var wT=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var d8=wT((b8,Au)=>{function j0(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 o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();var Rc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var N0={exports:{}},Ad={},R0={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 tc=Symbol.for("react.element"),_T=Symbol.for("react.portal"),bT=Symbol.for("react.fragment"),ST=Symbol.for("react.strict_mode"),kT=Symbol.for("react.profiler"),CT=Symbol.for("react.provider"),ET=Symbol.for("react.context"),TT=Symbol.for("react.forward_ref"),jT=Symbol.for("react.suspense"),NT=Symbol.for("react.memo"),RT=Symbol.for("react.lazy"),qv=Symbol.iterator;function PT(e){return e===null||typeof e!="object"?null:(e=qv&&e[qv]||e["@@iterator"],typeof e=="function"?e:null)}var P0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D0=Object.assign,A0={};function ca(e,t,r){this.props=e,this.context=t,this.refs=A0,this.updater=r||P0}ca.prototype.isReactComponent={};ca.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")};ca.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function O0(){}O0.prototype=ca.prototype;function gm(e,t,r){this.props=e,this.context=t,this.refs=A0,this.updater=r||P0}var vm=gm.prototype=new O0;vm.constructor=gm;D0(vm,ca.prototype);vm.isPureReactComponent=!0;var Xv=Array.isArray,M0=Object.prototype.hasOwnProperty,ym={current:null},I0={key:!0,ref:!0,__self:!0,__source:!0};function L0(e,t,r){var n,s={},o=null,i=null;if(t!=null)for(n in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)M0.call(t,n)&&!I0.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))Tes(fe,se)?(Z[z]=fe,Z[Te]=Q,z=Te):(Z[z]=se,Z[ne]=Q,z=ne);else if(Tes(fe,Q))Z[z]=fe,Z[Te]=Q,z=Te;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 o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var l=[],u=[],d=1,f=null,p=3,m=!1,x=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,h=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(g=!1,_(Z),!x)if(r(l)!==null)x=!0,te(E);else{var I=r(u);I!==null&&$(C,I.startTime-Z)}}function E(Z,I){x=!1,g&&(g=!1,v(D),D=-1),m=!0;var Q=p;try{for(_(I),f=r(l);f!==null&&(!(f.expirationTime>I)||Z&&!q());){var z=f.callback;if(typeof z=="function"){f.callback=null,p=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,p=Q,m=!1}}var T=!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)&&(g?(v(D),D=-1):g=!0,$(C,Q-z))):(Z.sortIndex=V,t(l,Z),x||m||(x=!0,te(E))),Z},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(Z){var I=p;return function(){var Q=p;p=I;try{return Z.apply(this,arguments)}finally{p=Q}}}})($0);W0.exports=$0;var WT=W0.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 $T=y,Fr=WT;function oe(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"),zh=Object.prototype.hasOwnProperty,BT=/^[: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]*$/,Jv={},ey={};function HT(e){return zh.call(ey,e)?!0:zh.call(Jv,e)?!1:BT.test(e)?ey[e]=!0:(Jv[e]=!0,!1)}function YT(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 ZT(e,t,r,n){if(t===null||typeof t>"u"||YT(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,o,i){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=o,this.removeEmptyString=i}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 wm=/[\-:]([a-z])/g;function _m(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(wm,_m);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(wm,_m);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(wm,_m);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 bm(e,t,r,n){var s=rr.hasOwnProperty(t)?rr[t]:null;(s!==null?s.type!==0:n||!(2a||s[i]!==o[a]){var l=` `+s[i].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=i&&0<=a);break}}}finally{Bf=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ua(e):""}function KT(e){switch(e.tag){case 5:return Ua(e.type);case 16:return Ua("Lazy");case 13:return Ua("Suspense");case 19:return Ua("SuspenseList");case 0:case 2:case 15:return e=Hf(e.type,!1),e;case 11:return e=Hf(e.type.render,!1),e;case 1:return e=Hf(e.type,!0),e;default:return""}}function $h(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 xi:return"Fragment";case yi:return"Portal";case Uh:return"Profiler";case Sm:return"StrictMode";case Vh:return"Suspense";case Wh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Y0:return(e.displayName||"Context")+".Consumer";case H0:return(e._context.displayName||"Context")+".Provider";case km:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Cm:return t=e.displayName||null,t!==null?t:$h(e.type)||"Memo";case zs:t=e._payload,e=e._init;try{return $h(e(t))}catch{}}return null}function GT(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 $h(t);case 8:return t===Sm?"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 so(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function K0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qT(e){var t=K0(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,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){n=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ac(e){e._valueTracker||(e._valueTracker=qT(e))}function G0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=K0(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Ou(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 Bh(e,t){var r=t.checked;return Mt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function ry(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=so(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 q0(e,t){t=t.checked,t!=null&&bm(e,"checked",t,!1)}function Hh(e,t){q0(e,t);var r=so(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")?Yh(e,t.type,r):t.hasOwnProperty("defaultValue")&&Yh(e,t.type,so(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ny(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 Yh(e,t,r){(t!=="number"||Ou(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Va=Array.isArray;function Oi(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Oc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function pl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ga={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},XT=["Webkit","ms","Moz","O"];Object.keys(Ga).forEach(function(e){XT.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ga[t]=Ga[e]})});function ew(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ga.hasOwnProperty(e)&&Ga[e]?(""+t).trim():t+"px"}function tw(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=ew(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var QT=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 Gh(e,t){if(t){if(QT[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(oe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(oe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(oe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(oe(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 Xh=null;function Em(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qh=null,Mi=null,Ii=null;function iy(e){if(e=sc(e)){if(typeof Qh!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=Fd(t),Qh(e.stateNode,e.type,t))}}function rw(e){Mi?Ii?Ii.push(e):Ii=[e]:Mi=e}function nw(){if(Mi){var e=Mi,t=Ii;if(Ii=Mi=null,iy(e),t)for(e=0;e>>=0,e===0?32:31-(cj(e)/uj|0)|0}var Mc=64,Ic=4194304;function Wa(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 Fu(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,o=e.pingedLanes,i=r&268435455;if(i!==0){var a=i&~s;a!==0?n=Wa(a):(o&=i,o!==0&&(n=Wa(o)))}else i=r&~s,i!==0?n=Wa(i):o!==0&&(n=Wa(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,o=t&-t,s>=o||s===16&&(o&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 rc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-dn(t),e[t]=r}function pj(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=Xa),my=" ",gy=!1;function Sw(e,t){switch(e){case"keyup":return Wj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wi=!1;function Bj(e,t){switch(e){case"compositionend":return kw(t);case"keypress":return t.which!==32?null:(gy=!0,my);case"textInput":return e=t.data,e===my&&gy?null:e;default:return null}}function Hj(e,t){if(wi)return e==="compositionend"||!Om&&Sw(e,t)?(e=_w(),du=Pm=Bs=null,wi=!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=wy(r)}}function jw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?jw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nw(){for(var e=window,t=Ou();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ou(e.document)}return t}function Mm(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 eN(e){var t=Nw(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&jw(r.ownerDocument.documentElement,r)){if(n!==null&&Mm(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,o=Math.min(n.start,s);n=n.end===void 0?o:Math.min(n.end,s),!e.extend&&o>n&&(s=n,n=o,o=s),s=_y(r,o);var i=_y(r,n);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.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,_i=null,sp=null,Ja=null,op=!1;function by(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;op||_i==null||_i!==Ou(n)||(n=_i,"selectionStart"in n&&Mm(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}),Ja&&wl(Ja,n)||(Ja=n,n=Vu(sp,"onSelect"),0ki||(e.current=dp[ki],dp[ki]=null,ki--)}function yt(e,t){ki++,dp[ki]=e.current,e.current=t}var oo={},lr=go(oo),Sr=go(!1),Fo=oo;function qi(e,t){var r=e.type.contextTypes;if(!r)return oo;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in r)s[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function kr(e){return e=e.childContextTypes,e!=null}function $u(){_t(Sr),_t(lr)}function Ny(e,t,r){if(lr.current!==oo)throw Error(oe(168));yt(lr,t),yt(Sr,r)}function Fw(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(oe(108,GT(e)||"Unknown",s));return Mt({},r,n)}function Bu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||oo,Fo=lr.current,yt(lr,e),yt(Sr,Sr.current),!0}function Ry(e,t,r){var n=e.stateNode;if(!n)throw Error(oe(169));r?(e=Fw(e,t,Fo),n.__reactInternalMemoizedMergedChildContext=e,_t(Sr),_t(lr),yt(lr,e)):_t(Sr),yt(Sr,r)}var os=null,zd=!1,oh=!1;function zw(e){os===null?os=[e]:os.push(e)}function fN(e){zd=!0,zw(e)}function vo(){if(!oh&&os!==null){oh=!0;var e=0,t=ht;try{var r=os;for(ht=1;e>=i,s-=i,is=1<<32-dn(t)+s|r<D?(P=R,R=null):P=R.sibling;var L=p(v,R,_[D],C);if(L===null){R===null&&(R=P);break}e&&R&&L.alternate===null&&t(v,R),h=o(L,h,D),T===null?E=L:T.sibling=L,T=L,R=P}if(D===_.length)return r(v,R),jt&&bo(v,D),E;if(R===null){for(;D<_.length;D++)R=f(v,_[D],C),R!==null&&(h=o(R,h,D),T===null?E=R:T.sibling=R,T=R);return jt&&bo(v,D),E}for(R=n(v,R);D<_.length;D++)P=m(R,v,D,_[D],C),P!==null&&(e&&P.alternate!==null&&R.delete(P.key===null?D:P.key),h=o(P,h,D),T===null?E=P:T.sibling=P,T=P);return e&&R.forEach(function(q){return t(v,q)}),jt&&bo(v,D),E}function g(v,h,_,C){var E=ka(_);if(typeof E!="function")throw Error(oe(150));if(_=E.call(_),_==null)throw Error(oe(151));for(var T=E=null,R=h,D=h=0,P=null,L=_.next();R!==null&&!L.done;D++,L=_.next()){R.index>D?(P=R,R=null):P=R.sibling;var q=p(v,R,L.value,C);if(q===null){R===null&&(R=P);break}e&&R&&q.alternate===null&&t(v,R),h=o(q,h,D),T===null?E=q:T.sibling=q,T=q,R=P}if(L.done)return r(v,R),jt&&bo(v,D),E;if(R===null){for(;!L.done;D++,L=_.next())L=f(v,L.value,C),L!==null&&(h=o(L,h,D),T===null?E=L:T.sibling=L,T=L);return jt&&bo(v,D),E}for(R=n(v,R);!L.done;D++,L=_.next())L=m(R,v,D,L.value,C),L!==null&&(e&&L.alternate!==null&&R.delete(L.key===null?D:L.key),h=o(L,h,D),T===null?E=L:T.sibling=L,T=L);return e&&R.forEach(function(j){return t(v,j)}),jt&&bo(v,D),E}function w(v,h,_,C){if(typeof _=="object"&&_!==null&&_.type===xi&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Dc:e:{for(var E=_.key,T=h;T!==null;){if(T.key===E){if(E=_.type,E===xi){if(T.tag===7){r(v,T.sibling),h=s(T,_.props.children),h.return=v,v=h;break e}}else if(T.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===zs&&Ay(E)===T.type){r(v,T.sibling),h=s(T,_.props),h.ref=Na(v,T,_),h.return=v,v=h;break e}r(v,T);break}else t(v,T);T=T.sibling}_.type===xi?(h=Oo(_.props.children,v.mode,C,_.key),h.return=v,v=h):(C=xu(_.type,_.key,_.props,null,v.mode,C),C.ref=Na(v,h,_),C.return=v,v=C)}return i(v);case yi:e:{for(T=_.key;h!==null;){if(h.key===T)if(h.tag===4&&h.stateNode.containerInfo===_.containerInfo&&h.stateNode.implementation===_.implementation){r(v,h.sibling),h=s(h,_.children||[]),h.return=v,v=h;break e}else{r(v,h);break}else t(v,h);h=h.sibling}h=hh(_,v.mode,C),h.return=v,v=h}return i(v);case zs:return T=_._init,w(v,h,T(_._payload),C)}if(Va(_))return x(v,h,_,C);if(ka(_))return g(v,h,_,C);$c(v,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,h!==null&&h.tag===6?(r(v,h.sibling),h=s(h,_),h.return=v,v=h):(r(v,h),h=fh(_,v.mode,C),h.return=v,v=h),i(v)):r(v,h)}return w}var Qi=$w(!0),Bw=$w(!1),Zu=go(null),Ku=null,Ti=null,zm=null;function Um(){zm=Ti=Ku=null}function Vm(e){var t=Zu.current;_t(Zu),e._currentValue=t}function pp(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 Fi(e,t){Ku=e,zm=Ti=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(zm!==e)if(e={context:e,memoizedValue:t,next:null},Ti===null){if(Ku===null)throw Error(oe(308));Ti=e,Ku.dependencies={lanes:0,firstContext:e}}else Ti=Ti.next=e;return t}var Eo=null;function Wm(e){Eo===null?Eo=[e]:Eo.push(e)}function Hw(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Wm(t)):(r.next=s.next,s.next=r),t.interleaved=r,gs(e,n)}function gs(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 $m(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Yw(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 us(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,it&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,gs(e,r)}return s=n.interleaved,s===null?(t.next=t,Wm(n)):(t.next=s.next,s.next=t),n.interleaved=t,gs(e,r)}function hu(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,jm(e,r)}}function Oy(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var i={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?s=o=i:o=o.next=i,r=r.next}while(r!==null);o===null?s=o=t:o=o.next=t}else s=o=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:o,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 Gu(e,t,r,n){var s=e.updateQueue;Us=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,u=l.next;l.next=null,i===null?o=u:i.next=u,i=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==i&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(o!==null){var f=s.baseState;i=0,d=u=l=null,a=o;do{var p=a.lane,m=a.eventTime;if((n&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=e,g=a;switch(p=t,m=r,g.tag){case 1:if(x=g.payload,typeof x=="function"){f=x.call(m,f,p);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=g.payload,p=typeof x=="function"?x.call(m,f,p):x,p==null)break e;f=Mt({},f,p);break e;case 2:Us=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=s.effects,p===null?s.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=m,l=f):d=d.next=m,i|=p;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;p=a,a=p.next,p.next=null,s.lastBaseUpdate=p,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 i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Vo|=i,e.lanes=i,e.memoizedState=f}}function My(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=ah.transition;ah.transition={};try{e(!1),t()}finally{ht=r,ah.transition=n}}function c_(){return Xr().memoizedState}function gN(e,t,r){var n=to(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},u_(e))d_(t,r);else if(r=Hw(e,t,r,n),r!==null){var s=pr();fn(r,e,n,s),f_(r,t,n)}}function vN(e,t,r){var n=to(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(u_(e))d_(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,r);if(s.hasEagerState=!0,s.eagerState=a,pn(a,i)){var l=t.interleaved;l===null?(s.next=s,Wm(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}r=Hw(e,t,s,n),r!==null&&(s=pr(),fn(r,e,n,s),f_(r,t,n))}}function u_(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function d_(e,t){el=Xu=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function f_(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,jm(e,r)}}var Qu={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},yN={readContext:qr,useCallback:function(e,t){return En().memoizedState=[e,t===void 0?null:t],e},useContext:qr,useEffect:Ly,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,mu(4194308,4,s_.bind(null,t,e),r)},useLayoutEffect:function(e,t){return mu(4194308,4,e,t)},useInsertionEffect:function(e,t){return mu(4,2,e,t)},useMemo:function(e,t){var r=En();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=En();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=gN.bind(null,Ot,e),[n.memoizedState,e]},useRef:function(e){var t=En();return e={current:e},t.memoizedState=e},useState:Iy,useDebugValue:Xm,useDeferredValue:function(e){return En().memoizedState=e},useTransition:function(){var e=Iy(!1),t=e[0];return e=mN.bind(null,e[1]),En().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ot,s=En();if(jt){if(r===void 0)throw Error(oe(407));r=r()}else{if(r=t(),Qt===null)throw Error(oe(349));Uo&30||qw(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,Ly(Qw.bind(null,n,o,e),[e]),n.flags|=2048,jl(9,Xw.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=En(),t=Qt.identifierPrefix;if(jt){var r=as,n=is;r=(n&~(1<<32-dn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=El++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=i.createElement(r,{is:n.is}):(e=i.createElement(r),r==="select"&&(i=e,n.multiple?i.multiple=!0:n.size&&(i.size=n.size))):e=i.createElementNS(e,r),e[Tn]=t,e[Sl]=n,b_(e,t,!1,!1),t.stateNode=e;e:{switch(i=qh(r,n),r){case"dialog":wt("cancel",e),wt("close",e),s=n;break;case"iframe":case"object":case"embed":wt("load",e),s=n;break;case"video":case"audio":for(s=0;s<$a.length;s++)wt($a[s],e);s=n;break;case"source":wt("error",e),s=n;break;case"img":case"image":case"link":wt("error",e),wt("load",e),s=n;break;case"details":wt("toggle",e),s=n;break;case"input":ry(e,n),s=Bh(e,n),wt("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=Mt({},n,{value:void 0}),wt("invalid",e);break;case"textarea":sy(e,n),s=Zh(e,n),wt("invalid",e);break;default:s=n}Gh(r,s),a=s;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?tw(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&J0(e,l)):o==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&pl(e,l):typeof l=="number"&&pl(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(hl.hasOwnProperty(o)?l!=null&&o==="onScroll"&&wt("scroll",e):l!=null&&bm(e,o,l,i))}switch(r){case"input":Ac(e),ny(e,n,!1);break;case"textarea":Ac(e),oy(e);break;case"option":n.value!=null&&e.setAttribute("value",""+so(n.value));break;case"select":e.multiple=!!n.multiple,o=n.value,o!=null?Oi(e,!!n.multiple,o,!1):n.defaultValue!=null&&Oi(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Wu)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return or(t),null;case 6:if(e&&t.stateNode!=null)k_(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(oe(166));if(r=To(Cl.current),To(On.current),Wc(t)){if(n=t.stateNode,r=t.memoizedProps,n[Tn]=t,(o=n.nodeValue!==r)&&(e=Or,e!==null))switch(e.tag){case 3:Vc(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Vc(n.nodeValue,r,(e.mode&1)!==0)}o&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Tn]=t,t.stateNode=n}return or(t),null;case 13:if(_t(Dt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(jt&&Ar!==null&&t.mode&1&&!(t.flags&128))Ww(),Xi(),t.flags|=98560,o=!1;else if(o=Wc(t),n!==null&&n.dehydrated!==null){if(e===null){if(!o)throw Error(oe(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(oe(317));o[Tn]=t}else Xi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;or(t),o=!1}else an!==null&&(Rp(an),an=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Dt.current&1?Kt===0&&(Kt=3):sg())),t.updateQueue!==null&&(t.flags|=4),or(t),null);case 4:return Ji(),bp(e,t),e===null&&_l(t.stateNode.containerInfo),or(t),null;case 10:return Vm(t.type._context),or(t),null;case 17:return kr(t.type)&&$u(),or(t),null;case 19:if(_t(Dt),o=t.memoizedState,o===null)return or(t),null;if(n=(t.flags&128)!==0,i=o.rendering,i===null)if(n)Ra(o,!1);else{if(Kt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=qu(e),i!==null){for(t.flags|=128,Ra(o,!1),n=i.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)o=r,e=n,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return yt(Dt,Dt.current&1|2),t.child}e=e.sibling}o.tail!==null&&Ut()>ta&&(t.flags|=128,n=!0,Ra(o,!1),t.lanes=4194304)}else{if(!n)if(e=qu(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ra(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!jt)return or(t),null}else 2*Ut()-o.renderingStartTime>ta&&r!==1073741824&&(t.flags|=128,n=!0,Ra(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(r=o.last,r!==null?r.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ut(),t.sibling=null,r=Dt.current,yt(Dt,n?r&1|2:r&1),t):(or(t),null);case 22:case 23:return ng(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Rr&1073741824&&(or(t),t.subtreeFlags&6&&(t.flags|=8192)):or(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function EN(e,t){switch(Lm(t),t.tag){case 1:return kr(t.type)&&$u(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ji(),_t(Sr),_t(lr),Ym(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Hm(t),null;case 13:if(_t(Dt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));Xi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _t(Dt),null;case 4:return Ji(),null;case 10:return Vm(t.type._context),null;case 22:case 23:return ng(),null;case 24:return null;default:return null}}var Hc=!1,ir=!1,TN=typeof WeakSet=="function"?WeakSet:Set,_e=null;function ji(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 Sp(e,t,r){try{r()}catch(n){Lt(e,t,n)}}var Ky=!1;function jN(e,t){if(ip=zu,e=Nw(),Mm(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,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var i=0,a=-1,l=-1,u=0,d=0,f=e,p=null;t:for(;;){for(var m;f!==r||s!==0&&f.nodeType!==3||(a=i+s),f!==o||n!==0&&f.nodeType!==3||(l=i+n),f.nodeType===3&&(i+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break t;if(p===r&&++u===s&&(a=i),p===o&&++d===n&&(l=i),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(ap={focusedElem:e,selectionRange:r},zu=!1,_e=t;_e!==null;)if(t=_e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_e=e;else for(;_e!==null;){t=_e;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var g=x.memoizedProps,w=x.memoizedState,v=t.stateNode,h=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:nn(t.type,g),w);v.__reactInternalSnapshotBeforeUpdate=h}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(oe(163))}}catch(C){Lt(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,_e=e;break}_e=t.return}return x=Ky,Ky=!1,x}function tl(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 o=s.destroy;s.destroy=void 0,o!==void 0&&Sp(t,r,o)}s=s.next}while(s!==n)}}function Wd(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 kp(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 C_(e){var t=e.alternate;t!==null&&(e.alternate=null,C_(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Tn],delete t[Sl],delete t[up],delete t[uN],delete t[dN])),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 E_(e){return e.tag===5||e.tag===3||e.tag===4}function Gy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||E_(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 Cp(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=Wu));else if(n!==4&&(e=e.child,e!==null))for(Cp(e,t,r),e=e.sibling;e!==null;)Cp(e,t,r),e=e.sibling}function Ep(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(Ep(e,t,r),e=e.sibling;e!==null;)Ep(e,t,r),e=e.sibling}var er=null,sn=!1;function Os(e,t,r){for(r=r.child;r!==null;)T_(e,t,r),r=r.sibling}function T_(e,t,r){if(An&&typeof An.onCommitFiberUnmount=="function")try{An.onCommitFiberUnmount(Od,r)}catch{}switch(r.tag){case 5:ir||ji(r,t);case 6:var n=er,s=sn;er=null,Os(e,t,r),er=n,sn=s,er!==null&&(sn?(e=er,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):er.removeChild(r.stateNode));break;case 18:er!==null&&(sn?(e=er,r=r.stateNode,e.nodeType===8?sh(e.parentNode,r):e.nodeType===1&&sh(e,r),yl(e)):sh(er,r.stateNode));break;case 4:n=er,s=sn,er=r.stateNode.containerInfo,sn=!0,Os(e,t,r),er=n,sn=s;break;case 0:case 11:case 14:case 15:if(!ir&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Sp(r,t,i),s=s.next}while(s!==n)}Os(e,t,r);break;case 1:if(!ir&&(ji(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?(ir=(n=ir)||r.memoizedState!==null,Os(e,t,r),ir=n):Os(e,t,r);break;default:Os(e,t,r)}}function qy(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new TN),t.forEach(function(n){var s=LN.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function rn(e,t){var r=t.deletions;if(r!==null)for(var n=0;ns&&(s=i),n&=~o}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*RN(n/1960))-n,10e?16:e,Hs===null)var n=!1;else{if(e=Hs,Hs=null,td=0,it&6)throw Error(oe(331));var s=it;for(it|=4,_e=e.current;_e!==null;){var o=_e,i=o.child;if(_e.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lUt()-tg?Ao(e,0):eg|=r),Cr(e,t)}function M_(e,t){t===0&&(e.mode&1?(t=Ic,Ic<<=1,!(Ic&130023424)&&(Ic=4194304)):t=1);var r=pr();e=gs(e,t),e!==null&&(rc(e,t,r),Cr(e,r))}function IN(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),M_(e,r)}function LN(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(oe(314))}n!==null&&n.delete(t),M_(e,r)}var I_;I_=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,kN(e,t,r);br=!!(e.flags&131072)}else br=!1,jt&&t.flags&1048576&&Uw(t,Yu,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;gu(e,t),e=t.pendingProps;var s=qi(t,lr.current);Fi(t,r),s=Km(null,t,n,e,s,r);var o=Gm();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)?(o=!0,Bu(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,$m(t),s.updater=Vd,t.stateNode=s,s._reactInternals=t,gp(t,n,e,r),t=xp(null,t,n,!0,o,r)):(t.tag=0,jt&&o&&Im(t),fr(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(gu(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=zN(n),e=nn(n,e),s){case 0:t=yp(null,t,n,e,r);break e;case 1:t=Hy(null,t,n,e,r);break e;case 11:t=$y(null,t,n,e,r);break e;case 14:t=By(null,t,n,nn(n.type,e),r);break e}throw Error(oe(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:nn(n,s),yp(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:nn(n,s),Hy(e,t,n,s,r);case 3:e:{if(x_(t),e===null)throw Error(oe(387));n=t.pendingProps,o=t.memoizedState,s=o.element,Yw(e,t),Gu(t,n,null,r);var i=t.memoizedState;if(n=i.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=ea(Error(oe(423)),t),t=Yy(e,t,n,r,s);break e}else if(n!==s){s=ea(Error(oe(424)),t),t=Yy(e,t,n,r,s);break e}else for(Ar=Qs(t.stateNode.containerInfo.firstChild),Or=t,jt=!0,an=null,r=Bw(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Xi(),n===s){t=vs(e,t,r);break e}fr(e,t,n,r)}t=t.child}return t;case 5:return Zw(t),e===null&&hp(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,lp(n,s)?i=null:o!==null&&lp(n,o)&&(t.flags|=32),y_(e,t),fr(e,t,i,r),t.child;case 6:return e===null&&hp(t),null;case 13:return w_(e,t,r);case 4:return Bm(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Qi(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:nn(n,s),$y(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,o=t.memoizedProps,i=s.value,yt(Zu,n._currentValue),n._currentValue=i,o!==null)if(pn(o.value,i)){if(o.children===s.children&&!Sr.current){t=vs(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(o.tag===1){l=us(-1,r&-r),l.tag=2;var u=o.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}}o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),pp(o.return,r,t),a.lanes|=r;break}l=l.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(oe(341));i.lanes|=r,a=i.alternate,a!==null&&(a.lanes|=r),pp(i,r,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}fr(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Fi(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=nn(n,t.pendingProps),s=nn(n.type,s),By(e,t,n,s,r);case 15:return g_(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:nn(n,s),gu(e,t),t.tag=1,kr(n)?(e=!0,Bu(t)):e=!1,Fi(t,r),h_(t,n,s),gp(t,n,s,r),xp(null,t,n,!0,e,r);case 19:return __(e,t,r);case 22:return v_(e,t,r)}throw Error(oe(156,t.tag))};function L_(e,t){return uw(e,t)}function FN(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 FN(e,t,r,n)}function og(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zN(e){if(typeof e=="function")return og(e)?1:0;if(e!=null){if(e=e.$$typeof,e===km)return 11;if(e===Cm)return 14}return 2}function ro(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 xu(e,t,r,n,s,o){var i=2;if(n=e,typeof e=="function")og(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case xi:return Oo(r.children,s,o,t);case Sm:i=8,s|=8;break;case Uh:return e=Zr(12,r,t,s|2),e.elementType=Uh,e.lanes=o,e;case Vh:return e=Zr(13,r,t,s),e.elementType=Vh,e.lanes=o,e;case Wh:return e=Zr(19,r,t,s),e.elementType=Wh,e.lanes=o,e;case Z0:return Bd(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H0:i=10;break e;case Y0:i=9;break e;case km:i=11;break e;case Cm:i=14;break e;case zs:i=16,n=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=Zr(i,r,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function Oo(e,t,r,n){return e=Zr(7,e,n,t),e.lanes=r,e}function Bd(e,t,r,n){return e=Zr(22,e,n,t),e.elementType=Z0,e.lanes=r,e.stateNode={isHidden:!1},e}function fh(e,t,r){return e=Zr(6,e,null,t),e.lanes=r,e}function hh(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 UN(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=Zf(0),this.expirationTimes=Zf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zf(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function ig(e,t,r,n,s,o,i,a,l){return e=new UN(e,t,r,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Zr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},$m(o),e}function VN(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(V_)}catch(e){console.error(e)}}V_(),V0.exports=zr;var ks=V0.exports;const W_=mm(ks),YN=j0({__proto__:null,default:W_},[ks]);var sx=ks;Fh.createRoot=sx.createRoot,Fh.hydrateRoot=sx.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 $o(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function KN(){return Math.random().toString(36).substr(2,8)}function ix(e,t){return{usr:e.state,key:e.key,idx:t}}function Rl(e,t,r,n){return r===void 0&&(r=null),Pt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Cs(t):t,{state:r,key:t&&t.key||n||KN()})}function Bo(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 Cs(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 GN(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:o=!1}=n,i=s.history,a=Wt.Pop,l=null,u=d();u==null&&(u=0,i.replaceState(Pt({},i.state,{idx:u}),""));function d(){return(i.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:g.location,delta:v})}function p(w,v){a=Wt.Push;let h=Rl(g.location,w,v);r&&r(h,w),u=d()+1;let _=ix(h,u),C=g.createHref(h);try{i.pushState(_,"",C)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(C)}o&&l&&l({action:a,location:g.location,delta:1})}function m(w,v){a=Wt.Replace;let h=Rl(g.location,w,v);r&&r(h,w),u=d();let _=ix(h,u),C=g.createHref(h);i.replaceState(_,"",C),o&&l&&l({action:a,location:g.location,delta:0})}function x(w){let v=s.location.origin!=="null"?s.location.origin:s.location.href,h=typeof w=="string"?w:Bo(w);return h=h.replace(/ $/,"%20"),Qe(v,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,v)}let g={get action(){return a},get location(){return e(s,i)},listen(w){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(ox,f),l=w,()=>{s.removeEventListener(ox,f),l=null}},createHref(w){return t(s,w)},createURL:x,encodeLocation(w){let v=x(w);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:m,go(w){return i.go(w)}};return g}var vt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(vt||(vt={}));const qN=new Set(["lazy","caseSensitive","path","id","index","children"]);function XN(e){return e.index===!0}function Pl(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((s,o)=>{let i=[...r,String(o)],a=typeof s.id=="string"?s.id:i.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`),XN(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=Pl(s.children,t,i,n)),l}})}function ko(e,t,r){return r===void 0&&(r="/"),wu(e,t,r,!1)}function wu(e,t,r,n){let s=typeof t=="string"?Cs(t):t,o=fa(s.pathname||"/",r);if(o==null)return null;let i=$_(e);JN(i);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};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=ds([n,l.relativePath]),d=r.concat(l);o.children&&o.children.length>0&&(Qe(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),$_(o.children,t,d,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:i2(u,o.index),routesMeta:d})};return e.forEach((o,i)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))s(o,i);else for(let l of B_(o.path))s(o,i,l)}),t}function B_(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return s?[o,""]:[o];let i=B_(n.join("/")),a=[];return a.push(...i.map(l=>l===""?o:[o,l].join("/"))),s&&a.push(...i),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function JN(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:a2(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const e2=/^:[\w-]+$/,t2=3,r2=2,n2=1,s2=10,o2=-2,ax=e=>e==="*";function i2(e,t){let r=e.split("/"),n=r.length;return r.some(ax)&&(n+=o2),t&&(n+=r2),r.filter(s=>!ax(s)).reduce((s,o)=>s+(e2.test(o)?t2:o===""?n2:s2),n)}function a2(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 l2(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,s={},o="/",i=[];for(let a=0;a{let{paramName:p,isOptional:m}=d;if(p==="*"){let g=a[f]||"";i=o.slice(0,o.length-g.length).replace(/(.)\/+$/,"$1")}const x=a[f];return m&&!x?u[p]=void 0:u[p]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function c2(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),$o(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,(i,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 u2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return $o(!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 fa(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 d2(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?Cs(e):e;return{pathname:r?r.startsWith("/")?r:f2(r,t):t,search:p2(n),hash:m2(s)}}function f2(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 ph(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 H_(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Gd(e,t){let r=H_(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function qd(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=Cs(e):(s=Pt({},e),Qe(!s.pathname||!s.pathname.includes("?"),ph("?","pathname","search",s)),Qe(!s.pathname||!s.pathname.includes("#"),ph("#","pathname","hash",s)),Qe(!s.search||!s.search.includes("#"),ph("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,a;if(i==null)a=r;else{let f=t.length-1;if(!n&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),f-=1;s.pathname=p.join("/")}a=f>=0?t[f]:"/"}let l=d2(s,a),u=i&&i!=="/"&&i.endsWith("/"),d=(o||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const ds=e=>e.join("/").replace(/\/\/+/g,"/"),h2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),p2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,m2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class ug{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 Xd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Y_=["post","put","patch","delete"],g2=new Set(Y_),v2=["get",...Y_],y2=new Set(v2),x2=new Set([301,302,303,307,308]),w2=new Set([307,308]),mh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},_2={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Da={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},dg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,b2=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Z_="remix-router-transitions";function S2(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=b2;let o={},i=Pl(e.routes,s,void 0,o),a,l=e.basename||"/",u=e.unstable_dataStrategy||j2,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),p=null,m=new Set,x=null,g=null,w=null,v=e.hydrationData!=null,h=ko(i,e.history.location,l),_=null;if(h==null&&!d){let U=ur(404,{pathname:e.history.location.pathname}),{matches:B,route:G}=yx(i);h=B,_={[G.id]:U}}h&&d&&!e.hydrationData&&Vf(h,i,e.history.location.pathname).active&&(h=null);let C;if(!h)C=!1,h=[];else if(h.some(U=>U.route.lazy))C=!1;else if(!h.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=h.findIndex(ye=>B[ye.route.id]!==void 0);C=h.slice(0,re+1).every(G)}else C=h.every(G)}else C=e.hydrationData!=null;let E,T={historyAction:e.history.action,location:e.history.location,matches:h,initialized:C,navigation:mh,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,j=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,Te=new Map,fe=new Map,ve=!1;function be(){if(p=e.history.listen(U=>{let{action:B,location:G,delta:re}=U;if(ve){ve=!1;return}$o(Te.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=Cc({currentLocation:T.location,nextLocation:G,historyAction:B});if(ye&&re!=null){ve=!0,e.history.go(re*-1),si(ye,{state:"blocked",location:G,proceed(){si(ye,{state:"proceeding",proceed:void 0,reset:void 0,location:G}),e.history.go(re)},reset(){let Ce=new Map(T.blockers);Ce.set(ye,Da),ke({blockers:Ce})}});return}return K(B,G)}),r){V2(t,q);let U=()=>W2(t,q);t.addEventListener("pagehide",U),j=()=>t.removeEventListener("pagehide",U)}return T.initialized||K(Wt.Pop,T.location,{initialHydration:!0}),E}function Pe(){p&&p(),j&&j(),m.clear(),P&&P.abort(),T.fetchers.forEach((U,B)=>Bt(B)),T.blockers.forEach((U,B)=>kc(B))}function je(U){return m.add(U),()=>m.delete(U)}function ke(U,B){B===void 0&&(B={}),T=Pt({},T,U);let G=[],re=[];f.v7_fetcherPersist&&T.fetchers.forEach((ye,Ce)=>{ye.state==="idle"&&(ne.has(Ce)?re.push(Ce):G.push(Ce))}),[...m].forEach(ye=>ye(T,{deletedFetchers:re,unstable_viewTransitionOpts:B.viewTransitionOpts,unstable_flushSync:B.flushSync===!0})),f.v7_fetcherPersist&&(G.forEach(ye=>T.fetchers.delete(ye)),re.forEach(ye=>Bt(ye)))}function rt(U,B,G){var re,ye;let{flushSync:Ce}=G===void 0?{}:G,Ue=T.actionData!=null&&T.navigation.formMethod!=null&&on(T.navigation.formMethod)&&T.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:Ue?ce=T.actionData:ce=null;let Ye=B.loaderData?gx(T.loaderData,B.loaderData,B.matches||[],B.errors):T.loaderData,Re=T.blockers;Re.size>0&&(Re=new Map(Re),Re.forEach((dt,gt)=>Re.set(gt,Da)));let De=D===!0||T.navigation.formMethod!=null&&on(T.navigation.formMethod)&&((ye=U.state)==null?void 0:ye._isRedirect)!==!0;a&&(i=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 dt=q.get(T.location.pathname);dt&&dt.has(U.pathname)?pt={currentLocation:T.location,nextLocation:U}:q.has(U.pathname)&&(pt={currentLocation:U,nextLocation:T.location})}else if(L){let dt=q.get(T.location.pathname);dt?dt.add(U.pathname):(dt=new Set([U.pathname]),q.set(T.location.pathname,dt)),pt={currentLocation:T.location,nextLocation:U}}ke(Pt({},B,{actionData:ce,loaderData:Ye,historyAction:R,location:U,initialized:!0,navigation:mh,revalidation:"idle",restoreScrollPosition:Kv(U,B.matches||T.matches),preventScrollReset:De,blockers:Re}),{viewTransitionOpts:pt,flushSync:Ce===!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=Pp(T.location,T.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:Ce}=cx(f.v7_normalizeFormMethod,!1,G,B),Ue=T.location,ce=Rl(T.location,re,B&&B.state);ce=Pt({},ce,e.history.encodeLocation(ce));let Ye=B&&B.replace!=null?B.replace:void 0,Re=Wt.Push;Ye===!0?Re=Wt.Replace:Ye===!1||ye!=null&&on(ye.formMethod)&&ye.formAction===T.location.pathname+T.location.search&&(Re=Wt.Replace);let De=B&&"preventScrollReset"in B?B.preventScrollReset===!0:void 0,pt=(B&&B.unstable_flushSync)===!0,dt=Cc({currentLocation:Ue,nextLocation:ce,historyAction:Re});if(dt){si(dt,{state:"blocked",location:ce,proceed(){si(dt,{state:"proceeding",proceed:void 0,reset:void 0,location:ce}),k(U,B)},reset(){let gt=new Map(T.blockers);gt.set(dt,Da),ke({blockers:gt})}});return}return await K(Re,ce,{submission:ye,pendingError:Ce,preventScrollReset:De,replace:B&&B.replace,enableViewTransition:B&&B.unstable_viewTransition,flushSync:pt})}function J(){if(Be(),ke({revalidation:"loading"}),T.navigation.state!=="submitting"){if(T.navigation.state==="idle"){K(T.historyAction,T.location,{startUninterruptedRevalidation:!0});return}K(R||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation})}}async function K(U,B,G){P&&P.abort(),P=null,R=U,F=(G&&G.startUninterruptedRevalidation)===!0,gT(T.location,T.matches),D=(G&&G.preventScrollReset)===!0,L=(G&&G.enableViewTransition)===!0;let re=a||i,ye=G&&G.overrideNavigation,Ce=ko(re,B,l),Ue=(G&&G.flushSync)===!0,ce=Vf(Ce,re,B.pathname);if(ce.active&&ce.matches&&(Ce=ce.matches),!Ce){let{error:ct,notFoundMatches:Jt,route:Vt}=oi(B.pathname);rt(B,{matches:Jt,loaderData:{},errors:{[Vt.id]:ct}},{flushSync:Ue});return}if(T.initialized&&!b&&O2(T.location,B)&&!(G&&G.submission&&on(G.submission.formMethod))){rt(B,{matches:Ce},{flushSync:Ue});return}P=new AbortController;let Ye=ui(e.history,B,P.signal,G&&G.submission),Re;if(G&&G.pendingError)Re=[Ri(Ce).route.id,{type:vt.error,error:G.pendingError}];else if(G&&G.submission&&on(G.submission.formMethod)){let ct=await A(Ye,B,G.submission,Ce,ce.active,{replace:G.replace,flushSync:Ue});if(ct.shortCircuited)return;if(ct.pendingActionResult){let[Jt,Vt]=ct.pendingActionResult;if(Pr(Vt)&&Xd(Vt.error)&&Vt.error.status===404){P=null,rt(B,{matches:ct.matches,loaderData:{},errors:{[Jt]:Vt.error}});return}}Ce=ct.matches||Ce,Re=ct.pendingActionResult,ye=gh(B,G.submission),Ue=!1,ce.active=!1,Ye=ui(e.history,Ye.url,Ye.signal)}let{shortCircuited:De,matches:pt,loaderData:dt,errors:gt}=await S(Ye,B,Ce,ce.active,ye,G&&G.submission,G&&G.fetcherSubmission,G&&G.replace,G&&G.initialHydration===!0,Ue,Re);De||(P=null,rt(B,Pt({matches:pt||Ce},vx(Re),{loaderData:dt,errors:gt})))}async function A(U,B,G,re,ye,Ce){Ce===void 0&&(Ce={}),Be();let Ue=z2(B,G);if(ke({navigation:Ue},{flushSync:Ce.flushSync===!0}),ye){let Re=await Ec(re,B.pathname,U.signal);if(Re.type==="aborted")return{shortCircuited:!0};if(Re.type==="error"){let{boundaryId:De,error:pt}=Sn(B.pathname,Re);return{matches:Re.partialMatches,pendingActionResult:[De,{type:vt.error,error:pt}]}}else if(Re.matches)re=Re.matches;else{let{notFoundMatches:De,error:pt,route:dt}=oi(B.pathname);return{matches:De,pendingActionResult:[dt.id,{type:vt.error,error:pt}]}}}let ce,Ye=Ba(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(No(ce)){let Re;return Ce&&Ce.replace!=null?Re=Ce.replace:Re=hx(ce.response.headers.get("Location"),new URL(U.url),l)===T.location.pathname+T.location.search,await X(U,ce,{submission:G,replace:Re}),{shortCircuited:!0}}if(jo(ce))throw ur(400,{type:"defer-action"});if(Pr(ce)){let Re=Ri(re,Ye.route.id);return(Ce&&Ce.replace)!==!0&&(R=Wt.Push),{matches:re,pendingActionResult:[Re.route.id,ce]}}return{matches:re,pendingActionResult:[Ye.route.id,ce]}}async function S(U,B,G,re,ye,Ce,Ue,ce,Ye,Re,De){let pt=ye||gh(B,Ce),dt=Ce||Ue||_x(pt),gt=!F&&(!f.v7_partialHydration||!Ye);if(re){if(gt){let It=N(De);ke(Pt({navigation:pt},It!==void 0?{actionData:It}:{}),{flushSync:Re})}let Ge=await Ec(G,B.pathname,U.signal);if(Ge.type==="aborted")return{shortCircuited:!0};if(Ge.type==="error"){let{boundaryId:It,error:Tr}=Sn(B.pathname,Ge);return{matches:Ge.partialMatches,loaderData:{},errors:{[It]:Tr}}}else if(Ge.matches)G=Ge.matches;else{let{error:It,notFoundMatches:Tr,route:Et}=oi(B.pathname);return{matches:Tr,loaderData:{},errors:{[Et.id]:It}}}}let ct=a||i,[Jt,Vt]=ux(e.history,T,G,dt,B,f.v7_partialHydration&&Ye===!0,f.v7_skipActionErrorRevalidation,b,W,te,ne,V,z,ct,l,De);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=qn();return rt(B,Pt({matches:G,loaderData:{},errors:De&&Pr(De[1])?{[De[0]]:De[1].error}:null},vx(De),Ge?{fetchers:new Map(T.fetchers)}:{}),{flushSync:Re}),{shortCircuited:!0}}if(gt){let Ge={};if(!re){Ge.navigation=pt;let It=N(De);It!==void 0&&(Ge.actionData=It)}Vt.length>0&&(Ge.fetchers=O(Vt)),ke(Ge,{flushSync:Re})}Vt.forEach(Ge=>{$.has(Ge.key)&&ot(Ge.key),Ge.controller&&$.set(Ge.key,Ge.controller)});let Sa=()=>Vt.forEach(Ge=>ot(Ge.key));P&&P.signal.addEventListener("abort",Sa);let{loaderResults:As,fetcherResults:ii}=await he(T.matches,G,Jt,Vt,U);if(U.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",Sa),Vt.forEach(Ge=>$.delete(Ge.key));let ai=xx([...As,...ii]);if(ai){if(ai.idx>=Jt.length){let Ge=Vt[ai.idx-Jt.length].key;z.add(Ge)}return await X(U,ai.result,{replace:ce}),{shortCircuited:!0}}let{loaderData:li,errors:kn}=mx(T,G,Jt,As,De,Vt,ii,se);se.forEach((Ge,It)=>{Ge.subscribe(Tr=>{(Tr||Ge.done)&&se.delete(It)})}),f.v7_partialHydration&&Ye&&T.errors&&Object.entries(T.errors).filter(Ge=>{let[It]=Ge;return!Jt.some(Tr=>Tr.route.id===It)}).forEach(Ge=>{let[It,Tr]=Ge;kn=Object.assign(kn||{},{[It]:Tr})});let Tc=qn(),jc=$r(I),Nc=Tc||jc||Vt.length>0;return Pt({matches:G,loaderData:li,errors:kn},Nc?{fetchers:new Map(T.fetchers)}:{})}function N(U){if(U&&!Pr(U[1]))return{[U[0]]:U[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function O(U){return U.forEach(B=>{let G=T.fetchers.get(B.key),re=Aa(void 0,G?G.data:void 0);T.fetchers.set(B.key,re)}),new Map(T.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)&&ot(U);let ye=(re&&re.unstable_flushSync)===!0,Ce=a||i,Ue=Pp(T.location,T.matches,l,f.v7_prependBasename,G,f.v7_relativeSplatPath,B,re==null?void 0:re.relative),ce=ko(Ce,Ue,l),Ye=Vf(ce,Ce,Ue);if(Ye.active&&Ye.matches&&(ce=Ye.matches),!ce){Ct(U,B,ur(404,{pathname:Ue}),{flushSync:ye});return}let{path:Re,submission:De,error:pt}=cx(f.v7_normalizeFormMethod,!0,Ue,re);if(pt){Ct(U,B,pt,{flushSync:ye});return}let dt=Ba(ce,Re);if(D=(re&&re.preventScrollReset)===!0,De&&on(De.formMethod)){M(U,B,Re,dt,ce,Ye.active,ye,De);return}V.set(U,{routeId:B,path:Re}),H(U,B,Re,dt,ce,Ye.active,ye,De)}async function M(U,B,G,re,ye,Ce,Ue,ce){Be(),V.delete(U);function Ye(Et){if(!Et.route.action&&!Et.route.lazy){let Xn=ur(405,{method:ce.formMethod,pathname:G,routeId:B});return Ct(U,B,Xn,{flushSync:Ue}),!0}return!1}if(!Ce&&Ye(re))return;let Re=T.fetchers.get(U);Oe(U,U2(ce,Re),{flushSync:Ue});let De=new AbortController,pt=ui(e.history,G,De.signal,ce);if(Ce){let Et=await Ec(ye,G,pt.signal);if(Et.type==="aborted")return;if(Et.type==="error"){let{error:Xn}=Sn(G,Et);Ct(U,B,Xn,{flushSync:Ue});return}else if(Et.matches){if(ye=Et.matches,re=Ba(ye,G),Ye(re))return}else{Ct(U,B,ur(404,{pathname:G}),{flushSync:Ue});return}}$.set(U,De);let dt=Z,ct=(await ee("action",pt,[re],ye))[0];if(pt.signal.aborted){$.get(U)===De&&$.delete(U);return}if(f.v7_fetcherPersist&&ne.has(U)){if(No(ct)||Pr(ct)){Oe(U,Ls(void 0));return}}else{if(No(ct))if($.delete(U),I>dt){Oe(U,Ls(void 0));return}else return z.add(U),Oe(U,Aa(ce)),X(pt,ct,{fetcherSubmission:ce});if(Pr(ct)){Ct(U,B,ct.error);return}}if(jo(ct))throw ur(400,{type:"defer-action"});let Jt=T.navigation.location||T.location,Vt=ui(e.history,Jt,De.signal),Sa=a||i,As=T.navigation.state!=="idle"?ko(Sa,T.navigation.location,l):T.matches;Qe(As,"Didn't find any matches after fetcher action");let ii=++Z;Q.set(U,ii);let ai=Aa(ce,ct.data);T.fetchers.set(U,ai);let[li,kn]=ux(e.history,T,As,ce,Jt,!1,f.v7_skipActionErrorRevalidation,b,W,te,ne,V,z,Sa,l,[re.route.id,ct]);kn.filter(Et=>Et.key!==U).forEach(Et=>{let Xn=Et.key,Gv=T.fetchers.get(Xn),xT=Aa(void 0,Gv?Gv.data:void 0);T.fetchers.set(Xn,xT),$.has(Xn)&&ot(Xn),Et.controller&&$.set(Xn,Et.controller)}),ke({fetchers:new Map(T.fetchers)});let Tc=()=>kn.forEach(Et=>ot(Et.key));De.signal.addEventListener("abort",Tc);let{loaderResults:jc,fetcherResults:Nc}=await he(T.matches,As,li,kn,Vt);if(De.signal.aborted)return;De.signal.removeEventListener("abort",Tc),Q.delete(U),$.delete(U),kn.forEach(Et=>$.delete(Et.key));let Ge=xx([...jc,...Nc]);if(Ge){if(Ge.idx>=li.length){let Et=kn[Ge.idx-li.length].key;z.add(Et)}return X(Vt,Ge.result)}let{loaderData:It,errors:Tr}=mx(T,T.matches,li,jc,void 0,kn,Nc,se);if(T.fetchers.has(U)){let Et=Ls(ct.data);T.fetchers.set(U,Et)}$r(ii),T.navigation.state==="loading"&&ii>I?(Qe(R,"Expected pending action"),P&&P.abort(),rt(T.navigation.location,{matches:As,loaderData:It,errors:Tr,fetchers:new Map(T.fetchers)})):(ke({errors:Tr,loaderData:gx(T.loaderData,It,As,Tr),fetchers:new Map(T.fetchers)}),b=!1)}async function H(U,B,G,re,ye,Ce,Ue,ce){let Ye=T.fetchers.get(U);Oe(U,Aa(ce,Ye?Ye.data:void 0),{flushSync:Ue});let Re=new AbortController,De=ui(e.history,G,Re.signal);if(Ce){let ct=await Ec(ye,G,De.signal);if(ct.type==="aborted")return;if(ct.type==="error"){let{error:Jt}=Sn(G,ct);Ct(U,B,Jt,{flushSync:Ue});return}else if(ct.matches)ye=ct.matches,re=Ba(ye,G);else{Ct(U,B,ur(404,{pathname:G}),{flushSync:Ue});return}}$.set(U,Re);let pt=Z,gt=(await ee("loader",De,[re],ye))[0];if(jo(gt)&&(gt=await Q_(gt,De.signal,!0)||gt),$.get(U)===Re&&$.delete(U),!De.signal.aborted){if(ne.has(U)){Oe(U,Ls(void 0));return}if(No(gt))if(I>pt){Oe(U,Ls(void 0));return}else{z.add(U),await X(De,gt);return}if(Pr(gt)){Ct(U,B,gt.error);return}Qe(!jo(gt),"Unhandled fetcher deferred data"),Oe(U,Ls(gt.data))}}async function X(U,B,G){let{submission:re,fetcherSubmission:ye,replace:Ce}=G===void 0?{}:G;B.response.headers.has("X-Remix-Revalidate")&&(b=!0);let Ue=B.response.headers.get("Location");Qe(Ue,"Expected a Location header on the redirect Response"),Ue=hx(Ue,new URL(U.url),l);let ce=Rl(T.location,Ue,{_isRedirect:!0});if(r){let gt=!1;if(B.response.headers.has("X-Remix-Reload-Document"))gt=!0;else if(dg.test(Ue)){const ct=e.history.createURL(Ue);gt=ct.origin!==t.location.origin||fa(ct.pathname,l)==null}if(gt){Ce?t.location.replace(Ue):t.location.assign(Ue);return}}P=null;let Ye=Ce===!0?Wt.Replace:Wt.Push,{formMethod:Re,formAction:De,formEncType:pt}=T.navigation;!re&&!ye&&Re&&De&&pt&&(re=_x(T.navigation));let dt=re||ye;if(w2.has(B.response.status)&&dt&&on(dt.formMethod))await K(Ye,ce,{submission:Pt({},dt,{formAction:Ue}),preventScrollReset:D});else{let gt=gh(ce,re);await K(Ye,ce,{overrideNavigation:gt,fetcherSubmission:ye,preventScrollReset:D})}}async function ee(U,B,G,re){try{let ye=await N2(u,U,B,G,re,o,s);return await Promise.all(ye.map((Ce,Ue)=>{if(I2(Ce)){let ce=Ce.result;return{type:vt.redirect,response:D2(ce,B,G[Ue].route.id,re,l,f.v7_relativeSplatPath)}}return P2(Ce)}))}catch(ye){return G.map(()=>({type:vt.error,error:ye}))}}async function he(U,B,G,re,ye){let[Ce,...Ue]=await Promise.all([G.length?ee("loader",ye,G,B):[],...re.map(ce=>{if(ce.matches&&ce.match&&ce.controller){let Ye=ui(e.history,ce.path,ce.controller.signal);return ee("loader",Ye,[ce.match],ce.matches).then(Re=>Re[0])}else return Promise.resolve({type:vt.error,error:ur(404,{pathname:ce.path})})})]);return await Promise.all([wx(U,G,Ce,Ce.map(()=>ye.signal),!1,T.loaderData),wx(U,re.map(ce=>ce.match),Ue,re.map(ce=>ce.controller?ce.controller.signal:null),!0)]),{loaderResults:Ce,fetcherResults:Ue}}function Be(){b=!0,W.push(...Ds()),V.forEach((U,B)=>{$.has(B)&&(te.push(B),ot(B))})}function Oe(U,B,G){G===void 0&&(G={}),T.fetchers.set(U,B),ke({fetchers:new Map(T.fetchers)},{flushSync:(G&&G.flushSync)===!0})}function Ct(U,B,G,re){re===void 0&&(re={});let ye=Ri(T.matches,B);Bt(U),ke({errors:{[ye.route.id]:G},fetchers:new Map(T.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)),T.fetchers.get(U)||_2}function Bt(U){let B=T.fetchers.get(U);$.has(U)&&!(B&&B.state==="loading"&&Q.has(U))&&ot(U),V.delete(U),Q.delete(U),z.delete(U),ne.delete(U),T.fetchers.delete(U)}function Kn(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);ke({fetchers:new Map(T.fetchers)})}function ot(U){let B=$.get(U);Qe(B,"Expected fetch controller: "+U),B.abort(),$.delete(U)}function Gn(U){for(let B of U){let G=Wr(B),re=Ls(G.data);T.fetchers.set(B,re)}}function qn(){let U=[],B=!1;for(let G of z){let re=T.fetchers.get(G);Qe(re,"Expected fetcher: "+G),re.state==="loading"&&(z.delete(G),U.push(G),B=!0)}return Gn(U),B}function $r(U){let B=[];for(let[G,re]of Q)if(re0}function Sc(U,B){let G=T.blockers.get(U)||Da;return Te.get(U)!==B&&Te.set(U,B),G}function kc(U){T.blockers.delete(U),Te.delete(U)}function si(U,B){let G=T.blockers.get(U)||Da;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(T.blockers);re.set(U,B),ke({blockers:re})}function Cc(U){let{currentLocation:B,nextLocation:G,historyAction:re}=U;if(Te.size===0)return;Te.size>1&&$o(!1,"A router only supports one blocker at a time");let ye=Array.from(Te.entries()),[Ce,Ue]=ye[ye.length-1],ce=T.blockers.get(Ce);if(!(ce&&ce.state==="proceeding")&&Ue({currentLocation:B,nextLocation:G,historyAction:re}))return Ce}function oi(U){let B=ur(404,{pathname:U}),G=a||i,{matches:re,route:ye}=yx(G);return Ds(),{notFoundMatches:re,route:ye,error:B}}function Sn(U,B){return{boundaryId:Ri(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 mT(U,B,G){if(x=U,w=B,g=G||null,!v&&T.navigation===mh){v=!0;let re=Kv(T.location,T.matches);re!=null&&ke({restoreScrollPosition:re})}return()=>{x=null,w=null,g=null}}function Zv(U,B){return g&&g(U,B.map(re=>QN(re,T.loaderData)))||U.key}function gT(U,B){if(x&&w){let G=Zv(U,B);x[G]=w()}}function Kv(U,B){if(x){let G=Zv(U,B),re=x[G];if(typeof re=="number")return re}return null}function Vf(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:wu(B,G,l,!0)}}else return{active:!0,matches:wu(B,G,l,!0)||[]};return{active:!1,matches:null}}async function Ec(U,B,G){let re=U,ye=re.length>0?re[re.length-1].route:null;for(;;){let Ce=a==null,Ue=a||i;try{await T2(d,B,re,Ue,o,s,fe,G)}catch(De){return{type:"error",error:De,partialMatches:re}}finally{Ce&&(i=[...i])}if(G.aborted)return{type:"aborted"};let ce=ko(Ue,B,l),Ye=!1;if(ce){let De=ce[ce.length-1].route;if(De.index)return{type:"success",matches:ce};if(De.path&&De.path.length>0)if(De.path==="*")Ye=!0;else return{type:"success",matches:ce}}let Re=wu(Ue,B,l,!0);if(!Re||re.map(De=>De.route.id).join("-")===Re.map(De=>De.route.id).join("-"))return{type:"success",matches:Ye?ce:null};if(re=Re,ye=re[re.length-1].route,ye.path==="*")return{type:"success",matches:re}}}function vT(U){o={},a=Pl(U,s,void 0,o)}function yT(U,B){let G=a==null;G_(U,B,a||i,o,s),G&&(i=[...i],ke({}))}return E={get basename(){return l},get future(){return f},get state(){return T},get routes(){return i},get window(){return t},initialize:be,subscribe:je,enableScrollRestoration:mT,navigate:k,fetch:Y,revalidate:J,createHref:U=>e.history.createHref(U),encodeLocation:U=>e.history.encodeLocation(U),getFetcher:Wr,deleteFetcher:Kn,dispose:Pe,getBlocker:Sc,deleteBlocker:kc,patchRoutes:yT,_internalFetchControllers:$,_internalActiveDeferreds:se,_internalSetRoutes:vT},E}function k2(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Pp(e,t,r,n,s,o,i,a){let l,u;if(i){l=[];for(let f of t)if(l.push(f),f.route.id===i){u=f;break}}else l=t,u=t[t.length-1];let d=qd(s||".",Gd(l,o),fa(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&&!fg(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(d.pathname=d.pathname==="/"?r:ds([r,d.pathname])),Bo(d)}function cx(e,t,r,n){if(!n||!k2(n))return{path:r};if(n.formMethod&&!F2(n.formMethod))return{path:r,error:ur(405,{method:n.formMethod})};let s=()=>({path:r,error:ur(400,{type:"invalid-body"})}),o=n.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),a=q_(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!on(i))return s();let p=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((m,x)=>{let[g,w]=x;return""+m+g+"="+w+` `},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:p}}}else if(n.formEncType==="application/json"){if(!on(i))return s();try{let p=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:p,text:void 0}}}catch{return s()}}}Qe(typeof FormData=="function","FormData is not available in this environment");let l,u;if(n.formData)l=Dp(n.formData),u=n.formData;else if(n.body instanceof FormData)l=Dp(n.body),u=n.body;else if(n.body instanceof URLSearchParams)l=n.body,u=px(l);else if(n.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(n.body),u=px(l)}catch{return s()}let d={formMethod:i,formAction:a,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(on(d.formMethod))return{path:r,submission:d};let f=Cs(r);return t&&f.search&&fg(f.search)&&l.append("index",""),f.search="?"+l,{path:Bo(f),submission:d}}function C2(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 ux(e,t,r,n,s,o,i,a,l,u,d,f,p,m,x,g){let w=g?Pr(g[1])?g[1].error:g[1].data:void 0,v=e.createURL(t.location),h=e.createURL(s),_=g&&Pr(g[1])?g[0]:void 0,C=_?C2(r,_):r,E=g?g[1].statusCode:void 0,T=i&&E&&E>=400,R=C.filter((P,L)=>{let{route:q}=P;if(q.lazy)return!0;if(q.loader==null)return!1;if(o)return typeof q.loader!="function"||q.loader.hydrate?!0:t.loaderData[q.id]===void 0&&(!t.errors||t.errors[q.id]===void 0);if(E2(t.loaderData,t.matches[L],P)||l.some(b=>b===P.route.id))return!0;let j=t.matches[L],F=P;return dx(P,Pt({currentUrl:v,currentParams:j.params,nextUrl:h,nextParams:F.params},n,{actionResult:w,actionStatus:E,defaultShouldRevalidate:T?!1:a||v.pathname+v.search===h.pathname+h.search||v.search!==h.search||K_(j,F)}))}),D=[];return f.forEach((P,L)=>{if(o||!r.some(W=>W.route.id===P.routeId)||d.has(L))return;let q=ko(m,P.path,x);if(!q){D.push({key:L,routeId:P.routeId,path:P.path,matches:null,match:null,controller:null});return}let j=t.fetchers.get(L),F=Ba(q,P.path),b=!1;p.has(L)?b=!1:u.includes(L)?b=!0:j&&j.state!=="idle"&&j.data===void 0?b=a:b=dx(F,Pt({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:h,nextParams:r[r.length-1].params},n,{actionResult:w,actionStatus:E,defaultShouldRevalidate:T?!1:a})),b&&D.push({key:L,routeId:P.routeId,path:P.path,matches:q,match:F,controller:new AbortController})}),[R,D]}function E2(e,t,r){let n=!t||r.route.id!==t.route.id,s=e[r.route.id]===void 0;return n||s}function K_(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function dx(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function T2(e,t,r,n,s,o,i,a){let l=[t,...r.map(u=>u.route.id)].join("-");try{let u=i.get(l);u||(u=e({path:t,matches:r,patch:(d,f)=>{a.aborted||G_(d,f,n,s,o)}}),i.set(l,u)),u&&M2(u)&&await u}finally{i.delete(l)}}function G_(e,t,r,n,s){if(e){var o;let i=n[e];Qe(i,"No route found to patch children into: routeId = "+e);let a=Pl(t,s,[e,"patch",String(((o=i.children)==null?void 0:o.length)||"0")],n);i.children?i.children.push(...a):i.children=a}else{let i=Pl(t,s,["patch",String(r.length||"0")],n);r.push(...i)}}async function fx(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 o={};for(let i in n){let l=s[i]!==void 0&&i!=="hasErrorBoundary";$o(!l,'Route "'+s.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!l&&!qN.has(i)&&(o[i]=n[i])}Object.assign(s,o),Object.assign(s,Pt({},t(s),{lazy:void 0}))}function j2(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function N2(e,t,r,n,s,o,i,a){let l=n.reduce((f,p)=>f.add(p.route.id),new Set),u=new Set,d=await e({matches:s.map(f=>{let p=l.has(f.route.id);return Pt({},f,{shouldLoad:p,resolve:x=>(u.add(f.route.id),p?R2(t,r,f,o,i,x,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,p)=>l.has(s[p].route.id))}async function R2(e,t,r,n,s,o,i){let a,l,u=d=>{let f,p=new Promise((g,w)=>f=w);l=()=>f(),t.signal.addEventListener("abort",l);let m=g=>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:i},...g!==void 0?[g]:[]),x;return o?x=o(g=>m(g)):x=(async()=>{try{return{type:"data",result:await m()}}catch(g){return{type:"error",result:g}}})(),Promise.race([x,p])};try{let d=r.route[e];if(r.route.lazy)if(d){let f,[p]=await Promise.all([u(d).catch(m=>{f=m}),fx(r.route,s,n)]);if(f!==void 0)throw f;a=p}else if(await fx(r.route,s,n),d=r.route[e],d)a=await u(d);else if(e==="action"){let f=new URL(t.url),p=f.pathname+f.search;throw ur(405,{method:t.method,pathname:p,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),p=f.pathname+f.search;throw ur(404,{pathname:p})}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 P2(e){let{result:t,type:r,status:n}=e;if(X_(t)){let i;try{let a=t.headers.get("Content-Type");a&&/\bapplication\/json\b/.test(a)?t.body==null?i=null:i=await t.json():i=await t.text()}catch(a){return{type:vt.error,error:a}}return r===vt.error?{type:vt.error,error:new ug(t.status,t.statusText,i),statusCode:t.status,headers:t.headers}:{type:vt.data,data:i,statusCode:t.status,headers:t.headers}}if(r===vt.error)return{type:vt.error,error:t,statusCode:Xd(t)?t.status:n};if(L2(t)){var s,o;return{type:vt.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}return{type:vt.data,data:t,statusCode:n}}function D2(e,t,r,n,s,o){let i=e.headers.get("Location");if(Qe(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!dg.test(i)){let a=n.slice(0,n.findIndex(l=>l.route.id===r)+1);i=Pp(new URL(t.url),a,s,!0,i,o),e.headers.set("Location",i)}return e}function hx(e,t,r){if(dg.test(e)){let n=e,s=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=fa(s.pathname,r)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}return e}function ui(e,t,r,n){let s=e.createURL(q_(t)).toString(),o={signal:r};if(n&&on(n.formMethod)){let{formMethod:i,formEncType:a}=n;o.method=i.toUpperCase(),a==="application/json"?(o.headers=new Headers({"Content-Type":a}),o.body=JSON.stringify(n.json)):a==="text/plain"?o.body=n.text:a==="application/x-www-form-urlencoded"&&n.formData?o.body=Dp(n.formData):o.body=n.formData}return new Request(s,o)}function Dp(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function px(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function A2(e,t,r,n,s,o){let i={},a=null,l,u=!1,d={},f=n&&Pr(n[1])?n[1].error:void 0;return r.forEach((p,m)=>{let x=t[m].route.id;if(Qe(!No(p),"Cannot handle redirect results in processLoaderData"),Pr(p)){let g=p.error;f!==void 0&&(g=f,f=void 0),a=a||{};{let w=Ri(e,x);a[w.route.id]==null&&(a[w.route.id]=g)}i[x]=void 0,u||(u=!0,l=Xd(p.error)?p.error.status:500),p.headers&&(d[x]=p.headers)}else jo(p)?(s.set(x,p.deferredData),i[x]=p.deferredData.data,p.statusCode!=null&&p.statusCode!==200&&!u&&(l=p.statusCode),p.headers&&(d[x]=p.headers)):(i[x]=p.data,p.statusCode&&p.statusCode!==200&&!u&&(l=p.statusCode),p.headers&&(d[x]=p.headers))}),f!==void 0&&n&&(a={[n[0]]:f},i[n[0]]=void 0),{loaderData:i,errors:a,statusCode:l||200,loaderHeaders:d}}function mx(e,t,r,n,s,o,i,a){let{loaderData:l,errors:u}=A2(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 yx(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:o,message:i}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",o==="route-discovery"?l='Unable to match URL "'+r+'" - the `unstable_patchRoutesOnMiss()` '+(`function threw the following error: `+i):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.":o==="defer-action"?l="defer() is not supported in actions":o==="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 ug(e||500,a,new Error(l),!0)}function xx(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(No(r))return{result:r,idx:t}}}function q_(e){let t=typeof e=="string"?Cs(e):e;return Bo(Pt({},t,{hash:""}))}function O2(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function M2(e){return typeof e=="object"&&e!=null&&"then"in e}function I2(e){return X_(e.result)&&x2.has(e.result.status)}function jo(e){return e.type===vt.deferred}function Pr(e){return e.type===vt.error}function No(e){return(e&&e.type)===vt.redirect}function L2(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 X_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function F2(e){return y2.has(e.toLowerCase())}function on(e){return g2.has(e.toLowerCase())}async function wx(e,t,r,n,s,o){for(let i=0;if.route.id===l.route.id),d=u!=null&&!K_(u,l)&&(o&&o[l.route.id])!==void 0;if(jo(a)&&(s||d)){let f=n[i];Qe(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await Q_(a,f,s).then(p=>{p&&(r[i]=p||r[i])})}}}async function Q_(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 fg(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ba(e,t){let r=typeof t=="string"?Cs(t).search:t.search;if(e[e.length-1].route.index&&fg(r||""))return e[e.length-1];let n=H_(e);return n[n.length-1]}function _x(e){let{formMethod:t,formAction:r,formEncType:n,text:s,formData:o,json:i}=e;if(!(!t||!r||!n)){if(s!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:s};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function gh(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 z2(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 Aa(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 U2(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 V2(e,t){try{let r=e.sessionStorage.getItem(Z_);if(r){let n=JSON.parse(r);for(let[s,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(s,new Set(o||[]))}}catch{}}function W2(e,t){if(t.size>0){let r={};for(let[n,s]of t)r[n]=[...s];try{e.sessionStorage.setItem(Z_,JSON.stringify(r))}catch(n){$o(!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 sd(){return sd=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),y.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){n.go(u);return}let f=qd(u,JSON.parse(i),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ds([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,i,o,e])}const H2=y.createContext(null);function Y2(e){let t=y.useContext(Es).outlet;return t&&y.createElement(H2.Provider,{value:e},t)}function r1(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=y.useContext(yo),{matches:s}=y.useContext(Es),{pathname:o}=Vn(),i=JSON.stringify(Gd(s,n.v7_relativeSplatPath));return y.useMemo(()=>qd(e,JSON.parse(i),o,r==="path"),[e,i,o,r])}function Z2(e,t,r,n){ha()||Qe(!1);let{navigator:s}=y.useContext(yo),{matches:o}=y.useContext(Es),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let l=i?i.pathnameBase:"/";i&&i.route;let u=Vn(),d;d=u;let f=d.pathname||"/",p=f;if(l!=="/"){let g=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(g.length).join("/")}let m=ko(e,{pathname:p});return Q2(m&&m.map(g=>Object.assign({},g,{params:Object.assign({},a,g.params),pathname:ds([l,s.encodeLocation?s.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:ds([l,s.encodeLocation?s.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,r,n)}function K2(){let e=rR(),t=Xd(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 y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),r?y.createElement("pre",{style:s},r):null,null)}const G2=y.createElement(K2,null);class q2 extends y.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?y.createElement(Es.Provider,{value:this.props.routeContext},y.createElement(e1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function X2(e){let{routeContext:t,match:r,children:n}=e,s=y.useContext(Qd);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),y.createElement(Es.Provider,{value:t},n)}function Q2(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if((o=r)!=null&&o.errors)e=r.matches;else return null}let i=e,a=(s=r)==null?void 0:s.errors;if(a!=null){let d=i.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||Qe(!1),i=i.slice(0,Math.min(i.length,d+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d=0?i=i.slice(0,u+1):i=[i[0]];break}}}return i.reduceRight((d,f,p)=>{let m,x=!1,g=null,w=null;r&&(m=a&&f.route.id?a[f.route.id]:void 0,g=f.route.errorElement||G2,l&&(u<0&&p===0?(sR("route-fallback"),x=!0,w=null):u===p&&(x=!0,w=f.route.hydrateFallbackElement||null)));let v=t.concat(i.slice(0,p+1)),h=()=>{let _;return m?_=g:x?_=w:f.route.Component?_=y.createElement(f.route.Component,null):f.route.element?_=f.route.element:_=d,y.createElement(X2,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:r!=null},children:_})};return r&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?y.createElement(q2,{location:r.location,revalidation:r.revalidation,component:g,error:m,children:h(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):h()},null)}var n1=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(n1||{}),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 J2(e){let t=y.useContext(Qd);return t||Qe(!1),t}function eR(e){let t=y.useContext(J_);return t||Qe(!1),t}function tR(e){let t=y.useContext(Es);return t||Qe(!1),t}function s1(e){let t=tR(),r=t.matches[t.matches.length-1];return r.route.id||Qe(!1),r.route.id}function rR(){var e;let t=y.useContext(e1),r=eR(od.UseRouteError),n=s1(od.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function nR(){let{router:e}=J2(n1.UseNavigateStable),t=s1(od.UseNavigateStable),r=y.useRef(!1);return t1(()=>{r.current=!0}),y.useCallback(function(s,o){o===void 0&&(o={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,sd({fromRouteId:t},o)))},[e,t])}const bx={};function sR(e,t,r){bx[e]||(bx[e]=!0)}function o1(e){let{to:t,replace:r,state:n,relative:s}=e;ha()||Qe(!1);let{future:o,static:i}=y.useContext(yo),{matches:a}=y.useContext(Es),{pathname:l}=Vn(),u=wn(),d=qd(t,Gd(a,o.v7_relativeSplatPath),l,s==="path"),f=JSON.stringify(d);return y.useEffect(()=>u(JSON.parse(f),{replace:r,state:n,relative:s}),[u,f,s,r,n]),null}function pg(e){return Y2(e.context)}function oR(e){let{basename:t="/",children:r=null,location:n,navigationType:s=Wt.Pop,navigator:o,static:i=!1,future:a}=e;ha()&&Qe(!1);let l=t.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:l,navigator:o,static:i,future:sd({v7_relativeSplatPath:!1},a)}),[l,a,o,i]);typeof n=="string"&&(n=Cs(n));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:x="default"}=n,g=y.useMemo(()=>{let w=fa(d,l);return w==null?null:{location:{pathname:w,search:f,hash:p,state:m,key:x},navigationType:s}},[l,d,f,p,m,x,s]);return g==null?null:y.createElement(yo.Provider,{value:u},y.createElement(hg.Provider,{children:r,value:g}))}new Promise(()=>{});function iR(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:y.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:y.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 Dl(){return Dl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[s]=e[s]);return r}function lR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function cR(e,t){return e.button===0&&(!t||t==="_self")&&!lR(e)}function Ap(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 uR(e,t){let r=Ap(e);return t&&t.forEach((n,s)=>{r.has(s)||t.getAll(s).forEach(o=>{r.append(s,o)})}),r}const dR=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],fR="6";try{window.__reactRouterVersion=fR}catch{}function hR(e,t){return S2({basename:void 0,future:Dl({},void 0,{v7_prependBasename:!0}),history:ZN({window:void 0}),hydrationData:pR(),routes:e,mapRouteProperties:iR,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function pR(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Dl({},t,{errors:mR(t.errors)})),t}function mR(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 ug(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let o=window[s.__subType];if(typeof o=="function")try{let i=new o(s.message);i.stack="",r[n]=i}catch{}}if(r[n]==null){let o=new Error(s.message);o.stack="",r[n]=o}}else r[n]=s;return r}const gR=y.createContext({isTransitioning:!1}),vR=y.createContext(new Map),yR="startTransition",Sx=z0[yR],xR="flushSync",kx=YN[xR];function wR(e){Sx?Sx(e):e()}function Oa(e){kx?kx(e):e()}class _R{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 bR(e){let{fallbackElement:t,router:r,future:n}=e,[s,o]=y.useState(r.state),[i,a]=y.useState(),[l,u]=y.useState({isTransitioning:!1}),[d,f]=y.useState(),[p,m]=y.useState(),[x,g]=y.useState(),w=y.useRef(new Map),{v7_startTransition:v}=n||{},h=y.useCallback(D=>{v?wR(D):D()},[v]),_=y.useCallback((D,P)=>{let{deletedFetchers:L,unstable_flushSync:q,unstable_viewTransitionOpts:j}=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(!j||F){q?Oa(()=>o(D)):h(()=>o(D));return}if(q){Oa(()=>{p&&(d&&d.resolve(),p.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:j.currentLocation,nextLocation:j.nextLocation})});let b=r.window.document.startViewTransition(()=>{Oa(()=>o(D))});b.finished.finally(()=>{Oa(()=>{f(void 0),m(void 0),a(void 0),u({isTransitioning:!1})})}),Oa(()=>m(b));return}p?(d&&d.resolve(),p.skipTransition(),g({state:D,currentLocation:j.currentLocation,nextLocation:j.nextLocation})):(a(D),u({isTransitioning:!0,flushSync:!1,currentLocation:j.currentLocation,nextLocation:j.nextLocation}))},[r.window,p,d,w,h]);y.useLayoutEffect(()=>r.subscribe(_),[r,_]),y.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new _R)},[l]),y.useEffect(()=>{if(d&&i&&r.window){let D=i,P=d.promise,L=r.window.document.startViewTransition(async()=>{h(()=>o(D)),await P});L.finished.finally(()=>{f(void 0),m(void 0),a(void 0),u({isTransitioning:!1})}),m(L)}},[h,i,d,r.window]),y.useEffect(()=>{d&&i&&s.location.key===i.location.key&&d.resolve()},[d,p,s.location,i]),y.useEffect(()=>{!l.isTransitioning&&x&&(a(x.state),u({isTransitioning:!0,flushSync:!1,currentLocation:x.currentLocation,nextLocation:x.nextLocation}),g(void 0))},[l.isTransitioning,x]),y.useEffect(()=>{},[]);let C=y.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||"/",T=y.useMemo(()=>({router:r,navigator:C,static:!1,basename:E}),[r,C,E]),R=y.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return y.createElement(y.Fragment,null,y.createElement(Qd.Provider,{value:T},y.createElement(J_.Provider,{value:s},y.createElement(vR.Provider,{value:w.current},y.createElement(gR.Provider,{value:l},y.createElement(oR,{basename:E,location:s.location,navigationType:s.historyAction,navigator:C,future:R},s.initialized||r.future.v7_partialHydration?y.createElement(SR,{routes:r.routes,future:r.future,state:s}):t))))),null)}const SR=y.memo(kR);function kR(e){let{routes:t,future:r,state:n}=e;return Z2(t,void 0,n,r)}const CR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ER=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dr=y.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:o,replace:i,state:a,target:l,to:u,preventScrollReset:d,unstable_viewTransition:f}=t,p=aR(t,dR),{basename:m}=y.useContext(yo),x,g=!1;if(typeof u=="string"&&ER.test(u)&&(x=u,CR))try{let _=new URL(window.location.href),C=u.startsWith("//")?new URL(_.protocol+u):new URL(u),E=fa(C.pathname,m);C.origin===_.origin&&E!=null?u=E+C.search+C.hash:g=!0}catch{}let w=$2(u,{relative:s}),v=TR(u,{replace:i,state:a,target:l,preventScrollReset:d,relative:s,unstable_viewTransition:f});function h(_){n&&n(_),_.defaultPrevented||v(_)}return y.createElement("a",Dl({},p,{href:x||w,onClick:g||o?n:h,ref:r,target:l}))});var Cx;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Cx||(Cx={}));var Ex;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ex||(Ex={}));function TR(e,t){let{target:r,replace:n,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:a}=t===void 0?{}:t,l=wn(),u=Vn(),d=r1(e,{relative:i});return y.useCallback(f=>{if(cR(f,r)){f.preventDefault();let p=n!==void 0?n:Bo(u)===Bo(d);l(e,{replace:p,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:a})}},[u,l,d,n,s,r,e,o,i,a])}function jR(e){let t=y.useRef(Ap(e)),r=y.useRef(!1),n=Vn(),s=y.useMemo(()=>uR(n.search,r.current?null:t.current),[n.search]),o=wn(),i=y.useCallback((a,l)=>{const u=Ap(typeof a=="function"?a(s):a);r.current=!0,o("?"+u,l)},[o,s]);return[s,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 NR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),i1=(...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 RR={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 PR=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:i,...a},l)=>y.createElement("svg",{ref:l,...RR,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:i1("lucide",s),...a},[...i.map(([u,d])=>y.createElement(u,d)),...Array.isArray(o)?o:[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 St=(e,t)=>{const r=y.forwardRef(({className:n,...s},o)=>y.createElement(PR,{ref:o,iconNode:t,className:i1(`lucide-${NR(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 DR=St("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 AR=St("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 OR=St("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 a1=St("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 l1=St("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 MR=St("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 IR=St("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 mg=St("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 LR=St("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 gg=St("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 FR=St("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 Op=St("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 zR=St("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 Tx=St("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 jx=St("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 UR=St("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 VR=St("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 WR=St("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 $R=St("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 Nx=St("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 Rx=St("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 c1=St("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 BR=St("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 HR=St("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 vg=St("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function YR(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Jd(...e){return t=>e.forEach(r=>YR(r,t))}function Xe(...e){return y.useCallback(Jd(...e),e)}var ys=y.forwardRef((e,t)=>{const{children:r,...n}=e,s=y.Children.toArray(r),o=s.find(ZR);if(o){const i=o.props.children,a=s.map(l=>l===o?y.Children.count(i)>1?y.Children.only(null):y.isValidElement(i)?i.props.children:null:l);return c.jsx(Mp,{...n,ref:t,children:y.isValidElement(i)?y.cloneElement(i,void 0,a):null})}return c.jsx(Mp,{...n,ref:t,children:r})});ys.displayName="Slot";var Mp=y.forwardRef((e,t)=>{const{children:r,...n}=e;if(y.isValidElement(r)){const s=GR(r);return y.cloneElement(r,{...KR(n,r.props),ref:t?Jd(t,s):s})}return y.Children.count(r)>1?y.Children.only(null):null});Mp.displayName="SlotClone";var yg=({children:e})=>c.jsx(c.Fragment,{children:e});function ZR(e){return y.isValidElement(e)&&e.type===yg}function KR(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...a)=>{o(...a),s(...a)}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function GR(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 u1(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,Dx=qR,ic=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Dx(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(u=>{const d=r==null?void 0:r[u],f=o==null?void 0:o[u];if(d===null)return null;const p=Px(d)||Px(f);return s[u][p]}),a=r&&Object.entries(r).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:p,...m}=d;return Object.entries(m).every(x=>{let[g,w]=x;return Array.isArray(w)?w.includes({...o,...a}[g]):{...o,...a}[g]===w})?[...u,f,p]:u},[]);return Dx(e,i,l,r==null?void 0:r.class,r==null?void 0:r.className)};function d1(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(o)))==null?void 0:i.classGroupId}const Ax=/^\[(.+)\]$/;function JR(e){if(Ax.test(e)){const t=Ax.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}}function eP(e){const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return rP(Object.entries(e.classGroups),r).forEach(([o,i])=>{Ip(i,n,o,t)}),n}function Ip(e,t,r,n){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Ox(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(tP(s)){Ip(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,i])=>{Ip(i,Ox(t,o),r,n)})})}function Ox(e,t){let r=e;return t.split(xg).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r}function tP(e){return e.isThemeGetter}function rP(e,t){return t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,a])=>[t+i,a])):o);return[r,s]}):e}function nP(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;function s(o,i){r.set(o,i),t++,t>e&&(t=0,n=r,r=new Map)}return{get(o){let i=r.get(o);if(i!==void 0)return i;if((i=n.get(o))!==void 0)return s(o,i),i},set(o,i){r.has(o)?r.set(o,i):s(o,i)}}}const h1="!";function sP(e){const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length;function i(a){const l=[];let u=0,d=0,f;for(let w=0;wd?f-d:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:x,maybePostfixModifierPosition:g}}return r?function(l){return r({className:l,parseClassName:i})}:i}function oP(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 iP(e){return{cache:nP(e.cacheSize),parseClassName:sP(e),...QR(e)}}const aP=/\s+/;function lP(e,t){const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(aP).map(i=>{const{modifiers:a,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=r(i);let f=!!d,p=n(f?u.substring(0,d):u);if(!p){if(!f)return{isTailwindClass:!1,originalClassName:i};if(p=n(u),!p)return{isTailwindClass:!1,originalClassName:i};f=!1}const m=oP(a).join(":");return{isTailwindClass:!0,modifierId:l?m+h1:m,classGroupId:p,originalClassName:i,hasPostfixModifier:f}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:u}=i,d=a+l;return o.has(d)?!1:(o.add(d),s(l,u).forEach(f=>o.add(a+f)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function cP(){let e=0,t,r,n="";for(;ef(d),e());return r=iP(u),n=r.cache.get,s=r.cache.set,o=a,a(l)}function a(l){const u=n(l);if(u)return u;const d=lP(l,r);return s(l,d),d}return function(){return o(cP.apply(null,arguments))}}function xt(e){const t=r=>r[e]||[];return t.isThemeGetter=!0,t}const m1=/^\[(?:([a-z-]+):)?(.+)\]$/i,dP=/^\d+\/\d+$/,fP=new Set(["px","full","screen"]),hP=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pP=/\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$/,mP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,gP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Qn(e){return Ro(e)||fP.has(e)||dP.test(e)}function Ms(e){return pa(e,"length",CP)}function Ro(e){return!!e&&!Number.isNaN(Number(e))}function Kc(e){return pa(e,"number",Ro)}function Ma(e){return!!e&&Number.isInteger(Number(e))}function yP(e){return e.endsWith("%")&&Ro(e.slice(0,-1))}function Ze(e){return m1.test(e)}function Is(e){return hP.test(e)}const xP=new Set(["length","size","percentage"]);function wP(e){return pa(e,xP,g1)}function _P(e){return pa(e,"position",g1)}const bP=new Set(["image","url"]);function SP(e){return pa(e,bP,TP)}function kP(e){return pa(e,"",EP)}function Ia(){return!0}function pa(e,t,r){const n=m1.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1}function CP(e){return pP.test(e)&&!mP.test(e)}function g1(){return!1}function EP(e){return gP.test(e)}function TP(e){return vP.test(e)}function jP(){const e=xt("colors"),t=xt("spacing"),r=xt("blur"),n=xt("brightness"),s=xt("borderColor"),o=xt("borderRadius"),i=xt("borderSpacing"),a=xt("borderWidth"),l=xt("contrast"),u=xt("grayscale"),d=xt("hueRotate"),f=xt("invert"),p=xt("gap"),m=xt("gradientColorStops"),x=xt("gradientColorStopPositions"),g=xt("inset"),w=xt("margin"),v=xt("opacity"),h=xt("padding"),_=xt("saturate"),C=xt("scale"),E=xt("sepia"),T=xt("skew"),R=xt("space"),D=xt("translate"),P=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",Ze,t],j=()=>[Ze,t],F=()=>["",Qn,Ms],b=()=>["auto",Ro,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=()=>[Ro,Kc],V=()=>[Ro,Ze];return{cacheSize:500,separator:":",theme:{colors:[Ia],spacing:[Qn,Ms],blur:["none","",Is,Ze],brightness:z(),borderColor:[e],borderRadius:["none","","full",Is,Ze],borderSpacing:j(),borderWidth:F(),contrast:z(),grayscale:I(),hueRotate:V(),invert:I(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[yP,Ms],inset:q(),margin:q(),opacity:z(),padding:j(),saturate:z(),scale:z(),sepia:I(),skew:V(),space:j(),translate:j()},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:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ma,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",Ma,Ze]}],"grid-cols":[{"grid-cols":[Ia]}],"col-start-end":[{col:["auto",{span:["full",Ma,Ze]},Ze]}],"col-start":[{"col-start":b()}],"col-end":[{"col-end":b()}],"grid-rows":[{"grid-rows":[Ia]}],"row-start-end":[{row:["auto",{span:[Ma,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:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"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:[h]}],px:[{px:[h]}],py:[{py:[h]}],ps:[{ps:[h]}],pe:[{pe:[h]}],pt:[{pt:[h]}],pr:[{pr:[h]}],pb:[{pb:[h]}],pl:[{pl:[h]}],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",Kc]}],"font-family":[{font:[Ia]}],"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",Ro,Kc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Qn,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",Qn,Ms]}],"underline-offset":[{"underline-offset":["auto",Qn,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:j()}],"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(),_P]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",wP]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},SP]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"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":[Qn,Ze]}],"outline-w":[{outline:[Qn,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":[Qn,Ms]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Is,kP]}],"shadow-color":[{shadow:[Ia]}],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":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"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:[Ma,Ze]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"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":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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:[Qn,Ms,Kc]}],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 NP=uP(jP);function me(...e){return NP(XR(e))}const ef=ic("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"}}),ft=y.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const i=n?ys:"button";return c.jsx(i,{className:me(ef({variant:t,size:r,className:e})),ref:o,...s})});ft.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 RP(e,t){const r=y.createContext(t);function n(o){const{children:i,...a}=o,l=y.useMemo(()=>a,Object.values(a));return c.jsx(r.Provider,{value:l,children:i})}function s(o){const i=y.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return n.displayName=e+"Provider",[n,s]}function Qr(e,t=[]){let r=[];function n(o,i){const a=y.createContext(i),l=r.length;r=[...r,i];function u(f){const{scope:p,children:m,...x}=f,g=(p==null?void 0:p[e][l])||a,w=y.useMemo(()=>x,Object.values(x));return c.jsx(g.Provider,{value:w,children:m})}function d(f,p){const m=(p==null?void 0:p[e][l])||a,x=y.useContext(m);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const s=()=>{const o=r.map(i=>y.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return y.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[n,PP(s,...t)]}function PP(...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(o){const i=n.reduce((a,{useScope:l,scopeName:u})=>{const f=l(o)[`__scope${u}`];return{...a,...f}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function At(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function io({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,s]=DP({defaultProp:t,onChange:r}),o=e!==void 0,i=o?e:n,a=At(r),l=y.useCallback(u=>{if(o){const f=typeof u=="function"?u(e):u;f!==e&&a(f)}else s(u)},[o,e,s,a]);return[i,l]}function DP({defaultProp:e,onChange:t}){const r=y.useState(e),[n]=r,s=y.useRef(n),o=At(t);return y.useEffect(()=>{s.current!==n&&(o(n),s.current=n)},[n,s,o]),r}var AP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ze=AP.reduce((e,t)=>{const r=y.forwardRef((n,s)=>{const{asChild:o,...i}=n,a=o?ys:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(a,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function wg(e,t){e&&ks.flushSync(()=>e.dispatchEvent(t))}function tf(e){const t=e+"CollectionProvider",[r,n]=Qr(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:x,children:g}=m,w=et.useRef(null),v=et.useRef(new Map).current;return c.jsx(s,{scope:x,itemMap:v,collectionRef:w,children:g})};i.displayName=t;const a=e+"CollectionSlot",l=et.forwardRef((m,x)=>{const{scope:g,children:w}=m,v=o(a,g),h=Xe(x,v.collectionRef);return c.jsx(ys,{ref:h,children:w})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=et.forwardRef((m,x)=>{const{scope:g,children:w,...v}=m,h=et.useRef(null),_=Xe(x,h),C=o(u,g);return et.useEffect(()=>(C.itemMap.set(h,{ref:h,...v}),()=>void C.itemMap.delete(h))),c.jsx(ys,{[d]:"",ref:_,children:w})});f.displayName=u;function p(m){const x=o(e+"CollectionConsumer",m);return et.useCallback(()=>{const w=x.collectionRef.current;if(!w)return[];const v=Array.from(w.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((C,E)=>v.indexOf(C.ref.current)-v.indexOf(E.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:l,ItemSlot:f},p,n]}var OP=y.createContext(void 0);function rf(e){const t=y.useContext(OP);return e||t||"ltr"}function MP(e,t=globalThis==null?void 0:globalThis.document){const r=At(e);y.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 IP="DismissableLayer",Lp="dismissableLayer.update",LP="dismissableLayer.pointerDownOutside",FP="dismissableLayer.focusOutside",Mx,v1=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ma=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,u=y.useContext(v1),[d,f]=y.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=y.useState({}),x=Xe(t,R=>f(R)),g=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(w),h=d?g.indexOf(d):-1,_=u.layersWithOutsidePointerEventsDisabled.size>0,C=h>=v,E=UP(R=>{const D=R.target,P=[...u.branches].some(L=>L.contains(D));!C||P||(s==null||s(R),i==null||i(R),R.defaultPrevented||a==null||a())},p),T=VP(R=>{const D=R.target;[...u.branches].some(L=>L.contains(D))||(o==null||o(R),i==null||i(R),R.defaultPrevented||a==null||a())},p);return MP(R=>{h===u.layers.size-1&&(n==null||n(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},p),y.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Mx=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Ix(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Mx)}},[d,p,r,u]),y.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Ix())},[d,u]),y.useEffect(()=>{const R=()=>m({});return document.addEventListener(Lp,R),()=>document.removeEventListener(Lp,R)},[]),c.jsx(ze.div,{...l,ref:x,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:ue(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ue(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ue(e.onPointerDownCapture,E.onPointerDownCapture)})});ma.displayName=IP;var zP="DismissableLayerBranch",y1=y.forwardRef((e,t)=>{const r=y.useContext(v1),n=y.useRef(null),s=Xe(t,n);return y.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),c.jsx(ze.div,{...e,ref:s})});y1.displayName=zP;function UP(e,t=globalThis==null?void 0:globalThis.document){const r=At(e),n=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){x1(LP,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},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function VP(e,t=globalThis==null?void 0:globalThis.document){const r=At(e),n=y.useRef(!1);return y.useEffect(()=>{const s=o=>{o.target&&!n.current&&x1(FP,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Ix(){const e=new CustomEvent(Lp);document.dispatchEvent(e)}function x1(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?wg(s,o):s.dispatchEvent(o)}var WP=ma,$P=y1,vh=0;function _g(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Lx()),document.body.insertAdjacentElement("beforeend",e[1]??Lx()),vh++,()=>{vh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),vh--}},[])}function Lx(){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 yh="focusScope.autoFocusOnMount",xh="focusScope.autoFocusOnUnmount",Fx={bubbles:!1,cancelable:!0},BP="FocusScope",nf=y.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,l]=y.useState(null),u=At(s),d=At(o),f=y.useRef(null),p=Xe(t,g=>l(g)),m=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(n){let g=function(_){if(m.paused||!a)return;const C=_.target;a.contains(C)?f.current=C:Fs(f.current,{select:!0})},w=function(_){if(m.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",g),document.addEventListener("focusout",w);const h=new MutationObserver(v);return a&&h.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",w),h.disconnect()}}},[n,a,m.paused]),y.useEffect(()=>{if(a){Ux.add(m);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(yh,Fx);a.addEventListener(yh,u),a.dispatchEvent(v),v.defaultPrevented||(HP(qP(w1(a)),{select:!0}),document.activeElement===g&&Fs(a))}return()=>{a.removeEventListener(yh,u),setTimeout(()=>{const v=new CustomEvent(xh,Fx);a.addEventListener(xh,d),a.dispatchEvent(v),v.defaultPrevented||Fs(g??document.body,{select:!0}),a.removeEventListener(xh,d),Ux.remove(m)},0)}}},[a,u,d,m]);const x=y.useCallback(g=>{if(!r&&!n||m.paused)return;const w=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(w&&v){const h=g.currentTarget,[_,C]=YP(h);_&&C?!g.shiftKey&&v===C?(g.preventDefault(),r&&Fs(_,{select:!0})):g.shiftKey&&v===_&&(g.preventDefault(),r&&Fs(C,{select:!0})):v===h&&g.preventDefault()}},[r,n,m.paused]);return c.jsx(ze.div,{tabIndex:-1,...i,ref:p,onKeyDown:x})});nf.displayName=BP;function HP(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Fs(n,{select:t}),document.activeElement!==r)return}function YP(e){const t=w1(e),r=zx(t,e),n=zx(t.reverse(),e);return[r,n]}function w1(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 zx(e,t){for(const r of e)if(!ZP(r,{upTo:t}))return r}function ZP(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 KP(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&&KP(e)&&t&&e.select()}}var Ux=GP();function GP(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Vx(e,t),e.unshift(t)},remove(t){var r;e=Vx(e,t),(r=e[0])==null||r.resume()}}}function Vx(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function qP(e){return e.filter(t=>t.tagName!=="A")}var nr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},XP=z0.useId||(()=>{}),QP=0;function Mn(e){const[t,r]=y.useState(XP());return nr(()=>{r(n=>n??String(QP++))},[e]),t?`radix-${t}`:""}const JP=["top","right","bottom","left"],Pn=Math.min,Dr=Math.max,id=Math.round,Gc=Math.floor,ao=e=>({x:e,y:e}),eD={left:"right",right:"left",bottom:"top",top:"bottom"},tD={start:"end",end:"start"};function Fp(e,t,r){return Dr(e,Pn(t,r))}function xs(e,t){return typeof e=="function"?e(t):e}function ws(e){return e.split("-")[0]}function ga(e){return e.split("-")[1]}function bg(e){return e==="x"?"y":"x"}function Sg(e){return e==="y"?"height":"width"}function lo(e){return["top","bottom"].includes(ws(e))?"y":"x"}function kg(e){return bg(lo(e))}function rD(e,t,r){r===void 0&&(r=!1);const n=ga(e),s=kg(e),o=Sg(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=ad(i)),[i,ad(i)]}function nD(e){const t=ad(e);return[zp(e),t,zp(t)]}function zp(e){return e.replace(/start|end/g,t=>tD[t])}function sD(e,t,r){const n=["left","right"],s=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return r?t?s:n:t?n:s;case"left":case"right":return t?o:i;default:return[]}}function oD(e,t,r,n){const s=ga(e);let o=sD(ws(e),r==="start",n);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(zp)))),o}function ad(e){return e.replace(/left|right|bottom|top/g,t=>eD[t])}function iD(e){return{top:0,right:0,bottom:0,left:0,...e}}function _1(e){return typeof e!="number"?iD(e):{top:e,right:e,bottom:e,left:e}}function ld(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 Wx(e,t,r){let{reference:n,floating:s}=e;const o=lo(t),i=kg(t),a=Sg(i),l=ws(t),u=o==="y",d=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,p=n[a]/2-s[a]/2;let m;switch(l){case"top":m={x:d,y:n.y-s.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:f};break;case"left":m={x:n.x-s.width,y:f};break;default:m={x:n.x,y:n.y}}switch(ga(t)){case"start":m[i]-=p*(r&&u?-1:1);break;case"end":m[i]+=p*(r&&u?-1:1);break}return m}const aD=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:i}=r,a=o.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=Wx(u,n,l),p=n,m={},x=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:i,elements:a,middlewareData:l}=t,{element:u,padding:d=0}=xs(e,t)||{};if(u==null)return{};const f=_1(d),p={x:r,y:n},m=kg(s),x=Sg(m),g=await i.getDimensions(u),w=m==="y",v=w?"top":"left",h=w?"bottom":"right",_=w?"clientHeight":"clientWidth",C=o.reference[x]+o.reference[m]-p[m]-o.floating[x],E=p[m]-o.reference[m],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let R=T?T[_]:0;(!R||!await(i.isElement==null?void 0:i.isElement(T)))&&(R=a.floating[_]||o.floating[x]);const D=C/2-E/2,P=R/2-g[x]/2-1,L=Pn(f[v],P),q=Pn(f[h],P),j=L,F=R-g[x]-q,b=R/2-g[x]/2+D,W=Fp(j,b,F),te=!l.arrow&&ga(s)!=null&&b!==W&&o.reference[x]/2-(bb<=0)){var q,j;const b=(((q=o.flip)==null?void 0:q.index)||0)+1,W=R[b];if(W)return{data:{index:b,overflows:L},reset:{placement:W}};let te=(j=L.filter($=>$.overflows[0]<=0).sort(($,Z)=>$.overflows[1]-Z.overflows[1])[0])==null?void 0:j.placement;if(!te)switch(m){case"bestFit":{var F;const $=(F=L.filter(Z=>{if(T){const I=lo(Z.placement);return I===h||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 $x(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bx(e){return JP.some(t=>e[t]>=0)}const uD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=xs(e,t);switch(n){case"referenceHidden":{const o=await Al(t,{...s,elementContext:"reference"}),i=$x(o,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Bx(i)}}}case"escaped":{const o=await Al(t,{...s,altBoundary:!0}),i=$x(o,r.floating);return{data:{escapedOffsets:i,escaped:Bx(i)}}}default:return{}}}}};async function dD(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=ws(r),a=ga(r),l=lo(r)==="y",u=["left","top"].includes(i)?-1:1,d=o&&l?-1:1,f=xs(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof x=="number"&&(m=a==="end"?x*-1:x),l?{x:m*d,y:p*u}:{x:p*u,y:m*d}}const fD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:i,middlewareData:a}=t,l=await dD(t,e);return i===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:i}}}}},hD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:w=>{let{x:v,y:h}=w;return{x:v,y:h}}},...l}=xs(e,t),u={x:r,y:n},d=await Al(t,l),f=lo(ws(s)),p=bg(f);let m=u[p],x=u[f];if(o){const w=p==="y"?"top":"left",v=p==="y"?"bottom":"right",h=m+d[w],_=m-d[v];m=Fp(h,m,_)}if(i){const w=f==="y"?"top":"left",v=f==="y"?"bottom":"right",h=x+d[w],_=x-d[v];x=Fp(h,x,_)}const g=a.fn({...t,[p]:m,[f]:x});return{...g,data:{x:g.x-r,y:g.y-n}}}}},pD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=xs(e,t),d={x:r,y:n},f=lo(s),p=bg(f);let m=d[p],x=d[f];const g=xs(a,t),w=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const _=p==="y"?"height":"width",C=o.reference[p]-o.floating[_]+w.mainAxis,E=o.reference[p]+o.reference[_]-w.mainAxis;mE&&(m=E)}if(u){var v,h;const _=p==="y"?"width":"height",C=["top","left"].includes(ws(s)),E=o.reference[f]-o.floating[_]+(C&&((v=i.offset)==null?void 0:v[f])||0)+(C?0:w.crossAxis),T=o.reference[f]+o.reference[_]+(C?0:((h=i.offset)==null?void 0:h[f])||0)-(C?w.crossAxis:0);xT&&(x=T)}return{[p]:m,[f]:x}}}},mD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:s,elements:o}=t,{apply:i=()=>{},...a}=xs(e,t),l=await Al(t,a),u=ws(r),d=ga(r),f=lo(r)==="y",{width:p,height:m}=n.floating;let x,g;u==="top"||u==="bottom"?(x=u,g=d===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(g=u,x=d==="end"?"top":"bottom");const w=m-l.top-l.bottom,v=p-l.left-l.right,h=Pn(m-l[x],w),_=Pn(p-l[g],v),C=!t.middlewareData.shift;let E=h,T=_;if(f?T=d||C?Pn(_,v):v:E=d||C?Pn(h,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?T=p-2*(D!==0||P!==0?D+P:Dr(l.left,l.right)):E=m-2*(L!==0||q!==0?L+q:Dr(l.top,l.bottom))}await i({...t,availableWidth:T,availableHeight:E});const R=await s.getDimensions(o.floating);return p!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function va(e){return b1(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=(b1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function b1(e){return e instanceof Node||e instanceof Mr(e).Node}function mn(e){return e instanceof Element||e instanceof Mr(e).Element}function Ln(e){return e instanceof HTMLElement||e instanceof Mr(e).HTMLElement}function Hx(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mr(e).ShadowRoot}function ac(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=gn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(s)}function gD(e){return["table","td","th"].includes(va(e))}function sf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Cg(e){const t=Eg(),r=mn(e)?gn(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 vD(e){let t=co(e);for(;Ln(t)&&!ra(t);){if(Cg(t))return t;if(sf(t))return null;t=co(t)}return null}function Eg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ra(e){return["html","body","#document"].includes(va(e))}function gn(e){return Mr(e).getComputedStyle(e)}function of(e){return mn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function co(e){if(va(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Hx(e)&&e.host||Ts(e);return Hx(t)?t.host:t}function S1(e){const t=co(e);return ra(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ln(t)&&ac(t)?t:S1(t)}function Ol(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=S1(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),i=Mr(s);return o?t.concat(i,i.visualViewport||[],ac(s)?s:[],i.frameElement&&r?Ol(i.frameElement):[]):t.concat(s,Ol(s,[],r))}function k1(e){const t=gn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Ln(e),o=s?e.offsetWidth:r,i=s?e.offsetHeight:n,a=id(r)!==o||id(n)!==i;return a&&(r=o,n=i),{width:r,height:n,$:a}}function Tg(e){return mn(e)?e:e.contextElement}function Ui(e){const t=Tg(e);if(!Ln(t))return ao(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=k1(t);let i=(o?id(r.width):r.width)/n,a=(o?id(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const yD=ao(0);function C1(e){const t=Mr(e);return!Eg()||!t.visualViewport?yD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xD(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Mr(e)?!1:t}function Ho(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=Tg(e);let i=ao(1);t&&(n?mn(n)&&(i=Ui(n)):i=Ui(e));const a=xD(o,r,n)?C1(o):ao(0);let l=(s.left+a.x)/i.x,u=(s.top+a.y)/i.y,d=s.width/i.x,f=s.height/i.y;if(o){const p=Mr(o),m=n&&mn(n)?Mr(n):n;let x=p,g=x.frameElement;for(;g&&n&&m!==x;){const w=Ui(g),v=g.getBoundingClientRect(),h=gn(g),_=v.left+(g.clientLeft+parseFloat(h.paddingLeft))*w.x,C=v.top+(g.clientTop+parseFloat(h.paddingTop))*w.y;l*=w.x,u*=w.y,d*=w.x,f*=w.y,l+=_,u+=C,x=Mr(g),g=x.frameElement}}return ld({width:d,height:f,x:l,y:u})}function wD(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",i=Ts(n),a=t?sf(t.floating):!1;if(n===i||a&&o)return r;let l={scrollLeft:0,scrollTop:0},u=ao(1);const d=ao(0),f=Ln(n);if((f||!f&&!o)&&((va(n)!=="body"||ac(i))&&(l=of(n)),Ln(n))){const p=Ho(n);u=Ui(n),d.x=p.x+n.clientLeft,d.y=p.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 _D(e){return Array.from(e.getClientRects())}function E1(e){return Ho(Ts(e)).left+of(e).scrollLeft}function bD(e){const t=Ts(e),r=of(e),n=e.ownerDocument.body,s=Dr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Dr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+E1(e);const a=-r.scrollTop;return gn(n).direction==="rtl"&&(i+=Dr(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:i,y:a}}function SD(e,t){const r=Mr(e),n=Ts(e),s=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,a=0,l=0;if(s){o=s.width,i=s.height;const u=Eg();(!u||u&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:i,x:a,y:l}}function kD(e,t){const r=Ho(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=Ln(e)?Ui(e):ao(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,l=s*o.x,u=n*o.y;return{width:i,height:a,x:l,y:u}}function Yx(e,t,r){let n;if(t==="viewport")n=SD(e,r);else if(t==="document")n=bD(Ts(e));else if(mn(t))n=kD(t,r);else{const s=C1(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return ld(n)}function T1(e,t){const r=co(e);return r===t||!mn(r)||ra(r)?!1:gn(r).position==="fixed"||T1(r,t)}function CD(e,t){const r=t.get(e);if(r)return r;let n=Ol(e,[],!1).filter(a=>mn(a)&&va(a)!=="body"),s=null;const o=gn(e).position==="fixed";let i=o?co(e):e;for(;mn(i)&&!ra(i);){const a=gn(i),l=Cg(i);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||ac(i)&&!l&&T1(e,i))?n=n.filter(d=>d!==i):s=a,i=co(i)}return t.set(e,n),n}function ED(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const i=[...r==="clippingAncestors"?sf(t)?[]:CD(t,this._c):[].concat(r),n],a=i[0],l=i.reduce((u,d)=>{const f=Yx(t,d,s);return u.top=Dr(f.top,u.top),u.right=Pn(f.right,u.right),u.bottom=Pn(f.bottom,u.bottom),u.left=Dr(f.left,u.left),u},Yx(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function TD(e){const{width:t,height:r}=k1(e);return{width:t,height:r}}function jD(e,t,r){const n=Ln(t),s=Ts(t),o=r==="fixed",i=Ho(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=ao(0);if(n||!n&&!o)if((va(t)!=="body"||ac(s))&&(a=of(t)),n){const f=Ho(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else s&&(l.x=E1(s));const u=i.left+a.scrollLeft-l.x,d=i.top+a.scrollTop-l.y;return{x:u,y:d,width:i.width,height:i.height}}function wh(e){return gn(e).position==="static"}function Zx(e,t){return!Ln(e)||gn(e).position==="fixed"?null:t?t(e):e.offsetParent}function j1(e,t){const r=Mr(e);if(sf(e))return r;if(!Ln(e)){let s=co(e);for(;s&&!ra(s);){if(mn(s)&&!wh(s))return s;s=co(s)}return r}let n=Zx(e,t);for(;n&&gD(n)&&wh(n);)n=Zx(n,t);return n&&ra(n)&&wh(n)&&!Cg(n)?r:n||vD(e)||r}const ND=async function(e){const t=this.getOffsetParent||j1,r=this.getDimensions,n=await r(e.floating);return{reference:jD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function RD(e){return gn(e).direction==="rtl"}const PD={convertOffsetParentRelativeRectToViewportRelativeRect:wD,getDocumentElement:Ts,getClippingRect:ED,getOffsetParent:j1,getElementRects:ND,getClientRects:_D,getDimensions:TD,getScale:Ui,isElement:mn,isRTL:RD};function DD(e,t){let r=null,n;const s=Ts(e);function o(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:u,top:d,width:f,height:p}=e.getBoundingClientRect();if(a||t(),!f||!p)return;const m=Gc(d),x=Gc(s.clientWidth-(u+f)),g=Gc(s.clientHeight-(d+p)),w=Gc(u),h={rootMargin:-m+"px "+-x+"px "+-g+"px "+-w+"px",threshold:Dr(0,Pn(1,l))||1};let _=!0;function C(E){const T=E[0].intersectionRatio;if(T!==l){if(!_)return i();T?i(!1,T):n=setTimeout(()=>{i(!1,1e-7)},1e3)}_=!1}try{r=new IntersectionObserver(C,{...h,root:s.ownerDocument})}catch{r=new IntersectionObserver(C,h)}r.observe(e)}return i(!0),o}function AD(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=Tg(e),d=s||o?[...u?Ol(u):[],...Ol(t)]:[];d.forEach(v=>{s&&v.addEventListener("scroll",r,{passive:!0}),o&&v.addEventListener("resize",r)});const f=u&&a?DD(u,r):null;let p=-1,m=null;i&&(m=new ResizeObserver(v=>{let[h]=v;h&&h.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(t)})),r()}),u&&!l&&m.observe(u),m.observe(t));let x,g=l?Ho(e):null;l&&w();function w(){const v=Ho(e);g&&(v.x!==g.x||v.y!==g.y||v.width!==g.width||v.height!==g.height)&&r(),g=v,x=requestAnimationFrame(w)}return r(),()=>{var v;d.forEach(h=>{s&&h.removeEventListener("scroll",r),o&&h.removeEventListener("resize",r)}),f==null||f(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(x)}}const OD=fD,MD=hD,ID=cD,LD=mD,FD=uD,Kx=lD,zD=pD,UD=(e,t,r)=>{const n=new Map,s={platform:PD,...r},o={...s.platform,_c:n};return aD(e,t,{...s,platform:o})};var _u=typeof document<"u"?y.useLayoutEffect:y.useEffect;function cd(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(!cd(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 o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!cd(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function N1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gx(e,t){const r=N1(e);return Math.round(t*r)/r}function qx(e){const t=y.useRef(e);return _u(()=>{t.current=e}),t}function VD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,f]=y.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=y.useState(n);cd(p,n)||m(n);const[x,g]=y.useState(null),[w,v]=y.useState(null),h=y.useCallback($=>{$!==T.current&&(T.current=$,g($))},[]),_=y.useCallback($=>{$!==R.current&&(R.current=$,v($))},[]),C=o||x,E=i||w,T=y.useRef(null),R=y.useRef(null),D=y.useRef(d),P=l!=null,L=qx(l),q=qx(s),j=y.useCallback(()=>{if(!T.current||!R.current)return;const $={placement:t,strategy:r,middleware:p};q.current&&($.platform=q.current),UD(T.current,R.current,$).then(Z=>{const I={...Z,isPositioned:!0};F.current&&!cd(D.current,I)&&(D.current=I,ks.flushSync(()=>{f(I)}))})},[p,t,r,q]);_u(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[u]);const F=y.useRef(!1);_u(()=>(F.current=!0,()=>{F.current=!1}),[]),_u(()=>{if(C&&(T.current=C),E&&(R.current=E),C&&E){if(L.current)return L.current(C,E,j);j()}},[C,E,j,L,P]);const b=y.useMemo(()=>({reference:T,floating:R,setReference:h,setFloating:_}),[h,_]),W=y.useMemo(()=>({reference:C,floating:E}),[C,E]),te=y.useMemo(()=>{const $={position:r,left:0,top:0};if(!W.floating)return $;const Z=Gx(W.floating,d.x),I=Gx(W.floating,d.y);return a?{...$,transform:"translate("+Z+"px, "+I+"px)",...N1(W.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Z,top:I}},[r,a,W.floating,d.x,d.y]);return y.useMemo(()=>({...d,update:j,refs:b,elements:W,floatingStyles:te}),[d,j,b,W,te])}const WD=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?Kx({element:n.current,padding:s}).fn(r):{}:n?Kx({element:n,padding:s}).fn(r):{}}}},$D=(e,t)=>({...OD(e),options:[e,t]}),BD=(e,t)=>({...MD(e),options:[e,t]}),HD=(e,t)=>({...zD(e),options:[e,t]}),YD=(e,t)=>({...ID(e),options:[e,t]}),ZD=(e,t)=>({...LD(e),options:[e,t]}),KD=(e,t)=>({...FD(e),options:[e,t]}),GD=(e,t)=>({...WD(e),options:[e,t]});var qD="Arrow",R1=y.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return c.jsx(ze.svg,{...o,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"})})});R1.displayName=qD;var XD=R1;function P1(e){const[t,r]=y.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 o=s[0];let i,a;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;r({width:i,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var jg="Popper",[D1,ya]=Qr(jg),[QD,A1]=D1(jg),O1=e=>{const{__scopePopper:t,children:r}=e,[n,s]=y.useState(null);return c.jsx(QD,{scope:t,anchor:n,onAnchorChange:s,children:r})};O1.displayName=jg;var M1="PopperAnchor",I1=y.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=A1(M1,r),i=y.useRef(null),a=Xe(t,i);return y.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:c.jsx(ze.div,{...s,ref:a})});I1.displayName=M1;var Ng="PopperContent",[JD,eA]=D1(Ng),L1=y.forwardRef((e,t)=>{var fe,ve,be,Pe,je,ke;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:x,...g}=e,w=A1(Ng,r),[v,h]=y.useState(null),_=Xe(t,rt=>h(rt)),[C,E]=y.useState(null),T=P1(C),R=(T==null?void 0:T.width)??0,D=(T==null?void 0:T.height)??0,P=n+(o!=="center"?"-"+o:""),L=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},q=Array.isArray(u)?u:[u],j=q.length>0,F={padding:L,boundary:q.filter(rA),altBoundary:j},{refs:b,floatingStyles:W,placement:te,isPositioned:$,middlewareData:Z}=VD({strategy:"fixed",placement:P,whileElementsMounted:(...rt)=>AD(...rt,{animationFrame:m==="always"}),elements:{reference:w.anchor},middleware:[$D({mainAxis:s+D,alignmentAxis:i}),l&&BD({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?HD():void 0,...F}),l&&YD({...F}),ZD({...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&&GD({element:C,padding:a}),nA({arrowWidth:R,arrowHeight:D}),p&&KD({strategy:"referenceHidden",...F})]}),[I,Q]=U1(te),z=At(x);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=((be=Z.arrow)==null?void 0:be.centerOffset)!==0,[se,Te]=y.useState();return nr(()=>{v&&Te(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":[(Pe=Z.transformOrigin)==null?void 0:Pe.x,(je=Z.transformOrigin)==null?void 0:je.y].join(" "),...((ke=Z.hide)==null?void 0:ke.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(JD,{scope:r,placedSide:I,onArrowChange:E,arrowX:V,arrowY:de,shouldHideArrow:ne,children:c.jsx(ze.div,{"data-side":I,"data-align":Q,...g,ref:_,style:{...g.style,animation:$?void 0:"none"}})})})});L1.displayName=Ng;var F1="PopperArrow",tA={top:"bottom",right:"left",bottom:"top",left:"right"},z1=y.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=eA(F1,n),i=tA[o.placedSide];return c.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:c.jsx(XD,{...s,ref:r,style:{...s.style,display:"block"}})})});z1.displayName=F1;function rA(e){return e!==null}var nA=e=>({name:"transformOrigin",options:e,fn(t){var w,v,h;const{placement:r,rects:n,middlewareData:s}=t,i=((w=s.arrow)==null?void 0:w.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,d]=U1(r),f={start:"0%",center:"50%",end:"100%"}[d],p=(((v=s.arrow)==null?void 0:v.x)??0)+a/2,m=(((h=s.arrow)==null?void 0:h.y)??0)+l/2;let x="",g="";return u==="bottom"?(x=i?f:`${p}px`,g=`${-l}px`):u==="top"?(x=i?f:`${p}px`,g=`${n.floating.height+l}px`):u==="right"?(x=`${-l}px`,g=i?f:`${m}px`):u==="left"&&(x=`${n.floating.width+l}px`,g=i?f:`${m}px`),{data:{x,y:g}}}});function U1(e){const[t,r="center"]=e.split("-");return[t,r]}var Rg=O1,Pg=I1,Dg=L1,Ag=z1,sA="Portal",lc=y.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,o]=y.useState(!1);nr(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?W_.createPortal(c.jsx(ze.div,{...n,ref:t}),i):null});lc.displayName=sA;function oA(e,t){return y.useReducer((r,n)=>t[r][n]??r,e)}var Er=e=>{const{present:t,children:r}=e,n=iA(t),s=typeof r=="function"?r({present:n.isPresent}):y.Children.only(r),o=Xe(n.ref,aA(s));return typeof r=="function"||n.isPresent?y.cloneElement(s,{ref:o}):null};Er.displayName="Presence";function iA(e){const[t,r]=y.useState(),n=y.useRef({}),s=y.useRef(e),o=y.useRef("none"),i=e?"mounted":"unmounted",[a,l]=oA(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const u=qc(n.current);o.current=a==="mounted"?u:"none"},[a]),nr(()=>{const u=n.current,d=s.current;if(d!==e){const p=o.current,m=qc(u);e?l("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),nr(()=>{if(t){const u=f=>{const m=qc(n.current).includes(f.animationName);f.target===t&&m&&ks.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=qc(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:y.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function qc(e){return(e==null?void 0:e.animationName)||"none"}function aA(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 _h="rovingFocusGroup.onEntryFocus",lA={bubbles:!1,cancelable:!0},af="RovingFocusGroup",[Up,V1,cA]=tf(af),[uA,W1]=Qr(af,[cA]),[dA,fA]=uA(af),$1=y.forwardRef((e,t)=>c.jsx(Up.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Up.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(hA,{...e,ref:t})})}));$1.displayName=af;var hA=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=y.useRef(null),m=Xe(t,p),x=rf(o),[g=null,w]=io({prop:i,defaultProp:a,onChange:l}),[v,h]=y.useState(!1),_=At(u),C=V1(r),E=y.useRef(!1),[T,R]=y.useState(0);return y.useEffect(()=>{const D=p.current;if(D)return D.addEventListener(_h,_),()=>D.removeEventListener(_h,_)},[_]),c.jsx(dA,{scope:r,orientation:n,dir:x,loop:s,currentTabStopId:g,onItemFocus:y.useCallback(D=>w(D),[w]),onItemShiftTab:y.useCallback(()=>h(!0),[]),onFocusableItemAdd:y.useCallback(()=>R(D=>D+1),[]),onFocusableItemRemove:y.useCallback(()=>R(D=>D-1),[]),children:c.jsx(ze.div,{tabIndex:v||T===0?-1:0,"data-orientation":n,...f,ref:m,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(_h,lA);if(D.currentTarget.dispatchEvent(L),!L.defaultPrevented){const q=C().filter(te=>te.focusable),j=q.find(te=>te.active),F=q.find(te=>te.id===g),W=[j,F,...q].filter(Boolean).map(te=>te.ref.current);Y1(W,d)}}E.current=!1}),onBlur:ue(e.onBlur,()=>h(!1))})})}),B1="RovingFocusGroupItem",H1=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,...i}=e,a=Mn(),l=o||a,u=fA(B1,r),d=u.currentTabStopId===l,f=V1(r),{onFocusableItemAdd:p,onFocusableItemRemove:m}=u;return y.useEffect(()=>{if(n)return p(),()=>m()},[n,p,m]),c.jsx(Up.ItemSlot,{scope:r,id:l,focusable:n,active:s,children:c.jsx(ze.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...i,ref:t,onMouseDown:ue(e.onMouseDown,x=>{n?u.onItemFocus(l):x.preventDefault()}),onFocus:ue(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:ue(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const g=gA(x,u.orientation,u.dir);if(g!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let v=f().filter(h=>h.focusable).map(h=>h.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();const h=v.indexOf(x.currentTarget);v=u.loop?vA(v,h+1):v.slice(h+1)}setTimeout(()=>Y1(v))}})})})});H1.displayName=B1;var pA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function gA(e,t,r){const n=mA(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return pA[n]}function Y1(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function vA(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var yA=$1,xA=H1,wA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},di=new WeakMap,Xc=new WeakMap,Qc={},bh=0,Z1=function(e){return e&&(e.host||Z1(e.parentNode))},_A=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Z1(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})},bA=function(e,t,r,n){var s=_A(t,Array.isArray(e)?e:[e]);Qc[r]||(Qc[r]=new WeakMap);var o=Qc[r],i=[],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(p){if(a.has(p))d(p);else try{var m=p.getAttribute(n),x=m!==null&&m!=="false",g=(di.get(p)||0)+1,w=(o.get(p)||0)+1;di.set(p,g),o.set(p,w),i.push(p),g===1&&x&&Xc.set(p,!0),w===1&&p.setAttribute(r,"true"),x||p.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return d(t),a.clear(),bh++,function(){i.forEach(function(f){var p=di.get(f)-1,m=o.get(f)-1;di.set(f,p),o.set(f,m),p||(Xc.has(f)||f.removeAttribute(n),Xc.delete(f)),m||f.removeAttribute(r)}),bh--,bh||(di=new WeakMap,di=new WeakMap,Xc=new WeakMap,Qc={})}},Og=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=wA(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),bA(n,s,r,"aria-hidden")):function(){return null}},jn=function(){return jn=Object.assign||function(t){for(var r,n=1,s=arguments.length;n"u")return zA;var t=UA(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])}},WA=X1(),Vi="data-scroll-locked",$A=function(e,t,r,n){var s=e.left,o=e.top,i=e.right,a=e.gap;return r===void 0&&(r="margin"),` .`.concat(kA,` { overflow: hidden `).concat(n,`; padding-right: `).concat(a,"px ").concat(n,`; } body[`).concat(Vi,`] { overflow: hidden `).concat(n,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` padding-left: `.concat(s,`px; padding-top: `).concat(o,`px; padding-right: `).concat(i,`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(bu,` { right: `).concat(a,"px ").concat(n,`; } .`).concat(Su,` { margin-right: `).concat(a,"px ").concat(n,`; } .`).concat(bu," .").concat(bu,` { right: 0 `).concat(n,`; } .`).concat(Su," .").concat(Su,` { margin-right: 0 `).concat(n,`; } body[`).concat(Vi,`] { `).concat(CA,": ").concat(a,`px; } `)},Qx=function(){var e=parseInt(document.body.getAttribute(Vi)||"0",10);return isFinite(e)?e:0},BA=function(){y.useEffect(function(){return document.body.setAttribute(Vi,(Qx()+1).toString()),function(){var e=Qx()-1;e<=0?document.body.removeAttribute(Vi):document.body.setAttribute(Vi,e.toString())}},[])},HA=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;BA();var o=y.useMemo(function(){return VA(s)},[s]);return y.createElement(WA,{styles:$A(o,!t,s,r?"":"!important")})},Vp=!1;if(typeof window<"u")try{var Jc=Object.defineProperty({},"passive",{get:function(){return Vp=!0,!0}});window.addEventListener("test",Jc,Jc),window.removeEventListener("test",Jc,Jc)}catch{Vp=!1}var fi=Vp?{passive:!1}:!1,YA=function(e){return e.tagName==="TEXTAREA"},Q1=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!YA(e)&&r[t]==="visible")},ZA=function(e){return Q1(e,"overflowY")},KA=function(e){return Q1(e,"overflowX")},Jx=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=J1(e,n);if(s){var o=eb(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},GA=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},qA=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},J1=function(e,t){return e==="v"?ZA(t):KA(t)},eb=function(e,t){return e==="v"?GA(t):qA(t)},XA=function(e,t){return e==="h"&&t==="rtl"?-1:1},QA=function(e,t,r,n,s){var o=XA(e,window.getComputedStyle(t).direction),i=o*n,a=r.target,l=t.contains(a),u=!1,d=i>0,f=0,p=0;do{var m=eb(e,a),x=m[0],g=m[1],w=m[2],v=g-w-o*x;(x||v)&&J1(e,a)&&(f+=v,p+=x),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(p)<1||!s))&&(u=!0),u},eu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},e0=function(e){return[e.deltaX,e.deltaY]},t0=function(e){return e&&"current"in e?e.current:e},JA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},eO=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},tO=0,hi=[];function rO(e){var t=y.useRef([]),r=y.useRef([0,0]),n=y.useRef(),s=y.useState(tO++)[0],o=y.useState(X1)[0],i=y.useRef(e);y.useEffect(function(){i.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=SA([e.lockRef.current],(e.shards||[]).map(t0),!0).filter(Boolean);return g.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=y.useCallback(function(g,w){if("touches"in g&&g.touches.length===2)return!i.current.allowPinchZoom;var v=eu(g),h=r.current,_="deltaX"in g?g.deltaX:h[0]-v[0],C="deltaY"in g?g.deltaY:h[1]-v[1],E,T=g.target,R=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in g&&R==="h"&&T.type==="range")return!1;var D=Jx(R,T);if(!D)return!0;if(D?E=R:(E=R==="v"?"h":"v",D=Jx(R,T)),!D)return!1;if(!n.current&&"changedTouches"in g&&(_||C)&&(n.current=E),!E)return!0;var P=n.current||E;return QA(P,w,g,P==="h"?_:C,!0)},[]),l=y.useCallback(function(g){var w=g;if(!(!hi.length||hi[hi.length-1]!==o)){var v="deltaY"in w?e0(w):eu(w),h=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&JA(E.delta,v)})[0];if(h&&h.should){w.cancelable&&w.preventDefault();return}if(!h){var _=(i.current.shards||[]).map(t0).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=_.length>0?a(w,_[0]):!i.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),u=y.useCallback(function(g,w,v,h){var _={name:g,delta:w,target:v,should:h,shadowParent:nO(v)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),d=y.useCallback(function(g){r.current=eu(g),n.current=void 0},[]),f=y.useCallback(function(g){u(g.type,e0(g),g.target,a(g,e.lockRef.current))},[]),p=y.useCallback(function(g){u(g.type,eu(g),g.target,a(g,e.lockRef.current))},[]);y.useEffect(function(){return hi.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,fi),document.addEventListener("touchmove",l,fi),document.addEventListener("touchstart",d,fi),function(){hi=hi.filter(function(g){return g!==o}),document.removeEventListener("wheel",l,fi),document.removeEventListener("touchmove",l,fi),document.removeEventListener("touchstart",d,fi)}},[]);var m=e.removeScrollBar,x=e.inert;return y.createElement(y.Fragment,null,x?y.createElement(o,{styles:eO(s)}):null,m?y.createElement(HA,{gapMode:e.gapMode}):null)}function nO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const sO=DA(q1,rO);var cf=y.forwardRef(function(e,t){return y.createElement(lf,jn({},e,{ref:t,sideCar:sO}))});cf.classNames=lf.classNames;var Wp=["Enter"," "],oO=["ArrowDown","PageUp","Home"],tb=["ArrowUp","PageDown","End"],iO=[...oO,...tb],aO={ltr:[...Wp,"ArrowRight"],rtl:[...Wp,"ArrowLeft"]},lO={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cc="Menu",[Ml,cO,uO]=tf(cc),[Qo,rb]=Qr(cc,[uO,ya,W1]),uf=ya(),nb=W1(),[dO,Jo]=Qo(cc),[fO,uc]=Qo(cc),sb=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:o,modal:i=!0}=e,a=uf(t),[l,u]=y.useState(null),d=y.useRef(!1),f=At(o),p=rf(s);return y.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),c.jsx(Rg,{...a,children:c.jsx(dO,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:u,children:c.jsx(fO,{scope:t,onClose:y.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:i,children:n})})})};sb.displayName=cc;var hO="MenuAnchor",Mg=y.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=uf(r);return c.jsx(Pg,{...s,...n,ref:t})});Mg.displayName=hO;var Ig="MenuPortal",[pO,ob]=Qo(Ig,{forceMount:void 0}),ib=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,o=Jo(Ig,t);return c.jsx(pO,{scope:t,forceMount:r,children:c.jsx(Er,{present:r||o.open,children:c.jsx(lc,{asChild:!0,container:s,children:n})})})};ib.displayName=Ig;var Gr="MenuContent",[mO,Lg]=Qo(Gr),ab=y.forwardRef((e,t)=>{const r=ob(Gr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Jo(Gr,e.__scopeMenu),i=uc(Gr,e.__scopeMenu);return c.jsx(Ml.Provider,{scope:e.__scopeMenu,children:c.jsx(Er,{present:n||o.open,children:c.jsx(Ml.Slot,{scope:e.__scopeMenu,children:i.modal?c.jsx(gO,{...s,ref:t}):c.jsx(vO,{...s,ref:t})})})})}),gO=y.forwardRef((e,t)=>{const r=Jo(Gr,e.__scopeMenu),n=y.useRef(null),s=Xe(t,n);return y.useEffect(()=>{const o=n.current;if(o)return Og(o)},[]),c.jsx(Fg,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ue(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),vO=y.forwardRef((e,t)=>{const r=Jo(Gr,e.__scopeMenu);return c.jsx(Fg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Fg=y.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:x,...g}=e,w=Jo(Gr,r),v=uc(Gr,r),h=uf(r),_=nb(r),C=cO(r),[E,T]=y.useState(null),R=y.useRef(null),D=Xe(t,R,w.onContentChange),P=y.useRef(0),L=y.useRef(""),q=y.useRef(0),j=y.useRef(null),F=y.useRef("right"),b=y.useRef(0),W=x?cf:y.Fragment,te=x?{as:ys,allowPinchZoom:!0}:void 0,$=I=>{var fe,ve;const Q=L.current+I,z=C().filter(be=>!be.disabled),V=document.activeElement,de=(fe=z.find(be=>be.ref.current===V))==null?void 0:fe.textValue,ne=z.map(be=>be.textValue),se=NO(ne,Q,de),Te=(ve=z.find(be=>be.textValue===se))==null?void 0:ve.ref.current;(function be(Pe){L.current=Pe,window.clearTimeout(P.current),Pe!==""&&(P.current=window.setTimeout(()=>be(""),1e3))})(Q),Te&&setTimeout(()=>Te.focus())};y.useEffect(()=>()=>window.clearTimeout(P.current),[]),_g();const Z=y.useCallback(I=>{var z,V;return F.current===((z=j.current)==null?void 0:z.side)&&PO(I,(V=j.current)==null?void 0:V.area)},[]);return c.jsx(mO,{scope:r,searchRef:L,onItemEnter:y.useCallback(I=>{Z(I)&&I.preventDefault()},[Z]),onItemLeave:y.useCallback(I=>{var Q;Z(I)||((Q=R.current)==null||Q.focus(),T(null))},[Z]),onTriggerLeave:y.useCallback(I=>{Z(I)&&I.preventDefault()},[Z]),pointerGraceTimerRef:q,onPointerGraceIntentChange:y.useCallback(I=>{j.current=I},[]),children:c.jsx(W,{...te,children:c.jsx(nf,{asChild:!0,trapped:s,onMountAutoFocus:ue(o,I=>{var Q;I.preventDefault(),(Q=R.current)==null||Q.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:c.jsx(ma,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:c.jsx(yA,{asChild:!0,..._,dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:E,onCurrentTabStopIdChange:T,onEntryFocus:ue(l,I=>{v.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(Dg,{role:"menu","aria-orientation":"vertical","data-state":Sb(w.open),"data-radix-menu-content":"",dir:v.dir,...h,...g,ref:D,style:{outline:"none",...g.style},onKeyDown:ue(g.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||!iO.includes(I.key))return;I.preventDefault();const Te=C().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);tb.includes(I.key)&&Te.reverse(),TO(Te)}),onBlur:ue(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(P.current),L.current="")}),onPointerMove:ue(e.onPointerMove,Il(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}}))})})})})})})});ab.displayName=Gr;var yO="MenuGroup",zg=y.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return c.jsx(ze.div,{role:"group",...n,ref:t})});zg.displayName=yO;var xO="MenuLabel",lb=y.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return c.jsx(ze.div,{...n,ref:t})});lb.displayName=xO;var ud="MenuItem",r0="menu.itemSelect",df=y.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,o=y.useRef(null),i=uc(ud,e.__scopeMenu),a=Lg(ud,e.__scopeMenu),l=Xe(t,o),u=y.useRef(!1),d=()=>{const f=o.current;if(!r&&f){const p=new CustomEvent(r0,{bubbles:!0,cancelable:!0});f.addEventListener(r0,m=>n==null?void 0:n(m),{once:!0}),wg(f,p),p.defaultPrevented?u.current=!1:i.onClose()}};return c.jsx(cb,{...s,ref:l,disabled:r,onClick:ue(e.onClick,d),onPointerDown:f=>{var p;(p=e.onPointerDown)==null||p.call(e,f),u.current=!0},onPointerUp:ue(e.onPointerUp,f=>{var p;u.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:ue(e.onKeyDown,f=>{const p=a.searchRef.current!=="";r||p&&f.key===" "||Wp.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});df.displayName=ud;var cb=y.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...o}=e,i=Lg(ud,r),a=nb(r),l=y.useRef(null),u=Xe(t,l),[d,f]=y.useState(!1),[p,m]=y.useState("");return y.useEffect(()=>{const x=l.current;x&&m((x.textContent??"").trim())},[o.children]),c.jsx(Ml.ItemSlot,{scope:r,disabled:n,textValue:s??p,children:c.jsx(xA,{asChild:!0,...a,focusable:!n,children:c.jsx(ze.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:u,onPointerMove:ue(e.onPointerMove,Il(x=>{n?i.onItemLeave(x):(i.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ue(e.onPointerLeave,Il(x=>i.onItemLeave(x))),onFocus:ue(e.onFocus,()=>f(!0)),onBlur:ue(e.onBlur,()=>f(!1))})})})}),wO="MenuCheckboxItem",ub=y.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return c.jsx(mb,{scope:e.__scopeMenu,checked:r,children:c.jsx(df,{role:"menuitemcheckbox","aria-checked":dd(r)?"mixed":r,...s,ref:t,"data-state":Vg(r),onSelect:ue(s.onSelect,()=>n==null?void 0:n(dd(r)?!0:!r),{checkForDefaultPrevented:!1})})})});ub.displayName=wO;var db="MenuRadioGroup",[_O,bO]=Qo(db,{value:void 0,onValueChange:()=>{}}),fb=y.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,o=At(n);return c.jsx(_O,{scope:e.__scopeMenu,value:r,onValueChange:o,children:c.jsx(zg,{...s,ref:t})})});fb.displayName=db;var hb="MenuRadioItem",pb=y.forwardRef((e,t)=>{const{value:r,...n}=e,s=bO(hb,e.__scopeMenu),o=r===s.value;return c.jsx(mb,{scope:e.__scopeMenu,checked:o,children:c.jsx(df,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":Vg(o),onSelect:ue(n.onSelect,()=>{var i;return(i=s.onValueChange)==null?void 0:i.call(s,r)},{checkForDefaultPrevented:!1})})})});pb.displayName=hb;var Ug="MenuItemIndicator",[mb,SO]=Qo(Ug,{checked:!1}),gb=y.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,o=SO(Ug,r);return c.jsx(Er,{present:n||dd(o.checked)||o.checked===!0,children:c.jsx(ze.span,{...s,ref:t,"data-state":Vg(o.checked)})})});gb.displayName=Ug;var kO="MenuSeparator",vb=y.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return c.jsx(ze.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});vb.displayName=kO;var CO="MenuArrow",yb=y.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=uf(r);return c.jsx(Ag,{...s,...n,ref:t})});yb.displayName=CO;var EO="MenuSub",[h8,xb]=Qo(EO),Ha="MenuSubTrigger",wb=y.forwardRef((e,t)=>{const r=Jo(Ha,e.__scopeMenu),n=uc(Ha,e.__scopeMenu),s=xb(Ha,e.__scopeMenu),o=Lg(Ha,e.__scopeMenu),i=y.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,u={__scopeMenu:e.__scopeMenu},d=y.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return y.useEffect(()=>d,[d]),y.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),c.jsx(Mg,{asChild:!0,...u,children:c.jsx(cb,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":Sb(r.open),...e,ref:Jd(t,s.onTriggerChange),onClick:f=>{var p;(p=e.onClick)==null||p.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ue(e.onPointerMove,Il(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:ue(e.onPointerLeave,Il(f=>{var m,x;d();const p=(m=r.content)==null?void 0:m.getBoundingClientRect();if(p){const g=(x=r.content)==null?void 0:x.dataset.side,w=g==="right",v=w?-5:5,h=p[w?"left":"right"],_=p[w?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+v,y:f.clientY},{x:h,y:p.top},{x:_,y:p.top},{x:_,y:p.bottom},{x:h,y:p.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:ue(e.onKeyDown,f=>{var m;const p=o.searchRef.current!=="";e.disabled||p&&f.key===" "||aO[n.dir].includes(f.key)&&(r.onOpenChange(!0),(m=r.content)==null||m.focus(),f.preventDefault())})})})});wb.displayName=Ha;var _b="MenuSubContent",bb=y.forwardRef((e,t)=>{const r=ob(Gr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Jo(Gr,e.__scopeMenu),i=uc(Gr,e.__scopeMenu),a=xb(_b,e.__scopeMenu),l=y.useRef(null),u=Xe(t,l);return c.jsx(Ml.Provider,{scope:e.__scopeMenu,children:c.jsx(Er,{present:n||o.open,children:c.jsx(Ml.Slot,{scope:e.__scopeMenu,children:c.jsx(Fg,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;i.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ue(e.onFocusOutside,d=>{d.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:ue(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:ue(e.onKeyDown,d=>{var m;const f=d.currentTarget.contains(d.target),p=lO[i.dir].includes(d.key);f&&p&&(o.onOpenChange(!1),(m=a.trigger)==null||m.focus(),d.preventDefault())})})})})})});bb.displayName=_b;function Sb(e){return e?"open":"closed"}function dd(e){return e==="indeterminate"}function Vg(e){return dd(e)?"indeterminate":e?"checked":"unchecked"}function TO(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function jO(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function NO(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=jO(e,Math.max(o,0));s.length===1&&(i=i.filter(u=>u!==r));const l=i.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function RO(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;on!=d>n&&r<(u-a)*(n-l)/(d-l)+a&&(s=!s)}return s}function PO(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return RO(r,t)}function Il(e){return t=>t.pointerType==="mouse"?e(t):void 0}var DO=sb,AO=Mg,OO=ib,MO=ab,IO=zg,LO=lb,FO=df,zO=ub,UO=fb,VO=pb,WO=gb,$O=vb,BO=yb,HO=wb,YO=bb,Wg="DropdownMenu",[ZO,p8]=Qr(Wg,[rb]),yr=rb(),[KO,kb]=ZO(Wg),Cb=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,l=yr(t),u=y.useRef(null),[d=!1,f]=io({prop:s,defaultProp:o,onChange:i});return c.jsx(KO,{scope:t,triggerId:Mn(),triggerRef:u,contentId:Mn(),open:d,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(p=>!p),[f]),modal:a,children:c.jsx(DO,{...l,open:d,onOpenChange:f,dir:n,modal:a,children:r})})};Cb.displayName=Wg;var Eb="DropdownMenuTrigger",Tb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,o=kb(Eb,r),i=yr(r);return c.jsx(AO,{asChild:!0,...i,children:c.jsx(ze.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:Jd(t,o.triggerRef),onPointerDown:ue(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:ue(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Tb.displayName=Eb;var GO="DropdownMenuPortal",jb=e=>{const{__scopeDropdownMenu:t,...r}=e,n=yr(t);return c.jsx(OO,{...n,...r})};jb.displayName=GO;var Nb="DropdownMenuContent",Rb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=kb(Nb,r),o=yr(r),i=y.useRef(!1);return c.jsx(MO,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...n,ref:t,onCloseAutoFocus:ue(e.onCloseAutoFocus,a=>{var l;i.current||(l=s.triggerRef.current)==null||l.focus(),i.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)&&(i.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)"}})});Rb.displayName=Nb;var qO="DropdownMenuGroup",XO=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(IO,{...s,...n,ref:t})});XO.displayName=qO;var QO="DropdownMenuLabel",Pb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(LO,{...s,...n,ref:t})});Pb.displayName=QO;var JO="DropdownMenuItem",Db=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(FO,{...s,...n,ref:t})});Db.displayName=JO;var eM="DropdownMenuCheckboxItem",Ab=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(zO,{...s,...n,ref:t})});Ab.displayName=eM;var tM="DropdownMenuRadioGroup",rM=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(UO,{...s,...n,ref:t})});rM.displayName=tM;var nM="DropdownMenuRadioItem",Ob=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(VO,{...s,...n,ref:t})});Ob.displayName=nM;var sM="DropdownMenuItemIndicator",Mb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(WO,{...s,...n,ref:t})});Mb.displayName=sM;var oM="DropdownMenuSeparator",Ib=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx($O,{...s,...n,ref:t})});Ib.displayName=oM;var iM="DropdownMenuArrow",aM=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(BO,{...s,...n,ref:t})});aM.displayName=iM;var lM="DropdownMenuSubTrigger",Lb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(HO,{...s,...n,ref:t})});Lb.displayName=lM;var cM="DropdownMenuSubContent",Fb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return c.jsx(YO,{...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)"}})});Fb.displayName=cM;var uM=Cb,dM=Tb,fM=jb,zb=Rb,Ub=Pb,Vb=Db,Wb=Ab,$b=Ob,Bb=Mb,Hb=Ib,Yb=Lb,Zb=Fb;const Kb=uM,Gb=dM,hM=y.forwardRef(({className:e,inset:t,children:r,...n},s)=>c.jsxs(Yb,{ref:s,className:me("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(MR,{className:"ml-auto h-4 w-4"})]}));hM.displayName=Yb.displayName;const pM=y.forwardRef(({className:e,...t},r)=>c.jsx(Zb,{ref:r,className:me("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}));pM.displayName=Zb.displayName;const $g=y.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(fM,{children:c.jsx(zb,{ref:n,sideOffset:t,className:me("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})}));$g.displayName=zb.displayName;const Wi=y.forwardRef(({className:e,inset:t,...r},n)=>c.jsx(Vb,{ref:n,className:me("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}));Wi.displayName=Vb.displayName;const mM=y.forwardRef(({className:e,children:t,checked:r,...n},s)=>c.jsxs(Wb,{ref:s,className:me("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(Bb,{children:c.jsx(a1,{className:"h-4 w-4"})})}),t]}));mM.displayName=Wb.displayName;const gM=y.forwardRef(({className:e,children:t,...r},n)=>c.jsxs($b,{ref:n,className:me("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(Bb,{children:c.jsx(FR,{className:"h-2 w-2 fill-current"})})}),t]}));gM.displayName=$b.displayName;const qb=y.forwardRef(({className:e,inset:t,...r},n)=>c.jsx(Ub,{ref:n,className:me("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));qb.displayName=Ub.displayName;const Xb=y.forwardRef(({className:e,...t},r)=>c.jsx(Hb,{ref:r,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));Xb.displayName=Hb.displayName;var Bg="Dialog",[Qb,Jb]=Qr(Bg),[vM,_n]=Qb(Bg),eS=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=y.useRef(null),l=y.useRef(null),[u=!1,d]=io({prop:n,defaultProp:s,onChange:o});return c.jsx(vM,{scope:t,triggerRef:a,contentRef:l,contentId:Mn(),titleId:Mn(),descriptionId:Mn(),open:u,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(f=>!f),[d]),modal:i,children:r})};eS.displayName=Bg;var tS="DialogTrigger",rS=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=_n(tS,r),o=Xe(t,s.triggerRef);return c.jsx(ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Zg(s.open),...n,ref:o,onClick:ue(e.onClick,s.onOpenToggle)})});rS.displayName=tS;var Hg="DialogPortal",[yM,nS]=Qb(Hg,{forceMount:void 0}),sS=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=_n(Hg,t);return c.jsx(yM,{scope:t,forceMount:r,children:y.Children.map(n,i=>c.jsx(Er,{present:r||o.open,children:c.jsx(lc,{asChild:!0,container:s,children:i})}))})};sS.displayName=Hg;var fd="DialogOverlay",oS=y.forwardRef((e,t)=>{const r=nS(fd,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=_n(fd,e.__scopeDialog);return o.modal?c.jsx(Er,{present:n||o.open,children:c.jsx(xM,{...s,ref:t})}):null});oS.displayName=fd;var xM=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=_n(fd,r);return c.jsx(cf,{as:ys,allowPinchZoom:!0,shards:[s.contentRef],children:c.jsx(ze.div,{"data-state":Zg(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Yo="DialogContent",iS=y.forwardRef((e,t)=>{const r=nS(Yo,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=_n(Yo,e.__scopeDialog);return c.jsx(Er,{present:n||o.open,children:o.modal?c.jsx(wM,{...s,ref:t}):c.jsx(_M,{...s,ref:t})})});iS.displayName=Yo;var wM=y.forwardRef((e,t)=>{const r=_n(Yo,e.__scopeDialog),n=y.useRef(null),s=Xe(t,r.contentRef,n);return y.useEffect(()=>{const o=n.current;if(o)return Og(o)},[]),c.jsx(aS,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ue(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ue(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:ue(e.onFocusOutside,o=>o.preventDefault())})}),_M=y.forwardRef((e,t)=>{const r=_n(Yo,e.__scopeDialog),n=y.useRef(!1),s=y.useRef(!1);return c.jsx(aS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((u=r.triggerRef.current)==null?void 0:u.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),aS=y.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=_n(Yo,r),l=y.useRef(null),u=Xe(t,l);return _g(),c.jsxs(c.Fragment,{children:[c.jsx(nf,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:c.jsx(ma,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Zg(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(SM,{titleId:a.titleId}),c.jsx(CM,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Yg="DialogTitle",lS=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=_n(Yg,r);return c.jsx(ze.h2,{id:s.titleId,...n,ref:t})});lS.displayName=Yg;var cS="DialogDescription",uS=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=_n(cS,r);return c.jsx(ze.p,{id:s.descriptionId,...n,ref:t})});uS.displayName=cS;var dS="DialogClose",fS=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=_n(dS,r);return c.jsx(ze.button,{type:"button",...n,ref:t,onClick:ue(e.onClick,()=>s.onOpenChange(!1))})});fS.displayName=dS;function Zg(e){return e?"open":"closed"}var hS="DialogTitleWarning",[bM,pS]=RP(hS,{contentName:Yo,titleName:Yg,docsSlug:"dialog"}),SM=({titleId:e})=>{const t=pS(hS),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 y.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},kM="DialogDescriptionWarning",CM=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pS(kM).contentName}}.`;return y.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Kg=eS,Gg=rS,qg=sS,dc=oS,fc=iS,hc=lS,pc=uS,ff=fS;const Xg=Kg,Qg=Gg,EM=qg,mS=y.forwardRef(({className:e,...t},r)=>c.jsx(dc,{className:me("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}));mS.displayName=dc.displayName;const TM=ic("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"}}),hf=y.forwardRef(({side:e="right",className:t,children:r,...n},s)=>c.jsxs(EM,{children:[c.jsx(mS,{}),c.jsxs(fc,{ref:s,className:me(TM({side:e}),t),...n,children:[r,c.jsxs(ff,{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(vg,{className:"h-4 w-4 dark:text-stone-200"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));hf.displayName=fc.displayName;const Jg=({className:e,...t})=>c.jsx("div",{className:me("flex flex-col space-y-2 text-center sm:text-left",e),...t});Jg.displayName="SheetHeader";const ev=y.forwardRef(({className:e,...t},r)=>c.jsx(hc,{ref:r,className:me("text-lg font-semibold text-foreground",e),...t}));ev.displayName=hc.displayName;const jM=y.forwardRef(({className:e,...t},r)=>c.jsx(pc,{ref:r,className:me("text-sm text-muted-foreground",e),...t}));jM.displayName=pc.displayName;class Ir extends Error{constructor(t){var r,n,s,o;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.":(o=(s=(n=this.originalError)==null?void 0:n.cause)==null?void 0:s.message)!=null&&o.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 tu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function NM(e,t){const r={};if(typeof e!="string")return r;const n=Object.assign({},{}).decode||RM;let s=0;for(;s0&&(!r.exp||r.exp-t>Date.now()/1e3))}gS=typeof atob!="function"||DM?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,o=0,i="";n=t.charAt(o++);~n&&(r=s%4?64*r+n:n,s++%4)?i+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return i}:atob;const s0="pb_auth";class AM{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!vS(this.token)}get isAdmin(){return $i(this.token).type==="admin"}get isAuthRecord(){return $i(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=s0){const n=NM(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=s0){var l,u;const n={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=$i(this.token);n.expires=s!=null&&s.exp?new Date(1e3*s.exp):new Date("1970-01-01"),t=Object.assign({},n,t);const o={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let i=n0(r,JSON.stringify(o),t);const a=typeof Blob<"u"?new Blob([i]).size:i.length;if(o.model&&a>4096){o.model={id:(l=o==null?void 0:o.model)==null?void 0:l.id,email:(u=o==null?void 0:o.model)==null?void 0:u.email};const d=["collectionId","username","verified"];for(const f in this.model)d.includes(f)&&(o.model[f]=this.model[f]);i=n0(r,JSON.stringify(o),t)}return i}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 OM extends AM{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 ei{constructor(t){this.client=t}}class MM extends ei{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,o,i){return i=Object.assign({method:"POST",body:{clientId:t,teamId:r,keyId:n,privateKey:s,duration:o}},i),this.client.send("/api/settings/apple/generate-client-secret",i)}}class tv extends ei{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 o;return s.items=((o=s.items)==null?void 0:o.map(i=>this.decode(i)))||[],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 o=>this.getList(o,t||500,r).then(i=>{const a=i.items;return n=n.concat(a),a.length==i.perPage?s(o+1):n});return s(1)}}function jr(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 Eh(e){var t;(t=e._resetAutoRefresh)==null||t.call(e)}class IM extends tv{get baseCrudPath(){return"/api/admins"}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i;return((o=this.client.authStore.model)==null?void 0:o.id)===s.id&&((i=this.client.authStore.model)==null?void 0:i.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,o;return n&&((s=this.client.authStore.model)==null?void 0:s.id)===t&&((o=this.client.authStore.model)==null?void 0:o.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 o={method:"POST",body:{identity:t,password:r}};o=jr("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",o,n,s);const i=o.autoRefreshThreshold;delete o.autoRefreshThreshold,o.autoRefresh||Eh(this.client);let a=await this.client.send(this.baseCrudPath+"/auth-with-password",o);return a=this.authResponse(a),i&&function(u,d,f,p){Eh(u);const m=u.beforeSend,x=u.authStore.model,g=u.authStore.onChange((w,v)=>{(!w||(v==null?void 0:v.id)!=(x==null?void 0:x.id)||(v!=null&&v.collectionId||x!=null&&x.collectionId)&&(v==null?void 0:v.collectionId)!=(x==null?void 0:x.collectionId))&&Eh(u)});u._resetAutoRefresh=function(){g(),u.beforeSend=m,delete u._resetAutoRefresh},u.beforeSend=async(w,v)=>{var E;const h=u.authStore.token;if((E=v.query)!=null&&E.autoRefresh)return m?m(w,v):{url:w,sendOptions:v};let _=u.authStore.isValid;if(_&&vS(u.authStore.token,d))try{await f()}catch{_=!1}_||await p();const C=v.headers||{};for(let T in C)if(T.toLowerCase()=="authorization"&&h==C[T]&&u.authStore.token){C[T]=u.authStore.token;break}return v.headers=C,m?m(w,v):{url:w,sendOptions:v}}}(this.client,i,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(t,r,Object.assign({autoRefresh:!0},o))),a}async authRefresh(t,r){let n={method:"POST"};return n=jr("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=jr("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,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=jr("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCrudPath+"/confirm-password-reset",i).then(()=>!0)}}const LM=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function yS(e){if(e){e.query=e.query||{};for(let t in e)LM.includes(t)||(e.query[t]=e[t],delete e[t])}}class xS extends ei{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 i;if(!t)throw new Error("topic must be set.");let s=t;if(n){yS(n);const a="options="+encodeURIComponent(JSON.stringify({query:n.query,headers:n.headers}));s+=(s.includes("?")?"&":"?")+a}const o=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(o),this.isConnected?this.subscriptions[s].length===1?await this.submitSubscriptions():(i=this.eventSource)==null||i.addEventListener(s,o):await this.connect(),async()=>this.unsubscribeByTopicAndListener(t,o)}async unsubscribe(t){var n;let r=!1;if(t){const s=this.getSubscriptionsByTopic(t);for(let o in s)if(this.hasSubscriptionListeners(o)){for(let i of this.subscriptions[o])(n=this.eventSource)==null||n.removeEventListener(o,i);delete this.subscriptions[o],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 o of this.subscriptions[s])(n=this.eventSource)==null||n.removeEventListener(s,o);delete this.subscriptions[s]}r&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(t,r){var o;let n=!1;const s=this.getSubscriptionsByTopic(t);for(let i in s){if(!Array.isArray(this.subscriptions[i])||!this.subscriptions[i].length)continue;let a=!1;for(let l=this.subscriptions[i].length-1;l>=0;l--)this.subscriptions[i][l]===r&&(a=!0,delete this.subscriptions[i][l],this.subscriptions[i].splice(l,1),(o=this.eventSource)==null||o.removeEventListener(i,r));a&&(this.subscriptions[i].length||delete this.subscriptions[i],n||this.hasSubscriptionListeners(i)||(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 o of n[s])o(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 FM extends tv{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 o,i,a;return((o=this.client.authStore.model)==null?void 0:o.id)!==(s==null?void 0:s.id)||((i=this.client.authStore.model)==null?void 0:i.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,o,i;return!n||((s=this.client.authStore.model)==null?void 0:s.id)!==t||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((i=this.client.authStore.model)==null?void 0:i.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 o={method:"POST",body:{identity:t,password:r}};return o=jr("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/auth-with-password",o).then(i=>this.authResponse(i))}async authWithOAuth2Code(t,r,n,s,o,i,a){let l={method:"POST",body:{provider:t,code:r,codeVerifier:n,redirectUrl:s,createData:o}};return l=jr("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,i,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=o0(void 0));const s=new xS(this.client);function o(){n==null||n.close(),s.unsubscribe()}const i={},a=r.requestKey;return a&&(i.requestKey=a),this.listAuthMethods(i).then(l=>{var p;const u=l.authProviders.find(m=>m.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?(p=this.client.cancelControllers)==null?void 0:p[a]:void 0;return f&&(f.signal.onabort=()=>{o()}),new Promise(async(m,x)=>{var g;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 T=Object.assign({},r);delete T.provider,delete T.scopes,delete T.createData,delete T.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,T);m(R)}catch(T){x(new Ir(T))}o()});const w={state:s.clientId};(g=r.scopes)!=null&&g.length&&(w.scope=r.scopes.join(" "));const v=this._replaceQueryParams(u.authUrl+d,w);await(r.urlCallback||function(_){n?n.location.href=_:n=o0(_)})(v)}catch(w){o(),x(new Ir(w))}})}).catch(l=>{throw o(),l})}async authRefresh(t,r){let n={method:"POST"};return n=jr("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=jr("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,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=jr("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCollectionPath+"/confirm-password-reset",i).then(()=>!0)}async requestVerification(t,r,n){let s={method:"POST",body:{email:t}};return s=jr("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=jr("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 o=$i(t),i=this.client.authStore.model;return i&&!i.verified&&i.id===o.id&&i.collectionId===o.collectionId&&(i.verified=!0,this.client.authStore.save(this.client.authStore.token,i)),!0})}async requestEmailChange(t,r,n){let s={method:"POST",body:{newEmail:t}};return s=jr("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 o={method:"POST",body:{token:t,password:r}};return o=jr("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",o).then(()=>{const i=$i(t),a=this.client.authStore.model;return a&&a.id===i.id&&a.collectionId===i.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 o={},i=s.split("&");for(const a of i){if(a=="")continue;const l=a.split("=");o[decodeURIComponent(l[0].replace(/\+/g," "))]=decodeURIComponent((l[1]||"").replace(/\+/g," "))}for(let a in r)r.hasOwnProperty(a)&&(r[a]==null?delete o[a]:o[a]=r[a]);s="";for(let a in o)o.hasOwnProperty(a)&&(s!=""&&(s+="&"),s+=encodeURIComponent(a.replace(/%20/g,"+"))+"="+encodeURIComponent(o[a].replace(/%20/g,"+")));return s!=""?n+"?"+s:n}}function o0(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 o=n/2-t/2,i=s/2-r/2;return window.open(e,"popup_window","width="+t+",height="+r+",top="+i+",left="+o+",resizable,menubar=no")}class zM extends tv{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 UM extends ei{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 VM extends ei{async check(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/health",t)}}class WM extends ei{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 o=this.client.buildUrl(s.join("/"));if(Object.keys(n).length){n.download===!1&&delete n.download;const i=new URLSearchParams(n);o+=(o.includes("?")?"&":"?")+i}return o}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 $M extends ei{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 BM{constructor(t="/",r,n="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=t,this.lang=n,this.authStore=r||new OM,this.admins=new IM(this),this.collections=new zM(this),this.files=new WM(this),this.logs=new UM(this),this.settings=new MM(this),this.realtime=new xS(this),this.health=new VM(this),this.backups=new $M(this)}collection(t){return this.recordServices[t]||(this.recordServices[t]=new FM(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 o={};try{o=await s.json()}catch{}if(this.afterSend&&(o=await this.afterSend(s,o)),s.status>=400)throw new Ir({url:s.url,status:s.status,data:o});return o}).catch(s=>{throw new Ir(s)})}initSendOptions(t,r){if((r=Object.assign({method:"GET"},r)).body=this.convertToFormDataIfNeeded(r.body),yS(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 o=Array.isArray(s)?s:[s];for(let i of o)r.append(n,i)}else{let o={};o[n]=s,r.append("@jsonPayload",JSON.stringify(o))}}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],o=encodeURIComponent(n);if(Array.isArray(s))for(const i of s)r.push(o+"="+encodeURIComponent(i));else s instanceof Date?r.push(o+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?r.push(o+"="+encodeURIComponent(JSON.stringify(s))):r.push(o+"="+encodeURIComponent(s))}return r.join("&")}}var HM={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const YM=HM.VITE_API_DOMAIN;console.log(YM);let ru;const Nt=()=>ru||(ru=new BM("/"),ru);//! moment.js //! version : 2.30.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com var wS;function ge(){return wS.apply(null,arguments)}function ZM(e){wS=e}function vn(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Mo(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function at(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function rv(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(at(e,t))return!1;return!0}function xr(e){return e===void 0}function _s(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function mc(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function _S(e,t){var r=[],n,s=e.length;for(n=0;n>>0,n;for(n=0;n0)for(r=0;r=0;return(o?r?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+n}var iv=/(\[[^\[]*\])|(\\)?([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,nu=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,jh={},Bi={};function Ne(e,t,r,n){var s=n;typeof n=="string"&&(s=function(){return this[n]()}),e&&(Bi[e]=s),t&&(Bi[t[0]]=function(){return Fn(s.apply(this,arguments),t[1],t[2])}),r&&(Bi[r]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function QM(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function JM(e){var t=e.match(iv),r,n;for(r=0,n=t.length;r=0&&nu.test(e);)e=e.replace(nu,n),nu.lastIndex=0,r-=1;return e}var eI={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 tI(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(iv).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[e])}var rI="Invalid date";function nI(){return this._invalidDate}var sI="%d",oI=/\d{1,2}/;function iI(e){return this._ordinal.replace("%d",e)}var aI={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 lI(e,t,r,n){var s=this._relativeTime[r];return $n(s)?s(e,t,r,n):s.replace(/%d/i,e)}function cI(e,t){var r=this._relativeTime[e>0?"future":"past"];return $n(r)?r(t):r.replace(/%s/i,t)}var l0={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"?l0[e]||l0[e.toLowerCase()]:void 0}function av(e){var t={},r,n;for(n in e)at(e,n)&&(r=en(n),r&&(t[r]=e[n]));return t}var uI={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 dI(e){var t=[],r;for(r in e)at(e,r)&&t.push({unit:r,priority:uI[r]});return t.sort(function(n,s){return n.priority-s.priority}),t}var CS=/\d/,Vr=/\d\d/,ES=/\d{3}/,lv=/\d{4}/,mf=/[+-]?\d{6}/,kt=/\d\d?/,TS=/\d\d\d\d?/,jS=/\d\d\d\d\d\d?/,gf=/\d{1,3}/,cv=/\d{1,4}/,vf=/[+-]?\d{1,6}/,xa=/\d+/,yf=/[+-]?\d+/,fI=/Z|[+-]\d\d:?\d\d/gi,xf=/Z|[+-]\d\d(?::?\d\d)?/gi,hI=/[+-]?\d+(\.\d{1,3})?/,vc=/[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,wa=/^[1-9]\d?/,uv=/^([1-9]\d|\d)/,hd;hd={};function we(e,t,r){hd[e]=$n(t)?t:function(n,s){return n&&r?r:t}}function pI(e,t){return at(hd,e)?hd[e](t._strict,t._locale):new RegExp(mI(e))}function mI(e){return fs(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,r,n,s,o){return r||n||s||o}))}function fs(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 Yp={};function mt(e,t){var r,n=t,s;for(typeof e=="string"&&(e=[e]),_s(t)&&(n=function(o,i){i[t]=tt(o)}),s=e.length,r=0;r68?1900:2e3)};var NS=_a("FullYear",!0);function xI(){return wf(this.year())}function _a(e,t){return function(r){return r!=null?(RS(this,e,r),ge.updateOffset(this,t),this):Ll(this,e)}}function Ll(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 RS(e,t,r){var n,s,o,i,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}o=r,i=e.month(),a=e.date(),a=a===29&&i===1&&!wf(o)?28:a,s?n.setUTCFullYear(o,i,a):n.setFullYear(o,i,a)}}function wI(e){return e=en(e),$n(this[e])?this[e]():this}function _I(e,t){if(typeof e=="object"){e=av(e);var r=dI(e),n,s=r.length;for(n=0;n=0?(a=new Date(e+400,t,r,n,s,o,i),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,r,n,s,o,i),a}function Fl(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 pd(e,t,r){var n=7+t-r,s=(7+Fl(e,0,n).getUTCDay()-t)%7;return-s+n-1}function IS(e,t,r,n,s){var o=(7+r-n)%7,i=pd(e,n,s),a=1+7*(t-1)+o+i,l,u;return a<=0?(l=e-1,u=sl(l)+a):a>sl(e)?(l=e+1,u=a-sl(e)):(l=e,u=a),{year:l,dayOfYear:u}}function zl(e,t,r){var n=pd(e.year(),t,r),s=Math.floor((e.dayOfYear()-n-1)/7)+1,o,i;return s<1?(i=e.year()-1,o=s+hs(i,t,r)):s>hs(e.year(),t,r)?(o=s-hs(e.year(),t,r),i=e.year()+1):(i=e.year(),o=s),{week:o,year:i}}function hs(e,t,r){var n=pd(e,t,r),s=pd(e+1,t,r);return(sl(e)-n+s)/7}Ne("w",["ww",2],"wo","week");Ne("W",["WW",2],"Wo","isoWeek");we("w",kt,wa);we("ww",kt,Vr);we("W",kt,wa);we("WW",kt,Vr);yc(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=tt(e)});function OI(e){return zl(e,this._week.dow,this._week.doy).week}var MI={dow:0,doy:6};function II(){return this._week.dow}function LI(){return this._week.doy}function FI(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function zI(e){var t=zl(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Ne("d",0,"do","day");Ne("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});Ne("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});Ne("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});Ne("e",0,0,"weekday");Ne("E",0,0,"isoWeekday");we("d",kt);we("e",kt);we("E",kt);we("dd",function(e,t){return t.weekdaysMinRegex(e)});we("ddd",function(e,t){return t.weekdaysShortRegex(e)});we("dddd",function(e,t){return t.weekdaysRegex(e)});yc(["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});yc(["d","e","E"],function(e,t,r,n){t[n]=tt(e)});function UI(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function VI(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function fv(e,t){return e.slice(t,7).concat(e.slice(0,t))}var WI="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),LS="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),$I="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),BI=vc,HI=vc,YI=vc;function ZI(e,t){var r=vn(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?fv(r,this._week.dow):e?r[e.day()]:r}function KI(e){return e===!0?fv(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function GI(e){return e===!0?fv(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function qI(e,t,r){var n,s,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=Wn([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return r?t==="dddd"?(s=zt.call(this._weekdaysParse,i),s!==-1?s:null):t==="ddd"?(s=zt.call(this._shortWeekdaysParse,i),s!==-1?s:null):(s=zt.call(this._minWeekdaysParse,i),s!==-1?s:null):t==="dddd"?(s=zt.call(this._weekdaysParse,i),s!==-1||(s=zt.call(this._shortWeekdaysParse,i),s!==-1)?s:(s=zt.call(this._minWeekdaysParse,i),s!==-1?s:null)):t==="ddd"?(s=zt.call(this._shortWeekdaysParse,i),s!==-1||(s=zt.call(this._weekdaysParse,i),s!==-1)?s:(s=zt.call(this._minWeekdaysParse,i),s!==-1?s:null)):(s=zt.call(this._minWeekdaysParse,i),s!==-1||(s=zt.call(this._weekdaysParse,i),s!==-1)?s:(s=zt.call(this._shortWeekdaysParse,i),s!==-1?s:null))}function XI(e,t,r){var n,s,o;if(this._weekdaysParseExact)return qI.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=Wn([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]||(o="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[n]=new RegExp(o.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 QI(e){if(!this.isValid())return e!=null?this:NaN;var t=Ll(this,"Day");return e!=null?(e=UI(e,this.localeData()),this.add(e-t,"d")):t}function JI(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 eL(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=VI(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function tL(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||hv.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(at(this,"_weekdaysRegex")||(this._weekdaysRegex=BI),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function rL(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||hv.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(at(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=HI),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function nL(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||hv.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(at(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=YI),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function hv(){function e(d,f){return f.length-d.length}var t=[],r=[],n=[],s=[],o,i,a,l,u;for(o=0;o<7;o++)i=Wn([2e3,1]).day(o),a=fs(this.weekdaysMin(i,"")),l=fs(this.weekdaysShort(i,"")),u=fs(this.weekdays(i,"")),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 pv(){return this.hours()%12||12}function sL(){return this.hours()||24}Ne("H",["HH",2],0,"hour");Ne("h",["hh",2],0,pv);Ne("k",["kk",2],0,sL);Ne("hmm",0,0,function(){return""+pv.apply(this)+Fn(this.minutes(),2)});Ne("hmmss",0,0,function(){return""+pv.apply(this)+Fn(this.minutes(),2)+Fn(this.seconds(),2)});Ne("Hmm",0,0,function(){return""+this.hours()+Fn(this.minutes(),2)});Ne("Hmmss",0,0,function(){return""+this.hours()+Fn(this.minutes(),2)+Fn(this.seconds(),2)});function FS(e,t){Ne(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}FS("a",!0);FS("A",!1);function zS(e,t){return t._meridiemParse}we("a",zS);we("A",zS);we("H",kt,uv);we("h",kt,wa);we("k",kt,wa);we("HH",kt,Vr);we("hh",kt,Vr);we("kk",kt,Vr);we("hmm",TS);we("hmmss",jS);we("Hmm",TS);we("Hmmss",jS);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[cn]=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[cn]=tt(e.substr(n,2)),t[cs]=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[cn]=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[cn]=tt(e.substr(n,2)),t[cs]=tt(e.substr(s))});function oL(e){return(e+"").toLowerCase().charAt(0)==="p"}var iL=/[ap]\.?m?\.?/i,aL=_a("Hours",!0);function lL(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var US={calendar:qM,longDateFormat:eI,invalidDate:rI,ordinal:sI,dayOfMonthOrdinalParse:oI,relativeTime:aI,months:SI,monthsShort:PS,week:MI,weekdays:WI,weekdaysMin:$I,weekdaysShort:LS,meridiemParse:iL},Tt={},La={},Ul;function cL(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r0;){if(s=_f(o.slice(0,r).join("-")),s)return s;if(n&&n.length>=r&&cL(o,n)>=r-1)break;r--}t++}return Ul}function dL(e){return!!(e&&e.match("^[^/\\\\]*$"))}function _f(e){var t=null,r;if(Tt[e]===void 0&&typeof Au<"u"&&Au&&Au.exports&&dL(e))try{t=Ul._abbr,r=require,r("./locale/"+e),no(t)}catch{Tt[e]=null}return Tt[e]}function no(e,t){var r;return e&&(xr(t)?r=js(e):r=mv(e,t),r?Ul=r:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Ul._abbr}function mv(e,t){if(t!==null){var r,n=US;if(t.abbr=e,Tt[e]!=null)SS("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=_f(t.parentLocale),r!=null)n=r._config;else return La[t.parentLocale]||(La[t.parentLocale]=[]),La[t.parentLocale].push({name:e,config:t}),null;return Tt[e]=new ov(Bp(n,t)),La[e]&&La[e].forEach(function(s){mv(s.name,s.config)}),no(e),Tt[e]}else return delete Tt[e],null}function fL(e,t){if(t!=null){var r,n,s=US;Tt[e]!=null&&Tt[e].parentLocale!=null?Tt[e].set(Bp(Tt[e]._config,t)):(n=_f(e),n!=null&&(s=n._config),t=Bp(s,t),n==null&&(t.abbr=e),r=new ov(t),r.parentLocale=Tt[e],Tt[e]=r),no(e)}else Tt[e]!=null&&(Tt[e].parentLocale!=null?(Tt[e]=Tt[e].parentLocale,e===no()&&no(e)):Tt[e]!=null&&delete Tt[e]);return Tt[e]}function js(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Ul;if(!vn(e)){if(t=_f(e),t)return t;e=[e]}return uL(e)}function hL(){return Hp(Tt)}function gv(e){var t,r=e._a;return r&&Ke(e).overflow===-2&&(t=r[ls]<0||r[ls]>11?ls:r[Nn]<1||r[Nn]>dv(r[ar],r[ls])?Nn:r[Gt]<0||r[Gt]>24||r[Gt]===24&&(r[cn]!==0||r[cs]!==0||r[Po]!==0)?Gt:r[cn]<0||r[cn]>59?cn:r[cs]<0||r[cs]>59?cs:r[Po]<0||r[Po]>999?Po:-1,Ke(e)._overflowDayOfYear&&(tNn)&&(t=Nn),Ke(e)._overflowWeeks&&t===-1&&(t=vI),Ke(e)._overflowWeekday&&t===-1&&(t=yI),Ke(e).overflow=t),e}var pL=/^\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)?)?$/,mL=/^\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)?)?$/,gL=/Z|[+-]\d\d(?::?\d\d)?/,su=[["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]],Nh=[["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/]],vL=/^\/?Date\((-?\d+)/i,yL=/^(?:(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}))$/,xL={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 VS(e){var t,r,n=e._i,s=pL.exec(n)||mL.exec(n),o,i,a,l,u=su.length,d=Nh.length;if(s){for(Ke(e).iso=!0,t=0,r=u;tsl(i)||e._dayOfYear===0)&&(Ke(e)._overflowDayOfYear=!0),r=Fl(i,0,e._dayOfYear),e._a[ls]=r.getUTCMonth(),e._a[Nn]=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[cn]===0&&e._a[cs]===0&&e._a[Po]===0&&(e._nextDay=!0,e._a[Gt]=0),e._d=(e._useUTC?Fl:AI).apply(null,n),o=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!==o&&(Ke(e).weekdayMismatch=!0)}}function TL(e){var t,r,n,s,o,i,a,l,u;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,i=4,r=gi(t.GG,e._a[ar],zl(bt(),1,4).year),n=gi(t.W,1),s=gi(t.E,1),(s<1||s>7)&&(l=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,u=zl(bt(),o,i),r=gi(t.gg,e._a[ar],u.year),n=gi(t.w,u.week),t.d!=null?(s=t.d,(s<0||s>6)&&(l=!0)):t.e!=null?(s=t.e+o,(t.e<0||t.e>6)&&(l=!0)):s=o),n<1||n>hs(r,o,i)?Ke(e)._overflowWeeks=!0:l!=null?Ke(e)._overflowWeekday=!0:(a=IS(r,n,s,o,i),e._a[ar]=a.year,e._dayOfYear=a.dayOfYear)}ge.ISO_8601=function(){};ge.RFC_2822=function(){};function yv(e){if(e._f===ge.ISO_8601){VS(e);return}if(e._f===ge.RFC_2822){WS(e);return}e._a=[],Ke(e).empty=!0;var t=""+e._i,r,n,s,o,i,a=t.length,l=0,u,d;for(s=kS(e._f,e._locale).match(iv)||[],d=s.length,r=0;r0&&Ke(e).unusedInput.push(i),t=t.slice(t.indexOf(n)+n.length),l+=n.length),Bi[o]?(n?Ke(e).empty=!1:Ke(e).unusedTokens.push(o),gI(o,n,e)):e._strict&&!n&&Ke(e).unusedTokens.push(o);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]=jL(e._locale,e._a[Gt],e._meridiem),u=Ke(e).era,u!==null&&(e._a[ar]=e._locale.erasConvertYear(u,e._a[ar])),vv(e),gv(e)}function jL(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 NL(e){var t,r,n,s,o,i,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:pf()});function HS(e,t){var r,n;if(t.length===1&&vn(t[0])&&(t=t[0]),!t.length)return bt();for(r=t[0],n=1;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function qL(){if(!xr(this._isDSTShifted))return this._isDSTShifted;var e={},t;return sv(e,this),e=$S(e),e._a?(t=e._isUTC?Wn(e._a):bt(e._a),this._isDSTShifted=this.isValid()&&VL(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function XL(){return this.isValid()?!this._isUTC:!1}function QL(){return this.isValid()?this._isUTC:!1}function ZS(){return this.isValid()?this._isUTC&&this._offset===0:!1}var JL=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,e4=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function bn(e,t){var r=e,n=null,s,o,i;return Cu(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:_s(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(n=JL.exec(e))?(s=n[1]==="-"?-1:1,r={y:0,d:tt(n[Nn])*s,h:tt(n[Gt])*s,m:tt(n[cn])*s,s:tt(n[cs])*s,ms:tt(Zp(n[Po]*1e3))*s}):(n=e4.exec(e))?(s=n[1]==="-"?-1:1,r={y:_o(n[2],s),M:_o(n[3],s),w:_o(n[4],s),d:_o(n[5],s),h:_o(n[6],s),m:_o(n[7],s),s:_o(n[8],s)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(i=t4(bt(r.from),bt(r.to)),r={},r.ms=i.milliseconds,r.M=i.months),o=new bf(r),Cu(e)&&at(e,"_locale")&&(o._locale=e._locale),Cu(e)&&at(e,"_isValid")&&(o._isValid=e._isValid),o}bn.fn=bf.prototype;bn.invalid=UL;function _o(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function u0(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 t4(e,t){var r;return e.isValid()&&t.isValid()?(t=wv(t,e),e.isBefore(t)?r=u0(e,t):(r=u0(t,e),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function KS(e,t){return function(r,n){var s,o;return n!==null&&!isNaN(+n)&&(SS(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."),o=r,r=n,n=o),s=bn(r,n),GS(this,s,e),this}}function GS(e,t,r,n){var s=t._milliseconds,o=Zp(t._days),i=Zp(t._months);e.isValid()&&(n=n??!0,i&&AS(e,Ll(e,"Month")+i*r),o&&RS(e,"Date",Ll(e,"Date")+o*r),s&&e._d.setTime(e._d.valueOf()+s*r),n&&ge.updateOffset(e,o||i))}var r4=KS(1,"add"),n4=KS(-1,"subtract");function qS(e){return typeof e=="string"||e instanceof String}function s4(e){return yn(e)||mc(e)||qS(e)||_s(e)||i4(e)||o4(e)||e===null||e===void 0}function o4(e){var t=Mo(e)&&!rv(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,o,i=n.length;for(s=0;sr.valueOf():r.valueOf()9999?ku(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):$n(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",ku(r,"Z")):ku(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function w4(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",r,n,s,o;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",o=t+'[")]',this.format(r+n+s+o)}function _4(e){e||(e=this.isUtc()?ge.defaultFormatUtc:ge.defaultFormat);var t=ku(this,e);return this.localeData().postformat(t)}function b4(e,t){return this.isValid()&&(yn(e)&&e.isValid()||bt(e).isValid())?bn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function S4(e){return this.from(bt(),e)}function k4(e,t){return this.isValid()&&(yn(e)&&e.isValid()||bt(e).isValid())?bn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function C4(e){return this.to(bt(),e)}function XS(e){var t;return e===void 0?this._locale._abbr:(t=js(e),t!=null&&(this._locale=t),this)}var QS=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 JS(){return this._locale}var md=1e3,Hi=60*md,gd=60*Hi,ek=(365*400+97)*24*gd;function Yi(e,t){return(e%t+t)%t}function tk(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-ek:new Date(e,t,r).valueOf()}function rk(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-ek:Date.UTC(e,t,r)}function E4(e){var t,r;if(e=en(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?rk:tk,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-=Yi(t+(this._isUTC?0:this.utcOffset()*Hi),gd);break;case"minute":t=this._d.valueOf(),t-=Yi(t,Hi);break;case"second":t=this._d.valueOf(),t-=Yi(t,md);break}return this._d.setTime(t),ge.updateOffset(this,!0),this}function T4(e){var t,r;if(e=en(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?rk:tk,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+=gd-Yi(t+(this._isUTC?0:this.utcOffset()*Hi),gd)-1;break;case"minute":t=this._d.valueOf(),t+=Hi-Yi(t,Hi)-1;break;case"second":t=this._d.valueOf(),t+=md-Yi(t,md)-1;break}return this._d.setTime(t),ge.updateOffset(this,!0),this}function j4(){return this._d.valueOf()-(this._offset||0)*6e4}function N4(){return Math.floor(this.valueOf()/1e3)}function R4(){return new Date(this.valueOf())}function P4(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function D4(){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 A4(){return this.isValid()?this.toISOString():null}function O4(){return nv(this)}function M4(){return Ys({},Ke(this))}function I4(){return Ke(this).overflow}function L4(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Ne("N",0,0,"eraAbbr");Ne("NN",0,0,"eraAbbr");Ne("NNN",0,0,"eraAbbr");Ne("NNNN",0,0,"eraName");Ne("NNNNN",0,0,"eraNarrow");Ne("y",["y",1],"yo","eraYear");Ne("y",["yy",2],0,"eraYear");Ne("y",["yyy",3],0,"eraYear");Ne("y",["yyyy",4],0,"eraYear");we("N",_v);we("NN",_v);we("NNN",_v);we("NNNN",K4);we("NNNNN",G4);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});we("y",xa);we("yy",xa);we("yyy",xa);we("yyyy",xa);we("yo",q4);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 F4(e,t){var r,n,s,o=this._eras||js("en")._eras;for(r=0,n=o.length;r=0)return o[n]}function U4(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 V4(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;eo&&(t=o),nF.call(this,e,t,r,n,s))}function nF(e,t,r,n,s){var o=IS(e,t,r,n,s),i=Fl(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}Ne("Q",0,"Qo","quarter");we("Q",CS);mt("Q",function(e,t){t[ls]=(tt(e)-1)*3});function sF(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Ne("D",["DD",2],"Do","date");we("D",kt,wa);we("DD",kt,Vr);we("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});mt(["D","DD"],Nn);mt("Do",function(e,t){t[Nn]=tt(e.match(kt)[0])});var sk=_a("Date",!0);Ne("DDD",["DDDD",3],"DDDo","dayOfYear");we("DDD",gf);we("DDDD",ES);mt(["DDD","DDDD"],function(e,t,r){r._dayOfYear=tt(e)});function oF(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Ne("m",["mm",2],0,"minute");we("m",kt,uv);we("mm",kt,Vr);mt(["m","mm"],cn);var iF=_a("Minutes",!1);Ne("s",["ss",2],0,"second");we("s",kt,uv);we("ss",kt,Vr);mt(["s","ss"],cs);var aF=_a("Seconds",!1);Ne("S",0,0,function(){return~~(this.millisecond()/100)});Ne(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Ne(0,["SSS",3],0,"millisecond");Ne(0,["SSSS",4],0,function(){return this.millisecond()*10});Ne(0,["SSSSS",5],0,function(){return this.millisecond()*100});Ne(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Ne(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Ne(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Ne(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});we("S",gf,CS);we("SS",gf,Vr);we("SSS",gf,ES);var Zs,ok;for(Zs="SSSS";Zs.length<=9;Zs+="S")we(Zs,xa);function lF(e,t){t[Po]=tt(("0."+e)*1e3)}for(Zs="S";Zs.length<=9;Zs+="S")mt(Zs,lF);ok=_a("Milliseconds",!1);Ne("z",0,0,"zoneAbbr");Ne("zz",0,0,"zoneName");function cF(){return this._isUTC?"UTC":""}function uF(){return this._isUTC?"Coordinated Universal Time":""}var ae=gc.prototype;ae.add=r4;ae.calendar=c4;ae.clone=u4;ae.diff=v4;ae.endOf=T4;ae.format=_4;ae.from=b4;ae.fromNow=S4;ae.to=k4;ae.toNow=C4;ae.get=wI;ae.invalidAt=I4;ae.isAfter=d4;ae.isBefore=f4;ae.isBetween=h4;ae.isSame=p4;ae.isSameOrAfter=m4;ae.isSameOrBefore=g4;ae.isValid=O4;ae.lang=QS;ae.locale=XS;ae.localeData=JS;ae.max=OL;ae.min=AL;ae.parsingFlags=M4;ae.set=_I;ae.startOf=E4;ae.subtract=n4;ae.toArray=P4;ae.toObject=D4;ae.toDate=R4;ae.toISOString=x4;ae.inspect=w4;typeof Symbol<"u"&&Symbol.for!=null&&(ae[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});ae.toJSON=A4;ae.toString=y4;ae.unix=N4;ae.valueOf=j4;ae.creationData=L4;ae.eraName=V4;ae.eraNarrow=W4;ae.eraAbbr=$4;ae.eraYear=B4;ae.year=NS;ae.isLeapYear=xI;ae.weekYear=X4;ae.isoWeekYear=Q4;ae.quarter=ae.quarters=sF;ae.month=OS;ae.daysInMonth=RI;ae.week=ae.weeks=FI;ae.isoWeek=ae.isoWeeks=zI;ae.weeksInYear=tF;ae.weeksInWeekYear=rF;ae.isoWeeksInYear=J4;ae.isoWeeksInISOWeekYear=eF;ae.date=sk;ae.day=ae.days=QI;ae.weekday=JI;ae.isoWeekday=eL;ae.dayOfYear=oF;ae.hour=ae.hours=aL;ae.minute=ae.minutes=iF;ae.second=ae.seconds=aF;ae.millisecond=ae.milliseconds=ok;ae.utcOffset=$L;ae.utc=HL;ae.local=YL;ae.parseZone=ZL;ae.hasAlignedHourOffset=KL;ae.isDST=GL;ae.isLocal=XL;ae.isUtcOffset=QL;ae.isUtc=ZS;ae.isUTC=ZS;ae.zoneAbbr=cF;ae.zoneName=uF;ae.dates=Jr("dates accessor is deprecated. Use date instead.",sk);ae.months=Jr("months accessor is deprecated. Use month instead",OS);ae.years=Jr("years accessor is deprecated. Use year instead",NS);ae.zone=Jr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",BL);ae.isDSTShifted=Jr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",qL);function dF(e){return bt(e*1e3)}function fF(){return bt.apply(null,arguments).parseZone()}function ik(e){return e}var lt=ov.prototype;lt.calendar=XM;lt.longDateFormat=tI;lt.invalidDate=nI;lt.ordinal=iI;lt.preparse=ik;lt.postformat=ik;lt.relativeTime=lI;lt.pastFuture=cI;lt.set=GM;lt.eras=F4;lt.erasParse=z4;lt.erasConvertYear=U4;lt.erasAbbrRegex=Y4;lt.erasNameRegex=H4;lt.erasNarrowRegex=Z4;lt.months=EI;lt.monthsShort=TI;lt.monthsParse=NI;lt.monthsRegex=DI;lt.monthsShortRegex=PI;lt.week=OI;lt.firstDayOfYear=LI;lt.firstDayOfWeek=II;lt.weekdays=ZI;lt.weekdaysMin=GI;lt.weekdaysShort=KI;lt.weekdaysParse=XI;lt.weekdaysRegex=tL;lt.weekdaysShortRegex=rL;lt.weekdaysMinRegex=nL;lt.isPM=oL;lt.meridiem=lL;function vd(e,t,r,n){var s=js(),o=Wn().set(n,t);return s[r](o,e)}function ak(e,t,r){if(_s(e)&&(t=e,e=void 0),e=e||"",t!=null)return vd(e,t,r,"month");var n,s=[];for(n=0;n<12;n++)s[n]=vd(e,n,r,"month");return s}function Sv(e,t,r,n){typeof e=="boolean"?(_s(t)&&(r=t,t=void 0),t=t||""):(t=e,r=t,e=!1,_s(t)&&(r=t,t=void 0),t=t||"");var s=js(),o=e?s._week.dow:0,i,a=[];if(r!=null)return vd(t,(r+o)%7,n,"day");for(i=0;i<7;i++)a[i]=vd(t,(i+o)%7,n,"day");return a}function hF(e,t){return ak(e,t,"months")}function pF(e,t){return ak(e,t,"monthsShort")}function mF(e,t,r){return Sv(e,t,r,"weekdays")}function gF(e,t,r){return Sv(e,t,r,"weekdaysShort")}function vF(e,t,r){return Sv(e,t,r,"weekdaysMin")}no("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.",no);ge.langData=Jr("moment.langData is deprecated. Use moment.localeData instead.",js);var Jn=Math.abs;function yF(){var e=this._data;return this._milliseconds=Jn(this._milliseconds),this._days=Jn(this._days),this._months=Jn(this._months),e.milliseconds=Jn(e.milliseconds),e.seconds=Jn(e.seconds),e.minutes=Jn(e.minutes),e.hours=Jn(e.hours),e.months=Jn(e.months),e.years=Jn(e.years),this}function lk(e,t,r,n){var s=bn(t,r);return e._milliseconds+=n*s._milliseconds,e._days+=n*s._days,e._months+=n*s._months,e._bubble()}function xF(e,t){return lk(this,e,t,1)}function wF(e,t){return lk(this,e,t,-1)}function d0(e){return e<0?Math.floor(e):Math.ceil(e)}function _F(){var e=this._milliseconds,t=this._days,r=this._months,n=this._data,s,o,i,a,l;return e>=0&&t>=0&&r>=0||e<=0&&t<=0&&r<=0||(e+=d0(Gp(r)+t)*864e5,t=0,r=0),n.milliseconds=e%1e3,s=Yr(e/1e3),n.seconds=s%60,o=Yr(s/60),n.minutes=o%60,i=Yr(o/60),n.hours=i%24,t+=Yr(i/24),l=Yr(ck(t)),r+=l,t-=d0(Gp(l)),a=Yr(r/12),r%=12,n.days=t,n.months=r,n.years=a,this}function ck(e){return e*4800/146097}function Gp(e){return e*146097/4800}function bF(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+ck(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Gp(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 Ns(e){return function(){return this.as(e)}}var uk=Ns("ms"),SF=Ns("s"),kF=Ns("m"),CF=Ns("h"),EF=Ns("d"),TF=Ns("w"),jF=Ns("M"),NF=Ns("Q"),RF=Ns("y"),PF=uk;function DF(){return bn(this)}function AF(e){return e=en(e),this.isValid()?this[e+"s"]():NaN}function ti(e){return function(){return this.isValid()?this._data[e]:NaN}}var OF=ti("milliseconds"),MF=ti("seconds"),IF=ti("minutes"),LF=ti("hours"),FF=ti("days"),zF=ti("months"),UF=ti("years");function VF(){return Yr(this.days()/7)}var ns=Math.round,Pi={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function WF(e,t,r,n,s){return s.relativeTime(t||1,!!r,e,n)}function $F(e,t,r,n){var s=bn(e).abs(),o=ns(s.as("s")),i=ns(s.as("m")),a=ns(s.as("h")),l=ns(s.as("d")),u=ns(s.as("M")),d=ns(s.as("w")),f=ns(s.as("y")),p=o<=r.ss&&["s",o]||o0,p[4]=n,WF.apply(null,p)}function BF(e){return e===void 0?ns:typeof e=="function"?(ns=e,!0):!1}function HF(e,t){return Pi[e]===void 0?!1:t===void 0?Pi[e]:(Pi[e]=t,e==="s"&&(Pi.ss=t-1),!0)}function YF(e,t){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Pi,s,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(r=e),typeof t=="object"&&(n=Object.assign({},Pi,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),s=this.localeData(),o=$F(this,!r,n,s),r&&(o=s.pastFuture(+this,o)),s.postformat(o)}var Rh=Math.abs;function pi(e){return(e>0)-(e<0)||+e}function kf(){if(!this.isValid())return this.localeData().invalidDate();var e=Rh(this._milliseconds)/1e3,t=Rh(this._days),r=Rh(this._months),n,s,o,i,a=this.asSeconds(),l,u,d,f;return a?(n=Yr(e/60),s=Yr(n/60),e%=60,n%=60,o=Yr(r/12),r%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=pi(this._months)!==pi(a)?"-":"",d=pi(this._days)!==pi(a)?"-":"",f=pi(this._milliseconds)!==pi(a)?"-":"",l+"P"+(o?u+o+"Y":"")+(r?u+r+"M":"")+(t?d+t+"D":"")+(s||n||e?"T":"")+(s?f+s+"H":"")+(n?f+n+"M":"")+(e?f+i+"S":"")):"P0D"}var st=bf.prototype;st.isValid=zL;st.abs=yF;st.add=xF;st.subtract=wF;st.as=bF;st.asMilliseconds=uk;st.asSeconds=SF;st.asMinutes=kF;st.asHours=CF;st.asDays=EF;st.asWeeks=TF;st.asMonths=jF;st.asQuarters=NF;st.asYears=RF;st.valueOf=PF;st._bubble=_F;st.clone=DF;st.get=AF;st.milliseconds=OF;st.seconds=MF;st.minutes=IF;st.hours=LF;st.days=FF;st.weeks=VF;st.months=zF;st.years=UF;st.humanize=YF;st.toISOString=kf;st.toString=kf;st.toJSON=kf;st.locale=XS;st.localeData=JS;st.toIsoString=Jr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",kf);st.lang=QS;Ne("X",0,0,"unix");Ne("x",0,0,"valueOf");we("x",yf);we("X",hI);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";ZM(bt);ge.fn=ae;ge.min=ML;ge.max=IL;ge.now=LL;ge.utc=Wn;ge.unix=dF;ge.months=hF;ge.isDate=mc;ge.locale=no;ge.invalid=pf;ge.duration=bn;ge.isMoment=yn;ge.weekdays=mF;ge.parseZone=fF;ge.localeData=js;ge.isDuration=Cu;ge.monthsShort=pF;ge.weekdaysMin=vF;ge.defineLocale=mv;ge.updateLocale=fL;ge.locales=hL;ge.weekdaysShort=gF;ge.normalizeUnits=en;ge.relativeTimeRounding=BF;ge.relativeTimeThreshold=HF;ge.calendarFormat=l4;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 ZF=async()=>await Nt().collection("access").getFullList({sort:"-created",filter:"deleted = null"}),ri=async e=>e.id?await Nt().collection("access").update(e.id,e):await Nt().collection("access").create(e),KF=async e=>(e.deleted=ge.utc().format("YYYY-MM-DD HH:mm:ss"),await Nt().collection("access").update(e.id,e)),GF=(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)};default:return e}},dk=y.createContext({}),Rs=()=>y.useContext(dk),qF=({children:e})=>{const[t,r]=y.useReducer(GF,{accesses:[]});y.useEffect(()=>{(async()=>{const a=await ZF();r({type:"SET_ACCESSES",payload:a})})()},[]);const n=y.useCallback(i=>{r({type:"DELETE_ACCESS",payload:i})},[]),s=y.useCallback(i=>{r({type:"ADD_ACCESS",payload:i})},[]),o=y.useCallback(i=>{r({type:"UPDATE_ACCESS",payload:i})},[]);return c.jsx(dk.Provider,{value:{config:{accesses:t.accesses},deleteAccess:n,addAccess:s,updateAccess:o},children:e&&e})},XF={theme:"system",setTheme:()=>null},fk=y.createContext(XF);function QF({children:e,defaultTheme:t="system",storageKey:r="vite-ui-theme",...n}){const[s,o]=y.useState(()=>localStorage.getItem(r)||t);y.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 i={theme:s,setTheme:a=>{localStorage.setItem(r,a),o(a)}};return c.jsx(fk.Provider,{...n,value:i,children:e})}const JF=()=>{const e=y.useContext(fk);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function e3(){const{setTheme:e}=JF();return c.jsxs(Kb,{children:[c.jsx(Gb,{asChild:!0,children:c.jsxs(ft,{variant:"outline",size:"icon",children:[c.jsx(HR,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),c.jsx($R,{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($g,{align:"end",children:[c.jsx(Wi,{onClick:()=>e("light"),children:"浅色"}),c.jsx(Wi,{onClick:()=>e("dark"),children:"暗黑"}),c.jsx(Wi,{onClick:()=>e("system"),children:"系统"})]})]})}var t3="Separator",f0="horizontal",r3=["horizontal","vertical"],hk=y.forwardRef((e,t)=>{const{decorative:r,orientation:n=f0,...s}=e,o=n3(n)?n:f0,a=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return c.jsx(ze.div,{"data-orientation":o,...a,...s,ref:t})});hk.displayName=t3;function n3(e){return r3.includes(e)}var pk=hk;const Yt=y.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>c.jsx(pk,{ref:s,decorative:r,orientation:t,className:me("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Yt.displayName=pk.displayName;function s3(){const e=wn(),t=Vn();if(!Nt().authStore.isValid||!Nt().authStore.isAdmin)return c.jsx(o1,{to:"/login"});const r=t.pathname,n=i=>(console.log(r),i==r?"bg-muted text-primary":"text-muted-foreground"),s=()=>{Nt().authStore.clear(),e("/login")},o=()=>{e("/setting/password")};return c.jsx(c.Fragment,{children:c.jsx(qF,{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:me("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/")),children:[c.jsx(jx,{className:"h-4 w-4"}),"控制面板"]}),c.jsxs(dr,{to:"/domains",className:me("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/domains")),children:[c.jsx(Op,{className:"h-4 w-4"}),"域名列表"]}),c.jsxs(dr,{to:"/access",className:me("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/access")),children:[c.jsx(Rx,{className:"h-4 w-4"}),"授权管理"]}),c.jsxs(dr,{to:"/history",className:me("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/history")),children:[c.jsx(Tx,{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(Xg,{children:[c.jsx(Qg,{asChild:!0,children:c.jsxs(ft,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[c.jsx(WR,{className:"h-5 w-5 dark:text-white"}),c.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),c.jsx(hf,{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:me("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/")),children:[c.jsx(jx,{className:"h-5 w-5"}),"控制面板"]}),c.jsxs(dr,{to:"/domains",className:me("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/domains")),children:[c.jsx(Op,{className:"h-5 w-5"}),"域名列表"]}),c.jsxs(dr,{to:"/access",className:me("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/dns_provider")),children:[c.jsx(Rx,{className:"h-5 w-5"}),"授权管理"]}),c.jsxs(dr,{to:"/history",className:me("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/history")),children:[c.jsx(Tx,{className:"h-5 w-5"}),"部署历史"]})]})})]}),c.jsx("div",{className:"w-full flex-1"}),c.jsx(e3,{}),c.jsxs(Kb,{children:[c.jsx(Gb,{asChild:!0,children:c.jsxs(ft,{variant:"secondary",size:"icon",className:"rounded-full",children:[c.jsx(LR,{className:"h-5 w-5"}),c.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),c.jsxs($g,{align:"end",children:[c.jsx(qb,{children:"账户"}),c.jsx(Xb,{}),c.jsx(Wi,{onClick:o,children:"设置"}),c.jsx(Wi,{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(pg,{}),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(AR,{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.2"})]})]})]})]})]})})})}const kv=({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},mk=({className:e,...t})=>c.jsx("nav",{role:"navigation","aria-label":"pagination",className:me("mx-auto flex w-full justify-center",e),...t});mk.displayName="Pagination";const gk=y.forwardRef(({className:e,...t},r)=>c.jsx("ul",{ref:r,className:me("flex flex-row items-center gap-1",e),...t}));gk.displayName="PaginationContent";const qp=y.forwardRef(({className:e,...t},r)=>c.jsx("li",{ref:r,className:me("",e),...t}));qp.displayName="PaginationItem";const vk=({className:e,isActive:t,size:r="icon",...n})=>c.jsx("a",{"aria-current":t?"page":void 0,className:me(ef({variant:t?"outline":"ghost",size:r}),e),...n});vk.displayName="PaginationLink";const yk=({className:e,...t})=>c.jsxs("span",{"aria-hidden":!0,className:me("flex h-9 w-9 items-center justify-center",e),...t,children:[c.jsx(zR,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"More pages"})]});yk.displayName="PaginationEllipsis";const xk=({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),p=e-1;return u=o(d,f),t>3&&u.unshift("..."),t{let d=a;const f=[];for(;d<=l;)f.push(d),d+=u;return f},i=s();return c.jsx(c.Fragment,{children:c.jsx(mk,{className:"dark:text-stone-200 justify-end mt-3",children:c.jsx(gk,{children:i.map((a,l)=>a==="..."?c.jsx(qp,{children:c.jsx(yk,{})},l):c.jsx(qp,{children:c.jsx(vk,{href:"#",isActive:t==a,onClick:u=>{u.preventDefault(),r(a)},children:a})},l))})})})},h0=({when:e,children:t,fallback:r})=>e?t:r;var wk="AlertDialog",[o3,m8]=Qr(wk,[Jb]),Ps=Jb(),_k=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ps(t);return c.jsx(Kg,{...n,...r,modal:!0})};_k.displayName=wk;var i3="AlertDialogTrigger",bk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ps(r);return c.jsx(Gg,{...s,...n,ref:t})});bk.displayName=i3;var a3="AlertDialogPortal",Sk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ps(t);return c.jsx(qg,{...n,...r})};Sk.displayName=a3;var l3="AlertDialogOverlay",kk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ps(r);return c.jsx(dc,{...s,...n,ref:t})});kk.displayName=l3;var Zi="AlertDialogContent",[c3,u3]=o3(Zi),Ck=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,o=Ps(r),i=y.useRef(null),a=Xe(t,i),l=y.useRef(null);return c.jsx(bM,{contentName:Zi,titleName:Ek,docsSlug:"alert-dialog",children:c.jsx(c3,{scope:r,cancelRef:l,children:c.jsxs(fc,{role:"alertdialog",...o,...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(yg,{children:n}),c.jsx(f3,{contentRef:i})]})})})});Ck.displayName=Zi;var Ek="AlertDialogTitle",Tk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ps(r);return c.jsx(hc,{...s,...n,ref:t})});Tk.displayName=Ek;var jk="AlertDialogDescription",Nk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ps(r);return c.jsx(pc,{...s,...n,ref:t})});Nk.displayName=jk;var d3="AlertDialogAction",Rk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ps(r);return c.jsx(ff,{...s,...n,ref:t})});Rk.displayName=d3;var Pk="AlertDialogCancel",Dk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=u3(Pk,r),o=Ps(r),i=Xe(t,s);return c.jsx(ff,{...o,...n,ref:i})});Dk.displayName=Pk;var f3=({contentRef:e})=>{const t=`\`${Zi}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${Zi}\` by passing a \`${jk}\` 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 \`${Zi}\`. 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 y.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},h3=_k,p3=bk,m3=Sk,Ak=kk,Ok=Ck,Mk=Rk,Ik=Dk,Lk=Tk,Fk=Nk;const g3=h3,v3=p3,y3=m3,zk=y.forwardRef(({className:e,...t},r)=>c.jsx(Ak,{className:me("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}));zk.displayName=Ak.displayName;const Uk=y.forwardRef(({className:e,...t},r)=>c.jsxs(y3,{children:[c.jsx(zk,{}),c.jsx(Ok,{ref:r,className:me("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})]}));Uk.displayName=Ok.displayName;const Vk=({className:e,...t})=>c.jsx("div",{className:me("flex flex-col space-y-2 text-center sm:text-left",e),...t});Vk.displayName="AlertDialogHeader";const Wk=({className:e,...t})=>c.jsx("div",{className:me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Wk.displayName="AlertDialogFooter";const $k=y.forwardRef(({className:e,...t},r)=>c.jsx(Lk,{ref:r,className:me("text-lg font-semibold",e),...t}));$k.displayName=Lk.displayName;const Bk=y.forwardRef(({className:e,...t},r)=>c.jsx(Fk,{ref:r,className:me("text-sm text-muted-foreground",e),...t}));Bk.displayName=Fk.displayName;const Hk=y.forwardRef(({className:e,...t},r)=>c.jsx(Mk,{ref:r,className:me(ef(),e),...t}));Hk.displayName=Mk.displayName;const Yk=y.forwardRef(({className:e,...t},r)=>c.jsx(Ik,{ref:r,className:me(ef({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Yk.displayName=Ik.displayName;function Zk(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Cv="Switch",[x3,g8]=Qr(Cv),[w3,_3]=x3(Cv),Kk=y.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:o,required:i,disabled:a,value:l="on",onCheckedChange:u,...d}=e,[f,p]=y.useState(null),m=Xe(t,h=>p(h)),x=y.useRef(!1),g=f?!!f.closest("form"):!0,[w=!1,v]=io({prop:s,defaultProp:o,onChange:u});return c.jsxs(w3,{scope:r,checked:w,disabled:a,children:[c.jsx(ze.button,{type:"button",role:"switch","aria-checked":w,"aria-required":i,"data-state":Xk(w),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onClick:ue(e.onClick,h=>{v(_=>!_),g&&(x.current=h.isPropagationStopped(),x.current||h.stopPropagation())})}),g&&c.jsx(b3,{control:f,bubbles:!x.current,name:n,value:l,checked:w,required:i,disabled:a,style:{transform:"translateX(-100%)"}})]})});Kk.displayName=Cv;var Gk="SwitchThumb",qk=y.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=_3(Gk,r);return c.jsx(ze.span,{"data-state":Xk(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});qk.displayName=Gk;var b3=e=>{const{control:t,checked:r,bubbles:n=!0,...s}=e,o=y.useRef(null),i=Zk(r),a=P1(t);return y.useEffect(()=>{const l=o.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==r&&f){const p=new Event("click",{bubbles:n});f.call(l,r),l.dispatchEvent(p)}},[i,r,n]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Xk(e){return e?"checked":"unchecked"}var Qk=Kk,S3=qk;const Jk=y.forwardRef(({className:e,...t},r)=>c.jsx(Qk,{className:me("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(S3,{className:me("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")})}));Jk.displayName=Qk.displayName;var k3="VisuallyHidden",xc=y.forwardRef((e,t)=>c.jsx(ze.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}}));xc.displayName=k3;var C3=xc,Ev="ToastProvider",[Tv,E3,T3]=tf("Toast"),[eC,v8]=Qr("Toast",[T3]),[j3,Cf]=eC(Ev),tC=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:i}=e,[a,l]=y.useState(null),[u,d]=y.useState(0),f=y.useRef(!1),p=y.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ev}\`. Expected non-empty \`string\`.`),c.jsx(Tv.Provider,{scope:t,children:c.jsx(j3,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:y.useCallback(()=>d(m=>m+1),[]),onToastRemove:y.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:i})})};tC.displayName=Ev;var rC="ToastViewport",N3=["F8"],Xp="toast.viewportPause",Qp="toast.viewportResume",nC=y.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=N3,label:s="Notifications ({hotkey})",...o}=e,i=Cf(rC,r),a=E3(r),l=y.useRef(null),u=y.useRef(null),d=y.useRef(null),f=y.useRef(null),p=Xe(t,f,i.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=i.toastCount>0;y.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]),y.useEffect(()=>{const w=l.current,v=f.current;if(x&&w&&v){const h=()=>{if(!i.isClosePausedRef.current){const T=new CustomEvent(Xp);v.dispatchEvent(T),i.isClosePausedRef.current=!0}},_=()=>{if(i.isClosePausedRef.current){const T=new CustomEvent(Qp);v.dispatchEvent(T),i.isClosePausedRef.current=!1}},C=T=>{!w.contains(T.relatedTarget)&&_()},E=()=>{w.contains(document.activeElement)||_()};return w.addEventListener("focusin",h),w.addEventListener("focusout",C),w.addEventListener("pointermove",h),w.addEventListener("pointerleave",E),window.addEventListener("blur",h),window.addEventListener("focus",_),()=>{w.removeEventListener("focusin",h),w.removeEventListener("focusout",C),w.removeEventListener("pointermove",h),w.removeEventListener("pointerleave",E),window.removeEventListener("blur",h),window.removeEventListener("focus",_)}}},[x,i.isClosePausedRef]);const g=y.useCallback(({tabbingDirection:w})=>{const h=a().map(_=>{const C=_.ref.current,E=[C,...W3(C)];return w==="forwards"?E:E.reverse()});return(w==="forwards"?h.reverse():h).flat()},[a]);return y.useEffect(()=>{const w=f.current;if(w){const v=h=>{var E,T,R;const _=h.altKey||h.ctrlKey||h.metaKey;if(h.key==="Tab"&&!_){const D=document.activeElement,P=h.shiftKey;if(h.target===w&&P){(E=u.current)==null||E.focus();return}const j=g({tabbingDirection:P?"backwards":"forwards"}),F=j.findIndex(b=>b===D);Ph(j.slice(F+1))?h.preventDefault():P?(T=u.current)==null||T.focus():(R=d.current)==null||R.focus()}};return w.addEventListener("keydown",v),()=>w.removeEventListener("keydown",v)}},[a,g]),c.jsxs($P,{ref:l,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&c.jsx(Jp,{ref:u,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"forwards"});Ph(w)}}),c.jsx(Tv.Slot,{scope:r,children:c.jsx(ze.ol,{tabIndex:-1,...o,ref:p})}),x&&c.jsx(Jp,{ref:d,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"backwards"});Ph(w)}})]})});nC.displayName=rC;var sC="ToastFocusProxy",Jp=y.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=Cf(sC,r);return c.jsx(xc,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{var u;const a=i.relatedTarget;!((u=o.viewport)!=null&&u.contains(a))&&n()}})});Jp.displayName=sC;var Ef="Toast",R3="toast.swipeStart",P3="toast.swipeMove",D3="toast.swipeCancel",A3="toast.swipeEnd",oC=y.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...i}=e,[a=!0,l]=io({prop:n,defaultProp:s,onChange:o});return c.jsx(Er,{present:r||a,children:c.jsx(I3,{open:a,...i,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)})})})});oC.displayName=Ef;var[O3,M3]=eC(Ef,{onClose(){}}),I3=y.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:m,...x}=e,g=Cf(Ef,r),[w,v]=y.useState(null),h=Xe(t,b=>v(b)),_=y.useRef(null),C=y.useRef(null),E=s||g.duration,T=y.useRef(0),R=y.useRef(E),D=y.useRef(0),{onToastAdd:P,onToastRemove:L}=g,q=At(()=>{var W;(w==null?void 0:w.contains(document.activeElement))&&((W=g.viewport)==null||W.focus()),i()}),j=y.useCallback(b=>{!b||b===1/0||(window.clearTimeout(D.current),T.current=new Date().getTime(),D.current=window.setTimeout(q,b))},[q]);y.useEffect(()=>{const b=g.viewport;if(b){const W=()=>{j(R.current),u==null||u()},te=()=>{const $=new Date().getTime()-T.current;R.current=R.current-$,window.clearTimeout(D.current),l==null||l()};return b.addEventListener(Xp,te),b.addEventListener(Qp,W),()=>{b.removeEventListener(Xp,te),b.removeEventListener(Qp,W)}}},[g.viewport,E,l,u,j]),y.useEffect(()=>{o&&!g.isClosePausedRef.current&&j(E)},[o,E,g.isClosePausedRef,j]),y.useEffect(()=>(P(),()=>L()),[P,L]);const F=y.useMemo(()=>w?fC(w):null,[w]);return g.viewport?c.jsxs(c.Fragment,{children:[F&&c.jsx(L3,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:F}),c.jsx(O3,{scope:r,onClose:q,children:ks.createPortal(c.jsx(Tv.ItemSlot,{scope:r,children:c.jsx(WP,{asChild:!0,onEscapeKeyDown:ue(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||q(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(ze.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":g.swipeDirection,...x,ref:h,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ue(e.onKeyDown,b=>{b.key==="Escape"&&(a==null||a(b.nativeEvent),b.nativeEvent.defaultPrevented||(g.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(g.swipeDirection),I=["left","up"].includes(g.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,ou(P3,f,ne,{discrete:!1})):p0(de,g.swipeDirection,V)?(C.current=de,ou(R3,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};p0(W,g.swipeDirection,g.swipeThreshold)?ou(A3,m,Z,{discrete:!0}):ou(D3,p,Z,{discrete:!0}),$.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),L3=e=>{const{__scopeToast:t,children:r,...n}=e,s=Cf(Ef,t),[o,i]=y.useState(!1),[a,l]=y.useState(!1);return U3(()=>i(!0)),y.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:c.jsx(lc,{asChild:!0,children:c.jsx(xc,{...n,children:o&&c.jsxs(c.Fragment,{children:[s.label," ",r]})})})},F3="ToastTitle",iC=y.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return c.jsx(ze.div,{...n,ref:t})});iC.displayName=F3;var z3="ToastDescription",aC=y.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return c.jsx(ze.div,{...n,ref:t})});aC.displayName=z3;var lC="ToastAction",cC=y.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?c.jsx(dC,{altText:r,asChild:!0,children:c.jsx(jv,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${lC}\`. Expected non-empty \`string\`.`),null)});cC.displayName=lC;var uC="ToastClose",jv=y.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=M3(uC,r);return c.jsx(dC,{asChild:!0,children:c.jsx(ze.button,{type:"button",...n,ref:t,onClick:ue(e.onClick,s.onClose)})})});jv.displayName=uC;var dC=y.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return c.jsx(ze.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function fC(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),V3(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...fC(n))}}),t}function ou(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?wg(s,o):s.dispatchEvent(o)}var p0=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),o=n>s;return t==="left"||t==="right"?o&&n>r:!o&&s>r};function U3(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 V3(e){return e.nodeType===e.ELEMENT_NODE}function W3(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 Ph(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var $3=tC,hC=nC,pC=oC,mC=iC,gC=aC,vC=cC,yC=jv;const B3=$3,xC=y.forwardRef(({className:e,...t},r)=>c.jsx(hC,{ref:r,className:me("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}));xC.displayName=hC.displayName;const H3=ic("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"}}),wC=y.forwardRef(({className:e,variant:t,...r},n)=>c.jsx(pC,{ref:n,className:me(H3({variant:t}),e),...r}));wC.displayName=pC.displayName;const Y3=y.forwardRef(({className:e,...t},r)=>c.jsx(vC,{ref:r,className:me("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}));Y3.displayName=vC.displayName;const _C=y.forwardRef(({className:e,...t},r)=>c.jsx(yC,{ref:r,className:me("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(vg,{className:"h-4 w-4"})}));_C.displayName=yC.displayName;const bC=y.forwardRef(({className:e,...t},r)=>c.jsx(mC,{ref:r,className:me("text-sm font-semibold",e),...t}));bC.displayName=mC.displayName;const SC=y.forwardRef(({className:e,...t},r)=>c.jsx(gC,{ref:r,className:me("text-sm opacity-90",e),...t}));SC.displayName=gC.displayName;const Z3=1,K3=1e6;let Dh=0;function G3(){return Dh=(Dh+1)%Number.MAX_SAFE_INTEGER,Dh.toString()}const Ah=new Map,m0=e=>{if(Ah.has(e))return;const t=setTimeout(()=>{Ah.delete(e),ol({type:"REMOVE_TOAST",toastId:e})},K3);Ah.set(e,t)},q3=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Z3)};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?m0(r):e.toasts.forEach(n=>{m0(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)}}},Tu=[];let ju={toasts:[]};function ol(e){ju=q3(ju,e),Tu.forEach(t=>{t(ju)})}function X3({...e}){const t=G3(),r=s=>ol({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>ol({type:"DISMISS_TOAST",toastId:t});return ol({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function Tf(){const[e,t]=y.useState(ju);return y.useEffect(()=>(Tu.push(t),()=>{const r=Tu.indexOf(t);r>-1&&Tu.splice(r,1)}),[e]),{...e,toast:X3,dismiss:r=>ol({type:"DISMISS_TOAST",toastId:r})}}function Nv(){const{toasts:e}=Tf();return c.jsxs(B3,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return c.jsxs(wC,{...o,children:[c.jsxs("div",{className:"grid gap-1",children:[r&&c.jsx(bC,{children:r}),n&&c.jsx(SC,{children:n})]}),s,c.jsx(_C,{})]},t)}),c.jsx(xC,{})]})}var[jf,y8]=Qr("Tooltip",[ya]),Nf=ya(),kC="TooltipProvider",Q3=700,em="tooltip.open",[J3,Rv]=jf(kC),CC=e=>{const{__scopeTooltip:t,delayDuration:r=Q3,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,[i,a]=y.useState(!0),l=y.useRef(!1),u=y.useRef(0);return y.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),c.jsx(J3,{scope:t,isOpenDelayed:i,delayDuration:r,onOpen:y.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:y.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:y.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:o})};CC.displayName=kC;var Rf="Tooltip",[e5,Pf]=jf(Rf),EC=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:a}=e,l=Rv(Rf,e.__scopeTooltip),u=Nf(t),[d,f]=y.useState(null),p=Mn(),m=y.useRef(0),x=i??l.disableHoverableContent,g=a??l.delayDuration,w=y.useRef(!1),[v=!1,h]=io({prop:n,defaultProp:s,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(em))):l.onClose(),o==null||o(R)}}),_=y.useMemo(()=>v?w.current?"delayed-open":"instant-open":"closed",[v]),C=y.useCallback(()=>{window.clearTimeout(m.current),w.current=!1,h(!0)},[h]),E=y.useCallback(()=>{window.clearTimeout(m.current),h(!1)},[h]),T=y.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{w.current=!0,h(!0)},g)},[g,h]);return y.useEffect(()=>()=>window.clearTimeout(m.current),[]),c.jsx(Rg,{...u,children:c.jsx(e5,{scope:t,contentId:p,open:v,stateAttribute:_,trigger:d,onTriggerChange:f,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayed?T():C()},[l.isOpenDelayed,T,C]),onTriggerLeave:y.useCallback(()=>{x?E():window.clearTimeout(m.current)},[E,x]),onOpen:C,onClose:E,disableHoverableContent:x,children:r})})};EC.displayName=Rf;var tm="TooltipTrigger",TC=y.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Pf(tm,r),o=Rv(tm,r),i=Nf(r),a=y.useRef(null),l=Xe(t,a,s.onTriggerChange),u=y.useRef(!1),d=y.useRef(!1),f=y.useCallback(()=>u.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(Pg,{asChild:!0,...i,children:c.jsx(ze.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:ue(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!o.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)})})});TC.displayName=tm;var t5="TooltipPortal",[x8,r5]=jf(t5,{forceMount:void 0}),na="TooltipContent",Pv=y.forwardRef((e,t)=>{const r=r5(na,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,i=Pf(na,e.__scopeTooltip);return c.jsx(Er,{present:n||i.open,children:i.disableHoverableContent?c.jsx(jC,{side:s,...o,ref:t}):c.jsx(n5,{side:s,...o,ref:t})})}),n5=y.forwardRef((e,t)=>{const r=Pf(na,e.__scopeTooltip),n=Rv(na,e.__scopeTooltip),s=y.useRef(null),o=Xe(t,s),[i,a]=y.useState(null),{trigger:l,onClose:u}=r,d=s.current,{onPointerInTransitChange:f}=n,p=y.useCallback(()=>{a(null),f(!1)},[f]),m=y.useCallback((x,g)=>{const w=x.currentTarget,v={x:x.clientX,y:x.clientY},h=a5(v,w.getBoundingClientRect()),_=l5(v,h),C=c5(g.getBoundingClientRect()),E=d5([..._,...C]);a(E),f(!0)},[f]);return y.useEffect(()=>()=>p(),[p]),y.useEffect(()=>{if(l&&d){const x=w=>m(w,d),g=w=>m(w,l);return l.addEventListener("pointerleave",x),d.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",g)}}},[l,d,m,p]),y.useEffect(()=>{if(i){const x=g=>{const w=g.target,v={x:g.clientX,y:g.clientY},h=(l==null?void 0:l.contains(w))||(d==null?void 0:d.contains(w)),_=!u5(v,i);h?p():_&&(p(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,d,i,u,p]),c.jsx(jC,{...e,ref:o})}),[s5,o5]=jf(Rf,{isInside:!1}),jC=y.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...a}=e,l=Pf(na,r),u=Nf(r),{onClose:d}=l;return y.useEffect(()=>(document.addEventListener(em,d),()=>document.removeEventListener(em,d)),[d]),y.useEffect(()=>{if(l.trigger){const f=p=>{const m=p.target;m!=null&&m.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),c.jsx(ma,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:c.jsxs(Dg,{"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(yg,{children:n}),c.jsx(s5,{scope:r,isInside:!0,children:c.jsx(C3,{id:l.contentId,role:"tooltip",children:s||n})})]})})});Pv.displayName=na;var NC="TooltipArrow",i5=y.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Nf(r);return o5(NC,r).isInside?null:c.jsx(Ag,{...s,...n,ref:t})});i5.displayName=NC;function a5(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function l5(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 c5(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 u5(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;on!=d>n&&r<(u-a)*(n-l)/(d-l)+a&&(s=!s)}return s}function d5(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),f5(t)}function f5(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.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 o=r[r.length-1],i=r[r.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.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 h5=EC,p5=TC,RC=Pv;const m5=h5,g5=p5,v5=y.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(RC,{ref:n,sideOffset:t,className:me("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}));v5.displayName=RC.displayName;function iu(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 PC={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,o){function i(u,d){if(!s[u]){if(!n[u]){var f=typeof iu=="function"&&iu;if(!d&&f)return f(u,!0);if(a)return a(u,!0);var p=new Error("Cannot find module '"+u+"'");throw p.code="MODULE_NOT_FOUND",p}var m=s[u]={exports:{}};n[u][0].call(m.exports,function(x){var g=n[u][1][x];return i(g||x)},m,m.exports,r,n,s,o)}return s[u].exports}for(var a=typeof iu=="function"&&iu,l=0;l>2,m=(3&u)<<4|d>>4,x=1<_?(15&d)<<2|f>>6:64,g=2<_?63&f:64,w.push(a.charAt(p)+a.charAt(m)+a.charAt(x)+a.charAt(g));return w.join("")},s.decode=function(l){var u,d,f,p,m,x,g=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 h,_=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(h=i.uint8array?new Uint8Array(0|_):new Array(0|_);g>4,d=(15&p)<<4|(m=a.indexOf(l.charAt(g++)))>>2,f=(3&m)<<6|(x=a.indexOf(l.charAt(g++))),h[w++]=u,m!==64&&(h[w++]=d),x!==64&&(h[w++]=f);return h}},{"./support":30,"./utils":32}],2:[function(r,n,s){var o=r("./external"),i=r("./stream/DataWorker"),a=r("./stream/Crc32Probe"),l=r("./stream/DataLengthProbe");function u(d,f,p,m,x){this.compressedSize=d,this.uncompressedSize=f,this.crc32=p,this.compression=m,this.compressedContent=x}u.prototype={getContentWorker:function(){var d=new i(o.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 i(o.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,p){return d.pipe(new a).pipe(new l("uncompressedSize")).pipe(f.compressWorker(p)).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 o=r("./stream/GenericWorker");s.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},s.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,s){var o=r("./utils"),i=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?o.getTypeOf(a)!=="string"?function(u,d,f,p){var m=i,x=p+f;u^=-1;for(var g=p;g>>8^m[255&(u^d[g])];return-1^u}(0|l,a,a.length,0):function(u,d,f,p){var m=i,x=p+f;u^=-1;for(var g=p;g>>8^m[255&(u^d.charCodeAt(g))];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 o=null;o=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:o}},{lie:37}],7:[function(r,n,s){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=r("pako"),a=r("./utils"),l=r("./stream/GenericWorker"),u=o?"uint8array":"array";function d(f,p){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=p,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 i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(p){f.push({data:p,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 o(m,x){var g,w="";for(g=0;g>>=8;return w}function i(m,x,g,w,v,h){var _,C,E=m.file,T=m.compression,R=h!==u.utf8encode,D=a.transformTo("string",h(E.name)),P=a.transformTo("string",u.utf8encode(E.name)),L=E.comment,q=a.transformTo("string",h(L)),j=a.transformTo("string",u.utf8encode(L)),F=P.length!==E.name.length,b=j.length!==L.length,W="",te="",$="",Z=E.dir,I=E.date,Q={crc32:0,compressedSize:0,uncompressedSize:0};x&&!g||(Q.crc32=m.crc32,Q.compressedSize=m.compressedSize,Q.uncompressedSize=m.uncompressedSize);var z=0;x&&(z|=8),R||!F&&!b||(z|=2048);var V=0,de=0;Z&&(V|=16),v==="UNIX"?(de=798,V|=function(se,Te){var fe=se;return se||(fe=Te?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=o(1,1)+o(d(D),4)+P,W+="up"+o(te.length,2)+te),b&&($=o(1,1)+o(d(q),4)+j,W+="uc"+o($.length,2)+$);var ne="";return ne+=` \0`,ne+=o(z,2),ne+=T.magic,ne+=o(_,2),ne+=o(C,2),ne+=o(Q.crc32,4),ne+=o(Q.compressedSize,4),ne+=o(Q.uncompressedSize,4),ne+=o(D.length,2),ne+=o(W.length,2),{fileRecord:f.LOCAL_FILE_HEADER+ne+D+W,dirRecord:f.CENTRAL_FILE_HEADER+o(de,2)+ne+o(q.length,2)+"\0\0\0\0"+o(V,4)+o(w,4)+D+W+q}}var a=r("../utils"),l=r("../stream/GenericWorker"),u=r("../utf8"),d=r("../crc32"),f=r("../signature");function p(m,x,g,w){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=x,this.zipPlatform=g,this.encodeFileName=w,this.streamFiles=m,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,l),p.prototype.push=function(m){var x=m.meta.percent||0,g=this.entriesCount,w=this._sources.length;this.accumulate?this.contentBuffer.push(m):(this.bytesWritten+=m.data.length,l.prototype.push.call(this,{data:m.data,meta:{currentFile:this.currentFile,percent:g?(x+100*(g-w-1))/g:100}}))},p.prototype.openedSource=function(m){this.currentSourceOffset=this.bytesWritten,this.currentFile=m.file.name;var x=this.streamFiles&&!m.file.dir;if(x){var g=i(m,x,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(m){this.accumulate=!1;var x=this.streamFiles&&!m.file.dir,g=i(m,x,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),x)this.push({data:function(w){return f.DATA_DESCRIPTOR+o(w.crc32,4)+o(w.compressedSize,4)+o(w.uncompressedSize,4)}(m),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var m=this.bytesWritten,x=0;x=this.index;l--)u=(u<<8)+this.byteAt(l);return this.index+=a,u},readString:function(a){return o.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=i},{"../utils":32}],19:[function(r,n,s){var o=r("./Uint8ArrayReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.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=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,s){var o=r("./DataReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},i.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},i.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},i.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=i},{"../utils":32,"./DataReader":18}],21:[function(r,n,s){var o=r("./ArrayReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.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=i},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,s){var o=r("../utils"),i=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),u=r("./NodeBufferReader"),d=r("./Uint8ArrayReader");n.exports=function(f){var p=o.getTypeOf(f);return o.checkSupport(p),p!=="string"||i.uint8array?p==="nodebuffer"?new u(f):i.uint8array?new d(o.transformTo("uint8array",f)):new a(o.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 o=r("./GenericWorker"),i=r("../utils");function a(l){o.call(this,"ConvertWorker to "+l),this.destType=l}i.inherits(a,o),a.prototype.processChunk=function(l){this.push({data:i.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,s){var o=r("./GenericWorker"),i=r("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,o),a.prototype.processChunk=function(l){this.streamInfo.crc32=i(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,s){var o=r("../utils"),i=r("./GenericWorker");function a(l){i.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(a,i),a.prototype.processChunk=function(l){if(l){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+l.data.length}i.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,s){var o=r("../utils"),i=r("./GenericWorker");function a(l){i.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=o.getTypeOf(d),u.isPaused||u._tickAndRepeat()},function(d){u.error(d)})}o.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.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 o(i){this.name=i||"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}o.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,a){return this._listeners[i].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,a){if(this._listeners[i])for(var l=0;l "+i:i}},n.exports=o},{}],29:[function(r,n,s){var o=r("../utils"),i=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 p(x,g){return new d.Promise(function(w,v){var h=[],_=x._internalType,C=x._outputType,E=x._mimeType;x.on("data",function(T,R){h.push(T),g&&g(R)}).on("error",function(T){h=[],v(T)}).on("end",function(){try{var T=function(R,D,P){switch(R){case"blob":return o.newBlob(o.transformTo("arraybuffer",D),P);case"base64":return l.encode(D);default:return o.transformTo(R,D)}}(C,function(R,D){var P,L=0,q=null,j=0;for(P=0;P"u")s.blob=!1;else{var o=new ArrayBuffer(0);try{s.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(o),s.blob=i.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 o=r("./utils"),i=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 p(){l.call(this,"utf-8 encode")}s.utf8encode=function(m){return i.nodebuffer?a.newBufferFrom(m,"utf-8"):function(x){var g,w,v,h,_,C=x.length,E=0;for(h=0;h>>6:(w<65536?g[_++]=224|w>>>12:(g[_++]=240|w>>>18,g[_++]=128|w>>>12&63),g[_++]=128|w>>>6&63),g[_++]=128|63&w);return g}(m)},s.utf8decode=function(m){return i.nodebuffer?o.transformTo("nodebuffer",m).toString("utf-8"):function(x){var g,w,v,h,_=x.length,C=new Array(2*_);for(g=w=0;g<_;)if((v=x[g++])<128)C[w++]=v;else if(4<(h=u[v]))C[w++]=65533,g+=h-1;else{for(v&=h===2?31:h===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),o.applyFromCharCode(C)}(m=o.transformTo(i.uint8array?"uint8array":"array",m))},o.inherits(f,l),f.prototype.processChunk=function(m){var x=o.transformTo(i.uint8array?"uint8array":"array",m.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var g=x;(x=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),x.set(g,this.leftOver.length)}else x=this.leftOver.concat(x);this.leftOver=null}var w=function(h,_){var C;for((_=_||h.length)>h.length&&(_=h.length),C=_-1;0<=C&&(192&h[C])==128;)C--;return C<0||C===0?_:C+u[h[C]]>_?C:_}(x),v=x;w!==x.length&&(i.uint8array?(v=x.subarray(0,w),this.leftOver=x.subarray(w,x.length)):(v=x.slice(0,w),this.leftOver=x.slice(w,x.length))),this.push({data:s.utf8decode(v),meta:m.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=f,o.inherits(p,l),p.prototype.processChunk=function(m){this.push({data:s.utf8encode(m.data),meta:m.meta})},s.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,s){var o=r("./support"),i=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function u(g){return g}function d(g,w){for(var v=0;v>8;this.dir=!!(16&this.externalFileAttributes),m==0&&(this.dosPermissions=63&this.externalFileAttributes),m==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var m=o(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=m.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=m.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=m.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=m.readInt(4))}},readExtraFields:function(m){var x,g,w,v=m.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});m.index+4>>6:(m<65536?p[w++]=224|m>>>12:(p[w++]=240|m>>>18,p[w++]=128|m>>>12&63),p[w++]=128|m>>>6&63),p[w++]=128|63&m);return p},s.buf2binstring=function(f){return d(f,f.length)},s.binstring2buf=function(f){for(var p=new o.Buf8(f.length),m=0,x=p.length;m>10&1023,h[x++]=56320|1023&g)}return d(h,x)},s.utf8border=function(f,p){var m;for((p=p||f.length)>f.length&&(p=f.length),m=p-1;0<=m&&(192&f[m])==128;)m--;return m<0||m===0?p:m+l[f[m]]>p?m:p}},{"./common":41}],43:[function(r,n,s){n.exports=function(o,i,a,l){for(var u=65535&o|0,d=o>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3>>1:i>>>1;a[l]=i}return a}();n.exports=function(i,a,l,u){var d=o,f=u+l;i^=-1;for(var p=u;p>>8^d[255&(i^a[p])];return-1^i}},{}],46:[function(r,n,s){var o,i=r("../utils/common"),a=r("./trees"),l=r("./adler32"),u=r("./crc32"),d=r("./messages"),f=0,p=4,m=0,x=-2,g=-1,w=4,v=2,h=8,_=9,C=286,E=30,T=19,R=2*C+1,D=15,P=3,L=258,q=L+P+1,j=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&&(i.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],Oe=H[N+O];k.prev_length>=k.good_match&&(S>>=2),Y>k.lookahead&&(Y=k.lookahead);do if(H[(K=J)+O]===Oe&&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 Te(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(i.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(Te(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===p?(V(k,!0),k.strm.avail_out===0?te:$):(k.strstart>k.block_start&&(V(k,!1),k.strm.avail_out),b)}),new be(4,4,8,4,fe),new be(4,5,16,8,fe),new be(4,6,32,32,fe),new be(4,4,16,16,ve),new be(8,16,32,32,ve),new be(8,16,128,128,ve),new be(8,32,128,256,ve),new be(32,128,258,1024,ve),new be(32,258,258,4096,ve)],s.deflateInit=function(k,J){return rt(k,J,h,15,8,0)},s.deflateInit2=rt,s.deflateReset=ke,s.deflateResetKeep=je,s.deflateSetHeader=function(k,J){return k&&k.state?k.state.wrap!==2?x:(k.state.gzhead=J,m):x},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=h+(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,m}else if(k.avail_in===0&&I(J)<=I(K)&&J!==p)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&&(Te(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===p?(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,Oe=M.window;;){if(M.lookahead<=L){if(Te(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===p?(V(M,!0),M.strm.avail_out===0?te:$):M.last_lit&&(V(M,!1),M.strm.avail_out===0)?b:W}(A,J):o[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),m;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,m}return J!==p?m: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 i.Buf8(K.w_size),i.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,Te(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)+(h&(1<>>=P,_-=P),_<15&&(h+=b[l++]<<_,_+=8,h+=b[l++]<<_,_+=8),D=E[h&R];r:for(;;){if(h>>>=P=D>>>24,_-=P,!(16&(P=D>>>16&255))){if(!(64&P)){D=E[(65535&D)+(h&(1<>>=P,_-=P,(P=d-f)>3,h&=(1<<(_-=L<<3))-1,o.next_in=l,o.next_out=d,o.avail_in=l>>24&255)+(j>>>8&65280)+((65280&j)<<8)+((255&j)<<24)}function h(){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 o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(j){var F;return j&&j.state?(F=j.state,j.total_in=j.total_out=F.total=0,j.msg="",F.wrap&&(j.adler=1&F.wrap),F.mode=x,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new o.Buf32(g),F.distcode=F.distdyn=new o.Buf32(w),F.sane=1,F.back=-1,p):m}function C(j){var F;return j&&j.state?((F=j.state).wsize=0,F.whave=0,F.wnext=0,_(j)):m}function E(j,F){var b,W;return j&&j.state?(W=j.state,F<0?(b=0,F=-F):(b=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15=$.wsize?(o.arraySet($.window,F,b-$.wsize,$.wsize,0),$.wnext=0,$.whave=$.wsize):(W<(te=$.wsize-$.wnext)&&(te=W),o.arraySet($.window,F,b-W,te,$.wnext),(W-=te)?(o.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(j){return T(j,15)},s.inflateInit2=T,s.inflate=function(j,F){var b,W,te,$,Z,I,Q,z,V,de,ne,se,Te,fe,ve,be,Pe,je,ke,rt,k,J,K,A,S=0,N=new o.Buf8(4),O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!j||!j.state||!j.output||!j.input&&j.avail_in!==0)return m;(b=j.state).mode===12&&(b.mode=13),Z=j.next_out,te=j.output,Q=j.avail_out,$=j.next_in,W=j.input,I=j.avail_in,z=b.hold,V=b.bits,de=I,ne=Q,J=p;e:for(;;)switch(b.mode){case x: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){j.msg="incorrect header check",b.mode=30;break}if((15&z)!=8){j.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){j.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)),o.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),j.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:j.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)){j.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){j.msg="invalid code lengths set",b.mode=30;break}b.have=0,b.mode=19;case 19:for(;b.have>>16&255,Pe=65535&S,!((ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=ve,V-=ve,b.lens[b.have++]=Pe;else{if(Pe===16){for(A=ve+2;V>>=ve,V-=ve,b.have===0){j.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(Pe===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){j.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){j.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){j.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){j.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){j.next_out=Z,j.avail_out=Q,j.next_in=$,j.avail_in=I,b.hold=z,b.bits=V,l(j,ne),Z=j.next_out,te=j.output,Q=j.avail_out,$=j.next_in,W=j.input,I=j.avail_in,z=b.hold,V=b.bits,b.mode===12&&(b.back=-1);break}for(b.back=0;be=(S=b.lencode[z&(1<>>16&255,Pe=65535&S,!((ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>je)])>>>16&255,Pe=65535&S,!(je+(ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=je,V-=je,b.back+=je}if(z>>>=ve,V-=ve,b.back+=ve,b.length=Pe,be===0){b.mode=26;break}if(32&be){b.back=-1,b.mode=12;break}if(64&be){j.msg="invalid literal/length code",b.mode=30;break}b.extra=15&be,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(;be=(S=b.distcode[z&(1<>>16&255,Pe=65535&S,!((ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>je)])>>>16&255,Pe=65535&S,!(je+(ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=je,V-=je,b.back+=je}if(z>>>=ve,V-=ve,b.back+=ve,64&be){j.msg="invalid distance code",b.mode=30;break}b.offset=Pe,b.extra=15&be,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){j.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){j.msg="invalid distance too far back",b.mode=30;break}Te=se>b.wnext?(se-=b.wnext,b.wsize-se):b.wnext-se,se>b.length&&(se=b.length),fe=b.window}else fe=te,Te=Z-b.offset,se=b.length;for(QR?(P=Te[fe+w[F]],V[de+w[F]]):(P=96,0),h=1<>Z)+(_-=h)]=D<<24|P<<16|L|0,_!==0;);for(h=1<>=1;if(h!==0?(z&=h-1,z+=h):z=0,F++,--ne[j]==0){if(j===W)break;j=f[p+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]=Te(H[ee]++,ee))}}function ve(S){var N;for(N=0;N>1;1<=O;O--)je(S,H,O);for(M=he;O=S.heap[1],S.heap[1]=S.heap[S.heap_len--],je(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++,je(S,H,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(Oe,Ct){var Wr,Bt,Kn,ot,Gn,qn,$r=Ct.dyn_tree,Sc=Ct.max_code,kc=Ct.stat_desc.static_tree,si=Ct.stat_desc.has_stree,Cc=Ct.stat_desc.extra_bits,oi=Ct.stat_desc.extra_base,Sn=Ct.stat_desc.max_length,Ds=0;for(ot=0;ot<=w;ot++)Oe.bl_count[ot]=0;for($r[2*Oe.heap[Oe.heap_max]+1]=0,Wr=Oe.heap_max+1;Wr>=7;M>>=1)if(1&Be&&ee.dyn_ltree[2*he]!==0)return i;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),ke(S,q,j)):(ne(S,4+(Y?1:0),3),function(ee,he,Be,Oe){var Ct;for(ne(ee,he-257,5),ne(ee,Be-1,5),ne(ee,Oe-4,4),Ct=0;Ct>>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(o){(function(i,a){if(!i.setImmediate){var l,u,d,f,p=1,m={},x=!1,g=i.document,w=Object.getPrototypeOf&&Object.getPrototypeOf(i);w=w&&w.setTimeout?w:i,l={}.toString.call(i.process)==="[object process]"?function(C){process.nextTick(function(){h(C)})}:function(){if(i.postMessage&&!i.importScripts){var C=!0,E=i.onmessage;return i.onmessage=function(){C=!1},i.postMessage("","*"),i.onmessage=E,C}}()?(f="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",_,!1):i.attachEvent("onmessage",_),function(C){i.postMessage(f+C,"*")}):i.MessageChannel?((d=new MessageChannel).port1.onmessage=function(C){h(C.data)},function(C){d.port2.postMessage(C)}):g&&"onreadystatechange"in g.createElement("script")?(u=g.documentElement,function(C){var E=g.createElement("script");E.onreadystatechange=function(){h(C),E.onreadystatechange=null,u.removeChild(E),E=null},u.appendChild(E)}):function(C){setTimeout(h,0,C)},w.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var E=new Array(arguments.length-1),T=0;T"u"?o===void 0?this:o:self)}).call(this,typeof Rc<"u"?Rc:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(PC);var y5=PC.exports;const x5=mm(y5);function w5(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 _5=async(e,t)=>{const r=new x5;t.forEach(o=>{r.file(o.name,o.content)});const n=await r.generateAsync({type:"blob"}),s=document.createElement("a");s.href=URL.createObjectURL(n),s.download=e,s.click()},sa=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)},b5=e=>sa(e).split(" ")[0];function DC(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"),o=String(t.getUTCHours()).padStart(2,"0"),i=String(t.getUTCMinutes()).padStart(2,"0"),a=String(t.getUTCSeconds()).padStart(2,"0");return`${r}-${n}-${s} ${o}:${i}:${a}`}const S5=async e=>{let t=1;e.page&&(t=e.page);let r=2;e.perPage&&(r=e.perPage);const n=Nt();let s="";return e.state==="enabled"?s="enabled=true":e.state==="disabled"?s="enabled=false":e.state==="expired"&&(s=n.filter("expiredAt<{:expiredAt}",{expiredAt:DC(15)})),n.collection("domains").getList(t,r,{sort:"-created",expand:"lastDeployment",filter:s})},k5=async()=>{const e=Nt(),t=await e.collection("domains").getList(1,1,{}),r=await e.collection("domains").getList(1,1,{filter:e.filter("expiredAt<{:expiredAt}",{expiredAt:DC(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}},C5=async e=>await Nt().collection("domains").getOne(e),rm=async e=>e.id?await Nt().collection("domains").update(e.id,e):await Nt().collection("domains").create(e),E5=async e=>await Nt().collection("domains").delete(e),T5=(e,t)=>Nt().collection("domains").subscribe(e,r=>{r.action==="update"&&t(r.record)},{expand:"lastDeployment"}),j5=e=>{Nt().collection("domains").unsubscribe(e)},N5=()=>{const e=Tf(),t=wn(),r=Vn(),n=new URLSearchParams(r.search),s=n.get("page"),o=n.get("state"),[i,a]=y.useState(0),l=()=>{t("/edit")},u=h=>{n.set("page",h.toString()),t(`?${n.toString()}`)},d=h=>{t(`/edit?id=${h}`)},f=h=>{t(`/history?domain=${h}`)},p=async h=>{try{await E5(h),x(m.filter(_=>_.id!==h))}catch(_){console.error("Error deleting domain:",_)}},[m,x]=y.useState([]);y.useEffect(()=>{(async()=>{const _=await S5({page:s?Number(s):1,perPage:10,state:o||""});x(_.items),a(_.totalPages)})()},[s,o]);const g=async h=>{const _=m.filter(R=>R.id===h),C=_[0].enabled,E=_[0];E.enabled=!C,await rm(E);const T=m.map(R=>R.id===h?{...R,checked:!C}:R);x(T)},w=async h=>{try{j5(h.id),T5(h.id,_=>{console.log(_);const C=m.map(E=>E.id===_.id?{..._}:E);x(C)}),h.rightnow=!0,await rm(h),e.toast({title:"操作成功",description:"已发起部署,请稍后查看部署日志。"})}catch{e.toast({title:"执行失败",description:c.jsxs(c.Fragment,{children:["执行失败,请查看",c.jsx(dr,{to:`/history?domain=${h.id}`,className:"underline text-blue-500",children:"部署日志"}),"查看详情。"]}),variant:"destructive"})}},v=async h=>{const _=`${h.id}-${h.domain}.zip`,C=[{name:`${h.domain}.pem`,content:h.certificate?h.certificate:""},{name:`${h.domain}.key`,content:h.privateKey?h.privateKey:""}];await _5(_,C)};return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"",children:[c.jsx(Nv,{}),c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("div",{className:"text-muted-foreground",children:"域名列表"}),c.jsx(ft,{onClick:l,children:"新增域名"})]}),m.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:"域名"}),m.map(h=>{var _,C,E,T,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:h.domain}),c.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:c.jsx("div",{children:h.expiredAt?c.jsxs(c.Fragment,{children:[c.jsx("div",{children:"有效期90天"}),c.jsxs("div",{children:[b5(h.expiredAt),"到期"]})]}):"---"})}),c.jsx("div",{className:"sm:w-32 w-full pt-1 sm:pt-0 flex items-center",children:h.lastDeployedAt&&((_=h.expand)!=null&&_.lastDeployment)?c.jsx(c.Fragment,{children:((C=h.expand.lastDeployment)==null?void 0:C.phase)==="deploy"&&((E=h.expand.lastDeployment)!=null&&E.phaseSuccess)?c.jsx(mg,{size:16,className:"text-green-700"}):c.jsx(gg,{size:16,className:"text-red-700"})}):"---"}),c.jsx("div",{className:"sm:w-64 w-full pt-1 sm:pt-0 flex items-center",children:h.lastDeployedAt&&((T=h.expand)!=null&&T.lastDeployment)?c.jsx(kv,{phase:(R=h.expand.lastDeployment)==null?void 0:R.phase,phaseSuccess:(D=h.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:h.lastDeployedAt?sa(h.lastDeployedAt):"---"}),c.jsx("div",{className:"sm:w-32 flex items-center",children:c.jsx(CC,{children:c.jsxs(m5,{children:[c.jsx(g5,{children:c.jsx(Jk,{checked:h.enabled,onCheckedChange:()=>{g(h.id)}})}),c.jsx(Pv,{children:c.jsx("div",{className:"border rounded-sm px-3 bg-background text-muted-foreground text-xs",children:h.enabled?"禁用":"启用"})})]})})}),c.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[c.jsx(ft,{variant:"link",className:"p-0",onClick:()=>f(h.id),children:"部署历史"}),c.jsxs(h0,{when:!!h.enabled,children:[c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(ft,{variant:"link",className:"p-0",onClick:()=>w(h),children:"立即部署"})]}),c.jsxs(h0,{when:!!h.expiredAt,children:[c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(ft,{variant:"link",className:"p-0",onClick:()=>v(h),children:"下载"})]}),!h.enabled&&c.jsxs(c.Fragment,{children:[c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsxs(g3,{children:[c.jsx(v3,{asChild:!0,children:c.jsx(ft,{variant:"link",className:"p-0",children:"删除"})}),c.jsxs(Uk,{children:[c.jsxs(Vk,{children:[c.jsx($k,{children:"删除域名"}),c.jsx(Bk,{children:"确定要删除域名吗?"})]}),c.jsxs(Wk,{children:[c.jsx(Yk,{children:"取消"}),c.jsx(Hk,{onClick:()=>{p(h.id)},children:"确认"})]})]})]}),c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(ft,{variant:"link",className:"p-0",onClick:()=>d(h.id),children:"编辑"})]})]})]},h.id)}),c.jsx(xk,{totalPages:i,currentPage:s?Number(s):1,onPageChange:h=>{u(h)}})]}):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(Op,{size:40,className:"text-primary"})}),c.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),c.jsx(ft,{onClick:l,className:"mt-3",children:"添加域名"})]})})]})})},$e=y.forwardRef(({className:e,type:t,...r},n)=>c.jsx("input",{type:t,className:me("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}));$e.displayName="Input";var wc=e=>e.type==="checkbox",Di=e=>e instanceof Date,hr=e=>e==null;const AC=e=>typeof e=="object";var qt=e=>!hr(e)&&!Array.isArray(e)&&AC(e)&&!Di(e),OC=e=>qt(e)&&e.target?wc(e.target)?e.target.checked:e.target.value:e,R5=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,MC=(e,t)=>e.has(R5(t)),P5=e=>{const t=e.constructor&&e.constructor.prototype;return qt(t)&&t.hasOwnProperty("isPrototypeOf")},Dv=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(!(Dv&&(e instanceof Blob||e instanceof FileList))&&(r||qt(e)))if(t=r?[]:{},!r&&!P5(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=wr(e[n]));else return e;return t}var Df=e=>Array.isArray(e)?e.filter(Boolean):[],Ft=e=>e===void 0,le=(e,t,r)=>{if(!t||!qt(e))return r;const n=Df(t.split(/[,[\].]+?/)).reduce((s,o)=>hr(s)?s:s[o],e);return Ft(n)||n===e?Ft(e[t])?r:e[t]:n},Rn=e=>typeof e=="boolean",Av=e=>/^\w*$/.test(e),IC=e=>Df(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ut=(e,t,r)=>{let n=-1;const s=Av(t)?[t]:IC(t),o=s.length,i=o-1;for(;++net.useContext(LC),D5=e=>{const{children:t,...r}=e;return et.createElement(LC.Provider,{value:r},t)};var FC=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==ln.all&&(t._proxyFormState[i]=!n||ln.all),r&&(r[i]=!0),e[i]}});return s},Nr=e=>qt(e)&&!Object.keys(e).length,zC=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return Nr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!n||ln.all))},il=e=>Array.isArray(e)?e:[e],UC=(e,t,r)=>!e||!t||e===t||il(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function Ov(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 A5(e){const t=Af(),{control:r=t.control,disabled:n,name:s,exact:o}=e||{},[i,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,Ov({disabled:n,next:f=>l.current&&UC(d.current,f.name,o)&&zC(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]),FC(i,r,u.current,!1)}var Dn=e=>typeof e=="string",VC=(e,t,r,n,s)=>Dn(e)?(n&&t.watch.add(e),le(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),le(r,o))):(n&&(t.watchAll=!0),r);function O5(e){const t=Af(),{control:r=t.control,name:n,defaultValue:s,disabled:o,exact:i}=e||{},a=et.useRef(n);a.current=n,Ov({disabled:o,subject:r._subjects.values,next:d=>{UC(a.current,d.name,i)&&u(wr(VC(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 M5(e){const t=Af(),{name:r,disabled:n,control:s=t.control,shouldUnregister:o}=e,i=MC(s._names.array,r),a=O5({control:s,name:r,defaultValue:le(s._formValues,r,le(s._defaultValues,r,e.defaultValue)),exact:!0}),l=A5({control:s,name:r}),u=et.useRef(s.register(r,{...e.rules,value:a,...Rn(e.disabled)?{disabled:e.disabled}:{}}));return et.useEffect(()=>{const d=s._options.shouldUnregister||o,f=(p,m)=>{const x=le(s._fields,p);x&&x._f&&(x._f.mount=m)};if(f(r,!0),d){const p=wr(le(s._options.defaultValues,r));ut(s._defaultValues,r,p),Ft(le(s._formValues,r))&&ut(s._formValues,r,p)}return()=>{(i?d&&!s._state.action:d)?s.unregister(r):f(r,!1)}},[r,s,i,o]),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,...Rn(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:et.useCallback(d=>u.current.onChange({target:{value:OC(d),name:r},type:yd.CHANGE}),[r]),onBlur:et.useCallback(()=>u.current.onBlur({target:{value:le(s._formValues,r),name:r},type:yd.BLUR}),[r,s]),ref:d=>{const f=le(s._fields,r);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:p=>d.setCustomValidity(p),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 I5=e=>e.render(M5(e));var WC=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},g0=e=>({isOnSubmit:!e||e===ln.onSubmit,isOnBlur:e===ln.onBlur,isOnChange:e===ln.onChange,isOnAll:e===ln.all,isOnTouch:e===ln.onTouched}),v0=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const al=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=le(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!n)break;if(i.ref&&t(i.ref,i.name)&&!n)break;al(a,t)}else qt(a)&&al(a,t)}}};var L5=(e,t,r)=>{const n=il(le(e,r));return ut(n,"root",t[r]),ut(e,r,n),e},Mv=e=>e.type==="file",Ks=e=>typeof e=="function",xd=e=>{if(!Dv)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Nu=e=>Dn(e),Iv=e=>e.type==="radio",wd=e=>e instanceof RegExp;const y0={value:!1,isValid:!1},x0={value:!0,isValid:!0};var $C=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===""?x0:{value:e[0].value,isValid:!0}:x0:y0}return y0};const w0={isValid:!1,value:null};var BC=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,w0):w0;function _0(e,t,r="validate"){if(Nu(e)||Array.isArray(e)&&e.every(Nu)||Rn(e)&&!e)return{type:r,message:Nu(e)?e:"",ref:t}}var mi=e=>qt(e)&&!wd(e)?e:{value:e,message:""},b0=async(e,t,r,n,s)=>{const{ref:o,refs:i,required:a,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:x,valueAsNumber:g,mount:w,disabled:v}=e._f,h=le(t,x);if(!w||v)return{};const _=i?i[0]:o,C=j=>{n&&_.reportValidity&&(_.setCustomValidity(Rn(j)?"":j||""),_.reportValidity())},E={},T=Iv(o),R=wc(o),D=T||R,P=(g||Mv(o))&&Ft(o.value)&&Ft(h)||xd(o)&&o.value===""||h===""||Array.isArray(h)&&!h.length,L=WC.bind(null,x,r,E),q=(j,F,b,W=es.maxLength,te=es.minLength)=>{const $=j?F:b;E[x]={type:j?W:te,message:$,ref:o,...L(j?W:te,$)}};if(s?!Array.isArray(h)||!h.length:a&&(!D&&(P||hr(h))||Rn(h)&&!h||R&&!$C(i).isValid||T&&!BC(i).isValid)){const{value:j,message:F}=Nu(a)?{value:!!a,message:a}:mi(a);if(j&&(E[x]={type:es.required,message:F,ref:_,...L(es.required,F)},!r))return C(F),E}if(!P&&(!hr(d)||!hr(f))){let j,F;const b=mi(f),W=mi(d);if(!hr(h)&&!isNaN(h)){const te=o.valueAsNumber||h&&+h;hr(b.value)||(j=te>b.value),hr(W.value)||(F=tenew Date(new Date().toDateString()+" "+Q),Z=o.type=="time",I=o.type=="week";Dn(b.value)&&h&&(j=Z?$(h)>$(b.value):I?h>b.value:te>new Date(b.value)),Dn(W.value)&&h&&(F=Z?$(h)<$(W.value):I?h+j.value,W=!hr(F.value)&&h.length<+F.value;if((b||W)&&(q(b,j.message,F.message),!r))return C(E[x].message),E}if(p&&!P&&Dn(h)){const{value:j,message:F}=mi(p);if(wd(j)&&!h.match(j)&&(E[x]={type:es.pattern,message:F,ref:o,...L(es.pattern,F)},!r))return C(F),E}if(m){if(Ks(m)){const j=await m(h,t),F=_0(j,_);if(F&&(E[x]={...F,...L(es.validate,F.message)},!r))return C(F.message),E}else if(qt(m)){let j={};for(const F in m){if(!Nr(j)&&!r)break;const b=_0(await m[F](h,t),_,F);b&&(j={...b,...L(F,b.message)},C(b.message),r&&(E[x]=j))}if(!Nr(j)&&(E[x]={ref:_,...j},!r))return E}}return C(!0),E};function F5(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 o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},_d=e=>hr(e)||!AC(e);function Do(e,t){if(_d(e)||_d(t))return e===t;if(Di(e)&&Di(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 o=e[s];if(!n.includes(s))return!1;if(s!=="ref"){const i=t[s];if(Di(o)&&Di(i)||qt(o)&&qt(i)||Array.isArray(o)&&Array.isArray(i)?!Do(o,i):o!==i)return!1}}return!0}var HC=e=>e.type==="select-multiple",U5=e=>Iv(e)||wc(e),Mh=e=>xd(e)&&e.isConnected,YC=e=>{for(const t in e)if(Ks(e[t]))return!0;return!1};function bd(e,t={}){const r=Array.isArray(e);if(qt(e)||r)for(const n in e)Array.isArray(e[n])||qt(e[n])&&!YC(e[n])?(t[n]=Array.isArray(e[n])?[]:{},bd(e[n],t[n])):hr(e[n])||(t[n]=!0);return t}function ZC(e,t,r){const n=Array.isArray(e);if(qt(e)||n)for(const s in e)Array.isArray(e[s])||qt(e[s])&&!YC(e[s])?Ft(t)||_d(r[s])?r[s]=Array.isArray(e[s])?bd(e[s],[]):{...bd(e[s])}:ZC(e[s],hr(t)?{}:t[s],r[s]):r[s]=!Do(e[s],t[s]);return r}var au=(e,t)=>ZC(e,t,bd(t)),KC=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ft(e)?e:t?e===""?NaN:e&&+e:r&&Dn(e)?new Date(e):n?n(e):e;function Ih(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return Mv(t)?t.files:Iv(t)?BC(e.refs).value:HC(t)?[...t.selectedOptions].map(({value:r})=>r):wc(t)?$C(e.refs).value:KC(Ft(t.value)?e.ref.value:t.value,e)}var V5=(e,t,r,n)=>{const s={};for(const o of e){const i=le(t,o);i&&ut(s,o,i._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},za=e=>Ft(e)?e:wd(e)?e.source:qt(e)?wd(e.value)?e.value.source:e.value:e,W5=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function S0(e,t,r){const n=le(e,r);if(n||Av(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),i=le(t,o),a=le(e,o);if(i&&!Array.isArray(i)&&r!==o)return{name:r};if(a&&a.type)return{name:o,error:a};s.pop()}return{name:r}}var $5=(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,B5=(e,t)=>!Df(le(e,t)).length&&Ht(e,t);const H5={mode:ln.onSubmit,reValidateMode:ln.onChange,shouldFocusError:!0};function Y5(e={}){let t={...H5,...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)||{}:{},o=t.shouldUnregister?{}:wr(s),i={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:Oh(),array:Oh(),state:Oh()},p=g0(t.mode),m=g0(t.reValidateMode),x=t.criteriaMode===ln.all,g=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?ut(r.validatingFields,O,N):Ht(r.validatingFields,O))}),f.state.next({validatingFields:r.validatingFields,isValidating:!Nr(r.validatingFields)}))},h=(S,N=[],O,Y,M=!0,H=!0)=>{if(Y&&O){if(i.action=!0,H&&Array.isArray(le(n,S))){const X=O(le(n,S),Y.argA,Y.argB);M&&ut(n,S,X)}if(H&&Array.isArray(le(r.errors,S))){const X=O(le(r.errors,S),Y.argA,Y.argB);M&&ut(r.errors,S,X),B5(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&&ut(r.touchedFields,S,X)}d.dirtyFields&&(r.dirtyFields=au(s,o)),f.state.next({name:S,isDirty:j(S,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ut(o,S,N)},_=(S,N)=>{ut(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(o,S,Ft(O)?le(s,S):O);Ft(H)||Y&&Y.defaultChecked||N?ut(o,S,N?H:Ih(M._f)):W(S,H),i.mount&&w()}},T=(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=j(),H=X!==ee.isDirty);const Be=he||Do(le(s,S),N);X=!!(!he&&le(r.dirtyFields,S)),Be||he?Ht(r.dirtyFields,S):ut(r.dirtyFields,S,!0),ee.dirtyFields=r.dirtyFields,H=H||d.dirtyFields&&X!==!Be}if(O){const Be=le(r.touchedFields,S);Be||(ut(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&&Rn(N)&&r.isValid!==N;if(e.delayError&&O?(l=g(()=>_(S,O)),l(e.delayError)):(clearTimeout(u),l=null,O?ut(r.errors,S,O):Ht(r.errors,S)),(O?!Do(M,O):M)||!Nr(Y)||H){const X={...Y,...H&&Rn(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(o,t.context,V5(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?ut(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 b0(M,o,x,t.shouldUseNativeValidation&&!N,ee);if(v([Y]),he[H.name]&&(O.valid=!1,N))break;!N&&(le(he,H.name)?ee?L5(r.errors,he,H.name):ut(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=>!Mh(O)):!Mh(N._f.ref))&&Te(S)}a.unMount=new Set},j=(S,N)=>(S&&N&&ut(o,S,N),!Do(z(),s)),F=(S,N,O)=>VC(S,a,{...i.mount?o:Ft(N)?s:Dn(S)?{[S]:N}:N},O,N),b=S=>Df(le(i.mount?o: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&&ut(o,S,KC(N,H)),M=xd(H.ref)&&hr(N)?"":N,HC(H.ref)?[...H.ref.options].forEach(X=>X.selected=M.includes(X.value)):H.refs?wc(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):Mv(H.ref)?H.ref.value="":(H.ref.value=M,H.ref.type||f.values.next({name:S,values:{...o}})))}(O.shouldDirty||O.shouldTouch)&&T(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)||!_d(M)||X&&!X._f)&&!Di(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);ut(o,S,H),M?(f.array.next({name:S,values:{...o}}),(d.isDirty||d.dirtyFields)&&O.shouldDirty&&f.state.next({name:S,dirtyFields:au(s,o),isDirty:j(S,H)})):Y&&!Y._f&&!hr(H)?te(S,H,O):W(S,H,O),v0(S,a)&&f.state.next({...r}),f.values.next({name:i.mount?S:void 0,values:{...o}})},Z=async S=>{i.mount=!0;const N=S.target;let O=N.name,Y=!0;const M=le(n,O),H=()=>N.type?Ih(M._f):OC(S),X=ee=>{Y=Number.isNaN(ee)||ee===le(o,O,ee)};if(M){let ee,he;const Be=H(),Oe=S.type===yd.BLUR||S.type===yd.FOCUS_OUT,Ct=!W5(M._f)&&!t.resolver&&!le(r.errors,O)&&!M._f.deps||$5(Oe,le(r.touchedFields,O),r.isSubmitted,m,p),Wr=v0(O,a,Oe);ut(o,O,Be),Oe?(M._f.onBlur&&M._f.onBlur(S),l&&l(0)):M._f.onChange&&M._f.onChange(S);const Bt=T(O,Be,Oe,!1),Kn=!Nr(Bt)||Wr;if(!Oe&&f.values.next({name:O,type:S.type,values:{...o}}),Ct)return d.isValid&&w(),Kn&&f.state.next({name:O,...Wr?{}:Bt});if(!Oe&&Wr&&f.state.next({...r}),t.resolver){const{errors:ot}=await D([O]);if(X(Be),Y){const Gn=S0(r.errors,n,O),qn=S0(ot,n,Gn.name||O);ee=qn.error,O=qn.name,he=Nr(ot)}}else v([O],!0),ee=(await b0(M,o,x,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=il(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({...!Dn(S)||d.isValid&&O!==r.isValid?{}:{name:S},...t.resolver||!S?{isValid:O}:{},errors:r.errors}),N.shouldFocus&&!Y&&al(n,I,S?M:a.mount),Y},z=S=>{const N={...i.mount?o:s};return Ft(S)?N:Dn(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&&il(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;ut(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),Te=(S,N={})=>{for(const O of S?il(S):a.mount)a.mount.delete(O),a.array.delete(O),N.keepValue||(Ht(n,O),Ht(o,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:{...o}}),f.state.next({...r,...N.keepDirty?{isDirty:j()}:{}}),!N.keepIsValid&&w()},fe=({disabled:S,name:N,field:O,fields:Y,value:M})=>{if(Rn(S)&&i.mount||S){const H=S?void 0:Ft(M)?Ih(O?O._f:le(Y,N)._f):M;ut(o,N,H),T(N,H,!1,!1,!0)}},ve=(S,N={})=>{let O=le(n,S);const Y=Rn(N.disabled);return ut(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:za(N.min),max:za(N.max),minLength:za(N.minLength),maxLength:za(N.maxLength),pattern:za(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=U5(H),ee=O._f.refs||[];if(X?ee.find(he=>he===H):H===O._f.ref)return;ut(n,S,{_f:{...O._f,...X?{refs:[...ee.filter(Mh),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)&&!(MC(a.array,S)&&i.action)&&a.unMount.add(S)}}},be=()=>t.shouldFocusError&&al(n,I,a.mount),Pe=S=>{Rn(S)&&(f.state.next({disabled:S}),al(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))},je=(S,N)=>async O=>{let Y;O&&(O.preventDefault&&O.preventDefault(),O.persist&&O.persist());let M=wr(o);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),be(),setTimeout(be);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Nr(r.errors)&&!Y,submitCount:r.submitCount+1,errors:r.errors}),Y)throw Y},ke=(S,N={})=>{le(n,S)&&(Ft(N.defaultValue)?$(S,wr(le(s,S))):($(S,N.defaultValue),ut(s,S,wr(N.defaultValue))),N.keepTouched||Ht(r.touchedFields,S),N.keepDirty||(Ht(r.dirtyFields,S),r.isDirty=N.defaultValue?j(S,wr(le(s,S))):j()),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)?ut(H,X,le(o,X)):$(X,le(H,X));else{if(Dv&&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(xd(he)){const Be=he.closest("form");if(Be){Be.reset();break}}}}n={}}o=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:""},i.mount=!d.isValid||!!N.keepIsValid||!!N.keepDirtyValues,i.watch=!!e.shouldUnregister,f.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:M?!1:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!Do(S,s)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:M?{}:N.keepDirtyValues?N.keepDefaultValues&&o?au(s,o):r.dirtyFields:N.keepDefaultValues&&S?au(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(o):S,N);return{control:{register:ve,unregister:Te,getFieldState:V,handleSubmit:je,setError:ne,_executeSchema:D,_getWatch:F,_getDirty:j,_updateValid:w,_removeUnmounted:q,_updateFieldArray:h,_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:Pe,_subjects:f,_proxyFormState:d,_setErrors:C,get _fields(){return n},get _formValues(){return o},get _state(){return i},set _state(S){i=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:je,watch:se,setValue:$,getValues:z,reset:k,resetField:ke,clearErrors:de,unregister:Te,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 Bn(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={...Y5(e),formState:n});const o=t.current.control;return o._options=e,Ov({subject:o._subjects.state,next:i=>{zC(i,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),et.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),et.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==n.isDirty&&o._subjects.state.next({isDirty:i})}},[o,n.isDirty]),et.useEffect(()=>{e.values&&!Do(e.values,r.current)?(o._reset(e.values,o._options.resetOptions),r.current=e.values,s(i=>({...i}))):o._resetDefaultValues()},[e.values,o]),et.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),et.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),et.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=FC(n,o),t.current}const k0=(e,t,r)=>{if(e&&"reportValidity"in e){const n=le(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},GC=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?k0(n.ref,r,e):n.refs&&n.refs.forEach(s=>k0(s,r,e))}},Z5=(e,t)=>{t.shouldUseNativeValidation&&GC(e,t);const r={};for(const n in e){const s=le(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(K5(t.names||Object.keys(e),n)){const i=Object.assign({},le(r,n));ut(i,"root",o),ut(r,n,i)}else ut(r,n,o)}return r},K5=(e,t)=>e.some(r=>r.startsWith(t+"."));var G5=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[i]={message:a.message,type:a.code}}else r[i]={message:o,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[i].types,u=l&&l[n.code];r[i]=WC(i,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r},Hn=function(e,t,r){return r===void 0&&(r={}),function(n,s,o){try{return Promise.resolve(function(i,a){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return o.shouldUseNativeValidation&&GC({},o),{errors:{},values:r.raw?n:u}})}catch(u){return a(u)}return l&&l.then?l.then(void 0,a):l}(0,function(i){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(i))return{values:{},errors:Z5(G5(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}}},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 o={};for(const i of s)o[i]=i;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(const a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(const i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(nt||(nt={}));var nm;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(nm||(nm={}));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}},ie=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"]),q5=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(o){return o.message},n={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));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 oa=(e,t)=>{let r;switch(e.code){case ie.invalid_type:e.received===xe.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,nt.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${nt.joinValues(e.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${nt.joinValues(e.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${nt.joinValues(e.options)}, received '${e.received}'`;break;case ie.invalid_arguments:r="Invalid function arguments";break;case ie.invalid_return_type:r="Invalid function return type";break;case ie.invalid_date:r="Invalid date";break;case ie.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 ie.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 ie.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 ie.custom:r="Invalid input";break;case ie.invalid_intersection_types:r="Intersection results could not be merged";break;case ie.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ie.not_finite:r="Number must be finite";break;default:r=t.defaultError,nt.assertNever(e)}return{message:r}};let qC=oa;function X5(e){qC=e}function Sd(){return qC}const kd=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)a=u(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},Q5=[];function pe(e,t){const r=Sd(),n=kd({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===oa?void 0:oa].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 We;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 o=await s.key,i=await s.value;n.push({key:o,value:i})}return cr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return We;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:t.value,value:n}}}const We=Object.freeze({status:"aborted"}),Ai=e=>({status:"dirty",value:e}),mr=e=>({status:"valid",value:e}),sm=e=>e.status==="aborted",om=e=>e.status==="dirty",Vl=e=>e.status==="valid",Wl=e=>typeof Promise<"u"&&e instanceof Promise;function Cd(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 XC(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 Ee;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ee||(Ee={}));var Ya,Za;class zn{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 C0=(e,t)=>{if(Vl(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:(i,a)=>{var l,u;const{message:d}=e;return i.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:(l=d??n)!==null&&l!==void 0?l:a.defaultError}:i.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(Wl(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)},o=this._parseSync({data:t,path:s.path,parent:s});return C0(s,o)}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}),o=await(Wl(s)?s:Promise.resolve(s));return C0(n,o)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{const i=t(s),a=()=>o.addIssue({code:ie.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!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 xn({schema:this,typeName:Fe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return In.create(this,this._def)}nullable(){return po.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hn.create(this,this._def)}promise(){return aa.create(this,this._def)}or(t){return Yl.create([this,t],this._def)}and(t){return Zl.create(this,t,this._def)}transform(t){return new xn({...He(this._def),schema:this,typeName:Fe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Ql({...He(this._def),innerType:this,defaultValue:r,typeName:Fe.ZodDefault})}brand(){return new Lv({typeName:Fe.ZodBranded,type:this,...He(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Jl({...He(this._def),innerType:this,catchValue:r,typeName:Fe.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return _c.create(this,t)}readonly(){return ec.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const J5=/^c[^\s-]{8,}$/i,e6=/^[0-9a-z]+$/,t6=/^[0-9A-HJKMNP-TV-Z]{26}$/,r6=/^[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,n6=/^[a-z0-9_-]{21}$/i,s6=/^[-+]?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)?)??$/,o6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,i6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Lh;const a6=/^(?:(?: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])$/,l6=/^(([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})))$/,c6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,QC="((\\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])))",u6=new RegExp(`^${QC}$`);function JC(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 d6(e){return new RegExp(`^${JC(e)}$`)}function eE(e){let t=`${QC}T${JC(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 f6(e,t){return!!((t==="v4"||!t)&&a6.test(e)||(t==="v6"||!t)&&l6.test(e))}class un extends qe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==xe.string){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:xe.string,received:o.parsedType}),We}const n=new cr;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(s=this._getOrReturnCtx(t,s),pe(s,{code:ie.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const i=t.data.length>o.value,a=t.data.lengtht.test(s),{validation:r,code:ie.invalid_string,...Ee.errToObj(n)})}_addCheck(t){return new un({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ee.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ee.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ee.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ee.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ee.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ee.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ee.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ee.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ee.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ee.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,...Ee.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,...Ee.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ee.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Ee.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...Ee.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Ee.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Ee.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Ee.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Ee.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Ee.errToObj(r)})}nonempty(t){return this.min(1,Ee.errToObj(t))}trim(){return new un({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new un({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new un({...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 un({checks:[],typeName:Fe.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...He(e)})};function h6(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=parseInt(e.toFixed(s).replace(".","")),i=parseInt(t.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}class uo 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 o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:xe.number,received:o.parsedType}),We}let n;const s=new cr;for(const o of this._def.checks)o.kind==="int"?nt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?h6(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.not_finite,message:o.message}),s.dirty()):nt.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ee.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ee.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ee.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ee.toString(r))}setLimit(t,r,n,s){return new uo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ee.toString(s)}]})}_addCheck(t){return new uo({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ee.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ee.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ee.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ee.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ee.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ee.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Ee.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ee.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ee.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 uo({checks:[],typeName:Fe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});class fo 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 o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:xe.bigint,received:o.parsedType}),We}let n;const s=new cr;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):nt.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ee.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ee.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ee.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ee.toString(r))}setLimit(t,r,n,s){return new fo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ee.toString(s)}]})}_addCheck(t){return new fo({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ee.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ee.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ee.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ee.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ee.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 fo({checks:[],typeName:Fe.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...He(e)})};class $l extends qe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==xe.boolean){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:xe.boolean,received:n.parsedType}),We}return mr(t.data)}}$l.create=e=>new $l({typeName:Fe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});class Zo extends qe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==xe.date){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:xe.date,received:o.parsedType}),We}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_date}),We}const n=new cr;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(s=this._getOrReturnCtx(t,s),pe(s,{code:ie.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):nt.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Zo({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Ee.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Ee.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 Zo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Fe.ZodDate,...He(e)});class Ed extends qe{_parse(t){if(this._getType(t)!==xe.symbol){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:xe.symbol,received:n.parsedType}),We}return mr(t.data)}}Ed.create=e=>new Ed({typeName:Fe.ZodSymbol,...He(e)});class Bl extends qe{_parse(t){if(this._getType(t)!==xe.undefined){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:xe.undefined,received:n.parsedType}),We}return mr(t.data)}}Bl.create=e=>new Bl({typeName:Fe.ZodUndefined,...He(e)});class Hl extends qe{_parse(t){if(this._getType(t)!==xe.null){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:xe.null,received:n.parsedType}),We}return mr(t.data)}}Hl.create=e=>new Hl({typeName:Fe.ZodNull,...He(e)});class ia extends qe{constructor(){super(...arguments),this._any=!0}_parse(t){return mr(t.data)}}ia.create=e=>new ia({typeName:Fe.ZodAny,...He(e)});class Io extends qe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return mr(t.data)}}Io.create=e=>new Io({typeName:Fe.ZodUnknown,...He(e)});class bs extends qe{_parse(t){const r=this._getOrReturnCtx(t);return pe(r,{code:ie.invalid_type,expected:xe.never,received:r.parsedType}),We}}bs.create=e=>new bs({typeName:Fe.ZodNever,...He(e)});class Td extends qe{_parse(t){if(this._getType(t)!==xe.undefined){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:xe.void,received:n.parsedType}),We}return mr(t.data)}}Td.create=e=>new Td({typeName:Fe.ZodVoid,...He(e)});class hn extends qe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==xe.array)return pe(r,{code:ie.invalid_type,expected:xe.array,received:r.parsedType}),We;if(s.exactLength!==null){const i=r.data.length>s.exactLength.value,a=r.data.lengths.maxLength.value&&(pe(r,{code:ie.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((i,a)=>s.type._parseAsync(new zn(r,i,r.path,a)))).then(i=>cr.mergeArray(n,i));const o=[...r.data].map((i,a)=>s.type._parseSync(new zn(r,i,r.path,a)));return cr.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new hn({...this._def,minLength:{value:t,message:Ee.toString(r)}})}max(t,r){return new hn({...this._def,maxLength:{value:t,message:Ee.toString(r)}})}length(t,r){return new hn({...this._def,exactLength:{value:t,message:Ee.toString(r)}})}nonempty(t){return this.min(1,t)}}hn.create=(e,t)=>new hn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Fe.ZodArray,...He(t)});function vi(e){if(e instanceof Rt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=In.create(vi(n))}return new Rt({...e._def,shape:()=>t})}else return e instanceof hn?new hn({...e._def,type:vi(e.element)}):e instanceof In?In.create(vi(e.unwrap())):e instanceof po?po.create(vi(e.unwrap())):e instanceof Un?Un.create(e.items.map(t=>vi(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 pe(u,{code:ie.invalid_type,expected:xe.object,received:u.parsedType}),We}const{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof bs&&this._def.unknownKeys==="strip"))for(const u in s.data)i.includes(u)||a.push(u);const l=[];for(const u of i){const d=o[u],f=s.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new zn(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof bs){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&&(pe(s,{code:ie.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 zn(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,p=await d.value;u.push({key:f,value:p,alwaysSet:d.alwaysSet})}return u}).then(u=>cr.mergeObjectSync(n,u)):cr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return Ee.errToObj,new Rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,o,i,a;const l=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Ee.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:Fe.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 vi(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 o=this.shape[n];for(;o instanceof In;)o=o._def.innerType;r[n]=o}}),new Rt({...this._def,shape:()=>r})}keyof(){return tE(nt.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:bs.create(),typeName:Fe.ZodObject,...He(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:bs.create(),typeName:Fe.ZodObject,...He(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:bs.create(),typeName:Fe.ZodObject,...He(t)});class Yl extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const i=o.map(a=>new Lr(a.ctx.common.issues));return pe(r,{code:ie.invalid_union,unionErrors:i}),We}if(r.common.async)return Promise.all(n.map(async o=>{const i={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let o;const i=[];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"&&!o&&(o={result:d,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(l=>new Lr(l));return pe(r,{code:ie.invalid_union,unionErrors:a}),We}}get options(){return this._def.options}}Yl.create=(e,t)=>new Yl({options:e,typeName:Fe.ZodUnion,...He(t)});const ts=e=>e instanceof Gl?ts(e.schema):e instanceof xn?ts(e.innerType()):e instanceof ql?[e.value]:e instanceof ho?e.options:e instanceof Xl?nt.objectValues(e.enum):e instanceof Ql?ts(e._def.innerType):e instanceof Bl?[void 0]:e instanceof Hl?[null]:e instanceof In?[void 0,...ts(e.unwrap())]:e instanceof po?[null,...ts(e.unwrap())]:e instanceof Lv||e instanceof ec?ts(e.unwrap()):e instanceof Jl?ts(e._def.innerType):[];class Of extends qe{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.object)return pe(r,{code:ie.invalid_type,expected:xe.object,received:r.parsedType}),We;const n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(pe(r,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),We)}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 o of r){const i=ts(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of i){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,o)}}return new Of({typeName:Fe.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...He(n)})}}function im(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),o=nt.objectKeys(e).filter(a=>s.indexOf(a)!==-1),i={...e,...t};for(const a of o){const l=im(e[a],t[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(r===xe.array&&n===xe.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{if(sm(o)||sm(i))return We;const a=im(o.value,i.value);return a.valid?((om(o)||om(i))&&r.dirty(),{status:r.value,value:a.data}):(pe(n,{code:ie.invalid_intersection_types}),We)};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(([o,i])=>s(o,i)):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}))}}Zl.create=(e,t,r)=>new Zl({left:e,right:t,typeName:Fe.ZodIntersection,...He(r)});class Un extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.array)return pe(n,{code:ie.invalid_type,expected:xe.array,received:n.parsedType}),We;if(n.data.lengththis._def.items.length&&(pe(n,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((i,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new zn(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>cr.mergeArray(r,i)):cr.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new Un({...this._def,rest:t})}}Un.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Un({items:e,typeName:Fe.ZodTuple,rest:null,...He(t)})};class Kl 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 pe(n,{code:ie.invalid_type,expected:xe.object,received:n.parsedType}),We;const s=[],o=this._def.keyType,i=this._def.valueType;for(const a in n.data)s.push({key:o._parse(new zn(n,a,n.path,a)),value:i._parse(new zn(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 Kl({keyType:t,valueType:r,typeName:Fe.ZodRecord,...He(n)}):new Kl({keyType:un.create(),valueType:t,typeName:Fe.ZodRecord,...He(r)})}}class jd 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 pe(n,{code:ie.invalid_type,expected:xe.map,received:n.parsedType}),We;const s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([a,l],u)=>({key:s._parse(new zn(n,a,n.path,[u,"key"])),value:o._parse(new zn(n,l,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of i){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return We;(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 i){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return We;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}}}}jd.create=(e,t,r)=>new jd({valueType:t,keyType:e,typeName:Fe.ZodMap,...He(r)});class Ko extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.set)return pe(n,{code:ie.invalid_type,expected:xe.set,received:n.parsedType}),We;const s=this._def;s.minSize!==null&&n.data.sizes.maxSize.value&&(pe(n,{code:ie.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const o=this._def.valueType;function i(l){const u=new Set;for(const d of l){if(d.status==="aborted")return We;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const a=[...n.data.values()].map((l,u)=>o._parse(new zn(n,l,n.path,u)));return n.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(t,r){return new Ko({...this._def,minSize:{value:t,message:Ee.toString(r)}})}max(t,r){return new Ko({...this._def,maxSize:{value:t,message:Ee.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Ko.create=(e,t)=>new Ko({valueType:e,minSize:null,maxSize:null,typeName:Fe.ZodSet,...He(t)});class Ki extends qe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.function)return pe(r,{code:ie.invalid_type,expected:xe.function,received:r.parsedType}),We;function n(a,l){return kd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Sd(),oa].filter(u=>!!u),issueData:{code:ie.invalid_arguments,argumentsError:l}})}function s(a,l){return kd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Sd(),oa].filter(u=>!!u),issueData:{code:ie.invalid_return_type,returnTypeError:l}})}const o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof aa){const a=this;return mr(async function(...l){const u=new Lr([]),d=await a._def.args.parseAsync(l,o).catch(m=>{throw u.addIssue(n(l,m)),u}),f=await Reflect.apply(i,this,d);return await a._def.returns._def.type.parseAsync(f,o).catch(m=>{throw u.addIssue(s(f,m)),u})})}else{const a=this;return mr(function(...l){const u=a._def.args.safeParse(l,o);if(!u.success)throw new Lr([n(l,u.error)]);const d=Reflect.apply(i,this,u.data),f=a._def.returns.safeParse(d,o);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 Ki({...this._def,args:Un.create(t).rest(Io.create())})}returns(t){return new Ki({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Ki({args:t||Un.create([]).rest(Io.create()),returns:r||Io.create(),typeName:Fe.ZodFunction,...He(n)})}}class Gl 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})}}Gl.create=(e,t)=>new Gl({getter:e,typeName:Fe.ZodLazy,...He(t)});class ql extends qe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return pe(r,{received:r.data,code:ie.invalid_literal,expected:this._def.value}),We}return{status:"valid",value:t.data}}get value(){return this._def.value}}ql.create=(e,t)=>new ql({value:e,typeName:Fe.ZodLiteral,...He(t)});function tE(e,t){return new ho({values:e,typeName:Fe.ZodEnum,...He(t)})}class ho extends qe{constructor(){super(...arguments),Ya.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return pe(r,{expected:nt.joinValues(n),received:r.parsedType,code:ie.invalid_type}),We}if(Cd(this,Ya)||XC(this,Ya,new Set(this._def.values)),!Cd(this,Ya).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return pe(r,{received:r.data,code:ie.invalid_enum_value,options:n}),We}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 ho.create(t,{...this._def,...r})}exclude(t,r=this._def){return ho.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Ya=new WeakMap;ho.create=tE;class Xl extends qe{constructor(){super(...arguments),Za.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 pe(n,{expected:nt.joinValues(s),received:n.parsedType,code:ie.invalid_type}),We}if(Cd(this,Za)||XC(this,Za,new Set(nt.getValidEnumValues(this._def.values))),!Cd(this,Za).has(t.data)){const s=nt.objectValues(r);return pe(n,{received:n.data,code:ie.invalid_enum_value,options:s}),We}return mr(t.data)}get enum(){return this._def.values}}Za=new WeakMap;Xl.create=(e,t)=>new Xl({values:e,typeName:Fe.ZodNativeEnum,...He(t)});class aa 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 pe(r,{code:ie.invalid_type,expected:xe.promise,received:r.parsedType}),We;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})))}}aa.create=(e,t)=>new aa({type:e,typeName:Fe.ZodPromise,...He(t)});class xn extends qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Fe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{pe(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async a=>{if(r.value==="aborted")return We;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?We:l.status==="dirty"||r.value==="dirty"?Ai(l.value):l});{if(r.value==="aborted")return We;const a=this._def.schema._parseSync({data:i,path:n.path,parent:n});return a.status==="aborted"?We:a.status==="dirty"||r.value==="dirty"?Ai(a.value):a}}if(s.type==="refinement"){const i=a=>{const l=s.refinement(a,o);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"?We:(a.status==="dirty"&&r.dirty(),i(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"?We:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Vl(i))return i;const a=s.transform(i.value,o);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(i=>Vl(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:r.value,value:a})):i);nt.assertNever(s)}}xn.create=(e,t,r)=>new xn({schema:e,typeName:Fe.ZodEffects,effect:t,...He(r)});xn.createWithPreprocess=(e,t,r)=>new xn({schema:t,effect:{type:"preprocess",transform:e},typeName:Fe.ZodEffects,...He(r)});class In extends qe{_parse(t){return this._getType(t)===xe.undefined?mr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}In.create=(e,t)=>new In({innerType:e,typeName:Fe.ZodOptional,...He(t)});class po extends qe{_parse(t){return this._getType(t)===xe.null?mr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}po.create=(e,t)=>new po({innerType:e,typeName:Fe.ZodNullable,...He(t)});class Ql 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}}Ql.create=(e,t)=>new Ql({innerType:e,typeName:Fe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...He(t)});class Jl 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 Wl(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.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}}Jl.create=(e,t)=>new Jl({innerType:e,typeName:Fe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...He(t)});class Nd extends qe{_parse(t){if(this._getType(t)!==xe.nan){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:xe.nan,received:n.parsedType}),We}return{status:"valid",value:t.data}}}Nd.create=e=>new Nd({typeName:Fe.ZodNaN,...He(e)});const p6=Symbol("zod_brand");class Lv 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 _c extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?We:o.status==="dirty"?(r.dirty(),Ai(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?We: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 _c({in:t,out:r,typeName:Fe.ZodPipeline})}}class ec extends qe{_parse(t){const r=this._def.innerType._parse(t),n=s=>(Vl(s)&&(s.value=Object.freeze(s.value)),s);return Wl(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}ec.create=(e,t)=>new ec({innerType:e,typeName:Fe.ZodReadonly,...He(t)});function rE(e,t={},r){return e?ia.create().superRefine((n,s)=>{var o,i;if(!e(n)){const a=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,l=(i=(o=a.fatal)!==null&&o!==void 0?o:r)!==null&&i!==void 0?i:!0,u=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...u,fatal:l})}}):ia.create()}const m6={object:Rt.lazycreate};var Fe;(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"})(Fe||(Fe={}));const g6=(e,t={message:`Input not instance of ${e.name}`})=>rE(r=>r instanceof e,t),nE=un.create,sE=uo.create,v6=Nd.create,y6=fo.create,oE=$l.create,x6=Zo.create,w6=Ed.create,_6=Bl.create,b6=Hl.create,S6=ia.create,k6=Io.create,C6=bs.create,E6=Td.create,T6=hn.create,j6=Rt.create,N6=Rt.strictCreate,R6=Yl.create,P6=Of.create,D6=Zl.create,A6=Un.create,O6=Kl.create,M6=jd.create,I6=Ko.create,L6=Ki.create,F6=Gl.create,z6=ql.create,U6=ho.create,V6=Xl.create,W6=aa.create,E0=xn.create,$6=In.create,B6=po.create,H6=xn.createWithPreprocess,Y6=_c.create,Z6=()=>nE().optional(),K6=()=>sE().optional(),G6=()=>oE().optional(),q6={string:e=>un.create({...e,coerce:!0}),number:e=>uo.create({...e,coerce:!0}),boolean:e=>$l.create({...e,coerce:!0}),bigint:e=>fo.create({...e,coerce:!0}),date:e=>Zo.create({...e,coerce:!0})},X6=We;var Se=Object.freeze({__proto__:null,defaultErrorMap:oa,setErrorMap:X5,getErrorMap:Sd,makeIssue:kd,EMPTY_PATH:Q5,addIssueToContext:pe,ParseStatus:cr,INVALID:We,DIRTY:Ai,OK:mr,isAborted:sm,isDirty:om,isValid:Vl,isAsync:Wl,get util(){return nt},get objectUtil(){return nm},ZodParsedType:xe,getParsedType:$s,ZodType:qe,datetimeRegex:eE,ZodString:un,ZodNumber:uo,ZodBigInt:fo,ZodBoolean:$l,ZodDate:Zo,ZodSymbol:Ed,ZodUndefined:Bl,ZodNull:Hl,ZodAny:ia,ZodUnknown:Io,ZodNever:bs,ZodVoid:Td,ZodArray:hn,ZodObject:Rt,ZodUnion:Yl,ZodDiscriminatedUnion:Of,ZodIntersection:Zl,ZodTuple:Un,ZodRecord:Kl,ZodMap:jd,ZodSet:Ko,ZodFunction:Ki,ZodLazy:Gl,ZodLiteral:ql,ZodEnum:ho,ZodNativeEnum:Xl,ZodPromise:aa,ZodEffects:xn,ZodTransformer:xn,ZodOptional:In,ZodNullable:po,ZodDefault:Ql,ZodCatch:Jl,ZodNaN:Nd,BRAND:p6,ZodBranded:Lv,ZodPipeline:_c,ZodReadonly:ec,custom:rE,Schema:qe,ZodSchema:qe,late:m6,get ZodFirstPartyTypeKind(){return Fe},coerce:q6,any:S6,array:T6,bigint:y6,boolean:oE,date:x6,discriminatedUnion:P6,effect:E0,enum:U6,function:L6,instanceof:g6,intersection:D6,lazy:F6,literal:z6,map:M6,nan:v6,nativeEnum:V6,never:C6,null:b6,nullable:B6,number:sE,object:j6,oboolean:G6,onumber:K6,optional:$6,ostring:Z6,pipeline:Y6,preprocess:H6,promise:W6,record:O6,set:I6,strictObject:N6,string:nE,symbol:w6,transformer:E0,tuple:A6,undefined:_6,union:R6,unknown:k6,void:E6,NEVER:X6,ZodIssueCode:ie,quotelessJson:q5,ZodError:Lr}),Q6="Label",iE=y.forwardRef((e,t)=>c.jsx(ze.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())}}));iE.displayName=Q6;var aE=iE;const J6=ic("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Fv=y.forwardRef(({className:e,...t},r)=>c.jsx(aE,{ref:r,className:me(J6(),e),...t}));Fv.displayName=aE.displayName;const Yn=D5,lE=y.createContext({}),Ve=({...e})=>c.jsx(lE.Provider,{value:{name:e.name},children:c.jsx(I5,{...e})}),Mf=()=>{const e=y.useContext(lE),t=y.useContext(cE),{getFieldState:r,formState:n}=Af(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},cE=y.createContext({}),Me=y.forwardRef(({className:e,...t},r)=>{const n=y.useId();return c.jsx(cE.Provider,{value:{id:n},children:c.jsx("div",{ref:r,className:me("space-y-2",e),...t})})});Me.displayName="FormItem";const Ie=y.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=Mf();return c.jsx(Fv,{ref:r,className:me(n&&"text-destructive",e),htmlFor:s,...t})});Ie.displayName="FormLabel";const Le=y.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:o}=Mf();return c.jsx(ys,{ref:t,id:n,"aria-describedby":r?`${s} ${o}`:`${s}`,"aria-invalid":!!r,...e})});Le.displayName="FormControl";const ez=y.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=Mf();return c.jsx("p",{ref:r,id:n,className:me("text-sm text-muted-foreground",e),...t})});ez.displayName="FormDescription";const Ae=y.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:o}=Mf(),i=s?String(s==null?void 0:s.message):t;return i?c.jsx("p",{ref:n,id:o,className:me("text-sm font-medium text-destructive",e),...r,children:i}):null});Ae.displayName="FormMessage";function am(e,[t,r]){return Math.min(r,Math.max(t,e))}var tz=[" ","Enter","ArrowUp","ArrowDown"],rz=[" ","Enter"],bc="Select",[If,Lf,nz]=tf(bc),[ba,w8]=Qr(bc,[nz,ya]),Ff=ya(),[sz,xo]=ba(bc),[oz,iz]=ba(bc),uE=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:m}=e,x=Ff(t),[g,w]=y.useState(null),[v,h]=y.useState(null),[_,C]=y.useState(!1),E=rf(u),[T=!1,R]=io({prop:n,defaultProp:s,onChange:o}),[D,P]=io({prop:i,defaultProp:a,onChange:l}),L=y.useRef(null),q=g?!!g.closest("form"):!0,[j,F]=y.useState(new Set),b=Array.from(j).map(W=>W.props.value).join(";");return c.jsx(Rg,{...x,children:c.jsxs(sz,{required:m,scope:t,trigger:g,onTriggerChange:w,valueNode:v,onValueNodeChange:h,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:Mn(),value:D,onValueChange:P,open:T,onOpenChange:R,dir:E,triggerPointerDownPosRef:L,disabled:p,children:[c.jsx(If.Provider,{scope:t,children:c.jsx(oz,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(W=>{F(te=>new Set(te).add(W))},[]),onNativeOptionRemove:y.useCallback(W=>{F(te=>{const $=new Set(te);return $.delete(W),$})},[]),children:r})}),q?c.jsxs(IE,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:D,onChange:W=>P(W.target.value),disabled:p,children:[D===void 0?c.jsx("option",{value:""}):null,Array.from(j)]},b):null]})})};uE.displayName=bc;var dE="SelectTrigger",fE=y.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=Ff(r),i=xo(dE,r),a=i.disabled||n,l=Xe(t,i.onTriggerChange),u=Lf(r),[d,f,p]=LE(x=>{const g=u().filter(h=>!h.disabled),w=g.find(h=>h.value===i.value),v=FE(g,x,w);v!==void 0&&i.onValueChange(v.value)}),m=()=>{a||(i.onOpenChange(!0),p())};return c.jsx(Pg,{asChild:!0,...o,children:c.jsx(ze.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":ME(i.value)?"":void 0,...s,ref:l,onClick:ue(s.onClick,x=>{x.currentTarget.focus()}),onPointerDown:ue(s.onPointerDown,x=>{const g=x.target;g.hasPointerCapture(x.pointerId)&&g.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&(m(),i.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)},x.preventDefault())}),onKeyDown:ue(s.onKeyDown,x=>{const g=d.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&f(x.key),!(g&&x.key===" ")&&tz.includes(x.key)&&(m(),x.preventDefault())})})})});fE.displayName=dE;var hE="SelectValue",pE=y.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:i="",...a}=e,l=xo(hE,r),{onValueNodeHasChildrenChange:u}=l,d=o!==void 0,f=Xe(t,l.onValueNodeChange);return nr(()=>{u(d)},[u,d]),c.jsx(ze.span,{...a,ref:f,style:{pointerEvents:"none"},children:ME(l.value)?c.jsx(c.Fragment,{children:i}):o})});pE.displayName=hE;var az="SelectIcon",mE=y.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return c.jsx(ze.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});mE.displayName=az;var lz="SelectPortal",gE=e=>c.jsx(lc,{asChild:!0,...e});gE.displayName=lz;var Go="SelectContent",vE=y.forwardRef((e,t)=>{const r=xo(Go,e.__scopeSelect),[n,s]=y.useState();if(nr(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?ks.createPortal(c.jsx(yE,{scope:e.__scopeSelect,children:c.jsx(If.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),o):null}return c.jsx(xE,{...e,ref:t})});vE.displayName=Go;var ss=10,[yE,wo]=ba(Go),cz="SelectContentImpl",xE=y.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:x,hideWhenDetached:g,avoidCollisions:w,...v}=e,h=xo(Go,r),[_,C]=y.useState(null),[E,T]=y.useState(null),R=Xe(t,fe=>C(fe)),[D,P]=y.useState(null),[L,q]=y.useState(null),j=Lf(r),[F,b]=y.useState(!1),W=y.useRef(!1);y.useEffect(()=>{if(_)return Og(_)},[_]),_g();const te=y.useCallback(fe=>{const[ve,...be]=j().map(ke=>ke.ref.current),[Pe]=be.slice(-1),je=document.activeElement;for(const ke of fe)if(ke===je||(ke==null||ke.scrollIntoView({block:"nearest"}),ke===ve&&E&&(E.scrollTop=0),ke===Pe&&E&&(E.scrollTop=E.scrollHeight),ke==null||ke.focus(),document.activeElement!==je))return},[j,E]),$=y.useCallback(()=>te([D,_]),[te,D,_]);y.useEffect(()=>{F&&$()},[F,$]);const{onOpenChange:Z,triggerPointerDownPosRef:I}=h;y.useEffect(()=>{if(_){let fe={x:0,y:0};const ve=Pe=>{var je,ke;fe={x:Math.abs(Math.round(Pe.pageX)-(((je=I.current)==null?void 0:je.x)??0)),y:Math.abs(Math.round(Pe.pageY)-(((ke=I.current)==null?void 0:ke.y)??0))}},be=Pe=>{fe.x<=10&&fe.y<=10?Pe.preventDefault():_.contains(Pe.target)||Z(!1),document.removeEventListener("pointermove",ve),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",ve),document.addEventListener("pointerup",be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ve),document.removeEventListener("pointerup",be,{capture:!0})}}},[_,Z,I]),y.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]=LE(fe=>{const ve=j().filter(je=>!je.disabled),be=ve.find(je=>je.ref.current===document.activeElement),Pe=FE(ve,fe,be);Pe&&setTimeout(()=>Pe.ref.current.focus())}),V=y.useCallback((fe,ve,be)=>{const Pe=!W.current&&!be;(h.value!==void 0&&h.value===ve||Pe)&&(P(fe),Pe&&(W.current=!0))},[h.value]),de=y.useCallback(()=>_==null?void 0:_.focus(),[_]),ne=y.useCallback((fe,ve,be)=>{const Pe=!W.current&&!be;(h.value!==void 0&&h.value===ve||Pe)&&q(fe)},[h.value]),se=n==="popper"?lm:wE,Te=se===lm?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:x,hideWhenDetached:g,avoidCollisions:w}:{};return c.jsx(yE,{scope:r,content:_,viewport:E,onViewportChange:T,itemRefCallback:V,selectedItem:D,onItemLeave:de,itemTextRefCallback:ne,focusSelectedItem:$,selectedItemText:L,position:n,isPositioned:F,searchRef:Q,children:c.jsx(cf,{as:ys,allowPinchZoom:!0,children:c.jsx(nf,{asChild:!0,trapped:h.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:ue(s,fe=>{var ve;(ve=h.trigger)==null||ve.focus({preventScroll:!0}),fe.preventDefault()}),children:c.jsx(ma,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:c.jsx(se,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:fe=>fe.preventDefault(),...v,...Te,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 Pe=j().filter(je=>!je.disabled).map(je=>je.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(Pe=Pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const je=fe.target,ke=Pe.indexOf(je);Pe=Pe.slice(ke+1)}setTimeout(()=>te(Pe)),fe.preventDefault()}})})})})})})});xE.displayName=cz;var uz="SelectItemAlignedPosition",wE=y.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=xo(Go,r),i=wo(Go,r),[a,l]=y.useState(null),[u,d]=y.useState(null),f=Xe(t,R=>d(R)),p=Lf(r),m=y.useRef(!1),x=y.useRef(!0),{viewport:g,selectedItem:w,selectedItemText:v,focusSelectedItem:h}=i,_=y.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&u&&g&&w&&v){const R=o.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),L=v.getBoundingClientRect();if(o.dir!=="rtl"){const je=L.left-D.left,ke=P.left-je,rt=R.left-ke,k=R.width+rt,J=Math.max(k,D.width),K=window.innerWidth-ss,A=am(ke,[ss,K-J]);a.style.minWidth=k+"px",a.style.left=A+"px"}else{const je=D.right-L.right,ke=window.innerWidth-P.right-je,rt=window.innerWidth-R.right-ke,k=R.width+rt,J=Math.max(k,D.width),K=window.innerWidth-ss,A=am(ke,[ss,K-J]);a.style.minWidth=k+"px",a.style.right=A+"px"}const q=p(),j=window.innerHeight-ss*2,F=g.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(g),V=parseInt(z.paddingTop,10),de=parseInt(z.paddingBottom,10),ne=R.top+R.height/2-ss,se=j-ne,Te=w.offsetHeight/2,fe=w.offsetTop+Te,ve=W+te+fe,be=I-ve;if(ve<=ne){const je=w===q[q.length-1].ref.current;a.style.bottom="0px";const ke=u.clientHeight-g.offsetTop-g.offsetHeight,rt=Math.max(se,Te+(je?de:0)+ke+$),k=ve+rt;a.style.height=k+"px"}else{const je=w===q[0].ref.current;a.style.top="0px";const rt=Math.max(ne,W+g.offsetTop+(je?V:0)+Te)+be;a.style.height=rt+"px",g.scrollTop=ve-ne+g.offsetTop}a.style.margin=`${ss}px 0`,a.style.minHeight=Q+"px",a.style.maxHeight=j+"px",n==null||n(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,a,u,g,w,v,o.dir,n]);nr(()=>_(),[_]);const[C,E]=y.useState();nr(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const T=y.useCallback(R=>{R&&x.current===!0&&(_(),h==null||h(),x.current=!1)},[_,h]);return c.jsx(fz,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:T,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(ze.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});wE.displayName=uz;var dz="SelectPopperPosition",lm=y.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=ss,...o}=e,i=Ff(r);return c.jsx(Dg,{...i,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.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)"}})});lm.displayName=dz;var[fz,zv]=ba(Go,{}),cm="SelectViewport",_E=y.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=wo(cm,r),i=zv(cm,r),a=Xe(t,o.onViewportChange),l=y.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(If.Slot,{scope:r,children:c.jsx(ze.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:p}=i;if(p!=null&&p.current&&f){const m=Math.abs(l.current-d.scrollTop);if(m>0){const x=window.innerHeight-ss*2,g=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),v=Math.max(g,w);if(v0?C:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});_E.displayName=cm;var bE="SelectGroup",[hz,pz]=ba(bE),SE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Mn();return c.jsx(hz,{scope:r,id:s,children:c.jsx(ze.div,{role:"group","aria-labelledby":s,...n,ref:t})})});SE.displayName=bE;var kE="SelectLabel",CE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=pz(kE,r);return c.jsx(ze.div,{id:s.id,...n,ref:t})});CE.displayName=kE;var Rd="SelectItem",[mz,EE]=ba(Rd),TE=y.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...i}=e,a=xo(Rd,r),l=wo(Rd,r),u=a.value===n,[d,f]=y.useState(o??""),[p,m]=y.useState(!1),x=Xe(t,v=>{var h;return(h=l.itemRefCallback)==null?void 0:h.call(l,v,n,s)}),g=Mn(),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(mz,{scope:r,value:n,disabled:s,textId:g,isSelected:u,onItemTextChange:y.useCallback(v=>{f(h=>h||((v==null?void 0:v.textContent)??"").trim())},[]),children:c.jsx(If.ItemSlot,{scope:r,value:n,disabled:s,textValue:d,children:c.jsx(ze.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:x,onFocus:ue(i.onFocus,()=>m(!0)),onBlur:ue(i.onBlur,()=>m(!1)),onPointerUp:ue(i.onPointerUp,w),onPointerMove:ue(i.onPointerMove,v=>{var h;s?(h=l.onItemLeave)==null||h.call(l):v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ue(i.onPointerLeave,v=>{var h;v.currentTarget===document.activeElement&&((h=l.onItemLeave)==null||h.call(l))}),onKeyDown:ue(i.onKeyDown,v=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&v.key===" "||(rz.includes(v.key)&&w(),v.key===" "&&v.preventDefault())})})})})});TE.displayName=Rd;var Ka="SelectItemText",jE=y.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,i=xo(Ka,r),a=wo(Ka,r),l=EE(Ka,r),u=iz(Ka,r),[d,f]=y.useState(null),p=Xe(t,v=>f(v),l.onItemTextChange,v=>{var h;return(h=a.itemTextRefCallback)==null?void 0:h.call(a,v,l.value,l.disabled)}),m=d==null?void 0:d.textContent,x=y.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:w}=u;return nr(()=>(g(x),()=>w(x)),[g,w,x]),c.jsxs(c.Fragment,{children:[c.jsx(ze.span,{id:l.textId,...o,ref:p}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?ks.createPortal(o.children,i.valueNode):null]})});jE.displayName=Ka;var NE="SelectItemIndicator",RE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return EE(NE,r).isSelected?c.jsx(ze.span,{"aria-hidden":!0,...n,ref:t}):null});RE.displayName=NE;var um="SelectScrollUpButton",PE=y.forwardRef((e,t)=>{const r=wo(um,e.__scopeSelect),n=zv(um,e.__scopeSelect),[s,o]=y.useState(!1),i=Xe(t,n.onScrollButtonChange);return nr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const u=l.scrollTop>0;o(u)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?c.jsx(AE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});PE.displayName=um;var dm="SelectScrollDownButton",DE=y.forwardRef((e,t)=>{const r=wo(dm,e.__scopeSelect),n=zv(dm,e.__scopeSelect),[s,o]=y.useState(!1),i=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(AE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});DE.displayName=dm;var AE=y.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=wo("SelectScrollButton",r),i=y.useRef(null),a=Lf(r),l=y.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return y.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(ze.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ue(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:ue(s.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:ue(s.onPointerLeave,()=>{l()})})}),gz="SelectSeparator",OE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return c.jsx(ze.div,{"aria-hidden":!0,...n,ref:t})});OE.displayName=gz;var fm="SelectArrow",vz=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Ff(r),o=xo(fm,r),i=wo(fm,r);return o.open&&i.position==="popper"?c.jsx(Ag,{...s,...n,ref:t}):null});vz.displayName=fm;function ME(e){return e===""||e===void 0}var IE=y.forwardRef((e,t)=>{const{value:r,...n}=e,s=y.useRef(null),o=Xe(t,s),i=Zk(r);return y.useEffect(()=>{const a=s.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==r&&d){const f=new Event("change",{bubbles:!0});d.call(a,r),a.dispatchEvent(f)}},[i,r]),c.jsx(xc,{asChild:!0,children:c.jsx("select",{...n,ref:o,defaultValue:r})})});IE.displayName="BubbleSelect";function LE(e){const t=At(e),r=y.useRef(""),n=y.useRef(0),s=y.useCallback(i=>{const a=r.current+i;t(a),function l(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=y.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function FE(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=yz(e,Math.max(o,0));s.length===1&&(i=i.filter(u=>u!==r));const l=i.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function yz(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var xz=uE,zE=fE,wz=pE,_z=mE,bz=gE,UE=vE,Sz=_E,kz=SE,VE=CE,WE=TE,Cz=jE,Ez=RE,$E=PE,BE=DE,HE=OE;const Ru=xz,Pu=kz,Du=wz,ll=y.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(zE,{ref:n,className:me("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(_z,{asChild:!0,children:c.jsx(l1,{className:"h-4 w-4 opacity-50"})})]}));ll.displayName=zE.displayName;const YE=y.forwardRef(({className:e,...t},r)=>c.jsx($E,{ref:r,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(IR,{className:"h-4 w-4"})}));YE.displayName=$E.displayName;const ZE=y.forwardRef(({className:e,...t},r)=>c.jsx(BE,{ref:r,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(l1,{className:"h-4 w-4"})}));ZE.displayName=BE.displayName;const cl=y.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>c.jsx(bz,{children:c.jsxs(UE,{ref:s,className:me("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(YE,{}),c.jsx(Sz,{className:me("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(ZE,{})]})}));cl.displayName=UE.displayName;const ul=y.forwardRef(({className:e,...t},r)=>c.jsx(VE,{ref:r,className:me("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));ul.displayName=VE.displayName;const dl=y.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(WE,{ref:n,className:me("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(Ez,{children:c.jsx(a1,{className:"h-4 w-4"})})}),c.jsx(Cz,{children:t})]}));dl.displayName=WE.displayName;const Tz=y.forwardRef(({className:e,...t},r)=>c.jsx(HE,{ref:r,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));Tz.displayName=HE.displayName;const hm=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"]]]),jz=Array.from(hm.keys()),Nz=Kg,Rz=Gg,Pz=qg,KE=y.forwardRef(({className:e,...t},r)=>c.jsx(dc,{ref:r,className:me("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}));KE.displayName=dc.displayName;const GE=y.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Pz,{children:[c.jsx(KE,{}),c.jsxs(fc,{ref:n,className:me("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(ff,{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(vg,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));GE.displayName=fc.displayName;const qE=({className:e,...t})=>c.jsx("div",{className:me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});qE.displayName="DialogHeader";const XE=y.forwardRef(({className:e,...t},r)=>c.jsx(hc,{ref:r,className:me("text-lg font-semibold leading-none tracking-tight",e),...t}));XE.displayName=hc.displayName;const Dz=y.forwardRef(({className:e,...t},r)=>c.jsx(pc,{ref:r,className:me("text-sm text-muted-foreground",e),...t}));Dz.displayName=pc.displayName;const Lo=new Map([["tencent",["腾讯云","/imgs/providers/tencent.svg"]],["aliyun",["阿里云","/imgs/providers/aliyun.svg"]],["cloudflare",["Cloudflare","/imgs/providers/cloudflare.svg"]],["namesilo",["Namesilo","/imgs/providers/namesilo.svg"]],["qiniu",["七牛云","/imgs/providers/qiniu.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),ni=Se.union([Se.literal("aliyun"),Se.literal("tencent"),Se.literal("ssh"),Se.literal("webhook"),Se.literal("cloudflare"),Se.literal("qiniu"),Se.literal("namesilo")],{message:"请选择云服务商"}),Az=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Rs(),s=Se.object({id:Se.string().optional(),name:Se.string().min(1).max(64),configType:ni,secretId:Se.string().min(1).max(64),secretKey:Se.string().min(1).max(64)});let o={secretId:"",secretKey:""};e&&(o=e.config);const i=Bn({resolver:Hn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"tencent",secretId:o.secretId,secretKey:o.secretKey}}),a=async l=>{const u={id:l.id,name:l.name,configType:l.configType,config:{secretId:l.secretId,secretKey:l.secretKey}};try{const d=await ri(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(([p,m])=>{i.setError(p,{type:"manual",message:m.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(Yn,{...i,children:c.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ve,{control:i.control,name:"name",render:({field:l})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"名称"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入授权名称",...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"id",render:({field:l})=>c.jsxs(Me,{className:"hidden",children:[c.jsx(Ie,{children:"配置类型"}),c.jsx(Le,{children:c.jsx($e,{...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"configType",render:({field:l})=>c.jsxs(Me,{className:"hidden",children:[c.jsx(Ie,{children:"配置类型"}),c.jsx(Le,{children:c.jsx($e,{...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"secretId",render:({field:l})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"SecretId"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入SecretId",...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"secretKey",render:({field:l})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"SecretKey"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入SecretKey",...l})}),c.jsx(Ae,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(ft,{type:"submit",children:"保存"})})]})})})})},Oz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Rs(),s=Se.object({id:Se.string().optional(),name:Se.string().min(1).max(64),configType:ni,accessKeyId:Se.string().min(1).max(64),accessSecretId:Se.string().min(1).max(64)});let o={accessKeyId:"",accessKeySecret:""};e&&(o=e.config);const i=Bn({resolver:Hn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"aliyun",accessKeyId:o.accessKeyId,accessSecretId:o.accessKeySecret}}),a=async l=>{const u={id:l.id,name:l.name,configType:l.configType,config:{accessKeyId:l.accessKeyId,accessKeySecret:l.accessSecretId}};try{const d=await ri(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(([p,m])=>{i.setError(p,{type:"manual",message:m.message})});return}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(Yn,{...i,children:c.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ve,{control:i.control,name:"name",render:({field:l})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"名称"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入授权名称",...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"id",render:({field:l})=>c.jsxs(Me,{className:"hidden",children:[c.jsx(Ie,{children:"配置类型"}),c.jsx(Le,{children:c.jsx($e,{...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"configType",render:({field:l})=>c.jsxs(Me,{className:"hidden",children:[c.jsx(Ie,{children:"配置类型"}),c.jsx(Le,{children:c.jsx($e,{...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"accessKeyId",render:({field:l})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"AccessKeyId"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入AccessKeyId",...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"accessSecretId",render:({field:l})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"AccessKeySecret"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入AccessKeySecret",...l})}),c.jsx(Ae,{})]})}),c.jsx(Ae,{}),c.jsx("div",{className:"flex justify-end",children:c.jsx(ft,{type:"submit",children:"保存"})})]})})})})},QE=y.forwardRef(({className:e,...t},r)=>c.jsx("textarea",{className:me("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}));QE.displayName="Textarea";const Mz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Rs(),s=Se.object({id:Se.string().optional(),name:Se.string().min(1).max(64),configType:ni,host:Se.string().ip({message:"请输入合法的IP地址"}),port:Se.string().min(1).max(5),username:Se.string().min(1).max(64),password:Se.string().min(0).max(64),key:Se.string().min(0).max(20480),keyFile:Se.string().optional(),command:Se.string().min(1).max(2048),certPath:Se.string().min(0).max(2048),keyPath:Se.string().min(0).max(2048)});let o={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&&(o=e.config);const i=Bn({resolver:Hn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"ssh",host:o.host,port:o.port,username:o.username,password:o.password,key:o.key,keyFile:o.keyFile,certPath:o.certPath,keyPath:o.keyPath,command:o.command}}),a=async u=>{console.log(u);const d={id:u.id,name:u.name,configType:u.configType,config:{host:u.host,port:u.port,username:u.username,password:u.password,key:u.key,command:u.command,certPath:u.certPath,keyPath:u.keyPath}};try{const f=await ri(d);if(t(),d.id=f.id,d.created=f.created,d.updated=f.updated,u.id){n(d);return}r(d)}catch(f){Object.entries(f.response.data).forEach(([m,x])=>{i.setError(m,{type:"manual",message:x.message})});return}},l=async u=>{var p;const d=(p=u.target.files)==null?void 0:p[0];if(!d)return;const f=await w5(d);i.setValue("key",f),i.setValue("keyFile","")};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(Yn,{...i,children:c.jsxs("form",{onSubmit:u=>{u.stopPropagation(),i.handleSubmit(a)(u)},className:"space-y-3",children:[c.jsx(Ve,{control:i.control,name:"name",render:({field:u})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"名称"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入授权名称",...u})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"id",render:({field:u})=>c.jsxs(Me,{className:"hidden",children:[c.jsx(Ie,{children:"配置类型"}),c.jsx(Le,{children:c.jsx($e,{...u})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"configType",render:({field:u})=>c.jsxs(Me,{className:"hidden",children:[c.jsx(Ie,{children:"配置类型"}),c.jsx(Le,{children:c.jsx($e,{...u})}),c.jsx(Ae,{})]})}),c.jsxs("div",{className:"flex space-x-2",children:[c.jsx(Ve,{control:i.control,name:"host",render:({field:u})=>c.jsxs(Me,{className:"grow",children:[c.jsx(Ie,{children:"服务器IP"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入Host",...u})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"port",render:({field:u})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"SSH端口"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入Port",...u,type:"number"})}),c.jsx(Ae,{})]})})]}),c.jsx(Ve,{control:i.control,name:"username",render:({field:u})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"用户名"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入用户名",...u})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"password",render:({field:u})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"密码"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入密码",...u,type:"password"})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"key",render:({field:u})=>c.jsxs(Me,{hidden:!0,children:[c.jsx(Ie,{children:"Key(使用证书登录)"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入Key",...u})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"keyFile",render:({field:u})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"Key(使用证书登录)"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入Key",...u,type:"file",onChange:l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"certPath",render:({field:u})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"证书上传路径"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入证书上传路径",...u})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"keyPath",render:({field:u})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"私钥上传路径"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入私钥上传路径",...u})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"command",render:({field:u})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"Command"}),c.jsx(Le,{children:c.jsx(QE,{placeholder:"请输入要执行的命令",...u})}),c.jsx(Ae,{})]})}),c.jsx(Ae,{}),c.jsx("div",{className:"flex justify-end",children:c.jsx(ft,{type:"submit",children:"保存"})})]})})})})},Iz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Rs(),s=Se.object({id:Se.string().optional(),name:Se.string().min(1).max(64),configType:ni,url:Se.string().url()});let o={url:""};e&&(o=e.config);const i=Bn({resolver:Hn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"webhook",url:o.url}}),a=async l=>{console.log(l);const u={id:l.id,name:l.name,configType:l.configType,config:{url:l.url}};try{const d=await ri(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(([p,m])=>{i.setError(p,{type:"manual",message:m.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(Yn,{...i,children:c.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ve,{control:i.control,name:"name",render:({field:l})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"名称"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入授权名称",...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"id",render:({field:l})=>c.jsxs(Me,{className:"hidden",children:[c.jsx(Ie,{children:"配置类型"}),c.jsx(Le,{children:c.jsx($e,{...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"configType",render:({field:l})=>c.jsxs(Me,{className:"hidden",children:[c.jsx(Ie,{children:"配置类型"}),c.jsx(Le,{children:c.jsx($e,{...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"url",render:({field:l})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"Webhook Url"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入Webhook Url",...l})}),c.jsx(Ae,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(ft,{type:"submit",children:"保存"})})]})})})})},Lz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Rs(),s=Se.object({id:Se.string().optional(),name:Se.string().min(1).max(64),configType:ni,dnsApiToken:Se.string().min(1).max(64)});let o={dnsApiToken:""};e&&(o=e.config);const i=Bn({resolver:Hn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"cloudflare",dnsApiToken:o.dnsApiToken}}),a=async l=>{console.log(l);const u={id:l.id,name:l.name,configType:l.configType,config:{dnsApiToken:l.dnsApiToken}};try{const d=await ri(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(([p,m])=>{i.setError(p,{type:"manual",message:m.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(Yn,{...i,children:c.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ve,{control:i.control,name:"name",render:({field:l})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"名称"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入授权名称",...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"id",render:({field:l})=>c.jsxs(Me,{className:"hidden",children:[c.jsx(Ie,{children:"配置类型"}),c.jsx(Le,{children:c.jsx($e,{...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"configType",render:({field:l})=>c.jsxs(Me,{className:"hidden",children:[c.jsx(Ie,{children:"配置类型"}),c.jsx(Le,{children:c.jsx($e,{...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"dnsApiToken",render:({field:l})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"CLOUD_DNS_API_TOKEN"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入CLOUD_DNS_API_TOKEN",...l})}),c.jsx(Ae,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(ft,{type:"submit",children:"保存"})})]})})})})},Fz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Rs(),s=Se.object({id:Se.string().optional(),name:Se.string().min(1).max(64),configType:ni,accessKey:Se.string().min(1).max(64),secretKey:Se.string().min(1).max(64)});let o={accessKey:"",secretKey:""};e&&(o=e.config);const i=Bn({resolver:Hn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"qiniu",accessKey:o.accessKey,secretKey:o.secretKey}}),a=async l=>{const u={id:l.id,name:l.name,configType:l.configType,config:{accessKey:l.accessKey,secretKey:l.secretKey}};try{const d=await ri(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(([p,m])=>{i.setError(p,{type:"manual",message:m.message})});return}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(Yn,{...i,children:c.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ve,{control:i.control,name:"name",render:({field:l})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"名称"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入授权名称",...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"id",render:({field:l})=>c.jsxs(Me,{className:"hidden",children:[c.jsx(Ie,{children:"配置类型"}),c.jsx(Le,{children:c.jsx($e,{...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"configType",render:({field:l})=>c.jsxs(Me,{className:"hidden",children:[c.jsx(Ie,{children:"配置类型"}),c.jsx(Le,{children:c.jsx($e,{...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"accessKey",render:({field:l})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"AccessKey"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入AccessKey",...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"secretKey",render:({field:l})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"SecretKey"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入SecretKey",...l})}),c.jsx(Ae,{})]})}),c.jsx(Ae,{}),c.jsx("div",{className:"flex justify-end",children:c.jsx(ft,{type:"submit",children:"保存"})})]})})})})},zz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=Rs(),s=Se.object({id:Se.string().optional(),name:Se.string().min(1).max(64),configType:ni,apiKey:Se.string().min(1).max(64)});let o={apiKey:""};e&&(o=e.config);const i=Bn({resolver:Hn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"namesilo",apiKey:o.apiKey}}),a=async l=>{console.log(l);const u={id:l.id,name:l.name,configType:l.configType,config:{apiKey:l.apiKey}};try{const d=await ri(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(([p,m])=>{i.setError(p,{type:"manual",message:m.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(Yn,{...i,children:c.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ve,{control:i.control,name:"name",render:({field:l})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"名称"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入授权名称",...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"id",render:({field:l})=>c.jsxs(Me,{className:"hidden",children:[c.jsx(Ie,{children:"配置类型"}),c.jsx(Le,{children:c.jsx($e,{...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"configType",render:({field:l})=>c.jsxs(Me,{className:"hidden",children:[c.jsx(Ie,{children:"配置类型"}),c.jsx(Le,{children:c.jsx($e,{...l})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:i.control,name:"apiKey",render:({field:l})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"NAMESILO_API_KEY"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入NAMESILO_API_KEY",...l})}),c.jsx(Ae,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(ft,{type:"submit",children:"保存"})})]})})})})};function fl({trigger:e,op:t,data:r,className:n}){const[s,o]=y.useState(!1),i=Array.from(Lo.keys()),[a,l]=y.useState((r==null?void 0:r.configType)||"");let u=c.jsx(c.Fragment,{children:" "});switch(a){case"tencent":u=c.jsx(Az,{data:r,onAfterReq:()=>{o(!1)}});break;case"aliyun":u=c.jsx(Oz,{data:r,onAfterReq:()=>{o(!1)}});break;case"ssh":u=c.jsx(Mz,{data:r,onAfterReq:()=>{o(!1)}});break;case"webhook":u=c.jsx(Iz,{data:r,onAfterReq:()=>{o(!1)}});break;case"cloudflare":u=c.jsx(Lz,{data:r,onAfterReq:()=>{o(!1)}});break;case"qiniu":u=c.jsx(Fz,{data:r,onAfterReq:()=>{o(!1)}});break;case"namesilo":u=c.jsx(zz,{data:r,onAfterReq:()=>{o(!1)}});break}const d=f=>f==a?"border-primary":"";return c.jsxs(Nz,{onOpenChange:o,open:s,children:[c.jsx(Rz,{asChild:!0,className:me(n),children:e}),c.jsxs(GE,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[c.jsx(qE,{children:c.jsxs(XE,{children:[t=="add"?"添加":"编辑","授权"]})}),c.jsxs("div",{className:"container",children:[c.jsx(Fv,{children:"服务商"}),c.jsxs(Ru,{onValueChange:f=>{console.log(f),l(f)},defaultValue:a,children:[c.jsx(ll,{className:"mt-3",children:c.jsx(Du,{placeholder:"请选择服务商"})}),c.jsx(cl,{children:c.jsxs(Pu,{children:[c.jsx(ul,{children:"服务商"}),i.map(f=>{var p,m;return c.jsx(dl,{value:f,children:c.jsxs("div",{className:me("flex items-center space-x-2 rounded cursor-pointer",d(f)),children:[c.jsx("img",{src:(p=Lo.get(f))==null?void 0:p[1],className:"h-6 w-6"}),c.jsx("div",{children:(m=Lo.get(f))==null?void 0:m[0]})]})},f)})]})})]}),u]})]})]})}const Uz=()=>{const{config:{accesses:e}}=Rs(),[t,r]=y.useState(),n=Vn();y.useEffect(()=>{const m=new URLSearchParams(n.search).get("id");m&&(async()=>{const g=await C5(m);r(g)})()},[n.search]);const s=Se.object({id:Se.string().optional(),domain:Se.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:"请输入正确的域名"}),access:Se.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择DNS服务商授权配置"}),targetAccess:Se.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择部署服务商配置"}),targetType:Se.string().regex(/^[a-zA-Z0-9-]+$/,{message:"请选择部署服务类型"})}),o=Bn({resolver:Hn(s),defaultValues:{id:"",domain:"",access:"",targetAccess:"",targetType:""}});y.useEffect(()=>{t&&o.reset({id:t.id,domain:t.domain,access:t.access,targetAccess:t.targetAccess,targetType:t.targetType})},[t,o]);const[i,a]=y.useState(t?t.targetType:""),l=e.filter(p=>{if(i=="")return!0;const m=o.getValues().targetType.split("-");return p.configType===m[0]}),{toast:u}=Tf(),d=wn(),f=async p=>{const m={id:p.id,crontab:"0 0 * * *",domain:p.domain,access:p.access,targetAccess:p.targetAccess,targetType:p.targetType};try{await rm(m);let x="域名编辑成功";m.id==""&&(x="域名添加成功"),u({title:"成功",description:x}),d("/domains")}catch(x){Object.entries(x.response.data).forEach(([w,v])=>{o.setError(w,{type:"manual",message:v.message})});return}};return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"",children:[c.jsx(Nv,{}),c.jsxs("div",{className:"border-b dark:border-stone-500 h-10 text-muted-foreground",children:[t!=null&&t.id?"编辑":"新增","域名"]}),c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(Yn,{...o,children:c.jsxs("form",{onSubmit:o.handleSubmit(f),className:"space-y-8 dark:text-stone-200",children:[c.jsx(Ve,{control:o.control,name:"domain",render:({field:p})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"域名"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"请输入域名",...p})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:o.control,name:"access",render:({field:p})=>c.jsxs(Me,{children:[c.jsxs(Ie,{className:"flex w-full justify-between",children:[c.jsx("div",{children:"DNS 服务商授权配置"}),c.jsx(fl,{trigger:c.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[c.jsx(Nx,{size:14}),"新增"]}),op:"add"})]}),c.jsx(Le,{children:c.jsxs(Ru,{...p,value:p.value,onValueChange:m=>{o.setValue("access",m)},children:[c.jsx(ll,{children:c.jsx(Du,{placeholder:"请选择授权配置"})}),c.jsx(cl,{children:c.jsxs(Pu,{children:[c.jsx(ul,{children:"服务商授权配置"}),e.map(m=>{var x;return c.jsx(dl,{value:m.id,children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("img",{className:"w-6",src:(x=Lo.get(m.configType))==null?void 0:x[1]}),c.jsx("div",{children:m.name})]})},m.id)})]})})]})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:o.control,name:"targetType",render:({field:p})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"部署服务类型"}),c.jsx(Le,{children:c.jsxs(Ru,{...p,onValueChange:m=>{a(m),o.setValue("targetType",m)},children:[c.jsx(ll,{children:c.jsx(Du,{placeholder:"请选择部署服务类型"})}),c.jsx(cl,{children:c.jsxs(Pu,{children:[c.jsx(ul,{children:"部署服务类型"}),jz.map(m=>{var x,g;return c.jsx(dl,{value:m,children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("img",{className:"w-6",src:(x=hm.get(m))==null?void 0:x[1]}),c.jsx("div",{children:(g=hm.get(m))==null?void 0:g[0]})]})},m)})]})})]})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:o.control,name:"targetAccess",render:({field:p})=>c.jsxs(Me,{children:[c.jsxs(Ie,{className:"w-full flex justify-between",children:[c.jsx("div",{children:"部署服务商授权配置"}),c.jsx(fl,{trigger:c.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[c.jsx(Nx,{size:14}),"新增"]}),op:"add"})]}),c.jsx(Le,{children:c.jsxs(Ru,{...p,onValueChange:m=>{o.setValue("targetAccess",m)},children:[c.jsx(ll,{children:c.jsx(Du,{placeholder:"请选择授权配置"})}),c.jsx(cl,{children:c.jsxs(Pu,{children:[c.jsx(ul,{children:"服务商授权配置"}),l.map(m=>{var x;return c.jsx(dl,{value:m.id,children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("img",{className:"w-6",src:(x=Lo.get(m.configType))==null?void 0:x[1]}),c.jsx("div",{children:m.name})]})},m.id)})]})})]})}),c.jsx(Ae,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(ft,{type:"submit",children:"保存"})})]})})})]})})},Vz=()=>{const{config:e,deleteAccess:t}=Rs(),{accesses:r}=e,n=10,s=Math.ceil(r.length/n),o=wn(),i=Vn(),a=new URLSearchParams(i.search),l=a.get("page"),u=l?Number(l):1,d=(u-1)*n,f=d+n,p=async m=>{const x=await KF(m);t(x.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(fl,{trigger:c.jsx(ft,{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(UR,{size:40,className:"text-primary"})}),c.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加授权开始部署证书吧。"}),c.jsx(fl,{trigger:c.jsx(ft,{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(m=>{var x,g;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:m.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:(x=Lo.get(m.configType))==null?void 0:x[1],className:"w-6"}),c.jsx("div",{children:(g=Lo.get(m.configType))==null?void 0:g[0]})]}),c.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["创建于 ",m.created&&sa(m.created)]}),c.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["更新于 ",m.updated&&sa(m.updated)]}),c.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[c.jsx(fl,{trigger:c.jsx(ft,{variant:"link",className:"p-0",children:"编辑"}),op:"edit",data:m}),c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(ft,{variant:"link",className:"p-0",onClick:()=>{p(m)},children:"删除"})]})]},m.id)}),c.jsx(xk,{totalPages:s,currentPage:u,onPageChange:m=>{a.set("page",m.toString()),o({search:a.toString()})}})]})]})},Wz=ic("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"}}),Uv=y.forwardRef(({className:e,variant:t,...r},n)=>c.jsx("div",{ref:n,role:"alert",className:me(Wz({variant:t}),e),...r}));Uv.displayName="Alert";const Vv=y.forwardRef(({className:e,...t},r)=>c.jsx("h5",{ref:r,className:me("mb-1 font-medium leading-none tracking-tight",e),...t}));Vv.displayName="AlertTitle";const Wv=y.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:me("text-sm [&_p]:leading-relaxed",e),...t}));Wv.displayName="AlertDescription";function $z(e,t){return y.useReducer((r,n)=>t[r][n]??r,e)}var $v="ScrollArea",[JE,_8]=Qr($v),[Bz,tn]=JE($v),eT=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:o=600,...i}=e,[a,l]=y.useState(null),[u,d]=y.useState(null),[f,p]=y.useState(null),[m,x]=y.useState(null),[g,w]=y.useState(null),[v,h]=y.useState(0),[_,C]=y.useState(0),[E,T]=y.useState(!1),[R,D]=y.useState(!1),P=Xe(t,q=>l(q)),L=rf(s);return c.jsx(Bz,{scope:r,type:n,dir:L,scrollHideDelay:o,scrollArea:a,viewport:u,onViewportChange:d,content:f,onContentChange:p,scrollbarX:m,onScrollbarXChange:x,scrollbarXEnabled:E,onScrollbarXEnabledChange:T,scrollbarY:g,onScrollbarYChange:w,scrollbarYEnabled:R,onScrollbarYEnabledChange:D,onCornerWidthChange:h,onCornerHeightChange:C,children:c.jsx(ze.div,{dir:L,...i,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});eT.displayName=$v;var tT="ScrollAreaViewport",rT=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...o}=e,i=tn(tT,r),a=y.useRef(null),l=Xe(t,a,i.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(ze.div,{"data-radix-scroll-area-viewport":"",...o,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});rT.displayName=tT;var Zn="ScrollAreaScrollbar",Bv=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=tn(Zn,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,a=e.orientation==="horizontal";return y.useEffect(()=>(a?o(!0):i(!0),()=>{a?o(!1):i(!1)}),[a,o,i]),s.type==="hover"?c.jsx(Hz,{...n,ref:t,forceMount:r}):s.type==="scroll"?c.jsx(Yz,{...n,ref:t,forceMount:r}):s.type==="auto"?c.jsx(nT,{...n,ref:t,forceMount:r}):s.type==="always"?c.jsx(Hv,{...n,ref:t}):null});Bv.displayName=Zn;var Hz=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=tn(Zn,e.__scopeScrollArea),[o,i]=y.useState(!1);return y.useEffect(()=>{const a=s.scrollArea;let l=0;if(a){const u=()=>{window.clearTimeout(l),i(!0)},d=()=>{l=window.setTimeout(()=>i(!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||o,children:c.jsx(nT,{"data-state":o?"visible":"hidden",...n,ref:t})})}),Yz=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=tn(Zn,e.__scopeScrollArea),o=e.orientation==="horizontal",i=Uf(()=>l("SCROLL_END"),100),[a,l]=$z("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 y.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,s.scrollHideDelay,l]),y.useEffect(()=>{const u=s.viewport,d=o?"scrollLeft":"scrollTop";if(u){let f=u[d];const p=()=>{const m=u[d];f!==m&&(l("SCROLL"),i()),f=m};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[s.viewport,o,l,i]),c.jsx(Er,{present:r||a!=="hidden",children:c.jsx(Hv,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ue(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ue(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),nT=y.forwardRef((e,t)=>{const r=tn(Zn,e.__scopeScrollArea),{forceMount:n,...s}=e,[o,i]=y.useState(!1),a=e.orientation==="horizontal",l=Uf(()=>{if(r.viewport){const u=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,s=tn(Zn,e.__scopeScrollArea),o=y.useRef(null),i=y.useRef(0),[a,l]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=lT(a.viewport,a.content),d={...n,sizes:a,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:p=>i.current=p};function f(p,m){return Qz(p,i.current,a,m)}return r==="horizontal"?c.jsx(Zz,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollLeft,m=T0(p,a,s.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollLeft=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollLeft=f(p,s.dir))}}):r==="vertical"?c.jsx(Kz,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollTop,m=T0(p,a);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollTop=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollTop=f(p))}}):null}),Zz=y.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=tn(Zn,e.__scopeScrollArea),[i,a]=y.useState(),l=y.useRef(null),u=Xe(t,l,o.onScrollbarXChange);return y.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(oT,{"data-orientation":"horizontal",...s,ref:u,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":zf(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(o.viewport){const p=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),uT(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Dd(i.paddingLeft),paddingEnd:Dd(i.paddingRight)}})}})}),Kz=y.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=tn(Zn,e.__scopeScrollArea),[i,a]=y.useState(),l=y.useRef(null),u=Xe(t,l,o.onScrollbarYChange);return y.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(oT,{"data-orientation":"vertical",...s,ref:u,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":zf(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(o.viewport){const p=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),uT(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Dd(i.paddingTop),paddingEnd:Dd(i.paddingBottom)}})}})}),[Gz,sT]=JE(Zn),oT=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...p}=e,m=tn(Zn,r),[x,g]=y.useState(null),w=Xe(t,P=>g(P)),v=y.useRef(null),h=y.useRef(""),_=m.viewport,C=n.content-n.viewport,E=At(d),T=At(l),R=Uf(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 y.useEffect(()=>{const P=L=>{const q=L.target;(x==null?void 0:x.contains(q))&&E(L,C)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[_,x,C,E]),y.useEffect(T,[n,T]),la(x,R),la(m.content,R),c.jsx(Gz,{scope:r,scrollbar:x,hasThumb:s,onThumbChange:At(o),onThumbPointerUp:At(i),onThumbPositionChange:T,onThumbPointerDown:At(a),children:c.jsx(ze.div,{...p,ref:w,style:{position:"absolute",...p.style},onPointerDown:ue(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),v.current=x.getBoundingClientRect(),h.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.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=h.current,m.viewport&&(m.viewport.style.scrollBehavior=""),v.current=null})})})}),Pd="ScrollAreaThumb",iT=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=sT(Pd,e.__scopeScrollArea);return c.jsx(Er,{present:r||s.hasThumb,children:c.jsx(qz,{ref:t,...n})})}),qz=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,o=tn(Pd,r),i=sT(Pd,r),{onThumbPositionChange:a}=i,l=Xe(t,f=>i.onThumbChange(f)),u=y.useRef(),d=Uf(()=>{u.current&&(u.current(),u.current=void 0)},100);return y.useEffect(()=>{const f=o.viewport;if(f){const p=()=>{if(d(),!u.current){const m=Jz(f,a);u.current=m,a()}};return a(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[o.viewport,d,a]),c.jsx(ze.div,{"data-state":i.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 m=f.target.getBoundingClientRect(),x=f.clientX-m.left,g=f.clientY-m.top;i.onThumbPointerDown({x,y:g})}),onPointerUp:ue(e.onPointerUp,i.onThumbPointerUp)})});iT.displayName=Pd;var Yv="ScrollAreaCorner",aT=y.forwardRef((e,t)=>{const r=tn(Yv,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?c.jsx(Xz,{...e,ref:t}):null});aT.displayName=Yv;var Xz=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=tn(Yv,r),[o,i]=y.useState(0),[a,l]=y.useState(0),u=!!(o&&a);return la(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),l(d)}),la(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),i(d)}),u?c.jsx(ze.div,{...n,ref:t,style:{width:o,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Dd(e){return e?parseInt(e,10):0}function lT(e,t){const r=e/t;return isNaN(r)?0:r}function zf(e){const t=lT(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Qz(e,t,r,n="ltr"){const s=zf(r),o=s/2,i=t||o,a=s-i,l=r.scrollbar.paddingStart+i,u=r.scrollbar.size-r.scrollbar.paddingEnd-a,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return cT([l,u],f)(e)}function T0(e,t,r="ltr"){const n=zf(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,i=t.content-t.viewport,a=o-n,l=r==="ltr"?[0,i]:[i*-1,0],u=am(e,l);return cT([0,i],[0,a])(u)}function cT(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 uT(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},i=r.left!==o.left,a=r.top!==o.top;(i||a)&&t(),r=o,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function Uf(e,t){const r=At(e),n=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(n.current),[]),y.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function la(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 dT=eT,e8=rT,t8=aT;const fT=y.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(dT,{ref:n,className:me("relative overflow-hidden",e),...r,children:[c.jsx(e8,{className:"h-full w-full rounded-[inherit]",children:t}),c.jsx(hT,{}),c.jsx(t8,{})]}));fT.displayName=dT.displayName;const hT=y.forwardRef(({className:e,orientation:t="vertical",...r},n)=>c.jsx(Bv,{ref:n,orientation:t,className:me("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(iT,{className:"relative flex-1 rounded-full bg-border"})}));hT.displayName=Bv.displayName;const pT=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 Nt().collection("deployments").getList(t,r,{filter:n,sort:"-deployedAt",expand:"domain"})},r8=()=>{const e=wn(),[t,r]=y.useState(),[n]=jR(),s=n.get("domain");return y.useEffect(()=>{(async()=>{const i={};s&&(i.domain=s);const a=await pT(i);r(a.items)})()},[s]),c.jsxs(fT,{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(o=>{var i,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:(i=o.expand.domain)==null?void 0:i.domain}),c.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:o.phase==="deploy"&&o.phaseSuccess?c.jsx(mg,{size:16,className:"text-green-700"}):c.jsx(gg,{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(kv,{phase:o.phase,phaseSuccess:o.phaseSuccess})}),c.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:sa(o.deployedAt)}),c.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:c.jsxs(Xg,{children:[c.jsx(Qg,{asChild:!0,children:c.jsx(ft,{variant:"link",className:"p-0",children:"日志"})}),c.jsxs(hf,{className:"sm:max-w-5xl",children:[c.jsx(Jg,{children:c.jsxs(ev,{children:[(a=o.expand.domain)==null?void 0:a.domain,"-",o.id,"部署详情"]})}),c.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[o.log.check&&c.jsx(c.Fragment,{children:o.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})]}))}),o.log.apply&&c.jsx(c.Fragment,{children:o.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})]}))}),o.log.deploy&&c.jsx(c.Fragment,{children:o.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})]}))})]})]})]})})]},o.id)})]}):c.jsx(c.Fragment,{children:c.jsxs(Uv,{className:"max-w-[40em] mx-auto mt-20",children:[c.jsx(Vv,{children:"暂无数据"}),c.jsxs(Wv,{children:[c.jsxs("div",{className:"flex items-center mt-5",children:[c.jsx("div",{children:c.jsx(c1,{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(ft,{onClick:()=>{e("/")},children:"添加域名"})})]})]})})]})},pm=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",n8=Se.object({username:Se.string().email({message:"请输入正确的邮箱地址"}),password:Se.string().min(10,{message:"密码至少10个字符"})}),s8=()=>{const e=Bn({resolver:Hn(n8),defaultValues:{username:"",password:""}}),t=async n=>{try{await Nt().admins.authWithPassword(n.username,n.password),r("/")}catch(s){const o=pm(s);e.setError("username",{message:o}),e.setError("password",{message:o})}},r=wn();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(Yn,{...e,children:c.jsxs("form",{onSubmit:e.handleSubmit(t),className:"space-y-8 dark:text-stone-200",children:[c.jsx(Ve,{control:e.control,name:"username",render:({field:n})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"用户名"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"email",...n})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:e.control,name:"password",render:({field:n})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"密码"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"shadcn",...n,type:"password"})}),c.jsx(Ae,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(ft,{type:"submit",children:"登录"})})]})})]})},o8=()=>Nt().authStore.isValid&&Nt().authStore.isAdmin?c.jsx(o1,{to:"/"}):c.jsx("div",{className:"container",children:c.jsx(pg,{})}),i8=Se.object({oldPassword:Se.string().min(10,{message:"密码至少10个字符"}),newPassword:Se.string().min(10,{message:"密码至少10个字符"}),confirmPassword:Se.string().min(10,{message:"密码至少10个字符"})}).refine(e=>e.newPassword===e.confirmPassword,{message:"两次密码不一致",path:["confirmPassword"]}),a8=()=>{const{toast:e}=Tf(),t=wn(),r=Bn({resolver:Hn(i8),defaultValues:{oldPassword:"",newPassword:"",confirmPassword:""}}),n=async s=>{var o,i;try{await Nt().admins.authWithPassword((o=Nt().authStore.model)==null?void 0:o.email,s.oldPassword)}catch(a){const l=pm(a);r.setError("oldPassword",{message:l})}try{await Nt().admins.update((i=Nt().authStore.model)==null?void 0:i.id,{password:s.newPassword,passwordConfirm:s.confirmPassword}),Nt().authStore.clear(),e({title:"修改密码成功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(a){const l=pm(a);e({title:"修改密码失败",description:l,variant:"destructive"})}};return c.jsx(c.Fragment,{children:c.jsx(Yn,{...r,children:c.jsxs("form",{onSubmit:r.handleSubmit(n),className:"space-y-8 dark:text-stone-200",children:[c.jsx(Ve,{control:r.control,name:"oldPassword",render:({field:s})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"当前密码"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"当前密码",...s,type:"password"})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:r.control,name:"newPassword",render:({field:s})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"新密码"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"newPassword",...s,type:"password"})}),c.jsx(Ae,{})]})}),c.jsx(Ve,{control:r.control,name:"confirmPassword",render:({field:s})=>c.jsxs(Me,{children:[c.jsx(Ie,{children:"确认密码"}),c.jsx(Le,{children:c.jsx($e,{placeholder:"confirmPassword",...s,type:"password"})}),c.jsx(Ae,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(ft,{type:"submit",children:"确认修改"})})]})})})},l8=()=>c.jsxs("div",{children:[c.jsx(Nv,{}),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(pg,{})})]}),c8=()=>{const[e,t]=y.useState(),[r,n]=y.useState(),s=wn();return y.useEffect(()=>{(async()=>{const i=await k5();t(i)})()},[]),y.useEffect(()=>{(async()=>{const a=await pT({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 md:flex-row",children:[c.jsxs("div",{className:"w-full md:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[c.jsx("div",{className:"p-3",children:c.jsx(BR,{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-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[c.jsx("div",{className:"p-3",children:c.jsx(OR,{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-[300px] flex items-center rounded-md p-3 shadow-lg",children:[c.jsx("div",{className:"p-3",children:c.jsx(VR,{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-[300px] flex items-center rounded-md p-3 shadow-lg",children:[c.jsx("div",{className:"p-3",children:c.jsx(DR,{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(Uv,{className:"max-w-[40em] mt-10",children:[c.jsx(Vv,{children:"暂无数据"}),c.jsxs(Wv,{children:[c.jsxs("div",{className:"flex items-center mt-5",children:[c.jsx("div",{children:c.jsx(c1,{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(ft,{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(o=>{var i,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:(i=o.expand.domain)==null?void 0:i.domain}),c.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:o.phase==="deploy"&&o.phaseSuccess?c.jsx(mg,{size:16,className:"text-green-700"}):c.jsx(gg,{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(kv,{phase:o.phase,phaseSuccess:o.phaseSuccess})}),c.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:sa(o.deployedAt)}),c.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:c.jsxs(Xg,{children:[c.jsx(Qg,{asChild:!0,children:c.jsx(ft,{variant:"link",className:"p-0",children:"日志"})}),c.jsxs(hf,{className:"sm:max-w-5xl",children:[c.jsx(Jg,{children:c.jsxs(ev,{children:[(a=o.expand.domain)==null?void 0:a.domain,"-",o.id,"部署详情"]})}),c.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[o.log.check&&c.jsx(c.Fragment,{children:o.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})]}))}),o.log.apply&&c.jsx(c.Fragment,{children:o.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})]}))}),o.log.deploy&&c.jsx(c.Fragment,{children:o.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})]}))})]})]})]})})]},o.id)})]})]})]})},u8=hR([{path:"/",element:c.jsx(s3,{}),children:[{path:"/",element:c.jsx(c8,{})},{path:"/domains",element:c.jsx(N5,{})},{path:"/edit",element:c.jsx(Uz,{})},{path:"/access",element:c.jsx(Vz,{})},{path:"/history",element:c.jsx(r8,{})},{path:"/setting",element:c.jsx(l8,{}),children:[{path:"/setting/password",element:c.jsx(a8,{})}]}]},{path:"/login",element:c.jsx(o8,{}),children:[{path:"/login",element:c.jsx(s8,{})}]},{path:"/about",element:c.jsx("div",{children:"About"})}]);Fh.createRoot(document.getElementById("root")).render(c.jsx(et.StrictMode,{children:c.jsx(QF,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:c.jsx(bR,{router:u8})})}))});export default d8();