var Sj=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var g8=Sj((j8,Ou)=>{function A0(e,t){for(var r=0;rn[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();var Oc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var O0={exports:{}},Od={},M0={exports:{}},Je={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ic=Symbol.for("react.element"),kj=Symbol.for("react.portal"),Cj=Symbol.for("react.fragment"),Ej=Symbol.for("react.strict_mode"),jj=Symbol.for("react.profiler"),Tj=Symbol.for("react.provider"),Nj=Symbol.for("react.context"),Rj=Symbol.for("react.forward_ref"),Pj=Symbol.for("react.suspense"),Dj=Symbol.for("react.memo"),Aj=Symbol.for("react.lazy"),ry=Symbol.iterator;function Oj(e){return e===null||typeof e!="object"?null:(e=ry&&e[ry]||e["@@iterator"],typeof e=="function"?e:null)}var I0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L0=Object.assign,F0={};function pa(e,t,r){this.props=e,this.context=t,this.refs=F0,this.updater=r||I0}pa.prototype.isReactComponent={};pa.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};pa.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function z0(){}z0.prototype=pa.prototype;function ym(e,t,r){this.props=e,this.context=t,this.refs=F0,this.updater=r||I0}var xm=ym.prototype=new z0;xm.constructor=ym;L0(xm,pa.prototype);xm.isPureReactComponent=!0;var ny=Array.isArray,U0=Object.prototype.hasOwnProperty,wm={current:null},V0={key:!0,ref:!0,__self:!0,__source:!0};function W0(e,t,r){var n,s={},i=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)U0.call(t,n)&&!V0.hasOwnProperty(n)&&(s[n]=t[n]);var a=arguments.length-2;if(a===1)s.children=r;else if(1>>1,V=Z[z];if(0>>1;zs(se,Q))Pes(fe,se)?(Z[z]=fe,Z[Pe]=Q,z=Pe):(Z[z]=se,Z[ne]=Q,z=ne);else if(Pes(fe,Q))Z[z]=fe,Z[Pe]=Q,z=Pe;else break e}}return I}function s(Z,I){var Q=Z.sortIndex-I.sortIndex;return Q!==0?Q:Z.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],d=1,f=null,g=3,h=!1,y=!1,m=!1,w=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(Z){for(var I=r(u);I!==null;){if(I.callback===null)n(u);else if(I.startTime<=Z)n(u),I.sortIndex=I.expirationTime,t(l,I);else break;I=r(u)}}function C(Z){if(m=!1,_(Z),!y)if(r(l)!==null)y=!0,te(E);else{var I=r(u);I!==null&&$(C,I.startTime-Z)}}function E(Z,I){y=!1,m&&(m=!1,v(D),D=-1),h=!0;var Q=g;try{for(_(I),f=r(l);f!==null&&(!(f.expirationTime>I)||Z&&!q());){var z=f.callback;if(typeof z=="function"){f.callback=null,g=f.priorityLevel;var V=z(f.expirationTime<=I);I=e.unstable_now(),typeof V=="function"?f.callback=V:f===r(l)&&n(l),_(I)}else n(l);f=r(l)}if(f!==null)var de=!0;else{var ne=r(u);ne!==null&&$(C,ne.startTime-I),de=!1}return de}finally{f=null,g=Q,h=!1}}var j=!1,R=null,D=-1,P=5,L=-1;function q(){return!(e.unstable_now()-LZ||125z?(Z.sortIndex=Q,t(u,Z),r(l)===null&&Z===r(u)&&(m?(v(D),D=-1):m=!0,$(C,Q-z))):(Z.sortIndex=V,t(l,Z),y||h||(y=!0,te(E))),Z},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(Z){var I=g;return function(){var Q=g;g=I;try{return Z.apply(this,arguments)}finally{g=Q}}}})(K0);Z0.exports=K0;var Hj=Z0.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Yj=x,Fr=Hj;function ie(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vh=Object.prototype.hasOwnProperty,Zj=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,iy={},oy={};function Kj(e){return Vh.call(oy,e)?!0:Vh.call(iy,e)?!1:Zj.test(e)?oy[e]=!0:(iy[e]=!0,!1)}function Gj(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function qj(e,t,r,n){if(t===null||typeof t>"u"||Gj(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function vr(e,t,r,n,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var rr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){rr[e]=new vr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];rr[t]=new vr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){rr[e]=new vr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){rr[e]=new vr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){rr[e]=new vr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){rr[e]=new vr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){rr[e]=new vr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){rr[e]=new vr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){rr[e]=new vr(e,5,!1,e.toLowerCase(),null,!1,!1)});var bm=/[\-:]([a-z])/g;function Sm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(bm,Sm);rr[t]=new vr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(bm,Sm);rr[t]=new vr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(bm,Sm);rr[t]=new vr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){rr[e]=new vr(e,1,!1,e.toLowerCase(),null,!1,!1)});rr.xlinkHref=new vr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){rr[e]=new vr(e,1,!1,e.toLowerCase(),null,!0,!0)});function km(e,t,r,n){var s=rr.hasOwnProperty(t)?rr[t]:null;(s!==null?s.type!==0:n||!(2a||s[o]!==i[a]){var l=` `+s[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{Hf=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ha(e):""}function Xj(e){switch(e.tag){case 5:return Ha(e.type);case 16:return Ha("Lazy");case 13:return Ha("Suspense");case 19:return Ha("SuspenseList");case 0:case 2:case 15:return e=Yf(e.type,!1),e;case 11:return e=Yf(e.type.render,!1),e;case 1:return e=Yf(e.type,!0),e;default:return""}}function Hh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case wo:return"Fragment";case xo:return"Portal";case Wh:return"Profiler";case Cm:return"StrictMode";case $h:return"Suspense";case Bh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case X0:return(e.displayName||"Context")+".Consumer";case q0:return(e._context.displayName||"Context")+".Provider";case Em:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case jm:return t=e.displayName||null,t!==null?t:Hh(e.type)||"Memo";case zs:t=e._payload,e=e._init;try{return Hh(e(t))}catch{}}return null}function Qj(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Hh(t);case 8:return t===Cm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function si(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function J0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Jj(e){var t=J0(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Lc(e){e._valueTracker||(e._valueTracker=Jj(e))}function ew(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=J0(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Mu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Yh(e,t){var r=t.checked;return Mt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function ly(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=si(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function tw(e,t){t=t.checked,t!=null&&km(e,"checked",t,!1)}function Zh(e,t){tw(e,t);var r=si(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Kh(e,t.type,r):t.hasOwnProperty("defaultValue")&&Kh(e,t.type,si(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function cy(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Kh(e,t,r){(t!=="number"||Mu(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ya=Array.isArray;function zo(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Fc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function yl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var nl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},eT=["Webkit","ms","Moz","O"];Object.keys(nl).forEach(function(e){eT.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),nl[t]=nl[e]})});function iw(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||nl.hasOwnProperty(e)&&nl[e]?(""+t).trim():t+"px"}function ow(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=iw(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var tT=Mt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Xh(e,t){if(t){if(tT[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ie(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ie(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ie(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ie(62))}}function Qh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Jh=null;function Tm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ep=null,Uo=null,Vo=null;function fy(e){if(e=lc(e)){if(typeof ep!="function")throw Error(ie(280));var t=e.stateNode;t&&(t=zd(t),ep(e.stateNode,e.type,t))}}function aw(e){Uo?Vo?Vo.push(e):Vo=[e]:Uo=e}function lw(){if(Uo){var e=Uo,t=Vo;if(Vo=Uo=null,fy(e),t)for(e=0;e>>=0,e===0?32:31-(fT(e)/hT|0)|0}var zc=64,Uc=4194304;function Za(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zu(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var a=o&~s;a!==0?n=Za(a):(i&=o,i!==0&&(n=Za(i)))}else o=r&~s,o!==0?n=Za(o):i!==0&&(n=Za(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function oc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pn(t),e[t]=r}function vT(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=il),_y=" ",by=!1;function Tw(e,t){switch(e){case"keyup":return HT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _o=!1;function ZT(e,t){switch(e){case"compositionend":return Nw(t);case"keypress":return t.which!==32?null:(by=!0,_y);case"textInput":return e=t.data,e===_y&&by?null:e;default:return null}}function KT(e,t){if(_o)return e==="compositionend"||!Im&&Tw(e,t)?(e=Ew(),mu=Am=Bs=null,_o=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ey(r)}}function Aw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Aw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ow(){for(var e=window,t=Mu();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Mu(e.document)}return t}function Lm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function nN(e){var t=Ow(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Aw(r.ownerDocument.documentElement,r)){if(n!==null&&Lm(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,i=Math.min(n.start,s);n=n.end===void 0?i:Math.min(n.end,s),!e.extend&&i>n&&(s=n,n=i,i=s),s=jy(r,i);var o=jy(r,n);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,bo=null,op=null,al=null,ap=!1;function Ty(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;ap||bo==null||bo!==Mu(n)||(n=bo,"selectionStart"in n&&Lm(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),al&&kl(al,n)||(al=n,n=Wu(op,"onSelect"),0Co||(e.current=hp[Co],hp[Co]=null,Co--)}function yt(e,t){Co++,hp[Co]=e.current,e.current=t}var ii={},lr=mi(ii),Sr=mi(!1),Ui=ii;function ta(e,t){var r=e.type.contextTypes;if(!r)return ii;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in r)s[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function kr(e){return e=e.childContextTypes,e!=null}function Bu(){bt(Sr),bt(lr)}function My(e,t,r){if(lr.current!==ii)throw Error(ie(168));yt(lr,t),yt(Sr,r)}function $w(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(ie(108,Qj(e)||"Unknown",s));return Mt({},r,n)}function Hu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ii,Ui=lr.current,yt(lr,e),yt(Sr,Sr.current),!0}function Iy(e,t,r){var n=e.stateNode;if(!n)throw Error(ie(169));r?(e=$w(e,t,Ui),n.__reactInternalMemoizedMergedChildContext=e,bt(Sr),bt(lr),yt(lr,e)):bt(Sr),yt(Sr,r)}var os=null,Ud=!1,oh=!1;function Bw(e){os===null?os=[e]:os.push(e)}function mN(e){Ud=!0,Bw(e)}function gi(){if(!oh&&os!==null){oh=!0;var e=0,t=ht;try{var r=os;for(ht=1;e>=o,s-=o,as=1<<32-pn(t)+s|r<D?(P=R,R=null):P=R.sibling;var L=g(v,R,_[D],C);if(L===null){R===null&&(R=P);break}e&&R&&L.alternate===null&&t(v,R),p=i(L,p,D),j===null?E=L:j.sibling=L,j=L,R=P}if(D===_.length)return r(v,R),Nt&&ki(v,D),E;if(R===null){for(;D<_.length;D++)R=f(v,_[D],C),R!==null&&(p=i(R,p,D),j===null?E=R:j.sibling=R,j=R);return Nt&&ki(v,D),E}for(R=n(v,R);D<_.length;D++)P=h(R,v,D,_[D],C),P!==null&&(e&&P.alternate!==null&&R.delete(P.key===null?D:P.key),p=i(P,p,D),j===null?E=P:j.sibling=P,j=P);return e&&R.forEach(function(q){return t(v,q)}),Nt&&ki(v,D),E}function m(v,p,_,C){var E=Na(_);if(typeof E!="function")throw Error(ie(150));if(_=E.call(_),_==null)throw Error(ie(151));for(var j=E=null,R=p,D=p=0,P=null,L=_.next();R!==null&&!L.done;D++,L=_.next()){R.index>D?(P=R,R=null):P=R.sibling;var q=g(v,R,L.value,C);if(q===null){R===null&&(R=P);break}e&&R&&q.alternate===null&&t(v,R),p=i(q,p,D),j===null?E=q:j.sibling=q,j=q,R=P}if(L.done)return r(v,R),Nt&&ki(v,D),E;if(R===null){for(;!L.done;D++,L=_.next())L=f(v,L.value,C),L!==null&&(p=i(L,p,D),j===null?E=L:j.sibling=L,j=L);return Nt&&ki(v,D),E}for(R=n(v,R);!L.done;D++,L=_.next())L=h(R,v,D,L.value,C),L!==null&&(e&&L.alternate!==null&&R.delete(L.key===null?D:L.key),p=i(L,p,D),j===null?E=L:j.sibling=L,j=L);return e&&R.forEach(function(T){return t(v,T)}),Nt&&ki(v,D),E}function w(v,p,_,C){if(typeof _=="object"&&_!==null&&_.type===wo&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Ic:e:{for(var E=_.key,j=p;j!==null;){if(j.key===E){if(E=_.type,E===wo){if(j.tag===7){r(v,j.sibling),p=s(j,_.props.children),p.return=v,v=p;break e}}else if(j.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===zs&&zy(E)===j.type){r(v,j.sibling),p=s(j,_.props),p.ref=Oa(v,j,_),p.return=v,v=p;break e}r(v,j);break}else t(v,j);j=j.sibling}_.type===wo?(p=Ii(_.props.children,v.mode,C,_.key),p.return=v,v=p):(C=Su(_.type,_.key,_.props,null,v.mode,C),C.ref=Oa(v,p,_),C.return=v,v=C)}return o(v);case xo:e:{for(j=_.key;p!==null;){if(p.key===j)if(p.tag===4&&p.stateNode.containerInfo===_.containerInfo&&p.stateNode.implementation===_.implementation){r(v,p.sibling),p=s(p,_.children||[]),p.return=v,v=p;break e}else{r(v,p);break}else t(v,p);p=p.sibling}p=ph(_,v.mode,C),p.return=v,v=p}return o(v);case zs:return j=_._init,w(v,p,j(_._payload),C)}if(Ya(_))return y(v,p,_,C);if(Na(_))return m(v,p,_,C);Zc(v,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,p!==null&&p.tag===6?(r(v,p.sibling),p=s(p,_),p.return=v,v=p):(r(v,p),p=hh(_,v.mode,C),p.return=v,v=p),o(v)):r(v,p)}return w}var na=Kw(!0),Gw=Kw(!1),Ku=mi(null),Gu=null,To=null,Vm=null;function Wm(){Vm=To=Gu=null}function $m(e){var t=Ku.current;bt(Ku),e._currentValue=t}function gp(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function $o(e,t){Gu=e,Vm=To=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(br=!0),e.firstContext=null)}function qr(e){var t=e._currentValue;if(Vm!==e)if(e={context:e,memoizedValue:t,next:null},To===null){if(Gu===null)throw Error(ie(308));To=e,Gu.dependencies={lanes:0,firstContext:e}}else To=To.next=e;return t}var Ti=null;function Bm(e){Ti===null?Ti=[e]:Ti.push(e)}function qw(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Bm(t)):(r.next=s.next,s.next=r),t.interleaved=r,vs(e,n)}function vs(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Us=!1;function Hm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ds(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Js(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ot&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,vs(e,r)}return s=n.interleaved,s===null?(t.next=t,Bm(n)):(t.next=s.next,s.next=t),n.interleaved=t,vs(e,r)}function vu(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Rm(e,r)}}function Uy(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?s=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?s=i=t:i=i.next=t}else s=i=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function qu(e,t,r,n){var s=e.updateQueue;Us=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;o=0,d=u=l=null,a=i;do{var g=a.lane,h=a.eventTime;if((n&g)===g){d!==null&&(d=d.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,m=a;switch(g=t,h=r,m.tag){case 1:if(y=m.payload,typeof y=="function"){f=y.call(h,f,g);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=m.payload,g=typeof y=="function"?y.call(h,f,g):y,g==null)break e;f=Mt({},f,g);break e;case 2:Us=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,g=s.effects,g===null?s.effects=[a]:g.push(a))}else h={eventTime:h,lane:g,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=h,l=f):d=d.next=h,o|=g;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;g=a,a=g.next,g.next=null,s.lastBaseUpdate=g,s.shared.pending=null}}while(!0);if(d===null&&(l=f),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);$i|=o,e.lanes=o,e.memoizedState=f}}function Vy(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=lh.transition;lh.transition={};try{e(!1),t()}finally{ht=r,lh.transition=n}}function p_(){return Xr().memoizedState}function xN(e,t,r){var n=ti(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},m_(e))g_(t,r);else if(r=qw(e,t,r,n),r!==null){var s=pr();mn(r,e,n,s),v_(r,t,n)}}function wN(e,t,r){var n=ti(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(m_(e))g_(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,r);if(s.hasEagerState=!0,s.eagerState=a,vn(a,o)){var l=t.interleaved;l===null?(s.next=s,Bm(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}r=qw(e,t,s,n),r!==null&&(s=pr(),mn(r,e,n,s),v_(r,t,n))}}function m_(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function g_(e,t){ll=Qu=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function v_(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Rm(e,r)}}var Ju={readContext:qr,useCallback:sr,useContext:sr,useEffect:sr,useImperativeHandle:sr,useInsertionEffect:sr,useLayoutEffect:sr,useMemo:sr,useReducer:sr,useRef:sr,useState:sr,useDebugValue:sr,useDeferredValue:sr,useTransition:sr,useMutableSource:sr,useSyncExternalStore:sr,useId:sr,unstable_isNewReconciler:!1},_N={readContext:qr,useCallback:function(e,t){return Rn().memoizedState=[e,t===void 0?null:t],e},useContext:qr,useEffect:$y,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,xu(4194308,4,c_.bind(null,t,e),r)},useLayoutEffect:function(e,t){return xu(4194308,4,e,t)},useInsertionEffect:function(e,t){return xu(4,2,e,t)},useMemo:function(e,t){var r=Rn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Rn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=xN.bind(null,Ot,e),[n.memoizedState,e]},useRef:function(e){var t=Rn();return e={current:e},t.memoizedState=e},useState:Wy,useDebugValue:Jm,useDeferredValue:function(e){return Rn().memoizedState=e},useTransition:function(){var e=Wy(!1),t=e[0];return e=yN.bind(null,e[1]),Rn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ot,s=Rn();if(Nt){if(r===void 0)throw Error(ie(407));r=r()}else{if(r=t(),Qt===null)throw Error(ie(349));Wi&30||t_(n,t,r)}s.memoizedState=r;var i={value:r,getSnapshot:t};return s.queue=i,$y(n_.bind(null,n,i,e),[e]),n.flags|=2048,Dl(9,r_.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Rn(),t=Qt.identifierPrefix;if(Nt){var r=ls,n=as;r=(n&~(1<<32-pn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Rl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Pn]=t,e[jl]=n,j_(e,t,!1,!1),t.stateNode=e;e:{switch(o=Qh(r,n),r){case"dialog":_t("cancel",e),_t("close",e),s=n;break;case"iframe":case"object":case"embed":_t("load",e),s=n;break;case"video":case"audio":for(s=0;soa&&(t.flags|=128,n=!0,Ma(i,!1),t.lanes=4194304)}else{if(!n)if(e=Xu(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ma(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Nt)return ir(t),null}else 2*Ut()-i.renderingStartTime>oa&&r!==1073741824&&(t.flags|=128,n=!0,Ma(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ut(),t.sibling=null,r=Dt.current,yt(Dt,n?r&1|2:r&1),t):(ir(t),null);case 22:case 23:return ig(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Rr&1073741824&&(ir(t),t.subtreeFlags&6&&(t.flags|=8192)):ir(t),null;case 24:return null;case 25:return null}throw Error(ie(156,t.tag))}function NN(e,t){switch(zm(t),t.tag){case 1:return kr(t.type)&&Bu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return sa(),bt(Sr),bt(lr),Km(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zm(t),null;case 13:if(bt(Dt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ie(340));ra()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return bt(Dt),null;case 4:return sa(),null;case 10:return $m(t.type._context),null;case 22:case 23:return ig(),null;case 24:return null;default:return null}}var Gc=!1,or=!1,RN=typeof WeakSet=="function"?WeakSet:Set,be=null;function No(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Lt(e,t,n)}else r.current=null}function Cp(e,t,r){try{r()}catch(n){Lt(e,t,n)}}var ex=!1;function PN(e,t){if(lp=Uu,e=Ow(),Lm(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,u=0,d=0,f=e,g=null;t:for(;;){for(var h;f!==r||s!==0&&f.nodeType!==3||(a=o+s),f!==i||n!==0&&f.nodeType!==3||(l=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)g=f,f=h;for(;;){if(f===e)break t;if(g===r&&++u===s&&(a=o),g===i&&++d===n&&(l=o),(h=f.nextSibling)!==null)break;f=g,g=f.parentNode}f=h}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},Uu=!1,be=t;be!==null;)if(t=be,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,be=e;else for(;be!==null;){t=be;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var m=y.memoizedProps,w=y.memoizedState,v=t.stateNode,p=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:an(t.type,m),w);v.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ie(163))}}catch(C){Lt(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,be=e;break}be=t.return}return y=ex,ex=!1,y}function cl(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Cp(t,r,i)}s=s.next}while(s!==n)}}function $d(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Ep(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function R_(e){var t=e.alternate;t!==null&&(e.alternate=null,R_(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Pn],delete t[jl],delete t[fp],delete t[hN],delete t[pN])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function P_(e){return e.tag===5||e.tag===3||e.tag===4}function tx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||P_(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function jp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=$u));else if(n!==4&&(e=e.child,e!==null))for(jp(e,t,r),e=e.sibling;e!==null;)jp(e,t,r),e=e.sibling}function Tp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Tp(e,t,r),e=e.sibling;e!==null;)Tp(e,t,r),e=e.sibling}var er=null,ln=!1;function Os(e,t,r){for(r=r.child;r!==null;)D_(e,t,r),r=r.sibling}function D_(e,t,r){if(Ln&&typeof Ln.onCommitFiberUnmount=="function")try{Ln.onCommitFiberUnmount(Md,r)}catch{}switch(r.tag){case 5:or||No(r,t);case 6:var n=er,s=ln;er=null,Os(e,t,r),er=n,ln=s,er!==null&&(ln?(e=er,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):er.removeChild(r.stateNode));break;case 18:er!==null&&(ln?(e=er,r=r.stateNode,e.nodeType===8?ih(e.parentNode,r):e.nodeType===1&&ih(e,r),bl(e)):ih(er,r.stateNode));break;case 4:n=er,s=ln,er=r.stateNode.containerInfo,ln=!0,Os(e,t,r),er=n,ln=s;break;case 0:case 11:case 14:case 15:if(!or&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Cp(r,t,o),s=s.next}while(s!==n)}Os(e,t,r);break;case 1:if(!or&&(No(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Lt(r,t,a)}Os(e,t,r);break;case 21:Os(e,t,r);break;case 22:r.mode&1?(or=(n=or)||r.memoizedState!==null,Os(e,t,r),or=n):Os(e,t,r);break;default:Os(e,t,r)}}function rx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new RN),t.forEach(function(n){var s=UN.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function on(e,t){var r=t.deletions;if(r!==null)for(var n=0;ns&&(s=o),n&=~i}if(n=s,n=Ut()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*AN(n/1960))-n,10e?16:e,Hs===null)var n=!1;else{if(e=Hs,Hs=null,rd=0,ot&6)throw Error(ie(331));var s=ot;for(ot|=4,be=e.current;be!==null;){var i=be,o=i.child;if(be.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lUt()-ng?Mi(e,0):rg|=r),Cr(e,t)}function U_(e,t){t===0&&(e.mode&1?(t=Uc,Uc<<=1,!(Uc&130023424)&&(Uc=4194304)):t=1);var r=pr();e=vs(e,t),e!==null&&(oc(e,t,r),Cr(e,r))}function zN(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),U_(e,r)}function UN(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ie(314))}n!==null&&n.delete(t),U_(e,r)}var V_;V_=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Sr.current)br=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return br=!1,jN(e,t,r);br=!!(e.flags&131072)}else br=!1,Nt&&t.flags&1048576&&Hw(t,Zu,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;wu(e,t),e=t.pendingProps;var s=ta(t,lr.current);$o(t,r),s=qm(null,t,n,e,s,r);var i=Xm();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,kr(n)?(i=!0,Hu(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Hm(t),s.updater=Wd,t.stateNode=s,s._reactInternals=t,yp(t,n,e,r),t=_p(null,t,n,!0,i,r)):(t.tag=0,Nt&&i&&Fm(t),fr(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(wu(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=WN(n),e=an(n,e),s){case 0:t=wp(null,t,n,e,r);break e;case 1:t=Xy(null,t,n,e,r);break e;case 11:t=Gy(null,t,n,e,r);break e;case 14:t=qy(null,t,n,an(n.type,e),r);break e}throw Error(ie(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:an(n,s),wp(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:an(n,s),Xy(e,t,n,s,r);case 3:e:{if(k_(t),e===null)throw Error(ie(387));n=t.pendingProps,i=t.memoizedState,s=i.element,Xw(e,t),qu(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=ia(Error(ie(423)),t),t=Qy(e,t,n,r,s);break e}else if(n!==s){s=ia(Error(ie(424)),t),t=Qy(e,t,n,r,s);break e}else for(Ar=Qs(t.stateNode.containerInfo.firstChild),Or=t,Nt=!0,un=null,r=Gw(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ra(),n===s){t=ys(e,t,r);break e}fr(e,t,n,r)}t=t.child}return t;case 5:return Qw(t),e===null&&mp(t),n=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,up(n,s)?o=null:i!==null&&up(n,i)&&(t.flags|=32),S_(e,t),fr(e,t,o,r),t.child;case 6:return e===null&&mp(t),null;case 13:return C_(e,t,r);case 4:return Ym(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=na(t,null,n,r):fr(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:an(n,s),Gy(e,t,n,s,r);case 7:return fr(e,t,t.pendingProps,r),t.child;case 8:return fr(e,t,t.pendingProps.children,r),t.child;case 12:return fr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,yt(Ku,n._currentValue),n._currentValue=o,i!==null)if(vn(i.value,o)){if(i.children===s.children&&!Sr.current){t=ys(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=ds(-1,r&-r),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),gp(i.return,r,t),a.lanes|=r;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(ie(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),gp(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}fr(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,$o(t,r),s=qr(s),n=n(s),t.flags|=1,fr(e,t,n,r),t.child;case 14:return n=t.type,s=an(n,t.pendingProps),s=an(n.type,s),qy(e,t,n,s,r);case 15:return __(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:an(n,s),wu(e,t),t.tag=1,kr(n)?(e=!0,Hu(t)):e=!1,$o(t,r),y_(t,n,s),yp(t,n,s,r),_p(null,t,n,!0,e,r);case 19:return E_(e,t,r);case 22:return b_(e,t,r)}throw Error(ie(156,t.tag))};function W_(e,t){return mw(e,t)}function VN(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zr(e,t,r,n){return new VN(e,t,r,n)}function ag(e){return e=e.prototype,!(!e||!e.isReactComponent)}function WN(e){if(typeof e=="function")return ag(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Em)return 11;if(e===jm)return 14}return 2}function ri(e,t){var r=e.alternate;return r===null?(r=Zr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Su(e,t,r,n,s,i){var o=2;if(n=e,typeof e=="function")ag(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case wo:return Ii(r.children,s,i,t);case Cm:o=8,s|=8;break;case Wh:return e=Zr(12,r,t,s|2),e.elementType=Wh,e.lanes=i,e;case $h:return e=Zr(13,r,t,s),e.elementType=$h,e.lanes=i,e;case Bh:return e=Zr(19,r,t,s),e.elementType=Bh,e.lanes=i,e;case Q0:return Hd(r,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case q0:o=10;break e;case X0:o=9;break e;case Em:o=11;break e;case jm:o=14;break e;case zs:o=16,n=null;break e}throw Error(ie(130,e==null?e:typeof e,""))}return t=Zr(o,r,t,s),t.elementType=e,t.type=n,t.lanes=i,t}function Ii(e,t,r,n){return e=Zr(7,e,n,t),e.lanes=r,e}function Hd(e,t,r,n){return e=Zr(22,e,n,t),e.elementType=Q0,e.lanes=r,e.stateNode={isHidden:!1},e}function hh(e,t,r){return e=Zr(6,e,null,t),e.lanes=r,e}function ph(e,t,r){return t=Zr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function $N(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Kf(0),this.expirationTimes=Kf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kf(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function lg(e,t,r,n,s,i,o,a,l){return e=new $N(e,t,r,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Zr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hm(i),e}function BN(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Y_)}catch(e){console.error(e)}}Y_(),Y0.exports=zr;var Cs=Y0.exports;const Z_=vm(Cs),GN=A0({__proto__:null,default:Z_},[Cs]);var ux=Cs;Uh.createRoot=ux.createRoot,Uh.hydrateRoot=ux.hydrateRoot;/** * @remix-run/router v1.18.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Pt(){return Pt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Hi(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function XN(){return Math.random().toString(36).substr(2,8)}function fx(e,t){return{usr:e.state,key:e.key,idx:t}}function Ol(e,t,r,n){return r===void 0&&(r=null),Pt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Es(t):t,{state:r,key:t&&t.key||n||XN()})}function Yi(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Es(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function QN(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:i=!1}=n,o=s.history,a=Wt.Pop,l=null,u=d();u==null&&(u=0,o.replaceState(Pt({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){a=Wt.Pop;let w=d(),v=w==null?null:w-u;u=w,l&&l({action:a,location:m.location,delta:v})}function g(w,v){a=Wt.Push;let p=Ol(m.location,w,v);r&&r(p,w),u=d()+1;let _=fx(p,u),C=m.createHref(p);try{o.pushState(_,"",C)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(C)}i&&l&&l({action:a,location:m.location,delta:1})}function h(w,v){a=Wt.Replace;let p=Ol(m.location,w,v);r&&r(p,w),u=d();let _=fx(p,u),C=m.createHref(p);o.replaceState(_,"",C),i&&l&&l({action:a,location:m.location,delta:0})}function y(w){let v=s.location.origin!=="null"?s.location.origin:s.location.href,p=typeof w=="string"?w:Yi(w);return p=p.replace(/ $/,"%20"),Qe(v,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,v)}let m={get action(){return a},get location(){return e(s,o)},listen(w){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(dx,f),l=w,()=>{s.removeEventListener(dx,f),l=null}},createHref(w){return t(s,w)},createURL:y,encodeLocation(w){let v=y(w);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:g,replace:h,go(w){return o.go(w)}};return m}var vt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(vt||(vt={}));const JN=new Set(["lazy","caseSensitive","path","id","index","children"]);function e2(e){return e.index===!0}function Ml(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((s,i)=>{let o=[...r,String(i)],a=typeof s.id=="string"?s.id:o.join("-");if(Qe(s.index!==!0||!s.children,"Cannot specify children on an index route"),Qe(!n[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),e2(s)){let l=Pt({},s,t(s),{id:a});return n[a]=l,l}else{let l=Pt({},s,t(s),{id:a,children:void 0});return n[a]=l,s.children&&(l.children=Ml(s.children,t,o,n)),l}})}function Ei(e,t,r){return r===void 0&&(r="/"),ku(e,t,r,!1)}function ku(e,t,r,n){let s=typeof t=="string"?Es(t):t,i=va(s.pathname||"/",r);if(i==null)return null;let o=K_(e);r2(o);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(Qe(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=fs([n,l.relativePath]),d=r.concat(l);i.children&&i.children.length>0&&(Qe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),K_(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:c2(u,i.index),routesMeta:d})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of G_(i.path))s(i,o,l)}),t}function G_(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return s?[i,""]:[i];let o=G_(n.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function r2(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:u2(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const n2=/^:[\w-]+$/,s2=3,i2=2,o2=1,a2=10,l2=-2,hx=e=>e==="*";function c2(e,t){let r=e.split("/"),n=r.length;return r.some(hx)&&(n+=l2),t&&(n+=i2),r.filter(s=>!hx(s)).reduce((s,i)=>s+(n2.test(i)?s2:i===""?o2:a2),n)}function u2(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function d2(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,s={},i="/",o=[];for(let a=0;a{let{paramName:g,isOptional:h}=d;if(g==="*"){let m=a[f]||"";o=i.slice(0,i.length-m.length).replace(/(.)\/+$/,"$1")}const y=a[f];return h&&!y?u[g]=void 0:u[g]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function f2(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Hi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function h2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Hi(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function va(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function p2(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?Es(e):e;return{pathname:r?r.startsWith("/")?r:m2(r,t):t,search:v2(n),hash:y2(s)}}function m2(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function mh(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function q_(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function qd(e,t){let r=q_(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Xd(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=Es(e):(s=Pt({},e),Qe(!s.pathname||!s.pathname.includes("?"),mh("?","pathname","search",s)),Qe(!s.pathname||!s.pathname.includes("#"),mh("#","pathname","hash",s)),Qe(!s.search||!s.search.includes("#"),mh("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),f-=1;s.pathname=g.join("/")}a=f>=0?t[f]:"/"}let l=p2(s,a),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const fs=e=>e.join("/").replace(/\/\/+/g,"/"),g2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),v2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,y2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class fg{constructor(t,r,n,s){s===void 0&&(s=!1),this.status=t,this.statusText=r||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function Qd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const X_=["post","put","patch","delete"],x2=new Set(X_),w2=["get",...X_],_2=new Set(w2),b2=new Set([301,302,303,307,308]),S2=new Set([307,308]),gh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},k2={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},La={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},hg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,C2=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Q_="remix-router-transitions";function E2(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;Qe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(e.mapRouteProperties)s=e.mapRouteProperties;else if(e.detectErrorBoundary){let U=e.detectErrorBoundary;s=B=>({hasErrorBoundary:U(B)})}else s=C2;let i={},o=Ml(e.routes,s,void 0,i),a,l=e.basename||"/",u=e.unstable_dataStrategy||P2,d=e.unstable_patchRoutesOnMiss,f=Pt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),g=null,h=new Set,y=null,m=null,w=null,v=e.hydrationData!=null,p=Ei(o,e.history.location,l),_=null;if(p==null&&!d){let U=ur(404,{pathname:e.history.location.pathname}),{matches:B,route:G}=kx(o);p=B,_={[G.id]:U}}p&&d&&!e.hydrationData&&Wf(p,o,e.history.location.pathname).active&&(p=null);let C;if(!p)C=!1,p=[];else if(p.some(U=>U.route.lazy))C=!1;else if(!p.some(U=>U.route.loader))C=!0;else if(f.v7_partialHydration){let U=e.hydrationData?e.hydrationData.loaderData:null,B=e.hydrationData?e.hydrationData.errors:null,G=re=>re.route.loader?typeof re.route.loader=="function"&&re.route.loader.hydrate===!0?!1:U&&U[re.route.id]!==void 0||B&&B[re.route.id]!==void 0:!0;if(B){let re=p.findIndex(ye=>B[ye.route.id]!==void 0);C=p.slice(0,re+1).every(G)}else C=p.every(G)}else C=e.hydrationData!=null;let E,j={historyAction:e.history.action,location:e.history.location,matches:p,initialized:C,navigation:gh,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||_,fetchers:new Map,blockers:new Map},R=Wt.Pop,D=!1,P,L=!1,q=new Map,T=null,F=!1,b=!1,W=[],te=[],$=new Map,Z=0,I=-1,Q=new Map,z=new Set,V=new Map,de=new Map,ne=new Set,se=new Map,Pe=new Map,fe=new Map,ve=!1;function Se(){if(g=e.history.listen(U=>{let{action:B,location:G,delta:re}=U;if(ve){ve=!1;return}Hi(Pe.size===0||re!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ye=Nc({currentLocation:j.location,nextLocation:G,historyAction:B});if(ye&&re!=null){ve=!0,e.history.go(re*-1),so(ye,{state:"blocked",location:G,proceed(){so(ye,{state:"proceeding",proceed:void 0,reset:void 0,location:G}),e.history.go(re)},reset(){let Ee=new Map(j.blockers);Ee.set(ye,La),Ce({blockers:Ee})}});return}return K(B,G)}),r){B2(t,q);let U=()=>H2(t,q);t.addEventListener("pagehide",U),T=()=>t.removeEventListener("pagehide",U)}return j.initialized||K(Wt.Pop,j.location,{initialHydration:!0}),E}function Ie(){g&&g(),T&&T(),h.clear(),P&&P.abort(),j.fetchers.forEach((U,B)=>Bt(B)),j.blockers.forEach((U,B)=>Tc(B))}function De(U){return h.add(U),()=>h.delete(U)}function Ce(U,B){B===void 0&&(B={}),j=Pt({},j,U);let G=[],re=[];f.v7_fetcherPersist&&j.fetchers.forEach((ye,Ee)=>{ye.state==="idle"&&(ne.has(Ee)?re.push(Ee):G.push(Ee))}),[...h].forEach(ye=>ye(j,{deletedFetchers:re,unstable_viewTransitionOpts:B.viewTransitionOpts,unstable_flushSync:B.flushSync===!0})),f.v7_fetcherPersist&&(G.forEach(ye=>j.fetchers.delete(ye)),re.forEach(ye=>Bt(ye)))}function rt(U,B,G){var re,ye;let{flushSync:Ee}=G===void 0?{}:G,We=j.actionData!=null&&j.navigation.formMethod!=null&&cn(j.navigation.formMethod)&&j.navigation.state==="loading"&&((re=U.state)==null?void 0:re._isRedirect)!==!0,ce;B.actionData?Object.keys(B.actionData).length>0?ce=B.actionData:ce=null:We?ce=j.actionData:ce=null;let Ye=B.loaderData?bx(j.loaderData,B.loaderData,B.matches||[],B.errors):j.loaderData,Me=j.blockers;Me.size>0&&(Me=new Map(Me),Me.forEach((ft,gt)=>Me.set(gt,La)));let Le=D===!0||j.navigation.formMethod!=null&&cn(j.navigation.formMethod)&&((ye=U.state)==null?void 0:ye._isRedirect)!==!0;a&&(o=a,a=void 0),F||R===Wt.Pop||(R===Wt.Push?e.history.push(U,U.state):R===Wt.Replace&&e.history.replace(U,U.state));let pt;if(R===Wt.Pop){let ft=q.get(j.location.pathname);ft&&ft.has(U.pathname)?pt={currentLocation:j.location,nextLocation:U}:q.has(U.pathname)&&(pt={currentLocation:U,nextLocation:j.location})}else if(L){let ft=q.get(j.location.pathname);ft?ft.add(U.pathname):(ft=new Set([U.pathname]),q.set(j.location.pathname,ft)),pt={currentLocation:j.location,nextLocation:U}}Ce(Pt({},B,{actionData:ce,loaderData:Ye,historyAction:R,location:U,initialized:!0,navigation:gh,revalidation:"idle",restoreScrollPosition:ey(U,B.matches||j.matches),preventScrollReset:Le,blockers:Me}),{viewTransitionOpts:pt,flushSync:Ee===!0}),R=Wt.Pop,D=!1,L=!1,F=!1,b=!1,W=[],te=[]}async function k(U,B){if(typeof U=="number"){e.history.go(U);return}let G=Ap(j.location,j.matches,l,f.v7_prependBasename,U,f.v7_relativeSplatPath,B==null?void 0:B.fromRouteId,B==null?void 0:B.relative),{path:re,submission:ye,error:Ee}=mx(f.v7_normalizeFormMethod,!1,G,B),We=j.location,ce=Ol(j.location,re,B&&B.state);ce=Pt({},ce,e.history.encodeLocation(ce));let Ye=B&&B.replace!=null?B.replace:void 0,Me=Wt.Push;Ye===!0?Me=Wt.Replace:Ye===!1||ye!=null&&cn(ye.formMethod)&&ye.formAction===j.location.pathname+j.location.search&&(Me=Wt.Replace);let Le=B&&"preventScrollReset"in B?B.preventScrollReset===!0:void 0,pt=(B&&B.unstable_flushSync)===!0,ft=Nc({currentLocation:We,nextLocation:ce,historyAction:Me});if(ft){so(ft,{state:"blocked",location:ce,proceed(){so(ft,{state:"proceeding",proceed:void 0,reset:void 0,location:ce}),k(U,B)},reset(){let gt=new Map(j.blockers);gt.set(ft,La),Ce({blockers:gt})}});return}return await K(Me,ce,{submission:ye,pendingError:Ee,preventScrollReset:Le,replace:B&&B.replace,enableViewTransition:B&&B.unstable_viewTransition,flushSync:pt})}function J(){if(Be(),Ce({revalidation:"loading"}),j.navigation.state!=="submitting"){if(j.navigation.state==="idle"){K(j.historyAction,j.location,{startUninterruptedRevalidation:!0});return}K(R||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation})}}async function K(U,B,G){P&&P.abort(),P=null,R=U,F=(G&&G.startUninterruptedRevalidation)===!0,xj(j.location,j.matches),D=(G&&G.preventScrollReset)===!0,L=(G&&G.enableViewTransition)===!0;let re=a||o,ye=G&&G.overrideNavigation,Ee=Ei(re,B,l),We=(G&&G.flushSync)===!0,ce=Wf(Ee,re,B.pathname);if(ce.active&&ce.matches&&(Ee=ce.matches),!Ee){let{error:ut,notFoundMatches:Jt,route:Vt}=io(B.pathname);rt(B,{matches:Jt,loaderData:{},errors:{[Vt.id]:ut}},{flushSync:We});return}if(j.initialized&&!b&&L2(j.location,B)&&!(G&&G.submission&&cn(G.submission.formMethod))){rt(B,{matches:Ee},{flushSync:We});return}P=new AbortController;let Ye=uo(e.history,B,P.signal,G&&G.submission),Me;if(G&&G.pendingError)Me=[Po(Ee).route.id,{type:vt.error,error:G.pendingError}];else if(G&&G.submission&&cn(G.submission.formMethod)){let ut=await A(Ye,B,G.submission,Ee,ce.active,{replace:G.replace,flushSync:We});if(ut.shortCircuited)return;if(ut.pendingActionResult){let[Jt,Vt]=ut.pendingActionResult;if(Pr(Vt)&&Qd(Vt.error)&&Vt.error.status===404){P=null,rt(B,{matches:ut.matches,loaderData:{},errors:{[Jt]:Vt.error}});return}}Ee=ut.matches||Ee,Me=ut.pendingActionResult,ye=vh(B,G.submission),We=!1,ce.active=!1,Ye=uo(e.history,Ye.url,Ye.signal)}let{shortCircuited:Le,matches:pt,loaderData:ft,errors:gt}=await S(Ye,B,Ee,ce.active,ye,G&&G.submission,G&&G.fetcherSubmission,G&&G.replace,G&&G.initialHydration===!0,We,Me);Le||(P=null,rt(B,Pt({matches:pt||Ee},Sx(Me),{loaderData:ft,errors:gt})))}async function A(U,B,G,re,ye,Ee){Ee===void 0&&(Ee={}),Be();let We=W2(B,G);if(Ce({navigation:We},{flushSync:Ee.flushSync===!0}),ye){let Me=await Rc(re,B.pathname,U.signal);if(Me.type==="aborted")return{shortCircuited:!0};if(Me.type==="error"){let{boundaryId:Le,error:pt}=jn(B.pathname,Me);return{matches:Me.partialMatches,pendingActionResult:[Le,{type:vt.error,error:pt}]}}else if(Me.matches)re=Me.matches;else{let{notFoundMatches:Le,error:pt,route:ft}=io(B.pathname);return{matches:Le,pendingActionResult:[ft.id,{type:vt.error,error:pt}]}}}let ce,Ye=Ga(re,B);if(!Ye.route.action&&!Ye.route.lazy)ce={type:vt.error,error:ur(405,{method:U.method,pathname:B.pathname,routeId:Ye.route.id})};else if(ce=(await ee("action",U,[Ye],re))[0],U.signal.aborted)return{shortCircuited:!0};if(Pi(ce)){let Me;return Ee&&Ee.replace!=null?Me=Ee.replace:Me=xx(ce.response.headers.get("Location"),new URL(U.url),l)===j.location.pathname+j.location.search,await X(U,ce,{submission:G,replace:Me}),{shortCircuited:!0}}if(Ri(ce))throw ur(400,{type:"defer-action"});if(Pr(ce)){let Me=Po(re,Ye.route.id);return(Ee&&Ee.replace)!==!0&&(R=Wt.Push),{matches:re,pendingActionResult:[Me.route.id,ce]}}return{matches:re,pendingActionResult:[Ye.route.id,ce]}}async function S(U,B,G,re,ye,Ee,We,ce,Ye,Me,Le){let pt=ye||vh(B,Ee),ft=Ee||We||jx(pt),gt=!F&&(!f.v7_partialHydration||!Ye);if(re){if(gt){let It=N(Le);Ce(Pt({navigation:pt},It!==void 0?{actionData:It}:{}),{flushSync:Me})}let Ge=await Rc(G,B.pathname,U.signal);if(Ge.type==="aborted")return{shortCircuited:!0};if(Ge.type==="error"){let{boundaryId:It,error:jr}=jn(B.pathname,Ge);return{matches:Ge.partialMatches,loaderData:{},errors:{[It]:jr}}}else if(Ge.matches)G=Ge.matches;else{let{error:It,notFoundMatches:jr,route:jt}=io(B.pathname);return{matches:jr,loaderData:{},errors:{[jt.id]:It}}}}let ut=a||o,[Jt,Vt]=gx(e.history,j,G,ft,B,f.v7_partialHydration&&Ye===!0,f.v7_skipActionErrorRevalidation,b,W,te,ne,V,z,ut,l,Le);if(Ds(Ge=>!(G&&G.some(It=>It.route.id===Ge))||Jt&&Jt.some(It=>It.route.id===Ge)),I=++Z,Jt.length===0&&Vt.length===0){let Ge=Xn();return rt(B,Pt({matches:G,loaderData:{},errors:Le&&Pr(Le[1])?{[Le[0]]:Le[1].error}:null},Sx(Le),Ge?{fetchers:new Map(j.fetchers)}:{}),{flushSync:Me}),{shortCircuited:!0}}if(gt){let Ge={};if(!re){Ge.navigation=pt;let It=N(Le);It!==void 0&&(Ge.actionData=It)}Vt.length>0&&(Ge.fetchers=O(Vt)),Ce(Ge,{flushSync:Me})}Vt.forEach(Ge=>{$.has(Ge.key)&&it(Ge.key),Ge.controller&&$.set(Ge.key,Ge.controller)});let Ta=()=>Vt.forEach(Ge=>it(Ge.key));P&&P.signal.addEventListener("abort",Ta);let{loaderResults:As,fetcherResults:oo}=await he(j.matches,G,Jt,Vt,U);if(U.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",Ta),Vt.forEach(Ge=>$.delete(Ge.key));let ao=Cx([...As,...oo]);if(ao){if(ao.idx>=Jt.length){let Ge=Vt[ao.idx-Jt.length].key;z.add(Ge)}return await X(U,ao.result,{replace:ce}),{shortCircuited:!0}}let{loaderData:lo,errors:Tn}=_x(j,G,Jt,As,Le,Vt,oo,se);se.forEach((Ge,It)=>{Ge.subscribe(jr=>{(jr||Ge.done)&&se.delete(It)})}),f.v7_partialHydration&&Ye&&j.errors&&Object.entries(j.errors).filter(Ge=>{let[It]=Ge;return!Jt.some(jr=>jr.route.id===It)}).forEach(Ge=>{let[It,jr]=Ge;Tn=Object.assign(Tn||{},{[It]:jr})});let Pc=Xn(),Dc=$r(I),Ac=Pc||Dc||Vt.length>0;return Pt({matches:G,loaderData:lo,errors:Tn},Ac?{fetchers:new Map(j.fetchers)}:{})}function N(U){if(U&&!Pr(U[1]))return{[U[0]]:U[1].data};if(j.actionData)return Object.keys(j.actionData).length===0?null:j.actionData}function O(U){return U.forEach(B=>{let G=j.fetchers.get(B.key),re=Fa(void 0,G?G.data:void 0);j.fetchers.set(B.key,re)}),new Map(j.fetchers)}function Y(U,B,G,re){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");$.has(U)&&it(U);let ye=(re&&re.unstable_flushSync)===!0,Ee=a||o,We=Ap(j.location,j.matches,l,f.v7_prependBasename,G,f.v7_relativeSplatPath,B,re==null?void 0:re.relative),ce=Ei(Ee,We,l),Ye=Wf(ce,Ee,We);if(Ye.active&&Ye.matches&&(ce=Ye.matches),!ce){Et(U,B,ur(404,{pathname:We}),{flushSync:ye});return}let{path:Me,submission:Le,error:pt}=mx(f.v7_normalizeFormMethod,!0,We,re);if(pt){Et(U,B,pt,{flushSync:ye});return}let ft=Ga(ce,Me);if(D=(re&&re.preventScrollReset)===!0,Le&&cn(Le.formMethod)){M(U,B,Me,ft,ce,Ye.active,ye,Le);return}V.set(U,{routeId:B,path:Me}),H(U,B,Me,ft,ce,Ye.active,ye,Le)}async function M(U,B,G,re,ye,Ee,We,ce){Be(),V.delete(U);function Ye(jt){if(!jt.route.action&&!jt.route.lazy){let Qn=ur(405,{method:ce.formMethod,pathname:G,routeId:B});return Et(U,B,Qn,{flushSync:We}),!0}return!1}if(!Ee&&Ye(re))return;let Me=j.fetchers.get(U);ze(U,$2(ce,Me),{flushSync:We});let Le=new AbortController,pt=uo(e.history,G,Le.signal,ce);if(Ee){let jt=await Rc(ye,G,pt.signal);if(jt.type==="aborted")return;if(jt.type==="error"){let{error:Qn}=jn(G,jt);Et(U,B,Qn,{flushSync:We});return}else if(jt.matches){if(ye=jt.matches,re=Ga(ye,G),Ye(re))return}else{Et(U,B,ur(404,{pathname:G}),{flushSync:We});return}}$.set(U,Le);let ft=Z,ut=(await ee("action",pt,[re],ye))[0];if(pt.signal.aborted){$.get(U)===Le&&$.delete(U);return}if(f.v7_fetcherPersist&&ne.has(U)){if(Pi(ut)||Pr(ut)){ze(U,Ls(void 0));return}}else{if(Pi(ut))if($.delete(U),I>ft){ze(U,Ls(void 0));return}else return z.add(U),ze(U,Fa(ce)),X(pt,ut,{fetcherSubmission:ce});if(Pr(ut)){Et(U,B,ut.error);return}}if(Ri(ut))throw ur(400,{type:"defer-action"});let Jt=j.navigation.location||j.location,Vt=uo(e.history,Jt,Le.signal),Ta=a||o,As=j.navigation.state!=="idle"?Ei(Ta,j.navigation.location,l):j.matches;Qe(As,"Didn't find any matches after fetcher action");let oo=++Z;Q.set(U,oo);let ao=Fa(ce,ut.data);j.fetchers.set(U,ao);let[lo,Tn]=gx(e.history,j,As,ce,Jt,!1,f.v7_skipActionErrorRevalidation,b,W,te,ne,V,z,Ta,l,[re.route.id,ut]);Tn.filter(jt=>jt.key!==U).forEach(jt=>{let Qn=jt.key,ty=j.fetchers.get(Qn),bj=Fa(void 0,ty?ty.data:void 0);j.fetchers.set(Qn,bj),$.has(Qn)&&it(Qn),jt.controller&&$.set(Qn,jt.controller)}),Ce({fetchers:new Map(j.fetchers)});let Pc=()=>Tn.forEach(jt=>it(jt.key));Le.signal.addEventListener("abort",Pc);let{loaderResults:Dc,fetcherResults:Ac}=await he(j.matches,As,lo,Tn,Vt);if(Le.signal.aborted)return;Le.signal.removeEventListener("abort",Pc),Q.delete(U),$.delete(U),Tn.forEach(jt=>$.delete(jt.key));let Ge=Cx([...Dc,...Ac]);if(Ge){if(Ge.idx>=lo.length){let jt=Tn[Ge.idx-lo.length].key;z.add(jt)}return X(Vt,Ge.result)}let{loaderData:It,errors:jr}=_x(j,j.matches,lo,Dc,void 0,Tn,Ac,se);if(j.fetchers.has(U)){let jt=Ls(ut.data);j.fetchers.set(U,jt)}$r(oo),j.navigation.state==="loading"&&oo>I?(Qe(R,"Expected pending action"),P&&P.abort(),rt(j.navigation.location,{matches:As,loaderData:It,errors:jr,fetchers:new Map(j.fetchers)})):(Ce({errors:jr,loaderData:bx(j.loaderData,It,As,jr),fetchers:new Map(j.fetchers)}),b=!1)}async function H(U,B,G,re,ye,Ee,We,ce){let Ye=j.fetchers.get(U);ze(U,Fa(ce,Ye?Ye.data:void 0),{flushSync:We});let Me=new AbortController,Le=uo(e.history,G,Me.signal);if(Ee){let ut=await Rc(ye,G,Le.signal);if(ut.type==="aborted")return;if(ut.type==="error"){let{error:Jt}=jn(G,ut);Et(U,B,Jt,{flushSync:We});return}else if(ut.matches)ye=ut.matches,re=Ga(ye,G);else{Et(U,B,ur(404,{pathname:G}),{flushSync:We});return}}$.set(U,Me);let pt=Z,gt=(await ee("loader",Le,[re],ye))[0];if(Ri(gt)&&(gt=await n1(gt,Le.signal,!0)||gt),$.get(U)===Me&&$.delete(U),!Le.signal.aborted){if(ne.has(U)){ze(U,Ls(void 0));return}if(Pi(gt))if(I>pt){ze(U,Ls(void 0));return}else{z.add(U),await X(Le,gt);return}if(Pr(gt)){Et(U,B,gt.error);return}Qe(!Ri(gt),"Unhandled fetcher deferred data"),ze(U,Ls(gt.data))}}async function X(U,B,G){let{submission:re,fetcherSubmission:ye,replace:Ee}=G===void 0?{}:G;B.response.headers.has("X-Remix-Revalidate")&&(b=!0);let We=B.response.headers.get("Location");Qe(We,"Expected a Location header on the redirect Response"),We=xx(We,new URL(U.url),l);let ce=Ol(j.location,We,{_isRedirect:!0});if(r){let gt=!1;if(B.response.headers.has("X-Remix-Reload-Document"))gt=!0;else if(hg.test(We)){const ut=e.history.createURL(We);gt=ut.origin!==t.location.origin||va(ut.pathname,l)==null}if(gt){Ee?t.location.replace(We):t.location.assign(We);return}}P=null;let Ye=Ee===!0?Wt.Replace:Wt.Push,{formMethod:Me,formAction:Le,formEncType:pt}=j.navigation;!re&&!ye&&Me&&Le&&pt&&(re=jx(j.navigation));let ft=re||ye;if(S2.has(B.response.status)&&ft&&cn(ft.formMethod))await K(Ye,ce,{submission:Pt({},ft,{formAction:We}),preventScrollReset:D});else{let gt=vh(ce,re);await K(Ye,ce,{overrideNavigation:gt,fetcherSubmission:ye,preventScrollReset:D})}}async function ee(U,B,G,re){try{let ye=await D2(u,U,B,G,re,i,s);return await Promise.all(ye.map((Ee,We)=>{if(z2(Ee)){let ce=Ee.result;return{type:vt.redirect,response:M2(ce,B,G[We].route.id,re,l,f.v7_relativeSplatPath)}}return O2(Ee)}))}catch(ye){return G.map(()=>({type:vt.error,error:ye}))}}async function he(U,B,G,re,ye){let[Ee,...We]=await Promise.all([G.length?ee("loader",ye,G,B):[],...re.map(ce=>{if(ce.matches&&ce.match&&ce.controller){let Ye=uo(e.history,ce.path,ce.controller.signal);return ee("loader",Ye,[ce.match],ce.matches).then(Me=>Me[0])}else return Promise.resolve({type:vt.error,error:ur(404,{pathname:ce.path})})})]);return await Promise.all([Ex(U,G,Ee,Ee.map(()=>ye.signal),!1,j.loaderData),Ex(U,re.map(ce=>ce.match),We,re.map(ce=>ce.controller?ce.controller.signal:null),!0)]),{loaderResults:Ee,fetcherResults:We}}function Be(){b=!0,W.push(...Ds()),V.forEach((U,B)=>{$.has(B)&&(te.push(B),it(B))})}function ze(U,B,G){G===void 0&&(G={}),j.fetchers.set(U,B),Ce({fetchers:new Map(j.fetchers)},{flushSync:(G&&G.flushSync)===!0})}function Et(U,B,G,re){re===void 0&&(re={});let ye=Po(j.matches,B);Bt(U),Ce({errors:{[ye.route.id]:G},fetchers:new Map(j.fetchers)},{flushSync:(re&&re.flushSync)===!0})}function Wr(U){return f.v7_fetcherPersist&&(de.set(U,(de.get(U)||0)+1),ne.has(U)&&ne.delete(U)),j.fetchers.get(U)||k2}function Bt(U){let B=j.fetchers.get(U);$.has(U)&&!(B&&B.state==="loading"&&Q.has(U))&&it(U),V.delete(U),Q.delete(U),z.delete(U),ne.delete(U),j.fetchers.delete(U)}function Gn(U){if(f.v7_fetcherPersist){let B=(de.get(U)||0)-1;B<=0?(de.delete(U),ne.add(U)):de.set(U,B)}else Bt(U);Ce({fetchers:new Map(j.fetchers)})}function it(U){let B=$.get(U);Qe(B,"Expected fetch controller: "+U),B.abort(),$.delete(U)}function qn(U){for(let B of U){let G=Wr(B),re=Ls(G.data);j.fetchers.set(B,re)}}function Xn(){let U=[],B=!1;for(let G of z){let re=j.fetchers.get(G);Qe(re,"Expected fetcher: "+G),re.state==="loading"&&(z.delete(G),U.push(G),B=!0)}return qn(U),B}function $r(U){let B=[];for(let[G,re]of Q)if(re0}function jc(U,B){let G=j.blockers.get(U)||La;return Pe.get(U)!==B&&Pe.set(U,B),G}function Tc(U){j.blockers.delete(U),Pe.delete(U)}function so(U,B){let G=j.blockers.get(U)||La;Qe(G.state==="unblocked"&&B.state==="blocked"||G.state==="blocked"&&B.state==="blocked"||G.state==="blocked"&&B.state==="proceeding"||G.state==="blocked"&&B.state==="unblocked"||G.state==="proceeding"&&B.state==="unblocked","Invalid blocker state transition: "+G.state+" -> "+B.state);let re=new Map(j.blockers);re.set(U,B),Ce({blockers:re})}function Nc(U){let{currentLocation:B,nextLocation:G,historyAction:re}=U;if(Pe.size===0)return;Pe.size>1&&Hi(!1,"A router only supports one blocker at a time");let ye=Array.from(Pe.entries()),[Ee,We]=ye[ye.length-1],ce=j.blockers.get(Ee);if(!(ce&&ce.state==="proceeding")&&We({currentLocation:B,nextLocation:G,historyAction:re}))return Ee}function io(U){let B=ur(404,{pathname:U}),G=a||o,{matches:re,route:ye}=kx(G);return Ds(),{notFoundMatches:re,route:ye,error:B}}function jn(U,B){return{boundaryId:Po(B.partialMatches).route.id,error:ur(400,{type:"route-discovery",pathname:U,message:B.error!=null&&"message"in B.error?B.error:String(B.error)})}}function Ds(U){let B=[];return se.forEach((G,re)=>{(!U||U(re))&&(G.cancel(),B.push(re),se.delete(re))}),B}function yj(U,B,G){if(y=U,w=B,m=G||null,!v&&j.navigation===gh){v=!0;let re=ey(j.location,j.matches);re!=null&&Ce({restoreScrollPosition:re})}return()=>{y=null,w=null,m=null}}function Jv(U,B){return m&&m(U,B.map(re=>t2(re,j.loaderData)))||U.key}function xj(U,B){if(y&&w){let G=Jv(U,B);y[G]=w()}}function ey(U,B){if(y){let G=Jv(U,B),re=y[G];if(typeof re=="number")return re}return null}function Wf(U,B,G){if(d)if(U){let re=U[U.length-1].route;if(re.path&&(re.path==="*"||re.path.endsWith("/*")))return{active:!0,matches:ku(B,G,l,!0)}}else return{active:!0,matches:ku(B,G,l,!0)||[]};return{active:!1,matches:null}}async function Rc(U,B,G){let re=U,ye=re.length>0?re[re.length-1].route:null;for(;;){let Ee=a==null,We=a||o;try{await R2(d,B,re,We,i,s,fe,G)}catch(Le){return{type:"error",error:Le,partialMatches:re}}finally{Ee&&(o=[...o])}if(G.aborted)return{type:"aborted"};let ce=Ei(We,B,l),Ye=!1;if(ce){let Le=ce[ce.length-1].route;if(Le.index)return{type:"success",matches:ce};if(Le.path&&Le.path.length>0)if(Le.path==="*")Ye=!0;else return{type:"success",matches:ce}}let Me=ku(We,B,l,!0);if(!Me||re.map(Le=>Le.route.id).join("-")===Me.map(Le=>Le.route.id).join("-"))return{type:"success",matches:Ye?ce:null};if(re=Me,ye=re[re.length-1].route,ye.path==="*")return{type:"success",matches:re}}}function wj(U){i={},a=Ml(U,s,void 0,i)}function _j(U,B){let G=a==null;e1(U,B,a||o,i,s),G&&(o=[...o],Ce({}))}return E={get basename(){return l},get future(){return f},get state(){return j},get routes(){return o},get window(){return t},initialize:Se,subscribe:De,enableScrollRestoration:yj,navigate:k,fetch:Y,revalidate:J,createHref:U=>e.history.createHref(U),encodeLocation:U=>e.history.encodeLocation(U),getFetcher:Wr,deleteFetcher:Gn,dispose:Ie,getBlocker:jc,deleteBlocker:Tc,patchRoutes:_j,_internalFetchControllers:$,_internalActiveDeferreds:se,_internalSetRoutes:wj},E}function j2(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ap(e,t,r,n,s,i,o,a){let l,u;if(o){l=[];for(let f of t)if(l.push(f),f.route.id===o){u=f;break}}else l=t,u=t[t.length-1];let d=Xd(s||".",qd(l,i),va(e.pathname,r)||e.pathname,a==="path");return s==null&&(d.search=e.search,d.hash=e.hash),(s==null||s===""||s===".")&&u&&u.route.index&&!pg(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(d.pathname=d.pathname==="/"?r:fs([r,d.pathname])),Yi(d)}function mx(e,t,r,n){if(!n||!j2(n))return{path:r};if(n.formMethod&&!V2(n.formMethod))return{path:r,error:ur(405,{method:n.formMethod})};let s=()=>({path:r,error:ur(400,{type:"invalid-body"})}),i=n.formMethod||"get",o=e?i.toUpperCase():i.toLowerCase(),a=t1(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!cn(o))return s();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((h,y)=>{let[m,w]=y;return""+h+m+"="+w+` `},""):String(n.body);return{path:r,submission:{formMethod:o,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!cn(o))return s();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:o,formAction:a,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return s()}}}Qe(typeof FormData=="function","FormData is not available in this environment");let l,u;if(n.formData)l=Op(n.formData),u=n.formData;else if(n.body instanceof FormData)l=Op(n.body),u=n.body;else if(n.body instanceof URLSearchParams)l=n.body,u=wx(l);else if(n.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(n.body),u=wx(l)}catch{return s()}let d={formMethod:o,formAction:a,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(cn(d.formMethod))return{path:r,submission:d};let f=Es(r);return t&&f.search&&pg(f.search)&&l.append("index",""),f.search="?"+l,{path:Yi(f),submission:d}}function T2(e,t){let r=e;if(t){let n=e.findIndex(s=>s.route.id===t);n>=0&&(r=e.slice(0,n))}return r}function gx(e,t,r,n,s,i,o,a,l,u,d,f,g,h,y,m){let w=m?Pr(m[1])?m[1].error:m[1].data:void 0,v=e.createURL(t.location),p=e.createURL(s),_=m&&Pr(m[1])?m[0]:void 0,C=_?T2(r,_):r,E=m?m[1].statusCode:void 0,j=o&&E&&E>=400,R=C.filter((P,L)=>{let{route:q}=P;if(q.lazy)return!0;if(q.loader==null)return!1;if(i)return typeof q.loader!="function"||q.loader.hydrate?!0:t.loaderData[q.id]===void 0&&(!t.errors||t.errors[q.id]===void 0);if(N2(t.loaderData,t.matches[L],P)||l.some(b=>b===P.route.id))return!0;let T=t.matches[L],F=P;return vx(P,Pt({currentUrl:v,currentParams:T.params,nextUrl:p,nextParams:F.params},n,{actionResult:w,actionStatus:E,defaultShouldRevalidate:j?!1:a||v.pathname+v.search===p.pathname+p.search||v.search!==p.search||J_(T,F)}))}),D=[];return f.forEach((P,L)=>{if(i||!r.some(W=>W.route.id===P.routeId)||d.has(L))return;let q=Ei(h,P.path,y);if(!q){D.push({key:L,routeId:P.routeId,path:P.path,matches:null,match:null,controller:null});return}let T=t.fetchers.get(L),F=Ga(q,P.path),b=!1;g.has(L)?b=!1:u.includes(L)?b=!0:T&&T.state!=="idle"&&T.data===void 0?b=a:b=vx(F,Pt({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:p,nextParams:r[r.length-1].params},n,{actionResult:w,actionStatus:E,defaultShouldRevalidate:j?!1:a})),b&&D.push({key:L,routeId:P.routeId,path:P.path,matches:q,match:F,controller:new AbortController})}),[R,D]}function N2(e,t,r){let n=!t||r.route.id!==t.route.id,s=e[r.route.id]===void 0;return n||s}function J_(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function vx(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function R2(e,t,r,n,s,i,o,a){let l=[t,...r.map(u=>u.route.id)].join("-");try{let u=o.get(l);u||(u=e({path:t,matches:r,patch:(d,f)=>{a.aborted||e1(d,f,n,s,i)}}),o.set(l,u)),u&&F2(u)&&await u}finally{o.delete(l)}}function e1(e,t,r,n,s){if(e){var i;let o=n[e];Qe(o,"No route found to patch children into: routeId = "+e);let a=Ml(t,s,[e,"patch",String(((i=o.children)==null?void 0:i.length)||"0")],n);o.children?o.children.push(...a):o.children=a}else{let o=Ml(t,s,["patch",String(r.length||"0")],n);r.push(...o)}}async function yx(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let s=r[e.id];Qe(s,"No route found in manifest");let i={};for(let o in n){let l=s[o]!==void 0&&o!=="hasErrorBoundary";Hi(!l,'Route "'+s.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!l&&!JN.has(o)&&(i[o]=n[o])}Object.assign(s,i),Object.assign(s,Pt({},t(s),{lazy:void 0}))}function P2(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function D2(e,t,r,n,s,i,o,a){let l=n.reduce((f,g)=>f.add(g.route.id),new Set),u=new Set,d=await e({matches:s.map(f=>{let g=l.has(f.route.id);return Pt({},f,{shouldLoad:g,resolve:y=>(u.add(f.route.id),g?A2(t,r,f,i,o,y,a):Promise.resolve({type:vt.data,result:void 0}))})}),request:r,params:s[0].params,context:a});return s.forEach(f=>Qe(u.has(f.route.id),'`match.resolve()` was not called for route id "'+f.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),d.filter((f,g)=>l.has(s[g].route.id))}async function A2(e,t,r,n,s,i,o){let a,l,u=d=>{let f,g=new Promise((m,w)=>f=w);l=()=>f(),t.signal.addEventListener("abort",l);let h=m=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):d({request:t,params:r.params,context:o},...m!==void 0?[m]:[]),y;return i?y=i(m=>h(m)):y=(async()=>{try{return{type:"data",result:await h()}}catch(m){return{type:"error",result:m}}})(),Promise.race([y,g])};try{let d=r.route[e];if(r.route.lazy)if(d){let f,[g]=await Promise.all([u(d).catch(h=>{f=h}),yx(r.route,s,n)]);if(f!==void 0)throw f;a=g}else if(await yx(r.route,s,n),d=r.route[e],d)a=await u(d);else if(e==="action"){let f=new URL(t.url),g=f.pathname+f.search;throw ur(405,{method:t.method,pathname:g,routeId:r.route.id})}else return{type:vt.data,result:void 0};else if(d)a=await u(d);else{let f=new URL(t.url),g=f.pathname+f.search;throw ur(404,{pathname:g})}Qe(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:vt.error,result:d}}finally{l&&t.signal.removeEventListener("abort",l)}return a}async function O2(e){let{result:t,type:r,status:n}=e;if(r1(t)){let o;try{let a=t.headers.get("Content-Type");a&&/\bapplication\/json\b/.test(a)?t.body==null?o=null:o=await t.json():o=await t.text()}catch(a){return{type:vt.error,error:a}}return r===vt.error?{type:vt.error,error:new fg(t.status,t.statusText,o),statusCode:t.status,headers:t.headers}:{type:vt.data,data:o,statusCode:t.status,headers:t.headers}}if(r===vt.error)return{type:vt.error,error:t,statusCode:Qd(t)?t.status:n};if(U2(t)){var s,i;return{type:vt.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((i=t.init)==null?void 0:i.headers)&&new Headers(t.init.headers)}}return{type:vt.data,data:t,statusCode:n}}function M2(e,t,r,n,s,i){let o=e.headers.get("Location");if(Qe(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!hg.test(o)){let a=n.slice(0,n.findIndex(l=>l.route.id===r)+1);o=Ap(new URL(t.url),a,s,!0,o,i),e.headers.set("Location",o)}return e}function xx(e,t,r){if(hg.test(e)){let n=e,s=n.startsWith("//")?new URL(t.protocol+n):new URL(n),i=va(s.pathname,r)!=null;if(s.origin===t.origin&&i)return s.pathname+s.search+s.hash}return e}function uo(e,t,r,n){let s=e.createURL(t1(t)).toString(),i={signal:r};if(n&&cn(n.formMethod)){let{formMethod:o,formEncType:a}=n;i.method=o.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(n.json)):a==="text/plain"?i.body=n.text:a==="application/x-www-form-urlencoded"&&n.formData?i.body=Op(n.formData):i.body=n.formData}return new Request(s,i)}function Op(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function wx(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function I2(e,t,r,n,s,i){let o={},a=null,l,u=!1,d={},f=n&&Pr(n[1])?n[1].error:void 0;return r.forEach((g,h)=>{let y=t[h].route.id;if(Qe(!Pi(g),"Cannot handle redirect results in processLoaderData"),Pr(g)){let m=g.error;f!==void 0&&(m=f,f=void 0),a=a||{};{let w=Po(e,y);a[w.route.id]==null&&(a[w.route.id]=m)}o[y]=void 0,u||(u=!0,l=Qd(g.error)?g.error.status:500),g.headers&&(d[y]=g.headers)}else Ri(g)?(s.set(y,g.deferredData),o[y]=g.deferredData.data,g.statusCode!=null&&g.statusCode!==200&&!u&&(l=g.statusCode),g.headers&&(d[y]=g.headers)):(o[y]=g.data,g.statusCode&&g.statusCode!==200&&!u&&(l=g.statusCode),g.headers&&(d[y]=g.headers))}),f!==void 0&&n&&(a={[n[0]]:f},o[n[0]]=void 0),{loaderData:o,errors:a,statusCode:l||200,loaderHeaders:d}}function _x(e,t,r,n,s,i,o,a){let{loaderData:l,errors:u}=I2(t,r,n,s,a);for(let d=0;dn.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function kx(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ur(e,t){let{pathname:r,routeId:n,method:s,type:i,message:o}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",i==="route-discovery"?l='Unable to match URL "'+r+'" - the `unstable_patchRoutesOnMiss()` '+(`function threw the following error: `+o):s&&r&&n?l="You made a "+s+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":i==="defer-action"?l="defer() is not supported in actions":i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(a="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):e===404?(a="Not Found",l='No route matches URL "'+r+'"'):e===405&&(a="Method Not Allowed",s&&r&&n?l="You made a "+s.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":s&&(l='Invalid request method "'+s.toUpperCase()+'"')),new fg(e||500,a,new Error(l),!0)}function Cx(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Pi(r))return{result:r,idx:t}}}function t1(e){let t=typeof e=="string"?Es(e):e;return Yi(Pt({},t,{hash:""}))}function L2(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function F2(e){return typeof e=="object"&&e!=null&&"then"in e}function z2(e){return r1(e.result)&&b2.has(e.result.status)}function Ri(e){return e.type===vt.deferred}function Pr(e){return e.type===vt.error}function Pi(e){return(e&&e.type)===vt.redirect}function U2(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function r1(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function V2(e){return _2.has(e.toLowerCase())}function cn(e){return x2.has(e.toLowerCase())}async function Ex(e,t,r,n,s,i){for(let o=0;of.route.id===l.route.id),d=u!=null&&!J_(u,l)&&(i&&i[l.route.id])!==void 0;if(Ri(a)&&(s||d)){let f=n[o];Qe(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await n1(a,f,s).then(g=>{g&&(r[o]=g||r[o])})}}}async function n1(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:vt.data,data:e.deferredData.unwrappedData}}catch(s){return{type:vt.error,error:s}}return{type:vt.data,data:e.deferredData.data}}}function pg(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ga(e,t){let r=typeof t=="string"?Es(t).search:t.search;if(e[e.length-1].route.index&&pg(r||""))return e[e.length-1];let n=q_(e);return n[n.length-1]}function jx(e){let{formMethod:t,formAction:r,formEncType:n,text:s,formData:i,json:o}=e;if(!(!t||!r||!n)){if(s!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:s};if(i!=null)return{formMethod:t,formAction:r,formEncType:n,formData:i,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:o,text:void 0}}}function vh(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function W2(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Fa(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function $2(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Ls(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function B2(e,t){try{let r=e.sessionStorage.getItem(Q_);if(r){let n=JSON.parse(r);for(let[s,i]of Object.entries(n||{}))i&&Array.isArray(i)&&t.set(s,new Set(i||[]))}}catch{}}function H2(e,t){if(t.size>0){let r={};for(let[n,s]of t)r[n]=[...s];try{e.sessionStorage.setItem(Q_,JSON.stringify(r))}catch(n){Hi(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/** * React Router v6.25.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function id(){return id=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),x.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){n.go(u);return}let f=Xd(u,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:fs([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,o,i,e])}const K2=x.createContext(null);function G2(e){let t=x.useContext(js).outlet;return t&&x.createElement(K2.Provider,{value:e},t)}function a1(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=x.useContext(vi),{matches:s}=x.useContext(js),{pathname:i}=Hn(),o=JSON.stringify(qd(s,n.v7_relativeSplatPath));return x.useMemo(()=>Xd(e,JSON.parse(o),i,r==="path"),[e,o,i,r])}function q2(e,t,r,n){ya()||Qe(!1);let{navigator:s}=x.useContext(vi),{matches:i}=x.useContext(js),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Hn(),d;d=u;let f=d.pathname||"/",g=f;if(l!=="/"){let m=l.replace(/^\//,"").split("/");g="/"+f.replace(/^\//,"").split("/").slice(m.length).join("/")}let h=Ei(e,{pathname:g});return tR(h&&h.map(m=>Object.assign({},m,{params:Object.assign({},a,m.params),pathname:fs([l,s.encodeLocation?s.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?l:fs([l,s.encodeLocation?s.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),i,r,n)}function X2(){let e=iR(),t=Qd(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),r?x.createElement("pre",{style:s},r):null,null)}const Q2=x.createElement(X2,null);class J2 extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?x.createElement(js.Provider,{value:this.props.routeContext},x.createElement(i1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function eR(e){let{routeContext:t,match:r,children:n}=e,s=x.useContext(Jd);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),x.createElement(js.Provider,{value:t},n)}function tR(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if((i=r)!=null&&i.errors)e=r.matches;else return null}let o=e,a=(s=r)==null?void 0:s.errors;if(a!=null){let d=o.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||Qe(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,g)=>{let h,y=!1,m=null,w=null;r&&(h=a&&f.route.id?a[f.route.id]:void 0,m=f.route.errorElement||Q2,l&&(u<0&&g===0?(aR("route-fallback"),y=!0,w=null):u===g&&(y=!0,w=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,g+1)),p=()=>{let _;return h?_=m:y?_=w:f.route.Component?_=x.createElement(f.route.Component,null):f.route.element?_=f.route.element:_=d,x.createElement(eR,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:r!=null},children:_})};return r&&(f.route.ErrorBoundary||f.route.errorElement||g===0)?x.createElement(J2,{location:r.location,revalidation:r.revalidation,component:m,error:h,children:p(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):p()},null)}var l1=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(l1||{}),od=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(od||{});function rR(e){let t=x.useContext(Jd);return t||Qe(!1),t}function nR(e){let t=x.useContext(s1);return t||Qe(!1),t}function sR(e){let t=x.useContext(js);return t||Qe(!1),t}function c1(e){let t=sR(),r=t.matches[t.matches.length-1];return r.route.id||Qe(!1),r.route.id}function iR(){var e;let t=x.useContext(i1),r=nR(od.UseRouteError),n=c1(od.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function oR(){let{router:e}=rR(l1.UseNavigateStable),t=c1(od.UseNavigateStable),r=x.useRef(!1);return o1(()=>{r.current=!0}),x.useCallback(function(s,i){i===void 0&&(i={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,id({fromRouteId:t},i)))},[e,t])}const Tx={};function aR(e,t,r){Tx[e]||(Tx[e]=!0)}function u1(e){let{to:t,replace:r,state:n,relative:s}=e;ya()||Qe(!1);let{future:i,static:o}=x.useContext(vi),{matches:a}=x.useContext(js),{pathname:l}=Hn(),u=Sn(),d=Xd(t,qd(a,i.v7_relativeSplatPath),l,s==="path"),f=JSON.stringify(d);return x.useEffect(()=>u(JSON.parse(f),{replace:r,state:n,relative:s}),[u,f,s,r,n]),null}function gg(e){return G2(e.context)}function lR(e){let{basename:t="/",children:r=null,location:n,navigationType:s=Wt.Pop,navigator:i,static:o=!1,future:a}=e;ya()&&Qe(!1);let l=t.replace(/^\/*/,"/"),u=x.useMemo(()=>({basename:l,navigator:i,static:o,future:id({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof n=="string"&&(n=Es(n));let{pathname:d="/",search:f="",hash:g="",state:h=null,key:y="default"}=n,m=x.useMemo(()=>{let w=va(d,l);return w==null?null:{location:{pathname:w,search:f,hash:g,state:h,key:y},navigationType:s}},[l,d,f,g,h,y,s]);return m==null?null:x.createElement(vi.Provider,{value:u},x.createElement(mg.Provider,{children:r,value:m}))}new Promise(()=>{});function cR(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:x.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:x.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:x.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** * React Router DOM v6.25.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Il(){return Il=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[s]=e[s]);return r}function dR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function fR(e,t){return e.button===0&&(!t||t==="_self")&&!dR(e)}function Mp(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function hR(e,t){let r=Mp(e);return t&&t.forEach((n,s)=>{r.has(s)||t.getAll(s).forEach(i=>{r.append(s,i)})}),r}const pR=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],mR="6";try{window.__reactRouterVersion=mR}catch{}function gR(e,t){return E2({basename:void 0,future:Il({},void 0,{v7_prependBasename:!0}),history:qN({window:void 0}),hydrationData:vR(),routes:e,mapRouteProperties:cR,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function vR(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Il({},t,{errors:yR(t.errors)})),t}function yR(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,s]of t)if(s&&s.__type==="RouteErrorResponse")r[n]=new fg(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let i=window[s.__subType];if(typeof i=="function")try{let o=new i(s.message);o.stack="",r[n]=o}catch{}}if(r[n]==null){let i=new Error(s.message);i.stack="",r[n]=i}}else r[n]=s;return r}const xR=x.createContext({isTransitioning:!1}),wR=x.createContext(new Map),_R="startTransition",Nx=B0[_R],bR="flushSync",Rx=GN[bR];function SR(e){Nx?Nx(e):e()}function za(e){Rx?Rx(e):e()}class kR{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function CR(e){let{fallbackElement:t,router:r,future:n}=e,[s,i]=x.useState(r.state),[o,a]=x.useState(),[l,u]=x.useState({isTransitioning:!1}),[d,f]=x.useState(),[g,h]=x.useState(),[y,m]=x.useState(),w=x.useRef(new Map),{v7_startTransition:v}=n||{},p=x.useCallback(D=>{v?SR(D):D()},[v]),_=x.useCallback((D,P)=>{let{deletedFetchers:L,unstable_flushSync:q,unstable_viewTransitionOpts:T}=P;L.forEach(b=>w.current.delete(b)),D.fetchers.forEach((b,W)=>{b.data!==void 0&&w.current.set(W,b.data)});let F=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!T||F){q?za(()=>i(D)):p(()=>i(D));return}if(q){za(()=>{g&&(d&&d.resolve(),g.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:T.currentLocation,nextLocation:T.nextLocation})});let b=r.window.document.startViewTransition(()=>{za(()=>i(D))});b.finished.finally(()=>{za(()=>{f(void 0),h(void 0),a(void 0),u({isTransitioning:!1})})}),za(()=>h(b));return}g?(d&&d.resolve(),g.skipTransition(),m({state:D,currentLocation:T.currentLocation,nextLocation:T.nextLocation})):(a(D),u({isTransitioning:!0,flushSync:!1,currentLocation:T.currentLocation,nextLocation:T.nextLocation}))},[r.window,g,d,w,p]);x.useLayoutEffect(()=>r.subscribe(_),[r,_]),x.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new kR)},[l]),x.useEffect(()=>{if(d&&o&&r.window){let D=o,P=d.promise,L=r.window.document.startViewTransition(async()=>{p(()=>i(D)),await P});L.finished.finally(()=>{f(void 0),h(void 0),a(void 0),u({isTransitioning:!1})}),h(L)}},[p,o,d,r.window]),x.useEffect(()=>{d&&o&&s.location.key===o.location.key&&d.resolve()},[d,g,s.location,o]),x.useEffect(()=>{!l.isTransitioning&&y&&(a(y.state),u({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),m(void 0))},[l.isTransitioning,y]),x.useEffect(()=>{},[]);let C=x.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:D=>r.navigate(D),push:(D,P,L)=>r.navigate(D,{state:P,preventScrollReset:L==null?void 0:L.preventScrollReset}),replace:(D,P,L)=>r.navigate(D,{replace:!0,state:P,preventScrollReset:L==null?void 0:L.preventScrollReset})}),[r]),E=r.basename||"/",j=x.useMemo(()=>({router:r,navigator:C,static:!1,basename:E}),[r,C,E]),R=x.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return x.createElement(x.Fragment,null,x.createElement(Jd.Provider,{value:j},x.createElement(s1.Provider,{value:s},x.createElement(wR.Provider,{value:w.current},x.createElement(xR.Provider,{value:l},x.createElement(lR,{basename:E,location:s.location,navigationType:s.historyAction,navigator:C,future:R},s.initialized||r.future.v7_partialHydration?x.createElement(ER,{routes:r.routes,future:r.future,state:s}):t))))),null)}const ER=x.memo(jR);function jR(e){let{routes:t,future:r,state:n}=e;return q2(t,void 0,n,r)}const TR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",NR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dr=x.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:u,preventScrollReset:d,unstable_viewTransition:f}=t,g=uR(t,pR),{basename:h}=x.useContext(vi),y,m=!1;if(typeof u=="string"&&NR.test(u)&&(y=u,TR))try{let _=new URL(window.location.href),C=u.startsWith("//")?new URL(_.protocol+u):new URL(u),E=va(C.pathname,h);C.origin===_.origin&&E!=null?u=E+C.search+C.hash:m=!0}catch{}let w=Y2(u,{relative:s}),v=RR(u,{replace:o,state:a,target:l,preventScrollReset:d,relative:s,unstable_viewTransition:f});function p(_){n&&n(_),_.defaultPrevented||v(_)}return x.createElement("a",Il({},g,{href:y||w,onClick:m||i?n:p,ref:r,target:l}))});var Px;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Px||(Px={}));var Dx;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Dx||(Dx={}));function RR(e,t){let{target:r,replace:n,state:s,preventScrollReset:i,relative:o,unstable_viewTransition:a}=t===void 0?{}:t,l=Sn(),u=Hn(),d=a1(e,{relative:o});return x.useCallback(f=>{if(fR(f,r)){f.preventDefault();let g=n!==void 0?n:Yi(u)===Yi(d);l(e,{replace:g,state:s,preventScrollReset:i,relative:o,unstable_viewTransition:a})}},[u,l,d,n,s,r,e,i,o,a])}function PR(e){let t=x.useRef(Mp(e)),r=x.useRef(!1),n=Hn(),s=x.useMemo(()=>hR(n.search,r.current?null:t.current),[n.search]),i=Sn(),o=x.useCallback((a,l)=>{const u=Mp(typeof a=="function"?a(s):a);r.current=!0,i("?"+u,l)},[i,s]);return[s,o]}/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const DR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),d1=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var AR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const OR=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...a},l)=>x.createElement("svg",{ref:l,...AR,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:d1("lucide",s),...a},[...o.map(([u,d])=>x.createElement(u,d)),...Array.isArray(i)?i:[i]]));/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kt=(e,t)=>{const r=x.forwardRef(({className:n,...s},i)=>x.createElement(OR,{ref:i,iconNode:t,className:d1(`lucide-${DR(e)}`,n),...s}));return r.displayName=`${e}`,r};/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const MR=kt("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const IR=kt("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const LR=kt("CalendarX2",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"m17 22 5-5",key:"1k6ppv"}],["path",{d:"m17 17 5 5",key:"p7ous7"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const f1=kt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const h1=kt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const FR=kt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zR=kt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vg=kt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const UR=kt("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yg=kt("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const VR=kt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ip=kt("Earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const WR=kt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ax=kt("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ox=kt("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $R=kt("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const BR=kt("LoaderPinwheel",[["path",{d:"M2 12c0-2.8 2.2-5 5-5s5 2.2 5 5 2.2 5 5 5 5-2.2 5-5",key:"1cg5zf"}],["path",{d:"M7 20.7a1 1 0 1 1 5-8.7 1 1 0 1 0 5-8.6",key:"1gnrpi"}],["path",{d:"M7 3.3a1 1 0 1 1 5 8.6 1 1 0 1 0 5 8.6",key:"u9yy5q"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const HR=kt("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const YR=kt("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yh=kt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mx=kt("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const p1=kt("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ZR=kt("SquareSigma",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M16 8.9V7H8l4 5-4 5h8v-1.9",key:"9nih0i"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const KR=kt("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xg=kt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function GR(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ef(...e){return t=>e.forEach(r=>GR(r,t))}function Xe(...e){return x.useCallback(ef(...e),e)}var xs=x.forwardRef((e,t)=>{const{children:r,...n}=e,s=x.Children.toArray(r),i=s.find(qR);if(i){const o=i.props.children,a=s.map(l=>l===i?x.Children.count(o)>1?x.Children.only(null):x.isValidElement(o)?o.props.children:null:l);return c.jsx(Lp,{...n,ref:t,children:x.isValidElement(o)?x.cloneElement(o,void 0,a):null})}return c.jsx(Lp,{...n,ref:t,children:r})});xs.displayName="Slot";var Lp=x.forwardRef((e,t)=>{const{children:r,...n}=e;if(x.isValidElement(r)){const s=QR(r);return x.cloneElement(r,{...XR(n,r.props),ref:t?ef(t,s):s})}return x.Children.count(r)>1?x.Children.only(null):null});Lp.displayName="SlotClone";var wg=({children:e})=>c.jsx(c.Fragment,{children:e});function qR(e){return x.isValidElement(e)&&e.type===wg}function XR(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{i(...a),s(...a)}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function QR(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function m1(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,Lx=JR,uc=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Lx(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(u=>{const d=r==null?void 0:r[u],f=i==null?void 0:i[u];if(d===null)return null;const g=Ix(d)||Ix(f);return s[u][g]}),a=r&&Object.entries(r).reduce((u,d)=>{let[f,g]=d;return g===void 0||(u[f]=g),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:g,...h}=d;return Object.entries(h).every(y=>{let[m,w]=y;return Array.isArray(w)?w.includes({...i,...a}[m]):{...i,...a}[m]===w})?[...u,f,g]:u},[]);return Lx(e,o,l,r==null?void 0:r.class,r==null?void 0:r.className)};function g1(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;ta(i)))==null?void 0:o.classGroupId}const Fx=/^\[(.+)\]$/;function rP(e){if(Fx.test(e)){const t=Fx.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}}function nP(e){const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return iP(Object.entries(e.classGroups),r).forEach(([i,o])=>{Fp(o,n,i,t)}),n}function Fp(e,t,r,n){e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:zx(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(sP(s)){Fp(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{Fp(o,zx(t,i),r,n)})})}function zx(e,t){let r=e;return t.split(_g).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r}function sP(e){return e.isThemeGetter}function iP(e,t){return t?e.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[t+o,a])):i);return[r,s]}):e}function oP(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;function s(i,o){r.set(i,o),t++,t>e&&(t=0,n=r,r=new Map)}return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return s(i,o),o},set(i,o){r.has(i)?r.set(i,o):s(i,o)}}}const y1="!";function aP(e){const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],i=t.length;function o(a){const l=[];let u=0,d=0,f;for(let w=0;wd?f-d:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:m}}return r?function(l){return r({className:l,parseClassName:o})}:o}function lP(e){if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t}function cP(e){return{cache:oP(e.cacheSize),parseClassName:aP(e),...tP(e)}}const uP=/\s+/;function dP(e,t){const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,i=new Set;return e.trim().split(uP).map(o=>{const{modifiers:a,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=r(o);let f=!!d,g=n(f?u.substring(0,d):u);if(!g){if(!f)return{isTailwindClass:!1,originalClassName:o};if(g=n(u),!g)return{isTailwindClass:!1,originalClassName:o};f=!1}const h=lP(a).join(":");return{isTailwindClass:!0,modifierId:l?h+y1:h,classGroupId:g,originalClassName:o,hasPostfixModifier:f}}).reverse().filter(o=>{if(!o.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:u}=o,d=a+l;return i.has(d)?!1:(i.add(d),s(l,u).forEach(f=>i.add(a+f)),!0)}).reverse().map(o=>o.originalClassName).join(" ")}function fP(){let e=0,t,r,n="";for(;ef(d),e());return r=cP(u),n=r.cache.get,s=r.cache.set,i=a,a(l)}function a(l){const u=n(l);if(u)return u;const d=dP(l,r);return s(l,d),d}return function(){return i(fP.apply(null,arguments))}}function wt(e){const t=r=>r[e]||[];return t.isThemeGetter=!0,t}const w1=/^\[(?:([a-z-]+):)?(.+)\]$/i,pP=/^\d+\/\d+$/,mP=new Set(["px","full","screen"]),gP=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vP=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,yP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,xP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Jn(e){return Di(e)||mP.has(e)||pP.test(e)}function Ms(e){return xa(e,"length",TP)}function Di(e){return!!e&&!Number.isNaN(Number(e))}function Qc(e){return xa(e,"number",Di)}function Ua(e){return!!e&&Number.isInteger(Number(e))}function _P(e){return e.endsWith("%")&&Di(e.slice(0,-1))}function Ze(e){return w1.test(e)}function Is(e){return gP.test(e)}const bP=new Set(["length","size","percentage"]);function SP(e){return xa(e,bP,_1)}function kP(e){return xa(e,"position",_1)}const CP=new Set(["image","url"]);function EP(e){return xa(e,CP,RP)}function jP(e){return xa(e,"",NP)}function Va(){return!0}function xa(e,t,r){const n=w1.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1}function TP(e){return vP.test(e)&&!yP.test(e)}function _1(){return!1}function NP(e){return xP.test(e)}function RP(e){return wP.test(e)}function PP(){const e=wt("colors"),t=wt("spacing"),r=wt("blur"),n=wt("brightness"),s=wt("borderColor"),i=wt("borderRadius"),o=wt("borderSpacing"),a=wt("borderWidth"),l=wt("contrast"),u=wt("grayscale"),d=wt("hueRotate"),f=wt("invert"),g=wt("gap"),h=wt("gradientColorStops"),y=wt("gradientColorStopPositions"),m=wt("inset"),w=wt("margin"),v=wt("opacity"),p=wt("padding"),_=wt("saturate"),C=wt("scale"),E=wt("sepia"),j=wt("skew"),R=wt("space"),D=wt("translate"),P=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",Ze,t],T=()=>[Ze,t],F=()=>["",Jn,Ms],b=()=>["auto",Di,Ze],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],te=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>["start","end","center","between","around","evenly","stretch"],I=()=>["","0",Ze],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[Di,Qc],V=()=>[Di,Ze];return{cacheSize:500,separator:":",theme:{colors:[Va],spacing:[Jn,Ms],blur:["none","",Is,Ze],brightness:z(),borderColor:[e],borderRadius:["none","","full",Is,Ze],borderSpacing:T(),borderWidth:F(),contrast:z(),grayscale:I(),hueRotate:V(),invert:I(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[_P,Ms],inset:q(),margin:q(),opacity:z(),padding:T(),saturate:z(),scale:z(),sepia:I(),skew:V(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",Ze]}],container:["container"],columns:[{columns:[Is]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),Ze]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ua,Ze]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ze]}],grow:[{grow:I()}],shrink:[{shrink:I()}],order:[{order:["first","last","none",Ua,Ze]}],"grid-cols":[{"grid-cols":[Va]}],"col-start-end":[{col:["auto",{span:["full",Ua,Ze]},Ze]}],"col-start":[{"col-start":b()}],"col-end":[{"col-end":b()}],"grid-rows":[{"grid-rows":[Va]}],"row-start-end":[{row:["auto",{span:[Ua,Ze]},Ze]}],"row-start":[{"row-start":b()}],"row-end":[{"row-end":b()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ze]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ze]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[p]}],px:[{px:[p]}],py:[{py:[p]}],ps:[{ps:[p]}],pe:[{pe:[p]}],pt:[{pt:[p]}],pr:[{pr:[p]}],pb:[{pb:[p]}],pl:[{pl:[p]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ze,t]}],"min-w":[{"min-w":[Ze,t,"min","max","fit"]}],"max-w":[{"max-w":[Ze,t,"none","full","min","max","fit","prose",{screen:[Is]},Is]}],h:[{h:[Ze,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ze,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ze,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ze,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Is,Ms]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Qc]}],"font-family":[{font:[Va]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ze]}],"line-clamp":[{"line-clamp":["none",Di,Qc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Jn,Ze]}],"list-image":[{"list-image":["none",Ze]}],"list-style-type":[{list:["none","disc","decimal",Ze]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Jn,Ms]}],"underline-offset":[{"underline-offset":["auto",Jn,Ze]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ze]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),kP]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",SP]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},EP]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...te(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:te()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...te()]}],"outline-offset":[{"outline-offset":[Jn,Ze]}],"outline-w":[{outline:[Jn,Ms]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Jn,Ms]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Is,jP]}],"shadow-color":[{shadow:[Va]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Is,Ze]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[_]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ze]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",Ze]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ze]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Ua,Ze]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ze]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ze]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ze]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Jn,Ms,Qc]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const DP=hP(PP);function pe(...e){return DP(eP(e))}const tf=uc("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),at=x.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},i)=>{const o=n?xs:"button";return c.jsx(o,{className:pe(tf({variant:t,size:r,className:e})),ref:i,...s})});at.displayName="Button";function ue(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function AP(e,t){const r=x.createContext(t);function n(i){const{children:o,...a}=i,l=x.useMemo(()=>a,Object.values(a));return c.jsx(r.Provider,{value:l,children:o})}function s(i){const o=x.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return n.displayName=e+"Provider",[n,s]}function Qr(e,t=[]){let r=[];function n(i,o){const a=x.createContext(o),l=r.length;r=[...r,o];function u(f){const{scope:g,children:h,...y}=f,m=(g==null?void 0:g[e][l])||a,w=x.useMemo(()=>y,Object.values(y));return c.jsx(m.Provider,{value:w,children:h})}function d(f,g){const h=(g==null?void 0:g[e][l])||a,y=x.useContext(h);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const s=()=>{const i=r.map(o=>x.createContext(o));return function(a){const l=(a==null?void 0:a[e])||i;return x.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[n,OP(s,...t)]}function OP(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((a,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...a,...f}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function At(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function oi({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,s]=MP({defaultProp:t,onChange:r}),i=e!==void 0,o=i?e:n,a=At(r),l=x.useCallback(u=>{if(i){const f=typeof u=="function"?u(e):u;f!==e&&a(f)}else s(u)},[i,e,s,a]);return[o,l]}function MP({defaultProp:e,onChange:t}){const r=x.useState(e),[n]=r,s=x.useRef(n),i=At(t);return x.useEffect(()=>{s.current!==n&&(i(n),s.current=n)},[n,s,i]),r}var IP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ve=IP.reduce((e,t)=>{const r=x.forwardRef((n,s)=>{const{asChild:i,...o}=n,a=i?xs:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(a,{...o,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function bg(e,t){e&&Cs.flushSync(()=>e.dispatchEvent(t))}function rf(e){const t=e+"CollectionProvider",[r,n]=Qr(t),[s,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=h=>{const{scope:y,children:m}=h,w=et.useRef(null),v=et.useRef(new Map).current;return c.jsx(s,{scope:y,itemMap:v,collectionRef:w,children:m})};o.displayName=t;const a=e+"CollectionSlot",l=et.forwardRef((h,y)=>{const{scope:m,children:w}=h,v=i(a,m),p=Xe(y,v.collectionRef);return c.jsx(xs,{ref:p,children:w})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=et.forwardRef((h,y)=>{const{scope:m,children:w,...v}=h,p=et.useRef(null),_=Xe(y,p),C=i(u,m);return et.useEffect(()=>(C.itemMap.set(p,{ref:p,...v}),()=>void C.itemMap.delete(p))),c.jsx(xs,{[d]:"",ref:_,children:w})});f.displayName=u;function g(h){const y=i(e+"CollectionConsumer",h);return et.useCallback(()=>{const w=y.collectionRef.current;if(!w)return[];const v=Array.from(w.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((C,E)=>v.indexOf(C.ref.current)-v.indexOf(E.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:l,ItemSlot:f},g,n]}var LP=x.createContext(void 0);function nf(e){const t=x.useContext(LP);return e||t||"ltr"}function FP(e,t=globalThis==null?void 0:globalThis.document){const r=At(e);x.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var zP="DismissableLayer",zp="dismissableLayer.update",UP="dismissableLayer.pointerDownOutside",VP="dismissableLayer.focusOutside",Ux,b1=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wa=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=e,u=x.useContext(b1),[d,f]=x.useState(null),g=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=x.useState({}),y=Xe(t,R=>f(R)),m=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(w),p=d?m.indexOf(d):-1,_=u.layersWithOutsidePointerEventsDisabled.size>0,C=p>=v,E=$P(R=>{const D=R.target,P=[...u.branches].some(L=>L.contains(D));!C||P||(s==null||s(R),o==null||o(R),R.defaultPrevented||a==null||a())},g),j=BP(R=>{const D=R.target;[...u.branches].some(L=>L.contains(D))||(i==null||i(R),o==null||o(R),R.defaultPrevented||a==null||a())},g);return FP(R=>{p===u.layers.size-1&&(n==null||n(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},g),x.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ux=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Vx(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Ux)}},[d,g,r,u]),x.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Vx())},[d,u]),x.useEffect(()=>{const R=()=>h({});return document.addEventListener(zp,R),()=>document.removeEventListener(zp,R)},[]),c.jsx(Ve.div,{...l,ref:y,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:ue(e.onFocusCapture,j.onFocusCapture),onBlurCapture:ue(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:ue(e.onPointerDownCapture,E.onPointerDownCapture)})});wa.displayName=zP;var WP="DismissableLayerBranch",S1=x.forwardRef((e,t)=>{const r=x.useContext(b1),n=x.useRef(null),s=Xe(t,n);return x.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),c.jsx(Ve.div,{...e,ref:s})});S1.displayName=WP;function $P(e,t=globalThis==null?void 0:globalThis.document){const r=At(e),n=x.useRef(!1),s=x.useRef(()=>{});return x.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){k1(UP,r,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=l,t.addEventListener("click",s.current,{once:!0})):l()}else t.removeEventListener("click",s.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function BP(e,t=globalThis==null?void 0:globalThis.document){const r=At(e),n=x.useRef(!1);return x.useEffect(()=>{const s=i=>{i.target&&!n.current&&k1(VP,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Vx(){const e=new CustomEvent(zp);document.dispatchEvent(e)}function k1(e,t,r,{discrete:n}){const s=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?bg(s,i):s.dispatchEvent(i)}var HP=wa,YP=S1,xh=0;function Sg(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Wx()),document.body.insertAdjacentElement("beforeend",e[1]??Wx()),xh++,()=>{xh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),xh--}},[])}function Wx(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var wh="focusScope.autoFocusOnMount",_h="focusScope.autoFocusOnUnmount",$x={bubbles:!1,cancelable:!0},ZP="FocusScope",sf=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[a,l]=x.useState(null),u=At(s),d=At(i),f=x.useRef(null),g=Xe(t,m=>l(m)),h=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let m=function(_){if(h.paused||!a)return;const C=_.target;a.contains(C)?f.current=C:Fs(f.current,{select:!0})},w=function(_){if(h.paused||!a)return;const C=_.relatedTarget;C!==null&&(a.contains(C)||Fs(f.current,{select:!0}))},v=function(_){if(document.activeElement===document.body)for(const E of _)E.removedNodes.length>0&&Fs(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",w);const p=new MutationObserver(v);return a&&p.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",w),p.disconnect()}}},[n,a,h.paused]),x.useEffect(()=>{if(a){Hx.add(h);const m=document.activeElement;if(!a.contains(m)){const v=new CustomEvent(wh,$x);a.addEventListener(wh,u),a.dispatchEvent(v),v.defaultPrevented||(KP(JP(C1(a)),{select:!0}),document.activeElement===m&&Fs(a))}return()=>{a.removeEventListener(wh,u),setTimeout(()=>{const v=new CustomEvent(_h,$x);a.addEventListener(_h,d),a.dispatchEvent(v),v.defaultPrevented||Fs(m??document.body,{select:!0}),a.removeEventListener(_h,d),Hx.remove(h)},0)}}},[a,u,d,h]);const y=x.useCallback(m=>{if(!r&&!n||h.paused)return;const w=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,v=document.activeElement;if(w&&v){const p=m.currentTarget,[_,C]=GP(p);_&&C?!m.shiftKey&&v===C?(m.preventDefault(),r&&Fs(_,{select:!0})):m.shiftKey&&v===_&&(m.preventDefault(),r&&Fs(C,{select:!0})):v===p&&m.preventDefault()}},[r,n,h.paused]);return c.jsx(Ve.div,{tabIndex:-1,...o,ref:g,onKeyDown:y})});sf.displayName=ZP;function KP(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Fs(n,{select:t}),document.activeElement!==r)return}function GP(e){const t=C1(e),r=Bx(t,e),n=Bx(t.reverse(),e);return[r,n]}function C1(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Bx(e,t){for(const r of e)if(!qP(r,{upTo:t}))return r}function qP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function XP(e){return e instanceof HTMLInputElement&&"select"in e}function Fs(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&XP(e)&&t&&e.select()}}var Hx=QP();function QP(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Yx(e,t),e.unshift(t)},remove(t){var r;e=Yx(e,t),(r=e[0])==null||r.resume()}}}function Yx(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function JP(e){return e.filter(t=>t.tagName!=="A")}var nr=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},eD=B0.useId||(()=>{}),tD=0;function zn(e){const[t,r]=x.useState(eD());return nr(()=>{r(n=>n??String(tD++))},[e]),t?`radix-${t}`:""}const rD=["top","right","bottom","left"],Mn=Math.min,Dr=Math.max,ad=Math.round,Jc=Math.floor,ai=e=>({x:e,y:e}),nD={left:"right",right:"left",bottom:"top",top:"bottom"},sD={start:"end",end:"start"};function Up(e,t,r){return Dr(e,Mn(t,r))}function ws(e,t){return typeof e=="function"?e(t):e}function _s(e){return e.split("-")[0]}function _a(e){return e.split("-")[1]}function kg(e){return e==="x"?"y":"x"}function Cg(e){return e==="y"?"height":"width"}function li(e){return["top","bottom"].includes(_s(e))?"y":"x"}function Eg(e){return kg(li(e))}function iD(e,t,r){r===void 0&&(r=!1);const n=_a(e),s=Eg(e),i=Cg(s);let o=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=ld(o)),[o,ld(o)]}function oD(e){const t=ld(e);return[Vp(e),t,Vp(t)]}function Vp(e){return e.replace(/start|end/g,t=>sD[t])}function aD(e,t,r){const n=["left","right"],s=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return r?t?s:n:t?n:s;case"left":case"right":return t?i:o;default:return[]}}function lD(e,t,r,n){const s=_a(e);let i=aD(_s(e),r==="start",n);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(Vp)))),i}function ld(e){return e.replace(/left|right|bottom|top/g,t=>nD[t])}function cD(e){return{top:0,right:0,bottom:0,left:0,...e}}function E1(e){return typeof e!="number"?cD(e):{top:e,right:e,bottom:e,left:e}}function cd(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function Zx(e,t,r){let{reference:n,floating:s}=e;const i=li(t),o=Eg(t),a=Cg(o),l=_s(t),u=i==="y",d=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,g=n[a]/2-s[a]/2;let h;switch(l){case"top":h={x:d,y:n.y-s.height};break;case"bottom":h={x:d,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-s.width,y:f};break;default:h={x:n.x,y:n.y}}switch(_a(t)){case"start":h[o]-=g*(r&&u?-1:1);break;case"end":h[o]+=g*(r&&u?-1:1);break}return h}const uD=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:o}=r,a=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=Zx(u,n,l),g=n,h={},y=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:i,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:d=0}=ws(e,t)||{};if(u==null)return{};const f=E1(d),g={x:r,y:n},h=Eg(s),y=Cg(h),m=await o.getDimensions(u),w=h==="y",v=w?"top":"left",p=w?"bottom":"right",_=w?"clientHeight":"clientWidth",C=i.reference[y]+i.reference[h]-g[h]-i.floating[y],E=g[h]-i.reference[h],j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let R=j?j[_]:0;(!R||!await(o.isElement==null?void 0:o.isElement(j)))&&(R=a.floating[_]||i.floating[y]);const D=C/2-E/2,P=R/2-m[y]/2-1,L=Mn(f[v],P),q=Mn(f[p],P),T=L,F=R-m[y]-q,b=R/2-m[y]/2+D,W=Up(T,b,F),te=!l.arrow&&_a(s)!=null&&b!==W&&i.reference[y]/2-(bb<=0)){var q,T;const b=(((q=i.flip)==null?void 0:q.index)||0)+1,W=R[b];if(W)return{data:{index:b,overflows:L},reset:{placement:W}};let te=(T=L.filter($=>$.overflows[0]<=0).sort(($,Z)=>$.overflows[1]-Z.overflows[1])[0])==null?void 0:T.placement;if(!te)switch(h){case"bestFit":{var F;const $=(F=L.filter(Z=>{if(j){const I=li(Z.placement);return I===p||I==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(I=>I>0).reduce((I,Q)=>I+Q,0)]).sort((Z,I)=>Z[1]-I[1])[0])==null?void 0:F[0];$&&(te=$);break}case"initialPlacement":te=a;break}if(s!==te)return{reset:{placement:te}}}return{}}}};function Kx(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Gx(e){return rD.some(t=>e[t]>=0)}const hD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=ws(e,t);switch(n){case"referenceHidden":{const i=await Ll(t,{...s,elementContext:"reference"}),o=Kx(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Gx(o)}}}case"escaped":{const i=await Ll(t,{...s,altBoundary:!0}),o=Kx(i,r.floating);return{data:{escapedOffsets:o,escaped:Gx(o)}}}default:return{}}}}};async function pD(e,t){const{placement:r,platform:n,elements:s}=e,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),o=_s(r),a=_a(r),l=li(r)==="y",u=["left","top"].includes(o)?-1:1,d=i&&l?-1:1,f=ws(t,e);let{mainAxis:g,crossAxis:h,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof y=="number"&&(h=a==="end"?y*-1:y),l?{x:h*d,y:g*u}:{x:g*u,y:h*d}}const mD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:i,placement:o,middlewareData:a}=t,l=await pD(t,e);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:o}}}}},gD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:w=>{let{x:v,y:p}=w;return{x:v,y:p}}},...l}=ws(e,t),u={x:r,y:n},d=await Ll(t,l),f=li(_s(s)),g=kg(f);let h=u[g],y=u[f];if(i){const w=g==="y"?"top":"left",v=g==="y"?"bottom":"right",p=h+d[w],_=h-d[v];h=Up(p,h,_)}if(o){const w=f==="y"?"top":"left",v=f==="y"?"bottom":"right",p=y+d[w],_=y-d[v];y=Up(p,y,_)}const m=a.fn({...t,[g]:h,[f]:y});return{...m,data:{x:m.x-r,y:m.y-n}}}}},vD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:i,middlewareData:o}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=ws(e,t),d={x:r,y:n},f=li(s),g=kg(f);let h=d[g],y=d[f];const m=ws(a,t),w=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const _=g==="y"?"height":"width",C=i.reference[g]-i.floating[_]+w.mainAxis,E=i.reference[g]+i.reference[_]-w.mainAxis;hE&&(h=E)}if(u){var v,p;const _=g==="y"?"width":"height",C=["top","left"].includes(_s(s)),E=i.reference[f]-i.floating[_]+(C&&((v=o.offset)==null?void 0:v[f])||0)+(C?0:w.crossAxis),j=i.reference[f]+i.reference[_]+(C?0:((p=o.offset)==null?void 0:p[f])||0)-(C?w.crossAxis:0);yj&&(y=j)}return{[g]:h,[f]:y}}}},yD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:s,elements:i}=t,{apply:o=()=>{},...a}=ws(e,t),l=await Ll(t,a),u=_s(r),d=_a(r),f=li(r)==="y",{width:g,height:h}=n.floating;let y,m;u==="top"||u==="bottom"?(y=u,m=d===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(m=u,y=d==="end"?"top":"bottom");const w=h-l.top-l.bottom,v=g-l.left-l.right,p=Mn(h-l[y],w),_=Mn(g-l[m],v),C=!t.middlewareData.shift;let E=p,j=_;if(f?j=d||C?Mn(_,v):v:E=d||C?Mn(p,w):w,C&&!d){const D=Dr(l.left,0),P=Dr(l.right,0),L=Dr(l.top,0),q=Dr(l.bottom,0);f?j=g-2*(D!==0||P!==0?D+P:Dr(l.left,l.right)):E=h-2*(L!==0||q!==0?L+q:Dr(l.top,l.bottom))}await o({...t,availableWidth:j,availableHeight:E});const R=await s.getDimensions(i.floating);return g!==R.width||h!==R.height?{reset:{rects:!0}}:{}}}};function ba(e){return j1(e)?(e.nodeName||"").toLowerCase():"#document"}function Mr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ts(e){var t;return(t=(j1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function j1(e){return e instanceof Node||e instanceof Mr(e).Node}function yn(e){return e instanceof Element||e instanceof Mr(e).Element}function Vn(e){return e instanceof HTMLElement||e instanceof Mr(e).HTMLElement}function qx(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mr(e).ShadowRoot}function dc(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=xn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(s)}function xD(e){return["table","td","th"].includes(ba(e))}function of(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function jg(e){const t=Tg(),r=yn(e)?xn(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function wD(e){let t=ci(e);for(;Vn(t)&&!aa(t);){if(jg(t))return t;if(of(t))return null;t=ci(t)}return null}function Tg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function aa(e){return["html","body","#document"].includes(ba(e))}function xn(e){return Mr(e).getComputedStyle(e)}function af(e){return yn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ci(e){if(ba(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qx(e)&&e.host||Ts(e);return qx(t)?t.host:t}function T1(e){const t=ci(e);return aa(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vn(t)&&dc(t)?t:T1(t)}function Fl(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=T1(e),i=s===((n=e.ownerDocument)==null?void 0:n.body),o=Mr(s);return i?t.concat(o,o.visualViewport||[],dc(s)?s:[],o.frameElement&&r?Fl(o.frameElement):[]):t.concat(s,Fl(s,[],r))}function N1(e){const t=xn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Vn(e),i=s?e.offsetWidth:r,o=s?e.offsetHeight:n,a=ad(r)!==i||ad(n)!==o;return a&&(r=i,n=o),{width:r,height:n,$:a}}function Ng(e){return yn(e)?e:e.contextElement}function Ho(e){const t=Ng(e);if(!Vn(t))return ai(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:i}=N1(t);let o=(i?ad(r.width):r.width)/n,a=(i?ad(r.height):r.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const _D=ai(0);function R1(e){const t=Mr(e);return!Tg()||!t.visualViewport?_D:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bD(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Mr(e)?!1:t}function Zi(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),i=Ng(e);let o=ai(1);t&&(n?yn(n)&&(o=Ho(n)):o=Ho(e));const a=bD(i,r,n)?R1(i):ai(0);let l=(s.left+a.x)/o.x,u=(s.top+a.y)/o.y,d=s.width/o.x,f=s.height/o.y;if(i){const g=Mr(i),h=n&&yn(n)?Mr(n):n;let y=g,m=y.frameElement;for(;m&&n&&h!==y;){const w=Ho(m),v=m.getBoundingClientRect(),p=xn(m),_=v.left+(m.clientLeft+parseFloat(p.paddingLeft))*w.x,C=v.top+(m.clientTop+parseFloat(p.paddingTop))*w.y;l*=w.x,u*=w.y,d*=w.x,f*=w.y,l+=_,u+=C,y=Mr(m),m=y.frameElement}}return cd({width:d,height:f,x:l,y:u})}function SD(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const i=s==="fixed",o=Ts(n),a=t?of(t.floating):!1;if(n===o||a&&i)return r;let l={scrollLeft:0,scrollTop:0},u=ai(1);const d=ai(0),f=Vn(n);if((f||!f&&!i)&&((ba(n)!=="body"||dc(o))&&(l=af(n)),Vn(n))){const g=Zi(n);u=Ho(n),d.x=g.x+n.clientLeft,d.y=g.y+n.clientTop}return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+d.x,y:r.y*u.y-l.scrollTop*u.y+d.y}}function kD(e){return Array.from(e.getClientRects())}function P1(e){return Zi(Ts(e)).left+af(e).scrollLeft}function CD(e){const t=Ts(e),r=af(e),n=e.ownerDocument.body,s=Dr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Dr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+P1(e);const a=-r.scrollTop;return xn(n).direction==="rtl"&&(o+=Dr(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:o,y:a}}function ED(e,t){const r=Mr(e),n=Ts(e),s=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,a=0,l=0;if(s){i=s.width,o=s.height;const u=Tg();(!u||u&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:i,height:o,x:a,y:l}}function jD(e,t){const r=Zi(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,i=Vn(e)?Ho(e):ai(1),o=e.clientWidth*i.x,a=e.clientHeight*i.y,l=s*i.x,u=n*i.y;return{width:o,height:a,x:l,y:u}}function Xx(e,t,r){let n;if(t==="viewport")n=ED(e,r);else if(t==="document")n=CD(Ts(e));else if(yn(t))n=jD(t,r);else{const s=R1(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return cd(n)}function D1(e,t){const r=ci(e);return r===t||!yn(r)||aa(r)?!1:xn(r).position==="fixed"||D1(r,t)}function TD(e,t){const r=t.get(e);if(r)return r;let n=Fl(e,[],!1).filter(a=>yn(a)&&ba(a)!=="body"),s=null;const i=xn(e).position==="fixed";let o=i?ci(e):e;for(;yn(o)&&!aa(o);){const a=xn(o),l=jg(o);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||dc(o)&&!l&&D1(e,o))?n=n.filter(d=>d!==o):s=a,o=ci(o)}return t.set(e,n),n}function ND(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const o=[...r==="clippingAncestors"?of(t)?[]:TD(t,this._c):[].concat(r),n],a=o[0],l=o.reduce((u,d)=>{const f=Xx(t,d,s);return u.top=Dr(f.top,u.top),u.right=Mn(f.right,u.right),u.bottom=Mn(f.bottom,u.bottom),u.left=Dr(f.left,u.left),u},Xx(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function RD(e){const{width:t,height:r}=N1(e);return{width:t,height:r}}function PD(e,t,r){const n=Vn(t),s=Ts(t),i=r==="fixed",o=Zi(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=ai(0);if(n||!n&&!i)if((ba(t)!=="body"||dc(s))&&(a=af(t)),n){const f=Zi(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else s&&(l.x=P1(s));const u=o.left+a.scrollLeft-l.x,d=o.top+a.scrollTop-l.y;return{x:u,y:d,width:o.width,height:o.height}}function bh(e){return xn(e).position==="static"}function Qx(e,t){return!Vn(e)||xn(e).position==="fixed"?null:t?t(e):e.offsetParent}function A1(e,t){const r=Mr(e);if(of(e))return r;if(!Vn(e)){let s=ci(e);for(;s&&!aa(s);){if(yn(s)&&!bh(s))return s;s=ci(s)}return r}let n=Qx(e,t);for(;n&&xD(n)&&bh(n);)n=Qx(n,t);return n&&aa(n)&&bh(n)&&!jg(n)?r:n||wD(e)||r}const DD=async function(e){const t=this.getOffsetParent||A1,r=this.getDimensions,n=await r(e.floating);return{reference:PD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function AD(e){return xn(e).direction==="rtl"}const OD={convertOffsetParentRelativeRectToViewportRelativeRect:SD,getDocumentElement:Ts,getClippingRect:ND,getOffsetParent:A1,getElementRects:DD,getClientRects:kD,getDimensions:RD,getScale:Ho,isElement:yn,isRTL:AD};function MD(e,t){let r=null,n;const s=Ts(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:u,top:d,width:f,height:g}=e.getBoundingClientRect();if(a||t(),!f||!g)return;const h=Jc(d),y=Jc(s.clientWidth-(u+f)),m=Jc(s.clientHeight-(d+g)),w=Jc(u),p={rootMargin:-h+"px "+-y+"px "+-m+"px "+-w+"px",threshold:Dr(0,Mn(1,l))||1};let _=!0;function C(E){const j=E[0].intersectionRatio;if(j!==l){if(!_)return o();j?o(!1,j):n=setTimeout(()=>{o(!1,1e-7)},1e3)}_=!1}try{r=new IntersectionObserver(C,{...p,root:s.ownerDocument})}catch{r=new IntersectionObserver(C,p)}r.observe(e)}return o(!0),i}function ID(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=Ng(e),d=s||i?[...u?Fl(u):[],...Fl(t)]:[];d.forEach(v=>{s&&v.addEventListener("scroll",r,{passive:!0}),i&&v.addEventListener("resize",r)});const f=u&&a?MD(u,r):null;let g=-1,h=null;o&&(h=new ResizeObserver(v=>{let[p]=v;p&&p.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var _;(_=h)==null||_.observe(t)})),r()}),u&&!l&&h.observe(u),h.observe(t));let y,m=l?Zi(e):null;l&&w();function w(){const v=Zi(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&r(),m=v,y=requestAnimationFrame(w)}return r(),()=>{var v;d.forEach(p=>{s&&p.removeEventListener("scroll",r),i&&p.removeEventListener("resize",r)}),f==null||f(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(y)}}const LD=mD,FD=gD,zD=fD,UD=yD,VD=hD,Jx=dD,WD=vD,$D=(e,t,r)=>{const n=new Map,s={platform:OD,...r},i={...s.platform,_c:n};return uD(e,t,{...s,platform:i})};var Cu=typeof document<"u"?x.useLayoutEffect:x.useEffect;function ud(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!ud(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const i=s[n];if(!(i==="_owner"&&e.$$typeof)&&!ud(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function O1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function e0(e,t){const r=O1(e);return Math.round(t*r)/r}function t0(e){const t=x.useRef(e);return Cu(()=>{t.current=e}),t}function BD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,f]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[g,h]=x.useState(n);ud(g,n)||h(n);const[y,m]=x.useState(null),[w,v]=x.useState(null),p=x.useCallback($=>{$!==j.current&&(j.current=$,m($))},[]),_=x.useCallback($=>{$!==R.current&&(R.current=$,v($))},[]),C=i||y,E=o||w,j=x.useRef(null),R=x.useRef(null),D=x.useRef(d),P=l!=null,L=t0(l),q=t0(s),T=x.useCallback(()=>{if(!j.current||!R.current)return;const $={placement:t,strategy:r,middleware:g};q.current&&($.platform=q.current),$D(j.current,R.current,$).then(Z=>{const I={...Z,isPositioned:!0};F.current&&!ud(D.current,I)&&(D.current=I,Cs.flushSync(()=>{f(I)}))})},[g,t,r,q]);Cu(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[u]);const F=x.useRef(!1);Cu(()=>(F.current=!0,()=>{F.current=!1}),[]),Cu(()=>{if(C&&(j.current=C),E&&(R.current=E),C&&E){if(L.current)return L.current(C,E,T);T()}},[C,E,T,L,P]);const b=x.useMemo(()=>({reference:j,floating:R,setReference:p,setFloating:_}),[p,_]),W=x.useMemo(()=>({reference:C,floating:E}),[C,E]),te=x.useMemo(()=>{const $={position:r,left:0,top:0};if(!W.floating)return $;const Z=e0(W.floating,d.x),I=e0(W.floating,d.y);return a?{...$,transform:"translate("+Z+"px, "+I+"px)",...O1(W.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Z,top:I}},[r,a,W.floating,d.x,d.y]);return x.useMemo(()=>({...d,update:T,refs:b,elements:W,floatingStyles:te}),[d,T,b,W,te])}const HD=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Jx({element:n.current,padding:s}).fn(r):{}:n?Jx({element:n,padding:s}).fn(r):{}}}},YD=(e,t)=>({...LD(e),options:[e,t]}),ZD=(e,t)=>({...FD(e),options:[e,t]}),KD=(e,t)=>({...WD(e),options:[e,t]}),GD=(e,t)=>({...zD(e),options:[e,t]}),qD=(e,t)=>({...UD(e),options:[e,t]}),XD=(e,t)=>({...VD(e),options:[e,t]}),QD=(e,t)=>({...HD(e),options:[e,t]});var JD="Arrow",M1=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...i}=e;return c.jsx(Ve.svg,{...i,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});M1.displayName=JD;var eA=M1;function I1(e){const[t,r]=x.useState(void 0);return nr(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=e.offsetWidth,a=e.offsetHeight;r({width:o,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Rg="Popper",[L1,Sa]=Qr(Rg),[tA,F1]=L1(Rg),z1=e=>{const{__scopePopper:t,children:r}=e,[n,s]=x.useState(null);return c.jsx(tA,{scope:t,anchor:n,onAnchorChange:s,children:r})};z1.displayName=Rg;var U1="PopperAnchor",V1=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,i=F1(U1,r),o=x.useRef(null),a=Xe(t,o);return x.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:c.jsx(Ve.div,{...s,ref:a})});V1.displayName=U1;var Pg="PopperContent",[rA,nA]=L1(Pg),W1=x.forwardRef((e,t)=>{var fe,ve,Se,Ie,De,Ce;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:g=!1,updatePositionStrategy:h="optimized",onPlaced:y,...m}=e,w=F1(Pg,r),[v,p]=x.useState(null),_=Xe(t,rt=>p(rt)),[C,E]=x.useState(null),j=I1(C),R=(j==null?void 0:j.width)??0,D=(j==null?void 0:j.height)??0,P=n+(i!=="center"?"-"+i:""),L=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},q=Array.isArray(u)?u:[u],T=q.length>0,F={padding:L,boundary:q.filter(iA),altBoundary:T},{refs:b,floatingStyles:W,placement:te,isPositioned:$,middlewareData:Z}=BD({strategy:"fixed",placement:P,whileElementsMounted:(...rt)=>ID(...rt,{animationFrame:h==="always"}),elements:{reference:w.anchor},middleware:[YD({mainAxis:s+D,alignmentAxis:o}),l&&ZD({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?KD():void 0,...F}),l&&GD({...F}),qD({...F,apply:({elements:rt,rects:k,availableWidth:J,availableHeight:K})=>{const{width:A,height:S}=k.reference,N=rt.floating.style;N.setProperty("--radix-popper-available-width",`${J}px`),N.setProperty("--radix-popper-available-height",`${K}px`),N.setProperty("--radix-popper-anchor-width",`${A}px`),N.setProperty("--radix-popper-anchor-height",`${S}px`)}}),C&&QD({element:C,padding:a}),oA({arrowWidth:R,arrowHeight:D}),g&&XD({strategy:"referenceHidden",...F})]}),[I,Q]=H1(te),z=At(y);nr(()=>{$&&(z==null||z())},[$,z]);const V=(fe=Z.arrow)==null?void 0:fe.x,de=(ve=Z.arrow)==null?void 0:ve.y,ne=((Se=Z.arrow)==null?void 0:Se.centerOffset)!==0,[se,Pe]=x.useState();return nr(()=>{v&&Pe(window.getComputedStyle(v).zIndex)},[v]),c.jsx("div",{ref:b.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:$?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(Ie=Z.transformOrigin)==null?void 0:Ie.x,(De=Z.transformOrigin)==null?void 0:De.y].join(" "),...((Ce=Z.hide)==null?void 0:Ce.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(rA,{scope:r,placedSide:I,onArrowChange:E,arrowX:V,arrowY:de,shouldHideArrow:ne,children:c.jsx(Ve.div,{"data-side":I,"data-align":Q,...m,ref:_,style:{...m.style,animation:$?void 0:"none"}})})})});W1.displayName=Pg;var $1="PopperArrow",sA={top:"bottom",right:"left",bottom:"top",left:"right"},B1=x.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,i=nA($1,n),o=sA[i.placedSide];return c.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:c.jsx(eA,{...s,ref:r,style:{...s.style,display:"block"}})})});B1.displayName=$1;function iA(e){return e!==null}var oA=e=>({name:"transformOrigin",options:e,fn(t){var w,v,p;const{placement:r,rects:n,middlewareData:s}=t,o=((w=s.arrow)==null?void 0:w.centerOffset)!==0,a=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,d]=H1(r),f={start:"0%",center:"50%",end:"100%"}[d],g=(((v=s.arrow)==null?void 0:v.x)??0)+a/2,h=(((p=s.arrow)==null?void 0:p.y)??0)+l/2;let y="",m="";return u==="bottom"?(y=o?f:`${g}px`,m=`${-l}px`):u==="top"?(y=o?f:`${g}px`,m=`${n.floating.height+l}px`):u==="right"?(y=`${-l}px`,m=o?f:`${h}px`):u==="left"&&(y=`${n.floating.width+l}px`,m=o?f:`${h}px`),{data:{x:y,y:m}}}});function H1(e){const[t,r="center"]=e.split("-");return[t,r]}var Dg=z1,Ag=V1,Og=W1,Mg=B1,aA="Portal",fc=x.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,i]=x.useState(!1);nr(()=>i(!0),[]);const o=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?Z_.createPortal(c.jsx(Ve.div,{...n,ref:t}),o):null});fc.displayName=aA;function lA(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Er=e=>{const{present:t,children:r}=e,n=cA(t),s=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),i=Xe(n.ref,uA(s));return typeof r=="function"||n.isPresent?x.cloneElement(s,{ref:i}):null};Er.displayName="Presence";function cA(e){const[t,r]=x.useState(),n=x.useRef({}),s=x.useRef(e),i=x.useRef("none"),o=e?"mounted":"unmounted",[a,l]=lA(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const u=eu(n.current);i.current=a==="mounted"?u:"none"},[a]),nr(()=>{const u=n.current,d=s.current;if(d!==e){const g=i.current,h=eu(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&g!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),nr(()=>{if(t){const u=f=>{const h=eu(n.current).includes(f.animationName);f.target===t&&h&&Cs.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(i.current=eu(n.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:x.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function eu(e){return(e==null?void 0:e.animationName)||"none"}function uA(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Sh="rovingFocusGroup.onEntryFocus",dA={bubbles:!1,cancelable:!0},lf="RovingFocusGroup",[Wp,Y1,fA]=rf(lf),[hA,Z1]=Qr(lf,[fA]),[pA,mA]=hA(lf),K1=x.forwardRef((e,t)=>c.jsx(Wp.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Wp.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(gA,{...e,ref:t})})}));K1.displayName=lf;var gA=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,g=x.useRef(null),h=Xe(t,g),y=nf(i),[m=null,w]=oi({prop:o,defaultProp:a,onChange:l}),[v,p]=x.useState(!1),_=At(u),C=Y1(r),E=x.useRef(!1),[j,R]=x.useState(0);return x.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(Sh,_),()=>D.removeEventListener(Sh,_)},[_]),c.jsx(pA,{scope:r,orientation:n,dir:y,loop:s,currentTabStopId:m,onItemFocus:x.useCallback(D=>w(D),[w]),onItemShiftTab:x.useCallback(()=>p(!0),[]),onFocusableItemAdd:x.useCallback(()=>R(D=>D+1),[]),onFocusableItemRemove:x.useCallback(()=>R(D=>D-1),[]),children:c.jsx(Ve.div,{tabIndex:v||j===0?-1:0,"data-orientation":n,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:ue(e.onMouseDown,()=>{E.current=!0}),onFocus:ue(e.onFocus,D=>{const P=!E.current;if(D.target===D.currentTarget&&P&&!v){const L=new CustomEvent(Sh,dA);if(D.currentTarget.dispatchEvent(L),!L.defaultPrevented){const q=C().filter(te=>te.focusable),T=q.find(te=>te.active),F=q.find(te=>te.id===m),W=[T,F,...q].filter(Boolean).map(te=>te.ref.current);X1(W,d)}}E.current=!1}),onBlur:ue(e.onBlur,()=>p(!1))})})}),G1="RovingFocusGroupItem",q1=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:i,...o}=e,a=zn(),l=i||a,u=mA(G1,r),d=u.currentTabStopId===l,f=Y1(r),{onFocusableItemAdd:g,onFocusableItemRemove:h}=u;return x.useEffect(()=>{if(n)return g(),()=>h()},[n,g,h]),c.jsx(Wp.ItemSlot,{scope:r,id:l,focusable:n,active:s,children:c.jsx(Ve.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...o,ref:t,onMouseDown:ue(e.onMouseDown,y=>{n?u.onItemFocus(l):y.preventDefault()}),onFocus:ue(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:ue(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const m=xA(y,u.orientation,u.dir);if(m!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let v=f().filter(p=>p.focusable).map(p=>p.ref.current);if(m==="last")v.reverse();else if(m==="prev"||m==="next"){m==="prev"&&v.reverse();const p=v.indexOf(y.currentTarget);v=u.loop?wA(v,p+1):v.slice(p+1)}setTimeout(()=>X1(v))}})})})});q1.displayName=G1;var vA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function yA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function xA(e,t,r){const n=yA(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return vA[n]}function X1(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function wA(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var _A=K1,bA=q1,SA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},fo=new WeakMap,tu=new WeakMap,ru={},kh=0,Q1=function(e){return e&&(e.host||Q1(e.parentNode))},kA=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Q1(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},CA=function(e,t,r,n){var s=kA(t,Array.isArray(e)?e:[e]);ru[r]||(ru[r]=new WeakMap);var i=ru[r],o=[],a=new Set,l=new Set(s),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};s.forEach(u);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(g){if(a.has(g))d(g);else try{var h=g.getAttribute(n),y=h!==null&&h!=="false",m=(fo.get(g)||0)+1,w=(i.get(g)||0)+1;fo.set(g,m),i.set(g,w),o.push(g),m===1&&y&&tu.set(g,!0),w===1&&g.setAttribute(r,"true"),y||g.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",g,v)}})};return d(t),a.clear(),kh++,function(){o.forEach(function(f){var g=fo.get(f)-1,h=i.get(f)-1;fo.set(f,g),i.set(f,h),g||(tu.has(f)||f.removeAttribute(n),tu.delete(f)),h||f.removeAttribute(r)}),kh--,kh||(fo=new WeakMap,fo=new WeakMap,tu=new WeakMap,ru={})}},Ig=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=SA(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),CA(n,s,r,"aria-hidden")):function(){return null}},Dn=function(){return Dn=Object.assign||function(t){for(var r,n=1,s=arguments.length;n"u")return WA;var t=$A(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},HA=rb(),Yo="data-scroll-locked",YA=function(e,t,r,n){var s=e.left,i=e.top,o=e.right,a=e.gap;return r===void 0&&(r="margin"),` .`.concat(jA,` { overflow: hidden `).concat(n,`; padding-right: `).concat(a,"px ").concat(n,`; } body[`).concat(Yo,`] { overflow: hidden `).concat(n,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` padding-left: `.concat(s,`px; padding-top: `).concat(i,`px; padding-right: `).concat(o,`px; margin-left:0; margin-top:0; margin-right: `).concat(a,"px ").concat(n,`; `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` } .`).concat(Eu,` { right: `).concat(a,"px ").concat(n,`; } .`).concat(ju,` { margin-right: `).concat(a,"px ").concat(n,`; } .`).concat(Eu," .").concat(Eu,` { right: 0 `).concat(n,`; } .`).concat(ju," .").concat(ju,` { margin-right: 0 `).concat(n,`; } body[`).concat(Yo,`] { `).concat(TA,": ").concat(a,`px; } `)},n0=function(){var e=parseInt(document.body.getAttribute(Yo)||"0",10);return isFinite(e)?e:0},ZA=function(){x.useEffect(function(){return document.body.setAttribute(Yo,(n0()+1).toString()),function(){var e=n0()-1;e<=0?document.body.removeAttribute(Yo):document.body.setAttribute(Yo,e.toString())}},[])},KA=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;ZA();var i=x.useMemo(function(){return BA(s)},[s]);return x.createElement(HA,{styles:YA(i,!t,s,r?"":"!important")})},$p=!1;if(typeof window<"u")try{var nu=Object.defineProperty({},"passive",{get:function(){return $p=!0,!0}});window.addEventListener("test",nu,nu),window.removeEventListener("test",nu,nu)}catch{$p=!1}var ho=$p?{passive:!1}:!1,GA=function(e){return e.tagName==="TEXTAREA"},nb=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!GA(e)&&r[t]==="visible")},qA=function(e){return nb(e,"overflowY")},XA=function(e){return nb(e,"overflowX")},s0=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=sb(e,n);if(s){var i=ib(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},QA=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},JA=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},sb=function(e,t){return e==="v"?qA(t):XA(t)},ib=function(e,t){return e==="v"?QA(t):JA(t)},eO=function(e,t){return e==="h"&&t==="rtl"?-1:1},tO=function(e,t,r,n,s){var i=eO(e,window.getComputedStyle(t).direction),o=i*n,a=r.target,l=t.contains(a),u=!1,d=o>0,f=0,g=0;do{var h=ib(e,a),y=h[0],m=h[1],w=h[2],v=m-w-i*y;(y||v)&&sb(e,a)&&(f+=v,g+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(Math.abs(f)<1||!s)||!d&&(Math.abs(g)<1||!s))&&(u=!0),u},su=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},i0=function(e){return[e.deltaX,e.deltaY]},o0=function(e){return e&&"current"in e?e.current:e},rO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},nO=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},sO=0,po=[];function iO(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),s=x.useState(sO++)[0],i=x.useState(rb)[0],o=x.useRef(e);x.useEffect(function(){o.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=EA([e.lockRef.current],(e.shards||[]).map(o0),!0).filter(Boolean);return m.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=x.useCallback(function(m,w){if("touches"in m&&m.touches.length===2)return!o.current.allowPinchZoom;var v=su(m),p=r.current,_="deltaX"in m?m.deltaX:p[0]-v[0],C="deltaY"in m?m.deltaY:p[1]-v[1],E,j=m.target,R=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in m&&R==="h"&&j.type==="range")return!1;var D=s0(R,j);if(!D)return!0;if(D?E=R:(E=R==="v"?"h":"v",D=s0(R,j)),!D)return!1;if(!n.current&&"changedTouches"in m&&(_||C)&&(n.current=E),!E)return!0;var P=n.current||E;return tO(P,w,m,P==="h"?_:C,!0)},[]),l=x.useCallback(function(m){var w=m;if(!(!po.length||po[po.length-1]!==i)){var v="deltaY"in w?i0(w):su(w),p=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&rO(E.delta,v)})[0];if(p&&p.should){w.cancelable&&w.preventDefault();return}if(!p){var _=(o.current.shards||[]).map(o0).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=_.length>0?a(w,_[0]):!o.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),u=x.useCallback(function(m,w,v,p){var _={name:m,delta:w,target:v,should:p,shadowParent:oO(v)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),d=x.useCallback(function(m){r.current=su(m),n.current=void 0},[]),f=x.useCallback(function(m){u(m.type,i0(m),m.target,a(m,e.lockRef.current))},[]),g=x.useCallback(function(m){u(m.type,su(m),m.target,a(m,e.lockRef.current))},[]);x.useEffect(function(){return po.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",l,ho),document.addEventListener("touchmove",l,ho),document.addEventListener("touchstart",d,ho),function(){po=po.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,ho),document.removeEventListener("touchmove",l,ho),document.removeEventListener("touchstart",d,ho)}},[]);var h=e.removeScrollBar,y=e.inert;return x.createElement(x.Fragment,null,y?x.createElement(i,{styles:nO(s)}):null,h?x.createElement(KA,{gapMode:e.gapMode}):null)}function oO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const aO=MA(tb,iO);var uf=x.forwardRef(function(e,t){return x.createElement(cf,Dn({},e,{ref:t,sideCar:aO}))});uf.classNames=cf.classNames;var Bp=["Enter"," "],lO=["ArrowDown","PageUp","Home"],ob=["ArrowUp","PageDown","End"],cO=[...lO,...ob],uO={ltr:[...Bp,"ArrowRight"],rtl:[...Bp,"ArrowLeft"]},dO={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hc="Menu",[zl,fO,hO]=rf(hc),[eo,ab]=Qr(hc,[hO,Sa,Z1]),df=Sa(),lb=Z1(),[pO,to]=eo(hc),[mO,pc]=eo(hc),cb=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:i,modal:o=!0}=e,a=df(t),[l,u]=x.useState(null),d=x.useRef(!1),f=At(i),g=nf(s);return x.useEffect(()=>{const h=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),c.jsx(Dg,{...a,children:c.jsx(pO,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:u,children:c.jsx(mO,{scope:t,onClose:x.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:g,modal:o,children:n})})})};cb.displayName=hc;var gO="MenuAnchor",Lg=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=df(r);return c.jsx(Ag,{...s,...n,ref:t})});Lg.displayName=gO;var Fg="MenuPortal",[vO,ub]=eo(Fg,{forceMount:void 0}),db=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,i=to(Fg,t);return c.jsx(vO,{scope:t,forceMount:r,children:c.jsx(Er,{present:r||i.open,children:c.jsx(fc,{asChild:!0,container:s,children:n})})})};db.displayName=Fg;var Gr="MenuContent",[yO,zg]=eo(Gr),fb=x.forwardRef((e,t)=>{const r=ub(Gr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,i=to(Gr,e.__scopeMenu),o=pc(Gr,e.__scopeMenu);return c.jsx(zl.Provider,{scope:e.__scopeMenu,children:c.jsx(Er,{present:n||i.open,children:c.jsx(zl.Slot,{scope:e.__scopeMenu,children:o.modal?c.jsx(xO,{...s,ref:t}):c.jsx(wO,{...s,ref:t})})})})}),xO=x.forwardRef((e,t)=>{const r=to(Gr,e.__scopeMenu),n=x.useRef(null),s=Xe(t,n);return x.useEffect(()=>{const i=n.current;if(i)return Ig(i)},[]),c.jsx(Ug,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ue(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),wO=x.forwardRef((e,t)=>{const r=to(Gr,e.__scopeMenu);return c.jsx(Ug,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Ug=x.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,onDismiss:h,disableOutsideScroll:y,...m}=e,w=to(Gr,r),v=pc(Gr,r),p=df(r),_=lb(r),C=fO(r),[E,j]=x.useState(null),R=x.useRef(null),D=Xe(t,R,w.onContentChange),P=x.useRef(0),L=x.useRef(""),q=x.useRef(0),T=x.useRef(null),F=x.useRef("right"),b=x.useRef(0),W=y?uf:x.Fragment,te=y?{as:xs,allowPinchZoom:!0}:void 0,$=I=>{var fe,ve;const Q=L.current+I,z=C().filter(Se=>!Se.disabled),V=document.activeElement,de=(fe=z.find(Se=>Se.ref.current===V))==null?void 0:fe.textValue,ne=z.map(Se=>Se.textValue),se=DO(ne,Q,de),Pe=(ve=z.find(Se=>Se.textValue===se))==null?void 0:ve.ref.current;(function Se(Ie){L.current=Ie,window.clearTimeout(P.current),Ie!==""&&(P.current=window.setTimeout(()=>Se(""),1e3))})(Q),Pe&&setTimeout(()=>Pe.focus())};x.useEffect(()=>()=>window.clearTimeout(P.current),[]),Sg();const Z=x.useCallback(I=>{var z,V;return F.current===((z=T.current)==null?void 0:z.side)&&OO(I,(V=T.current)==null?void 0:V.area)},[]);return c.jsx(yO,{scope:r,searchRef:L,onItemEnter:x.useCallback(I=>{Z(I)&&I.preventDefault()},[Z]),onItemLeave:x.useCallback(I=>{var Q;Z(I)||((Q=R.current)==null||Q.focus(),j(null))},[Z]),onTriggerLeave:x.useCallback(I=>{Z(I)&&I.preventDefault()},[Z]),pointerGraceTimerRef:q,onPointerGraceIntentChange:x.useCallback(I=>{T.current=I},[]),children:c.jsx(W,{...te,children:c.jsx(sf,{asChild:!0,trapped:s,onMountAutoFocus:ue(i,I=>{var Q;I.preventDefault(),(Q=R.current)==null||Q.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:c.jsx(wa,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,onDismiss:h,children:c.jsx(_A,{asChild:!0,..._,dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:E,onCurrentTabStopIdChange:j,onEntryFocus:ue(l,I=>{v.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(Og,{role:"menu","aria-orientation":"vertical","data-state":Tb(w.open),"data-radix-menu-content":"",dir:v.dir,...p,...m,ref:D,style:{outline:"none",...m.style},onKeyDown:ue(m.onKeyDown,I=>{const z=I.target.closest("[data-radix-menu-content]")===I.currentTarget,V=I.ctrlKey||I.altKey||I.metaKey,de=I.key.length===1;z&&(I.key==="Tab"&&I.preventDefault(),!V&&de&&$(I.key));const ne=R.current;if(I.target!==ne||!cO.includes(I.key))return;I.preventDefault();const Pe=C().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);ob.includes(I.key)&&Pe.reverse(),RO(Pe)}),onBlur:ue(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(P.current),L.current="")}),onPointerMove:ue(e.onPointerMove,Ul(I=>{const Q=I.target,z=b.current!==I.clientX;if(I.currentTarget.contains(Q)&&z){const V=I.clientX>b.current?"right":"left";F.current=V,b.current=I.clientX}}))})})})})})})});fb.displayName=Gr;var _O="MenuGroup",Vg=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return c.jsx(Ve.div,{role:"group",...n,ref:t})});Vg.displayName=_O;var bO="MenuLabel",hb=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return c.jsx(Ve.div,{...n,ref:t})});hb.displayName=bO;var dd="MenuItem",a0="menu.itemSelect",ff=x.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,i=x.useRef(null),o=pc(dd,e.__scopeMenu),a=zg(dd,e.__scopeMenu),l=Xe(t,i),u=x.useRef(!1),d=()=>{const f=i.current;if(!r&&f){const g=new CustomEvent(a0,{bubbles:!0,cancelable:!0});f.addEventListener(a0,h=>n==null?void 0:n(h),{once:!0}),bg(f,g),g.defaultPrevented?u.current=!1:o.onClose()}};return c.jsx(pb,{...s,ref:l,disabled:r,onClick:ue(e.onClick,d),onPointerDown:f=>{var g;(g=e.onPointerDown)==null||g.call(e,f),u.current=!0},onPointerUp:ue(e.onPointerUp,f=>{var g;u.current||(g=f.currentTarget)==null||g.click()}),onKeyDown:ue(e.onKeyDown,f=>{const g=a.searchRef.current!=="";r||g&&f.key===" "||Bp.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});ff.displayName=dd;var pb=x.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...i}=e,o=zg(dd,r),a=lb(r),l=x.useRef(null),u=Xe(t,l),[d,f]=x.useState(!1),[g,h]=x.useState("");return x.useEffect(()=>{const y=l.current;y&&h((y.textContent??"").trim())},[i.children]),c.jsx(zl.ItemSlot,{scope:r,disabled:n,textValue:s??g,children:c.jsx(bA,{asChild:!0,...a,focusable:!n,children:c.jsx(Ve.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:u,onPointerMove:ue(e.onPointerMove,Ul(y=>{n?o.onItemLeave(y):(o.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ue(e.onPointerLeave,Ul(y=>o.onItemLeave(y))),onFocus:ue(e.onFocus,()=>f(!0)),onBlur:ue(e.onBlur,()=>f(!1))})})})}),SO="MenuCheckboxItem",mb=x.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return c.jsx(wb,{scope:e.__scopeMenu,checked:r,children:c.jsx(ff,{role:"menuitemcheckbox","aria-checked":fd(r)?"mixed":r,...s,ref:t,"data-state":$g(r),onSelect:ue(s.onSelect,()=>n==null?void 0:n(fd(r)?!0:!r),{checkForDefaultPrevented:!1})})})});mb.displayName=SO;var gb="MenuRadioGroup",[kO,CO]=eo(gb,{value:void 0,onValueChange:()=>{}}),vb=x.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,i=At(n);return c.jsx(kO,{scope:e.__scopeMenu,value:r,onValueChange:i,children:c.jsx(Vg,{...s,ref:t})})});vb.displayName=gb;var yb="MenuRadioItem",xb=x.forwardRef((e,t)=>{const{value:r,...n}=e,s=CO(yb,e.__scopeMenu),i=r===s.value;return c.jsx(wb,{scope:e.__scopeMenu,checked:i,children:c.jsx(ff,{role:"menuitemradio","aria-checked":i,...n,ref:t,"data-state":$g(i),onSelect:ue(n.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,r)},{checkForDefaultPrevented:!1})})})});xb.displayName=yb;var Wg="MenuItemIndicator",[wb,EO]=eo(Wg,{checked:!1}),_b=x.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,i=EO(Wg,r);return c.jsx(Er,{present:n||fd(i.checked)||i.checked===!0,children:c.jsx(Ve.span,{...s,ref:t,"data-state":$g(i.checked)})})});_b.displayName=Wg;var jO="MenuSeparator",bb=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return c.jsx(Ve.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});bb.displayName=jO;var TO="MenuArrow",Sb=x.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=df(r);return c.jsx(Mg,{...s,...n,ref:t})});Sb.displayName=TO;var NO="MenuSub",[y8,kb]=eo(NO),qa="MenuSubTrigger",Cb=x.forwardRef((e,t)=>{const r=to(qa,e.__scopeMenu),n=pc(qa,e.__scopeMenu),s=kb(qa,e.__scopeMenu),i=zg(qa,e.__scopeMenu),o=x.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,u={__scopeMenu:e.__scopeMenu},d=x.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return x.useEffect(()=>d,[d]),x.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),c.jsx(Lg,{asChild:!0,...u,children:c.jsx(pb,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":Tb(r.open),...e,ref:ef(t,s.onTriggerChange),onClick:f=>{var g;(g=e.onClick)==null||g.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ue(e.onPointerMove,Ul(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:ue(e.onPointerLeave,Ul(f=>{var h,y;d();const g=(h=r.content)==null?void 0:h.getBoundingClientRect();if(g){const m=(y=r.content)==null?void 0:y.dataset.side,w=m==="right",v=w?-5:5,p=g[w?"left":"right"],_=g[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+v,y:f.clientY},{x:p,y:g.top},{x:_,y:g.top},{x:_,y:g.bottom},{x:p,y:g.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ue(e.onKeyDown,f=>{var h;const g=i.searchRef.current!=="";e.disabled||g&&f.key===" "||uO[n.dir].includes(f.key)&&(r.onOpenChange(!0),(h=r.content)==null||h.focus(),f.preventDefault())})})})});Cb.displayName=qa;var Eb="MenuSubContent",jb=x.forwardRef((e,t)=>{const r=ub(Gr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,i=to(Gr,e.__scopeMenu),o=pc(Gr,e.__scopeMenu),a=kb(Eb,e.__scopeMenu),l=x.useRef(null),u=Xe(t,l);return c.jsx(zl.Provider,{scope:e.__scopeMenu,children:c.jsx(Er,{present:n||i.open,children:c.jsx(zl.Slot,{scope:e.__scopeMenu,children:c.jsx(Ug,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;o.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ue(e.onFocusOutside,d=>{d.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ue(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:ue(e.onKeyDown,d=>{var h;const f=d.currentTarget.contains(d.target),g=dO[o.dir].includes(d.key);f&&g&&(i.onOpenChange(!1),(h=a.trigger)==null||h.focus(),d.preventDefault())})})})})})});jb.displayName=Eb;function Tb(e){return e?"open":"closed"}function fd(e){return e==="indeterminate"}function $g(e){return fd(e)?"indeterminate":e?"checked":"unchecked"}function RO(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function PO(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function DO(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=PO(e,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==r));const l=o.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function AO(e,t){const{x:r,y:n}=e;let s=!1;for(let i=0,o=t.length-1;in!=d>n&&r<(u-a)*(n-l)/(d-l)+a&&(s=!s)}return s}function OO(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return AO(r,t)}function Ul(e){return t=>t.pointerType==="mouse"?e(t):void 0}var MO=cb,IO=Lg,LO=db,FO=fb,zO=Vg,UO=hb,VO=ff,WO=mb,$O=vb,BO=xb,HO=_b,YO=bb,ZO=Sb,KO=Cb,GO=jb,Bg="DropdownMenu",[qO,x8]=Qr(Bg,[ab]),yr=ab(),[XO,Nb]=qO(Bg),Rb=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,l=yr(t),u=x.useRef(null),[d=!1,f]=oi({prop:s,defaultProp:i,onChange:o});return c.jsx(XO,{scope:t,triggerId:zn(),triggerRef:u,contentId:zn(),open:d,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(g=>!g),[f]),modal:a,children:c.jsx(MO,{...l,open:d,onOpenChange:f,dir:n,modal:a,children:r})})};Rb.displayName=Bg;var Pb="DropdownMenuTrigger",Db=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,i=Nb(Pb,r),o=yr(r);return c.jsx(IO,{asChild:!0,...o,children:c.jsx(Ve.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:ef(t,i.triggerRef),onPointerDown:ue(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:ue(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Db.displayName=Pb;var QO="DropdownMenuPortal",Ab=e=>{const{__scopeDropdownMenu:t,...r}=e,n=yr(t);return c.jsx(LO,{...n,...r})};Ab.displayName=QO;var Ob="DropdownMenuContent",Mb=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Nb(Ob,r),i=yr(r),o=x.useRef(!1);return c.jsx(FO,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...n,ref:t,onCloseAutoFocus:ue(e.onCloseAutoFocus,a=>{var l;o.current||(l=s.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:ue(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;(!s.modal||d)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Mb.displayName=Ob;var JO="DropdownMenuGroup",eM=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(zO,{...s,...n,ref:t})});eM.displayName=JO;var tM="DropdownMenuLabel",Ib=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(UO,{...s,...n,ref:t})});Ib.displayName=tM;var rM="DropdownMenuItem",Lb=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(VO,{...s,...n,ref:t})});Lb.displayName=rM;var nM="DropdownMenuCheckboxItem",Fb=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(WO,{...s,...n,ref:t})});Fb.displayName=nM;var sM="DropdownMenuRadioGroup",iM=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx($O,{...s,...n,ref:t})});iM.displayName=sM;var oM="DropdownMenuRadioItem",zb=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(BO,{...s,...n,ref:t})});zb.displayName=oM;var aM="DropdownMenuItemIndicator",Ub=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(HO,{...s,...n,ref:t})});Ub.displayName=aM;var lM="DropdownMenuSeparator",Vb=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(YO,{...s,...n,ref:t})});Vb.displayName=lM;var cM="DropdownMenuArrow",uM=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(ZO,{...s,...n,ref:t})});uM.displayName=cM;var dM="DropdownMenuSubTrigger",Wb=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(KO,{...s,...n,ref:t})});Wb.displayName=dM;var fM="DropdownMenuSubContent",$b=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(GO,{...s,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$b.displayName=fM;var hM=Rb,pM=Db,mM=Ab,Bb=Mb,Hb=Ib,Yb=Lb,Zb=Fb,Kb=zb,Gb=Ub,qb=Vb,Xb=Wb,Qb=$b;const Jb=hM,eS=pM,gM=x.forwardRef(({className:e,inset:t,children:r,...n},s)=>c.jsxs(Xb,{ref:s,className:pe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,c.jsx(FR,{className:"ml-auto h-4 w-4"})]}));gM.displayName=Xb.displayName;const vM=x.forwardRef(({className:e,...t},r)=>c.jsx(Qb,{ref:r,className:pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));vM.displayName=Qb.displayName;const Hg=x.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(mM,{children:c.jsx(Bb,{ref:n,sideOffset:t,className:pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Hg.displayName=Bb.displayName;const Zo=x.forwardRef(({className:e,inset:t,...r},n)=>c.jsx(Yb,{ref:n,className:pe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));Zo.displayName=Yb.displayName;const yM=x.forwardRef(({className:e,children:t,checked:r,...n},s)=>c.jsxs(Zb,{ref:s,className:pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Gb,{children:c.jsx(f1,{className:"h-4 w-4"})})}),t]}));yM.displayName=Zb.displayName;const xM=x.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Kb,{ref:n,className:pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Gb,{children:c.jsx(VR,{className:"h-2 w-2 fill-current"})})}),t]}));xM.displayName=Kb.displayName;const tS=x.forwardRef(({className:e,inset:t,...r},n)=>c.jsx(Hb,{ref:n,className:pe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));tS.displayName=Hb.displayName;const rS=x.forwardRef(({className:e,...t},r)=>c.jsx(qb,{ref:r,className:pe("-mx-1 my-1 h-px bg-muted",e),...t}));rS.displayName=qb.displayName;var Yg="Dialog",[nS,sS]=Qr(Yg),[wM,kn]=nS(Yg),iS=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,a=x.useRef(null),l=x.useRef(null),[u=!1,d]=oi({prop:n,defaultProp:s,onChange:i});return c.jsx(wM,{scope:t,triggerRef:a,contentRef:l,contentId:zn(),titleId:zn(),descriptionId:zn(),open:u,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(f=>!f),[d]),modal:o,children:r})};iS.displayName=Yg;var oS="DialogTrigger",aS=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=kn(oS,r),i=Xe(t,s.triggerRef);return c.jsx(Ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Gg(s.open),...n,ref:i,onClick:ue(e.onClick,s.onOpenToggle)})});aS.displayName=oS;var Zg="DialogPortal",[_M,lS]=nS(Zg,{forceMount:void 0}),cS=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,i=kn(Zg,t);return c.jsx(_M,{scope:t,forceMount:r,children:x.Children.map(n,o=>c.jsx(Er,{present:r||i.open,children:c.jsx(fc,{asChild:!0,container:s,children:o})}))})};cS.displayName=Zg;var hd="DialogOverlay",uS=x.forwardRef((e,t)=>{const r=lS(hd,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=kn(hd,e.__scopeDialog);return i.modal?c.jsx(Er,{present:n||i.open,children:c.jsx(bM,{...s,ref:t})}):null});uS.displayName=hd;var bM=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=kn(hd,r);return c.jsx(uf,{as:xs,allowPinchZoom:!0,shards:[s.contentRef],children:c.jsx(Ve.div,{"data-state":Gg(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Ki="DialogContent",dS=x.forwardRef((e,t)=>{const r=lS(Ki,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=kn(Ki,e.__scopeDialog);return c.jsx(Er,{present:n||i.open,children:i.modal?c.jsx(SM,{...s,ref:t}):c.jsx(kM,{...s,ref:t})})});dS.displayName=Ki;var SM=x.forwardRef((e,t)=>{const r=kn(Ki,e.__scopeDialog),n=x.useRef(null),s=Xe(t,r.contentRef,n);return x.useEffect(()=>{const i=n.current;if(i)return Ig(i)},[]),c.jsx(fS,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ue(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ue(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:ue(e.onFocusOutside,i=>i.preventDefault())})}),kM=x.forwardRef((e,t)=>{const r=kn(Ki,e.__scopeDialog),n=x.useRef(!1),s=x.useRef(!1);return c.jsx(fS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),fS=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,a=kn(Ki,r),l=x.useRef(null),u=Xe(t,l);return Sg(),c.jsxs(c.Fragment,{children:[c.jsx(sf,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:c.jsx(wa,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Gg(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(EM,{titleId:a.titleId}),c.jsx(TM,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Kg="DialogTitle",hS=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=kn(Kg,r);return c.jsx(Ve.h2,{id:s.titleId,...n,ref:t})});hS.displayName=Kg;var pS="DialogDescription",mS=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=kn(pS,r);return c.jsx(Ve.p,{id:s.descriptionId,...n,ref:t})});mS.displayName=pS;var gS="DialogClose",vS=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=kn(gS,r);return c.jsx(Ve.button,{type:"button",...n,ref:t,onClick:ue(e.onClick,()=>s.onOpenChange(!1))})});vS.displayName=gS;function Gg(e){return e?"open":"closed"}var yS="DialogTitleWarning",[CM,xS]=AP(yS,{contentName:Ki,titleName:Kg,docsSlug:"dialog"}),EM=({titleId:e})=>{const t=xS(yS),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},jM="DialogDescriptionWarning",TM=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${xS(jM).contentName}}.`;return x.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},qg=iS,Xg=aS,Qg=cS,mc=uS,gc=dS,vc=hS,yc=mS,hf=vS;const Jg=qg,ev=Xg,NM=Qg,wS=x.forwardRef(({className:e,...t},r)=>c.jsx(mc,{className:pe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));wS.displayName=mc.displayName;const RM=uc("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),pf=x.forwardRef(({side:e="right",className:t,children:r,...n},s)=>c.jsxs(NM,{children:[c.jsx(wS,{}),c.jsxs(gc,{ref:s,className:pe(RM({side:e}),t),...n,children:[r,c.jsxs(hf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[c.jsx(xg,{className:"h-4 w-4 dark:text-stone-200"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));pf.displayName=gc.displayName;const tv=({className:e,...t})=>c.jsx("div",{className:pe("flex flex-col space-y-2 text-center sm:text-left",e),...t});tv.displayName="SheetHeader";const rv=x.forwardRef(({className:e,...t},r)=>c.jsx(vc,{ref:r,className:pe("text-lg font-semibold text-foreground",e),...t}));rv.displayName=vc.displayName;const PM=x.forwardRef(({className:e,...t},r)=>c.jsx(yc,{ref:r,className:pe("text-sm text-muted-foreground",e),...t}));PM.displayName=yc.displayName;class Ir extends Error{constructor(t){var r,n,s,i;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Ir.prototype),t!==null&&typeof t=="object"&&(this.url=typeof t.url=="string"?t.url:"",this.status=typeof t.status=="number"?t.status:0,this.isAbort=!!t.isAbort,this.originalError=t.originalError,t.response!==null&&typeof t.response=="object"?this.response=t.response:t.data!==null&&typeof t.data=="object"?this.response=t.data:this.response={}),this.originalError||t instanceof Ir||(this.originalError=t),typeof DOMException<"u"&&t instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(r=this.response)==null?void 0:r.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(i=(s=(n=this.originalError)==null?void 0:n.cause)==null?void 0:s.message)!=null&&i.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const iu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function DM(e,t){const r={};if(typeof e!="string")return r;const n=Object.assign({},{}).decode||AM;let s=0;for(;s0&&(!r.exp||r.exp-t>Date.now()/1e3))}_S=typeof atob!="function"||MM?e=>{let t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,i=0,o="";n=t.charAt(i++);~n&&(r=s%4?64*r+n:n,s++%4)?o+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return o}:atob;const c0="pb_auth";class IM{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!bS(this.token)}get isAdmin(){return Ko(this.token).type==="admin"}get isAuthRecord(){return Ko(this.token).type==="authRecord"}save(t,r){this.baseToken=t||"",this.baseModel=r||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(t,r=c0){const n=DM(t||"")[r]||"";let s={};try{s=JSON.parse(n),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)}exportToCookie(t,r=c0){var l,u;const n={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=Ko(this.token);n.expires=s!=null&&s.exp?new Date(1e3*s.exp):new Date("1970-01-01"),t=Object.assign({},n,t);const i={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let o=l0(r,JSON.stringify(i),t);const a=typeof Blob<"u"?new Blob([o]).size:o.length;if(i.model&&a>4096){i.model={id:(l=i==null?void 0:i.model)==null?void 0:l.id,email:(u=i==null?void 0:i.model)==null?void 0:u.email};const d=["collectionId","username","verified"];for(const f in this.model)d.includes(f)&&(i.model[f]=this.model[f]);o=l0(r,JSON.stringify(i),t)}return o}onChange(t,r=!1){return this._onChangeCallbacks.push(t),r&&t(this.token,this.model),()=>{for(let n=this._onChangeCallbacks.length-1;n>=0;n--)if(this._onChangeCallbacks[n]==t)return delete this._onChangeCallbacks[n],void this._onChangeCallbacks.splice(n,1)}}triggerChange(){for(const t of this._onChangeCallbacks)t&&t(this.token,this.model)}}class LM extends IM{constructor(t="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=t,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(t,r){this._storageSet(this.storageKey,{token:t,model:r}),super.save(t,r)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(t){if(typeof window<"u"&&(window!=null&&window.localStorage)){const r=window.localStorage.getItem(t)||"";try{return JSON.parse(r)}catch{return r}}return this.storageFallback[t]}_storageSet(t,r){if(typeof window<"u"&&(window!=null&&window.localStorage)){let n=r;typeof r!="string"&&(n=JSON.stringify(r)),window.localStorage.setItem(t,n)}else this.storageFallback[t]=r}_storageRemove(t){var r;typeof window<"u"&&(window!=null&&window.localStorage)&&((r=window.localStorage)==null||r.removeItem(t)),delete this.storageFallback[t]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",t=>{if(t.key!=this.storageKey)return;const r=this._storageGet(this.storageKey)||{};super.save(r.token||"",r.model||null)})}}class ro{constructor(t){this.client=t}}class FM extends ro{async getAll(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/settings",t)}async update(t,r){return r=Object.assign({method:"PATCH",body:t},r),this.client.send("/api/settings",r)}async testS3(t="storage",r){return r=Object.assign({method:"POST",body:{filesystem:t}},r),this.client.send("/api/settings/test/s3",r).then(()=>!0)}async testEmail(t,r,n){return n=Object.assign({method:"POST",body:{email:t,template:r}},n),this.client.send("/api/settings/test/email",n).then(()=>!0)}async generateAppleClientSecret(t,r,n,s,i,o){return o=Object.assign({method:"POST",body:{clientId:t,teamId:r,keyId:n,privateKey:s,duration:i}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class nv extends ro{decode(t){return t}async getFullList(t,r){if(typeof t=="number")return this._getFullList(t,r);let n=500;return(r=Object.assign({},t,r)).batch&&(n=r.batch,delete r.batch),this._getFullList(n,r)}async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send(this.baseCrudPath,n).then(s=>{var i;return s.items=((i=s.items)==null?void 0:i.map(o=>this.decode(o)))||[],s})}async getFirstListItem(t,r){return(r=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+t},r)).query=Object.assign({filter:t,skipTotal:1},r.query),this.getList(1,1,r).then(n=>{var s;if(!((s=n==null?void 0:n.items)!=null&&s.length))throw new Ir({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return n.items[0]})}async getOne(t,r){if(!t)throw new Ir({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(n=>this.decode(n))}async create(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send(this.baseCrudPath,r).then(n=>this.decode(n))}async update(t,r,n){return n=Object.assign({method:"PATCH",body:r},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),n).then(s=>this.decode(s))}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(()=>!0)}_getFullList(t=500,r){(r=r||{}).query=Object.assign({skipTotal:1},r.query);let n=[],s=async i=>this.getList(i,t||500,r).then(o=>{const a=o.items;return n=n.concat(a),a.length==o.perPage?s(i+1):n});return s(1)}}function Tr(e,t,r,n){const s=n!==void 0;return s||r!==void 0?s?(console.warn(e),t.body=Object.assign({},t.body,r),t.query=Object.assign({},t.query,n),t):Object.assign(t,r):t}function Th(e){var t;(t=e._resetAutoRefresh)==null||t.call(e)}class zM extends nv{get baseCrudPath(){return"/api/admins"}async update(t,r,n){return super.update(t,r,n).then(s=>{var i,o;return((i=this.client.authStore.model)==null?void 0:i.id)===s.id&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,i;return n&&((s=this.client.authStore.model)==null?void 0:s.id)===t&&((i=this.client.authStore.model)==null?void 0:i.collectionId)===void 0&&this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.admin)||{});return t!=null&&t.token&&(t!=null&&t.admin)&&this.client.authStore.save(t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:r})}async authWithPassword(t,r,n,s){let i={method:"POST",body:{identity:t,password:r}};i=Tr("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",i,n,s);const o=i.autoRefreshThreshold;delete i.autoRefreshThreshold,i.autoRefresh||Th(this.client);let a=await this.client.send(this.baseCrudPath+"/auth-with-password",i);return a=this.authResponse(a),o&&function(u,d,f,g){Th(u);const h=u.beforeSend,y=u.authStore.model,m=u.authStore.onChange((w,v)=>{(!w||(v==null?void 0:v.id)!=(y==null?void 0:y.id)||(v!=null&&v.collectionId||y!=null&&y.collectionId)&&(v==null?void 0:v.collectionId)!=(y==null?void 0:y.collectionId))&&Th(u)});u._resetAutoRefresh=function(){m(),u.beforeSend=h,delete u._resetAutoRefresh},u.beforeSend=async(w,v)=>{var E;const p=u.authStore.token;if((E=v.query)!=null&&E.autoRefresh)return h?h(w,v):{url:w,sendOptions:v};let _=u.authStore.isValid;if(_&&bS(u.authStore.token,d))try{await f()}catch{_=!1}_||await g();const C=v.headers||{};for(let j in C)if(j.toLowerCase()=="authorization"&&p==C[j]&&u.authStore.token){C[j]=u.authStore.token;break}return v.headers=C,h?h(w,v):{url:w,sendOptions:v}}}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(t,r,Object.assign({autoRefresh:!0},i))),a}async authRefresh(t,r){let n={method:"POST"};return n=Tr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCrudPath+"/auth-refresh",n).then(this.authResponse.bind(this))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Tr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCrudPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,i){let o={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return o=Tr("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,s,i),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}const UM=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function SS(e){if(e){e.query=e.query||{};for(let t in e)UM.includes(t)||(e.query[t]=e[t],delete e[t])}}class kS extends ro{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(t,r,n){var o;if(!t)throw new Error("topic must be set.");let s=t;if(n){SS(n);const a="options="+encodeURIComponent(JSON.stringify({query:n.query,headers:n.headers}));s+=(s.includes("?")?"&":"?")+a}const i=function(a){const l=a;let u;try{u=JSON.parse(l==null?void 0:l.data)}catch{}r(u||{})};return this.subscriptions[s]||(this.subscriptions[s]=[]),this.subscriptions[s].push(i),this.isConnected?this.subscriptions[s].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(s,i):await this.connect(),async()=>this.unsubscribeByTopicAndListener(t,i)}async unsubscribe(t){var n;let r=!1;if(t){const s=this.getSubscriptionsByTopic(t);for(let i in s)if(this.hasSubscriptionListeners(i)){for(let o of this.subscriptions[i])(n=this.eventSource)==null||n.removeEventListener(i,o);delete this.subscriptions[i],r||(r=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?r&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(t){var n;let r=!1;for(let s in this.subscriptions)if((s+"?").startsWith(t)){r=!0;for(let i of this.subscriptions[s])(n=this.eventSource)==null||n.removeEventListener(s,i);delete this.subscriptions[s]}r&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(t,r){var i;let n=!1;const s=this.getSubscriptionsByTopic(t);for(let o in s){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let a=!1;for(let l=this.subscriptions[o].length-1;l>=0;l--)this.subscriptions[o][l]===r&&(a=!0,delete this.subscriptions[o][l],this.subscriptions[o].splice(l,1),(i=this.eventSource)==null||i.removeEventListener(o,r));a&&(this.subscriptions[o].length||delete this.subscriptions[o],n||this.hasSubscriptionListeners(o)||(n=!0))}this.hasSubscriptionListeners()?n&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(t){var r,n;if(this.subscriptions=this.subscriptions||{},t)return!!((r=this.subscriptions[t])!=null&&r.length);for(let s in this.subscriptions)if((n=this.subscriptions[s])!=null&&n.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(t=>{if(!(t!=null&&t.isAbort))throw t})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(t){const r={};t=t.includes("?")?t:t+"?";for(let n in this.subscriptions)(n+"?").startsWith(t)&&(r[n]=this.subscriptions[n]);return r}getNonEmptySubscriptionKeys(){const t=[];for(let r in this.subscriptions)this.subscriptions[r].length&&t.push(r);return t}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.addEventListener(t,r)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.removeEventListener(t,r)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((t,r)=>{this.pendingConnects.push({resolve:t,reject:r}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=t=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",t=>{const r=t;this.clientId=r==null?void 0:r.lastEventId,this.submitSubscriptions().then(async()=>{let n=3;for(;this.hasUnsentSubscriptions()&&n>0;)n--,await this.submitSubscriptions()}).then(()=>{for(let s of this.pendingConnects)s.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const n=this.getSubscriptionsByTopic("PB_CONNECT");for(let s in n)for(let i of n[s])i(t)}).catch(n=>{this.clientId="",this.connectErrorHandler(n)})})}hasUnsentSubscriptions(){const t=this.getNonEmptySubscriptionKeys();if(t.length!=this.lastSentSubscriptions.length)return!0;for(const r of t)if(!this.lastSentSubscriptions.includes(r))return!0;return!1}connectErrorHandler(t){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let n of this.pendingConnects)n.reject(new Ir(t));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const r=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},r)}disconnect(t=!1){var r;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(r=this.eventSource)==null||r.close(),this.eventSource=null,this.clientId="",!t){this.reconnectAttempts=0;for(let n of this.pendingConnects)n.resolve();this.pendingConnects=[]}}}class VM extends nv{constructor(t,r){super(t),this.collectionIdOrName=r}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(t,r,n){if(!t)throw new Error("Missing topic.");if(!r)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+t,r,n)}async unsubscribe(t){return t?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+t):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(t,r){if(typeof t=="number")return super.getFullList(t,r);const n=Object.assign({},t,r);return super.getFullList(n)}async getList(t=1,r=30,n){return super.getList(t,r,n)}async getFirstListItem(t,r){return super.getFirstListItem(t,r)}async getOne(t,r){return super.getOne(t,r)}async create(t,r){return super.create(t,r)}async update(t,r,n){return super.update(t,r,n).then(s=>{var i,o,a;return((i=this.client.authStore.model)==null?void 0:i.id)!==(s==null?void 0:s.id)||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((a=this.client.authStore.model)==null?void 0:a.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,i,o;return!n||((s=this.client.authStore.model)==null?void 0:s.id)!==t||((i=this.client.authStore.model)==null?void 0:i.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.record)||{});return this.client.authStore.save(t==null?void 0:t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",record:r})}async listAuthMethods(t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCollectionPath+"/auth-methods",t).then(r=>Object.assign({},r,{usernamePassword:!!(r!=null&&r.usernamePassword),emailPassword:!!(r!=null&&r.emailPassword),authProviders:Array.isArray(r==null?void 0:r.authProviders)?r==null?void 0:r.authProviders:[]}))}async authWithPassword(t,r,n,s){let i={method:"POST",body:{identity:t,password:r}};return i=Tr("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",i,n,s),this.client.send(this.baseCollectionPath+"/auth-with-password",i).then(o=>this.authResponse(o))}async authWithOAuth2Code(t,r,n,s,i,o,a){let l={method:"POST",body:{provider:t,code:r,codeVerifier:n,redirectUrl:s,createData:i}};return l=Tr("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",l,o,a),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",l).then(u=>this.authResponse(u))}authWithOAuth2(...t){if(t.length>1||typeof(t==null?void 0:t[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((t==null?void 0:t[0])||"",(t==null?void 0:t[1])||"",(t==null?void 0:t[2])||"",(t==null?void 0:t[3])||"",(t==null?void 0:t[4])||{},(t==null?void 0:t[5])||{},(t==null?void 0:t[6])||{});const r=(t==null?void 0:t[0])||{};let n=null;r.urlCallback||(n=u0(void 0));const s=new kS(this.client);function i(){n==null||n.close(),s.unsubscribe()}const o={},a=r.requestKey;return a&&(o.requestKey=a),this.listAuthMethods(o).then(l=>{var g;const u=l.authProviders.find(h=>h.name===r.provider);if(!u)throw new Ir(new Error(`Missing or invalid provider "${r.provider}".`));const d=this.client.buildUrl("/api/oauth2-redirect"),f=a?(g=this.client.cancelControllers)==null?void 0:g[a]:void 0;return f&&(f.signal.onabort=()=>{i()}),new Promise(async(h,y)=>{var m;try{await s.subscribe("@oauth2",async _=>{var E;const C=s.clientId;try{if(!_.state||C!==_.state)throw new Error("State parameters don't match.");if(_.error||!_.code)throw new Error("OAuth2 redirect error or missing code: "+_.error);const j=Object.assign({},r);delete j.provider,delete j.scopes,delete j.createData,delete j.urlCallback,(E=f==null?void 0:f.signal)!=null&&E.onabort&&(f.signal.onabort=null);const R=await this.authWithOAuth2Code(u.name,_.code,u.codeVerifier,d,r.createData,j);h(R)}catch(j){y(new Ir(j))}i()});const w={state:s.clientId};(m=r.scopes)!=null&&m.length&&(w.scope=r.scopes.join(" "));const v=this._replaceQueryParams(u.authUrl+d,w);await(r.urlCallback||function(_){n?n.location.href=_:n=u0(_)})(v)}catch(w){i(),y(new Ir(w))}})}).catch(l=>{throw i(),l})}async authRefresh(t,r){let n={method:"POST"};return n=Tr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCollectionPath+"/auth-refresh",n).then(s=>this.authResponse(s))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Tr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,i){let o={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return o=Tr("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,s,i),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(t,r,n){let s={method:"POST",body:{email:t}};return s=Tr("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}async confirmVerification(t,r,n){let s={method:"POST",body:{token:t}};return s=Tr("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>{const i=Ko(t),o=this.client.authStore.model;return o&&!o.verified&&o.id===i.id&&o.collectionId===i.collectionId&&(o.verified=!0,this.client.authStore.save(this.client.authStore.token,o)),!0})}async requestEmailChange(t,r,n){let s={method:"POST",body:{newEmail:t}};return s=Tr("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}async confirmEmailChange(t,r,n,s){let i={method:"POST",body:{token:t,password:r}};return i=Tr("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",i,n,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",i).then(()=>{const o=Ko(t),a=this.client.authStore.model;return a&&a.id===o.id&&a.collectionId===o.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(t,r){return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths",r)}async unlinkExternalAuth(t,r,n){return n=Object.assign({method:"DELETE"},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(r),n).then(()=>!0)}_replaceQueryParams(t,r={}){let n=t,s="";t.indexOf("?")>=0&&(n=t.substring(0,t.indexOf("?")),s=t.substring(t.indexOf("?")+1));const i={},o=s.split("&");for(const a of o){if(a=="")continue;const l=a.split("=");i[decodeURIComponent(l[0].replace(/\+/g," "))]=decodeURIComponent((l[1]||"").replace(/\+/g," "))}for(let a in r)r.hasOwnProperty(a)&&(r[a]==null?delete i[a]:i[a]=r[a]);s="";for(let a in i)i.hasOwnProperty(a)&&(s!=""&&(s+="&"),s+=encodeURIComponent(a.replace(/%20/g,"+"))+"="+encodeURIComponent(i[a].replace(/%20/g,"+")));return s!=""?n+"?"+s:n}}function u0(e){if(typeof window>"u"||!(window!=null&&window.open))throw new Ir(new Error("Not in a browser context - please pass a custom urlCallback function."));let t=1024,r=768,n=window.innerWidth,s=window.innerHeight;t=t>n?n:t,r=r>s?s:r;let i=n/2-t/2,o=s/2-r/2;return window.open(e,"popup_window","width="+t+",height="+r+",top="+o+",left="+i+",resizable,menubar=no")}class WM extends nv{get baseCrudPath(){return"/api/collections"}async import(t,r=!1,n){return n=Object.assign({method:"PUT",body:{collections:t,deleteMissing:r}},n),this.client.send(this.baseCrudPath+"/import",n).then(()=>!0)}}class $M extends ro{async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send("/api/logs",n)}async getOne(t,r){if(!t)throw new Ir({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send("/api/logs/"+encodeURIComponent(t),r)}async getStats(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/stats",t)}}class BM extends ro{async check(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/health",t)}}class HM extends ro{getUrl(t,r,n={}){if(!r||!(t!=null&&t.id)||!(t!=null&&t.collectionId)&&!(t!=null&&t.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(t.collectionId||t.collectionName)),s.push(encodeURIComponent(t.id)),s.push(encodeURIComponent(r));let i=this.client.buildUrl(s.join("/"));if(Object.keys(n).length){n.download===!1&&delete n.download;const o=new URLSearchParams(n);i+=(i.includes("?")?"&":"?")+o}return i}async getToken(t){return t=Object.assign({method:"POST"},t),this.client.send("/api/files/token",t).then(r=>(r==null?void 0:r.token)||"")}}class YM extends ro{async getFullList(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/backups",t)}async create(t,r){return r=Object.assign({method:"POST",body:{name:t}},r),this.client.send("/api/backups",r).then(()=>!0)}async upload(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send("/api/backups/upload",r).then(()=>!0)}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}`,r).then(()=>!0)}async restore(t,r){return r=Object.assign({method:"POST"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}/restore`,r).then(()=>!0)}getDownloadUrl(t,r){return this.client.buildUrl(`/api/backups/${encodeURIComponent(r)}?token=${encodeURIComponent(t)}`)}}class ZM{constructor(t="/",r,n="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=t,this.lang=n,this.authStore=r||new LM,this.admins=new zM(this),this.collections=new WM(this),this.files=new HM(this),this.logs=new $M(this),this.settings=new FM(this),this.realtime=new kS(this),this.health=new BM(this),this.backups=new YM(this)}collection(t){return this.recordServices[t]||(this.recordServices[t]=new VM(this,t)),this.recordServices[t]}autoCancellation(t){return this.enableAutoCancellation=!!t,this}cancelRequest(t){return this.cancelControllers[t]&&(this.cancelControllers[t].abort(),delete this.cancelControllers[t]),this}cancelAllRequests(){for(let t in this.cancelControllers)this.cancelControllers[t].abort();return this.cancelControllers={},this}filter(t,r){if(!r)return t;for(let n in r){let s=r[n];switch(typeof s){case"boolean":case"number":s=""+s;break;case"string":s="'"+s.replace(/'/g,"\\'")+"'";break;default:s=s===null?"null":s instanceof Date?"'"+s.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(s).replace(/'/g,"\\'")+"'"}t=t.replaceAll("{:"+n+"}",s)}return t}getFileUrl(t,r,n={}){return this.files.getUrl(t,r,n)}buildUrl(t){var n;let r=this.baseUrl;return typeof window>"u"||!window.location||r.startsWith("https://")||r.startsWith("http://")||(r=(n=window.location.origin)!=null&&n.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(r+=window.location.pathname||"/",r+=r.endsWith("/")?"":"/"),r+=this.baseUrl),t&&(r+=r.endsWith("/")?"":"/",r+=t.startsWith("/")?t.substring(1):t),r}async send(t,r){r=this.initSendOptions(t,r);let n=this.buildUrl(t);if(this.beforeSend){const s=Object.assign({},await this.beforeSend(n,r));s.url!==void 0||s.options!==void 0?(n=s.url||n,r=s.options||r):Object.keys(s).length&&(r=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(r.query!==void 0){const s=this.serializeQueryParams(r.query);s&&(n+=(n.includes("?")?"&":"?")+s),delete r.query}return this.getHeader(r.headers,"Content-Type")=="application/json"&&r.body&&typeof r.body!="string"&&(r.body=JSON.stringify(r.body)),(r.fetch||fetch)(n,r).then(async s=>{let i={};try{i=await s.json()}catch{}if(this.afterSend&&(i=await this.afterSend(s,i)),s.status>=400)throw new Ir({url:s.url,status:s.status,data:i});return i}).catch(s=>{throw new Ir(s)})}initSendOptions(t,r){if((r=Object.assign({method:"GET"},r)).body=this.convertToFormDataIfNeeded(r.body),SS(r),r.query=Object.assign({},r.params,r.query),r.requestKey===void 0&&(r.$autoCancel===!1||r.query.$autoCancel===!1?r.requestKey=null:(r.$cancelKey||r.query.$cancelKey)&&(r.requestKey=r.$cancelKey||r.query.$cancelKey)),delete r.$autoCancel,delete r.query.$autoCancel,delete r.$cancelKey,delete r.query.$cancelKey,this.getHeader(r.headers,"Content-Type")!==null||this.isFormData(r.body)||(r.headers=Object.assign({},r.headers,{"Content-Type":"application/json"})),this.getHeader(r.headers,"Accept-Language")===null&&(r.headers=Object.assign({},r.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(r.headers,"Authorization")===null&&(r.headers=Object.assign({},r.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&r.requestKey!==null){const n=r.requestKey||(r.method||"GET")+t;delete r.requestKey,this.cancelRequest(n);const s=new AbortController;this.cancelControllers[n]=s,r.signal=s.signal}return r}convertToFormDataIfNeeded(t){if(typeof FormData>"u"||t===void 0||typeof t!="object"||t===null||this.isFormData(t)||!this.hasBlobField(t))return t;const r=new FormData;for(const n in t){const s=t[n];if(typeof s!="object"||this.hasBlobField({data:s})){const i=Array.isArray(s)?s:[s];for(let o of i)r.append(n,o)}else{let i={};i[n]=s,r.append("@jsonPayload",JSON.stringify(i))}}return r}hasBlobField(t){for(const r in t){const n=Array.isArray(t[r])?t[r]:[t[r]];for(const s of n)if(typeof Blob<"u"&&s instanceof Blob||typeof File<"u"&&s instanceof File)return!0}return!1}getHeader(t,r){t=t||{},r=r.toLowerCase();for(let n in t)if(n.toLowerCase()==r)return t[n];return null}isFormData(t){return t&&(t.constructor.name==="FormData"||typeof FormData<"u"&&t instanceof FormData)}serializeQueryParams(t){const r=[];for(const n in t){if(t[n]===null)continue;const s=t[n],i=encodeURIComponent(n);if(Array.isArray(s))for(const o of s)r.push(i+"="+encodeURIComponent(o));else s instanceof Date?r.push(i+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?r.push(i+"="+encodeURIComponent(JSON.stringify(s))):r.push(i+"="+encodeURIComponent(s))}return r.join("&")}}var KM={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const GM=KM.VITE_API_DOMAIN;console.log(GM);let ou;const xt=()=>ou||(ou=new ZM("/"),ou);//! moment.js //! version : 2.30.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com var CS;function ge(){return CS.apply(null,arguments)}function qM(e){CS=e}function wn(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Li(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function lt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function sv(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(lt(e,t))return!1;return!0}function xr(e){return e===void 0}function bs(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function xc(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function ES(e,t){var r=[],n,s=e.length;for(n=0;n>>0,n;for(n=0;n0)for(r=0;r=0;return(i?r?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+n}var lv=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,au=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Rh={},Go={};function Oe(e,t,r,n){var s=n;typeof n=="string"&&(s=function(){return this[n]()}),e&&(Go[e]=s),t&&(Go[t[0]]=function(){return Wn(s.apply(this,arguments),t[1],t[2])}),r&&(Go[r]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function tI(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function rI(e){var t=e.match(lv),r,n;for(r=0,n=t.length;r=0&&au.test(e);)e=e.replace(au,n),au.lastIndex=0,r-=1;return e}var nI={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function sI(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(lv).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[e])}var iI="Invalid date";function oI(){return this._invalidDate}var aI="%d",lI=/\d{1,2}/;function cI(e){return this._ordinal.replace("%d",e)}var uI={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function dI(e,t,r,n){var s=this._relativeTime[r];return Zn(s)?s(e,t,r,n):s.replace(/%d/i,e)}function fI(e,t){var r=this._relativeTime[e>0?"future":"past"];return Zn(r)?r(t):r.replace(/%s/i,t)}var h0={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function en(e){return typeof e=="string"?h0[e]||h0[e.toLowerCase()]:void 0}function cv(e){var t={},r,n;for(n in e)lt(e,n)&&(r=en(n),r&&(t[r]=e[n]));return t}var hI={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function pI(e){var t=[],r;for(r in e)lt(e,r)&&t.push({unit:r,priority:hI[r]});return t.sort(function(n,s){return n.priority-s.priority}),t}var RS=/\d/,Vr=/\d\d/,PS=/\d{3}/,uv=/\d{4}/,gf=/[+-]?\d{6}/,Ct=/\d\d?/,DS=/\d\d\d\d?/,AS=/\d\d\d\d\d\d?/,vf=/\d{1,3}/,dv=/\d{1,4}/,yf=/[+-]?\d{1,6}/,ka=/\d+/,xf=/[+-]?\d+/,mI=/Z|[+-]\d\d:?\d\d/gi,wf=/Z|[+-]\d\d(?::?\d\d)?/gi,gI=/[+-]?\d+(\.\d{1,3})?/,_c=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ca=/^[1-9]\d?/,fv=/^([1-9]\d|\d)/,pd;pd={};function _e(e,t,r){pd[e]=Zn(t)?t:function(n,s){return n&&r?r:t}}function vI(e,t){return lt(pd,e)?pd[e](t._strict,t._locale):new RegExp(yI(e))}function yI(e){return hs(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,r,n,s,i){return r||n||s||i}))}function hs(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Yr(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function tt(e){var t=+e,r=0;return t!==0&&isFinite(t)&&(r=Yr(t)),r}var Kp={};function mt(e,t){var r,n=t,s;for(typeof e=="string"&&(e=[e]),bs(t)&&(n=function(i,o){o[t]=tt(i)}),s=e.length,r=0;r68?1900:2e3)};var OS=Ea("FullYear",!0);function bI(){return _f(this.year())}function Ea(e,t){return function(r){return r!=null?(MS(this,e,r),ge.updateOffset(this,t),this):Vl(this,e)}}function Vl(e,t){if(!e.isValid())return NaN;var r=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function MS(e,t,r){var n,s,i,o,a;if(!(!e.isValid()||isNaN(r))){switch(n=e._d,s=e._isUTC,t){case"Milliseconds":return void(s?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(s?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(s?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(s?n.setUTCHours(r):n.setHours(r));case"Date":return void(s?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}i=r,o=e.month(),a=e.date(),a=a===29&&o===1&&!_f(i)?28:a,s?n.setUTCFullYear(i,o,a):n.setFullYear(i,o,a)}}function SI(e){return e=en(e),Zn(this[e])?this[e]():this}function kI(e,t){if(typeof e=="object"){e=cv(e);var r=pI(e),n,s=r.length;for(n=0;n=0?(a=new Date(e+400,t,r,n,s,i,o),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,r,n,s,i,o),a}function Wl(e){var t,r;return e<100&&e>=0?(r=Array.prototype.slice.call(arguments),r[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function md(e,t,r){var n=7+t-r,s=(7+Wl(e,0,n).getUTCDay()-t)%7;return-s+n-1}function VS(e,t,r,n,s){var i=(7+r-n)%7,o=md(e,n,s),a=1+7*(t-1)+i+o,l,u;return a<=0?(l=e-1,u=fl(l)+a):a>fl(e)?(l=e+1,u=a-fl(e)):(l=e,u=a),{year:l,dayOfYear:u}}function $l(e,t,r){var n=md(e.year(),t,r),s=Math.floor((e.dayOfYear()-n-1)/7)+1,i,o;return s<1?(o=e.year()-1,i=s+ps(o,t,r)):s>ps(e.year(),t,r)?(i=s-ps(e.year(),t,r),o=e.year()+1):(o=e.year(),i=s),{week:i,year:o}}function ps(e,t,r){var n=md(e,t,r),s=md(e+1,t,r);return(fl(e)-n+s)/7}Oe("w",["ww",2],"wo","week");Oe("W",["WW",2],"Wo","isoWeek");_e("w",Ct,Ca);_e("ww",Ct,Vr);_e("W",Ct,Ca);_e("WW",Ct,Vr);bc(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=tt(e)});function LI(e){return $l(e,this._week.dow,this._week.doy).week}var FI={dow:0,doy:6};function zI(){return this._week.dow}function UI(){return this._week.doy}function VI(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function WI(e){var t=$l(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Oe("d",0,"do","day");Oe("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});Oe("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});Oe("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});Oe("e",0,0,"weekday");Oe("E",0,0,"isoWeekday");_e("d",Ct);_e("e",Ct);_e("E",Ct);_e("dd",function(e,t){return t.weekdaysMinRegex(e)});_e("ddd",function(e,t){return t.weekdaysShortRegex(e)});_e("dddd",function(e,t){return t.weekdaysRegex(e)});bc(["dd","ddd","dddd"],function(e,t,r,n){var s=r._locale.weekdaysParse(e,n,r._strict);s!=null?t.d=s:Ke(r).invalidWeekday=e});bc(["d","e","E"],function(e,t,r,n){t[n]=tt(e)});function $I(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function BI(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function pv(e,t){return e.slice(t,7).concat(e.slice(0,t))}var HI="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),WS="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),YI="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ZI=_c,KI=_c,GI=_c;function qI(e,t){var r=wn(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?pv(r,this._week.dow):e?r[e.day()]:r}function XI(e){return e===!0?pv(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function QI(e){return e===!0?pv(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function JI(e,t,r){var n,s,i,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)i=Yn([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(i,"").toLocaleLowerCase();return r?t==="dddd"?(s=zt.call(this._weekdaysParse,o),s!==-1?s:null):t==="ddd"?(s=zt.call(this._shortWeekdaysParse,o),s!==-1?s:null):(s=zt.call(this._minWeekdaysParse,o),s!==-1?s:null):t==="dddd"?(s=zt.call(this._weekdaysParse,o),s!==-1||(s=zt.call(this._shortWeekdaysParse,o),s!==-1)?s:(s=zt.call(this._minWeekdaysParse,o),s!==-1?s:null)):t==="ddd"?(s=zt.call(this._shortWeekdaysParse,o),s!==-1||(s=zt.call(this._weekdaysParse,o),s!==-1)?s:(s=zt.call(this._minWeekdaysParse,o),s!==-1?s:null)):(s=zt.call(this._minWeekdaysParse,o),s!==-1||(s=zt.call(this._weekdaysParse,o),s!==-1)?s:(s=zt.call(this._shortWeekdaysParse,o),s!==-1?s:null))}function eL(e,t,r){var n,s,i;if(this._weekdaysParseExact)return JI.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=Yn([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(i="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[n]=new RegExp(i.replace(".",""),"i")),r&&t==="dddd"&&this._fullWeekdaysParse[n].test(e))return n;if(r&&t==="ddd"&&this._shortWeekdaysParse[n].test(e))return n;if(r&&t==="dd"&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}}function tL(e){if(!this.isValid())return e!=null?this:NaN;var t=Vl(this,"Day");return e!=null?(e=$I(e,this.localeData()),this.add(e-t,"d")):t}function rL(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function nL(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=BI(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function sL(e){return this._weekdaysParseExact?(lt(this,"_weekdaysRegex")||mv.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(lt(this,"_weekdaysRegex")||(this._weekdaysRegex=ZI),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function iL(e){return this._weekdaysParseExact?(lt(this,"_weekdaysRegex")||mv.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(lt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=KI),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function oL(e){return this._weekdaysParseExact?(lt(this,"_weekdaysRegex")||mv.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(lt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=GI),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function mv(){function e(d,f){return f.length-d.length}var t=[],r=[],n=[],s=[],i,o,a,l,u;for(i=0;i<7;i++)o=Yn([2e3,1]).day(i),a=hs(this.weekdaysMin(o,"")),l=hs(this.weekdaysShort(o,"")),u=hs(this.weekdays(o,"")),t.push(a),r.push(l),n.push(u),s.push(a),s.push(l),s.push(u);t.sort(e),r.sort(e),n.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function gv(){return this.hours()%12||12}function aL(){return this.hours()||24}Oe("H",["HH",2],0,"hour");Oe("h",["hh",2],0,gv);Oe("k",["kk",2],0,aL);Oe("hmm",0,0,function(){return""+gv.apply(this)+Wn(this.minutes(),2)});Oe("hmmss",0,0,function(){return""+gv.apply(this)+Wn(this.minutes(),2)+Wn(this.seconds(),2)});Oe("Hmm",0,0,function(){return""+this.hours()+Wn(this.minutes(),2)});Oe("Hmmss",0,0,function(){return""+this.hours()+Wn(this.minutes(),2)+Wn(this.seconds(),2)});function $S(e,t){Oe(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}$S("a",!0);$S("A",!1);function BS(e,t){return t._meridiemParse}_e("a",BS);_e("A",BS);_e("H",Ct,fv);_e("h",Ct,Ca);_e("k",Ct,Ca);_e("HH",Ct,Vr);_e("hh",Ct,Vr);_e("kk",Ct,Vr);_e("hmm",DS);_e("hmmss",AS);_e("Hmm",DS);_e("Hmmss",AS);mt(["H","HH"],Gt);mt(["k","kk"],function(e,t,r){var n=tt(e);t[Gt]=n===24?0:n});mt(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e});mt(["h","hh"],function(e,t,r){t[Gt]=tt(e),Ke(r).bigHour=!0});mt("hmm",function(e,t,r){var n=e.length-2;t[Gt]=tt(e.substr(0,n)),t[fn]=tt(e.substr(n)),Ke(r).bigHour=!0});mt("hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Gt]=tt(e.substr(0,n)),t[fn]=tt(e.substr(n,2)),t[us]=tt(e.substr(s)),Ke(r).bigHour=!0});mt("Hmm",function(e,t,r){var n=e.length-2;t[Gt]=tt(e.substr(0,n)),t[fn]=tt(e.substr(n))});mt("Hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Gt]=tt(e.substr(0,n)),t[fn]=tt(e.substr(n,2)),t[us]=tt(e.substr(s))});function lL(e){return(e+"").toLowerCase().charAt(0)==="p"}var cL=/[ap]\.?m?\.?/i,uL=Ea("Hours",!0);function dL(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var HS={calendar:JM,longDateFormat:nI,invalidDate:iI,ordinal:aI,dayOfMonthOrdinalParse:lI,relativeTime:uI,months:EI,monthsShort:IS,week:FI,weekdays:HI,weekdaysMin:YI,weekdaysShort:WS,meridiemParse:cL},Tt={},Wa={},Bl;function fL(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r0;){if(s=bf(i.slice(0,r).join("-")),s)return s;if(n&&n.length>=r&&fL(i,n)>=r-1)break;r--}t++}return Bl}function pL(e){return!!(e&&e.match("^[^/\\\\]*$"))}function bf(e){var t=null,r;if(Tt[e]===void 0&&typeof Ou<"u"&&Ou&&Ou.exports&&pL(e))try{t=Bl._abbr,r=require,r("./locale/"+e),ni(t)}catch{Tt[e]=null}return Tt[e]}function ni(e,t){var r;return e&&(xr(t)?r=Ns(e):r=vv(e,t),r?Bl=r:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Bl._abbr}function vv(e,t){if(t!==null){var r,n=HS;if(t.abbr=e,Tt[e]!=null)TS("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Tt[e]._config;else if(t.parentLocale!=null)if(Tt[t.parentLocale]!=null)n=Tt[t.parentLocale]._config;else if(r=bf(t.parentLocale),r!=null)n=r._config;else return Wa[t.parentLocale]||(Wa[t.parentLocale]=[]),Wa[t.parentLocale].push({name:e,config:t}),null;return Tt[e]=new av(Yp(n,t)),Wa[e]&&Wa[e].forEach(function(s){vv(s.name,s.config)}),ni(e),Tt[e]}else return delete Tt[e],null}function mL(e,t){if(t!=null){var r,n,s=HS;Tt[e]!=null&&Tt[e].parentLocale!=null?Tt[e].set(Yp(Tt[e]._config,t)):(n=bf(e),n!=null&&(s=n._config),t=Yp(s,t),n==null&&(t.abbr=e),r=new av(t),r.parentLocale=Tt[e],Tt[e]=r),ni(e)}else Tt[e]!=null&&(Tt[e].parentLocale!=null?(Tt[e]=Tt[e].parentLocale,e===ni()&&ni(e)):Tt[e]!=null&&delete Tt[e]);return Tt[e]}function Ns(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Bl;if(!wn(e)){if(t=bf(e),t)return t;e=[e]}return hL(e)}function gL(){return Zp(Tt)}function yv(e){var t,r=e._a;return r&&Ke(e).overflow===-2&&(t=r[cs]<0||r[cs]>11?cs:r[An]<1||r[An]>hv(r[ar],r[cs])?An:r[Gt]<0||r[Gt]>24||r[Gt]===24&&(r[fn]!==0||r[us]!==0||r[Ai]!==0)?Gt:r[fn]<0||r[fn]>59?fn:r[us]<0||r[us]>59?us:r[Ai]<0||r[Ai]>999?Ai:-1,Ke(e)._overflowDayOfYear&&(tAn)&&(t=An),Ke(e)._overflowWeeks&&t===-1&&(t=wI),Ke(e)._overflowWeekday&&t===-1&&(t=_I),Ke(e).overflow=t),e}var vL=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,yL=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,xL=/Z|[+-]\d\d(?::?\d\d)?/,lu=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Ph=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],wL=/^\/?Date\((-?\d+)/i,_L=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,bL={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function YS(e){var t,r,n=e._i,s=vL.exec(n)||yL.exec(n),i,o,a,l,u=lu.length,d=Ph.length;if(s){for(Ke(e).iso=!0,t=0,r=u;tfl(o)||e._dayOfYear===0)&&(Ke(e)._overflowDayOfYear=!0),r=Wl(o,0,e._dayOfYear),e._a[cs]=r.getUTCMonth(),e._a[An]=r.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=n[t]=s[t];for(;t<7;t++)e._a[t]=n[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Gt]===24&&e._a[fn]===0&&e._a[us]===0&&e._a[Ai]===0&&(e._nextDay=!0,e._a[Gt]=0),e._d=(e._useUTC?Wl:II).apply(null,n),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Gt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==i&&(Ke(e).weekdayMismatch=!0)}}function RL(e){var t,r,n,s,i,o,a,l,u;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(i=1,o=4,r=vo(t.GG,e._a[ar],$l(St(),1,4).year),n=vo(t.W,1),s=vo(t.E,1),(s<1||s>7)&&(l=!0)):(i=e._locale._week.dow,o=e._locale._week.doy,u=$l(St(),i,o),r=vo(t.gg,e._a[ar],u.year),n=vo(t.w,u.week),t.d!=null?(s=t.d,(s<0||s>6)&&(l=!0)):t.e!=null?(s=t.e+i,(t.e<0||t.e>6)&&(l=!0)):s=i),n<1||n>ps(r,i,o)?Ke(e)._overflowWeeks=!0:l!=null?Ke(e)._overflowWeekday=!0:(a=VS(r,n,s,i,o),e._a[ar]=a.year,e._dayOfYear=a.dayOfYear)}ge.ISO_8601=function(){};ge.RFC_2822=function(){};function wv(e){if(e._f===ge.ISO_8601){YS(e);return}if(e._f===ge.RFC_2822){ZS(e);return}e._a=[],Ke(e).empty=!0;var t=""+e._i,r,n,s,i,o,a=t.length,l=0,u,d;for(s=NS(e._f,e._locale).match(lv)||[],d=s.length,r=0;r0&&Ke(e).unusedInput.push(o),t=t.slice(t.indexOf(n)+n.length),l+=n.length),Go[i]?(n?Ke(e).empty=!1:Ke(e).unusedTokens.push(i),xI(i,n,e)):e._strict&&!n&&Ke(e).unusedTokens.push(i);Ke(e).charsLeftOver=a-l,t.length>0&&Ke(e).unusedInput.push(t),e._a[Gt]<=12&&Ke(e).bigHour===!0&&e._a[Gt]>0&&(Ke(e).bigHour=void 0),Ke(e).parsedDateParts=e._a.slice(0),Ke(e).meridiem=e._meridiem,e._a[Gt]=PL(e._locale,e._a[Gt],e._meridiem),u=Ke(e).era,u!==null&&(e._a[ar]=e._locale.erasConvertYear(u,e._a[ar])),xv(e),yv(e)}function PL(e,t,r){var n;return r==null?t:e.meridiemHour!=null?e.meridiemHour(t,r):(e.isPM!=null&&(n=e.isPM(r),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function DL(e){var t,r,n,s,i,o,a=!1,l=e._f.length;if(l===0){Ke(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;sthis?this:e:mf()});function qS(e,t){var r,n;if(t.length===1&&wn(t[0])&&(t=t[0]),!t.length)return St();for(r=t[0],n=1;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function JL(){if(!xr(this._isDSTShifted))return this._isDSTShifted;var e={},t;return ov(e,this),e=KS(e),e._a?(t=e._isUTC?Yn(e._a):St(e._a),this._isDSTShifted=this.isValid()&&BL(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function e4(){return this.isValid()?!this._isUTC:!1}function t4(){return this.isValid()?this._isUTC:!1}function QS(){return this.isValid()?this._isUTC&&this._offset===0:!1}var r4=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,n4=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Cn(e,t){var r=e,n=null,s,i,o;return Nu(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:bs(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(n=r4.exec(e))?(s=n[1]==="-"?-1:1,r={y:0,d:tt(n[An])*s,h:tt(n[Gt])*s,m:tt(n[fn])*s,s:tt(n[us])*s,ms:tt(Gp(n[Ai]*1e3))*s}):(n=n4.exec(e))?(s=n[1]==="-"?-1:1,r={y:Si(n[2],s),M:Si(n[3],s),w:Si(n[4],s),d:Si(n[5],s),h:Si(n[6],s),m:Si(n[7],s),s:Si(n[8],s)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(o=s4(St(r.from),St(r.to)),r={},r.ms=o.milliseconds,r.M=o.months),i=new Sf(r),Nu(e)&<(e,"_locale")&&(i._locale=e._locale),Nu(e)&<(e,"_isValid")&&(i._isValid=e._isValid),i}Cn.fn=Sf.prototype;Cn.invalid=$L;function Si(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function m0(e,t){var r={};return r.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function s4(e,t){var r;return e.isValid()&&t.isValid()?(t=bv(t,e),e.isBefore(t)?r=m0(e,t):(r=m0(t,e),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function JS(e,t){return function(r,n){var s,i;return n!==null&&!isNaN(+n)&&(TS(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=r,r=n,n=i),s=Cn(r,n),ek(this,s,e),this}}function ek(e,t,r,n){var s=t._milliseconds,i=Gp(t._days),o=Gp(t._months);e.isValid()&&(n=n??!0,o&&FS(e,Vl(e,"Month")+o*r),i&&MS(e,"Date",Vl(e,"Date")+i*r),s&&e._d.setTime(e._d.valueOf()+s*r),n&&ge.updateOffset(e,i||o))}var i4=JS(1,"add"),o4=JS(-1,"subtract");function tk(e){return typeof e=="string"||e instanceof String}function a4(e){return _n(e)||xc(e)||tk(e)||bs(e)||c4(e)||l4(e)||e===null||e===void 0}function l4(e){var t=Li(e)&&!sv(e),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,i,o=n.length;for(s=0;sr.valueOf():r.valueOf()9999?Tu(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Zn(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Tu(r,"Z")):Tu(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function S4(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",r,n,s,i;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),r="["+e+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",i=t+'[")]',this.format(r+n+s+i)}function k4(e){e||(e=this.isUtc()?ge.defaultFormatUtc:ge.defaultFormat);var t=Tu(this,e);return this.localeData().postformat(t)}function C4(e,t){return this.isValid()&&(_n(e)&&e.isValid()||St(e).isValid())?Cn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function E4(e){return this.from(St(),e)}function j4(e,t){return this.isValid()&&(_n(e)&&e.isValid()||St(e).isValid())?Cn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function T4(e){return this.to(St(),e)}function rk(e){var t;return e===void 0?this._locale._abbr:(t=Ns(e),t!=null&&(this._locale=t),this)}var nk=Jr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function sk(){return this._locale}var gd=1e3,qo=60*gd,vd=60*qo,ik=(365*400+97)*24*vd;function Xo(e,t){return(e%t+t)%t}function ok(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-ik:new Date(e,t,r).valueOf()}function ak(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-ik:Date.UTC(e,t,r)}function N4(e){var t,r;if(e=en(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?ak:ok,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Xo(t+(this._isUTC?0:this.utcOffset()*qo),vd);break;case"minute":t=this._d.valueOf(),t-=Xo(t,qo);break;case"second":t=this._d.valueOf(),t-=Xo(t,gd);break}return this._d.setTime(t),ge.updateOffset(this,!0),this}function R4(e){var t,r;if(e=en(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?ak:ok,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=vd-Xo(t+(this._isUTC?0:this.utcOffset()*qo),vd)-1;break;case"minute":t=this._d.valueOf(),t+=qo-Xo(t,qo)-1;break;case"second":t=this._d.valueOf(),t+=gd-Xo(t,gd)-1;break}return this._d.setTime(t),ge.updateOffset(this,!0),this}function P4(){return this._d.valueOf()-(this._offset||0)*6e4}function D4(){return Math.floor(this.valueOf()/1e3)}function A4(){return new Date(this.valueOf())}function O4(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function M4(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function I4(){return this.isValid()?this.toISOString():null}function L4(){return iv(this)}function F4(){return Ys({},Ke(this))}function z4(){return Ke(this).overflow}function U4(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Oe("N",0,0,"eraAbbr");Oe("NN",0,0,"eraAbbr");Oe("NNN",0,0,"eraAbbr");Oe("NNNN",0,0,"eraName");Oe("NNNNN",0,0,"eraNarrow");Oe("y",["y",1],"yo","eraYear");Oe("y",["yy",2],0,"eraYear");Oe("y",["yyy",3],0,"eraYear");Oe("y",["yyyy",4],0,"eraYear");_e("N",Sv);_e("NN",Sv);_e("NNN",Sv);_e("NNNN",X4);_e("NNNNN",Q4);mt(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,n){var s=r._locale.erasParse(e,n,r._strict);s?Ke(r).era=s:Ke(r).invalidEra=e});_e("y",ka);_e("yy",ka);_e("yyy",ka);_e("yyyy",ka);_e("yo",J4);mt(["y","yy","yyy","yyyy"],ar);mt(["yo"],function(e,t,r,n){var s;r._locale._eraYearOrdinalRegex&&(s=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[ar]=r._locale.eraYearOrdinalParse(e,s):t[ar]=parseInt(e,10)});function V4(e,t){var r,n,s,i=this._eras||Ns("en")._eras;for(r=0,n=i.length;r=0)return i[n]}function $4(e,t){var r=e.since<=e.until?1:-1;return t===void 0?ge(e.since).year():ge(e.since).year()+(t-e.offset)*r}function B4(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;ei&&(t=i),oF.call(this,e,t,r,n,s))}function oF(e,t,r,n,s){var i=VS(e,t,r,n,s),o=Wl(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}Oe("Q",0,"Qo","quarter");_e("Q",RS);mt("Q",function(e,t){t[cs]=(tt(e)-1)*3});function aF(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Oe("D",["DD",2],"Do","date");_e("D",Ct,Ca);_e("DD",Ct,Vr);_e("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});mt(["D","DD"],An);mt("Do",function(e,t){t[An]=tt(e.match(Ct)[0])});var ck=Ea("Date",!0);Oe("DDD",["DDDD",3],"DDDo","dayOfYear");_e("DDD",vf);_e("DDDD",PS);mt(["DDD","DDDD"],function(e,t,r){r._dayOfYear=tt(e)});function lF(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Oe("m",["mm",2],0,"minute");_e("m",Ct,fv);_e("mm",Ct,Vr);mt(["m","mm"],fn);var cF=Ea("Minutes",!1);Oe("s",["ss",2],0,"second");_e("s",Ct,fv);_e("ss",Ct,Vr);mt(["s","ss"],us);var uF=Ea("Seconds",!1);Oe("S",0,0,function(){return~~(this.millisecond()/100)});Oe(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Oe(0,["SSS",3],0,"millisecond");Oe(0,["SSSS",4],0,function(){return this.millisecond()*10});Oe(0,["SSSSS",5],0,function(){return this.millisecond()*100});Oe(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Oe(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Oe(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Oe(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});_e("S",vf,RS);_e("SS",vf,Vr);_e("SSS",vf,PS);var Zs,uk;for(Zs="SSSS";Zs.length<=9;Zs+="S")_e(Zs,ka);function dF(e,t){t[Ai]=tt(("0."+e)*1e3)}for(Zs="S";Zs.length<=9;Zs+="S")mt(Zs,dF);uk=Ea("Milliseconds",!1);Oe("z",0,0,"zoneAbbr");Oe("zz",0,0,"zoneName");function fF(){return this._isUTC?"UTC":""}function hF(){return this._isUTC?"Coordinated Universal Time":""}var ae=wc.prototype;ae.add=i4;ae.calendar=f4;ae.clone=h4;ae.diff=w4;ae.endOf=R4;ae.format=k4;ae.from=C4;ae.fromNow=E4;ae.to=j4;ae.toNow=T4;ae.get=SI;ae.invalidAt=z4;ae.isAfter=p4;ae.isBefore=m4;ae.isBetween=g4;ae.isSame=v4;ae.isSameOrAfter=y4;ae.isSameOrBefore=x4;ae.isValid=L4;ae.lang=nk;ae.locale=rk;ae.localeData=sk;ae.max=LL;ae.min=IL;ae.parsingFlags=F4;ae.set=kI;ae.startOf=N4;ae.subtract=o4;ae.toArray=O4;ae.toObject=M4;ae.toDate=A4;ae.toISOString=b4;ae.inspect=S4;typeof Symbol<"u"&&Symbol.for!=null&&(ae[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});ae.toJSON=I4;ae.toString=_4;ae.unix=D4;ae.valueOf=P4;ae.creationData=U4;ae.eraName=B4;ae.eraNarrow=H4;ae.eraAbbr=Y4;ae.eraYear=Z4;ae.year=OS;ae.isLeapYear=bI;ae.weekYear=eF;ae.isoWeekYear=tF;ae.quarter=ae.quarters=aF;ae.month=zS;ae.daysInMonth=AI;ae.week=ae.weeks=VI;ae.isoWeek=ae.isoWeeks=WI;ae.weeksInYear=sF;ae.weeksInWeekYear=iF;ae.isoWeeksInYear=rF;ae.isoWeeksInISOWeekYear=nF;ae.date=ck;ae.day=ae.days=tL;ae.weekday=rL;ae.isoWeekday=nL;ae.dayOfYear=lF;ae.hour=ae.hours=uL;ae.minute=ae.minutes=cF;ae.second=ae.seconds=uF;ae.millisecond=ae.milliseconds=uk;ae.utcOffset=YL;ae.utc=KL;ae.local=GL;ae.parseZone=qL;ae.hasAlignedHourOffset=XL;ae.isDST=QL;ae.isLocal=e4;ae.isUtcOffset=t4;ae.isUtc=QS;ae.isUTC=QS;ae.zoneAbbr=fF;ae.zoneName=hF;ae.dates=Jr("dates accessor is deprecated. Use date instead.",ck);ae.months=Jr("months accessor is deprecated. Use month instead",zS);ae.years=Jr("years accessor is deprecated. Use year instead",OS);ae.zone=Jr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ZL);ae.isDSTShifted=Jr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",JL);function pF(e){return St(e*1e3)}function mF(){return St.apply(null,arguments).parseZone()}function dk(e){return e}var ct=av.prototype;ct.calendar=eI;ct.longDateFormat=sI;ct.invalidDate=oI;ct.ordinal=cI;ct.preparse=dk;ct.postformat=dk;ct.relativeTime=dI;ct.pastFuture=fI;ct.set=QM;ct.eras=V4;ct.erasParse=W4;ct.erasConvertYear=$4;ct.erasAbbrRegex=G4;ct.erasNameRegex=K4;ct.erasNarrowRegex=q4;ct.months=NI;ct.monthsShort=RI;ct.monthsParse=DI;ct.monthsRegex=MI;ct.monthsShortRegex=OI;ct.week=LI;ct.firstDayOfYear=UI;ct.firstDayOfWeek=zI;ct.weekdays=qI;ct.weekdaysMin=QI;ct.weekdaysShort=XI;ct.weekdaysParse=eL;ct.weekdaysRegex=sL;ct.weekdaysShortRegex=iL;ct.weekdaysMinRegex=oL;ct.isPM=lL;ct.meridiem=dL;function yd(e,t,r,n){var s=Ns(),i=Yn().set(n,t);return s[r](i,e)}function fk(e,t,r){if(bs(e)&&(t=e,e=void 0),e=e||"",t!=null)return yd(e,t,r,"month");var n,s=[];for(n=0;n<12;n++)s[n]=yd(e,n,r,"month");return s}function Cv(e,t,r,n){typeof e=="boolean"?(bs(t)&&(r=t,t=void 0),t=t||""):(t=e,r=t,e=!1,bs(t)&&(r=t,t=void 0),t=t||"");var s=Ns(),i=e?s._week.dow:0,o,a=[];if(r!=null)return yd(t,(r+i)%7,n,"day");for(o=0;o<7;o++)a[o]=yd(t,(o+i)%7,n,"day");return a}function gF(e,t){return fk(e,t,"months")}function vF(e,t){return fk(e,t,"monthsShort")}function yF(e,t,r){return Cv(e,t,r,"weekdays")}function xF(e,t,r){return Cv(e,t,r,"weekdaysShort")}function wF(e,t,r){return Cv(e,t,r,"weekdaysMin")}ni("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,r=tt(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+r}});ge.lang=Jr("moment.lang is deprecated. Use moment.locale instead.",ni);ge.langData=Jr("moment.langData is deprecated. Use moment.localeData instead.",Ns);var es=Math.abs;function _F(){var e=this._data;return this._milliseconds=es(this._milliseconds),this._days=es(this._days),this._months=es(this._months),e.milliseconds=es(e.milliseconds),e.seconds=es(e.seconds),e.minutes=es(e.minutes),e.hours=es(e.hours),e.months=es(e.months),e.years=es(e.years),this}function hk(e,t,r,n){var s=Cn(t,r);return e._milliseconds+=n*s._milliseconds,e._days+=n*s._days,e._months+=n*s._months,e._bubble()}function bF(e,t){return hk(this,e,t,1)}function SF(e,t){return hk(this,e,t,-1)}function g0(e){return e<0?Math.floor(e):Math.ceil(e)}function kF(){var e=this._milliseconds,t=this._days,r=this._months,n=this._data,s,i,o,a,l;return e>=0&&t>=0&&r>=0||e<=0&&t<=0&&r<=0||(e+=g0(Xp(r)+t)*864e5,t=0,r=0),n.milliseconds=e%1e3,s=Yr(e/1e3),n.seconds=s%60,i=Yr(s/60),n.minutes=i%60,o=Yr(i/60),n.hours=o%24,t+=Yr(o/24),l=Yr(pk(t)),r+=l,t-=g0(Xp(l)),a=Yr(r/12),r%=12,n.days=t,n.months=r,n.years=a,this}function pk(e){return e*4800/146097}function Xp(e){return e*146097/4800}function CF(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if(e=en(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+n/864e5,r=this._months+pk(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Xp(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+e)}}function Rs(e){return function(){return this.as(e)}}var mk=Rs("ms"),EF=Rs("s"),jF=Rs("m"),TF=Rs("h"),NF=Rs("d"),RF=Rs("w"),PF=Rs("M"),DF=Rs("Q"),AF=Rs("y"),OF=mk;function MF(){return Cn(this)}function IF(e){return e=en(e),this.isValid()?this[e+"s"]():NaN}function no(e){return function(){return this.isValid()?this._data[e]:NaN}}var LF=no("milliseconds"),FF=no("seconds"),zF=no("minutes"),UF=no("hours"),VF=no("days"),WF=no("months"),$F=no("years");function BF(){return Yr(this.days()/7)}var ss=Math.round,Do={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function HF(e,t,r,n,s){return s.relativeTime(t||1,!!r,e,n)}function YF(e,t,r,n){var s=Cn(e).abs(),i=ss(s.as("s")),o=ss(s.as("m")),a=ss(s.as("h")),l=ss(s.as("d")),u=ss(s.as("M")),d=ss(s.as("w")),f=ss(s.as("y")),g=i<=r.ss&&["s",i]||i0,g[4]=n,HF.apply(null,g)}function ZF(e){return e===void 0?ss:typeof e=="function"?(ss=e,!0):!1}function KF(e,t){return Do[e]===void 0?!1:t===void 0?Do[e]:(Do[e]=t,e==="s"&&(Do.ss=t-1),!0)}function GF(e,t){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Do,s,i;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(r=e),typeof t=="object"&&(n=Object.assign({},Do,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),s=this.localeData(),i=YF(this,!r,n,s),r&&(i=s.pastFuture(+this,i)),s.postformat(i)}var Dh=Math.abs;function mo(e){return(e>0)-(e<0)||+e}function Cf(){if(!this.isValid())return this.localeData().invalidDate();var e=Dh(this._milliseconds)/1e3,t=Dh(this._days),r=Dh(this._months),n,s,i,o,a=this.asSeconds(),l,u,d,f;return a?(n=Yr(e/60),s=Yr(n/60),e%=60,n%=60,i=Yr(r/12),r%=12,o=e?e.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=mo(this._months)!==mo(a)?"-":"",d=mo(this._days)!==mo(a)?"-":"",f=mo(this._milliseconds)!==mo(a)?"-":"",l+"P"+(i?u+i+"Y":"")+(r?u+r+"M":"")+(t?d+t+"D":"")+(s||n||e?"T":"")+(s?f+s+"H":"")+(n?f+n+"M":"")+(e?f+o+"S":"")):"P0D"}var st=Sf.prototype;st.isValid=WL;st.abs=_F;st.add=bF;st.subtract=SF;st.as=CF;st.asMilliseconds=mk;st.asSeconds=EF;st.asMinutes=jF;st.asHours=TF;st.asDays=NF;st.asWeeks=RF;st.asMonths=PF;st.asQuarters=DF;st.asYears=AF;st.valueOf=OF;st._bubble=kF;st.clone=MF;st.get=IF;st.milliseconds=LF;st.seconds=FF;st.minutes=zF;st.hours=UF;st.days=VF;st.weeks=BF;st.months=WF;st.years=$F;st.humanize=GF;st.toISOString=Cf;st.toString=Cf;st.toJSON=Cf;st.locale=rk;st.localeData=sk;st.toIsoString=Jr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Cf);st.lang=nk;Oe("X",0,0,"unix");Oe("x",0,0,"valueOf");_e("x",xf);_e("X",gI);mt("X",function(e,t,r){r._d=new Date(parseFloat(e)*1e3)});mt("x",function(e,t,r){r._d=new Date(tt(e))});//! moment.js ge.version="2.30.1";qM(St);ge.fn=ae;ge.min=FL;ge.max=zL;ge.now=UL;ge.utc=Yn;ge.unix=pF;ge.months=gF;ge.isDate=xc;ge.locale=ni;ge.invalid=mf;ge.duration=Cn;ge.isMoment=_n;ge.weekdays=yF;ge.parseZone=mF;ge.localeData=Ns;ge.isDuration=Nu;ge.monthsShort=vF;ge.weekdaysMin=wF;ge.defineLocale=vv;ge.updateLocale=mL;ge.locales=gL;ge.weekdaysShort=xF;ge.normalizeUnits=en;ge.relativeTimeRounding=ZF;ge.relativeTimeThreshold=KF;ge.calendarFormat=d4;ge.prototype=ae;ge.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const qF=async()=>await xt().collection("access").getFullList({sort:"-created",filter:"deleted = null"}),yi=async e=>e.id?await xt().collection("access").update(e.id,e):await xt().collection("access").create(e),XF=async e=>(e.deleted=ge.utc().format("YYYY-MM-DD HH:mm:ss"),await xt().collection("access").update(e.id,e)),QF=(e,t)=>{switch(t.type){case"SET_ACCESSES":return{...e,accesses:t.payload};case"ADD_ACCESS":return{...e,accesses:[t.payload,...e.accesses]};case"DELETE_ACCESS":return{...e,accesses:e.accesses.filter(r=>r.id!==t.payload)};case"UPDATE_ACCESS":return{...e,accesses:e.accesses.map(r=>r.id===t.payload.id?t.payload:r)};case"SET_EMAILS":return{...e,emails:t.payload};case"ADD_EMAIL":return{...e,emails:{...e.emails,content:{emails:[...e.emails.content.emails,t.payload]}}};default:return e}},JF=async()=>{try{return await xt().collection("settings").getFirstListItem("name='emails'")}catch{return{content:{emails:[]}}}},e3=async e=>{const t=xt();let r;return e.id?r=await t.collection("settings").update(e.id,e):r=await t.collection("settings").create(e),r},gk=x.createContext({}),En=()=>x.useContext(gk),t3=({children:e})=>{const[t,r]=x.useReducer(QF,{accesses:[],emails:{content:{emails:[]}}});x.useEffect(()=>{(async()=>{const l=await qF();r({type:"SET_ACCESSES",payload:l})})()},[]),x.useEffect(()=>{(async()=>{const l=await JF();r({type:"SET_EMAILS",payload:l})})()},[]);const n=x.useCallback(a=>{r({type:"SET_EMAILS",payload:a})},[]),s=x.useCallback(a=>{r({type:"DELETE_ACCESS",payload:a})},[]),i=x.useCallback(a=>{r({type:"ADD_ACCESS",payload:a})},[]),o=x.useCallback(a=>{r({type:"UPDATE_ACCESS",payload:a})},[]);return c.jsx(gk.Provider,{value:{config:{accesses:t.accesses,emails:t.emails},deleteAccess:s,addAccess:i,setEmails:n,updateAccess:o},children:e&&e})},r3={theme:"system",setTheme:()=>null},vk=x.createContext(r3);function n3({children:e,defaultTheme:t="system",storageKey:r="vite-ui-theme",...n}){const[s,i]=x.useState(()=>localStorage.getItem(r)||t);x.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),s==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(s)},[s]);const o={theme:s,setTheme:a=>{localStorage.setItem(r,a),i(a)}};return c.jsx(vk.Provider,{...n,value:o,children:e})}const s3=()=>{const e=x.useContext(vk);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function i3(){const{setTheme:e}=s3();return c.jsxs(Jb,{children:[c.jsx(eS,{asChild:!0,children:c.jsxs(at,{variant:"outline",size:"icon",children:[c.jsx(KR,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),c.jsx(YR,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100 dark:text-white"}),c.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),c.jsxs(Hg,{align:"end",children:[c.jsx(Zo,{onClick:()=>e("light"),children:"浅色"}),c.jsx(Zo,{onClick:()=>e("dark"),children:"暗黑"}),c.jsx(Zo,{onClick:()=>e("system"),children:"系统"})]})]})}var o3="Separator",v0="horizontal",a3=["horizontal","vertical"],yk=x.forwardRef((e,t)=>{const{decorative:r,orientation:n=v0,...s}=e,i=l3(n)?n:v0,a=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return c.jsx(Ve.div,{"data-orientation":i,...a,...s,ref:t})});yk.displayName=o3;function l3(e){return a3.includes(e)}var xk=yk;const Yt=x.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>c.jsx(xk,{ref:s,decorative:r,orientation:t,className:pe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Yt.displayName=xk.displayName;function c3(){const e=Sn(),t=Hn();if(!xt().authStore.isValid||!xt().authStore.isAdmin)return c.jsx(u1,{to:"/login"});const r=t.pathname,n=o=>(console.log(r),o==r?"bg-muted text-primary":"text-muted-foreground"),s=()=>{xt().authStore.clear(),e("/login")},i=()=>{e("/setting/password")};return c.jsx(c.Fragment,{children:c.jsx(t3,{children:c.jsxs("div",{className:"grid min-h-screen w-full md:grid-cols-[220px_1fr] lg:grid-cols-[280px_1fr]",children:[c.jsx("div",{className:"hidden border-r dark:border-stone-500 bg-muted/40 md:block",children:c.jsxs("div",{className:"flex h-full max-h-screen flex-col gap-2",children:[c.jsx("div",{className:"flex h-14 items-center border-b dark:border-stone-500 px-4 lg:h-[60px] lg:px-6",children:c.jsxs(dr,{to:"/",className:"flex items-center gap-2 font-semibold",children:[c.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),c.jsx("span",{className:"dark:text-white",children:"Certimate"})]})}),c.jsx("div",{className:"flex-1",children:c.jsxs("nav",{className:"grid items-start px-2 text-sm font-medium lg:px-4",children:[c.jsxs(dr,{to:"/",className:pe("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/")),children:[c.jsx(Ox,{className:"h-4 w-4"}),"控制面板"]}),c.jsxs(dr,{to:"/domains",className:pe("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/domains")),children:[c.jsx(Ip,{className:"h-4 w-4"}),"域名列表"]}),c.jsxs(dr,{to:"/access",className:pe("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/access")),children:[c.jsx(Mx,{className:"h-4 w-4"}),"授权管理"]}),c.jsxs(dr,{to:"/history",className:pe("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/history")),children:[c.jsx(Ax,{className:"h-4 w-4"}),"部署历史"]})]})})]})}),c.jsxs("div",{className:"flex flex-col",children:[c.jsxs("header",{className:"flex h-14 items-center gap-4 border-b dark:border-stone-500 bg-muted/40 px-4 lg:h-[60px] lg:px-6",children:[c.jsxs(Jg,{children:[c.jsx(ev,{asChild:!0,children:c.jsxs(at,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[c.jsx(HR,{className:"h-5 w-5 dark:text-white"}),c.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),c.jsx(pf,{side:"left",className:"flex flex-col",children:c.jsxs("nav",{className:"grid gap-2 text-lg font-medium",children:[c.jsxs(dr,{to:"/",className:"flex items-center gap-2 text-lg font-semibold",children:[c.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),c.jsx("span",{className:"dark:text-white",children:"Certimate"}),c.jsx("span",{className:"sr-only",children:"Certimate"})]}),c.jsxs(dr,{to:"/",className:pe("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/")),children:[c.jsx(Ox,{className:"h-5 w-5"}),"控制面板"]}),c.jsxs(dr,{to:"/domains",className:pe("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/domains")),children:[c.jsx(Ip,{className:"h-5 w-5"}),"域名列表"]}),c.jsxs(dr,{to:"/access",className:pe("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/dns_provider")),children:[c.jsx(Mx,{className:"h-5 w-5"}),"授权管理"]}),c.jsxs(dr,{to:"/history",className:pe("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/history")),children:[c.jsx(Ax,{className:"h-5 w-5"}),"部署历史"]})]})})]}),c.jsx("div",{className:"w-full flex-1"}),c.jsx(i3,{}),c.jsxs(Jb,{children:[c.jsx(eS,{asChild:!0,children:c.jsxs(at,{variant:"secondary",size:"icon",className:"rounded-full",children:[c.jsx(UR,{className:"h-5 w-5"}),c.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),c.jsxs(Hg,{align:"end",children:[c.jsx(tS,{children:"账户"}),c.jsx(rS,{}),c.jsx(Zo,{onClick:i,children:"设置"}),c.jsx(Zo,{onClick:s,children:"退出"})]})]})]}),c.jsxs("main",{className:"flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 relative",children:[c.jsx(gg,{}),c.jsxs("div",{className:"fixed right-0 bottom-0 w-full flex justify-between p-5",children:[c.jsx("div",{className:""}),c.jsxs("div",{className:"text-muted-foreground text-sm hover:text-stone-900 dark:hover:text-stone-200 flex",children:[c.jsxs("a",{href:"https://docs.certimate.me",target:"_blank",className:"flex items-center",children:[c.jsx(IR,{size:16}),c.jsx("div",{className:"ml-1",children:"文档"})]}),c.jsx(Yt,{orientation:"vertical",className:"mx-2"}),c.jsx("a",{href:"https://github.com/usual2970/certimate/releases",target:"_blank",children:"Certimate v0.1.4"})]})]})]})]})]})})})}const Ev=({phase:e,phaseSuccess:t})=>{let r=c.jsx(c.Fragment,{children:" "});return e==="check"&&(t?r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="apply"&&(t?r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"获取"}),c.jsx(Yt,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="deploy"&&(t?r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"部署"})]}):r=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),c.jsx(Yt,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"部署"})]})),r},wk=({className:e,...t})=>c.jsx("nav",{role:"navigation","aria-label":"pagination",className:pe("mx-auto flex w-full justify-center",e),...t});wk.displayName="Pagination";const _k=x.forwardRef(({className:e,...t},r)=>c.jsx("ul",{ref:r,className:pe("flex flex-row items-center gap-1",e),...t}));_k.displayName="PaginationContent";const Qp=x.forwardRef(({className:e,...t},r)=>c.jsx("li",{ref:r,className:pe("",e),...t}));Qp.displayName="PaginationItem";const bk=({className:e,isActive:t,size:r="icon",...n})=>c.jsx("a",{"aria-current":t?"page":void 0,className:pe(tf({variant:t?"outline":"ghost",size:r}),e),...n});bk.displayName="PaginationLink";const Sk=({className:e,...t})=>c.jsxs("span",{"aria-hidden":!0,className:pe("flex h-9 w-9 items-center justify-center",e),...t,children:[c.jsx(WR,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"More pages"})]});Sk.displayName="PaginationEllipsis";const kk=({totalPages:e,currentPage:t,onPageChange:r})=>{const s=()=>{if(e>7){let u=[];const d=Math.max(2,t-1),f=Math.min(e-1,t+1),g=e-1;return u=i(d,f),t>3&&u.unshift("..."),t{let d=a;const f=[];for(;d<=l;)f.push(d),d+=u;return f},o=s();return c.jsx(c.Fragment,{children:c.jsx(wk,{className:"dark:text-stone-200 justify-end mt-3",children:c.jsx(_k,{children:o.map((a,l)=>a==="..."?c.jsx(Qp,{children:c.jsx(Sk,{})},l):c.jsx(Qp,{children:c.jsx(bk,{href:"#",isActive:t==a,onClick:u=>{u.preventDefault(),r(a)},children:a})},l))})})})},y0=({when:e,children:t,fallback:r})=>e?t:r;var Ck="AlertDialog",[u3,w8]=Qr(Ck,[sS]),Ps=sS(),Ek=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ps(t);return c.jsx(qg,{...n,...r,modal:!0})};Ek.displayName=Ck;var d3="AlertDialogTrigger",jk=x.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ps(r);return c.jsx(Xg,{...s,...n,ref:t})});jk.displayName=d3;var f3="AlertDialogPortal",Tk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ps(t);return c.jsx(Qg,{...n,...r})};Tk.displayName=f3;var h3="AlertDialogOverlay",Nk=x.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ps(r);return c.jsx(mc,{...s,...n,ref:t})});Nk.displayName=h3;var Qo="AlertDialogContent",[p3,m3]=u3(Qo),Rk=x.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,i=Ps(r),o=x.useRef(null),a=Xe(t,o),l=x.useRef(null);return c.jsx(CM,{contentName:Qo,titleName:Pk,docsSlug:"alert-dialog",children:c.jsx(p3,{scope:r,cancelRef:l,children:c.jsxs(gc,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:ue(s.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[c.jsx(wg,{children:n}),c.jsx(v3,{contentRef:o})]})})})});Rk.displayName=Qo;var Pk="AlertDialogTitle",Dk=x.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ps(r);return c.jsx(vc,{...s,...n,ref:t})});Dk.displayName=Pk;var Ak="AlertDialogDescription",Ok=x.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ps(r);return c.jsx(yc,{...s,...n,ref:t})});Ok.displayName=Ak;var g3="AlertDialogAction",Mk=x.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ps(r);return c.jsx(hf,{...s,...n,ref:t})});Mk.displayName=g3;var Ik="AlertDialogCancel",Lk=x.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=m3(Ik,r),i=Ps(r),o=Xe(t,s);return c.jsx(hf,{...i,...n,ref:o})});Lk.displayName=Ik;var v3=({contentRef:e})=>{const t=`\`${Qo}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${Qo}\` by passing a \`${Ak}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Qo}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return x.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},y3=Ek,x3=jk,w3=Tk,Fk=Nk,zk=Rk,Uk=Mk,Vk=Lk,Wk=Dk,$k=Ok;const _3=y3,b3=x3,S3=w3,Bk=x.forwardRef(({className:e,...t},r)=>c.jsx(Fk,{className:pe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));Bk.displayName=Fk.displayName;const Hk=x.forwardRef(({className:e,...t},r)=>c.jsxs(S3,{children:[c.jsx(Bk,{}),c.jsx(zk,{ref:r,className:pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Hk.displayName=zk.displayName;const Yk=({className:e,...t})=>c.jsx("div",{className:pe("flex flex-col space-y-2 text-center sm:text-left",e),...t});Yk.displayName="AlertDialogHeader";const Zk=({className:e,...t})=>c.jsx("div",{className:pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Zk.displayName="AlertDialogFooter";const Kk=x.forwardRef(({className:e,...t},r)=>c.jsx(Wk,{ref:r,className:pe("text-lg font-semibold",e),...t}));Kk.displayName=Wk.displayName;const Gk=x.forwardRef(({className:e,...t},r)=>c.jsx($k,{ref:r,className:pe("text-sm text-muted-foreground",e),...t}));Gk.displayName=$k.displayName;const qk=x.forwardRef(({className:e,...t},r)=>c.jsx(Uk,{ref:r,className:pe(tf(),e),...t}));qk.displayName=Uk.displayName;const Xk=x.forwardRef(({className:e,...t},r)=>c.jsx(Vk,{ref:r,className:pe(tf({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Xk.displayName=Vk.displayName;function Qk(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var jv="Switch",[k3,_8]=Qr(jv),[C3,E3]=k3(jv),Jk=x.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:i,required:o,disabled:a,value:l="on",onCheckedChange:u,...d}=e,[f,g]=x.useState(null),h=Xe(t,p=>g(p)),y=x.useRef(!1),m=f?!!f.closest("form"):!0,[w=!1,v]=oi({prop:s,defaultProp:i,onChange:u});return c.jsxs(C3,{scope:r,checked:w,disabled:a,children:[c.jsx(Ve.button,{type:"button",role:"switch","aria-checked":w,"aria-required":o,"data-state":rC(w),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:h,onClick:ue(e.onClick,p=>{v(_=>!_),m&&(y.current=p.isPropagationStopped(),y.current||p.stopPropagation())})}),m&&c.jsx(j3,{control:f,bubbles:!y.current,name:n,value:l,checked:w,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});Jk.displayName=jv;var eC="SwitchThumb",tC=x.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=E3(eC,r);return c.jsx(Ve.span,{"data-state":rC(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});tC.displayName=eC;var j3=e=>{const{control:t,checked:r,bubbles:n=!0,...s}=e,i=x.useRef(null),o=Qk(r),a=I1(t);return x.useEffect(()=>{const l=i.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==r&&f){const g=new Event("click",{bubbles:n});f.call(l,r),l.dispatchEvent(g)}},[o,r,n]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function rC(e){return e?"checked":"unchecked"}var nC=Jk,T3=tC;const sC=x.forwardRef(({className:e,...t},r)=>c.jsx(nC,{className:pe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:c.jsx(T3,{className:pe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));sC.displayName=nC.displayName;var N3="VisuallyHidden",Sc=x.forwardRef((e,t)=>c.jsx(Ve.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Sc.displayName=N3;var R3=Sc,Tv="ToastProvider",[Nv,P3,D3]=rf("Toast"),[iC,b8]=Qr("Toast",[D3]),[A3,Ef]=iC(Tv),oC=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=e,[a,l]=x.useState(null),[u,d]=x.useState(0),f=x.useRef(!1),g=x.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Tv}\`. Expected non-empty \`string\`.`),c.jsx(Nv.Provider,{scope:t,children:c.jsx(A3,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:x.useCallback(()=>d(h=>h+1),[]),onToastRemove:x.useCallback(()=>d(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:g,children:o})})};oC.displayName=Tv;var aC="ToastViewport",O3=["F8"],Jp="toast.viewportPause",em="toast.viewportResume",lC=x.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=O3,label:s="Notifications ({hotkey})",...i}=e,o=Ef(aC,r),a=P3(r),l=x.useRef(null),u=x.useRef(null),d=x.useRef(null),f=x.useRef(null),g=Xe(t,f,o.onViewportChange),h=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=o.toastCount>0;x.useEffect(()=>{const w=v=>{var _;n.every(C=>v[C]||v.code===C)&&((_=f.current)==null||_.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[n]),x.useEffect(()=>{const w=l.current,v=f.current;if(y&&w&&v){const p=()=>{if(!o.isClosePausedRef.current){const j=new CustomEvent(Jp);v.dispatchEvent(j),o.isClosePausedRef.current=!0}},_=()=>{if(o.isClosePausedRef.current){const j=new CustomEvent(em);v.dispatchEvent(j),o.isClosePausedRef.current=!1}},C=j=>{!w.contains(j.relatedTarget)&&_()},E=()=>{w.contains(document.activeElement)||_()};return w.addEventListener("focusin",p),w.addEventListener("focusout",C),w.addEventListener("pointermove",p),w.addEventListener("pointerleave",E),window.addEventListener("blur",p),window.addEventListener("focus",_),()=>{w.removeEventListener("focusin",p),w.removeEventListener("focusout",C),w.removeEventListener("pointermove",p),w.removeEventListener("pointerleave",E),window.removeEventListener("blur",p),window.removeEventListener("focus",_)}}},[y,o.isClosePausedRef]);const m=x.useCallback(({tabbingDirection:w})=>{const p=a().map(_=>{const C=_.ref.current,E=[C,...Z3(C)];return w==="forwards"?E:E.reverse()});return(w==="forwards"?p.reverse():p).flat()},[a]);return x.useEffect(()=>{const w=f.current;if(w){const v=p=>{var E,j,R;const _=p.altKey||p.ctrlKey||p.metaKey;if(p.key==="Tab"&&!_){const D=document.activeElement,P=p.shiftKey;if(p.target===w&&P){(E=u.current)==null||E.focus();return}const T=m({tabbingDirection:P?"backwards":"forwards"}),F=T.findIndex(b=>b===D);Ah(T.slice(F+1))?p.preventDefault():P?(j=u.current)==null||j.focus():(R=d.current)==null||R.focus()}};return w.addEventListener("keydown",v),()=>w.removeEventListener("keydown",v)}},[a,m]),c.jsxs(YP,{ref:l,role:"region","aria-label":s.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&c.jsx(tm,{ref:u,onFocusFromOutsideViewport:()=>{const w=m({tabbingDirection:"forwards"});Ah(w)}}),c.jsx(Nv.Slot,{scope:r,children:c.jsx(Ve.ol,{tabIndex:-1,...i,ref:g})}),y&&c.jsx(tm,{ref:d,onFocusFromOutsideViewport:()=>{const w=m({tabbingDirection:"backwards"});Ah(w)}})]})});lC.displayName=aC;var cC="ToastFocusProxy",tm=x.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,i=Ef(cC,r);return c.jsx(Sc,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&n()}})});tm.displayName=cC;var jf="Toast",M3="toast.swipeStart",I3="toast.swipeMove",L3="toast.swipeCancel",F3="toast.swipeEnd",uC=x.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:i,...o}=e,[a=!0,l]=oi({prop:n,defaultProp:s,onChange:i});return c.jsx(Er,{present:r||a,children:c.jsx(V3,{open:a,...o,ref:t,onClose:()=>l(!1),onPause:At(e.onPause),onResume:At(e.onResume),onSwipeStart:ue(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ue(e.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:ue(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ue(e.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});uC.displayName=jf;var[z3,U3]=iC(jf,{onClose(){}}),V3=x.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:g,onSwipeEnd:h,...y}=e,m=Ef(jf,r),[w,v]=x.useState(null),p=Xe(t,b=>v(b)),_=x.useRef(null),C=x.useRef(null),E=s||m.duration,j=x.useRef(0),R=x.useRef(E),D=x.useRef(0),{onToastAdd:P,onToastRemove:L}=m,q=At(()=>{var W;(w==null?void 0:w.contains(document.activeElement))&&((W=m.viewport)==null||W.focus()),o()}),T=x.useCallback(b=>{!b||b===1/0||(window.clearTimeout(D.current),j.current=new Date().getTime(),D.current=window.setTimeout(q,b))},[q]);x.useEffect(()=>{const b=m.viewport;if(b){const W=()=>{T(R.current),u==null||u()},te=()=>{const $=new Date().getTime()-j.current;R.current=R.current-$,window.clearTimeout(D.current),l==null||l()};return b.addEventListener(Jp,te),b.addEventListener(em,W),()=>{b.removeEventListener(Jp,te),b.removeEventListener(em,W)}}},[m.viewport,E,l,u,T]),x.useEffect(()=>{i&&!m.isClosePausedRef.current&&T(E)},[i,E,m.isClosePausedRef,T]),x.useEffect(()=>(P(),()=>L()),[P,L]);const F=x.useMemo(()=>w?vC(w):null,[w]);return m.viewport?c.jsxs(c.Fragment,{children:[F&&c.jsx(W3,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:F}),c.jsx(z3,{scope:r,onClose:q,children:Cs.createPortal(c.jsx(Nv.ItemSlot,{scope:r,children:c.jsx(HP,{asChild:!0,onEscapeKeyDown:ue(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||q(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(Ve.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":m.swipeDirection,...y,ref:p,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ue(e.onKeyDown,b=>{b.key==="Escape"&&(a==null||a(b.nativeEvent),b.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:ue(e.onPointerDown,b=>{b.button===0&&(_.current={x:b.clientX,y:b.clientY})}),onPointerMove:ue(e.onPointerMove,b=>{if(!_.current)return;const W=b.clientX-_.current.x,te=b.clientY-_.current.y,$=!!C.current,Z=["left","right"].includes(m.swipeDirection),I=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,Q=Z?I(0,W):0,z=Z?0:I(0,te),V=b.pointerType==="touch"?10:2,de={x:Q,y:z},ne={originalEvent:b,delta:de};$?(C.current=de,cu(I3,f,ne,{discrete:!1})):x0(de,m.swipeDirection,V)?(C.current=de,cu(M3,d,ne,{discrete:!1}),b.target.setPointerCapture(b.pointerId)):(Math.abs(W)>V||Math.abs(te)>V)&&(_.current=null)}),onPointerUp:ue(e.onPointerUp,b=>{const W=C.current,te=b.target;if(te.hasPointerCapture(b.pointerId)&&te.releasePointerCapture(b.pointerId),C.current=null,_.current=null,W){const $=b.currentTarget,Z={originalEvent:b,delta:W};x0(W,m.swipeDirection,m.swipeThreshold)?cu(F3,h,Z,{discrete:!0}):cu(L3,g,Z,{discrete:!0}),$.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),W3=e=>{const{__scopeToast:t,children:r,...n}=e,s=Ef(jf,t),[i,o]=x.useState(!1),[a,l]=x.useState(!1);return H3(()=>o(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:c.jsx(fc,{asChild:!0,children:c.jsx(Sc,{...n,children:i&&c.jsxs(c.Fragment,{children:[s.label," ",r]})})})},$3="ToastTitle",dC=x.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return c.jsx(Ve.div,{...n,ref:t})});dC.displayName=$3;var B3="ToastDescription",fC=x.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return c.jsx(Ve.div,{...n,ref:t})});fC.displayName=B3;var hC="ToastAction",pC=x.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?c.jsx(gC,{altText:r,asChild:!0,children:c.jsx(Rv,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${hC}\`. Expected non-empty \`string\`.`),null)});pC.displayName=hC;var mC="ToastClose",Rv=x.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=U3(mC,r);return c.jsx(gC,{asChild:!0,children:c.jsx(Ve.button,{type:"button",...n,ref:t,onClick:ue(e.onClick,s.onClose)})})});Rv.displayName=mC;var gC=x.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return c.jsx(Ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function vC(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),Y3(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...vC(n))}}),t}function cu(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?bg(s,i):s.dispatchEvent(i)}var x0=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),i=n>s;return t==="left"||t==="right"?i&&n>r:!i&&s>r};function H3(e=()=>{}){const t=At(e);nr(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function Y3(e){return e.nodeType===e.ELEMENT_NODE}function Z3(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Ah(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var K3=oC,yC=lC,xC=uC,wC=dC,_C=fC,bC=pC,SC=Rv;const G3=K3,kC=x.forwardRef(({className:e,...t},r)=>c.jsx(yC,{ref:r,className:pe("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));kC.displayName=yC.displayName;const q3=uc("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),CC=x.forwardRef(({className:e,variant:t,...r},n)=>c.jsx(xC,{ref:n,className:pe(q3({variant:t}),e),...r}));CC.displayName=xC.displayName;const X3=x.forwardRef(({className:e,...t},r)=>c.jsx(bC,{ref:r,className:pe("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));X3.displayName=bC.displayName;const EC=x.forwardRef(({className:e,...t},r)=>c.jsx(SC,{ref:r,className:pe("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:c.jsx(xg,{className:"h-4 w-4"})}));EC.displayName=SC.displayName;const jC=x.forwardRef(({className:e,...t},r)=>c.jsx(wC,{ref:r,className:pe("text-sm font-semibold",e),...t}));jC.displayName=wC.displayName;const TC=x.forwardRef(({className:e,...t},r)=>c.jsx(_C,{ref:r,className:pe("text-sm opacity-90",e),...t}));TC.displayName=_C.displayName;const Q3=1,J3=1e6;let Oh=0;function e5(){return Oh=(Oh+1)%Number.MAX_SAFE_INTEGER,Oh.toString()}const Mh=new Map,w0=e=>{if(Mh.has(e))return;const t=setTimeout(()=>{Mh.delete(e),hl({type:"REMOVE_TOAST",toastId:e})},J3);Mh.set(e,t)},t5=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Q3)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?w0(r):e.toasts.forEach(n=>{w0(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Pu=[];let Du={toasts:[]};function hl(e){Du=t5(Du,e),Pu.forEach(t=>{t(Du)})}function r5({...e}){const t=e5(),r=s=>hl({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>hl({type:"DISMISS_TOAST",toastId:t});return hl({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function Tf(){const[e,t]=x.useState(Du);return x.useEffect(()=>(Pu.push(t),()=>{const r=Pu.indexOf(t);r>-1&&Pu.splice(r,1)}),[e]),{...e,toast:r5,dismiss:r=>hl({type:"DISMISS_TOAST",toastId:r})}}function Pv(){const{toasts:e}=Tf();return c.jsxs(G3,{children:[e.map(function({id:t,title:r,description:n,action:s,...i}){return c.jsxs(CC,{...i,children:[c.jsxs("div",{className:"grid gap-1",children:[r&&c.jsx(jC,{children:r}),n&&c.jsx(TC,{children:n})]}),s,c.jsx(EC,{})]},t)}),c.jsx(kC,{})]})}var[Nf,S8]=Qr("Tooltip",[Sa]),Rf=Sa(),NC="TooltipProvider",n5=700,rm="tooltip.open",[s5,Dv]=Nf(NC),RC=e=>{const{__scopeTooltip:t,delayDuration:r=n5,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=e,[o,a]=x.useState(!0),l=x.useRef(!1),u=x.useRef(0);return x.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),c.jsx(s5,{scope:t,isOpenDelayed:o,delayDuration:r,onOpen:x.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:x.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:x.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})};RC.displayName=NC;var Pf="Tooltip",[i5,Df]=Nf(Pf),PC=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s=!1,onOpenChange:i,disableHoverableContent:o,delayDuration:a}=e,l=Dv(Pf,e.__scopeTooltip),u=Rf(t),[d,f]=x.useState(null),g=zn(),h=x.useRef(0),y=o??l.disableHoverableContent,m=a??l.delayDuration,w=x.useRef(!1),[v=!1,p]=oi({prop:n,defaultProp:s,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(rm))):l.onClose(),i==null||i(R)}}),_=x.useMemo(()=>v?w.current?"delayed-open":"instant-open":"closed",[v]),C=x.useCallback(()=>{window.clearTimeout(h.current),w.current=!1,p(!0)},[p]),E=x.useCallback(()=>{window.clearTimeout(h.current),p(!1)},[p]),j=x.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{w.current=!0,p(!0)},m)},[m,p]);return x.useEffect(()=>()=>window.clearTimeout(h.current),[]),c.jsx(Dg,{...u,children:c.jsx(i5,{scope:t,contentId:g,open:v,stateAttribute:_,trigger:d,onTriggerChange:f,onTriggerEnter:x.useCallback(()=>{l.isOpenDelayed?j():C()},[l.isOpenDelayed,j,C]),onTriggerLeave:x.useCallback(()=>{y?E():window.clearTimeout(h.current)},[E,y]),onOpen:C,onClose:E,disableHoverableContent:y,children:r})})};PC.displayName=Pf;var nm="TooltipTrigger",DC=x.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Df(nm,r),i=Dv(nm,r),o=Rf(r),a=x.useRef(null),l=Xe(t,a,s.onTriggerChange),u=x.useRef(!1),d=x.useRef(!1),f=x.useCallback(()=>u.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(Ag,{asChild:!0,...o,children:c.jsx(Ve.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:ue(e.onPointerMove,g=>{g.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:ue(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:ue(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ue(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:ue(e.onBlur,s.onClose),onClick:ue(e.onClick,s.onClose)})})});DC.displayName=nm;var o5="TooltipPortal",[k8,a5]=Nf(o5,{forceMount:void 0}),la="TooltipContent",Av=x.forwardRef((e,t)=>{const r=a5(la,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...i}=e,o=Df(la,e.__scopeTooltip);return c.jsx(Er,{present:n||o.open,children:o.disableHoverableContent?c.jsx(AC,{side:s,...i,ref:t}):c.jsx(l5,{side:s,...i,ref:t})})}),l5=x.forwardRef((e,t)=>{const r=Df(la,e.__scopeTooltip),n=Dv(la,e.__scopeTooltip),s=x.useRef(null),i=Xe(t,s),[o,a]=x.useState(null),{trigger:l,onClose:u}=r,d=s.current,{onPointerInTransitChange:f}=n,g=x.useCallback(()=>{a(null),f(!1)},[f]),h=x.useCallback((y,m)=>{const w=y.currentTarget,v={x:y.clientX,y:y.clientY},p=f5(v,w.getBoundingClientRect()),_=h5(v,p),C=p5(m.getBoundingClientRect()),E=g5([..._,...C]);a(E),f(!0)},[f]);return x.useEffect(()=>()=>g(),[g]),x.useEffect(()=>{if(l&&d){const y=w=>h(w,d),m=w=>h(w,l);return l.addEventListener("pointerleave",y),d.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",m)}}},[l,d,h,g]),x.useEffect(()=>{if(o){const y=m=>{const w=m.target,v={x:m.clientX,y:m.clientY},p=(l==null?void 0:l.contains(w))||(d==null?void 0:d.contains(w)),_=!m5(v,o);p?g():_&&(g(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,d,o,u,g]),c.jsx(AC,{...e,ref:i})}),[c5,u5]=Nf(Pf,{isInside:!1}),AC=x.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=e,l=Df(la,r),u=Rf(r),{onClose:d}=l;return x.useEffect(()=>(document.addEventListener(rm,d),()=>document.removeEventListener(rm,d)),[d]),x.useEffect(()=>{if(l.trigger){const f=g=>{const h=g.target;h!=null&&h.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),c.jsx(wa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:c.jsxs(Og,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(wg,{children:n}),c.jsx(c5,{scope:r,isInside:!0,children:c.jsx(R3,{id:l.contentId,role:"tooltip",children:s||n})})]})})});Av.displayName=la;var OC="TooltipArrow",d5=x.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Rf(r);return u5(OC,r).isInside?null:c.jsx(Mg,{...s,...n,ref:t})});d5.displayName=OC;function f5(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,s,i)){case i:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function h5(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function p5(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function m5(e,t){const{x:r,y:n}=e;let s=!1;for(let i=0,o=t.length-1;in!=d>n&&r<(u-a)*(n-l)/(d-l)+a&&(s=!s)}return s}function g5(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),v5(t)}function v5(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var y5=PC,x5=DC,MC=Av;const w5=y5,_5=x5,b5=x.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(MC,{ref:n,sideOffset:t,className:pe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));b5.displayName=MC.displayName;function uu(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var IC={exports:{}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files (c) 2009-2016 Stuart Knightley Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE */(function(e,t){(function(r){e.exports=r()})(function(){return function r(n,s,i){function o(u,d){if(!s[u]){if(!n[u]){var f=typeof uu=="function"&&uu;if(!d&&f)return f(u,!0);if(a)return a(u,!0);var g=new Error("Cannot find module '"+u+"'");throw g.code="MODULE_NOT_FOUND",g}var h=s[u]={exports:{}};n[u][0].call(h.exports,function(y){var m=n[u][1][y];return o(m||y)},h,h.exports,r,n,s,i)}return s[u].exports}for(var a=typeof uu=="function"&&uu,l=0;l>2,h=(3&u)<<4|d>>4,y=1<_?(15&d)<<2|f>>6:64,m=2<_?63&f:64,w.push(a.charAt(g)+a.charAt(h)+a.charAt(y)+a.charAt(m));return w.join("")},s.decode=function(l){var u,d,f,g,h,y,m=0,w=0,v="data:";if(l.substr(0,v.length)===v)throw new Error("Invalid base64 input, it looks like a data url.");var p,_=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&_--,l.charAt(l.length-2)===a.charAt(64)&&_--,_%1!=0)throw new Error("Invalid base64 input, bad content length.");for(p=o.uint8array?new Uint8Array(0|_):new Array(0|_);m>4,d=(15&g)<<4|(h=a.indexOf(l.charAt(m++)))>>2,f=(3&h)<<6|(y=a.indexOf(l.charAt(m++))),p[w++]=u,h!==64&&(p[w++]=d),y!==64&&(p[w++]=f);return p}},{"./support":30,"./utils":32}],2:[function(r,n,s){var i=r("./external"),o=r("./stream/DataWorker"),a=r("./stream/Crc32Probe"),l=r("./stream/DataLengthProbe");function u(d,f,g,h,y){this.compressedSize=d,this.uncompressedSize=f,this.crc32=g,this.compression=h,this.compressedContent=y}u.prototype={getContentWorker:function(){var d=new o(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return d.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new o(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(d,f,g){return d.pipe(new a).pipe(new l("uncompressedSize")).pipe(f.compressWorker(g)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},n.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,s){var i=r("./stream/GenericWorker");s.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},s.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,s){var i=r("./utils"),o=function(){for(var a,l=[],u=0;u<256;u++){a=u;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;l[u]=a}return l}();n.exports=function(a,l){return a!==void 0&&a.length?i.getTypeOf(a)!=="string"?function(u,d,f,g){var h=o,y=g+f;u^=-1;for(var m=g;m>>8^h[255&(u^d[m])];return-1^u}(0|l,a,a.length,0):function(u,d,f,g){var h=o,y=g+f;u^=-1;for(var m=g;m>>8^h[255&(u^d.charCodeAt(m))];return-1^u}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(r,n,s){s.base64=!1,s.binary=!1,s.dir=!1,s.createFolders=!0,s.date=null,s.compression=null,s.compressionOptions=null,s.comment=null,s.unixPermissions=null,s.dosPermissions=null},{}],6:[function(r,n,s){var i=null;i=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:i}},{lie:37}],7:[function(r,n,s){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=r("pako"),a=r("./utils"),l=r("./stream/GenericWorker"),u=i?"uint8array":"array";function d(f,g){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=g,this.meta={}}s.magic="\b\0",a.inherits(d,l),d.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(u,f.data),!1)},d.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(g){f.push({data:g,meta:f.meta})}},s.compressWorker=function(f){return new d("Deflate",f)},s.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,s){function i(h,y){var m,w="";for(m=0;m>>=8;return w}function o(h,y,m,w,v,p){var _,C,E=h.file,j=h.compression,R=p!==u.utf8encode,D=a.transformTo("string",p(E.name)),P=a.transformTo("string",u.utf8encode(E.name)),L=E.comment,q=a.transformTo("string",p(L)),T=a.transformTo("string",u.utf8encode(L)),F=P.length!==E.name.length,b=T.length!==L.length,W="",te="",$="",Z=E.dir,I=E.date,Q={crc32:0,compressedSize:0,uncompressedSize:0};y&&!m||(Q.crc32=h.crc32,Q.compressedSize=h.compressedSize,Q.uncompressedSize=h.uncompressedSize);var z=0;y&&(z|=8),R||!F&&!b||(z|=2048);var V=0,de=0;Z&&(V|=16),v==="UNIX"?(de=798,V|=function(se,Pe){var fe=se;return se||(fe=Pe?16893:33204),(65535&fe)<<16}(E.unixPermissions,Z)):(de=20,V|=function(se){return 63&(se||0)}(E.dosPermissions)),_=I.getUTCHours(),_<<=6,_|=I.getUTCMinutes(),_<<=5,_|=I.getUTCSeconds()/2,C=I.getUTCFullYear()-1980,C<<=4,C|=I.getUTCMonth()+1,C<<=5,C|=I.getUTCDate(),F&&(te=i(1,1)+i(d(D),4)+P,W+="up"+i(te.length,2)+te),b&&($=i(1,1)+i(d(q),4)+T,W+="uc"+i($.length,2)+$);var ne="";return ne+=` \0`,ne+=i(z,2),ne+=j.magic,ne+=i(_,2),ne+=i(C,2),ne+=i(Q.crc32,4),ne+=i(Q.compressedSize,4),ne+=i(Q.uncompressedSize,4),ne+=i(D.length,2),ne+=i(W.length,2),{fileRecord:f.LOCAL_FILE_HEADER+ne+D+W,dirRecord:f.CENTRAL_FILE_HEADER+i(de,2)+ne+i(q.length,2)+"\0\0\0\0"+i(V,4)+i(w,4)+D+W+q}}var a=r("../utils"),l=r("../stream/GenericWorker"),u=r("../utf8"),d=r("../crc32"),f=r("../signature");function g(h,y,m,w){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=m,this.encodeFileName=w,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(g,l),g.prototype.push=function(h){var y=h.meta.percent||0,m=this.entriesCount,w=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,l.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:m?(y+100*(m-w-1))/m:100}}))},g.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var y=this.streamFiles&&!h.file.dir;if(y){var m=o(h,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},g.prototype.closedSource=function(h){this.accumulate=!1;var y=this.streamFiles&&!h.file.dir,m=o(h,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),y)this.push({data:function(w){return f.DATA_DESCRIPTOR+i(w.crc32,4)+i(w.compressedSize,4)+i(w.uncompressedSize,4)}(h),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},g.prototype.flush=function(){for(var h=this.bytesWritten,y=0;y=this.index;l--)u=(u<<8)+this.byteAt(l);return this.index+=a,u},readString:function(a){return i.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=o},{"../utils":32}],19:[function(r,n,s){var i=r("./Uint8ArrayReader");function o(a){i.call(this,a)}r("../utils").inherits(o,i),o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,s){var i=r("./DataReader");function o(a){i.call(this,a)}r("../utils").inherits(o,i),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./DataReader":18}],21:[function(r,n,s){var i=r("./ArrayReader");function o(a){i.call(this,a)}r("../utils").inherits(o,i),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,s){var i=r("../utils"),o=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),u=r("./NodeBufferReader"),d=r("./Uint8ArrayReader");n.exports=function(f){var g=i.getTypeOf(f);return i.checkSupport(g),g!=="string"||o.uint8array?g==="nodebuffer"?new u(f):o.uint8array?new d(i.transformTo("uint8array",f)):new a(i.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,s){s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,s){var i=r("./GenericWorker"),o=r("../utils");function a(l){i.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(a,i),a.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,s){var i=r("./GenericWorker"),o=r("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,i),a.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,s){var i=r("../utils"),o=r("./GenericWorker");function a(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}i.inherits(a,o),a.prototype.processChunk=function(l){if(l){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+l.data.length}o.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,s){var i=r("../utils"),o=r("./GenericWorker");function a(l){o.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(d){u.dataIsReady=!0,u.data=d,u.max=d&&d.length||0,u.type=i.getTypeOf(d),u.isPaused||u._tickAndRepeat()},function(d){u.error(d)})}i.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,u);break;case"uint8array":l=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":l=this.data.slice(this.index,u)}return this.index=u,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,s){function i(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var l=0;l "+o:o}},n.exports=i},{}],29:[function(r,n,s){var i=r("../utils"),o=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),u=r("../support"),d=r("../external"),f=null;if(u.nodestream)try{f=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function g(y,m){return new d.Promise(function(w,v){var p=[],_=y._internalType,C=y._outputType,E=y._mimeType;y.on("data",function(j,R){p.push(j),m&&m(R)}).on("error",function(j){p=[],v(j)}).on("end",function(){try{var j=function(R,D,P){switch(R){case"blob":return i.newBlob(i.transformTo("arraybuffer",D),P);case"base64":return l.encode(D);default:return i.transformTo(R,D)}}(C,function(R,D){var P,L=0,q=null,T=0;for(P=0;P"u")s.blob=!1;else{var i=new ArrayBuffer(0);try{s.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(i),s.blob=o.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!r("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,s){for(var i=r("./utils"),o=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),u=new Array(256),d=0;d<256;d++)u[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;u[254]=u[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function g(){l.call(this,"utf-8 encode")}s.utf8encode=function(h){return o.nodebuffer?a.newBufferFrom(h,"utf-8"):function(y){var m,w,v,p,_,C=y.length,E=0;for(p=0;p>>6:(w<65536?m[_++]=224|w>>>12:(m[_++]=240|w>>>18,m[_++]=128|w>>>12&63),m[_++]=128|w>>>6&63),m[_++]=128|63&w);return m}(h)},s.utf8decode=function(h){return o.nodebuffer?i.transformTo("nodebuffer",h).toString("utf-8"):function(y){var m,w,v,p,_=y.length,C=new Array(2*_);for(m=w=0;m<_;)if((v=y[m++])<128)C[w++]=v;else if(4<(p=u[v]))C[w++]=65533,m+=p-1;else{for(v&=p===2?31:p===3?15:7;1>10&1023,C[w++]=56320|1023&v)}return C.length!==w&&(C.subarray?C=C.subarray(0,w):C.length=w),i.applyFromCharCode(C)}(h=i.transformTo(o.uint8array?"uint8array":"array",h))},i.inherits(f,l),f.prototype.processChunk=function(h){var y=i.transformTo(o.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var m=y;(y=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),y.set(m,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var w=function(p,_){var C;for((_=_||p.length)>p.length&&(_=p.length),C=_-1;0<=C&&(192&p[C])==128;)C--;return C<0||C===0?_:C+u[p[C]]>_?C:_}(y),v=y;w!==y.length&&(o.uint8array?(v=y.subarray(0,w),this.leftOver=y.subarray(w,y.length)):(v=y.slice(0,w),this.leftOver=y.slice(w,y.length))),this.push({data:s.utf8decode(v),meta:h.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=f,i.inherits(g,l),g.prototype.processChunk=function(h){this.push({data:s.utf8encode(h.data),meta:h.meta})},s.Utf8EncodeWorker=g},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,s){var i=r("./support"),o=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function u(m){return m}function d(m,w){for(var v=0;v>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=i(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var y,m,w,v=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4>>6:(h<65536?g[w++]=224|h>>>12:(g[w++]=240|h>>>18,g[w++]=128|h>>>12&63),g[w++]=128|h>>>6&63),g[w++]=128|63&h);return g},s.buf2binstring=function(f){return d(f,f.length)},s.binstring2buf=function(f){for(var g=new i.Buf8(f.length),h=0,y=g.length;h>10&1023,p[y++]=56320|1023&m)}return d(p,y)},s.utf8border=function(f,g){var h;for((g=g||f.length)>f.length&&(g=f.length),h=g-1;0<=h&&(192&f[h])==128;)h--;return h<0||h===0?g:h+l[f[h]]>g?h:g}},{"./common":41}],43:[function(r,n,s){n.exports=function(i,o,a,l){for(var u=65535&i|0,d=i>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3>>1:o>>>1;a[l]=o}return a}();n.exports=function(o,a,l,u){var d=i,f=u+l;o^=-1;for(var g=u;g>>8^d[255&(o^a[g])];return-1^o}},{}],46:[function(r,n,s){var i,o=r("../utils/common"),a=r("./trees"),l=r("./adler32"),u=r("./crc32"),d=r("./messages"),f=0,g=4,h=0,y=-2,m=-1,w=4,v=2,p=8,_=9,C=286,E=30,j=19,R=2*C+1,D=15,P=3,L=258,q=L+P+1,T=42,F=113,b=1,W=2,te=3,$=4;function Z(k,J){return k.msg=d[J],J}function I(k){return(k<<1)-(4k.avail_out&&(K=k.avail_out),K!==0&&(o.arraySet(k.output,J.pending_buf,J.pending_out,K,k.next_out),k.next_out+=K,J.pending_out+=K,k.total_out+=K,k.avail_out-=K,J.pending-=K,J.pending===0&&(J.pending_out=0))}function V(k,J){a._tr_flush_block(k,0<=k.block_start?k.block_start:-1,k.strstart-k.block_start,J),k.block_start=k.strstart,z(k.strm)}function de(k,J){k.pending_buf[k.pending++]=J}function ne(k,J){k.pending_buf[k.pending++]=J>>>8&255,k.pending_buf[k.pending++]=255&J}function se(k,J){var K,A,S=k.max_chain_length,N=k.strstart,O=k.prev_length,Y=k.nice_match,M=k.strstart>k.w_size-q?k.strstart-(k.w_size-q):0,H=k.window,X=k.w_mask,ee=k.prev,he=k.strstart+L,Be=H[N+O-1],ze=H[N+O];k.prev_length>=k.good_match&&(S>>=2),Y>k.lookahead&&(Y=k.lookahead);do if(H[(K=J)+O]===ze&&H[K+O-1]===Be&&H[K]===H[N]&&H[++K]===H[N+1]){N+=2,K++;do;while(H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&NM&&--S!=0);return O<=k.lookahead?O:k.lookahead}function Pe(k){var J,K,A,S,N,O,Y,M,H,X,ee=k.w_size;do{if(S=k.window_size-k.lookahead-k.strstart,k.strstart>=ee+(ee-q)){for(o.arraySet(k.window,k.window,ee,ee,0),k.match_start-=ee,k.strstart-=ee,k.block_start-=ee,J=K=k.hash_size;A=k.head[--J],k.head[J]=ee<=A?A-ee:0,--K;);for(J=K=ee;A=k.prev[--J],k.prev[J]=ee<=A?A-ee:0,--K;);S+=ee}if(k.strm.avail_in===0)break;if(O=k.strm,Y=k.window,M=k.strstart+k.lookahead,H=S,X=void 0,X=O.avail_in,H=P)for(N=k.strstart-k.insert,k.ins_h=k.window[N],k.ins_h=(k.ins_h<=P&&(k.ins_h=(k.ins_h<=P)if(A=a._tr_tally(k,k.strstart-k.match_start,k.match_length-P),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=P){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<=P&&(k.ins_h=(k.ins_h<=P&&k.match_length<=k.prev_length){for(S=k.strstart+k.lookahead-P,A=a._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-P),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=S&&(k.ins_h=(k.ins_h<k.pending_buf_size-5&&(K=k.pending_buf_size-5);;){if(k.lookahead<=1){if(Pe(k),k.lookahead===0&&J===f)return b;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var A=k.block_start+K;if((k.strstart===0||k.strstart>=A)&&(k.lookahead=k.strstart-A,k.strstart=A,V(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-q&&(V(k,!1),k.strm.avail_out===0))return b}return k.insert=0,J===g?(V(k,!0),k.strm.avail_out===0?te:$):(k.strstart>k.block_start&&(V(k,!1),k.strm.avail_out),b)}),new Se(4,4,8,4,fe),new Se(4,5,16,8,fe),new Se(4,6,32,32,fe),new Se(4,4,16,16,ve),new Se(8,16,32,32,ve),new Se(8,16,128,128,ve),new Se(8,32,128,256,ve),new Se(32,128,258,1024,ve),new Se(32,258,258,4096,ve)],s.deflateInit=function(k,J){return rt(k,J,p,15,8,0)},s.deflateInit2=rt,s.deflateReset=Ce,s.deflateResetKeep=De,s.deflateSetHeader=function(k,J){return k&&k.state?k.state.wrap!==2?y:(k.state.gzhead=J,h):y},s.deflate=function(k,J){var K,A,S,N;if(!k||!k.state||5>8&255),de(A,A.gzhead.time>>16&255),de(A,A.gzhead.time>>24&255),de(A,A.level===9?2:2<=A.strategy||A.level<2?4:0),de(A,255&A.gzhead.os),A.gzhead.extra&&A.gzhead.extra.length&&(de(A,255&A.gzhead.extra.length),de(A,A.gzhead.extra.length>>8&255)),A.gzhead.hcrc&&(k.adler=u(k.adler,A.pending_buf,A.pending,0)),A.gzindex=0,A.status=69):(de(A,0),de(A,0),de(A,0),de(A,0),de(A,0),de(A,A.level===9?2:2<=A.strategy||A.level<2?4:0),de(A,3),A.status=F);else{var O=p+(A.w_bits-8<<4)<<8;O|=(2<=A.strategy||A.level<2?0:A.level<6?1:A.level===6?2:3)<<6,A.strstart!==0&&(O|=32),O+=31-O%31,A.status=F,ne(A,O),A.strstart!==0&&(ne(A,k.adler>>>16),ne(A,65535&k.adler)),k.adler=1}if(A.status===69)if(A.gzhead.extra){for(S=A.pending;A.gzindex<(65535&A.gzhead.extra.length)&&(A.pending!==A.pending_buf_size||(A.gzhead.hcrc&&A.pending>S&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),z(k),S=A.pending,A.pending!==A.pending_buf_size));)de(A,255&A.gzhead.extra[A.gzindex]),A.gzindex++;A.gzhead.hcrc&&A.pending>S&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),A.gzindex===A.gzhead.extra.length&&(A.gzindex=0,A.status=73)}else A.status=73;if(A.status===73)if(A.gzhead.name){S=A.pending;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>S&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),z(k),S=A.pending,A.pending===A.pending_buf_size)){N=1;break}N=A.gzindexS&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),N===0&&(A.gzindex=0,A.status=91)}else A.status=91;if(A.status===91)if(A.gzhead.comment){S=A.pending;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>S&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),z(k),S=A.pending,A.pending===A.pending_buf_size)){N=1;break}N=A.gzindexS&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),N===0&&(A.status=103)}else A.status=103;if(A.status===103&&(A.gzhead.hcrc?(A.pending+2>A.pending_buf_size&&z(k),A.pending+2<=A.pending_buf_size&&(de(A,255&k.adler),de(A,k.adler>>8&255),k.adler=0,A.status=F)):A.status=F),A.pending!==0){if(z(k),k.avail_out===0)return A.last_flush=-1,h}else if(k.avail_in===0&&I(J)<=I(K)&&J!==g)return Z(k,-5);if(A.status===666&&k.avail_in!==0)return Z(k,-5);if(k.avail_in!==0||A.lookahead!==0||J!==f&&A.status!==666){var Y=A.strategy===2?function(M,H){for(var X;;){if(M.lookahead===0&&(Pe(M),M.lookahead===0)){if(H===f)return b;break}if(M.match_length=0,X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,X&&(V(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===g?(V(M,!0),M.strm.avail_out===0?te:$):M.last_lit&&(V(M,!1),M.strm.avail_out===0)?b:W}(A,J):A.strategy===3?function(M,H){for(var X,ee,he,Be,ze=M.window;;){if(M.lookahead<=L){if(Pe(M),M.lookahead<=L&&H===f)return b;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=P&&0M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=P?(X=a._tr_tally(M,1,M.match_length-P),M.lookahead-=M.match_length,M.strstart+=M.match_length,M.match_length=0):(X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++),X&&(V(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===g?(V(M,!0),M.strm.avail_out===0?te:$):M.last_lit&&(V(M,!1),M.strm.avail_out===0)?b:W}(A,J):i[A.level].func(A,J);if(Y!==te&&Y!==$||(A.status=666),Y===b||Y===te)return k.avail_out===0&&(A.last_flush=-1),h;if(Y===W&&(J===1?a._tr_align(A):J!==5&&(a._tr_stored_block(A,0,0,!1),J===3&&(Q(A.head),A.lookahead===0&&(A.strstart=0,A.block_start=0,A.insert=0))),z(k),k.avail_out===0))return A.last_flush=-1,h}return J!==g?h:A.wrap<=0?1:(A.wrap===2?(de(A,255&k.adler),de(A,k.adler>>8&255),de(A,k.adler>>16&255),de(A,k.adler>>24&255),de(A,255&k.total_in),de(A,k.total_in>>8&255),de(A,k.total_in>>16&255),de(A,k.total_in>>24&255)):(ne(A,k.adler>>>16),ne(A,65535&k.adler)),z(k),0=K.w_size&&(N===0&&(Q(K.head),K.strstart=0,K.block_start=0,K.insert=0),H=new o.Buf8(K.w_size),o.arraySet(H,J,X-K.w_size,K.w_size,0),J=H,X=K.w_size),O=k.avail_in,Y=k.next_in,M=k.input,k.avail_in=X,k.next_in=0,k.input=J,Pe(K);K.lookahead>=P;){for(A=K.strstart,S=K.lookahead-(P-1);K.ins_h=(K.ins_h<>>=P=D>>>24,_-=P,(P=D>>>16&255)===0)W[d++]=65535&D;else{if(!(16&P)){if(!(64&P)){D=C[(65535&D)+(p&(1<>>=P,_-=P),_<15&&(p+=b[l++]<<_,_+=8,p+=b[l++]<<_,_+=8),D=E[p&R];r:for(;;){if(p>>>=P=D>>>24,_-=P,!(16&(P=D>>>16&255))){if(!(64&P)){D=E[(65535&D)+(p&(1<>>=P,_-=P,(P=d-f)>3,p&=(1<<(_-=L<<3))-1,i.next_in=l,i.next_out=d,i.avail_in=l>>24&255)+(T>>>8&65280)+((65280&T)<<8)+((255&T)<<24)}function p(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(T){var F;return T&&T.state?(F=T.state,T.total_in=T.total_out=F.total=0,T.msg="",F.wrap&&(T.adler=1&F.wrap),F.mode=y,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new i.Buf32(m),F.distcode=F.distdyn=new i.Buf32(w),F.sane=1,F.back=-1,g):h}function C(T){var F;return T&&T.state?((F=T.state).wsize=0,F.whave=0,F.wnext=0,_(T)):h}function E(T,F){var b,W;return T&&T.state?(W=T.state,F<0?(b=0,F=-F):(b=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15=$.wsize?(i.arraySet($.window,F,b-$.wsize,$.wsize,0),$.wnext=0,$.whave=$.wsize):(W<(te=$.wsize-$.wnext)&&(te=W),i.arraySet($.window,F,b-W,te,$.wnext),(W-=te)?(i.arraySet($.window,F,b-W,W,0),$.wnext=W,$.whave=$.wsize):($.wnext+=te,$.wnext===$.wsize&&($.wnext=0),$.whave<$.wsize&&($.whave+=te))),0}s.inflateReset=C,s.inflateReset2=E,s.inflateResetKeep=_,s.inflateInit=function(T){return j(T,15)},s.inflateInit2=j,s.inflate=function(T,F){var b,W,te,$,Z,I,Q,z,V,de,ne,se,Pe,fe,ve,Se,Ie,De,Ce,rt,k,J,K,A,S=0,N=new i.Buf8(4),O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!T||!T.state||!T.output||!T.input&&T.avail_in!==0)return h;(b=T.state).mode===12&&(b.mode=13),Z=T.next_out,te=T.output,Q=T.avail_out,$=T.next_in,W=T.input,I=T.avail_in,z=b.hold,V=b.bits,de=I,ne=Q,J=g;e:for(;;)switch(b.mode){case y:if(b.wrap===0){b.mode=13;break}for(;V<16;){if(I===0)break e;I--,z+=W[$++]<>>8&255,b.check=a(b.check,N,2,0),V=z=0,b.mode=2;break}if(b.flags=0,b.head&&(b.head.done=!1),!(1&b.wrap)||(((255&z)<<8)+(z>>8))%31){T.msg="incorrect header check",b.mode=30;break}if((15&z)!=8){T.msg="unknown compression method",b.mode=30;break}if(V-=4,k=8+(15&(z>>>=4)),b.wbits===0)b.wbits=k;else if(k>b.wbits){T.msg="invalid window size",b.mode=30;break}b.dmax=1<>8&1),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,b.check=a(b.check,N,2,0)),V=z=0,b.mode=3;case 3:for(;V<32;){if(I===0)break e;I--,z+=W[$++]<>>8&255,N[2]=z>>>16&255,N[3]=z>>>24&255,b.check=a(b.check,N,4,0)),V=z=0,b.mode=4;case 4:for(;V<16;){if(I===0)break e;I--,z+=W[$++]<>8),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,b.check=a(b.check,N,2,0)),V=z=0,b.mode=5;case 5:if(1024&b.flags){for(;V<16;){if(I===0)break e;I--,z+=W[$++]<>>8&255,b.check=a(b.check,N,2,0)),V=z=0}else b.head&&(b.head.extra=null);b.mode=6;case 6:if(1024&b.flags&&(I<(se=b.length)&&(se=I),se&&(b.head&&(k=b.head.extra_len-b.length,b.head.extra||(b.head.extra=new Array(b.head.extra_len)),i.arraySet(b.head.extra,W,$,se,k)),512&b.flags&&(b.check=a(b.check,W,se,$)),I-=se,$+=se,b.length-=se),b.length))break e;b.length=0,b.mode=7;case 7:if(2048&b.flags){if(I===0)break e;for(se=0;k=W[$+se++],b.head&&k&&b.length<65536&&(b.head.name+=String.fromCharCode(k)),k&&se>9&1,b.head.done=!0),T.adler=b.check=0,b.mode=12;break;case 10:for(;V<32;){if(I===0)break e;I--,z+=W[$++]<>>=7&V,V-=7&V,b.mode=27;break}for(;V<3;){if(I===0)break e;I--,z+=W[$++]<>>=1)){case 0:b.mode=14;break;case 1:if(L(b),b.mode=20,F!==6)break;z>>>=2,V-=2;break e;case 2:b.mode=17;break;case 3:T.msg="invalid block type",b.mode=30}z>>>=2,V-=2;break;case 14:for(z>>>=7&V,V-=7&V;V<32;){if(I===0)break e;I--,z+=W[$++]<>>16^65535)){T.msg="invalid stored block lengths",b.mode=30;break}if(b.length=65535&z,V=z=0,b.mode=15,F===6)break e;case 15:b.mode=16;case 16:if(se=b.length){if(I>>=5,V-=5,b.ndist=1+(31&z),z>>>=5,V-=5,b.ncode=4+(15&z),z>>>=4,V-=4,286>>=3,V-=3}for(;b.have<19;)b.lens[O[b.have++]]=0;if(b.lencode=b.lendyn,b.lenbits=7,K={bits:b.lenbits},J=u(0,b.lens,0,19,b.lencode,0,b.work,K),b.lenbits=K.bits,J){T.msg="invalid code lengths set",b.mode=30;break}b.have=0,b.mode=19;case 19:for(;b.have>>16&255,Ie=65535&S,!((ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=ve,V-=ve,b.lens[b.have++]=Ie;else{if(Ie===16){for(A=ve+2;V>>=ve,V-=ve,b.have===0){T.msg="invalid bit length repeat",b.mode=30;break}k=b.lens[b.have-1],se=3+(3&z),z>>>=2,V-=2}else if(Ie===17){for(A=ve+3;V>>=ve)),z>>>=3,V-=3}else{for(A=ve+7;V>>=ve)),z>>>=7,V-=7}if(b.have+se>b.nlen+b.ndist){T.msg="invalid bit length repeat",b.mode=30;break}for(;se--;)b.lens[b.have++]=k}}if(b.mode===30)break;if(b.lens[256]===0){T.msg="invalid code -- missing end-of-block",b.mode=30;break}if(b.lenbits=9,K={bits:b.lenbits},J=u(d,b.lens,0,b.nlen,b.lencode,0,b.work,K),b.lenbits=K.bits,J){T.msg="invalid literal/lengths set",b.mode=30;break}if(b.distbits=6,b.distcode=b.distdyn,K={bits:b.distbits},J=u(f,b.lens,b.nlen,b.ndist,b.distcode,0,b.work,K),b.distbits=K.bits,J){T.msg="invalid distances set",b.mode=30;break}if(b.mode=20,F===6)break e;case 20:b.mode=21;case 21:if(6<=I&&258<=Q){T.next_out=Z,T.avail_out=Q,T.next_in=$,T.avail_in=I,b.hold=z,b.bits=V,l(T,ne),Z=T.next_out,te=T.output,Q=T.avail_out,$=T.next_in,W=T.input,I=T.avail_in,z=b.hold,V=b.bits,b.mode===12&&(b.back=-1);break}for(b.back=0;Se=(S=b.lencode[z&(1<>>16&255,Ie=65535&S,!((ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>De)])>>>16&255,Ie=65535&S,!(De+(ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=De,V-=De,b.back+=De}if(z>>>=ve,V-=ve,b.back+=ve,b.length=Ie,Se===0){b.mode=26;break}if(32&Se){b.back=-1,b.mode=12;break}if(64&Se){T.msg="invalid literal/length code",b.mode=30;break}b.extra=15&Se,b.mode=22;case 22:if(b.extra){for(A=b.extra;V>>=b.extra,V-=b.extra,b.back+=b.extra}b.was=b.length,b.mode=23;case 23:for(;Se=(S=b.distcode[z&(1<>>16&255,Ie=65535&S,!((ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>De)])>>>16&255,Ie=65535&S,!(De+(ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=De,V-=De,b.back+=De}if(z>>>=ve,V-=ve,b.back+=ve,64&Se){T.msg="invalid distance code",b.mode=30;break}b.offset=Ie,b.extra=15&Se,b.mode=24;case 24:if(b.extra){for(A=b.extra;V>>=b.extra,V-=b.extra,b.back+=b.extra}if(b.offset>b.dmax){T.msg="invalid distance too far back",b.mode=30;break}b.mode=25;case 25:if(Q===0)break e;if(se=ne-Q,b.offset>se){if((se=b.offset-se)>b.whave&&b.sane){T.msg="invalid distance too far back",b.mode=30;break}Pe=se>b.wnext?(se-=b.wnext,b.wsize-se):b.wnext-se,se>b.length&&(se=b.length),fe=b.window}else fe=te,Pe=Z-b.offset,se=b.length;for(QR?(P=Pe[fe+w[F]],V[de+w[F]]):(P=96,0),p=1<>Z)+(_-=p)]=D<<24|P<<16|L|0,_!==0;);for(p=1<>=1;if(p!==0?(z&=p-1,z+=p):z=0,F++,--ne[T]==0){if(T===W)break;T=f[g+w[F]]}if(te>>7)]}function de(S,N){S.pending_buf[S.pending++]=255&N,S.pending_buf[S.pending++]=N>>>8&255}function ne(S,N,O){S.bi_valid>v-O?(S.bi_buf|=N<>v-S.bi_valid,S.bi_valid+=O-v):(S.bi_buf|=N<>>=1,O<<=1,0<--N;);return O>>>1}function fe(S,N,O){var Y,M,H=new Array(w+1),X=0;for(Y=1;Y<=w;Y++)H[Y]=X=X+O[Y-1]<<1;for(M=0;M<=N;M++){var ee=S[2*M+1];ee!==0&&(S[2*M]=Pe(H[ee]++,ee))}}function ve(S){var N;for(N=0;N>1;1<=O;O--)De(S,H,O);for(M=he;O=S.heap[1],S.heap[1]=S.heap[S.heap_len--],De(S,H,1),Y=S.heap[1],S.heap[--S.heap_max]=O,S.heap[--S.heap_max]=Y,H[2*M]=H[2*O]+H[2*Y],S.depth[M]=(S.depth[O]>=S.depth[Y]?S.depth[O]:S.depth[Y])+1,H[2*O+1]=H[2*Y+1]=M,S.heap[1]=M++,De(S,H,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(ze,Et){var Wr,Bt,Gn,it,qn,Xn,$r=Et.dyn_tree,jc=Et.max_code,Tc=Et.stat_desc.static_tree,so=Et.stat_desc.has_stree,Nc=Et.stat_desc.extra_bits,io=Et.stat_desc.extra_base,jn=Et.stat_desc.max_length,Ds=0;for(it=0;it<=w;it++)ze.bl_count[it]=0;for($r[2*ze.heap[ze.heap_max]+1]=0,Wr=ze.heap_max+1;Wr>=7;M>>=1)if(1&Be&&ee.dyn_ltree[2*he]!==0)return o;if(ee.dyn_ltree[18]!==0||ee.dyn_ltree[20]!==0||ee.dyn_ltree[26]!==0)return a;for(he=32;he>>3,(H=S.static_len+3+7>>>3)<=M&&(M=H)):M=H=O+5,O+4<=M&&N!==-1?A(S,N,O,Y):S.strategy===4||H===M?(ne(S,2+(Y?1:0),3),Ce(S,q,T)):(ne(S,4+(Y?1:0),3),function(ee,he,Be,ze){var Et;for(ne(ee,he-257,5),ne(ee,Be-1,5),ne(ee,ze-4,4),Et=0;Et>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&N,S.pending_buf[S.l_buf+S.last_lit]=255&O,S.last_lit++,N===0?S.dyn_ltree[2*O]++:(S.matches++,N--,S.dyn_ltree[2*(b[O]+f+1)]++,S.dyn_dtree[2*V(N)]++),S.last_lit===S.lit_bufsize-1},s._tr_align=function(S){ne(S,2,3),se(S,_,q),function(N){N.bi_valid===16?(de(N,N.bi_buf),N.bi_buf=0,N.bi_valid=0):8<=N.bi_valid&&(N.pending_buf[N.pending++]=255&N.bi_buf,N.bi_buf>>=8,N.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(r,n,s){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,s){(function(i){(function(o,a){if(!o.setImmediate){var l,u,d,f,g=1,h={},y=!1,m=o.document,w=Object.getPrototypeOf&&Object.getPrototypeOf(o);w=w&&w.setTimeout?w:o,l={}.toString.call(o.process)==="[object process]"?function(C){process.nextTick(function(){p(C)})}:function(){if(o.postMessage&&!o.importScripts){var C=!0,E=o.onmessage;return o.onmessage=function(){C=!1},o.postMessage("","*"),o.onmessage=E,C}}()?(f="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",_,!1):o.attachEvent("onmessage",_),function(C){o.postMessage(f+C,"*")}):o.MessageChannel?((d=new MessageChannel).port1.onmessage=function(C){p(C.data)},function(C){d.port2.postMessage(C)}):m&&"onreadystatechange"in m.createElement("script")?(u=m.documentElement,function(C){var E=m.createElement("script");E.onreadystatechange=function(){p(C),E.onreadystatechange=null,u.removeChild(E),E=null},u.appendChild(E)}):function(C){setTimeout(p,0,C)},w.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var E=new Array(arguments.length-1),j=0;j"u"?i===void 0?this:i:self)}).call(this,typeof Oc<"u"?Oc:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(IC);var S5=IC.exports;const k5=vm(S5);function C5(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{n.result?t(n.result.toString()):r("No content found")},n.onerror=()=>r(n.error),n.readAsText(e)})}const E5=async(e,t)=>{const r=new k5;t.forEach(i=>{r.file(i.name,i.content)});const n=await r.generateAsync({type:"blob"}),s=document.createElement("a");s.href=URL.createObjectURL(n),s.download=e,s.click()},ca=e=>{const t=new Date(e);return new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"Asia/Shanghai"}).format(t)},j5=e=>ca(e).split(" ")[0];function LC(e){const t=new Date;t.setUTCDate(t.getUTCDate()+e);const r=t.getUTCFullYear(),n=String(t.getUTCMonth()+1).padStart(2,"0"),s=String(t.getUTCDate()).padStart(2,"0"),i=String(t.getUTCHours()).padStart(2,"0"),o=String(t.getUTCMinutes()).padStart(2,"0"),a=String(t.getUTCSeconds()).padStart(2,"0");return`${r}-${n}-${s} ${i}:${o}:${a}`}const T5=async e=>{let t=1;e.page&&(t=e.page);let r=2;e.perPage&&(r=e.perPage);const n=xt();let s="";return e.state==="enabled"?s="enabled=true":e.state==="disabled"?s="enabled=false":e.state==="expired"&&(s=n.filter("expiredAt<{:expiredAt}",{expiredAt:LC(15)})),n.collection("domains").getList(t,r,{sort:"-created",expand:"lastDeployment",filter:s})},N5=async()=>{const e=xt(),t=await e.collection("domains").getList(1,1,{}),r=await e.collection("domains").getList(1,1,{filter:e.filter("expiredAt<{:expiredAt}",{expiredAt:LC(15)})}),n=await e.collection("domains").getList(1,1,{filter:"enabled=true"}),s=await e.collection("domains").getList(1,1,{filter:"enabled=false"});return{total:t.totalItems,expired:r.totalItems,enabled:n.totalItems,disabled:s.totalItems}},R5=async e=>await xt().collection("domains").getOne(e),sm=async e=>e.id?await xt().collection("domains").update(e.id,e):await xt().collection("domains").create(e),P5=async e=>await xt().collection("domains").delete(e),D5=(e,t)=>xt().collection("domains").subscribe(e,r=>{r.action==="update"&&t(r.record)},{expand:"lastDeployment"}),A5=e=>{xt().collection("domains").unsubscribe(e)},O5=()=>{const e=Tf(),t=Sn(),r=Hn(),n=new URLSearchParams(r.search),s=n.get("page"),i=n.get("state"),[o,a]=x.useState(0),l=()=>{t("/edit")},u=p=>{n.set("page",p.toString()),t(`?${n.toString()}`)},d=p=>{t(`/edit?id=${p}`)},f=p=>{t(`/history?domain=${p}`)},g=async p=>{try{await P5(p),y(h.filter(_=>_.id!==p))}catch(_){console.error("Error deleting domain:",_)}},[h,y]=x.useState([]);x.useEffect(()=>{(async()=>{const _=await T5({page:s?Number(s):1,perPage:10,state:i||""});y(_.items),a(_.totalPages)})()},[s,i]);const m=async p=>{const _=h.filter(R=>R.id===p),C=_[0].enabled,E=_[0];E.enabled=!C,await sm(E);const j=h.map(R=>R.id===p?{...R,checked:!C}:R);y(j)},w=async p=>{try{A5(p.id),D5(p.id,_=>{console.log(_);const C=h.map(E=>E.id===_.id?{..._}:E);y(C)}),p.rightnow=!0,await sm(p),e.toast({title:"操作成功",description:"已发起部署,请稍后查看部署日志。"})}catch{e.toast({title:"执行失败",description:c.jsxs(c.Fragment,{children:["执行失败,请查看",c.jsx(dr,{to:`/history?domain=${p.id}`,className:"underline text-blue-500",children:"部署日志"}),"查看详情。"]}),variant:"destructive"})}},v=async p=>{const _=`${p.id}-${p.domain}.zip`,C=[{name:`${p.domain}.pem`,content:p.certificate?p.certificate:""},{name:`${p.domain}.key`,content:p.privateKey?p.privateKey:""}];await E5(_,C)};return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"",children:[c.jsx(Pv,{}),c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("div",{className:"text-muted-foreground",children:"域名列表"}),c.jsx(at,{onClick:l,children:"新增域名"})]}),h.length?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[c.jsx("div",{className:"w-40",children:"域名"}),c.jsx("div",{className:"w-48",children:"有效期限"}),c.jsx("div",{className:"w-32",children:"最近执行状态"}),c.jsx("div",{className:"w-64",children:"最近执行阶段"}),c.jsx("div",{className:"w-40 sm:ml-2",children:"最近执行时间"}),c.jsx("div",{className:"w-32",children:"是否启用"}),c.jsx("div",{className:"grow",children:"操作"})]}),c.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"域名"}),h.map(p=>{var _,C,E,j,R,D;return c.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[c.jsx("div",{className:"sm:w-40 w-full pt-1 sm:pt-0 flex items-center",children:p.domain}),c.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:c.jsx("div",{children:p.expiredAt?c.jsxs(c.Fragment,{children:[c.jsx("div",{children:"有效期90天"}),c.jsxs("div",{children:[j5(p.expiredAt),"到期"]})]}):"---"})}),c.jsx("div",{className:"sm:w-32 w-full pt-1 sm:pt-0 flex items-center",children:p.lastDeployedAt&&((_=p.expand)!=null&&_.lastDeployment)?c.jsx(c.Fragment,{children:((C=p.expand.lastDeployment)==null?void 0:C.phase)==="deploy"&&((E=p.expand.lastDeployment)!=null&&E.phaseSuccess)?c.jsx(vg,{size:16,className:"text-green-700"}):c.jsx(yg,{size:16,className:"text-red-700"})}):"---"}),c.jsx("div",{className:"sm:w-64 w-full pt-1 sm:pt-0 flex items-center",children:p.lastDeployedAt&&((j=p.expand)!=null&&j.lastDeployment)?c.jsx(Ev,{phase:(R=p.expand.lastDeployment)==null?void 0:R.phase,phaseSuccess:(D=p.expand.lastDeployment)==null?void 0:D.phaseSuccess}):"---"}),c.jsx("div",{className:"sm:w-40 pt-1 sm:pt-0 sm:ml-2 flex items-center",children:p.lastDeployedAt?ca(p.lastDeployedAt):"---"}),c.jsx("div",{className:"sm:w-32 flex items-center",children:c.jsx(RC,{children:c.jsxs(w5,{children:[c.jsx(_5,{children:c.jsx(sC,{checked:p.enabled,onCheckedChange:()=>{m(p.id)}})}),c.jsx(Av,{children:c.jsx("div",{className:"border rounded-sm px-3 bg-background text-muted-foreground text-xs",children:p.enabled?"禁用":"启用"})})]})})}),c.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[c.jsx(at,{variant:"link",className:"p-0",onClick:()=>f(p.id),children:"部署历史"}),c.jsxs(y0,{when:!!p.enabled,children:[c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(at,{variant:"link",className:"p-0",onClick:()=>w(p),children:"立即部署"})]}),c.jsxs(y0,{when:!!p.expiredAt,children:[c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(at,{variant:"link",className:"p-0",onClick:()=>v(p),children:"下载"})]}),!p.enabled&&c.jsxs(c.Fragment,{children:[c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsxs(_3,{children:[c.jsx(b3,{asChild:!0,children:c.jsx(at,{variant:"link",className:"p-0",children:"删除"})}),c.jsxs(Hk,{children:[c.jsxs(Yk,{children:[c.jsx(Kk,{children:"删除域名"}),c.jsx(Gk,{children:"确定要删除域名吗?"})]}),c.jsxs(Zk,{children:[c.jsx(Xk,{children:"取消"}),c.jsx(qk,{onClick:()=>{g(p.id)},children:"确认"})]})]})]}),c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(at,{variant:"link",className:"p-0",onClick:()=>d(p.id),children:"编辑"})]})]})]},p.id)}),c.jsx(kk,{totalPages:o,currentPage:s?Number(s):1,onPageChange:p=>{u(p)}})]}):c.jsx(c.Fragment,{children:c.jsxs("div",{className:"flex flex-col items-center mt-10",children:[c.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:c.jsx(Ip,{size:40,className:"text-primary"})}),c.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),c.jsx(at,{onClick:l,className:"mt-3",children:"添加域名"})]})})]})})},Fe=x.forwardRef(({className:e,type:t,...r},n)=>c.jsx("input",{type:t,className:pe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));Fe.displayName="Input";var kc=e=>e.type==="checkbox",Ao=e=>e instanceof Date,hr=e=>e==null;const FC=e=>typeof e=="object";var qt=e=>!hr(e)&&!Array.isArray(e)&&FC(e)&&!Ao(e),zC=e=>qt(e)&&e.target?kc(e.target)?e.target.checked:e.target.value:e,M5=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,UC=(e,t)=>e.has(M5(t)),I5=e=>{const t=e.constructor&&e.constructor.prototype;return qt(t)&&t.hasOwnProperty("isPrototypeOf")},Ov=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function wr(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Ov&&(e instanceof Blob||e instanceof FileList))&&(r||qt(e)))if(t=r?[]:{},!r&&!I5(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=wr(e[n]));else return e;return t}var Af=e=>Array.isArray(e)?e.filter(Boolean):[],Ft=e=>e===void 0,le=(e,t,r)=>{if(!t||!qt(e))return r;const n=Af(t.split(/[,[\].]+?/)).reduce((s,i)=>hr(s)?s:s[i],e);return Ft(n)||n===e?Ft(e[t])?r:e[t]:n},On=e=>typeof e=="boolean",Mv=e=>/^\w*$/.test(e),VC=e=>Af(e.replace(/["|']|\]/g,"").split(/\.|\[/)),dt=(e,t,r)=>{let n=-1;const s=Mv(t)?[t]:VC(t),i=s.length,o=i-1;for(;++net.useContext(WC),L5=e=>{const{children:t,...r}=e;return et.createElement(WC.Provider,{value:r},t)};var $C=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const o=i;return t._proxyFormState[o]!==dn.all&&(t._proxyFormState[o]=!n||dn.all),r&&(r[o]=!0),e[o]}});return s},Nr=e=>qt(e)&&!Object.keys(e).length,BC=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return Nr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!n||dn.all))},pl=e=>Array.isArray(e)?e:[e],HC=(e,t,r)=>!e||!t||e===t||pl(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function Iv(e){const t=et.useRef(e);t.current=e,et.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function F5(e){const t=Of(),{control:r=t.control,disabled:n,name:s,exact:i}=e||{},[o,a]=et.useState(r._formState),l=et.useRef(!0),u=et.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=et.useRef(s);return d.current=s,Iv({disabled:n,next:f=>l.current&&HC(d.current,f.name,i)&&BC(f,u.current,r._updateFormState)&&a({...r._formState,...f}),subject:r._subjects.state}),et.useEffect(()=>(l.current=!0,u.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),$C(o,r,u.current,!1)}var In=e=>typeof e=="string",YC=(e,t,r,n,s)=>In(e)?(n&&t.watch.add(e),le(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),le(r,i))):(n&&(t.watchAll=!0),r);function z5(e){const t=Of(),{control:r=t.control,name:n,defaultValue:s,disabled:i,exact:o}=e||{},a=et.useRef(n);a.current=n,Iv({disabled:i,subject:r._subjects.values,next:d=>{HC(a.current,d.name,o)&&u(wr(YC(a.current,r._names,d.values||r._formValues,!1,s)))}});const[l,u]=et.useState(r._getWatch(n,s));return et.useEffect(()=>r._removeUnmounted()),l}function U5(e){const t=Of(),{name:r,disabled:n,control:s=t.control,shouldUnregister:i}=e,o=UC(s._names.array,r),a=z5({control:s,name:r,defaultValue:le(s._formValues,r,le(s._defaultValues,r,e.defaultValue)),exact:!0}),l=F5({control:s,name:r}),u=et.useRef(s.register(r,{...e.rules,value:a,...On(e.disabled)?{disabled:e.disabled}:{}}));return et.useEffect(()=>{const d=s._options.shouldUnregister||i,f=(g,h)=>{const y=le(s._fields,g);y&&y._f&&(y._f.mount=h)};if(f(r,!0),d){const g=wr(le(s._options.defaultValues,r));dt(s._defaultValues,r,g),Ft(le(s._formValues,r))&&dt(s._formValues,r,g)}return()=>{(o?d&&!s._state.action:d)?s.unregister(r):f(r,!1)}},[r,s,o,i]),et.useEffect(()=>{le(s._fields,r)&&s._updateDisabledField({disabled:n,fields:s._fields,name:r,value:le(s._fields,r)._f.value})},[n,r,s]),{field:{name:r,value:a,...On(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:et.useCallback(d=>u.current.onChange({target:{value:zC(d),name:r},type:xd.CHANGE}),[r]),onBlur:et.useCallback(()=>u.current.onBlur({target:{value:le(s._formValues,r),name:r},type:xd.BLUR}),[r,s]),ref:d=>{const f=le(s._fields,r);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:g=>d.setCustomValidity(g),reportValidity:()=>d.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!le(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!le(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!le(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!le(l.validatingFields,r)},error:{enumerable:!0,get:()=>le(l.errors,r)}})}}const V5=e=>e.render(U5(e));var ZC=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},_0=e=>({isOnSubmit:!e||e===dn.onSubmit,isOnBlur:e===dn.onBlur,isOnChange:e===dn.onChange,isOnAll:e===dn.all,isOnTouch:e===dn.onTouched}),b0=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const ml=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=le(e,s);if(i){const{_f:o,...a}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!n)break;if(o.ref&&t(o.ref,o.name)&&!n)break;ml(a,t)}else qt(a)&&ml(a,t)}}};var W5=(e,t,r)=>{const n=pl(le(e,r));return dt(n,"root",t[r]),dt(e,r,n),e},Lv=e=>e.type==="file",Ks=e=>typeof e=="function",wd=e=>{if(!Ov)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Au=e=>In(e),Fv=e=>e.type==="radio",_d=e=>e instanceof RegExp;const S0={value:!1,isValid:!1},k0={value:!0,isValid:!0};var KC=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ft(e[0].attributes.value)?Ft(e[0].value)||e[0].value===""?k0:{value:e[0].value,isValid:!0}:k0:S0}return S0};const C0={isValid:!1,value:null};var GC=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,C0):C0;function E0(e,t,r="validate"){if(Au(e)||Array.isArray(e)&&e.every(Au)||On(e)&&!e)return{type:r,message:Au(e)?e:"",ref:t}}var go=e=>qt(e)&&!_d(e)?e:{value:e,message:""},j0=async(e,t,r,n,s)=>{const{ref:i,refs:o,required:a,maxLength:l,minLength:u,min:d,max:f,pattern:g,validate:h,name:y,valueAsNumber:m,mount:w,disabled:v}=e._f,p=le(t,y);if(!w||v)return{};const _=o?o[0]:i,C=T=>{n&&_.reportValidity&&(_.setCustomValidity(On(T)?"":T||""),_.reportValidity())},E={},j=Fv(i),R=kc(i),D=j||R,P=(m||Lv(i))&&Ft(i.value)&&Ft(p)||wd(i)&&i.value===""||p===""||Array.isArray(p)&&!p.length,L=ZC.bind(null,y,r,E),q=(T,F,b,W=ts.maxLength,te=ts.minLength)=>{const $=T?F:b;E[y]={type:T?W:te,message:$,ref:i,...L(T?W:te,$)}};if(s?!Array.isArray(p)||!p.length:a&&(!D&&(P||hr(p))||On(p)&&!p||R&&!KC(o).isValid||j&&!GC(o).isValid)){const{value:T,message:F}=Au(a)?{value:!!a,message:a}:go(a);if(T&&(E[y]={type:ts.required,message:F,ref:_,...L(ts.required,F)},!r))return C(F),E}if(!P&&(!hr(d)||!hr(f))){let T,F;const b=go(f),W=go(d);if(!hr(p)&&!isNaN(p)){const te=i.valueAsNumber||p&&+p;hr(b.value)||(T=te>b.value),hr(W.value)||(F=tenew Date(new Date().toDateString()+" "+Q),Z=i.type=="time",I=i.type=="week";In(b.value)&&p&&(T=Z?$(p)>$(b.value):I?p>b.value:te>new Date(b.value)),In(W.value)&&p&&(F=Z?$(p)<$(W.value):I?p+T.value,W=!hr(F.value)&&p.length<+F.value;if((b||W)&&(q(b,T.message,F.message),!r))return C(E[y].message),E}if(g&&!P&&In(p)){const{value:T,message:F}=go(g);if(_d(T)&&!p.match(T)&&(E[y]={type:ts.pattern,message:F,ref:i,...L(ts.pattern,F)},!r))return C(F),E}if(h){if(Ks(h)){const T=await h(p,t),F=E0(T,_);if(F&&(E[y]={...F,...L(ts.validate,F.message)},!r))return C(F.message),E}else if(qt(h)){let T={};for(const F in h){if(!Nr(T)&&!r)break;const b=E0(await h[F](p,t),_,F);b&&(T={...b,...L(F,b.message)},C(b.message),r&&(E[y]=T))}if(!Nr(T)&&(E[y]={ref:_,...T},!r))return E}}return C(!0),E};function $5(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}},bd=e=>hr(e)||!FC(e);function Oi(e,t){if(bd(e)||bd(t))return e===t;if(Ao(e)&&Ao(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r){const i=e[s];if(!n.includes(s))return!1;if(s!=="ref"){const o=t[s];if(Ao(i)&&Ao(o)||qt(i)&&qt(o)||Array.isArray(i)&&Array.isArray(o)?!Oi(i,o):i!==o)return!1}}return!0}var qC=e=>e.type==="select-multiple",H5=e=>Fv(e)||kc(e),Lh=e=>wd(e)&&e.isConnected,XC=e=>{for(const t in e)if(Ks(e[t]))return!0;return!1};function Sd(e,t={}){const r=Array.isArray(e);if(qt(e)||r)for(const n in e)Array.isArray(e[n])||qt(e[n])&&!XC(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Sd(e[n],t[n])):hr(e[n])||(t[n]=!0);return t}function QC(e,t,r){const n=Array.isArray(e);if(qt(e)||n)for(const s in e)Array.isArray(e[s])||qt(e[s])&&!XC(e[s])?Ft(t)||bd(r[s])?r[s]=Array.isArray(e[s])?Sd(e[s],[]):{...Sd(e[s])}:QC(e[s],hr(t)?{}:t[s],r[s]):r[s]=!Oi(e[s],t[s]);return r}var du=(e,t)=>QC(e,t,Sd(t)),JC=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ft(e)?e:t?e===""?NaN:e&&+e:r&&In(e)?new Date(e):n?n(e):e;function Fh(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return Lv(t)?t.files:Fv(t)?GC(e.refs).value:qC(t)?[...t.selectedOptions].map(({value:r})=>r):kc(t)?KC(e.refs).value:JC(Ft(t.value)?e.ref.value:t.value,e)}var Y5=(e,t,r,n)=>{const s={};for(const i of e){const o=le(t,i);o&&dt(s,i,o._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Ba=e=>Ft(e)?e:_d(e)?e.source:qt(e)?_d(e.value)?e.value.source:e.value:e,Z5=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function T0(e,t,r){const n=le(e,r);if(n||Mv(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),o=le(t,i),a=le(e,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(a&&a.type)return{name:i,error:a};s.pop()}return{name:r}}var K5=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,G5=(e,t)=>!Af(le(e,t)).length&&Ht(e,t);const q5={mode:dn.onSubmit,reValidateMode:dn.onChange,shouldFocusError:!0};function X5(e={}){let t={...q5,...e},r={submitCount:0,isDirty:!1,isLoading:Ks(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=qt(t.defaultValues)||qt(t.values)?wr(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:wr(s),o={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:Ih(),array:Ih(),state:Ih()},g=_0(t.mode),h=_0(t.reValidateMode),y=t.criteriaMode===dn.all,m=S=>N=>{clearTimeout(u),u=setTimeout(S,N)},w=async S=>{if(d.isValid||S){const N=t.resolver?Nr((await D()).errors):await L(n,!0);N!==r.isValid&&f.state.next({isValid:N})}},v=(S,N)=>{(d.isValidating||d.validatingFields)&&((S||Array.from(a.mount)).forEach(O=>{O&&(N?dt(r.validatingFields,O,N):Ht(r.validatingFields,O))}),f.state.next({validatingFields:r.validatingFields,isValidating:!Nr(r.validatingFields)}))},p=(S,N=[],O,Y,M=!0,H=!0)=>{if(Y&&O){if(o.action=!0,H&&Array.isArray(le(n,S))){const X=O(le(n,S),Y.argA,Y.argB);M&&dt(n,S,X)}if(H&&Array.isArray(le(r.errors,S))){const X=O(le(r.errors,S),Y.argA,Y.argB);M&&dt(r.errors,S,X),G5(r.errors,S)}if(d.touchedFields&&H&&Array.isArray(le(r.touchedFields,S))){const X=O(le(r.touchedFields,S),Y.argA,Y.argB);M&&dt(r.touchedFields,S,X)}d.dirtyFields&&(r.dirtyFields=du(s,i)),f.state.next({name:S,isDirty:T(S,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else dt(i,S,N)},_=(S,N)=>{dt(r.errors,S,N),f.state.next({errors:r.errors})},C=S=>{r.errors=S,f.state.next({errors:r.errors,isValid:!1})},E=(S,N,O,Y)=>{const M=le(n,S);if(M){const H=le(i,S,Ft(O)?le(s,S):O);Ft(H)||Y&&Y.defaultChecked||N?dt(i,S,N?H:Fh(M._f)):W(S,H),o.mount&&w()}},j=(S,N,O,Y,M)=>{let H=!1,X=!1;const ee={name:S},he=!!(le(n,S)&&le(n,S)._f&&le(n,S)._f.disabled);if(!O||Y){d.isDirty&&(X=r.isDirty,r.isDirty=ee.isDirty=T(),H=X!==ee.isDirty);const Be=he||Oi(le(s,S),N);X=!!(!he&&le(r.dirtyFields,S)),Be||he?Ht(r.dirtyFields,S):dt(r.dirtyFields,S,!0),ee.dirtyFields=r.dirtyFields,H=H||d.dirtyFields&&X!==!Be}if(O){const Be=le(r.touchedFields,S);Be||(dt(r.touchedFields,S,O),ee.touchedFields=r.touchedFields,H=H||d.touchedFields&&Be!==O)}return H&&M&&f.state.next(ee),H?ee:{}},R=(S,N,O,Y)=>{const M=le(r.errors,S),H=d.isValid&&On(N)&&r.isValid!==N;if(e.delayError&&O?(l=m(()=>_(S,O)),l(e.delayError)):(clearTimeout(u),l=null,O?dt(r.errors,S,O):Ht(r.errors,S)),(O?!Oi(M,O):M)||!Nr(Y)||H){const X={...Y,...H&&On(N)?{isValid:N}:{},errors:r.errors,name:S};r={...r,...X},f.state.next(X)}},D=async S=>{v(S,!0);const N=await t.resolver(i,t.context,Y5(S||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return v(S),N},P=async S=>{const{errors:N}=await D(S);if(S)for(const O of S){const Y=le(N,O);Y?dt(r.errors,O,Y):Ht(r.errors,O)}else r.errors=N;return N},L=async(S,N,O={valid:!0})=>{for(const Y in S){const M=S[Y];if(M){const{_f:H,...X}=M;if(H){const ee=a.array.has(H.name);v([Y],!0);const he=await j0(M,i,y,t.shouldUseNativeValidation&&!N,ee);if(v([Y]),he[H.name]&&(O.valid=!1,N))break;!N&&(le(he,H.name)?ee?W5(r.errors,he,H.name):dt(r.errors,H.name,he[H.name]):Ht(r.errors,H.name))}X&&await L(X,N,O)}}return O.valid},q=()=>{for(const S of a.unMount){const N=le(n,S);N&&(N._f.refs?N._f.refs.every(O=>!Lh(O)):!Lh(N._f.ref))&&Pe(S)}a.unMount=new Set},T=(S,N)=>(S&&N&&dt(i,S,N),!Oi(z(),s)),F=(S,N,O)=>YC(S,a,{...o.mount?i:Ft(N)?s:In(S)?{[S]:N}:N},O,N),b=S=>Af(le(o.mount?i:s,S,e.shouldUnregister?le(s,S,[]):[])),W=(S,N,O={})=>{const Y=le(n,S);let M=N;if(Y){const H=Y._f;H&&(!H.disabled&&dt(i,S,JC(N,H)),M=wd(H.ref)&&hr(N)?"":N,qC(H.ref)?[...H.ref.options].forEach(X=>X.selected=M.includes(X.value)):H.refs?kc(H.ref)?H.refs.length>1?H.refs.forEach(X=>(!X.defaultChecked||!X.disabled)&&(X.checked=Array.isArray(M)?!!M.find(ee=>ee===X.value):M===X.value)):H.refs[0]&&(H.refs[0].checked=!!M):H.refs.forEach(X=>X.checked=X.value===M):Lv(H.ref)?H.ref.value="":(H.ref.value=M,H.ref.type||f.values.next({name:S,values:{...i}})))}(O.shouldDirty||O.shouldTouch)&&j(S,M,O.shouldTouch,O.shouldDirty,!0),O.shouldValidate&&Q(S)},te=(S,N,O)=>{for(const Y in N){const M=N[Y],H=`${S}.${Y}`,X=le(n,H);(a.array.has(S)||!bd(M)||X&&!X._f)&&!Ao(M)?te(H,M,O):W(H,M,O)}},$=(S,N,O={})=>{const Y=le(n,S),M=a.array.has(S),H=wr(N);dt(i,S,H),M?(f.array.next({name:S,values:{...i}}),(d.isDirty||d.dirtyFields)&&O.shouldDirty&&f.state.next({name:S,dirtyFields:du(s,i),isDirty:T(S,H)})):Y&&!Y._f&&!hr(H)?te(S,H,O):W(S,H,O),b0(S,a)&&f.state.next({...r}),f.values.next({name:o.mount?S:void 0,values:{...i}})},Z=async S=>{o.mount=!0;const N=S.target;let O=N.name,Y=!0;const M=le(n,O),H=()=>N.type?Fh(M._f):zC(S),X=ee=>{Y=Number.isNaN(ee)||ee===le(i,O,ee)};if(M){let ee,he;const Be=H(),ze=S.type===xd.BLUR||S.type===xd.FOCUS_OUT,Et=!Z5(M._f)&&!t.resolver&&!le(r.errors,O)&&!M._f.deps||K5(ze,le(r.touchedFields,O),r.isSubmitted,h,g),Wr=b0(O,a,ze);dt(i,O,Be),ze?(M._f.onBlur&&M._f.onBlur(S),l&&l(0)):M._f.onChange&&M._f.onChange(S);const Bt=j(O,Be,ze,!1),Gn=!Nr(Bt)||Wr;if(!ze&&f.values.next({name:O,type:S.type,values:{...i}}),Et)return d.isValid&&w(),Gn&&f.state.next({name:O,...Wr?{}:Bt});if(!ze&&Wr&&f.state.next({...r}),t.resolver){const{errors:it}=await D([O]);if(X(Be),Y){const qn=T0(r.errors,n,O),Xn=T0(it,n,qn.name||O);ee=Xn.error,O=Xn.name,he=Nr(it)}}else v([O],!0),ee=(await j0(M,i,y,t.shouldUseNativeValidation))[O],v([O]),X(Be),Y&&(ee?he=!1:d.isValid&&(he=await L(n,!0)));Y&&(M._f.deps&&Q(M._f.deps),R(O,he,ee,Bt))}},I=(S,N)=>{if(le(r.errors,N)&&S.focus)return S.focus(),1},Q=async(S,N={})=>{let O,Y;const M=pl(S);if(t.resolver){const H=await P(Ft(S)?S:M);O=Nr(H),Y=S?!M.some(X=>le(H,X)):O}else S?(Y=(await Promise.all(M.map(async H=>{const X=le(n,H);return await L(X&&X._f?{[H]:X}:X)}))).every(Boolean),!(!Y&&!r.isValid)&&w()):Y=O=await L(n);return f.state.next({...!In(S)||d.isValid&&O!==r.isValid?{}:{name:S},...t.resolver||!S?{isValid:O}:{},errors:r.errors}),N.shouldFocus&&!Y&&ml(n,I,S?M:a.mount),Y},z=S=>{const N={...o.mount?i:s};return Ft(S)?N:In(S)?le(N,S):S.map(O=>le(N,O))},V=(S,N)=>({invalid:!!le((N||r).errors,S),isDirty:!!le((N||r).dirtyFields,S),error:le((N||r).errors,S),isValidating:!!le(r.validatingFields,S),isTouched:!!le((N||r).touchedFields,S)}),de=S=>{S&&pl(S).forEach(N=>Ht(r.errors,N)),f.state.next({errors:S?r.errors:{}})},ne=(S,N,O)=>{const Y=(le(n,S,{_f:{}})._f||{}).ref,M=le(r.errors,S)||{},{ref:H,message:X,type:ee,...he}=M;dt(r.errors,S,{...he,...N,ref:Y}),f.state.next({name:S,errors:r.errors,isValid:!1}),O&&O.shouldFocus&&Y&&Y.focus&&Y.focus()},se=(S,N)=>Ks(S)?f.values.subscribe({next:O=>S(F(void 0,N),O)}):F(S,N,!0),Pe=(S,N={})=>{for(const O of S?pl(S):a.mount)a.mount.delete(O),a.array.delete(O),N.keepValue||(Ht(n,O),Ht(i,O)),!N.keepError&&Ht(r.errors,O),!N.keepDirty&&Ht(r.dirtyFields,O),!N.keepTouched&&Ht(r.touchedFields,O),!N.keepIsValidating&&Ht(r.validatingFields,O),!t.shouldUnregister&&!N.keepDefaultValue&&Ht(s,O);f.values.next({values:{...i}}),f.state.next({...r,...N.keepDirty?{isDirty:T()}:{}}),!N.keepIsValid&&w()},fe=({disabled:S,name:N,field:O,fields:Y,value:M})=>{if(On(S)&&o.mount||S){const H=S?void 0:Ft(M)?Fh(O?O._f:le(Y,N)._f):M;dt(i,N,H),j(N,H,!1,!1,!0)}},ve=(S,N={})=>{let O=le(n,S);const Y=On(N.disabled);return dt(n,S,{...O||{},_f:{...O&&O._f?O._f:{ref:{name:S}},name:S,mount:!0,...N}}),a.mount.add(S),O?fe({field:O,disabled:N.disabled,name:S,value:N.value}):E(S,!0,N.value),{...Y?{disabled:N.disabled}:{},...t.progressive?{required:!!N.required,min:Ba(N.min),max:Ba(N.max),minLength:Ba(N.minLength),maxLength:Ba(N.maxLength),pattern:Ba(N.pattern)}:{},name:S,onChange:Z,onBlur:Z,ref:M=>{if(M){ve(S,N),O=le(n,S);const H=Ft(M.value)&&M.querySelectorAll&&M.querySelectorAll("input,select,textarea")[0]||M,X=H5(H),ee=O._f.refs||[];if(X?ee.find(he=>he===H):H===O._f.ref)return;dt(n,S,{_f:{...O._f,...X?{refs:[...ee.filter(Lh),H,...Array.isArray(le(s,S))?[{}]:[]],ref:{type:H.type,name:S}}:{ref:H}}}),E(S,!1,void 0,H)}else O=le(n,S,{}),O._f&&(O._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(UC(a.array,S)&&o.action)&&a.unMount.add(S)}}},Se=()=>t.shouldFocusError&&ml(n,I,a.mount),Ie=S=>{On(S)&&(f.state.next({disabled:S}),ml(n,(N,O)=>{const Y=le(n,O);Y&&(N.disabled=Y._f.disabled||S,Array.isArray(Y._f.refs)&&Y._f.refs.forEach(M=>{M.disabled=Y._f.disabled||S}))},0,!1))},De=(S,N)=>async O=>{let Y;O&&(O.preventDefault&&O.preventDefault(),O.persist&&O.persist());let M=wr(i);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:H,values:X}=await D();r.errors=H,M=X}else await L(n);if(Ht(r.errors,"root"),Nr(r.errors)){f.state.next({errors:{}});try{await S(M,O)}catch(H){Y=H}}else N&&await N({...r.errors},O),Se(),setTimeout(Se);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Nr(r.errors)&&!Y,submitCount:r.submitCount+1,errors:r.errors}),Y)throw Y},Ce=(S,N={})=>{le(n,S)&&(Ft(N.defaultValue)?$(S,wr(le(s,S))):($(S,N.defaultValue),dt(s,S,wr(N.defaultValue))),N.keepTouched||Ht(r.touchedFields,S),N.keepDirty||(Ht(r.dirtyFields,S),r.isDirty=N.defaultValue?T(S,wr(le(s,S))):T()),N.keepError||(Ht(r.errors,S),d.isValid&&w()),f.state.next({...r}))},rt=(S,N={})=>{const O=S?wr(S):s,Y=wr(O),M=Nr(S),H=M?s:Y;if(N.keepDefaultValues||(s=O),!N.keepValues){if(N.keepDirtyValues)for(const X of a.mount)le(r.dirtyFields,X)?dt(H,X,le(i,X)):$(X,le(H,X));else{if(Ov&&Ft(S))for(const X of a.mount){const ee=le(n,X);if(ee&&ee._f){const he=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if(wd(he)){const Be=he.closest("form");if(Be){Be.reset();break}}}}n={}}i=e.shouldUnregister?N.keepDefaultValues?wr(s):{}:wr(H),f.array.next({values:{...H}}),f.values.next({values:{...H}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!N.keepIsValid||!!N.keepDirtyValues,o.watch=!!e.shouldUnregister,f.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:M?!1:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!Oi(S,s)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:M?{}:N.keepDirtyValues?N.keepDefaultValues&&i?du(s,i):r.dirtyFields:N.keepDefaultValues&&S?du(s,S):N.keepDirty?r.dirtyFields:{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},k=(S,N)=>rt(Ks(S)?S(i):S,N);return{control:{register:ve,unregister:Pe,getFieldState:V,handleSubmit:De,setError:ne,_executeSchema:D,_getWatch:F,_getDirty:T,_updateValid:w,_removeUnmounted:q,_updateFieldArray:p,_updateDisabledField:fe,_getFieldArray:b,_reset:rt,_resetDefaultValues:()=>Ks(t.defaultValues)&&t.defaultValues().then(S=>{k(S,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:S=>{r={...r,...S}},_disableForm:Ie,_subjects:f,_proxyFormState:d,_setErrors:C,get _fields(){return n},get _formValues(){return i},get _state(){return o},set _state(S){o=S},get _defaultValues(){return s},get _names(){return a},set _names(S){a=S},get _formState(){return r},set _formState(S){r=S},get _options(){return t},set _options(S){t={...t,...S}}},trigger:Q,register:ve,handleSubmit:De,watch:se,setValue:$,getValues:z,reset:k,resetField:Ce,clearErrors:de,unregister:Pe,setError:ne,setFocus:(S,N={})=>{const O=le(n,S),Y=O&&O._f;if(Y){const M=Y.refs?Y.refs[0]:Y.ref;M.focus&&(M.focus(),N.shouldSelect&&M.select())}},getFieldState:V}}function tn(e={}){const t=et.useRef(),r=et.useRef(),[n,s]=et.useState({isDirty:!1,isValidating:!1,isLoading:Ks(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Ks(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...X5(e),formState:n});const i=t.current.control;return i._options=e,Iv({subject:i._subjects.state,next:o=>{BC(o,i._proxyFormState,i._updateFormState,!0)&&s({...i._formState})}}),et.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),et.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==n.isDirty&&i._subjects.state.next({isDirty:o})}},[i,n.isDirty]),et.useEffect(()=>{e.values&&!Oi(e.values,r.current)?(i._reset(e.values,i._options.resetOptions),r.current=e.values,s(o=>({...o}))):i._resetDefaultValues()},[e.values,i]),et.useEffect(()=>{e.errors&&i._setErrors(e.errors)},[e.errors,i]),et.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),et.useEffect(()=>{e.shouldUnregister&&i._subjects.values.next({values:i._getWatch()})},[e.shouldUnregister,i]),t.current.formState=$C(n,i),t.current}const N0=(e,t,r)=>{if(e&&"reportValidity"in e){const n=le(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},eE=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?N0(n.ref,r,e):n.refs&&n.refs.forEach(s=>N0(s,r,e))}},Q5=(e,t)=>{t.shouldUseNativeValidation&&eE(e,t);const r={};for(const n in e){const s=le(t.fields,n),i=Object.assign(e[n]||{},{ref:s&&s.ref});if(J5(t.names||Object.keys(e),n)){const o=Object.assign({},le(r,n));dt(o,"root",i),dt(r,n,o)}else dt(r,n,i)}return r},J5=(e,t)=>e.some(r=>r.startsWith(t+"."));var e6=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,i=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[o]={message:a.message,type:a.code}}else r[o]={message:i,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var l=r[o].types,u=l&&l[n.code];r[o]=ZC(o,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r},rn=function(e,t,r){return r===void 0&&(r={}),function(n,s,i){try{return Promise.resolve(function(o,a){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return i.shouldUseNativeValidation&&eE({},i),{errors:{},values:r.raw?n:u}})}catch(u){return a(u)}return l&&l.then?l.then(void 0,a):l}(0,function(o){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(o))return{values:{},errors:Q5(e6(o.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}}},nt;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(const a of i)o[a]=s[a];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},e.find=(s,i)=>{for(const o of s)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(nt||(nt={}));var im;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(im||(im={}));const xe=nt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$s=e=>{switch(typeof e){case"undefined":return xe.undefined;case"string":return xe.string;case"number":return isNaN(e)?xe.nan:xe.number;case"boolean":return xe.boolean;case"function":return xe.function;case"bigint":return xe.bigint;case"symbol":return xe.symbol;case"object":return Array.isArray(e)?xe.array:e===null?xe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?xe.promise:typeof Map<"u"&&e instanceof Map?xe.map:typeof Set<"u"&&e instanceof Set?xe.set:typeof Date<"u"&&e instanceof Date?xe.date:xe.object;default:return xe.unknown}},oe=nt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),t6=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Lr extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(i){return i.message},n={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,l=0;for(;lr.message){const r={},n=[];for(const s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Lr.create=e=>new Lr(e);const ua=(e,t)=>{let r;switch(e.code){case oe.invalid_type:e.received===xe.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case oe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,nt.jsonStringifyReplacer)}`;break;case oe.unrecognized_keys:r=`Unrecognized key(s) in object: ${nt.joinValues(e.keys,", ")}`;break;case oe.invalid_union:r="Invalid input";break;case oe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${nt.joinValues(e.options)}`;break;case oe.invalid_enum_value:r=`Invalid enum value. Expected ${nt.joinValues(e.options)}, received '${e.received}'`;break;case oe.invalid_arguments:r="Invalid function arguments";break;case oe.invalid_return_type:r="Invalid function return type";break;case oe.invalid_date:r="Invalid date";break;case oe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:nt.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case oe.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case oe.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case oe.custom:r="Invalid input";break;case oe.invalid_intersection_types:r="Intersection results could not be merged";break;case oe.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case oe.not_finite:r="Number must be finite";break;default:r=t.defaultError,nt.assertNever(e)}return{message:r}};let tE=ua;function r6(e){tE=e}function kd(){return tE}const Cd=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,i=[...r,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:t,defaultError:a}).message;return{...s,path:i,message:a}},n6=[];function me(e,t){const r=kd(),n=Cd({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ua?void 0:ua].filter(s=>!!s)});e.common.issues.push(n)}class cr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return $e;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const i=await s.key,o=await s.value;n.push({key:i,value:o})}return cr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return $e;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[i.value]=o.value)}return{status:t.value,value:n}}}const $e=Object.freeze({status:"aborted"}),Oo=e=>({status:"dirty",value:e}),mr=e=>({status:"valid",value:e}),om=e=>e.status==="aborted",am=e=>e.status==="dirty",Hl=e=>e.status==="valid",Yl=e=>typeof Promise<"u"&&e instanceof Promise;function Ed(e,t,r,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function rE(e,t,r,n,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var je;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(je||(je={}));var Xa,Qa;class $n{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const R0=(e,t)=>{if(Hl(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Lr(e.common.issues);return this._error=r,this._error}}};function He(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,a)=>{var l,u;const{message:d}=e;return o.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:(l=d??n)!==null&&l!==void 0?l:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(u=d??r)!==null&&u!==void 0?u:a.defaultError}},description:s}}class qe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return $s(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:$s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new cr,ctx:{common:t.parent.common,data:t.data,parsedType:$s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Yl(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const s={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$s(t)},i=this._parseSync({data:t,path:s.path,parent:s});return R0(s,i)}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$s(t)},s=this._parse({data:t,path:n.path,parent:n}),i=await(Yl(s)?s:Promise.resolve(s));return R0(n,i)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{const o=t(s),a=()=>i.addIssue({code:oe.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new bn({schema:this,typeName:Ue.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Un.create(this,this._def)}nullable(){return hi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gn.create(this,this._def)}promise(){return fa.create(this,this._def)}or(t){return ql.create([this,t],this._def)}and(t){return Xl.create(this,t,this._def)}transform(t){return new bn({...He(this._def),schema:this,typeName:Ue.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new rc({...He(this._def),innerType:this,defaultValue:r,typeName:Ue.ZodDefault})}brand(){return new zv({typeName:Ue.ZodBranded,type:this,...He(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new nc({...He(this._def),innerType:this,catchValue:r,typeName:Ue.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Cc.create(this,t)}readonly(){return sc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const s6=/^c[^\s-]{8,}$/i,i6=/^[0-9a-z]+$/,o6=/^[0-9A-HJKMNP-TV-Z]{26}$/,a6=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,l6=/^[a-z0-9_-]{21}$/i,c6=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,u6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,d6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let zh;const f6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,h6=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,p6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nE="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",m6=new RegExp(`^${nE}$`);function sE(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function g6(e){return new RegExp(`^${sE(e)}$`)}function iE(e){let t=`${nE}T${sE(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function v6(e,t){return!!((t==="v4"||!t)&&f6.test(e)||(t==="v6"||!t)&&h6.test(e))}class hn extends qe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==xe.string){const i=this._getOrReturnCtx(t);return me(i,{code:oe.invalid_type,expected:xe.string,received:i.parsedType}),$e}const n=new cr;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.lengthi.value&&(s=this._getOrReturnCtx(t,s),me(s,{code:oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,a=t.data.lengtht.test(s),{validation:r,code:oe.invalid_string,...je.errToObj(n)})}_addCheck(t){return new hn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...je.errToObj(t)})}url(t){return this._addCheck({kind:"url",...je.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...je.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...je.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...je.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...je.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...je.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...je.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...je.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...je.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...je.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...je.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...je.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...je.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...je.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...je.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...je.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...je.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...je.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...je.errToObj(r)})}nonempty(t){return this.min(1,je.errToObj(t))}trim(){return new hn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new hn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new hn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new hn({checks:[],typeName:Ue.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...He(e)})};function y6(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,i=parseInt(e.toFixed(s).replace(".","")),o=parseInt(t.toFixed(s).replace(".",""));return i%o/Math.pow(10,s)}class ui extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==xe.number){const i=this._getOrReturnCtx(t);return me(i,{code:oe.invalid_type,expected:xe.number,received:i.parsedType}),$e}let n;const s=new cr;for(const i of this._def.checks)i.kind==="int"?nt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),me(n,{code:oe.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),me(n,{code:oe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?y6(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),me(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),me(n,{code:oe.not_finite,message:i.message}),s.dirty()):nt.assertNever(i);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,je.toString(r))}gt(t,r){return this.setLimit("min",t,!1,je.toString(r))}lte(t,r){return this.setLimit("max",t,!0,je.toString(r))}lt(t,r){return this.setLimit("max",t,!1,je.toString(r))}setLimit(t,r,n,s){return new ui({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:je.toString(s)}]})}_addCheck(t){return new ui({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:je.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:je.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:je.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:je.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:je.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:je.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:je.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:je.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:je.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&nt.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew ui({checks:[],typeName:Ue.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});class di extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==xe.bigint){const i=this._getOrReturnCtx(t);return me(i,{code:oe.invalid_type,expected:xe.bigint,received:i.parsedType}),$e}let n;const s=new cr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),me(n,{code:oe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),me(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):nt.assertNever(i);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,je.toString(r))}gt(t,r){return this.setLimit("min",t,!1,je.toString(r))}lte(t,r){return this.setLimit("max",t,!0,je.toString(r))}lt(t,r){return this.setLimit("max",t,!1,je.toString(r))}setLimit(t,r,n,s){return new di({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:je.toString(s)}]})}_addCheck(t){return new di({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:je.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:je.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:je.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:je.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:je.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new di({checks:[],typeName:Ue.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...He(e)})};class Zl extends qe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==xe.boolean){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.boolean,received:n.parsedType}),$e}return mr(t.data)}}Zl.create=e=>new Zl({typeName:Ue.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});class Gi extends qe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==xe.date){const i=this._getOrReturnCtx(t);return me(i,{code:oe.invalid_type,expected:xe.date,received:i.parsedType}),$e}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return me(i,{code:oe.invalid_date}),$e}const n=new cr;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()i.value&&(s=this._getOrReturnCtx(t,s),me(s,{code:oe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):nt.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Gi({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:je.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:je.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Gi({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ue.ZodDate,...He(e)});class jd extends qe{_parse(t){if(this._getType(t)!==xe.symbol){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.symbol,received:n.parsedType}),$e}return mr(t.data)}}jd.create=e=>new jd({typeName:Ue.ZodSymbol,...He(e)});class Kl extends qe{_parse(t){if(this._getType(t)!==xe.undefined){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.undefined,received:n.parsedType}),$e}return mr(t.data)}}Kl.create=e=>new Kl({typeName:Ue.ZodUndefined,...He(e)});class Gl extends qe{_parse(t){if(this._getType(t)!==xe.null){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.null,received:n.parsedType}),$e}return mr(t.data)}}Gl.create=e=>new Gl({typeName:Ue.ZodNull,...He(e)});class da extends qe{constructor(){super(...arguments),this._any=!0}_parse(t){return mr(t.data)}}da.create=e=>new da({typeName:Ue.ZodAny,...He(e)});class Fi extends qe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return mr(t.data)}}Fi.create=e=>new Fi({typeName:Ue.ZodUnknown,...He(e)});class Ss extends qe{_parse(t){const r=this._getOrReturnCtx(t);return me(r,{code:oe.invalid_type,expected:xe.never,received:r.parsedType}),$e}}Ss.create=e=>new Ss({typeName:Ue.ZodNever,...He(e)});class Td extends qe{_parse(t){if(this._getType(t)!==xe.undefined){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.void,received:n.parsedType}),$e}return mr(t.data)}}Td.create=e=>new Td({typeName:Ue.ZodVoid,...He(e)});class gn extends qe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==xe.array)return me(r,{code:oe.invalid_type,expected:xe.array,received:r.parsedType}),$e;if(s.exactLength!==null){const o=r.data.length>s.exactLength.value,a=r.data.lengths.maxLength.value&&(me(r,{code:oe.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>s.type._parseAsync(new $n(r,o,r.path,a)))).then(o=>cr.mergeArray(n,o));const i=[...r.data].map((o,a)=>s.type._parseSync(new $n(r,o,r.path,a)));return cr.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new gn({...this._def,minLength:{value:t,message:je.toString(r)}})}max(t,r){return new gn({...this._def,maxLength:{value:t,message:je.toString(r)}})}length(t,r){return new gn({...this._def,exactLength:{value:t,message:je.toString(r)}})}nonempty(t){return this.min(1,t)}}gn.create=(e,t)=>new gn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ue.ZodArray,...He(t)});function yo(e){if(e instanceof Rt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Un.create(yo(n))}return new Rt({...e._def,shape:()=>t})}else return e instanceof gn?new gn({...e._def,type:yo(e.element)}):e instanceof Un?Un.create(yo(e.unwrap())):e instanceof hi?hi.create(yo(e.unwrap())):e instanceof Bn?Bn.create(e.items.map(t=>yo(t))):e}class Rt extends qe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=nt.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==xe.object){const u=this._getOrReturnCtx(t);return me(u,{code:oe.invalid_type,expected:xe.object,received:u.parsedType}),$e}const{status:n,ctx:s}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Ss&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const d=i[u],f=s.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new $n(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Ss){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")a.length>0&&(me(s,{code:oe.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of a){const f=s.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new $n(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const f=await d.key,g=await d.value;u.push({key:f,value:g,alwaysSet:d.alwaysSet})}return u}).then(u=>cr.mergeObjectSync(n,u)):cr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return je.errToObj,new Rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,i,o,a;const l=(o=(i=(s=this._def).errorMap)===null||i===void 0?void 0:i.call(s,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=je.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Rt({...this._def,unknownKeys:"strip"})}passthrough(){return new Rt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Rt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Rt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ue.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Rt({...this._def,catchall:t})}pick(t){const r={};return nt.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}omit(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}deepPartial(){return yo(this)}partial(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}),new Rt({...this._def,shape:()=>r})}required(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Un;)i=i._def.innerType;r[n]=i}}),new Rt({...this._def,shape:()=>r})}keyof(){return oE(nt.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:Ss.create(),typeName:Ue.ZodObject,...He(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:Ss.create(),typeName:Ue.ZodObject,...He(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:Ss.create(),typeName:Ue.ZodObject,...He(t)});class ql extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(a=>new Lr(a.ctx.common.issues));return me(r,{code:oe.invalid_union,unionErrors:o}),$e}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const l of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=l._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const a=o.map(l=>new Lr(l));return me(r,{code:oe.invalid_union,unionErrors:a}),$e}}get options(){return this._def.options}}ql.create=(e,t)=>new ql({options:e,typeName:Ue.ZodUnion,...He(t)});const rs=e=>e instanceof Jl?rs(e.schema):e instanceof bn?rs(e.innerType()):e instanceof ec?[e.value]:e instanceof fi?e.options:e instanceof tc?nt.objectValues(e.enum):e instanceof rc?rs(e._def.innerType):e instanceof Kl?[void 0]:e instanceof Gl?[null]:e instanceof Un?[void 0,...rs(e.unwrap())]:e instanceof hi?[null,...rs(e.unwrap())]:e instanceof zv||e instanceof sc?rs(e.unwrap()):e instanceof nc?rs(e._def.innerType):[];class Mf extends qe{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.object)return me(r,{code:oe.invalid_type,expected:xe.object,received:r.parsedType}),$e;const n=this.discriminator,s=r.data[n],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(me(r,{code:oe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),$e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const s=new Map;for(const i of r){const o=rs(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,i)}}return new Mf({typeName:Ue.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...He(n)})}}function lm(e,t){const r=$s(e),n=$s(t);if(e===t)return{valid:!0,data:e};if(r===xe.object&&n===xe.object){const s=nt.objectKeys(t),i=nt.objectKeys(e).filter(a=>s.indexOf(a)!==-1),o={...e,...t};for(const a of i){const l=lm(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(r===xe.array&&n===xe.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i{if(om(i)||om(o))return $e;const a=lm(i.value,o.value);return a.valid?((am(i)||am(o))&&r.dirty(),{status:r.value,value:a.data}):(me(n,{code:oe.invalid_intersection_types}),$e)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Xl.create=(e,t,r)=>new Xl({left:e,right:t,typeName:Ue.ZodIntersection,...He(r)});class Bn extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.array)return me(n,{code:oe.invalid_type,expected:xe.array,received:n.parsedType}),$e;if(n.data.lengththis._def.items.length&&(me(n,{code:oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new $n(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>cr.mergeArray(r,o)):cr.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new Bn({...this._def,rest:t})}}Bn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bn({items:e,typeName:Ue.ZodTuple,rest:null,...He(t)})};class Ql extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.object)return me(n,{code:oe.invalid_type,expected:xe.object,received:n.parsedType}),$e;const s=[],i=this._def.keyType,o=this._def.valueType;for(const a in n.data)s.push({key:i._parse(new $n(n,a,n.path,a)),value:o._parse(new $n(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?cr.mergeObjectAsync(r,s):cr.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof qe?new Ql({keyType:t,valueType:r,typeName:Ue.ZodRecord,...He(n)}):new Ql({keyType:hn.create(),valueType:t,typeName:Ue.ZodRecord,...He(r)})}}class Nd extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.map)return me(n,{code:oe.invalid_type,expected:xe.map,received:n.parsedType}),$e;const s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,l],u)=>({key:s._parse(new $n(n,a,n.path,[u,"key"])),value:i._parse(new $n(n,l,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return $e;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return $e;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}}}}Nd.create=(e,t,r)=>new Nd({valueType:t,keyType:e,typeName:Ue.ZodMap,...He(r)});class qi extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.set)return me(n,{code:oe.invalid_type,expected:xe.set,received:n.parsedType}),$e;const s=this._def;s.minSize!==null&&n.data.sizes.maxSize.value&&(me(n,{code:oe.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const i=this._def.valueType;function o(l){const u=new Set;for(const d of l){if(d.status==="aborted")return $e;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const a=[...n.data.values()].map((l,u)=>i._parse(new $n(n,l,n.path,u)));return n.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,r){return new qi({...this._def,minSize:{value:t,message:je.toString(r)}})}max(t,r){return new qi({...this._def,maxSize:{value:t,message:je.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}qi.create=(e,t)=>new qi({valueType:e,minSize:null,maxSize:null,typeName:Ue.ZodSet,...He(t)});class Jo extends qe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.function)return me(r,{code:oe.invalid_type,expected:xe.function,received:r.parsedType}),$e;function n(a,l){return Cd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,kd(),ua].filter(u=>!!u),issueData:{code:oe.invalid_arguments,argumentsError:l}})}function s(a,l){return Cd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,kd(),ua].filter(u=>!!u),issueData:{code:oe.invalid_return_type,returnTypeError:l}})}const i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof fa){const a=this;return mr(async function(...l){const u=new Lr([]),d=await a._def.args.parseAsync(l,i).catch(h=>{throw u.addIssue(n(l,h)),u}),f=await Reflect.apply(o,this,d);return await a._def.returns._def.type.parseAsync(f,i).catch(h=>{throw u.addIssue(s(f,h)),u})})}else{const a=this;return mr(function(...l){const u=a._def.args.safeParse(l,i);if(!u.success)throw new Lr([n(l,u.error)]);const d=Reflect.apply(o,this,u.data),f=a._def.returns.safeParse(d,i);if(!f.success)throw new Lr([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Jo({...this._def,args:Bn.create(t).rest(Fi.create())})}returns(t){return new Jo({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Jo({args:t||Bn.create([]).rest(Fi.create()),returns:r||Fi.create(),typeName:Ue.ZodFunction,...He(n)})}}class Jl extends qe{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Jl.create=(e,t)=>new Jl({getter:e,typeName:Ue.ZodLazy,...He(t)});class ec extends qe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return me(r,{received:r.data,code:oe.invalid_literal,expected:this._def.value}),$e}return{status:"valid",value:t.data}}get value(){return this._def.value}}ec.create=(e,t)=>new ec({value:e,typeName:Ue.ZodLiteral,...He(t)});function oE(e,t){return new fi({values:e,typeName:Ue.ZodEnum,...He(t)})}class fi extends qe{constructor(){super(...arguments),Xa.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return me(r,{expected:nt.joinValues(n),received:r.parsedType,code:oe.invalid_type}),$e}if(Ed(this,Xa)||rE(this,Xa,new Set(this._def.values)),!Ed(this,Xa).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return me(r,{received:r.data,code:oe.invalid_enum_value,options:n}),$e}return mr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return fi.create(t,{...this._def,...r})}exclude(t,r=this._def){return fi.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Xa=new WeakMap;fi.create=oE;class tc extends qe{constructor(){super(...arguments),Qa.set(this,void 0)}_parse(t){const r=nt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==xe.string&&n.parsedType!==xe.number){const s=nt.objectValues(r);return me(n,{expected:nt.joinValues(s),received:n.parsedType,code:oe.invalid_type}),$e}if(Ed(this,Qa)||rE(this,Qa,new Set(nt.getValidEnumValues(this._def.values))),!Ed(this,Qa).has(t.data)){const s=nt.objectValues(r);return me(n,{received:n.data,code:oe.invalid_enum_value,options:s}),$e}return mr(t.data)}get enum(){return this._def.values}}Qa=new WeakMap;tc.create=(e,t)=>new tc({values:e,typeName:Ue.ZodNativeEnum,...He(t)});class fa extends qe{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.promise&&r.common.async===!1)return me(r,{code:oe.invalid_type,expected:xe.promise,received:r.parsedType}),$e;const n=r.parsedType===xe.promise?r.data:Promise.resolve(r.data);return mr(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}fa.create=(e,t)=>new fa({type:e,typeName:Ue.ZodPromise,...He(t)});class bn extends qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ue.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:o=>{me(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return $e;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?$e:l.status==="dirty"||r.value==="dirty"?Oo(l.value):l});{if(r.value==="aborted")return $e;const a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?$e:a.status==="dirty"||r.value==="dirty"?Oo(a.value):a}}if(s.type==="refinement"){const o=a=>{const l=s.refinement(a,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?$e:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?$e:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Hl(o))return o;const a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Hl(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:r.value,value:a})):o);nt.assertNever(s)}}bn.create=(e,t,r)=>new bn({schema:e,typeName:Ue.ZodEffects,effect:t,...He(r)});bn.createWithPreprocess=(e,t,r)=>new bn({schema:t,effect:{type:"preprocess",transform:e},typeName:Ue.ZodEffects,...He(r)});class Un extends qe{_parse(t){return this._getType(t)===xe.undefined?mr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Un.create=(e,t)=>new Un({innerType:e,typeName:Ue.ZodOptional,...He(t)});class hi extends qe{_parse(t){return this._getType(t)===xe.null?mr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}hi.create=(e,t)=>new hi({innerType:e,typeName:Ue.ZodNullable,...He(t)});class rc extends qe{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===xe.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}rc.create=(e,t)=>new rc({innerType:e,typeName:Ue.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...He(t)});class nc extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Yl(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Lr(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Lr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}nc.create=(e,t)=>new nc({innerType:e,typeName:Ue.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...He(t)});class Rd extends qe{_parse(t){if(this._getType(t)!==xe.nan){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.nan,received:n.parsedType}),$e}return{status:"valid",value:t.data}}}Rd.create=e=>new Rd({typeName:Ue.ZodNaN,...He(e)});const x6=Symbol("zod_brand");class zv extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Cc extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?$e:i.status==="dirty"?(r.dirty(),Oo(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?$e:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new Cc({in:t,out:r,typeName:Ue.ZodPipeline})}}class sc extends qe{_parse(t){const r=this._def.innerType._parse(t),n=s=>(Hl(s)&&(s.value=Object.freeze(s.value)),s);return Yl(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}sc.create=(e,t)=>new sc({innerType:e,typeName:Ue.ZodReadonly,...He(t)});function aE(e,t={},r){return e?da.create().superRefine((n,s)=>{var i,o;if(!e(n)){const a=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,l=(o=(i=a.fatal)!==null&&i!==void 0?i:r)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...u,fatal:l})}}):da.create()}const w6={object:Rt.lazycreate};var Ue;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ue||(Ue={}));const _6=(e,t={message:`Input not instance of ${e.name}`})=>aE(r=>r instanceof e,t),lE=hn.create,cE=ui.create,b6=Rd.create,S6=di.create,uE=Zl.create,k6=Gi.create,C6=jd.create,E6=Kl.create,j6=Gl.create,T6=da.create,N6=Fi.create,R6=Ss.create,P6=Td.create,D6=gn.create,A6=Rt.create,O6=Rt.strictCreate,M6=ql.create,I6=Mf.create,L6=Xl.create,F6=Bn.create,z6=Ql.create,U6=Nd.create,V6=qi.create,W6=Jo.create,$6=Jl.create,B6=ec.create,H6=fi.create,Y6=tc.create,Z6=fa.create,P0=bn.create,K6=Un.create,G6=hi.create,q6=bn.createWithPreprocess,X6=Cc.create,Q6=()=>lE().optional(),J6=()=>cE().optional(),ez=()=>uE().optional(),tz={string:e=>hn.create({...e,coerce:!0}),number:e=>ui.create({...e,coerce:!0}),boolean:e=>Zl.create({...e,coerce:!0}),bigint:e=>di.create({...e,coerce:!0}),date:e=>Gi.create({...e,coerce:!0})},rz=$e;var we=Object.freeze({__proto__:null,defaultErrorMap:ua,setErrorMap:r6,getErrorMap:kd,makeIssue:Cd,EMPTY_PATH:n6,addIssueToContext:me,ParseStatus:cr,INVALID:$e,DIRTY:Oo,OK:mr,isAborted:om,isDirty:am,isValid:Hl,isAsync:Yl,get util(){return nt},get objectUtil(){return im},ZodParsedType:xe,getParsedType:$s,ZodType:qe,datetimeRegex:iE,ZodString:hn,ZodNumber:ui,ZodBigInt:di,ZodBoolean:Zl,ZodDate:Gi,ZodSymbol:jd,ZodUndefined:Kl,ZodNull:Gl,ZodAny:da,ZodUnknown:Fi,ZodNever:Ss,ZodVoid:Td,ZodArray:gn,ZodObject:Rt,ZodUnion:ql,ZodDiscriminatedUnion:Mf,ZodIntersection:Xl,ZodTuple:Bn,ZodRecord:Ql,ZodMap:Nd,ZodSet:qi,ZodFunction:Jo,ZodLazy:Jl,ZodLiteral:ec,ZodEnum:fi,ZodNativeEnum:tc,ZodPromise:fa,ZodEffects:bn,ZodTransformer:bn,ZodOptional:Un,ZodNullable:hi,ZodDefault:rc,ZodCatch:nc,ZodNaN:Rd,BRAND:x6,ZodBranded:zv,ZodPipeline:Cc,ZodReadonly:sc,custom:aE,Schema:qe,ZodSchema:qe,late:w6,get ZodFirstPartyTypeKind(){return Ue},coerce:tz,any:T6,array:D6,bigint:S6,boolean:uE,date:k6,discriminatedUnion:I6,effect:P0,enum:H6,function:W6,instanceof:_6,intersection:L6,lazy:$6,literal:B6,map:U6,nan:b6,nativeEnum:Y6,never:R6,null:j6,nullable:G6,number:cE,object:A6,oboolean:ez,onumber:J6,optional:K6,ostring:Q6,pipeline:X6,preprocess:q6,promise:Z6,record:z6,set:V6,strictObject:O6,string:lE,symbol:C6,transformer:P0,tuple:F6,undefined:E6,union:M6,unknown:N6,void:P6,NEVER:rz,ZodIssueCode:oe,quotelessJson:t6,ZodError:Lr}),nz="Label",dE=x.forwardRef((e,t)=>c.jsx(Ve.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));dE.displayName=nz;var fE=dE;const sz=uc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Uv=x.forwardRef(({className:e,...t},r)=>c.jsx(fE,{ref:r,className:pe(sz(),e),...t}));Uv.displayName=fE.displayName;const nn=L5,hE=x.createContext({}),Ae=({...e})=>c.jsx(hE.Provider,{value:{name:e.name},children:c.jsx(V5,{...e})}),If=()=>{const e=x.useContext(hE),t=x.useContext(pE),{getFieldState:r,formState:n}=Of(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within ");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},pE=x.createContext({}),Te=x.forwardRef(({className:e,...t},r)=>{const n=x.useId();return c.jsx(pE.Provider,{value:{id:n},children:c.jsx("div",{ref:r,className:pe("space-y-2",e),...t})})});Te.displayName="FormItem";const Ne=x.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=If();return c.jsx(Uv,{ref:r,className:pe(n&&"text-destructive",e),htmlFor:s,...t})});Ne.displayName="FormLabel";const Re=x.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:i}=If();return c.jsx(xs,{ref:t,id:n,"aria-describedby":r?`${s} ${i}`:`${s}`,"aria-invalid":!!r,...e})});Re.displayName="FormControl";const iz=x.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=If();return c.jsx("p",{ref:r,id:n,className:pe("text-sm text-muted-foreground",e),...t})});iz.displayName="FormDescription";const ke=x.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:i}=If(),o=s?String(s==null?void 0:s.message):t;return o?c.jsx("p",{ref:n,id:i,className:pe("text-sm font-medium text-destructive",e),...r,children:o}):null});ke.displayName="FormMessage";function cm(e,[t,r]){return Math.min(r,Math.max(t,e))}var oz=[" ","Enter","ArrowUp","ArrowDown"],az=[" ","Enter"],Ec="Select",[Lf,Ff,lz]=rf(Ec),[ja,C8]=Qr(Ec,[lz,Sa]),zf=Sa(),[cz,xi]=ja(Ec),[uz,dz]=ja(Ec),mE=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:g,required:h}=e,y=zf(t),[m,w]=x.useState(null),[v,p]=x.useState(null),[_,C]=x.useState(!1),E=nf(u),[j=!1,R]=oi({prop:n,defaultProp:s,onChange:i}),[D,P]=oi({prop:o,defaultProp:a,onChange:l}),L=x.useRef(null),q=m?!!m.closest("form"):!0,[T,F]=x.useState(new Set),b=Array.from(T).map(W=>W.props.value).join(";");return c.jsx(Dg,{...y,children:c.jsxs(cz,{required:h,scope:t,trigger:m,onTriggerChange:w,valueNode:v,onValueNodeChange:p,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:zn(),value:D,onValueChange:P,open:j,onOpenChange:R,dir:E,triggerPointerDownPosRef:L,disabled:g,children:[c.jsx(Lf.Provider,{scope:t,children:c.jsx(uz,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(W=>{F(te=>new Set(te).add(W))},[]),onNativeOptionRemove:x.useCallback(W=>{F(te=>{const $=new Set(te);return $.delete(W),$})},[]),children:r})}),q?c.jsxs(VE,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:D,onChange:W=>P(W.target.value),disabled:g,children:[D===void 0?c.jsx("option",{value:""}):null,Array.from(T)]},b):null]})})};mE.displayName=Ec;var gE="SelectTrigger",vE=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,i=zf(r),o=xi(gE,r),a=o.disabled||n,l=Xe(t,o.onTriggerChange),u=Ff(r),[d,f,g]=WE(y=>{const m=u().filter(p=>!p.disabled),w=m.find(p=>p.value===o.value),v=$E(m,y,w);v!==void 0&&o.onValueChange(v.value)}),h=()=>{a||(o.onOpenChange(!0),g())};return c.jsx(Ag,{asChild:!0,...i,children:c.jsx(Ve.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":UE(o.value)?"":void 0,...s,ref:l,onClick:ue(s.onClick,y=>{y.currentTarget.focus()}),onPointerDown:ue(s.onPointerDown,y=>{const m=y.target;m.hasPointerCapture(y.pointerId)&&m.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&(h(),o.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)},y.preventDefault())}),onKeyDown:ue(s.onKeyDown,y=>{const m=d.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&f(y.key),!(m&&y.key===" ")&&oz.includes(y.key)&&(h(),y.preventDefault())})})})});vE.displayName=gE;var yE="SelectValue",xE=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:i,placeholder:o="",...a}=e,l=xi(yE,r),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,f=Xe(t,l.onValueNodeChange);return nr(()=>{u(d)},[u,d]),c.jsx(Ve.span,{...a,ref:f,style:{pointerEvents:"none"},children:UE(l.value)?c.jsx(c.Fragment,{children:o}):i})});xE.displayName=yE;var fz="SelectIcon",wE=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return c.jsx(Ve.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});wE.displayName=fz;var hz="SelectPortal",_E=e=>c.jsx(fc,{asChild:!0,...e});_E.displayName=hz;var Xi="SelectContent",bE=x.forwardRef((e,t)=>{const r=xi(Xi,e.__scopeSelect),[n,s]=x.useState();if(nr(()=>{s(new DocumentFragment)},[]),!r.open){const i=n;return i?Cs.createPortal(c.jsx(SE,{scope:e.__scopeSelect,children:c.jsx(Lf.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),i):null}return c.jsx(kE,{...e,ref:t})});bE.displayName=Xi;var is=10,[SE,wi]=ja(Xi),pz="SelectContentImpl",kE=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:w,...v}=e,p=xi(Xi,r),[_,C]=x.useState(null),[E,j]=x.useState(null),R=Xe(t,fe=>C(fe)),[D,P]=x.useState(null),[L,q]=x.useState(null),T=Ff(r),[F,b]=x.useState(!1),W=x.useRef(!1);x.useEffect(()=>{if(_)return Ig(_)},[_]),Sg();const te=x.useCallback(fe=>{const[ve,...Se]=T().map(Ce=>Ce.ref.current),[Ie]=Se.slice(-1),De=document.activeElement;for(const Ce of fe)if(Ce===De||(Ce==null||Ce.scrollIntoView({block:"nearest"}),Ce===ve&&E&&(E.scrollTop=0),Ce===Ie&&E&&(E.scrollTop=E.scrollHeight),Ce==null||Ce.focus(),document.activeElement!==De))return},[T,E]),$=x.useCallback(()=>te([D,_]),[te,D,_]);x.useEffect(()=>{F&&$()},[F,$]);const{onOpenChange:Z,triggerPointerDownPosRef:I}=p;x.useEffect(()=>{if(_){let fe={x:0,y:0};const ve=Ie=>{var De,Ce;fe={x:Math.abs(Math.round(Ie.pageX)-(((De=I.current)==null?void 0:De.x)??0)),y:Math.abs(Math.round(Ie.pageY)-(((Ce=I.current)==null?void 0:Ce.y)??0))}},Se=Ie=>{fe.x<=10&&fe.y<=10?Ie.preventDefault():_.contains(Ie.target)||Z(!1),document.removeEventListener("pointermove",ve),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",ve),document.addEventListener("pointerup",Se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ve),document.removeEventListener("pointerup",Se,{capture:!0})}}},[_,Z,I]),x.useEffect(()=>{const fe=()=>Z(!1);return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[Z]);const[Q,z]=WE(fe=>{const ve=T().filter(De=>!De.disabled),Se=ve.find(De=>De.ref.current===document.activeElement),Ie=$E(ve,fe,Se);Ie&&setTimeout(()=>Ie.ref.current.focus())}),V=x.useCallback((fe,ve,Se)=>{const Ie=!W.current&&!Se;(p.value!==void 0&&p.value===ve||Ie)&&(P(fe),Ie&&(W.current=!0))},[p.value]),de=x.useCallback(()=>_==null?void 0:_.focus(),[_]),ne=x.useCallback((fe,ve,Se)=>{const Ie=!W.current&&!Se;(p.value!==void 0&&p.value===ve||Ie)&&q(fe)},[p.value]),se=n==="popper"?um:CE,Pe=se===um?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:w}:{};return c.jsx(SE,{scope:r,content:_,viewport:E,onViewportChange:j,itemRefCallback:V,selectedItem:D,onItemLeave:de,itemTextRefCallback:ne,focusSelectedItem:$,selectedItemText:L,position:n,isPositioned:F,searchRef:Q,children:c.jsx(uf,{as:xs,allowPinchZoom:!0,children:c.jsx(sf,{asChild:!0,trapped:p.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:ue(s,fe=>{var ve;(ve=p.trigger)==null||ve.focus({preventScroll:!0}),fe.preventDefault()}),children:c.jsx(wa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:c.jsx(se,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:fe=>fe.preventDefault(),...v,...Pe,onPlaced:()=>b(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:ue(v.onKeyDown,fe=>{const ve=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!ve&&fe.key.length===1&&z(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let Ie=T().filter(De=>!De.disabled).map(De=>De.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(Ie=Ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const De=fe.target,Ce=Ie.indexOf(De);Ie=Ie.slice(Ce+1)}setTimeout(()=>te(Ie)),fe.preventDefault()}})})})})})})});kE.displayName=pz;var mz="SelectItemAlignedPosition",CE=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,i=xi(Xi,r),o=wi(Xi,r),[a,l]=x.useState(null),[u,d]=x.useState(null),f=Xe(t,R=>d(R)),g=Ff(r),h=x.useRef(!1),y=x.useRef(!0),{viewport:m,selectedItem:w,selectedItemText:v,focusSelectedItem:p}=o,_=x.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&m&&w&&v){const R=i.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),L=v.getBoundingClientRect();if(i.dir!=="rtl"){const De=L.left-D.left,Ce=P.left-De,rt=R.left-Ce,k=R.width+rt,J=Math.max(k,D.width),K=window.innerWidth-is,A=cm(Ce,[is,K-J]);a.style.minWidth=k+"px",a.style.left=A+"px"}else{const De=D.right-L.right,Ce=window.innerWidth-P.right-De,rt=window.innerWidth-R.right-Ce,k=R.width+rt,J=Math.max(k,D.width),K=window.innerWidth-is,A=cm(Ce,[is,K-J]);a.style.minWidth=k+"px",a.style.right=A+"px"}const q=g(),T=window.innerHeight-is*2,F=m.scrollHeight,b=window.getComputedStyle(u),W=parseInt(b.borderTopWidth,10),te=parseInt(b.paddingTop,10),$=parseInt(b.borderBottomWidth,10),Z=parseInt(b.paddingBottom,10),I=W+te+F+Z+$,Q=Math.min(w.offsetHeight*5,I),z=window.getComputedStyle(m),V=parseInt(z.paddingTop,10),de=parseInt(z.paddingBottom,10),ne=R.top+R.height/2-is,se=T-ne,Pe=w.offsetHeight/2,fe=w.offsetTop+Pe,ve=W+te+fe,Se=I-ve;if(ve<=ne){const De=w===q[q.length-1].ref.current;a.style.bottom="0px";const Ce=u.clientHeight-m.offsetTop-m.offsetHeight,rt=Math.max(se,Pe+(De?de:0)+Ce+$),k=ve+rt;a.style.height=k+"px"}else{const De=w===q[0].ref.current;a.style.top="0px";const rt=Math.max(ne,W+m.offsetTop+(De?V:0)+Pe)+Se;a.style.height=rt+"px",m.scrollTop=ve-ne+m.offsetTop}a.style.margin=`${is}px 0`,a.style.minHeight=Q+"px",a.style.maxHeight=T+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[g,i.trigger,i.valueNode,a,u,m,w,v,i.dir,n]);nr(()=>_(),[_]);const[C,E]=x.useState();nr(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const j=x.useCallback(R=>{R&&y.current===!0&&(_(),p==null||p(),y.current=!1)},[_,p]);return c.jsx(vz,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:j,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(Ve.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});CE.displayName=mz;var gz="SelectPopperPosition",um=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=is,...i}=e,o=zf(r);return c.jsx(Og,{...o,...i,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});um.displayName=gz;var[vz,Vv]=ja(Xi,{}),dm="SelectViewport",EE=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,i=wi(dm,r),o=Vv(dm,r),a=Xe(t,i.onViewportChange),l=x.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),c.jsx(Lf.Slot,{scope:r,children:c.jsx(Ve.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:ue(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:g}=o;if(g!=null&&g.current&&f){const h=Math.abs(l.current-d.scrollTop);if(h>0){const y=window.innerHeight-is*2,m=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),v=Math.max(m,w);if(v0?C:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});EE.displayName=dm;var jE="SelectGroup",[yz,xz]=ja(jE),TE=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=zn();return c.jsx(yz,{scope:r,id:s,children:c.jsx(Ve.div,{role:"group","aria-labelledby":s,...n,ref:t})})});TE.displayName=jE;var NE="SelectLabel",RE=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=xz(NE,r);return c.jsx(Ve.div,{id:s.id,...n,ref:t})});RE.displayName=NE;var Pd="SelectItem",[wz,PE]=ja(Pd),DE=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:i,...o}=e,a=xi(Pd,r),l=wi(Pd,r),u=a.value===n,[d,f]=x.useState(i??""),[g,h]=x.useState(!1),y=Xe(t,v=>{var p;return(p=l.itemRefCallback)==null?void 0:p.call(l,v,n,s)}),m=zn(),w=()=>{s||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(wz,{scope:r,value:n,disabled:s,textId:m,isSelected:u,onItemTextChange:x.useCallback(v=>{f(p=>p||((v==null?void 0:v.textContent)??"").trim())},[]),children:c.jsx(Lf.ItemSlot,{scope:r,value:n,disabled:s,textValue:d,children:c.jsx(Ve.div,{role:"option","aria-labelledby":m,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:y,onFocus:ue(o.onFocus,()=>h(!0)),onBlur:ue(o.onBlur,()=>h(!1)),onPointerUp:ue(o.onPointerUp,w),onPointerMove:ue(o.onPointerMove,v=>{var p;s?(p=l.onItemLeave)==null||p.call(l):v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ue(o.onPointerLeave,v=>{var p;v.currentTarget===document.activeElement&&((p=l.onItemLeave)==null||p.call(l))}),onKeyDown:ue(o.onKeyDown,v=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&v.key===" "||(az.includes(v.key)&&w(),v.key===" "&&v.preventDefault())})})})})});DE.displayName=Pd;var Ja="SelectItemText",AE=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...i}=e,o=xi(Ja,r),a=wi(Ja,r),l=PE(Ja,r),u=dz(Ja,r),[d,f]=x.useState(null),g=Xe(t,v=>f(v),l.onItemTextChange,v=>{var p;return(p=a.itemTextRefCallback)==null?void 0:p.call(a,v,l.value,l.disabled)}),h=d==null?void 0:d.textContent,y=x.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:w}=u;return nr(()=>(m(y),()=>w(y)),[m,w,y]),c.jsxs(c.Fragment,{children:[c.jsx(Ve.span,{id:l.textId,...i,ref:g}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Cs.createPortal(i.children,o.valueNode):null]})});AE.displayName=Ja;var OE="SelectItemIndicator",ME=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return PE(OE,r).isSelected?c.jsx(Ve.span,{"aria-hidden":!0,...n,ref:t}):null});ME.displayName=OE;var fm="SelectScrollUpButton",IE=x.forwardRef((e,t)=>{const r=wi(fm,e.__scopeSelect),n=Vv(fm,e.__scopeSelect),[s,i]=x.useState(!1),o=Xe(t,n.onScrollButtonChange);return nr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const u=l.scrollTop>0;i(u)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?c.jsx(FE,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});IE.displayName=fm;var hm="SelectScrollDownButton",LE=x.forwardRef((e,t)=>{const r=wi(hm,e.__scopeSelect),n=Vv(hm,e.__scopeSelect),[s,i]=x.useState(!1),o=Xe(t,n.onScrollButtonChange);return nr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?c.jsx(FE,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});LE.displayName=hm;var FE=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,i=wi("SelectScrollButton",r),o=x.useRef(null),a=Ff(r),l=x.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return x.useEffect(()=>()=>l(),[l]),nr(()=>{var d;const u=a().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),c.jsx(Ve.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ue(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:ue(s.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:ue(s.onPointerLeave,()=>{l()})})}),_z="SelectSeparator",zE=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return c.jsx(Ve.div,{"aria-hidden":!0,...n,ref:t})});zE.displayName=_z;var pm="SelectArrow",bz=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=zf(r),i=xi(pm,r),o=wi(pm,r);return i.open&&o.position==="popper"?c.jsx(Mg,{...s,...n,ref:t}):null});bz.displayName=pm;function UE(e){return e===""||e===void 0}var VE=x.forwardRef((e,t)=>{const{value:r,...n}=e,s=x.useRef(null),i=Xe(t,s),o=Qk(r);return x.useEffect(()=>{const a=s.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==r&&d){const f=new Event("change",{bubbles:!0});d.call(a,r),a.dispatchEvent(f)}},[o,r]),c.jsx(Sc,{asChild:!0,children:c.jsx("select",{...n,ref:i,defaultValue:r})})});VE.displayName="BubbleSelect";function WE(e){const t=At(e),r=x.useRef(""),n=x.useRef(0),s=x.useCallback(o=>{const a=r.current+o;t(a),function l(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,i]}function $E(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=Sz(e,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==r));const l=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function Sz(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var kz=mE,BE=vE,Cz=xE,Ez=wE,jz=_E,HE=bE,Tz=EE,Nz=TE,YE=RE,ZE=DE,Rz=AE,Pz=ME,KE=IE,GE=LE,qE=zE;const el=kz,tl=Nz,rl=Cz,Mo=x.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(BE,{ref:n,className:pe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,c.jsx(Ez,{asChild:!0,children:c.jsx(h1,{className:"h-4 w-4 opacity-50"})})]}));Mo.displayName=BE.displayName;const XE=x.forwardRef(({className:e,...t},r)=>c.jsx(KE,{ref:r,className:pe("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(zR,{className:"h-4 w-4"})}));XE.displayName=KE.displayName;const QE=x.forwardRef(({className:e,...t},r)=>c.jsx(GE,{ref:r,className:pe("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(h1,{className:"h-4 w-4"})}));QE.displayName=GE.displayName;const Io=x.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>c.jsx(jz,{children:c.jsxs(HE,{ref:s,className:pe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[c.jsx(XE,{}),c.jsx(Tz,{className:pe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(QE,{})]})}));Io.displayName=HE.displayName;const Lo=x.forwardRef(({className:e,...t},r)=>c.jsx(YE,{ref:r,className:pe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Lo.displayName=YE.displayName;const Fo=x.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(ZE,{ref:n,className:pe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Pz,{children:c.jsx(f1,{className:"h-4 w-4"})})}),c.jsx(Rz,{children:t})]}));Fo.displayName=ZE.displayName;const Dz=x.forwardRef(({className:e,...t},r)=>c.jsx(qE,{ref:r,className:pe("-mx-1 my-1 h-px bg-muted",e),...t}));Dz.displayName=qE.displayName;const mm=new Map([["aliyun-cdn",["阿里云-CDN","/imgs/providers/aliyun.svg"]],["aliyun-oss",["阿里云-OSS","/imgs/providers/aliyun.svg"]],["tencent-cdn",["腾讯云-CDN","/imgs/providers/tencent.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["qiniu-cdn",["七牛云-CDN","/imgs/providers/qiniu.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),Az=Array.from(mm.keys()),JE=qg,ej=Xg,Oz=Qg,tj=x.forwardRef(({className:e,...t},r)=>c.jsx(mc,{ref:r,className:pe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));tj.displayName=mc.displayName;const Wv=x.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Oz,{children:[c.jsx(tj,{}),c.jsxs(gc,{ref:n,className:pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,c.jsxs(hf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[c.jsx(xg,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Wv.displayName=gc.displayName;const $v=({className:e,...t})=>c.jsx("div",{className:pe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});$v.displayName="DialogHeader";const Bv=x.forwardRef(({className:e,...t},r)=>c.jsx(vc,{ref:r,className:pe("text-lg font-semibold leading-none tracking-tight",e),...t}));Bv.displayName=vc.displayName;const Mz=x.forwardRef(({className:e,...t},r)=>c.jsx(yc,{ref:r,className:pe("text-sm text-muted-foreground",e),...t}));Mz.displayName=yc.displayName;function Iz(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Hv="ScrollArea",[rj,E8]=Qr(Hv),[Lz,sn]=rj(Hv),nj=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:i=600,...o}=e,[a,l]=x.useState(null),[u,d]=x.useState(null),[f,g]=x.useState(null),[h,y]=x.useState(null),[m,w]=x.useState(null),[v,p]=x.useState(0),[_,C]=x.useState(0),[E,j]=x.useState(!1),[R,D]=x.useState(!1),P=Xe(t,q=>l(q)),L=nf(s);return c.jsx(Lz,{scope:r,type:n,dir:L,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:d,content:f,onContentChange:g,scrollbarX:h,onScrollbarXChange:y,scrollbarXEnabled:E,onScrollbarXEnabledChange:j,scrollbarY:m,onScrollbarYChange:w,scrollbarYEnabled:R,onScrollbarYEnabledChange:D,onCornerWidthChange:p,onCornerHeightChange:C,children:c.jsx(Ve.div,{dir:L,...o,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});nj.displayName=Hv;var sj="ScrollAreaViewport",ij=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...i}=e,o=sn(sj,r),a=x.useRef(null),l=Xe(t,a,o.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),c.jsx(Ve.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});ij.displayName=sj;var Kn="ScrollAreaScrollbar",Yv=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=sn(Kn,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=s,a=e.orientation==="horizontal";return x.useEffect(()=>(a?i(!0):o(!0),()=>{a?i(!1):o(!1)}),[a,i,o]),s.type==="hover"?c.jsx(Fz,{...n,ref:t,forceMount:r}):s.type==="scroll"?c.jsx(zz,{...n,ref:t,forceMount:r}):s.type==="auto"?c.jsx(oj,{...n,ref:t,forceMount:r}):s.type==="always"?c.jsx(Zv,{...n,ref:t}):null});Yv.displayName=Kn;var Fz=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=sn(Kn,e.__scopeScrollArea),[i,o]=x.useState(!1);return x.useEffect(()=>{const a=s.scrollArea;let l=0;if(a){const u=()=>{window.clearTimeout(l),o(!0)},d=()=>{l=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),c.jsx(Er,{present:r||i,children:c.jsx(oj,{"data-state":i?"visible":"hidden",...n,ref:t})})}),zz=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=sn(Kn,e.__scopeScrollArea),i=e.orientation==="horizontal",o=Vf(()=>l("SCROLL_END"),100),[a,l]=Iz("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,s.scrollHideDelay,l]),x.useEffect(()=>{const u=s.viewport,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const g=()=>{const h=u[d];f!==h&&(l("SCROLL"),o()),f=h};return u.addEventListener("scroll",g),()=>u.removeEventListener("scroll",g)}},[s.viewport,i,l,o]),c.jsx(Er,{present:r||a!=="hidden",children:c.jsx(Zv,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ue(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ue(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),oj=x.forwardRef((e,t)=>{const r=sn(Kn,e.__scopeScrollArea),{forceMount:n,...s}=e,[i,o]=x.useState(!1),a=e.orientation==="horizontal",l=Vf(()=>{if(r.viewport){const u=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,s=sn(Kn,e.__scopeScrollArea),i=x.useRef(null),o=x.useRef(0),[a,l]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=dj(a.viewport,a.content),d={...n,sizes:a,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:g=>o.current=g};function f(g,h){return Hz(g,o.current,a,h)}return r==="horizontal"?c.jsx(Uz,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollLeft,h=D0(g,a,s.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollLeft=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollLeft=f(g,s.dir))}}):r==="vertical"?c.jsx(Vz,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollTop,h=D0(g,a);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollTop=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollTop=f(g))}}):null}),Uz=x.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=sn(Kn,e.__scopeScrollArea),[o,a]=x.useState(),l=x.useRef(null),u=Xe(t,l,i.onScrollbarXChange);return x.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(lj,{"data-orientation":"horizontal",...s,ref:u,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Uf(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(i.viewport){const g=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(g),hj(g,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&o&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Ad(o.paddingLeft),paddingEnd:Ad(o.paddingRight)}})}})}),Vz=x.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=sn(Kn,e.__scopeScrollArea),[o,a]=x.useState(),l=x.useRef(null),u=Xe(t,l,i.onScrollbarYChange);return x.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(lj,{"data-orientation":"vertical",...s,ref:u,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Uf(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(i.viewport){const g=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(g),hj(g,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&o&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Ad(o.paddingTop),paddingEnd:Ad(o.paddingBottom)}})}})}),[Wz,aj]=rj(Kn),lj=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...g}=e,h=sn(Kn,r),[y,m]=x.useState(null),w=Xe(t,P=>m(P)),v=x.useRef(null),p=x.useRef(""),_=h.viewport,C=n.content-n.viewport,E=At(d),j=At(l),R=Vf(f,10);function D(P){if(v.current){const L=P.clientX-v.current.left,q=P.clientY-v.current.top;u({x:L,y:q})}}return x.useEffect(()=>{const P=L=>{const q=L.target;(y==null?void 0:y.contains(q))&&E(L,C)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[_,y,C,E]),x.useEffect(j,[n,j]),ha(y,R),ha(h.content,R),c.jsx(Wz,{scope:r,scrollbar:y,hasThumb:s,onThumbChange:At(i),onThumbPointerUp:At(o),onThumbPositionChange:j,onThumbPointerDown:At(a),children:c.jsx(Ve.div,{...g,ref:w,style:{position:"absolute",...g.style},onPointerDown:ue(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),v.current=y.getBoundingClientRect(),p.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),D(P))}),onPointerMove:ue(e.onPointerMove,D),onPointerUp:ue(e.onPointerUp,P=>{const L=P.target;L.hasPointerCapture(P.pointerId)&&L.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=p.current,h.viewport&&(h.viewport.style.scrollBehavior=""),v.current=null})})})}),Dd="ScrollAreaThumb",cj=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=aj(Dd,e.__scopeScrollArea);return c.jsx(Er,{present:r||s.hasThumb,children:c.jsx($z,{ref:t,...n})})}),$z=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,i=sn(Dd,r),o=aj(Dd,r),{onThumbPositionChange:a}=o,l=Xe(t,f=>o.onThumbChange(f)),u=x.useRef(),d=Vf(()=>{u.current&&(u.current(),u.current=void 0)},100);return x.useEffect(()=>{const f=i.viewport;if(f){const g=()=>{if(d(),!u.current){const h=Yz(f,a);u.current=h,a()}};return a(),f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[i.viewport,d,a]),c.jsx(Ve.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ue(e.onPointerDownCapture,f=>{const h=f.target.getBoundingClientRect(),y=f.clientX-h.left,m=f.clientY-h.top;o.onThumbPointerDown({x:y,y:m})}),onPointerUp:ue(e.onPointerUp,o.onThumbPointerUp)})});cj.displayName=Dd;var Kv="ScrollAreaCorner",uj=x.forwardRef((e,t)=>{const r=sn(Kv,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?c.jsx(Bz,{...e,ref:t}):null});uj.displayName=Kv;var Bz=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=sn(Kv,r),[i,o]=x.useState(0),[a,l]=x.useState(0),u=!!(i&&a);return ha(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),l(d)}),ha(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),o(d)}),u?c.jsx(Ve.div,{...n,ref:t,style:{width:i,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ad(e){return e?parseInt(e,10):0}function dj(e,t){const r=e/t;return isNaN(r)?0:r}function Uf(e){const t=dj(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Hz(e,t,r,n="ltr"){const s=Uf(r),i=s/2,o=t||i,a=s-o,l=r.scrollbar.paddingStart+o,u=r.scrollbar.size-r.scrollbar.paddingEnd-a,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return fj([l,u],f)(e)}function D0(e,t,r="ltr"){const n=Uf(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,o=t.content-t.viewport,a=i-n,l=r==="ltr"?[0,o]:[o*-1,0],u=cm(e,l);return fj([0,o],[0,a])(u)}function fj(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function hj(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const i={left:e.scrollLeft,top:e.scrollTop},o=r.left!==i.left,a=r.top!==i.top;(o||a)&&t(),r=i,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function Vf(e,t){const r=At(e),n=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),x.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ha(e,t){const r=At(t);nr(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var pj=nj,Zz=ij,Kz=uj;const Gv=x.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(pj,{ref:n,className:pe("relative overflow-hidden",e),...r,children:[c.jsx(Zz,{className:"h-full w-full rounded-[inherit]",children:t}),c.jsx(mj,{}),c.jsx(Kz,{})]}));Gv.displayName=pj.displayName;const mj=x.forwardRef(({className:e,orientation:t="vertical",...r},n)=>c.jsx(Yv,{ref:n,orientation:t,className:pe("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:c.jsx(cj,{className:"relative flex-1 rounded-full bg-border"})}));mj.displayName=Yv.displayName;const zi=new Map([["tencent",["腾讯云","/imgs/providers/tencent.svg"]],["aliyun",["阿里云","/imgs/providers/aliyun.svg"]],["cloudflare",["Cloudflare","/imgs/providers/cloudflare.svg"]],["namesilo",["Namesilo","/imgs/providers/namesilo.svg"]],["godaddy",["GoDaddy","/imgs/providers/godaddy.svg"]],["qiniu",["七牛云","/imgs/providers/qiniu.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),_i=we.union([we.literal("aliyun"),we.literal("tencent"),we.literal("ssh"),we.literal("webhook"),we.literal("cloudflare"),we.literal("qiniu"),we.literal("namesilo"),we.literal("godaddy")],{message:"请选择云服务商"}),bi=e=>{switch(e){case"aliyun":case"tencent":return"all";case"ssh":case"webhook":case"qiniu":return"deploy";case"cloudflare":case"namesilo":case"godaddy":return"apply";default:return"all"}},Gz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,secretId:we.string().min(1).max(64),secretKey:we.string().min(1).max(64)});let i={secretId:"",secretKey:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"tencent",secretId:i.secretId,secretKey:i.secretKey}}),a=async l=>{const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{secretId:l.secretId,secretKey:l.secretKey}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"secretId",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"SecretId"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入SecretId",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"secretKey",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"SecretKey"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入SecretKey",...l})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},qz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,accessKeyId:we.string().min(1).max(64),accessSecretId:we.string().min(1).max(64)});let i={accessKeyId:"",accessKeySecret:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"aliyun",accessKeyId:i.accessKeyId,accessSecretId:i.accessKeySecret}}),a=async l=>{const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{accessKeyId:l.accessKeyId,accessKeySecret:l.accessSecretId}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})});return}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"accessKeyId",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"AccessKeyId"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入AccessKeyId",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"accessSecretId",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"AccessKeySecret"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入AccessKeySecret",...l})}),c.jsx(ke,{})]})}),c.jsx(ke,{}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},gj=x.forwardRef(({className:e,...t},r)=>c.jsx("textarea",{className:pe("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));gj.displayName="Textarea";const Xz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=x.useRef(null),[i,o]=x.useState(""),a=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,host:we.string().ip({message:"请输入合法的IP地址"}),port:we.string().min(1).max(5),username:we.string().min(1).max(64),password:we.string().min(0).max(64),key:we.string().min(0).max(20480),keyFile:we.any().optional(),command:we.string().min(1).max(2048),certPath:we.string().min(0).max(2048),keyPath:we.string().min(0).max(2048)});let l={host:"127.0.0.1",port:"22",username:"root",password:"",key:"",keyFile:"",command:"sudo service nginx restart",certPath:"/etc/nginx/ssl/certificate.crt",keyPath:"/etc/nginx/ssl/private.key"};e&&(l=e.config);const u=tn({resolver:rn(a),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"ssh",host:l.host,port:l.port,username:l.username,password:l.password,key:l.key,keyFile:l.keyFile,certPath:l.certPath,keyPath:l.keyPath,command:l.command}}),d=async h=>{console.log(h);const y={id:h.id,name:h.name,configType:h.configType,usage:bi(h.configType),config:{host:h.host,port:h.port,username:h.username,password:h.password,key:h.key,command:h.command,certPath:h.certPath,keyPath:h.keyPath}};try{const m=await yi(y);if(t(),y.id=m.id,y.created=m.created,y.updated=m.updated,h.id){n(y);return}r(y)}catch(m){Object.entries(m.response.data).forEach(([v,p])=>{u.setError(v,{type:"manual",message:p.message})});return}},f=async h=>{var v;const y=(v=h.target.files)==null?void 0:v[0];if(!y)return;const m=y;o(m.name);const w=await C5(m);u.setValue("key",w)},g=()=>{var h;console.log(s.current),(h=s.current)==null||h.click()};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...u,children:c.jsxs("form",{onSubmit:h=>{h.stopPropagation(),u.handleSubmit(d)(h)},className:"space-y-3",children:[c.jsx(Ae,{control:u.control,name:"name",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"id",render:({field:h})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"configType",render:({field:h})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...h})}),c.jsx(ke,{})]})}),c.jsxs("div",{className:"flex space-x-2",children:[c.jsx(Ae,{control:u.control,name:"host",render:({field:h})=>c.jsxs(Te,{className:"grow",children:[c.jsx(Ne,{children:"服务器IP"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入Host",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"port",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"SSH端口"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入Port",...h,type:"number"})}),c.jsx(ke,{})]})})]}),c.jsx(Ae,{control:u.control,name:"username",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"用户名"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入用户名",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"password",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"密码"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入密码",...h,type:"password"})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"key",render:({field:h})=>c.jsxs(Te,{hidden:!0,children:[c.jsx(Ne,{children:"Key(使用证书登录)"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入Key",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"keyFile",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"Key(使用证书登录)"}),c.jsx(Re,{children:c.jsxs("div",{children:[c.jsx(at,{type:"button",variant:"secondary",size:"sm",className:"w-48",onClick:g,children:i||"请选择文件"}),c.jsx(Fe,{placeholder:"请输入Key",...h,ref:s,className:"hidden",hidden:!0,type:"file",onChange:f})]})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"certPath",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"证书上传路径"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入证书上传路径",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"keyPath",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"私钥上传路径"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入私钥上传路径",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"command",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"Command"}),c.jsx(Re,{children:c.jsx(gj,{placeholder:"请输入要执行的命令",...h})}),c.jsx(ke,{})]})}),c.jsx(ke,{}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},Qz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,url:we.string().url()});let i={url:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"webhook",url:i.url}}),a=async l=>{console.log(l);const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{url:l.url}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"url",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"Webhook Url"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入Webhook Url",...l})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},Jz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,dnsApiToken:we.string().min(1).max(64)});let i={dnsApiToken:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"cloudflare",dnsApiToken:i.dnsApiToken}}),a=async l=>{console.log(l);const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{dnsApiToken:l.dnsApiToken}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"dnsApiToken",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"CLOUD_DNS_API_TOKEN"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入CLOUD_DNS_API_TOKEN",...l})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},e8=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,accessKey:we.string().min(1).max(64),secretKey:we.string().min(1).max(64)});let i={accessKey:"",secretKey:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"qiniu",accessKey:i.accessKey,secretKey:i.secretKey}}),a=async l=>{const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{accessKey:l.accessKey,secretKey:l.secretKey}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})});return}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"accessKey",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"AccessKey"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入AccessKey",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"secretKey",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"SecretKey"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入SecretKey",...l})}),c.jsx(ke,{})]})}),c.jsx(ke,{}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},t8=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,apiKey:we.string().min(1).max(64)});let i={apiKey:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"namesilo",apiKey:i.apiKey}}),a=async l=>{console.log(l);const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{apiKey:l.apiKey}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"apiKey",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"NAMESILO_API_KEY"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入NAMESILO_API_KEY",...l})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},r8=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,apiKey:we.string().min(1).max(64),apiSecret:we.string().min(1).max(64)});let i={apiKey:"",apiSecret:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"godaddy",apiKey:i.apiKey,apiSecret:i.apiSecret}}),a=async l=>{console.log(l);const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{apiKey:l.apiKey,apiSecret:l.apiSecret}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"apiKey",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"GODADDY_API_KEY"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入GODADDY_API_KEY",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"apiSecret",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"GODADDY_API_SECRET"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入GODADDY_API_SECRET",...l})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})};function gl({trigger:e,op:t,data:r,className:n}){const[s,i]=x.useState(!1),o=Array.from(zi.keys()),[a,l]=x.useState((r==null?void 0:r.configType)||"");let u=c.jsx(c.Fragment,{children:" "});switch(a){case"tencent":u=c.jsx(Gz,{data:r,onAfterReq:()=>{i(!1)}});break;case"aliyun":u=c.jsx(qz,{data:r,onAfterReq:()=>{i(!1)}});break;case"ssh":u=c.jsx(Xz,{data:r,onAfterReq:()=>{i(!1)}});break;case"webhook":u=c.jsx(Qz,{data:r,onAfterReq:()=>{i(!1)}});break;case"cloudflare":u=c.jsx(Jz,{data:r,onAfterReq:()=>{i(!1)}});break;case"qiniu":u=c.jsx(e8,{data:r,onAfterReq:()=>{i(!1)}});break;case"namesilo":u=c.jsx(t8,{data:r,onAfterReq:()=>{i(!1)}});break;case"godaddy":u=c.jsx(r8,{data:r,onAfterReq:()=>{i(!1)}});break}const d=f=>f==a?"border-primary":"";return c.jsxs(JE,{onOpenChange:i,open:s,children:[c.jsx(ej,{asChild:!0,className:pe(n),children:e}),c.jsxs(Wv,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[c.jsx($v,{children:c.jsxs(Bv,{children:[t=="add"?"添加":"编辑","授权"]})}),c.jsx(Gv,{className:"max-h-[80vh]",children:c.jsxs("div",{className:"container py-3",children:[c.jsx(Uv,{children:"服务商"}),c.jsxs(el,{onValueChange:f=>{console.log(f),l(f)},defaultValue:a,children:[c.jsx(Mo,{className:"mt-3",children:c.jsx(rl,{placeholder:"请选择服务商"})}),c.jsx(Io,{children:c.jsxs(tl,{children:[c.jsx(Lo,{children:"服务商"}),o.map(f=>{var g,h;return c.jsx(Fo,{value:f,children:c.jsxs("div",{className:pe("flex items-center space-x-2 rounded cursor-pointer",d(f)),children:[c.jsx("img",{src:(g=zi.get(f))==null?void 0:g[1],className:"h-6 w-6"}),c.jsx("div",{children:(h=zi.get(f))==null?void 0:h[0]})]})},f)})]})})]}),u]})})]})]})}const n8=({className:e,trigger:t})=>{const{config:{emails:r},setEmails:n}=En(),[s,i]=x.useState(!1),o=we.object({email:we.string().email()}),a=tn({resolver:rn(o),defaultValues:{email:""}}),l=async u=>{if(r.content.emails.includes(u.email)){a.setError("email",{message:"邮箱已存在"});return}const d=[...r.content.emails,u.email];try{const f=await e3({...r,name:"emails",content:{emails:d}});n(f),a.reset(),a.clearErrors(),i(!1)}catch(f){Object.entries(f.response.data).forEach(([h,y])=>{a.setError(h,{type:"manual",message:y.message})})}};return c.jsxs(JE,{onOpenChange:i,open:s,children:[c.jsx(ej,{asChild:!0,className:pe(e),children:t}),c.jsxs(Wv,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[c.jsx($v,{children:c.jsx(Bv,{children:"添加邮箱"})}),c.jsx("div",{className:"container py-3",children:c.jsx(nn,{...a,children:c.jsxs("form",{onSubmit:u=>{console.log(u),u.stopPropagation(),a.handleSubmit(l)(u)},className:"space-y-8",children:[c.jsx(Ae,{control:a.control,name:"email",render:({field:u})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"邮箱"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入邮箱",...u,type:"email"})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})]})]})},s8=()=>{const{config:{accesses:e,emails:t}}=En(),[r,n]=x.useState(),s=Hn();x.useEffect(()=>{const y=new URLSearchParams(s.search).get("id");y&&(async()=>{const w=await R5(y);n(w)})()},[s.search]);const i=we.object({id:we.string().optional(),domain:we.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:"请输入正确的域名"}),email:we.string().email().optional(),access:we.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择DNS服务商授权配置"}),targetAccess:we.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择部署服务商配置"}),targetType:we.string().regex(/^[a-zA-Z0-9-]+$/,{message:"请选择部署服务类型"})}),o=tn({resolver:rn(i),defaultValues:{id:"",domain:"",email:"",access:"",targetAccess:"",targetType:""}});x.useEffect(()=>{r&&o.reset({id:r.id,domain:r.domain,email:r.email,access:r.access,targetAccess:r.targetAccess,targetType:r.targetType})},[r,o]);const[a,l]=x.useState(r?r.targetType:""),u=e.filter(h=>{if(h.usage=="apply")return!1;if(a=="")return!0;const y=o.getValues().targetType.split("-");return h.configType===y[0]}),{toast:d}=Tf(),f=Sn(),g=async h=>{const y={id:h.id,crontab:"0 0 * * *",domain:h.domain,email:h.email,access:h.access,targetAccess:h.targetAccess,targetType:h.targetType};try{await sm(y);let m="域名编辑成功";y.id==""&&(m="域名添加成功"),d({title:"成功",description:m}),f("/domains")}catch(m){Object.entries(m.response.data).forEach(([v,p])=>{o.setError(v,{type:"manual",message:p.message})});return}};return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"",children:[c.jsx(Pv,{}),c.jsxs("div",{className:"border-b dark:border-stone-500 h-10 text-muted-foreground",children:[r!=null&&r.id?"编辑":"新增","域名"]}),c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:o.handleSubmit(g),className:"space-y-8 dark:text-stone-200",children:[c.jsx(Ae,{control:o.control,name:"domain",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"域名"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入域名",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"email",render:({field:h})=>c.jsxs(Te,{children:[c.jsxs(Ne,{className:"flex w-full justify-between",children:[c.jsx("div",{children:"Email(申请证书需要提供邮箱)"}),c.jsx(n8,{trigger:c.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[c.jsx(yh,{size:14}),"新增"]})})]}),c.jsx(Re,{children:c.jsxs(el,{...h,value:h.value,onValueChange:y=>{o.setValue("email",y)},children:[c.jsx(Mo,{children:c.jsx(rl,{placeholder:"请选择邮箱"})}),c.jsx(Io,{children:c.jsxs(tl,{children:[c.jsx(Lo,{children:"邮箱列表"}),t.content.emails.map(y=>c.jsx(Fo,{value:y,children:c.jsx("div",{children:y})},y))]})})]})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"access",render:({field:h})=>c.jsxs(Te,{children:[c.jsxs(Ne,{className:"flex w-full justify-between",children:[c.jsx("div",{children:"DNS 服务商授权配置"}),c.jsx(gl,{trigger:c.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[c.jsx(yh,{size:14}),"新增"]}),op:"add"})]}),c.jsx(Re,{children:c.jsxs(el,{...h,value:h.value,onValueChange:y=>{o.setValue("access",y)},children:[c.jsx(Mo,{children:c.jsx(rl,{placeholder:"请选择授权配置"})}),c.jsx(Io,{children:c.jsxs(tl,{children:[c.jsx(Lo,{children:"服务商授权配置"}),e.filter(y=>y.usage!="deploy").map(y=>{var m;return c.jsx(Fo,{value:y.id,children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("img",{className:"w-6",src:(m=zi.get(y.configType))==null?void 0:m[1]}),c.jsx("div",{children:y.name})]})},y.id)})]})})]})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"targetType",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"部署服务类型"}),c.jsx(Re,{children:c.jsxs(el,{...h,onValueChange:y=>{l(y),o.setValue("targetType",y)},children:[c.jsx(Mo,{children:c.jsx(rl,{placeholder:"请选择部署服务类型"})}),c.jsx(Io,{children:c.jsxs(tl,{children:[c.jsx(Lo,{children:"部署服务类型"}),Az.map(y=>{var m,w;return c.jsx(Fo,{value:y,children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("img",{className:"w-6",src:(m=mm.get(y))==null?void 0:m[1]}),c.jsx("div",{children:(w=mm.get(y))==null?void 0:w[0]})]})},y)})]})})]})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"targetAccess",render:({field:h})=>c.jsxs(Te,{children:[c.jsxs(Ne,{className:"w-full flex justify-between",children:[c.jsx("div",{children:"部署服务商授权配置"}),c.jsx(gl,{trigger:c.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[c.jsx(yh,{size:14}),"新增"]}),op:"add"})]}),c.jsx(Re,{children:c.jsxs(el,{...h,onValueChange:y=>{o.setValue("targetAccess",y)},children:[c.jsx(Mo,{children:c.jsx(rl,{placeholder:"请选择授权配置"})}),c.jsx(Io,{children:c.jsxs(tl,{children:[c.jsx(Lo,{children:"服务商授权配置"}),u.map(y=>{var m;return c.jsx(Fo,{value:y.id,children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("img",{className:"w-6",src:(m=zi.get(y.configType))==null?void 0:m[1]}),c.jsx("div",{children:y.name})]})},y.id)})]})})]})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})]})})},i8=()=>{const{config:e,deleteAccess:t}=En(),{accesses:r}=e,n=10,s=Math.ceil(r.length/n),i=Sn(),o=Hn(),a=new URLSearchParams(o.search),l=a.get("page"),u=l?Number(l):1,d=(u-1)*n,f=d+n,g=async h=>{const y=await XF(h);t(y.id)};return c.jsxs("div",{className:"",children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("div",{className:"text-muted-foreground",children:"授权管理"}),c.jsx(gl,{trigger:c.jsx(at,{children:"添加授权"}),op:"add"})]}),r.length===0?c.jsxs("div",{className:"flex flex-col items-center mt-10",children:[c.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:c.jsx($R,{size:40,className:"text-primary"})}),c.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加授权开始部署证书吧。"}),c.jsx(gl,{trigger:c.jsx(at,{children:"添加授权"}),op:"add",className:"mt-3"})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[c.jsx("div",{className:"w-48",children:"名称"}),c.jsx("div",{className:"w-48",children:"服务商"}),c.jsx("div",{className:"w-52",children:"创建时间"}),c.jsx("div",{className:"w-52",children:"更新时间"}),c.jsx("div",{className:"grow",children:"操作"})]}),c.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"授权列表"}),r.slice(d,f).map(h=>{var y,m;return c.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[c.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:h.name}),c.jsxs("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center space-x-2",children:[c.jsx("img",{src:(y=zi.get(h.configType))==null?void 0:y[1],className:"w-6"}),c.jsx("div",{children:(m=zi.get(h.configType))==null?void 0:m[0]})]}),c.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["创建于 ",h.created&&ca(h.created)]}),c.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["更新于 ",h.updated&&ca(h.updated)]}),c.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[c.jsx(gl,{trigger:c.jsx(at,{variant:"link",className:"p-0",children:"编辑"}),op:"edit",data:h}),c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(at,{variant:"link",className:"p-0",onClick:()=>{g(h)},children:"删除"})]})]},h.id)}),c.jsx(kk,{totalPages:s,currentPage:u,onPageChange:h=>{a.set("page",h.toString()),i({search:a.toString()})}})]})]})},o8=uc("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),qv=x.forwardRef(({className:e,variant:t,...r},n)=>c.jsx("div",{ref:n,role:"alert",className:pe(o8({variant:t}),e),...r}));qv.displayName="Alert";const Xv=x.forwardRef(({className:e,...t},r)=>c.jsx("h5",{ref:r,className:pe("mb-1 font-medium leading-none tracking-tight",e),...t}));Xv.displayName="AlertTitle";const Qv=x.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:pe("text-sm [&_p]:leading-relaxed",e),...t}));Qv.displayName="AlertDescription";const vj=async e=>{let t=1;e.page&&(t=e.page);let r=50;e.perPage&&(r=e.perPage);let n="domain!=null";return e.domain&&(n=`domain="${e.domain}"`),await xt().collection("deployments").getList(t,r,{filter:n,sort:"-deployedAt",expand:"domain"})},a8=()=>{const e=Sn(),[t,r]=x.useState(),[n]=PR(),s=n.get("domain");return x.useEffect(()=>{(async()=>{const o={};s&&(o.domain=s);const a=await vj(o);r(a.items)})()},[s]),c.jsxs(Gv,{className:"h-[80vh] overflow-hidden",children:[c.jsx("div",{className:"text-muted-foreground",children:"部署历史"}),t!=null&&t.length?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[c.jsx("div",{className:"w-48",children:"域名"}),c.jsx("div",{className:"w-24",children:"状态"}),c.jsx("div",{className:"w-56",children:"阶段"}),c.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),c.jsx("div",{className:"grow",children:"操作"})]}),c.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),t==null?void 0:t.map(i=>{var o,a;return c.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[c.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(o=i.expand.domain)==null?void 0:o.domain}),c.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:i.phase==="deploy"&&i.phaseSuccess?c.jsx(vg,{size:16,className:"text-green-700"}):c.jsx(yg,{size:16,className:"text-red-700"})}),c.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:c.jsx(Ev,{phase:i.phase,phaseSuccess:i.phaseSuccess})}),c.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:ca(i.deployedAt)}),c.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:c.jsxs(Jg,{children:[c.jsx(ev,{asChild:!0,children:c.jsx(at,{variant:"link",className:"p-0",children:"日志"})}),c.jsxs(pf,{className:"sm:max-w-5xl",children:[c.jsx(tv,{children:c.jsxs(rv,{children:[(a=i.expand.domain)==null?void 0:a.domain,"-",i.id,"部署详情"]})}),c.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[i.log.check&&c.jsx(c.Fragment,{children:i.log.check.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),i.log.apply&&c.jsx(c.Fragment,{children:i.log.apply.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.info&&l.info.map(u=>c.jsx("div",{className:"mt-1 text-green-600",children:u})),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),i.log.deploy&&c.jsx(c.Fragment,{children:i.log.deploy.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))})]})]})]})})]},i.id)})]}):c.jsx(c.Fragment,{children:c.jsxs(qv,{className:"max-w-[40em] mx-auto mt-20",children:[c.jsx(Xv,{children:"暂无数据"}),c.jsxs(Qv,{children:[c.jsxs("div",{className:"flex items-center mt-5",children:[c.jsx("div",{children:c.jsx(p1,{className:"text-yellow-400",size:36})}),c.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(at,{onClick:()=>{e("/")},children:"添加域名"})})]})]})})]})},gm=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",l8=we.object({username:we.string().email({message:"请输入正确的邮箱地址"}),password:we.string().min(10,{message:"密码至少10个字符"})}),c8=()=>{const e=tn({resolver:rn(l8),defaultValues:{username:"",password:""}}),t=async n=>{try{await xt().admins.authWithPassword(n.username,n.password),r("/")}catch(s){const i=gm(s);e.setError("username",{message:i}),e.setError("password",{message:i})}},r=Sn();return c.jsxs("div",{className:"max-w-[35em] border dark:border-stone-500 mx-auto mt-32 p-10 rounded-md shadow-md",children:[c.jsx("div",{className:"flex justify-center mb-10",children:c.jsx("img",{src:"/vite.svg",className:"w-16"})}),c.jsx(nn,{...e,children:c.jsxs("form",{onSubmit:e.handleSubmit(t),className:"space-y-8 dark:text-stone-200",children:[c.jsx(Ae,{control:e.control,name:"username",render:({field:n})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"用户名"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"email",...n})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:e.control,name:"password",render:({field:n})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"密码"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"shadcn",...n,type:"password"})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"登录"})})]})})]})},u8=()=>xt().authStore.isValid&&xt().authStore.isAdmin?c.jsx(u1,{to:"/"}):c.jsx("div",{className:"container",children:c.jsx(gg,{})}),d8=we.object({oldPassword:we.string().min(10,{message:"密码至少10个字符"}),newPassword:we.string().min(10,{message:"密码至少10个字符"}),confirmPassword:we.string().min(10,{message:"密码至少10个字符"})}).refine(e=>e.newPassword===e.confirmPassword,{message:"两次密码不一致",path:["confirmPassword"]}),f8=()=>{const{toast:e}=Tf(),t=Sn(),r=tn({resolver:rn(d8),defaultValues:{oldPassword:"",newPassword:"",confirmPassword:""}}),n=async s=>{var i,o;try{await xt().admins.authWithPassword((i=xt().authStore.model)==null?void 0:i.email,s.oldPassword)}catch(a){const l=gm(a);r.setError("oldPassword",{message:l})}try{await xt().admins.update((o=xt().authStore.model)==null?void 0:o.id,{password:s.newPassword,passwordConfirm:s.confirmPassword}),xt().authStore.clear(),e({title:"修改密码成功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(a){const l=gm(a);e({title:"修改密码失败",description:l,variant:"destructive"})}};return c.jsx(c.Fragment,{children:c.jsx(nn,{...r,children:c.jsxs("form",{onSubmit:r.handleSubmit(n),className:"space-y-8 dark:text-stone-200",children:[c.jsx(Ae,{control:r.control,name:"oldPassword",render:({field:s})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"当前密码"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"当前密码",...s,type:"password"})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:r.control,name:"newPassword",render:({field:s})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"新密码"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"newPassword",...s,type:"password"})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:r.control,name:"confirmPassword",render:({field:s})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"确认密码"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"confirmPassword",...s,type:"password"})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"确认修改"})})]})})})},h8=()=>c.jsxs("div",{children:[c.jsx(Pv,{}),c.jsx("div",{className:"text-muted-foreground border-b dark:border-stone-500 py-5",children:"设置密码"}),c.jsx("div",{className:"w-full sm:w-[35em] mt-10 flex flex-col p-3 mx-auto",children:c.jsx(gg,{})})]}),p8=()=>{const[e,t]=x.useState(),[r,n]=x.useState(),s=Sn();return x.useEffect(()=>{(async()=>{const o=await N5();t(o)})()},[]),x.useEffect(()=>{(async()=>{const a=await vj({perPage:8});n(a.items)})()},[]),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("div",{className:"flex justify-between items-center",children:c.jsx("div",{className:"text-muted-foreground",children:"控制面板"})}),c.jsxs("div",{className:"flex mt-10 gap-5 flex-col flex-wrap md:flex-row",children:[c.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[c.jsx("div",{className:"p-3",children:c.jsx(ZR,{size:48,strokeWidth:1,className:"text-blue-400"})}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground font-semibold",children:"所有"}),c.jsxs("div",{className:"flex items-baseline",children:[c.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.total?c.jsx(dr,{to:"/domains",className:"hover:underline",children:e==null?void 0:e.total}):0}),c.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),c.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[c.jsx("div",{className:"p-3",children:c.jsx(LR,{size:48,strokeWidth:1,className:"text-red-400"})}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground font-semibold",children:"即将过期"}),c.jsxs("div",{className:"flex items-baseline",children:[c.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.expired?c.jsx(dr,{to:"/domains?state=expired",className:"hover:underline",children:e==null?void 0:e.expired}):0}),c.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),c.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[c.jsx("div",{className:"p-3",children:c.jsx(BR,{size:48,strokeWidth:1,className:"text-green-400"})}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground font-semibold",children:"启用中"}),c.jsxs("div",{className:"flex items-baseline",children:[c.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.enabled?c.jsx(dr,{to:"/domains?state=enabled",className:"hover:underline",children:e==null?void 0:e.enabled}):0}),c.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),c.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[c.jsx("div",{className:"p-3",children:c.jsx(MR,{size:48,strokeWidth:1,className:"text-gray-400"})}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground font-semibold",children:"未启用"}),c.jsxs("div",{className:"flex items-baseline",children:[c.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.disabled?c.jsx(dr,{to:"/domains?state=disabled",className:"hover:underline",children:e==null?void 0:e.disabled}):0}),c.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground mt-5 text-sm",children:"部署历史"}),(r==null?void 0:r.length)==0?c.jsx(c.Fragment,{children:c.jsxs(qv,{className:"max-w-[40em] mt-10",children:[c.jsx(Xv,{children:"暂无数据"}),c.jsxs(Qv,{children:[c.jsxs("div",{className:"flex items-center mt-5",children:[c.jsx("div",{children:c.jsx(p1,{className:"text-yellow-400",size:36})}),c.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(at,{onClick:()=>{s("/")},children:"添加域名"})})]})]})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[c.jsx("div",{className:"w-48",children:"域名"}),c.jsx("div",{className:"w-24",children:"状态"}),c.jsx("div",{className:"w-56",children:"阶段"}),c.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),c.jsx("div",{className:"grow",children:"操作"})]}),c.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),r==null?void 0:r.map(i=>{var o,a;return c.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[c.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(o=i.expand.domain)==null?void 0:o.domain}),c.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:i.phase==="deploy"&&i.phaseSuccess?c.jsx(vg,{size:16,className:"text-green-700"}):c.jsx(yg,{size:16,className:"text-red-700"})}),c.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:c.jsx(Ev,{phase:i.phase,phaseSuccess:i.phaseSuccess})}),c.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:ca(i.deployedAt)}),c.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:c.jsxs(Jg,{children:[c.jsx(ev,{asChild:!0,children:c.jsx(at,{variant:"link",className:"p-0",children:"日志"})}),c.jsxs(pf,{className:"sm:max-w-5xl",children:[c.jsx(tv,{children:c.jsxs(rv,{children:[(a=i.expand.domain)==null?void 0:a.domain,"-",i.id,"部署详情"]})}),c.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[i.log.check&&c.jsx(c.Fragment,{children:i.log.check.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),i.log.apply&&c.jsx(c.Fragment,{children:i.log.apply.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.info&&l.info.map(u=>c.jsx("div",{className:"mt-1 text-green-600",children:u})),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),i.log.deploy&&c.jsx(c.Fragment,{children:i.log.deploy.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))})]})]})]})})]},i.id)})]})]})]})},m8=gR([{path:"/",element:c.jsx(c3,{}),children:[{path:"/",element:c.jsx(p8,{})},{path:"/domains",element:c.jsx(O5,{})},{path:"/edit",element:c.jsx(s8,{})},{path:"/access",element:c.jsx(i8,{})},{path:"/history",element:c.jsx(a8,{})},{path:"/setting",element:c.jsx(h8,{}),children:[{path:"/setting/password",element:c.jsx(f8,{})}]}]},{path:"/login",element:c.jsx(u8,{}),children:[{path:"/login",element:c.jsx(c8,{})}]},{path:"/about",element:c.jsx("div",{children:"About"})}]);Uh.createRoot(document.getElementById("root")).render(c.jsx(et.StrictMode,{children:c.jsx(n3,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:c.jsx(CR,{router:m8})})}))});export default g8();