From 4a03f930a1a1f3f196c010ba86a5cee4a8030a74 Mon Sep 17 00:00:00 2001 From: yoan <536464346@qq.com> Date: Mon, 26 Aug 2024 21:51:30 +0800 Subject: [PATCH] Supports certificate downloads, wildcard domains, and more. --- ui/dist/assets/index-CVoG9k3w.js | 239 +++++++++++++++++++++++++++++++ ui/dist/assets/index-FyOtRun2.js | 228 ----------------------------- ui/dist/index.html | 2 +- ui/package-lock.json | 80 ++++++++++- ui/package.json | 1 + ui/src/domain/domain.ts | 2 + ui/src/lib/file.ts | 23 +++ ui/src/pages/domains/Edit.tsx | 2 +- ui/src/pages/domains/Home.tsx | 28 ++++ 9 files changed, 373 insertions(+), 232 deletions(-) create mode 100644 ui/dist/assets/index-CVoG9k3w.js delete mode 100644 ui/dist/assets/index-FyOtRun2.js diff --git a/ui/dist/assets/index-CVoG9k3w.js b/ui/dist/assets/index-CVoG9k3w.js new file mode 100644 index 00000000..8edca166 --- /dev/null +++ b/ui/dist/assets/index-CVoG9k3w.js @@ -0,0 +1,239 @@ +var ET=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var lU=ET((xU,Cu)=>{function yw(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 Cc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function im(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ww={exports:{}},Cd={},xw={exports:{}},Ye={};/** + * @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 Hl=Symbol.for("react.element"),TT=Symbol.for("react.portal"),RT=Symbol.for("react.fragment"),NT=Symbol.for("react.strict_mode"),PT=Symbol.for("react.profiler"),jT=Symbol.for("react.provider"),DT=Symbol.for("react.context"),OT=Symbol.for("react.forward_ref"),AT=Symbol.for("react.suspense"),MT=Symbol.for("react.memo"),IT=Symbol.for("react.lazy"),Fv=Symbol.iterator;function LT(e){return e===null||typeof e!="object"?null:(e=Fv&&e[Fv]||e["@@iterator"],typeof e=="function"?e:null)}var _w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bw=Object.assign,Sw={};function ta(e,t,r){this.props=e,this.context=t,this.refs=Sw,this.updater=r||_w}ta.prototype.isReactComponent={};ta.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")};ta.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function kw(){}kw.prototype=ta.prototype;function am(e,t,r){this.props=e,this.context=t,this.refs=Sw,this.updater=r||_w}var lm=am.prototype=new kw;lm.constructor=am;bw(lm,ta.prototype);lm.isPureReactComponent=!0;var zv=Array.isArray,Cw=Object.prototype.hasOwnProperty,cm={current:null},Ew={key:!0,ref:!0,__self:!0,__source:!0};function Tw(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)Cw.call(t,n)&&!Ew.hasOwnProperty(n)&&(s[n]=t[n]);var a=arguments.length-2;if(a===1)s.children=r;else if(1>>1,$=Z[z];if(0>>1;zs(se,Q))Ee<$&&0>s(fe,se)?(Z[z]=fe,Z[Ee]=Q,z=Ee):(Z[z]=se,Z[ne]=Q,z=ne);else if(Ee<$&&0>s(fe,Q))Z[z]=fe,Z[Ee]=Q,z=Ee;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=[],c=[],f=1,u=null,h=3,m=!1,y=!1,p=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=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(c);I!==null;){if(I.callback===null)n(c);else if(I.startTime<=Z)n(c),I.sortIndex=I.expirationTime,t(l,I);else break;I=r(c)}}function C(Z){if(p=!1,_(Z),!y)if(r(l)!==null)y=!0,te(E);else{var I=r(c);I!==null&&B(C,I.startTime-Z)}}function E(Z,I){y=!1,p&&(p=!1,g(O),O=-1),m=!0;var Q=h;try{for(_(I),u=r(l);u!==null&&(!(u.expirationTime>I)||Z&&!q());){var z=u.callback;if(typeof z=="function"){u.callback=null,h=u.priorityLevel;var $=z(u.expirationTime<=I);I=e.unstable_now(),typeof $=="function"?u.callback=$:u===r(l)&&n(l),_(I)}else n(l);u=r(l)}if(u!==null)var de=!0;else{var ne=r(c);ne!==null&&B(C,ne.startTime-I),de=!1}return de}finally{u=null,h=Q,m=!1}}var T=!1,P=null,O=-1,j=5,L=-1;function q(){return!(e.unstable_now()-LZ||125z?(Z.sortIndex=Q,t(c,Z),r(l)===null&&Z===r(c)&&(p?(g(O),O=-1):p=!0,B(C,Q-z))):(Z.sortIndex=$,t(l,Z),y||m||(y=!0,te(E))),Z},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(Z){var I=h;return function(){var Q=h;h=I;try{return Z.apply(this,arguments)}finally{h=Q}}}})(Ow);Dw.exports=Ow;var GT=Dw.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 KT=w,Fr=GT;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"),Rh=Object.prototype.hasOwnProperty,qT=/^[: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]*$/,$v={},Vv={};function XT(e){return Rh.call(Vv,e)?!0:Rh.call($v,e)?!1:qT.test(e)?Vv[e]=!0:($v[e]=!0,!1)}function QT(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 JT(e,t,r,n){if(t===null||typeof t>"u"||QT(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 gr(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 tr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){tr[e]=new gr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];tr[t]=new gr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){tr[e]=new gr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){tr[e]=new gr(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){tr[e]=new gr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){tr[e]=new gr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){tr[e]=new gr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){tr[e]=new gr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){tr[e]=new gr(e,5,!1,e.toLowerCase(),null,!1,!1)});var dm=/[\-:]([a-z])/g;function fm(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(dm,fm);tr[t]=new gr(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(dm,fm);tr[t]=new gr(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(dm,fm);tr[t]=new gr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){tr[e]=new gr(e,1,!1,e.toLowerCase(),null,!1,!1)});tr.xlinkHref=new gr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){tr[e]=new gr(e,1,!1,e.toLowerCase(),null,!0,!0)});function hm(e,t,r,n){var s=tr.hasOwnProperty(t)?tr[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{Of=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Da(e):""}function eR(e){switch(e.tag){case 5:return Da(e.type);case 16:return Da("Lazy");case 13:return Da("Suspense");case 19:return Da("SuspenseList");case 0:case 2:case 15:return e=Af(e.type,!1),e;case 11:return e=Af(e.type.render,!1),e;case 1:return e=Af(e.type,!0),e;default:return""}}function Dh(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 hi:return"Fragment";case fi:return"Portal";case Nh:return"Profiler";case pm:return"StrictMode";case Ph:return"Suspense";case jh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Iw:return(e.displayName||"Context")+".Consumer";case Mw:return(e._context.displayName||"Context")+".Provider";case mm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case gm:return t=e.displayName||null,t!==null?t:Dh(e.type)||"Memo";case As:t=e._payload,e=e._init;try{return Dh(e(t))}catch{}}return null}function tR(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 Dh(t);case 8:return t===pm?"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 Js(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Fw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rR(e){var t=Fw(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 Rc(e){e._valueTracker||(e._valueTracker=rR(e))}function zw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Fw(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Eu(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 Oh(e,t){var r=t.checked;return Dt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Wv(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Js(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 Uw(e,t){t=t.checked,t!=null&&hm(e,"checked",t,!1)}function Ah(e,t){Uw(e,t);var r=Js(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")?Mh(e,t.type,r):t.hasOwnProperty("defaultValue")&&Mh(e,t.type,Js(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Hv(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 Mh(e,t,r){(t!=="number"||Eu(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Oa=Array.isArray;function Ri(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Nc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var $a={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},nR=["Webkit","ms","Moz","O"];Object.keys($a).forEach(function(e){nR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),$a[t]=$a[e]})});function Ww(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||$a.hasOwnProperty(e)&&$a[e]?(""+t).trim():t+"px"}function Hw(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=Ww(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var sR=Dt({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 Fh(e,t){if(t){if(sR[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 zh(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 Uh=null;function vm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $h=null,Ni=null,Pi=null;function Gv(e){if(e=Gl(e)){if(typeof $h!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=Pd(t),$h(e.stateNode,e.type,t))}}function Yw(e){Ni?Pi?Pi.push(e):Pi=[e]:Ni=e}function Zw(){if(Ni){var e=Ni,t=Pi;if(Pi=Ni=null,Gv(e),t)for(e=0;e>>=0,e===0?32:31-(mR(e)/gR|0)|0}var Pc=64,jc=4194304;function Aa(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 Pu(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=Aa(a):(o&=i,o!==0&&(n=Aa(o)))}else i=r&~s,i!==0?n=Aa(i):o!==0&&(n=Aa(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 Yl(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-un(t),e[t]=r}function xR(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=Ba),ny=" ",sy=!1;function hx(e,t){switch(e){case"keyup":return GR.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function px(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var pi=!1;function qR(e,t){switch(e){case"compositionend":return px(t);case"keypress":return t.which!==32?null:(sy=!0,ny);case"textInput":return e=t.data,e===ny&&sy?null:e;default:return null}}function XR(e,t){if(pi)return e==="compositionend"||!Cm&&hx(e,t)?(e=dx(),iu=bm=zs=null,pi=!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=ly(r)}}function yx(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yx(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wx(){for(var e=window,t=Eu();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Eu(e.document)}return t}function Em(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 i2(e){var t=wx(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&yx(r.ownerDocument.documentElement,r)){if(n!==null&&Em(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=cy(r,o);var i=cy(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,mi=null,Zh=null,Ha=null,Gh=!1;function uy(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Gh||mi==null||mi!==Eu(n)||(n=mi,"selectionStart"in n&&Em(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}),Ha&&ll(Ha,n)||(Ha=n,n=Ou(Zh,"onSelect"),0yi||(e.current=ep[yi],ep[yi]=null,yi--)}function gt(e,t){yi++,ep[yi]=e.current,e.current=t}var eo={},ar=co(eo),Sr=co(!1),Ao=eo;function Bi(e,t){var r=e.type.contextTypes;if(!r)return eo;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 Mu(){xt(Sr),xt(ar)}function vy(e,t,r){if(ar.current!==eo)throw Error(oe(168));gt(ar,t),gt(Sr,r)}function Rx(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,tR(e)||"Unknown",s));return Dt({},r,n)}function Iu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||eo,Ao=ar.current,gt(ar,e),gt(Sr,Sr.current),!0}function yy(e,t,r){var n=e.stateNode;if(!n)throw Error(oe(169));r?(e=Rx(e,t,Ao),n.__reactInternalMemoizedMergedChildContext=e,xt(Sr),xt(ar),gt(ar,e)):xt(Sr),gt(Sr,r)}var es=null,jd=!1,Gf=!1;function Nx(e){es===null?es=[e]:es.push(e)}function y2(e){jd=!0,Nx(e)}function uo(){if(!Gf&&es!==null){Gf=!0;var e=0,t=ut;try{var r=es;for(ut=1;e>=i,s-=i,ts=1<<32-un(t)+s|r<O?(j=P,P=null):j=P.sibling;var L=h(g,P,_[O],C);if(L===null){P===null&&(P=j);break}e&&P&&L.alternate===null&&t(g,P),v=o(L,v,O),T===null?E=L:T.sibling=L,T=L,P=j}if(O===_.length)return r(g,P),Et&&yo(g,O),E;if(P===null){for(;O<_.length;O++)P=u(g,_[O],C),P!==null&&(v=o(P,v,O),T===null?E=P:T.sibling=P,T=P);return Et&&yo(g,O),E}for(P=n(g,P);O<_.length;O++)j=m(P,g,O,_[O],C),j!==null&&(e&&j.alternate!==null&&P.delete(j.key===null?O:j.key),v=o(j,v,O),T===null?E=j:T.sibling=j,T=j);return e&&P.forEach(function(q){return t(g,q)}),Et&&yo(g,O),E}function p(g,v,_,C){var E=ga(_);if(typeof E!="function")throw Error(oe(150));if(_=E.call(_),_==null)throw Error(oe(151));for(var T=E=null,P=v,O=v=0,j=null,L=_.next();P!==null&&!L.done;O++,L=_.next()){P.index>O?(j=P,P=null):j=P.sibling;var q=h(g,P,L.value,C);if(q===null){P===null&&(P=j);break}e&&P&&q.alternate===null&&t(g,P),v=o(q,v,O),T===null?E=q:T.sibling=q,T=q,P=j}if(L.done)return r(g,P),Et&&yo(g,O),E;if(P===null){for(;!L.done;O++,L=_.next())L=u(g,L.value,C),L!==null&&(v=o(L,v,O),T===null?E=L:T.sibling=L,T=L);return Et&&yo(g,O),E}for(P=n(g,P);!L.done;O++,L=_.next())L=m(P,g,O,L.value,C),L!==null&&(e&&L.alternate!==null&&P.delete(L.key===null?O:L.key),v=o(L,v,O),T===null?E=L:T.sibling=L,T=L);return e&&P.forEach(function(R){return t(g,R)}),Et&&yo(g,O),E}function x(g,v,_,C){if(typeof _=="object"&&_!==null&&_.type===hi&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Tc:e:{for(var E=_.key,T=v;T!==null;){if(T.key===E){if(E=_.type,E===hi){if(T.tag===7){r(g,T.sibling),v=s(T,_.props.children),v.return=g,g=v;break e}}else if(T.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===As&&_y(E)===T.type){r(g,T.sibling),v=s(T,_.props),v.ref=_a(g,T,_),v.return=g,g=v;break e}r(g,T);break}else t(g,T);T=T.sibling}_.type===hi?(v=Po(_.props.children,g.mode,C,_.key),v.return=g,g=v):(C=pu(_.type,_.key,_.props,null,g.mode,C),C.ref=_a(g,v,_),C.return=g,g=C)}return i(g);case fi:e:{for(T=_.key;v!==null;){if(v.key===T)if(v.tag===4&&v.stateNode.containerInfo===_.containerInfo&&v.stateNode.implementation===_.implementation){r(g,v.sibling),v=s(v,_.children||[]),v.return=g,g=v;break e}else{r(g,v);break}else t(g,v);v=v.sibling}v=rh(_,g.mode,C),v.return=g,g=v}return i(g);case As:return T=_._init,x(g,v,T(_._payload),C)}if(Oa(_))return y(g,v,_,C);if(ga(_))return p(g,v,_,C);Fc(g,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,v!==null&&v.tag===6?(r(g,v.sibling),v=s(v,_),v.return=g,g=v):(r(g,v),v=th(_,g.mode,C),v.return=g,g=v),i(g)):r(g,v)}return x}var Hi=Ox(!0),Ax=Ox(!1),zu=co(null),Uu=null,_i=null,Pm=null;function jm(){Pm=_i=Uu=null}function Dm(e){var t=zu.current;xt(zu),e._currentValue=t}function np(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 Di(e,t){Uu=e,Pm=_i=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(Pm!==e)if(e={context:e,memoizedValue:t,next:null},_i===null){if(Uu===null)throw Error(oe(308));_i=e,Uu.dependencies={lanes:0,firstContext:e}}else _i=_i.next=e;return t}var bo=null;function Om(e){bo===null?bo=[e]:bo.push(e)}function Mx(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Om(t)):(r.next=s.next,s.next=r),t.interleaved=r,ds(e,n)}function ds(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 Ms=!1;function Am(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ix(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 os(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Gs(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,et&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,ds(e,r)}return s=n.interleaved,s===null?(t.next=t,Om(n)):(t.next=s.next,s.next=t),n.interleaved=t,ds(e,r)}function lu(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,wm(e,r)}}function by(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 $u(e,t,r,n){var s=e.updateQueue;Ms=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,i===null?o=c:i.next=c,i=l;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==i&&(a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=l))}if(o!==null){var u=s.baseState;i=0,f=c=l=null,a=o;do{var h=a.lane,m=a.eventTime;if((n&h)===h){f!==null&&(f=f.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,p=a;switch(h=t,m=r,p.tag){case 1:if(y=p.payload,typeof y=="function"){u=y.call(m,u,h);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=p.payload,h=typeof y=="function"?y.call(m,u,h):y,h==null)break e;u=Dt({},u,h);break e;case 2:Ms=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else m={eventTime:m,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(c=f=m,l=u):f=f.next=m,i|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(f===null&&(l=u),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=f,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);Lo|=i,e.lanes=i,e.memoizedState=u}}function Sy(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=qf.transition;qf.transition={};try{e(!1),t()}finally{ut=r,qf.transition=n}}function Jx(){return Xr().memoizedState}function b2(e,t,r){var n=qs(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},e_(e))t_(t,r);else if(r=Mx(e,t,r,n),r!==null){var s=hr();dn(r,e,n,s),r_(r,t,n)}}function S2(e,t,r){var n=qs(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(e_(e))t_(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,hn(a,i)){var l=t.interleaved;l===null?(s.next=s,Om(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}r=Mx(e,t,s,n),r!==null&&(s=hr(),dn(r,e,n,s),r_(r,t,n))}}function e_(e){var t=e.alternate;return e===jt||t!==null&&t===jt}function t_(e,t){Ya=Bu=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function r_(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,wm(e,r)}}var Wu={readContext:qr,useCallback:nr,useContext:nr,useEffect:nr,useImperativeHandle:nr,useInsertionEffect:nr,useLayoutEffect:nr,useMemo:nr,useReducer:nr,useRef:nr,useState:nr,useDebugValue:nr,useDeferredValue:nr,useTransition:nr,useMutableSource:nr,useSyncExternalStore:nr,useId:nr,unstable_isNewReconciler:!1},k2={readContext:qr,useCallback:function(e,t){return kn().memoizedState=[e,t===void 0?null:t],e},useContext:qr,useEffect:Cy,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,uu(4194308,4,Gx.bind(null,t,e),r)},useLayoutEffect:function(e,t){return uu(4194308,4,e,t)},useInsertionEffect:function(e,t){return uu(4,2,e,t)},useMemo:function(e,t){var r=kn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=kn();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=b2.bind(null,jt,e),[n.memoizedState,e]},useRef:function(e){var t=kn();return e={current:e},t.memoizedState=e},useState:ky,useDebugValue:Vm,useDeferredValue:function(e){return kn().memoizedState=e},useTransition:function(){var e=ky(!1),t=e[0];return e=_2.bind(null,e[1]),kn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=jt,s=kn();if(Et){if(r===void 0)throw Error(oe(407));r=r()}else{if(r=t(),qt===null)throw Error(oe(349));Io&30||Ux(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,Cy(Vx.bind(null,n,o,e),[e]),n.flags|=2048,gl(9,$x.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=kn(),t=qt.identifierPrefix;if(Et){var r=rs,n=ts;r=(n&~(1<<32-un(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=pl++,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[Cn]=t,e[dl]=n,f_(e,t,!1,!1),t.stateNode=e;e:{switch(i=zh(r,n),r){case"dialog":yt("cancel",e),yt("close",e),s=n;break;case"iframe":case"object":case"embed":yt("load",e),s=n;break;case"video":case"audio":for(s=0;sGi&&(t.flags|=128,n=!0,ba(o,!1),t.lanes=4194304)}else{if(!n)if(e=Vu(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ba(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Et)return sr(t),null}else 2*Ft()-o.renderingStartTime>Gi&&r!==1073741824&&(t.flags|=128,n=!0,ba(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=Ft(),t.sibling=null,r=Nt.current,gt(Nt,n?r&1|2:r&1),t):(sr(t),null);case 22:case 23:return Gm(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Pr&1073741824&&(sr(t),t.subtreeFlags&6&&(t.flags|=8192)):sr(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function D2(e,t){switch(Rm(t),t.tag){case 1:return kr(t.type)&&Mu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(),xt(Sr),xt(ar),Lm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Im(t),null;case 13:if(xt(Nt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xt(Nt),null;case 4:return Yi(),null;case 10:return Dm(t.type._context),null;case 22:case 23:return Gm(),null;case 24:return null;default:return null}}var Uc=!1,or=!1,O2=typeof WeakSet=="function"?WeakSet:Set,_e=null;function bi(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){At(e,t,n)}else r.current=null}function fp(e,t,r){try{r()}catch(n){At(e,t,n)}}var Iy=!1;function A2(e,t){if(Kh=ju,e=wx(),Em(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,c=0,f=0,u=e,h=null;t:for(;;){for(var m;u!==r||s!==0&&u.nodeType!==3||(a=i+s),u!==o||n!==0&&u.nodeType!==3||(l=i+n),u.nodeType===3&&(i+=u.nodeValue.length),(m=u.firstChild)!==null;)h=u,u=m;for(;;){if(u===e)break t;if(h===r&&++c===s&&(a=i),h===o&&++f===n&&(l=i),(m=u.nextSibling)!==null)break;u=h,h=u.parentNode}u=m}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(qh={focusedElem:e,selectionRange:r},ju=!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 y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var p=y.memoizedProps,x=y.memoizedState,g=t.stateNode,v=g.getSnapshotBeforeUpdate(t.elementType===t.type?p:rn(t.type,p),x);g.__reactInternalSnapshotBeforeUpdate=v}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){At(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,_e=e;break}_e=t.return}return y=Iy,Iy=!1,y}function Za(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&&fp(t,r,o)}s=s.next}while(s!==n)}}function Ad(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 hp(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 m_(e){var t=e.alternate;t!==null&&(e.alternate=null,m_(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Cn],delete t[dl],delete t[Jh],delete t[g2],delete t[v2])),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 g_(e){return e.tag===5||e.tag===3||e.tag===4}function Ly(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||g_(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 pp(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=Au));else if(n!==4&&(e=e.child,e!==null))for(pp(e,t,r),e=e.sibling;e!==null;)pp(e,t,r),e=e.sibling}function mp(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(mp(e,t,r),e=e.sibling;e!==null;)mp(e,t,r),e=e.sibling}var Jt=null,nn=!1;function Ns(e,t,r){for(r=r.child;r!==null;)v_(e,t,r),r=r.sibling}function v_(e,t,r){if(jn&&typeof jn.onCommitFiberUnmount=="function")try{jn.onCommitFiberUnmount(Ed,r)}catch{}switch(r.tag){case 5:or||bi(r,t);case 6:var n=Jt,s=nn;Jt=null,Ns(e,t,r),Jt=n,nn=s,Jt!==null&&(nn?(e=Jt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Jt.removeChild(r.stateNode));break;case 18:Jt!==null&&(nn?(e=Jt,r=r.stateNode,e.nodeType===8?Zf(e.parentNode,r):e.nodeType===1&&Zf(e,r),il(e)):Zf(Jt,r.stateNode));break;case 4:n=Jt,s=nn,Jt=r.stateNode.containerInfo,nn=!0,Ns(e,t,r),Jt=n,nn=s;break;case 0:case 11:case 14:case 15:if(!or&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&fp(r,t,i),s=s.next}while(s!==n)}Ns(e,t,r);break;case 1:if(!or&&(bi(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){At(r,t,a)}Ns(e,t,r);break;case 21:Ns(e,t,r);break;case 22:r.mode&1?(or=(n=or)||r.memoizedState!==null,Ns(e,t,r),or=n):Ns(e,t,r);break;default:Ns(e,t,r)}}function Fy(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new O2),t.forEach(function(n){var s=B2.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function tn(e,t){var r=t.deletions;if(r!==null)for(var n=0;ns&&(s=i),n&=~o}if(n=s,n=Ft()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*I2(n/1960))-n,10e?16:e,Us===null)var n=!1;else{if(e=Us,Us=null,Zu=0,et&6)throw Error(oe(331));var s=et;for(et|=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;lFt()-Ym?No(e,0):Hm|=r),Cr(e,t)}function C_(e,t){t===0&&(e.mode&1?(t=jc,jc<<=1,!(jc&130023424)&&(jc=4194304)):t=1);var r=hr();e=ds(e,t),e!==null&&(Yl(e,t,r),Cr(e,r))}function V2(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),C_(e,r)}function B2(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),C_(e,r)}var E_;E_=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,P2(e,t,r);br=!!(e.flags&131072)}else br=!1,Et&&t.flags&1048576&&Px(t,Fu,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;du(e,t),e=t.pendingProps;var s=Bi(t,ar.current);Di(t,r),s=zm(null,t,n,e,s,r);var o=Um();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,Iu(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Am(t),s.updater=Od,t.stateNode=s,s._reactInternals=t,op(t,n,e,r),t=lp(null,t,n,!0,o,r)):(t.tag=0,Et&&o&&Tm(t),dr(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(du(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=H2(n),e=rn(n,e),s){case 0:t=ap(null,t,n,e,r);break e;case 1:t=Oy(null,t,n,e,r);break e;case 11:t=jy(null,t,n,e,r);break e;case 14:t=Dy(null,t,n,rn(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:rn(n,s),ap(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),Oy(e,t,n,s,r);case 3:e:{if(c_(t),e===null)throw Error(oe(387));n=t.pendingProps,o=t.memoizedState,s=o.element,Ix(e,t),$u(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=Zi(Error(oe(423)),t),t=Ay(e,t,n,r,s);break e}else if(n!==s){s=Zi(Error(oe(424)),t),t=Ay(e,t,n,r,s);break e}else for(Or=Zs(t.stateNode.containerInfo.firstChild),Ar=t,Et=!0,on=null,r=Ax(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Wi(),n===s){t=fs(e,t,r);break e}dr(e,t,n,r)}t=t.child}return t;case 5:return Lx(t),e===null&&rp(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,Xh(n,s)?i=null:o!==null&&Xh(n,o)&&(t.flags|=32),l_(e,t),dr(e,t,i,r),t.child;case 6:return e===null&&rp(t),null;case 13:return u_(e,t,r);case 4:return Mm(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Hi(t,null,n,r):dr(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),jy(e,t,n,s,r);case 7:return dr(e,t,t.pendingProps,r),t.child;case 8:return dr(e,t,t.pendingProps.children,r),t.child;case 12:return dr(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,gt(zu,n._currentValue),n._currentValue=i,o!==null)if(hn(o.value,i)){if(o.children===s.children&&!Sr.current){t=fs(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=os(-1,r&-r),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?l.next=l:(l.next=f.next,f.next=l),c.pending=l}}o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),np(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),np(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}dr(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Di(t,r),s=qr(s),n=n(s),t.flags|=1,dr(e,t,n,r),t.child;case 14:return n=t.type,s=rn(n,t.pendingProps),s=rn(n.type,s),Dy(e,t,n,s,r);case 15:return i_(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),du(e,t),t.tag=1,kr(n)?(e=!0,Iu(t)):e=!1,Di(t,r),n_(t,n,s),op(t,n,s,r),lp(null,t,n,!0,e,r);case 19:return d_(e,t,r);case 22:return a_(e,t,r)}throw Error(oe(156,t.tag))};function T_(e,t){return ex(e,t)}function W2(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 W2(e,t,r,n)}function qm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function H2(e){if(typeof e=="function")return qm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===mm)return 11;if(e===gm)return 14}return 2}function Xs(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 pu(e,t,r,n,s,o){var i=2;if(n=e,typeof e=="function")qm(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case hi:return Po(r.children,s,o,t);case pm:i=8,s|=8;break;case Nh:return e=Zr(12,r,t,s|2),e.elementType=Nh,e.lanes=o,e;case Ph:return e=Zr(13,r,t,s),e.elementType=Ph,e.lanes=o,e;case jh:return e=Zr(19,r,t,s),e.elementType=jh,e.lanes=o,e;case Lw:return Id(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Mw:i=10;break e;case Iw:i=9;break e;case mm:i=11;break e;case gm:i=14;break e;case As: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 Po(e,t,r,n){return e=Zr(7,e,n,t),e.lanes=r,e}function Id(e,t,r,n){return e=Zr(22,e,n,t),e.elementType=Lw,e.lanes=r,e.stateNode={isHidden:!1},e}function th(e,t,r){return e=Zr(6,e,null,t),e.lanes=r,e}function rh(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 Y2(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=If(0),this.expirationTimes=If(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=If(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Xm(e,t,r,n,s,o,i,a,l){return e=new Y2(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},Am(o),e}function Z2(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j_)}catch(e){console.error(e)}}j_(),jw.exports=zr;var xs=jw.exports;const D_=im(xs),Q2=yw({__proto__:null,default:D_},[xs]);var Yy=xs;Th.createRoot=Yy.createRoot,Th.hydrateRoot=Yy.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 Rt(){return Rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function zo(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function eN(){return Math.random().toString(36).substr(2,8)}function Gy(e,t){return{usr:e.state,key:e.key,idx:t}}function yl(e,t,r,n){return r===void 0&&(r=null),Rt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?_s(t):t,{state:r,key:t&&t.key||n||eN()})}function Uo(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 _s(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 tN(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:o=!1}=n,i=s.history,a=Ut.Pop,l=null,c=f();c==null&&(c=0,i.replaceState(Rt({},i.state,{idx:c}),""));function f(){return(i.state||{idx:null}).idx}function u(){a=Ut.Pop;let x=f(),g=x==null?null:x-c;c=x,l&&l({action:a,location:p.location,delta:g})}function h(x,g){a=Ut.Push;let v=yl(p.location,x,g);r&&r(v,x),c=f()+1;let _=Gy(v,c),C=p.createHref(v);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:p.location,delta:1})}function m(x,g){a=Ut.Replace;let v=yl(p.location,x,g);r&&r(v,x),c=f();let _=Gy(v,c),C=p.createHref(v);i.replaceState(_,"",C),o&&l&&l({action:a,location:p.location,delta:0})}function y(x){let g=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof x=="string"?x:Uo(x);return v=v.replace(/ $/,"%20"),He(g,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,g)}let p={get action(){return a},get location(){return e(s,i)},listen(x){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(Zy,u),l=x,()=>{s.removeEventListener(Zy,u),l=null}},createHref(x){return t(s,x)},createURL:y,encodeLocation(x){let g=y(x);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:h,replace:m,go(x){return i.go(x)}};return p}var mt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(mt||(mt={}));const rN=new Set(["lazy","caseSensitive","path","id","index","children"]);function nN(e){return e.index===!0}function wl(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(He(s.index!==!0||!s.children,"Cannot specify children on an index route"),He(!n[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),nN(s)){let l=Rt({},s,t(s),{id:a});return n[a]=l,l}else{let l=Rt({},s,t(s),{id:a,children:void 0});return n[a]=l,s.children&&(l.children=wl(s.children,t,i,n)),l}})}function xo(e,t,r){return r===void 0&&(r="/"),mu(e,t,r,!1)}function mu(e,t,r,n){let s=typeof t=="string"?_s(t):t,o=sa(s.pathname||"/",r);if(o==null)return null;let i=O_(e);oN(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("/")&&(He(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 c=is([n,l.relativePath]),f=r.concat(l);o.children&&o.children.length>0&&(He(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),O_(o.children,t,f,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:fN(c,o.index),routesMeta:f})};return e.forEach((o,i)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))s(o,i);else for(let l of A_(o.path))s(o,i,l)}),t}function A_(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=A_(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 oN(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:hN(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const iN=/^:[\w-]+$/,aN=3,lN=2,cN=1,uN=10,dN=-2,Ky=e=>e==="*";function fN(e,t){let r=e.split("/"),n=r.length;return r.some(Ky)&&(n+=dN),t&&(n+=lN),r.filter(s=>!Ky(s)).reduce((s,o)=>s+(iN.test(o)?aN:o===""?cN:uN),n)}function hN(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 pN(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,s={},o="/",i=[];for(let a=0;a{let{paramName:h,isOptional:m}=f;if(h==="*"){let p=a[u]||"";i=o.slice(0,o.length-p.length).replace(/(.)\/+$/,"$1")}const y=a[u];return m&&!y?c[h]=void 0:c[h]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function mN(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),zo(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 gN(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return zo(!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 sa(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 vN(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?_s(e):e;return{pathname:r?r.startsWith("/")?r:yN(r,t):t,search:xN(n),hash:_N(s)}}function yN(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 nh(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 M_(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function $d(e,t){let r=M_(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Vd(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=_s(e):(s=Rt({},e),He(!s.pathname||!s.pathname.includes("?"),nh("?","pathname","search",s)),He(!s.pathname||!s.pathname.includes("#"),nh("#","pathname","hash",s)),He(!s.search||!s.search.includes("#"),nh("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,a;if(i==null)a=r;else{let u=t.length-1;if(!n&&i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),u-=1;s.pathname=h.join("/")}a=u>=0?t[u]:"/"}let l=vN(s,a),c=i&&i!=="/"&&i.endsWith("/"),f=(o||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||f)&&(l.pathname+="/"),l}const is=e=>e.join("/").replace(/\/\/+/g,"/"),wN=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),xN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_N=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class tg{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 Bd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const I_=["post","put","patch","delete"],bN=new Set(I_),SN=["get",...I_],kN=new Set(SN),CN=new Set([301,302,303,307,308]),EN=new Set([307,308]),sh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},TN={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ka={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},rg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,RN=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),L_="remix-router-transitions";function NN(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;He(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=W=>({hasErrorBoundary:U(W)})}else s=RN;let o={},i=wl(e.routes,s,void 0,o),a,l=e.basename||"/",c=e.unstable_dataStrategy||AN,f=e.unstable_patchRoutesOnMiss,u=Rt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,m=new Set,y=null,p=null,x=null,g=e.hydrationData!=null,v=xo(i,e.history.location,l),_=null;if(v==null&&!f){let U=ur(404,{pathname:e.history.location.pathname}),{matches:W,route:K}=i0(i);v=W,_={[K.id]:U}}v&&f&&!e.hydrationData&&Pf(v,i,e.history.location.pathname).active&&(v=null);let C;if(!v)C=!1,v=[];else if(v.some(U=>U.route.lazy))C=!1;else if(!v.some(U=>U.route.loader))C=!0;else if(u.v7_partialHydration){let U=e.hydrationData?e.hydrationData.loaderData:null,W=e.hydrationData?e.hydrationData.errors:null,K=re=>re.route.loader?typeof re.route.loader=="function"&&re.route.loader.hydrate===!0?!1:U&&U[re.route.id]!==void 0||W&&W[re.route.id]!==void 0:!0;if(W){let re=v.findIndex(ve=>W[ve.route.id]!==void 0);C=v.slice(0,re+1).every(K)}else C=v.every(K)}else C=e.hydrationData!=null;let E,T={historyAction:e.history.action,location:e.history.location,matches:v,initialized:C,navigation:sh,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},P=Ut.Pop,O=!1,j,L=!1,q=new Map,R=null,F=!1,b=!1,V=[],te=[],B=new Map,Z=0,I=-1,Q=new Map,z=new Set,$=new Map,de=new Map,ne=new Set,se=new Map,Ee=new Map,fe=new Map,ge=!1;function be(){if(h=e.history.listen(U=>{let{action:W,location:K,delta:re}=U;if(ge){ge=!1;return}zo(Ee.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 ve=xc({currentLocation:T.location,nextLocation:K,historyAction:W});if(ve&&re!=null){ge=!0,e.history.go(re*-1),Qo(ve,{state:"blocked",location:K,proceed(){Qo(ve,{state:"proceeding",proceed:void 0,reset:void 0,location:K}),e.history.go(re)},reset(){let ke=new Map(T.blockers);ke.set(ve,ka),Se({blockers:ke})}});return}return G(W,K)}),r){ZN(t,q);let U=()=>GN(t,q);t.addEventListener("pagehide",U),R=()=>t.removeEventListener("pagehide",U)}return T.initialized||G(Ut.Pop,T.location,{initialHydration:!0}),E}function Pe(){h&&h(),R&&R(),m.clear(),j&&j.abort(),T.fetchers.forEach((U,W)=>Vt(W)),T.blockers.forEach((U,W)=>wc(W))}function Te(U){return m.add(U),()=>m.delete(U)}function Se(U,W){W===void 0&&(W={}),T=Rt({},T,U);let K=[],re=[];u.v7_fetcherPersist&&T.fetchers.forEach((ve,ke)=>{ve.state==="idle"&&(ne.has(ke)?re.push(ke):K.push(ke))}),[...m].forEach(ve=>ve(T,{deletedFetchers:re,unstable_viewTransitionOpts:W.viewTransitionOpts,unstable_flushSync:W.flushSync===!0})),u.v7_fetcherPersist&&(K.forEach(ve=>T.fetchers.delete(ve)),re.forEach(ve=>Vt(ve)))}function Ke(U,W,K){var re,ve;let{flushSync:ke}=K===void 0?{}:K,Me=T.actionData!=null&&T.navigation.formMethod!=null&&sn(T.navigation.formMethod)&&T.navigation.state==="loading"&&((re=U.state)==null?void 0:re._isRedirect)!==!0,ue;W.actionData?Object.keys(W.actionData).length>0?ue=W.actionData:ue=null:Me?ue=T.actionData:ue=null;let Ue=W.loaderData?s0(T.loaderData,W.loaderData,W.matches||[],W.errors):T.loaderData,Ne=T.blockers;Ne.size>0&&(Ne=new Map(Ne),Ne.forEach((it,pt)=>Ne.set(pt,ka)));let je=O===!0||T.navigation.formMethod!=null&&sn(T.navigation.formMethod)&&((ve=U.state)==null?void 0:ve._isRedirect)!==!0;a&&(i=a,a=void 0),F||P===Ut.Pop||(P===Ut.Push?e.history.push(U,U.state):P===Ut.Replace&&e.history.replace(U,U.state));let dt;if(P===Ut.Pop){let it=q.get(T.location.pathname);it&&it.has(U.pathname)?dt={currentLocation:T.location,nextLocation:U}:q.has(U.pathname)&&(dt={currentLocation:U,nextLocation:T.location})}else if(L){let it=q.get(T.location.pathname);it?it.add(U.pathname):(it=new Set([U.pathname]),q.set(T.location.pathname,it)),dt={currentLocation:T.location,nextLocation:U}}Se(Rt({},W,{actionData:ue,loaderData:Ue,historyAction:P,location:U,initialized:!0,navigation:sh,revalidation:"idle",restoreScrollPosition:Iv(U,W.matches||T.matches),preventScrollReset:je,blockers:Ne}),{viewTransitionOpts:dt,flushSync:ke===!0}),P=Ut.Pop,O=!1,L=!1,F=!1,b=!1,V=[],te=[]}async function k(U,W){if(typeof U=="number"){e.history.go(U);return}let K=xp(T.location,T.matches,l,u.v7_prependBasename,U,u.v7_relativeSplatPath,W==null?void 0:W.fromRouteId,W==null?void 0:W.relative),{path:re,submission:ve,error:ke}=Xy(u.v7_normalizeFormMethod,!1,K,W),Me=T.location,ue=yl(T.location,re,W&&W.state);ue=Rt({},ue,e.history.encodeLocation(ue));let Ue=W&&W.replace!=null?W.replace:void 0,Ne=Ut.Push;Ue===!0?Ne=Ut.Replace:Ue===!1||ve!=null&&sn(ve.formMethod)&&ve.formAction===T.location.pathname+T.location.search&&(Ne=Ut.Replace);let je=W&&"preventScrollReset"in W?W.preventScrollReset===!0:void 0,dt=(W&&W.unstable_flushSync)===!0,it=xc({currentLocation:Me,nextLocation:ue,historyAction:Ne});if(it){Qo(it,{state:"blocked",location:ue,proceed(){Qo(it,{state:"proceeding",proceed:void 0,reset:void 0,location:ue}),k(U,W)},reset(){let pt=new Map(T.blockers);pt.set(it,ka),Se({blockers:pt})}});return}return await G(Ne,ue,{submission:ve,pendingError:ke,preventScrollReset:je,replace:W&&W.replace,enableViewTransition:W&&W.unstable_viewTransition,flushSync:dt})}function J(){if(Le(),Se({revalidation:"loading"}),T.navigation.state!=="submitting"){if(T.navigation.state==="idle"){G(T.historyAction,T.location,{startUninterruptedRevalidation:!0});return}G(P||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation})}}async function G(U,W,K){j&&j.abort(),j=null,P=U,F=(K&&K.startUninterruptedRevalidation)===!0,bT(T.location,T.matches),O=(K&&K.preventScrollReset)===!0,L=(K&&K.enableViewTransition)===!0;let re=a||i,ve=K&&K.overrideNavigation,ke=xo(re,W,l),Me=(K&&K.flushSync)===!0,ue=Pf(ke,re,W.pathname);if(ue.active&&ue.matches&&(ke=ue.matches),!ke){let{error:st,notFoundMatches:Qt,route:zt}=Jo(W.pathname);Ke(W,{matches:Qt,loaderData:{},errors:{[zt.id]:st}},{flushSync:Me});return}if(T.initialized&&!b&&UN(T.location,W)&&!(K&&K.submission&&sn(K.submission.formMethod))){Ke(W,{matches:ke},{flushSync:Me});return}j=new AbortController;let Ue=si(e.history,W,j.signal,K&&K.submission),Ne;if(K&&K.pendingError)Ne=[ki(ke).route.id,{type:mt.error,error:K.pendingError}];else if(K&&K.submission&&sn(K.submission.formMethod)){let st=await D(Ue,W,K.submission,ke,ue.active,{replace:K.replace,flushSync:Me});if(st.shortCircuited)return;if(st.pendingActionResult){let[Qt,zt]=st.pendingActionResult;if(jr(zt)&&Bd(zt.error)&&zt.error.status===404){j=null,Ke(W,{matches:st.matches,loaderData:{},errors:{[Qt]:zt.error}});return}}ke=st.matches||ke,Ne=st.pendingActionResult,ve=oh(W,K.submission),Me=!1,ue.active=!1,Ue=si(e.history,Ue.url,Ue.signal)}let{shortCircuited:je,matches:dt,loaderData:it,errors:pt}=await S(Ue,W,ke,ue.active,ve,K&&K.submission,K&&K.fetcherSubmission,K&&K.replace,K&&K.initialHydration===!0,Me,Ne);je||(j=null,Ke(W,Rt({matches:dt||ke},o0(Ne),{loaderData:it,errors:pt})))}async function D(U,W,K,re,ve,ke){ke===void 0&&(ke={}),Le();let Me=HN(W,K);if(Se({navigation:Me},{flushSync:ke.flushSync===!0}),ve){let Ne=await _c(re,W.pathname,U.signal);if(Ne.type==="aborted")return{shortCircuited:!0};if(Ne.type==="error"){let{boundaryId:je,error:dt}=_n(W.pathname,Ne);return{matches:Ne.partialMatches,pendingActionResult:[je,{type:mt.error,error:dt}]}}else if(Ne.matches)re=Ne.matches;else{let{notFoundMatches:je,error:dt,route:it}=Jo(W.pathname);return{matches:je,pendingActionResult:[it.id,{type:mt.error,error:dt}]}}}let ue,Ue=Ia(re,W);if(!Ue.route.action&&!Ue.route.lazy)ue={type:mt.error,error:ur(405,{method:U.method,pathname:W.pathname,routeId:Ue.route.id})};else if(ue=(await ee("action",U,[Ue],re))[0],U.signal.aborted)return{shortCircuited:!0};if(Co(ue)){let Ne;return ke&&ke.replace!=null?Ne=ke.replace:Ne=t0(ue.response.headers.get("Location"),new URL(U.url),l)===T.location.pathname+T.location.search,await X(U,ue,{submission:K,replace:Ne}),{shortCircuited:!0}}if(ko(ue))throw ur(400,{type:"defer-action"});if(jr(ue)){let Ne=ki(re,Ue.route.id);return(ke&&ke.replace)!==!0&&(P=Ut.Push),{matches:re,pendingActionResult:[Ne.route.id,ue]}}return{matches:re,pendingActionResult:[Ue.route.id,ue]}}async function S(U,W,K,re,ve,ke,Me,ue,Ue,Ne,je){let dt=ve||oh(W,ke),it=ke||Me||c0(dt),pt=!F&&(!u.v7_partialHydration||!Ue);if(re){if(pt){let Ot=N(je);Se(Rt({navigation:dt},Ot!==void 0?{actionData:Ot}:{}),{flushSync:Ne})}let Be=await _c(K,W.pathname,U.signal);if(Be.type==="aborted")return{shortCircuited:!0};if(Be.type==="error"){let{boundaryId:Ot,error:Tr}=_n(W.pathname,Be);return{matches:Be.partialMatches,loaderData:{},errors:{[Ot]:Tr}}}else if(Be.matches)K=Be.matches;else{let{error:Ot,notFoundMatches:Tr,route:kt}=Jo(W.pathname);return{matches:Tr,loaderData:{},errors:{[kt.id]:Ot}}}}let st=a||i,[Qt,zt]=Qy(e.history,T,K,it,W,u.v7_partialHydration&&Ue===!0,u.v7_skipActionErrorRevalidation,b,V,te,ne,$,z,st,l,je);if(Ts(Be=>!(K&&K.some(Ot=>Ot.route.id===Be))||Qt&&Qt.some(Ot=>Ot.route.id===Be)),I=++Z,Qt.length===0&&zt.length===0){let Be=Wn();return Ke(W,Rt({matches:K,loaderData:{},errors:je&&jr(je[1])?{[je[0]]:je[1].error}:null},o0(je),Be?{fetchers:new Map(T.fetchers)}:{}),{flushSync:Ne}),{shortCircuited:!0}}if(pt){let Be={};if(!re){Be.navigation=dt;let Ot=N(je);Ot!==void 0&&(Be.actionData=Ot)}zt.length>0&&(Be.fetchers=A(zt)),Se(Be,{flushSync:Ne})}zt.forEach(Be=>{B.has(Be.key)&&Je(Be.key),Be.controller&&B.set(Be.key,Be.controller)});let ma=()=>zt.forEach(Be=>Je(Be.key));j&&j.signal.addEventListener("abort",ma);let{loaderResults:Rs,fetcherResults:ei}=await he(T.matches,K,Qt,zt,U);if(U.signal.aborted)return{shortCircuited:!0};j&&j.signal.removeEventListener("abort",ma),zt.forEach(Be=>B.delete(Be.key));let ti=a0([...Rs,...ei]);if(ti){if(ti.idx>=Qt.length){let Be=zt[ti.idx-Qt.length].key;z.add(Be)}return await X(U,ti.result,{replace:ue}),{shortCircuited:!0}}let{loaderData:ri,errors:bn}=n0(T,K,Qt,Rs,je,zt,ei,se);se.forEach((Be,Ot)=>{Be.subscribe(Tr=>{(Tr||Be.done)&&se.delete(Ot)})}),u.v7_partialHydration&&Ue&&T.errors&&Object.entries(T.errors).filter(Be=>{let[Ot]=Be;return!Qt.some(Tr=>Tr.route.id===Ot)}).forEach(Be=>{let[Ot,Tr]=Be;bn=Object.assign(bn||{},{[Ot]:Tr})});let bc=Wn(),Sc=Br(I),kc=bc||Sc||zt.length>0;return Rt({matches:K,loaderData:ri,errors:bn},kc?{fetchers:new Map(T.fetchers)}:{})}function N(U){if(U&&!jr(U[1]))return{[U[0]]:U[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function A(U){return U.forEach(W=>{let K=T.fetchers.get(W.key),re=Ca(void 0,K?K.data:void 0);T.fetchers.set(W.key,re)}),new Map(T.fetchers)}function Y(U,W,K,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.");B.has(U)&&Je(U);let ve=(re&&re.unstable_flushSync)===!0,ke=a||i,Me=xp(T.location,T.matches,l,u.v7_prependBasename,K,u.v7_relativeSplatPath,W,re==null?void 0:re.relative),ue=xo(ke,Me,l),Ue=Pf(ue,ke,Me);if(Ue.active&&Ue.matches&&(ue=Ue.matches),!ue){St(U,W,ur(404,{pathname:Me}),{flushSync:ve});return}let{path:Ne,submission:je,error:dt}=Xy(u.v7_normalizeFormMethod,!0,Me,re);if(dt){St(U,W,dt,{flushSync:ve});return}let it=Ia(ue,Ne);if(O=(re&&re.preventScrollReset)===!0,je&&sn(je.formMethod)){M(U,W,Ne,it,ue,Ue.active,ve,je);return}$.set(U,{routeId:W,path:Ne}),H(U,W,Ne,it,ue,Ue.active,ve,je)}async function M(U,W,K,re,ve,ke,Me,ue){Le(),$.delete(U);function Ue(kt){if(!kt.route.action&&!kt.route.lazy){let Hn=ur(405,{method:ue.formMethod,pathname:K,routeId:W});return St(U,W,Hn,{flushSync:Me}),!0}return!1}if(!ke&&Ue(re))return;let Ne=T.fetchers.get(U);Oe(U,YN(ue,Ne),{flushSync:Me});let je=new AbortController,dt=si(e.history,K,je.signal,ue);if(ke){let kt=await _c(ve,K,dt.signal);if(kt.type==="aborted")return;if(kt.type==="error"){let{error:Hn}=_n(K,kt);St(U,W,Hn,{flushSync:Me});return}else if(kt.matches){if(ve=kt.matches,re=Ia(ve,K),Ue(re))return}else{St(U,W,ur(404,{pathname:K}),{flushSync:Me});return}}B.set(U,je);let it=Z,st=(await ee("action",dt,[re],ve))[0];if(dt.signal.aborted){B.get(U)===je&&B.delete(U);return}if(u.v7_fetcherPersist&&ne.has(U)){if(Co(st)||jr(st)){Oe(U,Ds(void 0));return}}else{if(Co(st))if(B.delete(U),I>it){Oe(U,Ds(void 0));return}else return z.add(U),Oe(U,Ca(ue)),X(dt,st,{fetcherSubmission:ue});if(jr(st)){St(U,W,st.error);return}}if(ko(st))throw ur(400,{type:"defer-action"});let Qt=T.navigation.location||T.location,zt=si(e.history,Qt,je.signal),ma=a||i,Rs=T.navigation.state!=="idle"?xo(ma,T.navigation.location,l):T.matches;He(Rs,"Didn't find any matches after fetcher action");let ei=++Z;Q.set(U,ei);let ti=Ca(ue,st.data);T.fetchers.set(U,ti);let[ri,bn]=Qy(e.history,T,Rs,ue,Qt,!1,u.v7_skipActionErrorRevalidation,b,V,te,ne,$,z,ma,l,[re.route.id,st]);bn.filter(kt=>kt.key!==U).forEach(kt=>{let Hn=kt.key,Lv=T.fetchers.get(Hn),CT=Ca(void 0,Lv?Lv.data:void 0);T.fetchers.set(Hn,CT),B.has(Hn)&&Je(Hn),kt.controller&&B.set(Hn,kt.controller)}),Se({fetchers:new Map(T.fetchers)});let bc=()=>bn.forEach(kt=>Je(kt.key));je.signal.addEventListener("abort",bc);let{loaderResults:Sc,fetcherResults:kc}=await he(T.matches,Rs,ri,bn,zt);if(je.signal.aborted)return;je.signal.removeEventListener("abort",bc),Q.delete(U),B.delete(U),bn.forEach(kt=>B.delete(kt.key));let Be=a0([...Sc,...kc]);if(Be){if(Be.idx>=ri.length){let kt=bn[Be.idx-ri.length].key;z.add(kt)}return X(zt,Be.result)}let{loaderData:Ot,errors:Tr}=n0(T,T.matches,ri,Sc,void 0,bn,kc,se);if(T.fetchers.has(U)){let kt=Ds(st.data);T.fetchers.set(U,kt)}Br(ei),T.navigation.state==="loading"&&ei>I?(He(P,"Expected pending action"),j&&j.abort(),Ke(T.navigation.location,{matches:Rs,loaderData:Ot,errors:Tr,fetchers:new Map(T.fetchers)})):(Se({errors:Tr,loaderData:s0(T.loaderData,Ot,Rs,Tr),fetchers:new Map(T.fetchers)}),b=!1)}async function H(U,W,K,re,ve,ke,Me,ue){let Ue=T.fetchers.get(U);Oe(U,Ca(ue,Ue?Ue.data:void 0),{flushSync:Me});let Ne=new AbortController,je=si(e.history,K,Ne.signal);if(ke){let st=await _c(ve,K,je.signal);if(st.type==="aborted")return;if(st.type==="error"){let{error:Qt}=_n(K,st);St(U,W,Qt,{flushSync:Me});return}else if(st.matches)ve=st.matches,re=Ia(ve,K);else{St(U,W,ur(404,{pathname:K}),{flushSync:Me});return}}B.set(U,Ne);let dt=Z,pt=(await ee("loader",je,[re],ve))[0];if(ko(pt)&&(pt=await V_(pt,je.signal,!0)||pt),B.get(U)===Ne&&B.delete(U),!je.signal.aborted){if(ne.has(U)){Oe(U,Ds(void 0));return}if(Co(pt))if(I>dt){Oe(U,Ds(void 0));return}else{z.add(U),await X(je,pt);return}if(jr(pt)){St(U,W,pt.error);return}He(!ko(pt),"Unhandled fetcher deferred data"),Oe(U,Ds(pt.data))}}async function X(U,W,K){let{submission:re,fetcherSubmission:ve,replace:ke}=K===void 0?{}:K;W.response.headers.has("X-Remix-Revalidate")&&(b=!0);let Me=W.response.headers.get("Location");He(Me,"Expected a Location header on the redirect Response"),Me=t0(Me,new URL(U.url),l);let ue=yl(T.location,Me,{_isRedirect:!0});if(r){let pt=!1;if(W.response.headers.has("X-Remix-Reload-Document"))pt=!0;else if(rg.test(Me)){const st=e.history.createURL(Me);pt=st.origin!==t.location.origin||sa(st.pathname,l)==null}if(pt){ke?t.location.replace(Me):t.location.assign(Me);return}}j=null;let Ue=ke===!0?Ut.Replace:Ut.Push,{formMethod:Ne,formAction:je,formEncType:dt}=T.navigation;!re&&!ve&&Ne&&je&&dt&&(re=c0(T.navigation));let it=re||ve;if(EN.has(W.response.status)&&it&&sn(it.formMethod))await G(Ue,ue,{submission:Rt({},it,{formAction:Me}),preventScrollReset:O});else{let pt=oh(ue,re);await G(Ue,ue,{overrideNavigation:pt,fetcherSubmission:ve,preventScrollReset:O})}}async function ee(U,W,K,re){try{let ve=await MN(c,U,W,K,re,o,s);return await Promise.all(ve.map((ke,Me)=>{if(VN(ke)){let ue=ke.result;return{type:mt.redirect,response:FN(ue,W,K[Me].route.id,re,l,u.v7_relativeSplatPath)}}return LN(ke)}))}catch(ve){return K.map(()=>({type:mt.error,error:ve}))}}async function he(U,W,K,re,ve){let[ke,...Me]=await Promise.all([K.length?ee("loader",ve,K,W):[],...re.map(ue=>{if(ue.matches&&ue.match&&ue.controller){let Ue=si(e.history,ue.path,ue.controller.signal);return ee("loader",Ue,[ue.match],ue.matches).then(Ne=>Ne[0])}else return Promise.resolve({type:mt.error,error:ur(404,{pathname:ue.path})})})]);return await Promise.all([l0(U,K,ke,ke.map(()=>ve.signal),!1,T.loaderData),l0(U,re.map(ue=>ue.match),Me,re.map(ue=>ue.controller?ue.controller.signal:null),!0)]),{loaderResults:ke,fetcherResults:Me}}function Le(){b=!0,V.push(...Ts()),$.forEach((U,W)=>{B.has(W)&&(te.push(W),Je(W))})}function Oe(U,W,K){K===void 0&&(K={}),T.fetchers.set(U,W),Se({fetchers:new Map(T.fetchers)},{flushSync:(K&&K.flushSync)===!0})}function St(U,W,K,re){re===void 0&&(re={});let ve=ki(T.matches,W);Vt(U),Se({errors:{[ve.route.id]:K},fetchers:new Map(T.fetchers)},{flushSync:(re&&re.flushSync)===!0})}function Vr(U){return u.v7_fetcherPersist&&(de.set(U,(de.get(U)||0)+1),ne.has(U)&&ne.delete(U)),T.fetchers.get(U)||TN}function Vt(U){let W=T.fetchers.get(U);B.has(U)&&!(W&&W.state==="loading"&&Q.has(U))&&Je(U),$.delete(U),Q.delete(U),z.delete(U),ne.delete(U),T.fetchers.delete(U)}function Vn(U){if(u.v7_fetcherPersist){let W=(de.get(U)||0)-1;W<=0?(de.delete(U),ne.add(U)):de.set(U,W)}else Vt(U);Se({fetchers:new Map(T.fetchers)})}function Je(U){let W=B.get(U);He(W,"Expected fetch controller: "+U),W.abort(),B.delete(U)}function Bn(U){for(let W of U){let K=Vr(W),re=Ds(K.data);T.fetchers.set(W,re)}}function Wn(){let U=[],W=!1;for(let K of z){let re=T.fetchers.get(K);He(re,"Expected fetcher: "+K),re.state==="loading"&&(z.delete(K),U.push(K),W=!0)}return Bn(U),W}function Br(U){let W=[];for(let[K,re]of Q)if(re0}function yc(U,W){let K=T.blockers.get(U)||ka;return Ee.get(U)!==W&&Ee.set(U,W),K}function wc(U){T.blockers.delete(U),Ee.delete(U)}function Qo(U,W){let K=T.blockers.get(U)||ka;He(K.state==="unblocked"&&W.state==="blocked"||K.state==="blocked"&&W.state==="blocked"||K.state==="blocked"&&W.state==="proceeding"||K.state==="blocked"&&W.state==="unblocked"||K.state==="proceeding"&&W.state==="unblocked","Invalid blocker state transition: "+K.state+" -> "+W.state);let re=new Map(T.blockers);re.set(U,W),Se({blockers:re})}function xc(U){let{currentLocation:W,nextLocation:K,historyAction:re}=U;if(Ee.size===0)return;Ee.size>1&&zo(!1,"A router only supports one blocker at a time");let ve=Array.from(Ee.entries()),[ke,Me]=ve[ve.length-1],ue=T.blockers.get(ke);if(!(ue&&ue.state==="proceeding")&&Me({currentLocation:W,nextLocation:K,historyAction:re}))return ke}function Jo(U){let W=ur(404,{pathname:U}),K=a||i,{matches:re,route:ve}=i0(K);return Ts(),{notFoundMatches:re,route:ve,error:W}}function _n(U,W){return{boundaryId:ki(W.partialMatches).route.id,error:ur(400,{type:"route-discovery",pathname:U,message:W.error!=null&&"message"in W.error?W.error:String(W.error)})}}function Ts(U){let W=[];return se.forEach((K,re)=>{(!U||U(re))&&(K.cancel(),W.push(re),se.delete(re))}),W}function _T(U,W,K){if(y=U,x=W,p=K||null,!g&&T.navigation===sh){g=!0;let re=Iv(T.location,T.matches);re!=null&&Se({restoreScrollPosition:re})}return()=>{y=null,x=null,p=null}}function Mv(U,W){return p&&p(U,W.map(re=>sN(re,T.loaderData)))||U.key}function bT(U,W){if(y&&x){let K=Mv(U,W);y[K]=x()}}function Iv(U,W){if(y){let K=Mv(U,W),re=y[K];if(typeof re=="number")return re}return null}function Pf(U,W,K){if(f)if(U){let re=U[U.length-1].route;if(re.path&&(re.path==="*"||re.path.endsWith("/*")))return{active:!0,matches:mu(W,K,l,!0)}}else return{active:!0,matches:mu(W,K,l,!0)||[]};return{active:!1,matches:null}}async function _c(U,W,K){let re=U,ve=re.length>0?re[re.length-1].route:null;for(;;){let ke=a==null,Me=a||i;try{await ON(f,W,re,Me,o,s,fe,K)}catch(je){return{type:"error",error:je,partialMatches:re}}finally{ke&&(i=[...i])}if(K.aborted)return{type:"aborted"};let ue=xo(Me,W,l),Ue=!1;if(ue){let je=ue[ue.length-1].route;if(je.index)return{type:"success",matches:ue};if(je.path&&je.path.length>0)if(je.path==="*")Ue=!0;else return{type:"success",matches:ue}}let Ne=mu(Me,W,l,!0);if(!Ne||re.map(je=>je.route.id).join("-")===Ne.map(je=>je.route.id).join("-"))return{type:"success",matches:Ue?ue:null};if(re=Ne,ve=re[re.length-1].route,ve.path==="*")return{type:"success",matches:re}}}function ST(U){o={},a=wl(U,s,void 0,o)}function kT(U,W){let K=a==null;z_(U,W,a||i,o,s),K&&(i=[...i],Se({}))}return E={get basename(){return l},get future(){return u},get state(){return T},get routes(){return i},get window(){return t},initialize:be,subscribe:Te,enableScrollRestoration:_T,navigate:k,fetch:Y,revalidate:J,createHref:U=>e.history.createHref(U),encodeLocation:U=>e.history.encodeLocation(U),getFetcher:Vr,deleteFetcher:Vn,dispose:Pe,getBlocker:yc,deleteBlocker:wc,patchRoutes:kT,_internalFetchControllers:B,_internalActiveDeferreds:se,_internalSetRoutes:ST},E}function PN(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function xp(e,t,r,n,s,o,i,a){let l,c;if(i){l=[];for(let u of t)if(l.push(u),u.route.id===i){c=u;break}}else l=t,c=t[t.length-1];let f=Vd(s||".",$d(l,o),sa(e.pathname,r)||e.pathname,a==="path");return s==null&&(f.search=e.search,f.hash=e.hash),(s==null||s===""||s===".")&&c&&c.route.index&&!ng(f.search)&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(f.pathname=f.pathname==="/"?r:is([r,f.pathname])),Uo(f)}function Xy(e,t,r,n){if(!n||!PN(n))return{path:r};if(n.formMethod&&!WN(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=U_(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!sn(i))return s();let h=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((m,y)=>{let[p,x]=y;return""+m+p+"="+x+` +`},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:h}}}else if(n.formEncType==="application/json"){if(!sn(i))return s();try{let h=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:h,text:void 0}}}catch{return s()}}}He(typeof FormData=="function","FormData is not available in this environment");let l,c;if(n.formData)l=_p(n.formData),c=n.formData;else if(n.body instanceof FormData)l=_p(n.body),c=n.body;else if(n.body instanceof URLSearchParams)l=n.body,c=r0(l);else if(n.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(n.body),c=r0(l)}catch{return s()}let f={formMethod:i,formAction:a,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(sn(f.formMethod))return{path:r,submission:f};let u=_s(r);return t&&u.search&&ng(u.search)&&l.append("index",""),u.search="?"+l,{path:Uo(u),submission:f}}function jN(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 Qy(e,t,r,n,s,o,i,a,l,c,f,u,h,m,y,p){let x=p?jr(p[1])?p[1].error:p[1].data:void 0,g=e.createURL(t.location),v=e.createURL(s),_=p&&jr(p[1])?p[0]:void 0,C=_?jN(r,_):r,E=p?p[1].statusCode:void 0,T=i&&E&&E>=400,P=C.filter((j,L)=>{let{route:q}=j;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(DN(t.loaderData,t.matches[L],j)||l.some(b=>b===j.route.id))return!0;let R=t.matches[L],F=j;return Jy(j,Rt({currentUrl:g,currentParams:R.params,nextUrl:v,nextParams:F.params},n,{actionResult:x,actionStatus:E,defaultShouldRevalidate:T?!1:a||g.pathname+g.search===v.pathname+v.search||g.search!==v.search||F_(R,F)}))}),O=[];return u.forEach((j,L)=>{if(o||!r.some(V=>V.route.id===j.routeId)||f.has(L))return;let q=xo(m,j.path,y);if(!q){O.push({key:L,routeId:j.routeId,path:j.path,matches:null,match:null,controller:null});return}let R=t.fetchers.get(L),F=Ia(q,j.path),b=!1;h.has(L)?b=!1:c.includes(L)?b=!0:R&&R.state!=="idle"&&R.data===void 0?b=a:b=Jy(F,Rt({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:v,nextParams:r[r.length-1].params},n,{actionResult:x,actionStatus:E,defaultShouldRevalidate:T?!1:a})),b&&O.push({key:L,routeId:j.routeId,path:j.path,matches:q,match:F,controller:new AbortController})}),[P,O]}function DN(e,t,r){let n=!t||r.route.id!==t.route.id,s=e[r.route.id]===void 0;return n||s}function F_(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Jy(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function ON(e,t,r,n,s,o,i,a){let l=[t,...r.map(c=>c.route.id)].join("-");try{let c=i.get(l);c||(c=e({path:t,matches:r,patch:(f,u)=>{a.aborted||z_(f,u,n,s,o)}}),i.set(l,c)),c&&$N(c)&&await c}finally{i.delete(l)}}function z_(e,t,r,n,s){if(e){var o;let i=n[e];He(i,"No route found to patch children into: routeId = "+e);let a=wl(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=wl(t,s,["patch",String(r.length||"0")],n);r.push(...i)}}async function e0(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let s=r[e.id];He(s,"No route found in manifest");let o={};for(let i in n){let l=s[i]!==void 0&&i!=="hasErrorBoundary";zo(!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&&!rN.has(i)&&(o[i]=n[i])}Object.assign(s,o),Object.assign(s,Rt({},t(s),{lazy:void 0}))}function AN(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function MN(e,t,r,n,s,o,i,a){let l=n.reduce((u,h)=>u.add(h.route.id),new Set),c=new Set,f=await e({matches:s.map(u=>{let h=l.has(u.route.id);return Rt({},u,{shouldLoad:h,resolve:y=>(c.add(u.route.id),h?IN(t,r,u,o,i,y,a):Promise.resolve({type:mt.data,result:void 0}))})}),request:r,params:s[0].params,context:a});return s.forEach(u=>He(c.has(u.route.id),'`match.resolve()` was not called for route id "'+u.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),f.filter((u,h)=>l.has(s[h].route.id))}async function IN(e,t,r,n,s,o,i){let a,l,c=f=>{let u,h=new Promise((p,x)=>u=x);l=()=>u(),t.signal.addEventListener("abort",l);let m=p=>typeof f!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):f({request:t,params:r.params,context:i},...p!==void 0?[p]:[]),y;return o?y=o(p=>m(p)):y=(async()=>{try{return{type:"data",result:await m()}}catch(p){return{type:"error",result:p}}})(),Promise.race([y,h])};try{let f=r.route[e];if(r.route.lazy)if(f){let u,[h]=await Promise.all([c(f).catch(m=>{u=m}),e0(r.route,s,n)]);if(u!==void 0)throw u;a=h}else if(await e0(r.route,s,n),f=r.route[e],f)a=await c(f);else if(e==="action"){let u=new URL(t.url),h=u.pathname+u.search;throw ur(405,{method:t.method,pathname:h,routeId:r.route.id})}else return{type:mt.data,result:void 0};else if(f)a=await c(f);else{let u=new URL(t.url),h=u.pathname+u.search;throw ur(404,{pathname:h})}He(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(f){return{type:mt.error,result:f}}finally{l&&t.signal.removeEventListener("abort",l)}return a}async function LN(e){let{result:t,type:r,status:n}=e;if($_(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:mt.error,error:a}}return r===mt.error?{type:mt.error,error:new tg(t.status,t.statusText,i),statusCode:t.status,headers:t.headers}:{type:mt.data,data:i,statusCode:t.status,headers:t.headers}}if(r===mt.error)return{type:mt.error,error:t,statusCode:Bd(t)?t.status:n};if(BN(t)){var s,o;return{type:mt.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:mt.data,data:t,statusCode:n}}function FN(e,t,r,n,s,o){let i=e.headers.get("Location");if(He(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!rg.test(i)){let a=n.slice(0,n.findIndex(l=>l.route.id===r)+1);i=xp(new URL(t.url),a,s,!0,i,o),e.headers.set("Location",i)}return e}function t0(e,t,r){if(rg.test(e)){let n=e,s=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=sa(s.pathname,r)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}return e}function si(e,t,r,n){let s=e.createURL(U_(t)).toString(),o={signal:r};if(n&&sn(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=_p(n.formData):o.body=n.formData}return new Request(s,o)}function _p(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function r0(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function zN(e,t,r,n,s,o){let i={},a=null,l,c=!1,f={},u=n&&jr(n[1])?n[1].error:void 0;return r.forEach((h,m)=>{let y=t[m].route.id;if(He(!Co(h),"Cannot handle redirect results in processLoaderData"),jr(h)){let p=h.error;u!==void 0&&(p=u,u=void 0),a=a||{};{let x=ki(e,y);a[x.route.id]==null&&(a[x.route.id]=p)}i[y]=void 0,c||(c=!0,l=Bd(h.error)?h.error.status:500),h.headers&&(f[y]=h.headers)}else ko(h)?(s.set(y,h.deferredData),i[y]=h.deferredData.data,h.statusCode!=null&&h.statusCode!==200&&!c&&(l=h.statusCode),h.headers&&(f[y]=h.headers)):(i[y]=h.data,h.statusCode&&h.statusCode!==200&&!c&&(l=h.statusCode),h.headers&&(f[y]=h.headers))}),u!==void 0&&n&&(a={[n[0]]:u},i[n[0]]=void 0),{loaderData:i,errors:a,statusCode:l||200,loaderHeaders:f}}function n0(e,t,r,n,s,o,i,a){let{loaderData:l,errors:c}=zN(t,r,n,s,a);for(let f=0;fn.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function i0(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 tg(e||500,a,new Error(l),!0)}function a0(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Co(r))return{result:r,idx:t}}}function U_(e){let t=typeof e=="string"?_s(e):e;return Uo(Rt({},t,{hash:""}))}function UN(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function $N(e){return typeof e=="object"&&e!=null&&"then"in e}function VN(e){return $_(e.result)&&CN.has(e.result.status)}function ko(e){return e.type===mt.deferred}function jr(e){return e.type===mt.error}function Co(e){return(e&&e.type)===mt.redirect}function BN(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 $_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function WN(e){return kN.has(e.toLowerCase())}function sn(e){return bN.has(e.toLowerCase())}async function l0(e,t,r,n,s,o){for(let i=0;iu.route.id===l.route.id),f=c!=null&&!F_(c,l)&&(o&&o[l.route.id])!==void 0;if(ko(a)&&(s||f)){let u=n[i];He(u,"Expected an AbortSignal for revalidating fetcher deferred result"),await V_(a,u,s).then(h=>{h&&(r[i]=h||r[i])})}}}async function V_(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:mt.data,data:e.deferredData.unwrappedData}}catch(s){return{type:mt.error,error:s}}return{type:mt.data,data:e.deferredData.data}}}function ng(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ia(e,t){let r=typeof t=="string"?_s(t).search:t.search;if(e[e.length-1].route.index&&ng(r||""))return e[e.length-1];let n=M_(e);return n[n.length-1]}function c0(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 oh(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 HN(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 Ca(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 YN(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 Ds(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 ZN(e,t){try{let r=e.sessionStorage.getItem(L_);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 GN(e,t){if(t.size>0){let r={};for(let[n,s]of t)r[n]=[...s];try{e.sessionStorage.setItem(L_,JSON.stringify(r))}catch(n){zo(!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 qu(){return qu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),w.useCallback(function(c,f){if(f===void 0&&(f={}),!a.current)return;if(typeof c=="number"){n.go(c);return}let u=Vd(c,JSON.parse(i),o,f.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:is([t,u.pathname])),(f.replace?n.replace:n.push)(u,f.state,f)},[t,n,i,o,e])}const XN=w.createContext(null);function QN(e){let t=w.useContext(bs).outlet;return t&&w.createElement(XN.Provider,{value:e},t)}function Y_(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=w.useContext(fo),{matches:s}=w.useContext(bs),{pathname:o}=ho(),i=JSON.stringify($d(s,n.v7_relativeSplatPath));return w.useMemo(()=>Vd(e,JSON.parse(i),o,r==="path"),[e,i,o,r])}function JN(e,t,r,n){oa()||He(!1);let{navigator:s}=w.useContext(fo),{matches:o}=w.useContext(bs),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let l=i?i.pathnameBase:"/";i&&i.route;let c=ho(),f;f=c;let u=f.pathname||"/",h=u;if(l!=="/"){let p=l.replace(/^\//,"").split("/");h="/"+u.replace(/^\//,"").split("/").slice(p.length).join("/")}let m=xo(e,{pathname:h});return sP(m&&m.map(p=>Object.assign({},p,{params:Object.assign({},a,p.params),pathname:is([l,s.encodeLocation?s.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?l:is([l,s.encodeLocation?s.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),o,r,n)}function eP(){let e=lP(),t=Bd(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 w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),r?w.createElement("pre",{style:s},r):null,null)}const tP=w.createElement(eP,null);class rP extends w.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?w.createElement(bs.Provider,{value:this.props.routeContext},w.createElement(W_.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function nP(e){let{routeContext:t,match:r,children:n}=e,s=w.useContext(Wd);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),w.createElement(bs.Provider,{value:t},n)}function sP(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 f=i.findIndex(u=>u.route.id&&(a==null?void 0:a[u.route.id])!==void 0);f>=0||He(!1),i=i.slice(0,Math.min(i.length,f+1))}let l=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((f,u,h)=>{let m,y=!1,p=null,x=null;r&&(m=a&&u.route.id?a[u.route.id]:void 0,p=u.route.errorElement||tP,l&&(c<0&&h===0?(uP("route-fallback"),y=!0,x=null):c===h&&(y=!0,x=u.route.hydrateFallbackElement||null)));let g=t.concat(i.slice(0,h+1)),v=()=>{let _;return m?_=p:y?_=x:u.route.Component?_=w.createElement(u.route.Component,null):u.route.element?_=u.route.element:_=f,w.createElement(nP,{match:u,routeContext:{outlet:f,matches:g,isDataRoute:r!=null},children:_})};return r&&(u.route.ErrorBoundary||u.route.errorElement||h===0)?w.createElement(rP,{location:r.location,revalidation:r.revalidation,component:p,error:m,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}var Z_=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Z_||{}),Xu=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}(Xu||{});function oP(e){let t=w.useContext(Wd);return t||He(!1),t}function iP(e){let t=w.useContext(B_);return t||He(!1),t}function aP(e){let t=w.useContext(bs);return t||He(!1),t}function G_(e){let t=aP(),r=t.matches[t.matches.length-1];return r.route.id||He(!1),r.route.id}function lP(){var e;let t=w.useContext(W_),r=iP(Xu.UseRouteError),n=G_(Xu.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function cP(){let{router:e}=oP(Z_.UseNavigateStable),t=G_(Xu.UseNavigateStable),r=w.useRef(!1);return H_(()=>{r.current=!0}),w.useCallback(function(s,o){o===void 0&&(o={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,qu({fromRouteId:t},o)))},[e,t])}const u0={};function uP(e,t,r){u0[e]||(u0[e]=!0)}function K_(e){let{to:t,replace:r,state:n,relative:s}=e;oa()||He(!1);let{future:o,static:i}=w.useContext(fo),{matches:a}=w.useContext(bs),{pathname:l}=ho(),c=po(),f=Vd(t,$d(a,o.v7_relativeSplatPath),l,s==="path"),u=JSON.stringify(f);return w.useEffect(()=>c(JSON.parse(u),{replace:r,state:n,relative:s}),[c,u,s,r,n]),null}function q_(e){return QN(e.context)}function dP(e){let{basename:t="/",children:r=null,location:n,navigationType:s=Ut.Pop,navigator:o,static:i=!1,future:a}=e;oa()&&He(!1);let l=t.replace(/^\/*/,"/"),c=w.useMemo(()=>({basename:l,navigator:o,static:i,future:qu({v7_relativeSplatPath:!1},a)}),[l,a,o,i]);typeof n=="string"&&(n=_s(n));let{pathname:f="/",search:u="",hash:h="",state:m=null,key:y="default"}=n,p=w.useMemo(()=>{let x=sa(f,l);return x==null?null:{location:{pathname:x,search:u,hash:h,state:m,key:y},navigationType:s}},[l,f,u,h,m,y,s]);return p==null?null:w.createElement(fo.Provider,{value:c},w.createElement(sg.Provider,{children:r,value:p}))}new Promise(()=>{});function fP(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:w.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:w.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:w.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 xl(){return xl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[s]=e[s]);return r}function pP(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function mP(e,t){return e.button===0&&(!t||t==="_self")&&!pP(e)}function bp(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 gP(e,t){let r=bp(e);return t&&t.forEach((n,s)=>{r.has(s)||t.getAll(s).forEach(o=>{r.append(s,o)})}),r}const vP=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],yP="6";try{window.__reactRouterVersion=yP}catch{}function wP(e,t){return NN({basename:void 0,future:xl({},void 0,{v7_prependBasename:!0}),history:J2({window:void 0}),hydrationData:xP(),routes:e,mapRouteProperties:fP,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function xP(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=xl({},t,{errors:_P(t.errors)})),t}function _P(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 tg(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 bP=w.createContext({isTransitioning:!1}),SP=w.createContext(new Map),kP="startTransition",d0=Nw[kP],CP="flushSync",f0=Q2[CP];function EP(e){d0?d0(e):e()}function Ea(e){f0?f0(e):e()}class TP{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 RP(e){let{fallbackElement:t,router:r,future:n}=e,[s,o]=w.useState(r.state),[i,a]=w.useState(),[l,c]=w.useState({isTransitioning:!1}),[f,u]=w.useState(),[h,m]=w.useState(),[y,p]=w.useState(),x=w.useRef(new Map),{v7_startTransition:g}=n||{},v=w.useCallback(O=>{g?EP(O):O()},[g]),_=w.useCallback((O,j)=>{let{deletedFetchers:L,unstable_flushSync:q,unstable_viewTransitionOpts:R}=j;L.forEach(b=>x.current.delete(b)),O.fetchers.forEach((b,V)=>{b.data!==void 0&&x.current.set(V,b.data)});let F=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!R||F){q?Ea(()=>o(O)):v(()=>o(O));return}if(q){Ea(()=>{h&&(f&&f.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:R.currentLocation,nextLocation:R.nextLocation})});let b=r.window.document.startViewTransition(()=>{Ea(()=>o(O))});b.finished.finally(()=>{Ea(()=>{u(void 0),m(void 0),a(void 0),c({isTransitioning:!1})})}),Ea(()=>m(b));return}h?(f&&f.resolve(),h.skipTransition(),p({state:O,currentLocation:R.currentLocation,nextLocation:R.nextLocation})):(a(O),c({isTransitioning:!0,flushSync:!1,currentLocation:R.currentLocation,nextLocation:R.nextLocation}))},[r.window,h,f,x,v]);w.useLayoutEffect(()=>r.subscribe(_),[r,_]),w.useEffect(()=>{l.isTransitioning&&!l.flushSync&&u(new TP)},[l]),w.useEffect(()=>{if(f&&i&&r.window){let O=i,j=f.promise,L=r.window.document.startViewTransition(async()=>{v(()=>o(O)),await j});L.finished.finally(()=>{u(void 0),m(void 0),a(void 0),c({isTransitioning:!1})}),m(L)}},[v,i,f,r.window]),w.useEffect(()=>{f&&i&&s.location.key===i.location.key&&f.resolve()},[f,h,s.location,i]),w.useEffect(()=>{!l.isTransitioning&&y&&(a(y.state),c({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),p(void 0))},[l.isTransitioning,y]),w.useEffect(()=>{},[]);let C=w.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:O=>r.navigate(O),push:(O,j,L)=>r.navigate(O,{state:j,preventScrollReset:L==null?void 0:L.preventScrollReset}),replace:(O,j,L)=>r.navigate(O,{replace:!0,state:j,preventScrollReset:L==null?void 0:L.preventScrollReset})}),[r]),E=r.basename||"/",T=w.useMemo(()=>({router:r,navigator:C,static:!1,basename:E}),[r,C,E]),P=w.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return w.createElement(w.Fragment,null,w.createElement(Wd.Provider,{value:T},w.createElement(B_.Provider,{value:s},w.createElement(SP.Provider,{value:x.current},w.createElement(bP.Provider,{value:l},w.createElement(dP,{basename:E,location:s.location,navigationType:s.historyAction,navigator:C,future:P},s.initialized||r.future.v7_partialHydration?w.createElement(NP,{routes:r.routes,future:r.future,state:s}):t))))),null)}const NP=w.memo(PP);function PP(e){let{routes:t,future:r,state:n}=e;return JN(t,void 0,n,r)}const jP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",DP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kn=w.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:o,replace:i,state:a,target:l,to:c,preventScrollReset:f,unstable_viewTransition:u}=t,h=hP(t,vP),{basename:m}=w.useContext(fo),y,p=!1;if(typeof c=="string"&&DP.test(c)&&(y=c,jP))try{let _=new URL(window.location.href),C=c.startsWith("//")?new URL(_.protocol+c):new URL(c),E=sa(C.pathname,m);C.origin===_.origin&&E!=null?c=E+C.search+C.hash:p=!0}catch{}let x=KN(c,{relative:s}),g=OP(c,{replace:i,state:a,target:l,preventScrollReset:f,relative:s,unstable_viewTransition:u});function v(_){n&&n(_),_.defaultPrevented||g(_)}return w.createElement("a",xl({},h,{href:y||x,onClick:p||o?n:v,ref:r,target:l}))});var h0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(h0||(h0={}));var p0;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(p0||(p0={}));function OP(e,t){let{target:r,replace:n,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:a}=t===void 0?{}:t,l=po(),c=ho(),f=Y_(e,{relative:i});return w.useCallback(u=>{if(mP(u,r)){u.preventDefault();let h=n!==void 0?n:Uo(c)===Uo(f);l(e,{replace:h,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:a})}},[c,l,f,n,s,r,e,o,i,a])}function AP(e){let t=w.useRef(bp(e)),r=w.useRef(!1),n=ho(),s=w.useMemo(()=>gP(n.search,r.current?null:t.current),[n.search]),o=po(),i=w.useCallback((a,l)=>{const c=bp(typeof a=="function"?a(s):a);r.current=!0,o("?"+c,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 MP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),X_=(...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 IP={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 LP=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:i,...a},l)=>w.createElement("svg",{ref:l,...IP,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:X_("lucide",s),...a},[...i.map(([c,f])=>w.createElement(c,f)),...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 cr=(e,t)=>{const r=w.forwardRef(({className:n,...s},o)=>w.createElement(LP,{ref:o,iconNode:t,className:X_(`lucide-${MP(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 Q_=cr("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 J_=cr("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 FP=cr("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 zP=cr("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 e1=cr("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 UP=cr("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 t1=cr("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 r1=cr("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 Sp=cr("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 m0=cr("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 $P=cr("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 VP=cr("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 g0=cr("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 v0=cr("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 BP=cr("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 og=cr("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function WP(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Hd(...e){return t=>e.forEach(r=>WP(r,t))}function ze(...e){return w.useCallback(Hd(...e),e)}var hs=w.forwardRef((e,t)=>{const{children:r,...n}=e,s=w.Children.toArray(r),o=s.find(HP);if(o){const i=o.props.children,a=s.map(l=>l===o?w.Children.count(i)>1?w.Children.only(null):w.isValidElement(i)?i.props.children:null:l);return d.jsx(kp,{...n,ref:t,children:w.isValidElement(i)?w.cloneElement(i,void 0,a):null})}return d.jsx(kp,{...n,ref:t,children:r})});hs.displayName="Slot";var kp=w.forwardRef((e,t)=>{const{children:r,...n}=e;if(w.isValidElement(r)){const s=ZP(r);return w.cloneElement(r,{...YP(n,r.props),ref:t?Hd(t,s):s})}return w.Children.count(r)>1?w.Children.only(null):null});kp.displayName="SlotClone";var ig=({children:e})=>d.jsx(d.Fragment,{children:e});function HP(e){return w.isValidElement(e)&&e.type===ig}function YP(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 ZP(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 n1(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,w0=GP,ql=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return w0(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(c=>{const f=r==null?void 0:r[c],u=o==null?void 0:o[c];if(f===null)return null;const h=y0(f)||y0(u);return s[c][h]}),a=r&&Object.entries(r).reduce((c,f)=>{let[u,h]=f;return h===void 0||(c[u]=h),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,f)=>{let{class:u,className:h,...m}=f;return Object.entries(m).every(y=>{let[p,x]=y;return Array.isArray(x)?x.includes({...o,...a}[p]):{...o,...a}[p]===x})?[...c,u,h]:c},[]);return w0(e,i,l,r==null?void 0:r.class,r==null?void 0:r.className)};function s1(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 x0=/^\[(.+)\]$/;function XP(e){if(x0.test(e)){const t=x0.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}}function QP(e){const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return ej(Object.entries(e.classGroups),r).forEach(([o,i])=>{Cp(i,n,o,t)}),n}function Cp(e,t,r,n){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:_0(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(JP(s)){Cp(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,i])=>{Cp(i,_0(t,o),r,n)})})}function _0(e,t){let r=e;return t.split(ag).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r}function JP(e){return e.isThemeGetter}function ej(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 tj(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 i1="!";function rj(e){const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length;function i(a){const l=[];let c=0,f=0,u;for(let x=0;xf?u-f:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:p}}return r?function(l){return r({className:l,parseClassName:i})}:i}function nj(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 sj(e){return{cache:tj(e.cacheSize),parseClassName:rj(e),...qP(e)}}const oj=/\s+/;function ij(e,t){const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(oj).map(i=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:f}=r(i);let u=!!f,h=n(u?c.substring(0,f):c);if(!h){if(!u)return{isTailwindClass:!1,originalClassName:i};if(h=n(c),!h)return{isTailwindClass:!1,originalClassName:i};u=!1}const m=nj(a).join(":");return{isTailwindClass:!0,modifierId:l?m+i1:m,classGroupId:h,originalClassName:i,hasPostfixModifier:u}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=i,f=a+l;return o.has(f)?!1:(o.add(f),s(l,c).forEach(u=>o.add(a+u)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function aj(){let e=0,t,r,n="";for(;eu(f),e());return r=sj(c),n=r.cache.get,s=r.cache.set,o=a,a(l)}function a(l){const c=n(l);if(c)return c;const f=ij(l,r);return s(l,f),f}return function(){return o(aj.apply(null,arguments))}}function vt(e){const t=r=>r[e]||[];return t.isThemeGetter=!0,t}const l1=/^\[(?:([a-z-]+):)?(.+)\]$/i,cj=/^\d+\/\d+$/,uj=new Set(["px","full","screen"]),dj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fj=/\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$/,hj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,pj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Yn(e){return Eo(e)||uj.has(e)||cj.test(e)}function Ps(e){return ia(e,"length",Sj)}function Eo(e){return!!e&&!Number.isNaN(Number(e))}function Bc(e){return ia(e,"number",Eo)}function Ta(e){return!!e&&Number.isInteger(Number(e))}function gj(e){return e.endsWith("%")&&Eo(e.slice(0,-1))}function $e(e){return l1.test(e)}function js(e){return dj.test(e)}const vj=new Set(["length","size","percentage"]);function yj(e){return ia(e,vj,c1)}function wj(e){return ia(e,"position",c1)}const xj=new Set(["image","url"]);function _j(e){return ia(e,xj,Cj)}function bj(e){return ia(e,"",kj)}function Ra(){return!0}function ia(e,t,r){const n=l1.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1}function Sj(e){return fj.test(e)&&!hj.test(e)}function c1(){return!1}function kj(e){return pj.test(e)}function Cj(e){return mj.test(e)}function Ej(){const e=vt("colors"),t=vt("spacing"),r=vt("blur"),n=vt("brightness"),s=vt("borderColor"),o=vt("borderRadius"),i=vt("borderSpacing"),a=vt("borderWidth"),l=vt("contrast"),c=vt("grayscale"),f=vt("hueRotate"),u=vt("invert"),h=vt("gap"),m=vt("gradientColorStops"),y=vt("gradientColorStopPositions"),p=vt("inset"),x=vt("margin"),g=vt("opacity"),v=vt("padding"),_=vt("saturate"),C=vt("scale"),E=vt("sepia"),T=vt("skew"),P=vt("space"),O=vt("translate"),j=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",$e,t],R=()=>[$e,t],F=()=>["",Yn,Ps],b=()=>["auto",Eo,$e],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],te=()=>["solid","dashed","dotted","double","none"],B=()=>["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",$e],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[Eo,Bc],$=()=>[Eo,$e];return{cacheSize:500,separator:":",theme:{colors:[Ra],spacing:[Yn,Ps],blur:["none","",js,$e],brightness:z(),borderColor:[e],borderRadius:["none","","full",js,$e],borderSpacing:R(),borderWidth:F(),contrast:z(),grayscale:I(),hueRotate:$(),invert:I(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[gj,Ps],inset:q(),margin:q(),opacity:z(),padding:R(),saturate:z(),scale:z(),sepia:I(),skew:$(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",$e]}],container:["container"],columns:[{columns:[js]}],"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:[...V(),$e]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ta,$e]}],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",$e]}],grow:[{grow:I()}],shrink:[{shrink:I()}],order:[{order:["first","last","none",Ta,$e]}],"grid-cols":[{"grid-cols":[Ra]}],"col-start-end":[{col:["auto",{span:["full",Ta,$e]},$e]}],"col-start":[{"col-start":b()}],"col-end":[{"col-end":b()}],"grid-rows":[{"grid-rows":[Ra]}],"row-start-end":[{row:["auto",{span:[Ta,$e]},$e]}],"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",$e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$e]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"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:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$e,t]}],"min-w":[{"min-w":[$e,t,"min","max","fit"]}],"max-w":[{"max-w":[$e,t,"none","full","min","max","fit","prose",{screen:[js]},js]}],h:[{h:[$e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",js,Ps]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bc]}],"font-family":[{font:[Ra]}],"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",$e]}],"line-clamp":[{"line-clamp":["none",Eo,Bc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Yn,$e]}],"list-image":[{"list-image":["none",$e]}],"list-style-type":[{list:["none","disc","decimal",$e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Yn,Ps]}],"underline-offset":[{"underline-offset":["auto",Yn,$e]}],"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:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e]}],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",$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),wj]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",yj]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_j]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"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":[g]}],"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":[g]}],"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":[Yn,$e]}],"outline-w":[{outline:[Yn,Ps]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Yn,Ps]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",js,bj]}],"shadow-color":[{shadow:[Ra]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",js,$e]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[u]}],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":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"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",$e]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",$e]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",$e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Ta,$e]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"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",$e]}],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",$e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",$e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Yn,Ps,Bc]}],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 Tj=lj(Ej);function we(...e){return Tj(KP(e))}const lg=ql("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"}}),Lt=w.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const i=n?hs:"button";return d.jsx(i,{className:we(lg({variant:t,size:r,className:e})),ref:o,...s})});Lt.displayName="Button";function le(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 Rj(e,t){const r=w.createContext(t);function n(o){const{children:i,...a}=o,l=w.useMemo(()=>a,Object.values(a));return d.jsx(r.Provider,{value:l,children:i})}function s(o){const i=w.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 Er(e,t=[]){let r=[];function n(o,i){const a=w.createContext(i),l=r.length;r=[...r,i];function c(u){const{scope:h,children:m,...y}=u,p=(h==null?void 0:h[e][l])||a,x=w.useMemo(()=>y,Object.values(y));return d.jsx(p.Provider,{value:x,children:m})}function f(u,h){const m=(h==null?void 0:h[e][l])||a,y=w.useContext(m);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,f]}const s=()=>{const o=r.map(i=>w.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[n,Nj(s,...t)]}function Nj(...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:c})=>{const u=l(o)[`__scope${c}`];return{...a,...u}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function Pt(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function ps({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,s]=Pj({defaultProp:t,onChange:r}),o=e!==void 0,i=o?e:n,a=Pt(r),l=w.useCallback(c=>{if(o){const u=typeof c=="function"?c(e):c;u!==e&&a(u)}else s(c)},[o,e,s,a]);return[i,l]}function Pj({defaultProp:e,onChange:t}){const r=w.useState(e),[n]=r,s=w.useRef(n),o=Pt(t);return w.useEffect(()=>{s.current!==n&&(o(n),s.current=n)},[n,s,o]),r}var jj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],De=jj.reduce((e,t)=>{const r=w.forwardRef((n,s)=>{const{asChild:o,...i}=n,a=o?hs:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(a,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function cg(e,t){e&&xs.flushSync(()=>e.dispatchEvent(t))}function Yd(e){const t=e+"CollectionProvider",[r,n]=Er(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:y,children:p}=m,x=Ze.useRef(null),g=Ze.useRef(new Map).current;return d.jsx(s,{scope:y,itemMap:g,collectionRef:x,children:p})};i.displayName=t;const a=e+"CollectionSlot",l=Ze.forwardRef((m,y)=>{const{scope:p,children:x}=m,g=o(a,p),v=ze(y,g.collectionRef);return d.jsx(hs,{ref:v,children:x})});l.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",u=Ze.forwardRef((m,y)=>{const{scope:p,children:x,...g}=m,v=Ze.useRef(null),_=ze(y,v),C=o(c,p);return Ze.useEffect(()=>(C.itemMap.set(v,{ref:v,...g}),()=>void C.itemMap.delete(v))),d.jsx(hs,{[f]:"",ref:_,children:x})});u.displayName=c;function h(m){const y=o(e+"CollectionConsumer",m);return Ze.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const g=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((C,E)=>g.indexOf(C.ref.current)-g.indexOf(E.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:l,ItemSlot:u},h,n]}var Dj=w.createContext(void 0);function Xl(e){const t=w.useContext(Dj);return e||t||"ltr"}function Oj(e,t=globalThis==null?void 0:globalThis.document){const r=Pt(e);w.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 Aj="DismissableLayer",Ep="dismissableLayer.update",Mj="dismissableLayer.pointerDownOutside",Ij="dismissableLayer.focusOutside",b0,u1=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),aa=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,c=w.useContext(u1),[f,u]=w.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=w.useState({}),y=ze(t,P=>u(P)),p=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=p.indexOf(x),v=f?p.indexOf(f):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,C=v>=g,E=Fj(P=>{const O=P.target,j=[...c.branches].some(L=>L.contains(O));!C||j||(s==null||s(P),i==null||i(P),P.defaultPrevented||a==null||a())},h),T=zj(P=>{const O=P.target;[...c.branches].some(L=>L.contains(O))||(o==null||o(P),i==null||i(P),P.defaultPrevented||a==null||a())},h);return Oj(P=>{v===c.layers.size-1&&(n==null||n(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},h),w.useEffect(()=>{if(f)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(b0=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),S0(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=b0)}},[f,h,r,c]),w.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),S0())},[f,c]),w.useEffect(()=>{const P=()=>m({});return document.addEventListener(Ep,P),()=>document.removeEventListener(Ep,P)},[]),d.jsx(De.div,{...l,ref:y,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:le(e.onFocusCapture,T.onFocusCapture),onBlurCapture:le(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:le(e.onPointerDownCapture,E.onPointerDownCapture)})});aa.displayName=Aj;var Lj="DismissableLayerBranch",d1=w.forwardRef((e,t)=>{const r=w.useContext(u1),n=w.useRef(null),s=ze(t,n);return w.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),d.jsx(De.div,{...e,ref:s})});d1.displayName=Lj;function Fj(e,t=globalThis==null?void 0:globalThis.document){const r=Pt(e),n=w.useRef(!1),s=w.useRef(()=>{});return w.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){f1(Mj,r,c,{discrete:!0})};const c={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 zj(e,t=globalThis==null?void 0:globalThis.document){const r=Pt(e),n=w.useRef(!1);return w.useEffect(()=>{const s=o=>{o.target&&!n.current&&f1(Ij,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 S0(){const e=new CustomEvent(Ep);document.dispatchEvent(e)}function f1(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?cg(s,o):s.dispatchEvent(o)}var Uj=aa,$j=d1,ih=0;function ug(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??k0()),document.body.insertAdjacentElement("beforeend",e[1]??k0()),ih++,()=>{ih===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ih--}},[])}function k0(){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 ah="focusScope.autoFocusOnMount",lh="focusScope.autoFocusOnUnmount",C0={bubbles:!1,cancelable:!0},Vj="FocusScope",Zd=w.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,l]=w.useState(null),c=Pt(s),f=Pt(o),u=w.useRef(null),h=ze(t,p=>l(p)),m=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(n){let p=function(_){if(m.paused||!a)return;const C=_.target;a.contains(C)?u.current=C:Os(u.current,{select:!0})},x=function(_){if(m.paused||!a)return;const C=_.relatedTarget;C!==null&&(a.contains(C)||Os(u.current,{select:!0}))},g=function(_){if(document.activeElement===document.body)for(const E of _)E.removedNodes.length>0&&Os(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",x);const v=new MutationObserver(g);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",x),v.disconnect()}}},[n,a,m.paused]),w.useEffect(()=>{if(a){T0.add(m);const p=document.activeElement;if(!a.contains(p)){const g=new CustomEvent(ah,C0);a.addEventListener(ah,c),a.dispatchEvent(g),g.defaultPrevented||(Bj(Gj(h1(a)),{select:!0}),document.activeElement===p&&Os(a))}return()=>{a.removeEventListener(ah,c),setTimeout(()=>{const g=new CustomEvent(lh,C0);a.addEventListener(lh,f),a.dispatchEvent(g),g.defaultPrevented||Os(p??document.body,{select:!0}),a.removeEventListener(lh,f),T0.remove(m)},0)}}},[a,c,f,m]);const y=w.useCallback(p=>{if(!r&&!n||m.paused)return;const x=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,g=document.activeElement;if(x&&g){const v=p.currentTarget,[_,C]=Wj(v);_&&C?!p.shiftKey&&g===C?(p.preventDefault(),r&&Os(_,{select:!0})):p.shiftKey&&g===_&&(p.preventDefault(),r&&Os(C,{select:!0})):g===v&&p.preventDefault()}},[r,n,m.paused]);return d.jsx(De.div,{tabIndex:-1,...i,ref:h,onKeyDown:y})});Zd.displayName=Vj;function Bj(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Os(n,{select:t}),document.activeElement!==r)return}function Wj(e){const t=h1(e),r=E0(t,e),n=E0(t.reverse(),e);return[r,n]}function h1(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 E0(e,t){for(const r of e)if(!Hj(r,{upTo:t}))return r}function Hj(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 Yj(e){return e instanceof HTMLInputElement&&"select"in e}function Os(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Yj(e)&&t&&e.select()}}var T0=Zj();function Zj(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=R0(e,t),e.unshift(t)},remove(t){var r;e=R0(e,t),(r=e[0])==null||r.resume()}}}function R0(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Gj(e){return e.filter(t=>t.tagName!=="A")}var rr=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},Kj=Nw.useId||(()=>{}),qj=0;function On(e){const[t,r]=w.useState(Kj());return rr(()=>{r(n=>n??String(qj++))},[e]),t?`radix-${t}`:""}const Xj=["top","right","bottom","left"],Nn=Math.min,Dr=Math.max,Qu=Math.round,Wc=Math.floor,to=e=>({x:e,y:e}),Qj={left:"right",right:"left",bottom:"top",top:"bottom"},Jj={start:"end",end:"start"};function Tp(e,t,r){return Dr(e,Nn(t,r))}function ms(e,t){return typeof e=="function"?e(t):e}function gs(e){return e.split("-")[0]}function la(e){return e.split("-")[1]}function dg(e){return e==="x"?"y":"x"}function fg(e){return e==="y"?"height":"width"}function ro(e){return["top","bottom"].includes(gs(e))?"y":"x"}function hg(e){return dg(ro(e))}function eD(e,t,r){r===void 0&&(r=!1);const n=la(e),s=hg(e),o=fg(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Ju(i)),[i,Ju(i)]}function tD(e){const t=Ju(e);return[Rp(e),t,Rp(t)]}function Rp(e){return e.replace(/start|end/g,t=>Jj[t])}function rD(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 nD(e,t,r,n){const s=la(e);let o=rD(gs(e),r==="start",n);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(Rp)))),o}function Ju(e){return e.replace(/left|right|bottom|top/g,t=>Qj[t])}function sD(e){return{top:0,right:0,bottom:0,left:0,...e}}function p1(e){return typeof e!="number"?sD(e):{top:e,right:e,bottom:e,left:e}}function ed(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 N0(e,t,r){let{reference:n,floating:s}=e;const o=ro(t),i=hg(t),a=fg(i),l=gs(t),c=o==="y",f=n.x+n.width/2-s.width/2,u=n.y+n.height/2-s.height/2,h=n[a]/2-s[a]/2;let m;switch(l){case"top":m={x:f,y:n.y-s.height};break;case"bottom":m={x:f,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:u};break;case"left":m={x:n.x-s.width,y:u};break;default:m={x:n.x,y:n.y}}switch(la(t)){case"start":m[i]-=h*(r&&c?-1:1);break;case"end":m[i]+=h*(r&&c?-1:1);break}return m}const oD=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 c=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:f,y:u}=N0(c,n,l),h=n,m={},y=0;for(let p=0;p({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:f=0}=ms(e,t)||{};if(c==null)return{};const u=p1(f),h={x:r,y:n},m=hg(s),y=fg(m),p=await i.getDimensions(c),x=m==="y",g=x?"top":"left",v=x?"bottom":"right",_=x?"clientHeight":"clientWidth",C=o.reference[y]+o.reference[m]-h[m]-o.floating[y],E=h[m]-o.reference[m],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let P=T?T[_]:0;(!P||!await(i.isElement==null?void 0:i.isElement(T)))&&(P=a.floating[_]||o.floating[y]);const O=C/2-E/2,j=P/2-p[y]/2-1,L=Nn(u[g],j),q=Nn(u[v],j),R=L,F=P-p[y]-q,b=P/2-p[y]/2+O,V=Tp(R,b,F),te=!l.arrow&&la(s)!=null&&b!==V&&o.reference[y]/2-(bb<=0)){var q,R;const b=(((q=o.flip)==null?void 0:q.index)||0)+1,V=P[b];if(V)return{data:{index:b,overflows:L},reset:{placement:V}};let te=(R=L.filter(B=>B.overflows[0]<=0).sort((B,Z)=>B.overflows[1]-Z.overflows[1])[0])==null?void 0:R.placement;if(!te)switch(m){case"bestFit":{var F;const B=(F=L.filter(Z=>{if(T){const I=ro(Z.placement);return I===v||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];B&&(te=B);break}case"initialPlacement":te=a;break}if(s!==te)return{reset:{placement:te}}}return{}}}};function P0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function j0(e){return Xj.some(t=>e[t]>=0)}const lD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=ms(e,t);switch(n){case"referenceHidden":{const o=await _l(t,{...s,elementContext:"reference"}),i=P0(o,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:j0(i)}}}case"escaped":{const o=await _l(t,{...s,altBoundary:!0}),i=P0(o,r.floating);return{data:{escapedOffsets:i,escaped:j0(i)}}}default:return{}}}}};async function cD(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=gs(r),a=la(r),l=ro(r)==="y",c=["left","top"].includes(i)?-1:1,f=o&&l?-1:1,u=ms(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:y}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&typeof y=="number"&&(m=a==="end"?y*-1:y),l?{x:m*f,y:h*c}:{x:h*c,y:m*f}}const uD=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 cD(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}}}}},dD=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:x=>{let{x:g,y:v}=x;return{x:g,y:v}}},...l}=ms(e,t),c={x:r,y:n},f=await _l(t,l),u=ro(gs(s)),h=dg(u);let m=c[h],y=c[u];if(o){const x=h==="y"?"top":"left",g=h==="y"?"bottom":"right",v=m+f[x],_=m-f[g];m=Tp(v,m,_)}if(i){const x=u==="y"?"top":"left",g=u==="y"?"bottom":"right",v=y+f[x],_=y-f[g];y=Tp(v,y,_)}const p=a.fn({...t,[h]:m,[u]:y});return{...p,data:{x:p.x-r,y:p.y-n}}}}},fD=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:c=!0}=ms(e,t),f={x:r,y:n},u=ro(s),h=dg(u);let m=f[h],y=f[u];const p=ms(a,t),x=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const _=h==="y"?"height":"width",C=o.reference[h]-o.floating[_]+x.mainAxis,E=o.reference[h]+o.reference[_]-x.mainAxis;mE&&(m=E)}if(c){var g,v;const _=h==="y"?"width":"height",C=["top","left"].includes(gs(s)),E=o.reference[u]-o.floating[_]+(C&&((g=i.offset)==null?void 0:g[u])||0)+(C?0:x.crossAxis),T=o.reference[u]+o.reference[_]+(C?0:((v=i.offset)==null?void 0:v[u])||0)-(C?x.crossAxis:0);yT&&(y=T)}return{[h]:m,[u]:y}}}},hD=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}=ms(e,t),l=await _l(t,a),c=gs(r),f=la(r),u=ro(r)==="y",{width:h,height:m}=n.floating;let y,p;c==="top"||c==="bottom"?(y=c,p=f===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(p=c,y=f==="end"?"top":"bottom");const x=m-l.top-l.bottom,g=h-l.left-l.right,v=Nn(m-l[y],x),_=Nn(h-l[p],g),C=!t.middlewareData.shift;let E=v,T=_;if(u?T=f||C?Nn(_,g):g:E=f||C?Nn(v,x):x,C&&!f){const O=Dr(l.left,0),j=Dr(l.right,0),L=Dr(l.top,0),q=Dr(l.bottom,0);u?T=h-2*(O!==0||j!==0?O+j: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 P=await s.getDimensions(o.floating);return h!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function ca(e){return m1(e)?(e.nodeName||"").toLowerCase():"#document"}function Mr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ss(e){var t;return(t=(m1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function m1(e){return e instanceof Node||e instanceof Mr(e).Node}function pn(e){return e instanceof Element||e instanceof Mr(e).Element}function Mn(e){return e instanceof HTMLElement||e instanceof Mr(e).HTMLElement}function D0(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mr(e).ShadowRoot}function Ql(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=mn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(s)}function pD(e){return["table","td","th"].includes(ca(e))}function Gd(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function pg(e){const t=mg(),r=pn(e)?mn(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 mD(e){let t=no(e);for(;Mn(t)&&!Ki(t);){if(pg(t))return t;if(Gd(t))return null;t=no(t)}return null}function mg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ki(e){return["html","body","#document"].includes(ca(e))}function mn(e){return Mr(e).getComputedStyle(e)}function Kd(e){return pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function no(e){if(ca(e)==="html")return e;const t=e.assignedSlot||e.parentNode||D0(e)&&e.host||Ss(e);return D0(t)?t.host:t}function g1(e){const t=no(e);return Ki(t)?e.ownerDocument?e.ownerDocument.body:e.body:Mn(t)&&Ql(t)?t:g1(t)}function bl(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=g1(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),i=Mr(s);return o?t.concat(i,i.visualViewport||[],Ql(s)?s:[],i.frameElement&&r?bl(i.frameElement):[]):t.concat(s,bl(s,[],r))}function v1(e){const t=mn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Mn(e),o=s?e.offsetWidth:r,i=s?e.offsetHeight:n,a=Qu(r)!==o||Qu(n)!==i;return a&&(r=o,n=i),{width:r,height:n,$:a}}function gg(e){return pn(e)?e:e.contextElement}function Ai(e){const t=gg(e);if(!Mn(t))return to(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=v1(t);let i=(o?Qu(r.width):r.width)/n,a=(o?Qu(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const gD=to(0);function y1(e){const t=Mr(e);return!mg()||!t.visualViewport?gD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vD(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Mr(e)?!1:t}function $o(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=gg(e);let i=to(1);t&&(n?pn(n)&&(i=Ai(n)):i=Ai(e));const a=vD(o,r,n)?y1(o):to(0);let l=(s.left+a.x)/i.x,c=(s.top+a.y)/i.y,f=s.width/i.x,u=s.height/i.y;if(o){const h=Mr(o),m=n&&pn(n)?Mr(n):n;let y=h,p=y.frameElement;for(;p&&n&&m!==y;){const x=Ai(p),g=p.getBoundingClientRect(),v=mn(p),_=g.left+(p.clientLeft+parseFloat(v.paddingLeft))*x.x,C=g.top+(p.clientTop+parseFloat(v.paddingTop))*x.y;l*=x.x,c*=x.y,f*=x.x,u*=x.y,l+=_,c+=C,y=Mr(p),p=y.frameElement}}return ed({width:f,height:u,x:l,y:c})}function yD(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",i=Ss(n),a=t?Gd(t.floating):!1;if(n===i||a&&o)return r;let l={scrollLeft:0,scrollTop:0},c=to(1);const f=to(0),u=Mn(n);if((u||!u&&!o)&&((ca(n)!=="body"||Ql(i))&&(l=Kd(n)),Mn(n))){const h=$o(n);c=Ai(n),f.x=h.x+n.clientLeft,f.y=h.y+n.clientTop}return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+f.x,y:r.y*c.y-l.scrollTop*c.y+f.y}}function wD(e){return Array.from(e.getClientRects())}function w1(e){return $o(Ss(e)).left+Kd(e).scrollLeft}function xD(e){const t=Ss(e),r=Kd(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+w1(e);const a=-r.scrollTop;return mn(n).direction==="rtl"&&(i+=Dr(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:i,y:a}}function _D(e,t){const r=Mr(e),n=Ss(e),s=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,a=0,l=0;if(s){o=s.width,i=s.height;const c=mg();(!c||c&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:i,x:a,y:l}}function bD(e,t){const r=$o(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=Mn(e)?Ai(e):to(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,l=s*o.x,c=n*o.y;return{width:i,height:a,x:l,y:c}}function O0(e,t,r){let n;if(t==="viewport")n=_D(e,r);else if(t==="document")n=xD(Ss(e));else if(pn(t))n=bD(t,r);else{const s=y1(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return ed(n)}function x1(e,t){const r=no(e);return r===t||!pn(r)||Ki(r)?!1:mn(r).position==="fixed"||x1(r,t)}function SD(e,t){const r=t.get(e);if(r)return r;let n=bl(e,[],!1).filter(a=>pn(a)&&ca(a)!=="body"),s=null;const o=mn(e).position==="fixed";let i=o?no(e):e;for(;pn(i)&&!Ki(i);){const a=mn(i),l=pg(i);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Ql(i)&&!l&&x1(e,i))?n=n.filter(f=>f!==i):s=a,i=no(i)}return t.set(e,n),n}function kD(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const i=[...r==="clippingAncestors"?Gd(t)?[]:SD(t,this._c):[].concat(r),n],a=i[0],l=i.reduce((c,f)=>{const u=O0(t,f,s);return c.top=Dr(u.top,c.top),c.right=Nn(u.right,c.right),c.bottom=Nn(u.bottom,c.bottom),c.left=Dr(u.left,c.left),c},O0(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function CD(e){const{width:t,height:r}=v1(e);return{width:t,height:r}}function ED(e,t,r){const n=Mn(t),s=Ss(t),o=r==="fixed",i=$o(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=to(0);if(n||!n&&!o)if((ca(t)!=="body"||Ql(s))&&(a=Kd(t)),n){const u=$o(t,!0,o,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else s&&(l.x=w1(s));const c=i.left+a.scrollLeft-l.x,f=i.top+a.scrollTop-l.y;return{x:c,y:f,width:i.width,height:i.height}}function ch(e){return mn(e).position==="static"}function A0(e,t){return!Mn(e)||mn(e).position==="fixed"?null:t?t(e):e.offsetParent}function _1(e,t){const r=Mr(e);if(Gd(e))return r;if(!Mn(e)){let s=no(e);for(;s&&!Ki(s);){if(pn(s)&&!ch(s))return s;s=no(s)}return r}let n=A0(e,t);for(;n&&pD(n)&&ch(n);)n=A0(n,t);return n&&Ki(n)&&ch(n)&&!pg(n)?r:n||mD(e)||r}const TD=async function(e){const t=this.getOffsetParent||_1,r=this.getDimensions,n=await r(e.floating);return{reference:ED(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function RD(e){return mn(e).direction==="rtl"}const ND={convertOffsetParentRelativeRectToViewportRelativeRect:yD,getDocumentElement:Ss,getClippingRect:kD,getOffsetParent:_1,getElementRects:TD,getClientRects:wD,getDimensions:CD,getScale:Ai,isElement:pn,isRTL:RD};function PD(e,t){let r=null,n;const s=Ss(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:c,top:f,width:u,height:h}=e.getBoundingClientRect();if(a||t(),!u||!h)return;const m=Wc(f),y=Wc(s.clientWidth-(c+u)),p=Wc(s.clientHeight-(f+h)),x=Wc(c),v={rootMargin:-m+"px "+-y+"px "+-p+"px "+-x+"px",threshold:Dr(0,Nn(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,{...v,root:s.ownerDocument})}catch{r=new IntersectionObserver(C,v)}r.observe(e)}return i(!0),o}function jD(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,c=gg(e),f=s||o?[...c?bl(c):[],...bl(t)]:[];f.forEach(g=>{s&&g.addEventListener("scroll",r,{passive:!0}),o&&g.addEventListener("resize",r)});const u=c&&a?PD(c,r):null;let h=-1,m=null;i&&(m=new ResizeObserver(g=>{let[v]=g;v&&v.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(t)})),r()}),c&&!l&&m.observe(c),m.observe(t));let y,p=l?$o(e):null;l&&x();function x(){const g=$o(e);p&&(g.x!==p.x||g.y!==p.y||g.width!==p.width||g.height!==p.height)&&r(),p=g,y=requestAnimationFrame(x)}return r(),()=>{var g;f.forEach(v=>{s&&v.removeEventListener("scroll",r),o&&v.removeEventListener("resize",r)}),u==null||u(),(g=m)==null||g.disconnect(),m=null,l&&cancelAnimationFrame(y)}}const DD=uD,OD=dD,AD=aD,MD=hD,ID=lD,M0=iD,LD=fD,FD=(e,t,r)=>{const n=new Map,s={platform:ND,...r},o={...s.platform,_c:n};return oD(e,t,{...s,platform:o})};var gu=typeof document<"u"?w.useLayoutEffect:w.useEffect;function td(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(!td(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)&&!td(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function b1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function I0(e,t){const r=b1(e);return Math.round(t*r)/r}function L0(e){const t=w.useRef(e);return gu(()=>{t.current=e}),t}function zD(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:c}=e,[f,u]=w.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=w.useState(n);td(h,n)||m(n);const[y,p]=w.useState(null),[x,g]=w.useState(null),v=w.useCallback(B=>{B!==T.current&&(T.current=B,p(B))},[]),_=w.useCallback(B=>{B!==P.current&&(P.current=B,g(B))},[]),C=o||y,E=i||x,T=w.useRef(null),P=w.useRef(null),O=w.useRef(f),j=l!=null,L=L0(l),q=L0(s),R=w.useCallback(()=>{if(!T.current||!P.current)return;const B={placement:t,strategy:r,middleware:h};q.current&&(B.platform=q.current),FD(T.current,P.current,B).then(Z=>{const I={...Z,isPositioned:!0};F.current&&!td(O.current,I)&&(O.current=I,xs.flushSync(()=>{u(I)}))})},[h,t,r,q]);gu(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,u(B=>({...B,isPositioned:!1})))},[c]);const F=w.useRef(!1);gu(()=>(F.current=!0,()=>{F.current=!1}),[]),gu(()=>{if(C&&(T.current=C),E&&(P.current=E),C&&E){if(L.current)return L.current(C,E,R);R()}},[C,E,R,L,j]);const b=w.useMemo(()=>({reference:T,floating:P,setReference:v,setFloating:_}),[v,_]),V=w.useMemo(()=>({reference:C,floating:E}),[C,E]),te=w.useMemo(()=>{const B={position:r,left:0,top:0};if(!V.floating)return B;const Z=I0(V.floating,f.x),I=I0(V.floating,f.y);return a?{...B,transform:"translate("+Z+"px, "+I+"px)",...b1(V.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Z,top:I}},[r,a,V.floating,f.x,f.y]);return w.useMemo(()=>({...f,update:R,refs:b,elements:V,floatingStyles:te}),[f,R,b,V,te])}const UD=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?M0({element:n.current,padding:s}).fn(r):{}:n?M0({element:n,padding:s}).fn(r):{}}}},$D=(e,t)=>({...DD(e),options:[e,t]}),VD=(e,t)=>({...OD(e),options:[e,t]}),BD=(e,t)=>({...LD(e),options:[e,t]}),WD=(e,t)=>({...AD(e),options:[e,t]}),HD=(e,t)=>({...MD(e),options:[e,t]}),YD=(e,t)=>({...ID(e),options:[e,t]}),ZD=(e,t)=>({...UD(e),options:[e,t]});var GD="Arrow",S1=w.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return d.jsx(De.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});S1.displayName=GD;var KD=S1;function vg(e){const[t,r]=w.useState(void 0);return rr(()=>{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,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.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 yg="Popper",[k1,ua]=Er(yg),[qD,C1]=k1(yg),E1=e=>{const{__scopePopper:t,children:r}=e,[n,s]=w.useState(null);return d.jsx(qD,{scope:t,anchor:n,onAnchorChange:s,children:r})};E1.displayName=yg;var T1="PopperAnchor",R1=w.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=C1(T1,r),i=w.useRef(null),a=ze(t,i);return w.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:d.jsx(De.div,{...s,ref:a})});R1.displayName=T1;var wg="PopperContent",[XD,QD]=k1(wg),N1=w.forwardRef((e,t)=>{var fe,ge,be,Pe,Te,Se;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:u="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:y,...p}=e,x=C1(wg,r),[g,v]=w.useState(null),_=ze(t,Ke=>v(Ke)),[C,E]=w.useState(null),T=vg(C),P=(T==null?void 0:T.width)??0,O=(T==null?void 0:T.height)??0,j=n+(o!=="center"?"-"+o:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},q=Array.isArray(c)?c:[c],R=q.length>0,F={padding:L,boundary:q.filter(eO),altBoundary:R},{refs:b,floatingStyles:V,placement:te,isPositioned:B,middlewareData:Z}=zD({strategy:"fixed",placement:j,whileElementsMounted:(...Ke)=>jD(...Ke,{animationFrame:m==="always"}),elements:{reference:x.anchor},middleware:[$D({mainAxis:s+O,alignmentAxis:i}),l&&VD({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?BD():void 0,...F}),l&&WD({...F}),HD({...F,apply:({elements:Ke,rects:k,availableWidth:J,availableHeight:G})=>{const{width:D,height:S}=k.reference,N=Ke.floating.style;N.setProperty("--radix-popper-available-width",`${J}px`),N.setProperty("--radix-popper-available-height",`${G}px`),N.setProperty("--radix-popper-anchor-width",`${D}px`),N.setProperty("--radix-popper-anchor-height",`${S}px`)}}),C&&ZD({element:C,padding:a}),tO({arrowWidth:P,arrowHeight:O}),h&&YD({strategy:"referenceHidden",...F})]}),[I,Q]=D1(te),z=Pt(y);rr(()=>{B&&(z==null||z())},[B,z]);const $=(fe=Z.arrow)==null?void 0:fe.x,de=(ge=Z.arrow)==null?void 0:ge.y,ne=((be=Z.arrow)==null?void 0:be.centerOffset)!==0,[se,Ee]=w.useState();return rr(()=>{g&&Ee(window.getComputedStyle(g).zIndex)},[g]),d.jsx("div",{ref:b.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:B?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(Pe=Z.transformOrigin)==null?void 0:Pe.x,(Te=Z.transformOrigin)==null?void 0:Te.y].join(" "),...((Se=Z.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(XD,{scope:r,placedSide:I,onArrowChange:E,arrowX:$,arrowY:de,shouldHideArrow:ne,children:d.jsx(De.div,{"data-side":I,"data-align":Q,...p,ref:_,style:{...p.style,animation:B?void 0:"none"}})})})});N1.displayName=wg;var P1="PopperArrow",JD={top:"bottom",right:"left",bottom:"top",left:"right"},j1=w.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=QD(P1,n),i=JD[o.placedSide];return d.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:d.jsx(KD,{...s,ref:r,style:{...s.style,display:"block"}})})});j1.displayName=P1;function eO(e){return e!==null}var tO=e=>({name:"transformOrigin",options:e,fn(t){var x,g,v;const{placement:r,rects:n,middlewareData:s}=t,i=((x=s.arrow)==null?void 0:x.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,f]=D1(r),u={start:"0%",center:"50%",end:"100%"}[f],h=(((g=s.arrow)==null?void 0:g.x)??0)+a/2,m=(((v=s.arrow)==null?void 0:v.y)??0)+l/2;let y="",p="";return c==="bottom"?(y=i?u:`${h}px`,p=`${-l}px`):c==="top"?(y=i?u:`${h}px`,p=`${n.floating.height+l}px`):c==="right"?(y=`${-l}px`,p=i?u:`${m}px`):c==="left"&&(y=`${n.floating.width+l}px`,p=i?u:`${m}px`),{data:{x:y,y:p}}}});function D1(e){const[t,r="center"]=e.split("-");return[t,r]}var xg=E1,_g=R1,bg=N1,Sg=j1,rO="Portal",Jl=w.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,o]=w.useState(!1);rr(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?D_.createPortal(d.jsx(De.div,{...n,ref:t}),i):null});Jl.displayName=rO;function nO(e,t){return w.useReducer((r,n)=>t[r][n]??r,e)}var vr=e=>{const{present:t,children:r}=e,n=sO(t),s=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),o=ze(n.ref,oO(s));return typeof r=="function"||n.isPresent?w.cloneElement(s,{ref:o}):null};vr.displayName="Presence";function sO(e){const[t,r]=w.useState(),n=w.useRef({}),s=w.useRef(e),o=w.useRef("none"),i=e?"mounted":"unmounted",[a,l]=nO(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const c=Hc(n.current);o.current=a==="mounted"?c:"none"},[a]),rr(()=>{const c=n.current,f=s.current;if(f!==e){const h=o.current,m=Hc(c);e?l("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(f&&h!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),rr(()=>{if(t){const c=u=>{const m=Hc(n.current).includes(u.animationName);u.target===t&&m&&xs.flushSync(()=>l("ANIMATION_END"))},f=u=>{u.target===t&&(o.current=Hc(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(c=>{c&&(n.current=getComputedStyle(c)),r(c)},[])}}function Hc(e){return(e==null?void 0:e.animationName)||"none"}function oO(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 uh="rovingFocusGroup.onEntryFocus",iO={bubbles:!1,cancelable:!0},qd="RovingFocusGroup",[Np,O1,aO]=Yd(qd),[lO,Xd]=Er(qd,[aO]),[cO,uO]=lO(qd),A1=w.forwardRef((e,t)=>d.jsx(Np.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Np.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(dO,{...e,ref:t})})}));A1.displayName=qd;var dO=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...u}=e,h=w.useRef(null),m=ze(t,h),y=Xl(o),[p=null,x]=ps({prop:i,defaultProp:a,onChange:l}),[g,v]=w.useState(!1),_=Pt(c),C=O1(r),E=w.useRef(!1),[T,P]=w.useState(0);return w.useEffect(()=>{const O=h.current;if(O)return O.addEventListener(uh,_),()=>O.removeEventListener(uh,_)},[_]),d.jsx(cO,{scope:r,orientation:n,dir:y,loop:s,currentTabStopId:p,onItemFocus:w.useCallback(O=>x(O),[x]),onItemShiftTab:w.useCallback(()=>v(!0),[]),onFocusableItemAdd:w.useCallback(()=>P(O=>O+1),[]),onFocusableItemRemove:w.useCallback(()=>P(O=>O-1),[]),children:d.jsx(De.div,{tabIndex:g||T===0?-1:0,"data-orientation":n,...u,ref:m,style:{outline:"none",...e.style},onMouseDown:le(e.onMouseDown,()=>{E.current=!0}),onFocus:le(e.onFocus,O=>{const j=!E.current;if(O.target===O.currentTarget&&j&&!g){const L=new CustomEvent(uh,iO);if(O.currentTarget.dispatchEvent(L),!L.defaultPrevented){const q=C().filter(te=>te.focusable),R=q.find(te=>te.active),F=q.find(te=>te.id===p),V=[R,F,...q].filter(Boolean).map(te=>te.ref.current);L1(V,f)}}E.current=!1}),onBlur:le(e.onBlur,()=>v(!1))})})}),M1="RovingFocusGroupItem",I1=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,...i}=e,a=On(),l=o||a,c=uO(M1,r),f=c.currentTabStopId===l,u=O1(r),{onFocusableItemAdd:h,onFocusableItemRemove:m}=c;return w.useEffect(()=>{if(n)return h(),()=>m()},[n,h,m]),d.jsx(Np.ItemSlot,{scope:r,id:l,focusable:n,active:s,children:d.jsx(De.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:le(e.onMouseDown,y=>{n?c.onItemFocus(l):y.preventDefault()}),onFocus:le(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:le(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const p=pO(y,c.orientation,c.dir);if(p!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let g=u().filter(v=>v.focusable).map(v=>v.ref.current);if(p==="last")g.reverse();else if(p==="prev"||p==="next"){p==="prev"&&g.reverse();const v=g.indexOf(y.currentTarget);g=c.loop?mO(g,v+1):g.slice(v+1)}setTimeout(()=>L1(g))}})})})});I1.displayName=M1;var fO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hO(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function pO(e,t,r){const n=hO(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return fO[n]}function L1(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function mO(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var F1=A1,z1=I1,gO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},oi=new WeakMap,Yc=new WeakMap,Zc={},dh=0,U1=function(e){return e&&(e.host||U1(e.parentNode))},vO=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=U1(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})},yO=function(e,t,r,n){var s=vO(t,Array.isArray(e)?e:[e]);Zc[r]||(Zc[r]=new WeakMap);var o=Zc[r],i=[],a=new Set,l=new Set(s),c=function(u){!u||a.has(u)||(a.add(u),c(u.parentNode))};s.forEach(c);var f=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(h){if(a.has(h))f(h);else try{var m=h.getAttribute(n),y=m!==null&&m!=="false",p=(oi.get(h)||0)+1,x=(o.get(h)||0)+1;oi.set(h,p),o.set(h,x),i.push(h),p===1&&y&&Yc.set(h,!0),x===1&&h.setAttribute(r,"true"),y||h.setAttribute(n,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return f(t),a.clear(),dh++,function(){i.forEach(function(u){var h=oi.get(u)-1,m=o.get(u)-1;oi.set(u,h),o.set(u,m),h||(Yc.has(u)||u.removeAttribute(n),Yc.delete(u)),m||u.removeAttribute(r)}),dh--,dh||(oi=new WeakMap,oi=new WeakMap,Yc=new WeakMap,Zc={})}},kg=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=gO(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),yO(n,s,r,"aria-hidden")):function(){return null}},En=function(){return En=Object.assign||function(t){for(var r,n=1,s=arguments.length;n"u")return MO;var t=IO(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])}},FO=W1(),Mi="data-scroll-locked",zO=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(xO,` { + overflow: hidden `).concat(n,`; + padding-right: `).concat(a,"px ").concat(n,`; + } + body[`).concat(Mi,`] { + 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(vu,` { + right: `).concat(a,"px ").concat(n,`; + } + + .`).concat(yu,` { + margin-right: `).concat(a,"px ").concat(n,`; + } + + .`).concat(vu," .").concat(vu,` { + right: 0 `).concat(n,`; + } + + .`).concat(yu," .").concat(yu,` { + margin-right: 0 `).concat(n,`; + } + + body[`).concat(Mi,`] { + `).concat(_O,": ").concat(a,`px; + } +`)},z0=function(){var e=parseInt(document.body.getAttribute(Mi)||"0",10);return isFinite(e)?e:0},UO=function(){w.useEffect(function(){return document.body.setAttribute(Mi,(z0()+1).toString()),function(){var e=z0()-1;e<=0?document.body.removeAttribute(Mi):document.body.setAttribute(Mi,e.toString())}},[])},$O=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;UO();var o=w.useMemo(function(){return LO(s)},[s]);return w.createElement(FO,{styles:zO(o,!t,s,r?"":"!important")})},Pp=!1;if(typeof window<"u")try{var Gc=Object.defineProperty({},"passive",{get:function(){return Pp=!0,!0}});window.addEventListener("test",Gc,Gc),window.removeEventListener("test",Gc,Gc)}catch{Pp=!1}var ii=Pp?{passive:!1}:!1,VO=function(e){return e.tagName==="TEXTAREA"},H1=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!VO(e)&&r[t]==="visible")},BO=function(e){return H1(e,"overflowY")},WO=function(e){return H1(e,"overflowX")},U0=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=Y1(e,n);if(s){var o=Z1(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},HO=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},YO=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Y1=function(e,t){return e==="v"?BO(t):WO(t)},Z1=function(e,t){return e==="v"?HO(t):YO(t)},ZO=function(e,t){return e==="h"&&t==="rtl"?-1:1},GO=function(e,t,r,n,s){var o=ZO(e,window.getComputedStyle(t).direction),i=o*n,a=r.target,l=t.contains(a),c=!1,f=i>0,u=0,h=0;do{var m=Z1(e,a),y=m[0],p=m[1],x=m[2],g=p-x-o*y;(y||g)&&Y1(e,a)&&(u+=g,h+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&(Math.abs(u)<1||!s)||!f&&(Math.abs(h)<1||!s))&&(c=!0),c},Kc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$0=function(e){return[e.deltaX,e.deltaY]},V0=function(e){return e&&"current"in e?e.current:e},KO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qO=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},XO=0,ai=[];function QO(e){var t=w.useRef([]),r=w.useRef([0,0]),n=w.useRef(),s=w.useState(XO++)[0],o=w.useState(W1)[0],i=w.useRef(e);w.useEffect(function(){i.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var p=wO([e.lockRef.current],(e.shards||[]).map(V0),!0).filter(Boolean);return p.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=w.useCallback(function(p,x){if("touches"in p&&p.touches.length===2)return!i.current.allowPinchZoom;var g=Kc(p),v=r.current,_="deltaX"in p?p.deltaX:v[0]-g[0],C="deltaY"in p?p.deltaY:v[1]-g[1],E,T=p.target,P=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in p&&P==="h"&&T.type==="range")return!1;var O=U0(P,T);if(!O)return!0;if(O?E=P:(E=P==="v"?"h":"v",O=U0(P,T)),!O)return!1;if(!n.current&&"changedTouches"in p&&(_||C)&&(n.current=E),!E)return!0;var j=n.current||E;return GO(j,x,p,j==="h"?_:C,!0)},[]),l=w.useCallback(function(p){var x=p;if(!(!ai.length||ai[ai.length-1]!==o)){var g="deltaY"in x?$0(x):Kc(x),v=t.current.filter(function(E){return E.name===x.type&&(E.target===x.target||x.target===E.shadowParent)&&KO(E.delta,g)})[0];if(v&&v.should){x.cancelable&&x.preventDefault();return}if(!v){var _=(i.current.shards||[]).map(V0).filter(Boolean).filter(function(E){return E.contains(x.target)}),C=_.length>0?a(x,_[0]):!i.current.noIsolation;C&&x.cancelable&&x.preventDefault()}}},[]),c=w.useCallback(function(p,x,g,v){var _={name:p,delta:x,target:g,should:v,shadowParent:JO(g)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),f=w.useCallback(function(p){r.current=Kc(p),n.current=void 0},[]),u=w.useCallback(function(p){c(p.type,$0(p),p.target,a(p,e.lockRef.current))},[]),h=w.useCallback(function(p){c(p.type,Kc(p),p.target,a(p,e.lockRef.current))},[]);w.useEffect(function(){return ai.push(o),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:h}),document.addEventListener("wheel",l,ii),document.addEventListener("touchmove",l,ii),document.addEventListener("touchstart",f,ii),function(){ai=ai.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,ii),document.removeEventListener("touchmove",l,ii),document.removeEventListener("touchstart",f,ii)}},[]);var m=e.removeScrollBar,y=e.inert;return w.createElement(w.Fragment,null,y?w.createElement(o,{styles:qO(s)}):null,m?w.createElement($O,{gapMode:e.gapMode}):null)}function JO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const eA=RO(B1,QO);var Jd=w.forwardRef(function(e,t){return w.createElement(Qd,En({},e,{ref:t,sideCar:eA}))});Jd.classNames=Qd.classNames;var jp=["Enter"," "],tA=["ArrowDown","PageUp","Home"],G1=["ArrowUp","PageDown","End"],rA=[...tA,...G1],nA={ltr:[...jp,"ArrowRight"],rtl:[...jp,"ArrowLeft"]},sA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ec="Menu",[Sl,oA,iA]=Yd(ec),[Go,K1]=Er(ec,[iA,ua,Xd]),ef=ua(),q1=Xd(),[aA,Ko]=Go(ec),[lA,tc]=Go(ec),X1=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:o,modal:i=!0}=e,a=ef(t),[l,c]=w.useState(null),f=w.useRef(!1),u=Pt(o),h=Xl(s);return w.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),d.jsx(xg,{...a,children:d.jsx(aA,{scope:t,open:r,onOpenChange:u,content:l,onContentChange:c,children:d.jsx(lA,{scope:t,onClose:w.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:f,dir:h,modal:i,children:n})})})};X1.displayName=ec;var cA="MenuAnchor",Cg=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=ef(r);return d.jsx(_g,{...s,...n,ref:t})});Cg.displayName=cA;var Eg="MenuPortal",[uA,Q1]=Go(Eg,{forceMount:void 0}),J1=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,o=Ko(Eg,t);return d.jsx(uA,{scope:t,forceMount:r,children:d.jsx(vr,{present:r||o.open,children:d.jsx(Jl,{asChild:!0,container:s,children:n})})})};J1.displayName=Eg;var Kr="MenuContent",[dA,Tg]=Go(Kr),eb=w.forwardRef((e,t)=>{const r=Q1(Kr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Ko(Kr,e.__scopeMenu),i=tc(Kr,e.__scopeMenu);return d.jsx(Sl.Provider,{scope:e.__scopeMenu,children:d.jsx(vr,{present:n||o.open,children:d.jsx(Sl.Slot,{scope:e.__scopeMenu,children:i.modal?d.jsx(fA,{...s,ref:t}):d.jsx(hA,{...s,ref:t})})})})}),fA=w.forwardRef((e,t)=>{const r=Ko(Kr,e.__scopeMenu),n=w.useRef(null),s=ze(t,n);return w.useEffect(()=>{const o=n.current;if(o)return kg(o)},[]),d.jsx(Rg,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:le(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),hA=w.forwardRef((e,t)=>{const r=Ko(Kr,e.__scopeMenu);return d.jsx(Rg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Rg=w.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:h,onDismiss:m,disableOutsideScroll:y,...p}=e,x=Ko(Kr,r),g=tc(Kr,r),v=ef(r),_=q1(r),C=oA(r),[E,T]=w.useState(null),P=w.useRef(null),O=ze(t,P,x.onContentChange),j=w.useRef(0),L=w.useRef(""),q=w.useRef(0),R=w.useRef(null),F=w.useRef("right"),b=w.useRef(0),V=y?Jd:w.Fragment,te=y?{as:hs,allowPinchZoom:!0}:void 0,B=I=>{var fe,ge;const Q=L.current+I,z=C().filter(be=>!be.disabled),$=document.activeElement,de=(fe=z.find(be=>be.ref.current===$))==null?void 0:fe.textValue,ne=z.map(be=>be.textValue),se=CA(ne,Q,de),Ee=(ge=z.find(be=>be.textValue===se))==null?void 0:ge.ref.current;(function be(Pe){L.current=Pe,window.clearTimeout(j.current),Pe!==""&&(j.current=window.setTimeout(()=>be(""),1e3))})(Q),Ee&&setTimeout(()=>Ee.focus())};w.useEffect(()=>()=>window.clearTimeout(j.current),[]),ug();const Z=w.useCallback(I=>{var z,$;return F.current===((z=R.current)==null?void 0:z.side)&&TA(I,($=R.current)==null?void 0:$.area)},[]);return d.jsx(dA,{scope:r,searchRef:L,onItemEnter:w.useCallback(I=>{Z(I)&&I.preventDefault()},[Z]),onItemLeave:w.useCallback(I=>{var Q;Z(I)||((Q=P.current)==null||Q.focus(),T(null))},[Z]),onTriggerLeave:w.useCallback(I=>{Z(I)&&I.preventDefault()},[Z]),pointerGraceTimerRef:q,onPointerGraceIntentChange:w.useCallback(I=>{R.current=I},[]),children:d.jsx(V,{...te,children:d.jsx(Zd,{asChild:!0,trapped:s,onMountAutoFocus:le(o,I=>{var Q;I.preventDefault(),(Q=P.current)==null||Q.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:d.jsx(aa,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:h,onDismiss:m,children:d.jsx(F1,{asChild:!0,..._,dir:g.dir,orientation:"vertical",loop:n,currentTabStopId:E,onCurrentTabStopIdChange:T,onEntryFocus:le(l,I=>{g.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(bg,{role:"menu","aria-orientation":"vertical","data-state":gb(x.open),"data-radix-menu-content":"",dir:g.dir,...v,...p,ref:O,style:{outline:"none",...p.style},onKeyDown:le(p.onKeyDown,I=>{const z=I.target.closest("[data-radix-menu-content]")===I.currentTarget,$=I.ctrlKey||I.altKey||I.metaKey,de=I.key.length===1;z&&(I.key==="Tab"&&I.preventDefault(),!$&&de&&B(I.key));const ne=P.current;if(I.target!==ne||!rA.includes(I.key))return;I.preventDefault();const Ee=C().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);G1.includes(I.key)&&Ee.reverse(),SA(Ee)}),onBlur:le(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(j.current),L.current="")}),onPointerMove:le(e.onPointerMove,kl(I=>{const Q=I.target,z=b.current!==I.clientX;if(I.currentTarget.contains(Q)&&z){const $=I.clientX>b.current?"right":"left";F.current=$,b.current=I.clientX}}))})})})})})})});eb.displayName=Kr;var pA="MenuGroup",Ng=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return d.jsx(De.div,{role:"group",...n,ref:t})});Ng.displayName=pA;var mA="MenuLabel",tb=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return d.jsx(De.div,{...n,ref:t})});tb.displayName=mA;var rd="MenuItem",B0="menu.itemSelect",tf=w.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,o=w.useRef(null),i=tc(rd,e.__scopeMenu),a=Tg(rd,e.__scopeMenu),l=ze(t,o),c=w.useRef(!1),f=()=>{const u=o.current;if(!r&&u){const h=new CustomEvent(B0,{bubbles:!0,cancelable:!0});u.addEventListener(B0,m=>n==null?void 0:n(m),{once:!0}),cg(u,h),h.defaultPrevented?c.current=!1:i.onClose()}};return d.jsx(rb,{...s,ref:l,disabled:r,onClick:le(e.onClick,f),onPointerDown:u=>{var h;(h=e.onPointerDown)==null||h.call(e,u),c.current=!0},onPointerUp:le(e.onPointerUp,u=>{var h;c.current||(h=u.currentTarget)==null||h.click()}),onKeyDown:le(e.onKeyDown,u=>{const h=a.searchRef.current!=="";r||h&&u.key===" "||jp.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});tf.displayName=rd;var rb=w.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...o}=e,i=Tg(rd,r),a=q1(r),l=w.useRef(null),c=ze(t,l),[f,u]=w.useState(!1),[h,m]=w.useState("");return w.useEffect(()=>{const y=l.current;y&&m((y.textContent??"").trim())},[o.children]),d.jsx(Sl.ItemSlot,{scope:r,disabled:n,textValue:s??h,children:d.jsx(z1,{asChild:!0,...a,focusable:!n,children:d.jsx(De.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:c,onPointerMove:le(e.onPointerMove,kl(y=>{n?i.onItemLeave(y):(i.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:le(e.onPointerLeave,kl(y=>i.onItemLeave(y))),onFocus:le(e.onFocus,()=>u(!0)),onBlur:le(e.onBlur,()=>u(!1))})})})}),gA="MenuCheckboxItem",nb=w.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return d.jsx(lb,{scope:e.__scopeMenu,checked:r,children:d.jsx(tf,{role:"menuitemcheckbox","aria-checked":nd(r)?"mixed":r,...s,ref:t,"data-state":jg(r),onSelect:le(s.onSelect,()=>n==null?void 0:n(nd(r)?!0:!r),{checkForDefaultPrevented:!1})})})});nb.displayName=gA;var sb="MenuRadioGroup",[vA,yA]=Go(sb,{value:void 0,onValueChange:()=>{}}),ob=w.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,o=Pt(n);return d.jsx(vA,{scope:e.__scopeMenu,value:r,onValueChange:o,children:d.jsx(Ng,{...s,ref:t})})});ob.displayName=sb;var ib="MenuRadioItem",ab=w.forwardRef((e,t)=>{const{value:r,...n}=e,s=yA(ib,e.__scopeMenu),o=r===s.value;return d.jsx(lb,{scope:e.__scopeMenu,checked:o,children:d.jsx(tf,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":jg(o),onSelect:le(n.onSelect,()=>{var i;return(i=s.onValueChange)==null?void 0:i.call(s,r)},{checkForDefaultPrevented:!1})})})});ab.displayName=ib;var Pg="MenuItemIndicator",[lb,wA]=Go(Pg,{checked:!1}),cb=w.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,o=wA(Pg,r);return d.jsx(vr,{present:n||nd(o.checked)||o.checked===!0,children:d.jsx(De.span,{...s,ref:t,"data-state":jg(o.checked)})})});cb.displayName=Pg;var xA="MenuSeparator",ub=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return d.jsx(De.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});ub.displayName=xA;var _A="MenuArrow",db=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=ef(r);return d.jsx(Sg,{...s,...n,ref:t})});db.displayName=_A;var bA="MenuSub",[uU,fb]=Go(bA),La="MenuSubTrigger",hb=w.forwardRef((e,t)=>{const r=Ko(La,e.__scopeMenu),n=tc(La,e.__scopeMenu),s=fb(La,e.__scopeMenu),o=Tg(La,e.__scopeMenu),i=w.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},f=w.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return w.useEffect(()=>f,[f]),w.useEffect(()=>{const u=a.current;return()=>{window.clearTimeout(u),l(null)}},[a,l]),d.jsx(Cg,{asChild:!0,...c,children:d.jsx(rb,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":gb(r.open),...e,ref:Hd(t,s.onTriggerChange),onClick:u=>{var h;(h=e.onClick)==null||h.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:le(e.onPointerMove,kl(u=>{o.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:le(e.onPointerLeave,kl(u=>{var m,y;f();const h=(m=r.content)==null?void 0:m.getBoundingClientRect();if(h){const p=(y=r.content)==null?void 0:y.dataset.side,x=p==="right",g=x?-5:5,v=h[x?"left":"right"],_=h[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:u.clientX+g,y:u.clientY},{x:v,y:h.top},{x:_,y:h.top},{x:_,y:h.bottom},{x:v,y:h.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(u),u.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:le(e.onKeyDown,u=>{var m;const h=o.searchRef.current!=="";e.disabled||h&&u.key===" "||nA[n.dir].includes(u.key)&&(r.onOpenChange(!0),(m=r.content)==null||m.focus(),u.preventDefault())})})})});hb.displayName=La;var pb="MenuSubContent",mb=w.forwardRef((e,t)=>{const r=Q1(Kr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Ko(Kr,e.__scopeMenu),i=tc(Kr,e.__scopeMenu),a=fb(pb,e.__scopeMenu),l=w.useRef(null),c=ze(t,l);return d.jsx(Sl.Provider,{scope:e.__scopeMenu,children:d.jsx(vr,{present:n||o.open,children:d.jsx(Sl.Slot,{scope:e.__scopeMenu,children:d.jsx(Rg,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var u;i.isUsingKeyboardRef.current&&((u=l.current)==null||u.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:le(e.onFocusOutside,f=>{f.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:le(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:le(e.onKeyDown,f=>{var m;const u=f.currentTarget.contains(f.target),h=sA[i.dir].includes(f.key);u&&h&&(o.onOpenChange(!1),(m=a.trigger)==null||m.focus(),f.preventDefault())})})})})})});mb.displayName=pb;function gb(e){return e?"open":"closed"}function nd(e){return e==="indeterminate"}function jg(e){return nd(e)?"indeterminate":e?"checked":"unchecked"}function SA(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function kA(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function CA(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=kA(e,Math.max(o,0));s.length===1&&(i=i.filter(c=>c!==r));const l=i.find(c=>c.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function EA(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;on!=f>n&&r<(c-a)*(n-l)/(f-l)+a&&(s=!s)}return s}function TA(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return EA(r,t)}function kl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var RA=X1,NA=Cg,PA=J1,jA=eb,DA=Ng,OA=tb,AA=tf,MA=nb,IA=ob,LA=ab,FA=cb,zA=ub,UA=db,$A=hb,VA=mb,Dg="DropdownMenu",[BA,dU]=Er(Dg,[K1]),yr=K1(),[WA,vb]=BA(Dg),yb=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,l=yr(t),c=w.useRef(null),[f=!1,u]=ps({prop:s,defaultProp:o,onChange:i});return d.jsx(WA,{scope:t,triggerId:On(),triggerRef:c,contentId:On(),open:f,onOpenChange:u,onOpenToggle:w.useCallback(()=>u(h=>!h),[u]),modal:a,children:d.jsx(RA,{...l,open:f,onOpenChange:u,dir:n,modal:a,children:r})})};yb.displayName=Dg;var wb="DropdownMenuTrigger",xb=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,o=vb(wb,r),i=yr(r);return d.jsx(NA,{asChild:!0,...i,children:d.jsx(De.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:Hd(t,o.triggerRef),onPointerDown:le(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:le(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});xb.displayName=wb;var HA="DropdownMenuPortal",_b=e=>{const{__scopeDropdownMenu:t,...r}=e,n=yr(t);return d.jsx(PA,{...n,...r})};_b.displayName=HA;var bb="DropdownMenuContent",Sb=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vb(bb,r),o=yr(r),i=w.useRef(!1);return d.jsx(jA,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...n,ref:t,onCloseAutoFocus:le(e.onCloseAutoFocus,a=>{var l;i.current||(l=s.triggerRef.current)==null||l.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:le(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,f=l.button===2||c;(!s.modal||f)&&(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)"}})});Sb.displayName=bb;var YA="DropdownMenuGroup",ZA=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return d.jsx(DA,{...s,...n,ref:t})});ZA.displayName=YA;var GA="DropdownMenuLabel",kb=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return d.jsx(OA,{...s,...n,ref:t})});kb.displayName=GA;var KA="DropdownMenuItem",Cb=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return d.jsx(AA,{...s,...n,ref:t})});Cb.displayName=KA;var qA="DropdownMenuCheckboxItem",Eb=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return d.jsx(MA,{...s,...n,ref:t})});Eb.displayName=qA;var XA="DropdownMenuRadioGroup",QA=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return d.jsx(IA,{...s,...n,ref:t})});QA.displayName=XA;var JA="DropdownMenuRadioItem",Tb=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return d.jsx(LA,{...s,...n,ref:t})});Tb.displayName=JA;var eM="DropdownMenuItemIndicator",Rb=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return d.jsx(FA,{...s,...n,ref:t})});Rb.displayName=eM;var tM="DropdownMenuSeparator",Nb=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return d.jsx(zA,{...s,...n,ref:t})});Nb.displayName=tM;var rM="DropdownMenuArrow",nM=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return d.jsx(UA,{...s,...n,ref:t})});nM.displayName=rM;var sM="DropdownMenuSubTrigger",Pb=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return d.jsx($A,{...s,...n,ref:t})});Pb.displayName=sM;var oM="DropdownMenuSubContent",jb=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=yr(r);return d.jsx(VA,{...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)"}})});jb.displayName=oM;var iM=yb,aM=xb,lM=_b,Db=Sb,Ob=kb,Ab=Cb,Mb=Eb,Ib=Tb,Lb=Rb,Fb=Nb,zb=Pb,Ub=jb;const cM=iM,uM=aM,dM=w.forwardRef(({className:e,inset:t,children:r,...n},s)=>d.jsxs(zb,{ref:s,className:we("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,d.jsx(FP,{className:"ml-auto h-4 w-4"})]}));dM.displayName=zb.displayName;const fM=w.forwardRef(({className:e,...t},r)=>d.jsx(Ub,{ref:r,className:we("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}));fM.displayName=Ub.displayName;const $b=w.forwardRef(({className:e,sideOffset:t=4,...r},n)=>d.jsx(lM,{children:d.jsx(Db,{ref:n,sideOffset:t,className:we("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})}));$b.displayName=Db.displayName;const Vb=w.forwardRef(({className:e,inset:t,...r},n)=>d.jsx(Ab,{ref:n,className:we("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}));Vb.displayName=Ab.displayName;const hM=w.forwardRef(({className:e,children:t,checked:r,...n},s)=>d.jsxs(Mb,{ref:s,className:we("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:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(Lb,{children:d.jsx(Q_,{className:"h-4 w-4"})})}),t]}));hM.displayName=Mb.displayName;const pM=w.forwardRef(({className:e,children:t,...r},n)=>d.jsxs(Ib,{ref:n,className:we("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:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(Lb,{children:d.jsx(r1,{className:"h-2 w-2 fill-current"})})}),t]}));pM.displayName=Ib.displayName;const Bb=w.forwardRef(({className:e,inset:t,...r},n)=>d.jsx(Ob,{ref:n,className:we("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Bb.displayName=Ob.displayName;const Wb=w.forwardRef(({className:e,...t},r)=>d.jsx(Fb,{ref:r,className:we("-mx-1 my-1 h-px bg-muted",e),...t}));Wb.displayName=Fb.displayName;var Og="Dialog",[Hb,Yb]=Er(Og),[mM,wn]=Hb(Og),Zb=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=w.useRef(null),l=w.useRef(null),[c=!1,f]=ps({prop:n,defaultProp:s,onChange:o});return d.jsx(mM,{scope:t,triggerRef:a,contentRef:l,contentId:On(),titleId:On(),descriptionId:On(),open:c,onOpenChange:f,onOpenToggle:w.useCallback(()=>f(u=>!u),[f]),modal:i,children:r})};Zb.displayName=Og;var Gb="DialogTrigger",Kb=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=wn(Gb,r),o=ze(t,s.triggerRef);return d.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Ig(s.open),...n,ref:o,onClick:le(e.onClick,s.onOpenToggle)})});Kb.displayName=Gb;var Ag="DialogPortal",[gM,qb]=Hb(Ag,{forceMount:void 0}),Xb=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=wn(Ag,t);return d.jsx(gM,{scope:t,forceMount:r,children:w.Children.map(n,i=>d.jsx(vr,{present:r||o.open,children:d.jsx(Jl,{asChild:!0,container:s,children:i})}))})};Xb.displayName=Ag;var sd="DialogOverlay",Qb=w.forwardRef((e,t)=>{const r=qb(sd,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=wn(sd,e.__scopeDialog);return o.modal?d.jsx(vr,{present:n||o.open,children:d.jsx(vM,{...s,ref:t})}):null});Qb.displayName=sd;var vM=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=wn(sd,r);return d.jsx(Jd,{as:hs,allowPinchZoom:!0,shards:[s.contentRef],children:d.jsx(De.div,{"data-state":Ig(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Vo="DialogContent",Jb=w.forwardRef((e,t)=>{const r=qb(Vo,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=wn(Vo,e.__scopeDialog);return d.jsx(vr,{present:n||o.open,children:o.modal?d.jsx(yM,{...s,ref:t}):d.jsx(wM,{...s,ref:t})})});Jb.displayName=Vo;var yM=w.forwardRef((e,t)=>{const r=wn(Vo,e.__scopeDialog),n=w.useRef(null),s=ze(t,r.contentRef,n);return w.useEffect(()=>{const o=n.current;if(o)return kg(o)},[]),d.jsx(eS,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:le(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:le(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:le(e.onFocusOutside,o=>o.preventDefault())})}),wM=w.forwardRef((e,t)=>{const r=wn(Vo,e.__scopeDialog),n=w.useRef(!1),s=w.useRef(!1);return d.jsx(eS,{...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,c;(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;((c=r.triggerRef.current)==null?void 0:c.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),eS=w.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=wn(Vo,r),l=w.useRef(null),c=ze(t,l);return ug(),d.jsxs(d.Fragment,{children:[d.jsx(Zd,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:d.jsx(aa,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Ig(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(_M,{titleId:a.titleId}),d.jsx(SM,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Mg="DialogTitle",tS=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=wn(Mg,r);return d.jsx(De.h2,{id:s.titleId,...n,ref:t})});tS.displayName=Mg;var rS="DialogDescription",nS=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=wn(rS,r);return d.jsx(De.p,{id:s.descriptionId,...n,ref:t})});nS.displayName=rS;var sS="DialogClose",oS=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=wn(sS,r);return d.jsx(De.button,{type:"button",...n,ref:t,onClick:le(e.onClick,()=>s.onOpenChange(!1))})});oS.displayName=sS;function Ig(e){return e?"open":"closed"}var iS="DialogTitleWarning",[xM,aS]=Rj(iS,{contentName:Vo,titleName:Mg,docsSlug:"dialog"}),_M=({titleId:e})=>{const t=aS(iS),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 w.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},bM="DialogDescriptionWarning",SM=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${aS(bM).contentName}}.`;return w.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},Lg=Zb,Fg=Kb,zg=Xb,rc=Qb,nc=Jb,sc=tS,oc=nS,rf=oS;const lS=Lg,cS=Fg,kM=zg,uS=w.forwardRef(({className:e,...t},r)=>d.jsx(rc,{className:we("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}));uS.displayName=rc.displayName;const CM=ql("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"}}),Ug=w.forwardRef(({side:e="right",className:t,children:r,...n},s)=>d.jsxs(kM,{children:[d.jsx(uS,{}),d.jsxs(nc,{ref:s,className:we(CM({side:e}),t),...n,children:[r,d.jsxs(rf,{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:[d.jsx(og,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ug.displayName=nc.displayName;const dS=({className:e,...t})=>d.jsx("div",{className:we("flex flex-col space-y-2 text-center sm:text-left",e),...t});dS.displayName="SheetHeader";const fS=w.forwardRef(({className:e,...t},r)=>d.jsx(sc,{ref:r,className:we("text-lg font-semibold text-foreground",e),...t}));fS.displayName=sc.displayName;const EM=w.forwardRef(({className:e,...t},r)=>d.jsx(oc,{ref:r,className:we("text-sm text-muted-foreground",e),...t}));EM.displayName=oc.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 qc=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function TM(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))}hS=typeof atob!="function"||PM?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 H0="pb_auth";class jM{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!pS(this.token)}get isAdmin(){return Ii(this.token).type==="admin"}get isAuthRecord(){return Ii(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=H0){const n=TM(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=H0){var l,c;const n={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=Ii(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=W0(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:(c=o==null?void 0:o.model)==null?void 0:c.email};const f=["collectionId","username","verified"];for(const u in this.model)f.includes(u)&&(o.model[u]=this.model[u]);i=W0(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 DM extends jM{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 qo{constructor(t){this.client=t}}class OM extends qo{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 $g extends qo{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 Rr(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 mh(e){var t;(t=e._resetAutoRefresh)==null||t.call(e)}class AM extends $g{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=Rr("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||mh(this.client);let a=await this.client.send(this.baseCrudPath+"/auth-with-password",o);return a=this.authResponse(a),i&&function(c,f,u,h){mh(c);const m=c.beforeSend,y=c.authStore.model,p=c.authStore.onChange((x,g)=>{(!x||(g==null?void 0:g.id)!=(y==null?void 0:y.id)||(g!=null&&g.collectionId||y!=null&&y.collectionId)&&(g==null?void 0:g.collectionId)!=(y==null?void 0:y.collectionId))&&mh(c)});c._resetAutoRefresh=function(){p(),c.beforeSend=m,delete c._resetAutoRefresh},c.beforeSend=async(x,g)=>{var E;const v=c.authStore.token;if((E=g.query)!=null&&E.autoRefresh)return m?m(x,g):{url:x,sendOptions:g};let _=c.authStore.isValid;if(_&&pS(c.authStore.token,f))try{await u()}catch{_=!1}_||await h();const C=g.headers||{};for(let T in C)if(T.toLowerCase()=="authorization"&&v==C[T]&&c.authStore.token){C[T]=c.authStore.token;break}return g.headers=C,m?m(x,g):{url:x,sendOptions:g}}}(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=Rr("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=Rr("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=Rr("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 MM=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function mS(e){if(e){e.query=e.query||{};for(let t in e)MM.includes(t)||(e.query[t]=e[t],delete e[t])}}class gS extends qo{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){mS(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 c;try{c=JSON.parse(l==null?void 0:l.data)}catch{}r(c||{})};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 IM extends $g{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=Rr("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=Rr("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(c=>this.authResponse(c))}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=Y0(void 0));const s=new gS(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 h;const c=l.authProviders.find(m=>m.name===r.provider);if(!c)throw new Ir(new Error(`Missing or invalid provider "${r.provider}".`));const f=this.client.buildUrl("/api/oauth2-redirect"),u=a?(h=this.client.cancelControllers)==null?void 0:h[a]:void 0;return u&&(u.signal.onabort=()=>{o()}),new Promise(async(m,y)=>{var p;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=u==null?void 0:u.signal)!=null&&E.onabort&&(u.signal.onabort=null);const P=await this.authWithOAuth2Code(c.name,_.code,c.codeVerifier,f,r.createData,T);m(P)}catch(T){y(new Ir(T))}o()});const x={state:s.clientId};(p=r.scopes)!=null&&p.length&&(x.scope=r.scopes.join(" "));const g=this._replaceQueryParams(c.authUrl+f,x);await(r.urlCallback||function(_){n?n.location.href=_:n=Y0(_)})(g)}catch(x){o(),y(new Ir(x))}})}).catch(l=>{throw o(),l})}async authRefresh(t,r){let n={method:"POST"};return n=Rr("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=Rr("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=Rr("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=Rr("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=Rr("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=Ii(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=Rr("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=Rr("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=Ii(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 Y0(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 LM extends $g{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 FM extends qo{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 zM extends qo{async check(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/health",t)}}class UM extends qo{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 qo{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 VM{constructor(t="/",r,n="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=t,this.lang=n,this.authStore=r||new DM,this.admins=new AM(this),this.collections=new LM(this),this.files=new UM(this),this.logs=new FM(this),this.settings=new OM(this),this.realtime=new gS(this),this.health=new zM(this),this.backups=new $M(this)}collection(t){return this.recordServices[t]||(this.recordServices[t]=new IM(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),mS(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 BM={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const WM=BM.VITE_API_DOMAIN;console.log(WM);let Xc;const Xt=()=>Xc||(Xc=new VM("/"),Xc);//! moment.js +//! version : 2.30.1 +//! authors : Tim Wood, Iskren Chernev, Moment.js contributors +//! license : MIT +//! momentjs.com +var vS;function me(){return vS.apply(null,arguments)}function HM(e){vS=e}function gn(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function jo(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function tt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Vg(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(tt(e,t))return!1;return!0}function wr(e){return e===void 0}function vs(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function ic(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function yS(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 Yg=/(\[[^\[]*\])|(\\)?([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,Qc=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,vh={},Li={};function Re(e,t,r,n){var s=n;typeof n=="string"&&(s=function(){return this[n]()}),e&&(Li[e]=s),t&&(Li[t[0]]=function(){return In(s.apply(this,arguments),t[1],t[2])}),r&&(Li[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 XM(e){var t=e.match(Yg),r,n;for(r=0,n=t.length;r=0&&Qc.test(e);)e=e.replace(Qc,n),Qc.lastIndex=0,r-=1;return e}var QM={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 JM(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(Yg).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[e])}var eI="Invalid date";function tI(){return this._invalidDate}var rI="%d",nI=/\d{1,2}/;function sI(e){return this._ordinal.replace("%d",e)}var oI={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 iI(e,t,r,n){var s=this._relativeTime[r];return Un(s)?s(e,t,r,n):s.replace(/%d/i,e)}function aI(e,t){var r=this._relativeTime[e>0?"future":"past"];return Un(r)?r(t):r.replace(/%s/i,t)}var K0={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 Jr(e){return typeof e=="string"?K0[e]||K0[e.toLowerCase()]:void 0}function Zg(e){var t={},r,n;for(n in e)tt(e,n)&&(r=Jr(n),r&&(t[r]=e[n]));return t}var lI={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 cI(e){var t=[],r;for(r in e)tt(e,r)&&t.push({unit:r,priority:lI[r]});return t.sort(function(n,s){return n.priority-s.priority}),t}var bS=/\d/,$r=/\d\d/,SS=/\d{3}/,Gg=/\d{4}/,sf=/[+-]?\d{6}/,bt=/\d\d?/,kS=/\d\d\d\d?/,CS=/\d\d\d\d\d\d?/,of=/\d{1,3}/,Kg=/\d{1,4}/,af=/[+-]?\d{1,6}/,da=/\d+/,lf=/[+-]?\d+/,uI=/Z|[+-]\d\d:?\d\d/gi,cf=/Z|[+-]\d\d(?::?\d\d)?/gi,dI=/[+-]?\d+(\.\d{1,3})?/,lc=/[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,fa=/^[1-9]\d?/,qg=/^([1-9]\d|\d)/,od;od={};function xe(e,t,r){od[e]=Un(t)?t:function(n,s){return n&&r?r:t}}function fI(e,t){return tt(od,e)?od[e](t._strict,t._locale):new RegExp(hI(e))}function hI(e){return as(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,r,n,s,o){return r||n||s||o}))}function as(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Yr(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Ge(e){var t=+e,r=0;return t!==0&&isFinite(t)&&(r=Yr(t)),r}var Mp={};function ht(e,t){var r,n=t,s;for(typeof e=="string"&&(e=[e]),vs(t)&&(n=function(o,i){i[t]=Ge(o)}),s=e.length,r=0;r68?1900:2e3)};var ES=ha("FullYear",!0);function vI(){return uf(this.year())}function ha(e,t){return function(r){return r!=null?(TS(this,e,r),me.updateOffset(this,t),this):Cl(this,e)}}function Cl(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 TS(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&&!uf(o)?28:a,s?n.setUTCFullYear(o,i,a):n.setFullYear(o,i,a)}}function yI(e){return e=Jr(e),Un(this[e])?this[e]():this}function wI(e,t){if(typeof e=="object"){e=Zg(e);var r=cI(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 El(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 id(e,t,r){var n=7+t-r,s=(7+El(e,0,n).getUTCDay()-t)%7;return-s+n-1}function OS(e,t,r,n,s){var o=(7+r-n)%7,i=id(e,n,s),a=1+7*(t-1)+o+i,l,c;return a<=0?(l=e-1,c=qa(l)+a):a>qa(e)?(l=e+1,c=a-qa(e)):(l=e,c=a),{year:l,dayOfYear:c}}function Tl(e,t,r){var n=id(e.year(),t,r),s=Math.floor((e.dayOfYear()-n-1)/7)+1,o,i;return s<1?(i=e.year()-1,o=s+ls(i,t,r)):s>ls(e.year(),t,r)?(o=s-ls(e.year(),t,r),i=e.year()+1):(i=e.year(),o=s),{week:o,year:i}}function ls(e,t,r){var n=id(e,t,r),s=id(e+1,t,r);return(qa(e)-n+s)/7}Re("w",["ww",2],"wo","week");Re("W",["WW",2],"Wo","isoWeek");xe("w",bt,fa);xe("ww",bt,$r);xe("W",bt,fa);xe("WW",bt,$r);cc(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=Ge(e)});function DI(e){return Tl(e,this._week.dow,this._week.doy).week}var OI={dow:0,doy:6};function AI(){return this._week.dow}function MI(){return this._week.doy}function II(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function LI(e){var t=Tl(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Re("d",0,"do","day");Re("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});Re("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});Re("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});Re("e",0,0,"weekday");Re("E",0,0,"isoWeekday");xe("d",bt);xe("e",bt);xe("E",bt);xe("dd",function(e,t){return t.weekdaysMinRegex(e)});xe("ddd",function(e,t){return t.weekdaysShortRegex(e)});xe("dddd",function(e,t){return t.weekdaysRegex(e)});cc(["dd","ddd","dddd"],function(e,t,r,n){var s=r._locale.weekdaysParse(e,n,r._strict);s!=null?t.d=s:Ve(r).invalidWeekday=e});cc(["d","e","E"],function(e,t,r,n){t[n]=Ge(e)});function FI(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function zI(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Qg(e,t){return e.slice(t,7).concat(e.slice(0,t))}var UI="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),AS="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),$I="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),VI=lc,BI=lc,WI=lc;function HI(e,t){var r=gn(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Qg(r,this._week.dow):e?r[e.day()]:r}function YI(e){return e===!0?Qg(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function ZI(e){return e===!0?Qg(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function GI(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=zn([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=It.call(this._weekdaysParse,i),s!==-1?s:null):t==="ddd"?(s=It.call(this._shortWeekdaysParse,i),s!==-1?s:null):(s=It.call(this._minWeekdaysParse,i),s!==-1?s:null):t==="dddd"?(s=It.call(this._weekdaysParse,i),s!==-1||(s=It.call(this._shortWeekdaysParse,i),s!==-1)?s:(s=It.call(this._minWeekdaysParse,i),s!==-1?s:null)):t==="ddd"?(s=It.call(this._shortWeekdaysParse,i),s!==-1||(s=It.call(this._weekdaysParse,i),s!==-1)?s:(s=It.call(this._minWeekdaysParse,i),s!==-1?s:null)):(s=It.call(this._minWeekdaysParse,i),s!==-1||(s=It.call(this._weekdaysParse,i),s!==-1)?s:(s=It.call(this._shortWeekdaysParse,i),s!==-1?s:null))}function KI(e,t,r){var n,s,o;if(this._weekdaysParseExact)return GI.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=zn([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=Cl(this,"Day");return e!=null?(e=FI(e,this.localeData()),this.add(e-t,"d")):t}function XI(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 QI(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=zI(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function JI(e){return this._weekdaysParseExact?(tt(this,"_weekdaysRegex")||Jg.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(tt(this,"_weekdaysRegex")||(this._weekdaysRegex=VI),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function eL(e){return this._weekdaysParseExact?(tt(this,"_weekdaysRegex")||Jg.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(tt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=BI),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function tL(e){return this._weekdaysParseExact?(tt(this,"_weekdaysRegex")||Jg.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(tt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=WI),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Jg(){function e(f,u){return u.length-f.length}var t=[],r=[],n=[],s=[],o,i,a,l,c;for(o=0;o<7;o++)i=zn([2e3,1]).day(o),a=as(this.weekdaysMin(i,"")),l=as(this.weekdaysShort(i,"")),c=as(this.weekdays(i,"")),t.push(a),r.push(l),n.push(c),s.push(a),s.push(l),s.push(c);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 ev(){return this.hours()%12||12}function rL(){return this.hours()||24}Re("H",["HH",2],0,"hour");Re("h",["hh",2],0,ev);Re("k",["kk",2],0,rL);Re("hmm",0,0,function(){return""+ev.apply(this)+In(this.minutes(),2)});Re("hmmss",0,0,function(){return""+ev.apply(this)+In(this.minutes(),2)+In(this.seconds(),2)});Re("Hmm",0,0,function(){return""+this.hours()+In(this.minutes(),2)});Re("Hmmss",0,0,function(){return""+this.hours()+In(this.minutes(),2)+In(this.seconds(),2)});function MS(e,t){Re(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}MS("a",!0);MS("A",!1);function IS(e,t){return t._meridiemParse}xe("a",IS);xe("A",IS);xe("H",bt,qg);xe("h",bt,fa);xe("k",bt,fa);xe("HH",bt,$r);xe("hh",bt,$r);xe("kk",bt,$r);xe("hmm",kS);xe("hmmss",CS);xe("Hmm",kS);xe("Hmmss",CS);ht(["H","HH"],Yt);ht(["k","kk"],function(e,t,r){var n=Ge(e);t[Yt]=n===24?0:n});ht(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e});ht(["h","hh"],function(e,t,r){t[Yt]=Ge(e),Ve(r).bigHour=!0});ht("hmm",function(e,t,r){var n=e.length-2;t[Yt]=Ge(e.substr(0,n)),t[ln]=Ge(e.substr(n)),Ve(r).bigHour=!0});ht("hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Yt]=Ge(e.substr(0,n)),t[ln]=Ge(e.substr(n,2)),t[ss]=Ge(e.substr(s)),Ve(r).bigHour=!0});ht("Hmm",function(e,t,r){var n=e.length-2;t[Yt]=Ge(e.substr(0,n)),t[ln]=Ge(e.substr(n))});ht("Hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Yt]=Ge(e.substr(0,n)),t[ln]=Ge(e.substr(n,2)),t[ss]=Ge(e.substr(s))});function nL(e){return(e+"").toLowerCase().charAt(0)==="p"}var sL=/[ap]\.?m?\.?/i,oL=ha("Hours",!0);function iL(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var LS={calendar:GM,longDateFormat:QM,invalidDate:eI,ordinal:rI,dayOfMonthOrdinalParse:nI,relativeTime:oI,months:_I,monthsShort:RS,week:OI,weekdays:UI,weekdaysMin:$I,weekdaysShort:AS,meridiemParse:sL},Ct={},Na={},Rl;function aL(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r0;){if(s=df(o.slice(0,r).join("-")),s)return s;if(n&&n.length>=r&&aL(o,n)>=r-1)break;r--}t++}return Rl}function cL(e){return!!(e&&e.match("^[^/\\\\]*$"))}function df(e){var t=null,r;if(Ct[e]===void 0&&typeof Cu<"u"&&Cu&&Cu.exports&&cL(e))try{t=Rl._abbr,r=require,r("./locale/"+e),Qs(t)}catch{Ct[e]=null}return Ct[e]}function Qs(e,t){var r;return e&&(wr(t)?r=ks(e):r=tv(e,t),r?Rl=r:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Rl._abbr}function tv(e,t){if(t!==null){var r,n=LS;if(t.abbr=e,Ct[e]!=null)xS("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=Ct[e]._config;else if(t.parentLocale!=null)if(Ct[t.parentLocale]!=null)n=Ct[t.parentLocale]._config;else if(r=df(t.parentLocale),r!=null)n=r._config;else return Na[t.parentLocale]||(Na[t.parentLocale]=[]),Na[t.parentLocale].push({name:e,config:t}),null;return Ct[e]=new Hg(Op(n,t)),Na[e]&&Na[e].forEach(function(s){tv(s.name,s.config)}),Qs(e),Ct[e]}else return delete Ct[e],null}function uL(e,t){if(t!=null){var r,n,s=LS;Ct[e]!=null&&Ct[e].parentLocale!=null?Ct[e].set(Op(Ct[e]._config,t)):(n=df(e),n!=null&&(s=n._config),t=Op(s,t),n==null&&(t.abbr=e),r=new Hg(t),r.parentLocale=Ct[e],Ct[e]=r),Qs(e)}else Ct[e]!=null&&(Ct[e].parentLocale!=null?(Ct[e]=Ct[e].parentLocale,e===Qs()&&Qs(e)):Ct[e]!=null&&delete Ct[e]);return Ct[e]}function ks(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Rl;if(!gn(e)){if(t=df(e),t)return t;e=[e]}return lL(e)}function dL(){return Ap(Ct)}function rv(e){var t,r=e._a;return r&&Ve(e).overflow===-2&&(t=r[ns]<0||r[ns]>11?ns:r[Tn]<1||r[Tn]>Xg(r[ir],r[ns])?Tn:r[Yt]<0||r[Yt]>24||r[Yt]===24&&(r[ln]!==0||r[ss]!==0||r[To]!==0)?Yt:r[ln]<0||r[ln]>59?ln:r[ss]<0||r[ss]>59?ss:r[To]<0||r[To]>999?To:-1,Ve(e)._overflowDayOfYear&&(tTn)&&(t=Tn),Ve(e)._overflowWeeks&&t===-1&&(t=mI),Ve(e)._overflowWeekday&&t===-1&&(t=gI),Ve(e).overflow=t),e}var fL=/^\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)?)?$/,hL=/^\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)?)?$/,pL=/Z|[+-]\d\d(?::?\d\d)?/,Jc=[["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]],yh=[["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/]],mL=/^\/?Date\((-?\d+)/i,gL=/^(?:(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}))$/,vL={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 FS(e){var t,r,n=e._i,s=fL.exec(n)||hL.exec(n),o,i,a,l,c=Jc.length,f=yh.length;if(s){for(Ve(e).iso=!0,t=0,r=c;tqa(i)||e._dayOfYear===0)&&(Ve(e)._overflowDayOfYear=!0),r=El(i,0,e._dayOfYear),e._a[ns]=r.getUTCMonth(),e._a[Tn]=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[Yt]===24&&e._a[ln]===0&&e._a[ss]===0&&e._a[To]===0&&(e._nextDay=!0,e._a[Yt]=0),e._d=(e._useUTC?El:jI).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[Yt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==o&&(Ve(e).weekdayMismatch=!0)}}function CL(e){var t,r,n,s,o,i,a,l,c;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,i=4,r=ui(t.GG,e._a[ir],Tl(_t(),1,4).year),n=ui(t.W,1),s=ui(t.E,1),(s<1||s>7)&&(l=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,c=Tl(_t(),o,i),r=ui(t.gg,e._a[ir],c.year),n=ui(t.w,c.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>ls(r,o,i)?Ve(e)._overflowWeeks=!0:l!=null?Ve(e)._overflowWeekday=!0:(a=OS(r,n,s,o,i),e._a[ir]=a.year,e._dayOfYear=a.dayOfYear)}me.ISO_8601=function(){};me.RFC_2822=function(){};function sv(e){if(e._f===me.ISO_8601){FS(e);return}if(e._f===me.RFC_2822){zS(e);return}e._a=[],Ve(e).empty=!0;var t=""+e._i,r,n,s,o,i,a=t.length,l=0,c,f;for(s=_S(e._f,e._locale).match(Yg)||[],f=s.length,r=0;r0&&Ve(e).unusedInput.push(i),t=t.slice(t.indexOf(n)+n.length),l+=n.length),Li[o]?(n?Ve(e).empty=!1:Ve(e).unusedTokens.push(o),pI(o,n,e)):e._strict&&!n&&Ve(e).unusedTokens.push(o);Ve(e).charsLeftOver=a-l,t.length>0&&Ve(e).unusedInput.push(t),e._a[Yt]<=12&&Ve(e).bigHour===!0&&e._a[Yt]>0&&(Ve(e).bigHour=void 0),Ve(e).parsedDateParts=e._a.slice(0),Ve(e).meridiem=e._meridiem,e._a[Yt]=EL(e._locale,e._a[Yt],e._meridiem),c=Ve(e).era,c!==null&&(e._a[ir]=e._locale.erasConvertYear(c,e._a[ir])),nv(e),rv(e)}function EL(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 TL(e){var t,r,n,s,o,i,a=!1,l=e._f.length;if(l===0){Ve(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;sthis?this:e:nf()});function VS(e,t){var r,n;if(t.length===1&&gn(t[0])&&(t=t[0]),!t.length)return _t();for(r=t[0],n=1;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function GL(){if(!wr(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Wg(e,this),e=US(e),e._a?(t=e._isUTC?zn(e._a):_t(e._a),this._isDSTShifted=this.isValid()&&zL(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function KL(){return this.isValid()?!this._isUTC:!1}function qL(){return this.isValid()?this._isUTC:!1}function WS(){return this.isValid()?this._isUTC&&this._offset===0:!1}var XL=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,QL=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function xn(e,t){var r=e,n=null,s,o,i;return xu(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:vs(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(n=XL.exec(e))?(s=n[1]==="-"?-1:1,r={y:0,d:Ge(n[Tn])*s,h:Ge(n[Yt])*s,m:Ge(n[ln])*s,s:Ge(n[ss])*s,ms:Ge(Ip(n[To]*1e3))*s}):(n=QL.exec(e))?(s=n[1]==="-"?-1:1,r={y:vo(n[2],s),M:vo(n[3],s),w:vo(n[4],s),d:vo(n[5],s),h:vo(n[6],s),m:vo(n[7],s),s:vo(n[8],s)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(i=JL(_t(r.from),_t(r.to)),r={},r.ms=i.milliseconds,r.M=i.months),o=new ff(r),xu(e)&&tt(e,"_locale")&&(o._locale=e._locale),xu(e)&&tt(e,"_isValid")&&(o._isValid=e._isValid),o}xn.fn=ff.prototype;xn.invalid=FL;function vo(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function X0(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 JL(e,t){var r;return e.isValid()&&t.isValid()?(t=iv(t,e),e.isBefore(t)?r=X0(e,t):(r=X0(t,e),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function HS(e,t){return function(r,n){var s,o;return n!==null&&!isNaN(+n)&&(xS(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=xn(r,n),YS(this,s,e),this}}function YS(e,t,r,n){var s=t._milliseconds,o=Ip(t._days),i=Ip(t._months);e.isValid()&&(n=n??!0,i&&PS(e,Cl(e,"Month")+i*r),o&&TS(e,"Date",Cl(e,"Date")+o*r),s&&e._d.setTime(e._d.valueOf()+s*r),n&&me.updateOffset(e,o||i))}var eF=HS(1,"add"),tF=HS(-1,"subtract");function ZS(e){return typeof e=="string"||e instanceof String}function rF(e){return vn(e)||ic(e)||ZS(e)||vs(e)||sF(e)||nF(e)||e===null||e===void 0}function nF(e){var t=jo(e)&&!Vg(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?wu(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Un(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",wu(r,"Z")):wu(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function yF(){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 wF(e){e||(e=this.isUtc()?me.defaultFormatUtc:me.defaultFormat);var t=wu(this,e);return this.localeData().postformat(t)}function xF(e,t){return this.isValid()&&(vn(e)&&e.isValid()||_t(e).isValid())?xn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function _F(e){return this.from(_t(),e)}function bF(e,t){return this.isValid()&&(vn(e)&&e.isValid()||_t(e).isValid())?xn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function SF(e){return this.to(_t(),e)}function GS(e){var t;return e===void 0?this._locale._abbr:(t=ks(e),t!=null&&(this._locale=t),this)}var KS=Qr("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 qS(){return this._locale}var ad=1e3,Fi=60*ad,ld=60*Fi,XS=(365*400+97)*24*ld;function zi(e,t){return(e%t+t)%t}function QS(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-XS:new Date(e,t,r).valueOf()}function JS(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-XS:Date.UTC(e,t,r)}function kF(e){var t,r;if(e=Jr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?JS:QS,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-=zi(t+(this._isUTC?0:this.utcOffset()*Fi),ld);break;case"minute":t=this._d.valueOf(),t-=zi(t,Fi);break;case"second":t=this._d.valueOf(),t-=zi(t,ad);break}return this._d.setTime(t),me.updateOffset(this,!0),this}function CF(e){var t,r;if(e=Jr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?JS:QS,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+=ld-zi(t+(this._isUTC?0:this.utcOffset()*Fi),ld)-1;break;case"minute":t=this._d.valueOf(),t+=Fi-zi(t,Fi)-1;break;case"second":t=this._d.valueOf(),t+=ad-zi(t,ad)-1;break}return this._d.setTime(t),me.updateOffset(this,!0),this}function EF(){return this._d.valueOf()-(this._offset||0)*6e4}function TF(){return Math.floor(this.valueOf()/1e3)}function RF(){return new Date(this.valueOf())}function NF(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function PF(){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 jF(){return this.isValid()?this.toISOString():null}function DF(){return Bg(this)}function OF(){return $s({},Ve(this))}function AF(){return Ve(this).overflow}function MF(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Re("N",0,0,"eraAbbr");Re("NN",0,0,"eraAbbr");Re("NNN",0,0,"eraAbbr");Re("NNNN",0,0,"eraName");Re("NNNNN",0,0,"eraNarrow");Re("y",["y",1],"yo","eraYear");Re("y",["yy",2],0,"eraYear");Re("y",["yyy",3],0,"eraYear");Re("y",["yyyy",4],0,"eraYear");xe("N",av);xe("NN",av);xe("NNN",av);xe("NNNN",YF);xe("NNNNN",ZF);ht(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,n){var s=r._locale.erasParse(e,n,r._strict);s?Ve(r).era=s:Ve(r).invalidEra=e});xe("y",da);xe("yy",da);xe("yyy",da);xe("yyyy",da);xe("yo",GF);ht(["y","yy","yyy","yyyy"],ir);ht(["yo"],function(e,t,r,n){var s;r._locale._eraYearOrdinalRegex&&(s=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[ir]=r._locale.eraYearOrdinalParse(e,s):t[ir]=parseInt(e,10)});function IF(e,t){var r,n,s,o=this._eras||ks("en")._eras;for(r=0,n=o.length;r=0)return o[n]}function FF(e,t){var r=e.since<=e.until?1:-1;return t===void 0?me(e.since).year():me(e.since).year()+(t-e.offset)*r}function zF(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;eo&&(t=o),t4.call(this,e,t,r,n,s))}function t4(e,t,r,n,s){var o=OS(e,t,r,n,s),i=El(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}Re("Q",0,"Qo","quarter");xe("Q",bS);ht("Q",function(e,t){t[ns]=(Ge(e)-1)*3});function r4(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Re("D",["DD",2],"Do","date");xe("D",bt,fa);xe("DD",bt,$r);xe("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});ht(["D","DD"],Tn);ht("Do",function(e,t){t[Tn]=Ge(e.match(bt)[0])});var tk=ha("Date",!0);Re("DDD",["DDDD",3],"DDDo","dayOfYear");xe("DDD",of);xe("DDDD",SS);ht(["DDD","DDDD"],function(e,t,r){r._dayOfYear=Ge(e)});function n4(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Re("m",["mm",2],0,"minute");xe("m",bt,qg);xe("mm",bt,$r);ht(["m","mm"],ln);var s4=ha("Minutes",!1);Re("s",["ss",2],0,"second");xe("s",bt,qg);xe("ss",bt,$r);ht(["s","ss"],ss);var o4=ha("Seconds",!1);Re("S",0,0,function(){return~~(this.millisecond()/100)});Re(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Re(0,["SSS",3],0,"millisecond");Re(0,["SSSS",4],0,function(){return this.millisecond()*10});Re(0,["SSSSS",5],0,function(){return this.millisecond()*100});Re(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Re(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Re(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Re(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});xe("S",of,bS);xe("SS",of,$r);xe("SSS",of,SS);var Vs,rk;for(Vs="SSSS";Vs.length<=9;Vs+="S")xe(Vs,da);function i4(e,t){t[To]=Ge(("0."+e)*1e3)}for(Vs="S";Vs.length<=9;Vs+="S")ht(Vs,i4);rk=ha("Milliseconds",!1);Re("z",0,0,"zoneAbbr");Re("zz",0,0,"zoneName");function a4(){return this._isUTC?"UTC":""}function l4(){return this._isUTC?"Coordinated Universal Time":""}var ae=ac.prototype;ae.add=eF;ae.calendar=aF;ae.clone=lF;ae.diff=mF;ae.endOf=CF;ae.format=wF;ae.from=xF;ae.fromNow=_F;ae.to=bF;ae.toNow=SF;ae.get=yI;ae.invalidAt=AF;ae.isAfter=cF;ae.isBefore=uF;ae.isBetween=dF;ae.isSame=fF;ae.isSameOrAfter=hF;ae.isSameOrBefore=pF;ae.isValid=DF;ae.lang=KS;ae.locale=GS;ae.localeData=qS;ae.max=DL;ae.min=jL;ae.parsingFlags=OF;ae.set=wI;ae.startOf=kF;ae.subtract=tF;ae.toArray=NF;ae.toObject=PF;ae.toDate=RF;ae.toISOString=vF;ae.inspect=yF;typeof Symbol<"u"&&Symbol.for!=null&&(ae[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});ae.toJSON=jF;ae.toString=gF;ae.unix=TF;ae.valueOf=EF;ae.creationData=MF;ae.eraName=zF;ae.eraNarrow=UF;ae.eraAbbr=$F;ae.eraYear=VF;ae.year=ES;ae.isLeapYear=vI;ae.weekYear=KF;ae.isoWeekYear=qF;ae.quarter=ae.quarters=r4;ae.month=jS;ae.daysInMonth=RI;ae.week=ae.weeks=II;ae.isoWeek=ae.isoWeeks=LI;ae.weeksInYear=JF;ae.weeksInWeekYear=e4;ae.isoWeeksInYear=XF;ae.isoWeeksInISOWeekYear=QF;ae.date=tk;ae.day=ae.days=qI;ae.weekday=XI;ae.isoWeekday=QI;ae.dayOfYear=n4;ae.hour=ae.hours=oL;ae.minute=ae.minutes=s4;ae.second=ae.seconds=o4;ae.millisecond=ae.milliseconds=rk;ae.utcOffset=$L;ae.utc=BL;ae.local=WL;ae.parseZone=HL;ae.hasAlignedHourOffset=YL;ae.isDST=ZL;ae.isLocal=KL;ae.isUtcOffset=qL;ae.isUtc=WS;ae.isUTC=WS;ae.zoneAbbr=a4;ae.zoneName=l4;ae.dates=Qr("dates accessor is deprecated. Use date instead.",tk);ae.months=Qr("months accessor is deprecated. Use month instead",jS);ae.years=Qr("years accessor is deprecated. Use year instead",ES);ae.zone=Qr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",VL);ae.isDSTShifted=Qr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",GL);function c4(e){return _t(e*1e3)}function u4(){return _t.apply(null,arguments).parseZone()}function nk(e){return e}var rt=Hg.prototype;rt.calendar=KM;rt.longDateFormat=JM;rt.invalidDate=tI;rt.ordinal=sI;rt.preparse=nk;rt.postformat=nk;rt.relativeTime=iI;rt.pastFuture=aI;rt.set=ZM;rt.eras=IF;rt.erasParse=LF;rt.erasConvertYear=FF;rt.erasAbbrRegex=WF;rt.erasNameRegex=BF;rt.erasNarrowRegex=HF;rt.months=kI;rt.monthsShort=CI;rt.monthsParse=TI;rt.monthsRegex=PI;rt.monthsShortRegex=NI;rt.week=DI;rt.firstDayOfYear=MI;rt.firstDayOfWeek=AI;rt.weekdays=HI;rt.weekdaysMin=ZI;rt.weekdaysShort=YI;rt.weekdaysParse=KI;rt.weekdaysRegex=JI;rt.weekdaysShortRegex=eL;rt.weekdaysMinRegex=tL;rt.isPM=nL;rt.meridiem=iL;function cd(e,t,r,n){var s=ks(),o=zn().set(n,t);return s[r](o,e)}function sk(e,t,r){if(vs(e)&&(t=e,e=void 0),e=e||"",t!=null)return cd(e,t,r,"month");var n,s=[];for(n=0;n<12;n++)s[n]=cd(e,n,r,"month");return s}function cv(e,t,r,n){typeof e=="boolean"?(vs(t)&&(r=t,t=void 0),t=t||""):(t=e,r=t,e=!1,vs(t)&&(r=t,t=void 0),t=t||"");var s=ks(),o=e?s._week.dow:0,i,a=[];if(r!=null)return cd(t,(r+o)%7,n,"day");for(i=0;i<7;i++)a[i]=cd(t,(i+o)%7,n,"day");return a}function d4(e,t){return sk(e,t,"months")}function f4(e,t){return sk(e,t,"monthsShort")}function h4(e,t,r){return cv(e,t,r,"weekdays")}function p4(e,t,r){return cv(e,t,r,"weekdaysShort")}function m4(e,t,r){return cv(e,t,r,"weekdaysMin")}Qs("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=Ge(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+r}});me.lang=Qr("moment.lang is deprecated. Use moment.locale instead.",Qs);me.langData=Qr("moment.langData is deprecated. Use moment.localeData instead.",ks);var Zn=Math.abs;function g4(){var e=this._data;return this._milliseconds=Zn(this._milliseconds),this._days=Zn(this._days),this._months=Zn(this._months),e.milliseconds=Zn(e.milliseconds),e.seconds=Zn(e.seconds),e.minutes=Zn(e.minutes),e.hours=Zn(e.hours),e.months=Zn(e.months),e.years=Zn(e.years),this}function ok(e,t,r,n){var s=xn(t,r);return e._milliseconds+=n*s._milliseconds,e._days+=n*s._days,e._months+=n*s._months,e._bubble()}function v4(e,t){return ok(this,e,t,1)}function y4(e,t){return ok(this,e,t,-1)}function Q0(e){return e<0?Math.floor(e):Math.ceil(e)}function w4(){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+=Q0(Fp(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(ik(t)),r+=l,t-=Q0(Fp(l)),a=Yr(r/12),r%=12,n.days=t,n.months=r,n.years=a,this}function ik(e){return e*4800/146097}function Fp(e){return e*146097/4800}function x4(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if(e=Jr(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+n/864e5,r=this._months+ik(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Fp(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 Cs(e){return function(){return this.as(e)}}var ak=Cs("ms"),_4=Cs("s"),b4=Cs("m"),S4=Cs("h"),k4=Cs("d"),C4=Cs("w"),E4=Cs("M"),T4=Cs("Q"),R4=Cs("y"),N4=ak;function P4(){return xn(this)}function j4(e){return e=Jr(e),this.isValid()?this[e+"s"]():NaN}function Xo(e){return function(){return this.isValid()?this._data[e]:NaN}}var D4=Xo("milliseconds"),O4=Xo("seconds"),A4=Xo("minutes"),M4=Xo("hours"),I4=Xo("days"),L4=Xo("months"),F4=Xo("years");function z4(){return Yr(this.days()/7)}var Qn=Math.round,Ci={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function U4(e,t,r,n,s){return s.relativeTime(t||1,!!r,e,n)}function $4(e,t,r,n){var s=xn(e).abs(),o=Qn(s.as("s")),i=Qn(s.as("m")),a=Qn(s.as("h")),l=Qn(s.as("d")),c=Qn(s.as("M")),f=Qn(s.as("w")),u=Qn(s.as("y")),h=o<=r.ss&&["s",o]||o0,h[4]=n,U4.apply(null,h)}function V4(e){return e===void 0?Qn:typeof e=="function"?(Qn=e,!0):!1}function B4(e,t){return Ci[e]===void 0?!1:t===void 0?Ci[e]:(Ci[e]=t,e==="s"&&(Ci.ss=t-1),!0)}function W4(e,t){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Ci,s,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(r=e),typeof t=="object"&&(n=Object.assign({},Ci,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),s=this.localeData(),o=$4(this,!r,n,s),r&&(o=s.pastFuture(+this,o)),s.postformat(o)}var wh=Math.abs;function li(e){return(e>0)-(e<0)||+e}function pf(){if(!this.isValid())return this.localeData().invalidDate();var e=wh(this._milliseconds)/1e3,t=wh(this._days),r=wh(this._months),n,s,o,i,a=this.asSeconds(),l,c,f,u;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?"-":"",c=li(this._months)!==li(a)?"-":"",f=li(this._days)!==li(a)?"-":"",u=li(this._milliseconds)!==li(a)?"-":"",l+"P"+(o?c+o+"Y":"")+(r?c+r+"M":"")+(t?f+t+"D":"")+(s||n||e?"T":"")+(s?u+s+"H":"")+(n?u+n+"M":"")+(e?u+i+"S":"")):"P0D"}var Qe=ff.prototype;Qe.isValid=LL;Qe.abs=g4;Qe.add=v4;Qe.subtract=y4;Qe.as=x4;Qe.asMilliseconds=ak;Qe.asSeconds=_4;Qe.asMinutes=b4;Qe.asHours=S4;Qe.asDays=k4;Qe.asWeeks=C4;Qe.asMonths=E4;Qe.asQuarters=T4;Qe.asYears=R4;Qe.valueOf=N4;Qe._bubble=w4;Qe.clone=P4;Qe.get=j4;Qe.milliseconds=D4;Qe.seconds=O4;Qe.minutes=A4;Qe.hours=M4;Qe.days=I4;Qe.weeks=z4;Qe.months=L4;Qe.years=F4;Qe.humanize=W4;Qe.toISOString=pf;Qe.toString=pf;Qe.toJSON=pf;Qe.locale=GS;Qe.localeData=qS;Qe.toIsoString=Qr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",pf);Qe.lang=KS;Re("X",0,0,"unix");Re("x",0,0,"valueOf");xe("x",lf);xe("X",dI);ht("X",function(e,t,r){r._d=new Date(parseFloat(e)*1e3)});ht("x",function(e,t,r){r._d=new Date(Ge(e))});//! moment.js +me.version="2.30.1";HM(_t);me.fn=ae;me.min=OL;me.max=AL;me.now=ML;me.utc=zn;me.unix=c4;me.months=d4;me.isDate=ic;me.locale=Qs;me.invalid=nf;me.duration=xn;me.isMoment=vn;me.weekdays=h4;me.parseZone=u4;me.localeData=ks;me.isDuration=xu;me.monthsShort=f4;me.weekdaysMin=m4;me.defineLocale=tv;me.updateLocale=uL;me.locales=dL;me.weekdaysShort=p4;me.normalizeUnits=Jr;me.relativeTimeRounding=V4;me.relativeTimeThreshold=B4;me.calendarFormat=iF;me.prototype=ae;me.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 H4=async()=>await Xt().collection("access").getFullList({sort:"-created",filter:"deleted = null"}),uv=async e=>e.id?await Xt().collection("access").update(e.id,e):await Xt().collection("access").create(e),Y4=async e=>(e.deleted=me.utc().format("YYYY-MM-DD HH:mm:ss"),await Xt().collection("access").update(e.id,e)),Z4=(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}},lk=w.createContext({}),uc=()=>w.useContext(lk),G4=({children:e})=>{const[t,r]=w.useReducer(Z4,{accesses:[]});w.useEffect(()=>{(async()=>{const a=await H4();r({type:"SET_ACCESSES",payload:a})})()},[]);const n=w.useCallback(i=>{r({type:"DELETE_ACCESS",payload:i})},[]),s=w.useCallback(i=>{r({type:"ADD_ACCESS",payload:i})},[]),o=w.useCallback(i=>{r({type:"UPDATE_ACCESS",payload:i})},[]);return d.jsx(lk.Provider,{value:{config:{accesses:t.accesses},deleteAccess:n,addAccess:s,updateAccess:o},children:e&&e})};function K4(){const e=po(),t=ho();if(!Xt().authStore.isValid||!Xt().authStore.isAdmin)return d.jsx(K_,{to:"/login"});const r=t.pathname,n=o=>(console.log(r),o==r?"bg-muted text-primary":"text-muted-foreground"),s=()=>{Xt().authStore.clear(),e("/login")};return d.jsx(d.Fragment,{children:d.jsx(G4,{children:d.jsxs("div",{className:"grid min-h-screen w-full md:grid-cols-[220px_1fr] lg:grid-cols-[280px_1fr]",children:[d.jsx("div",{className:"hidden border-r bg-muted/40 md:block",children:d.jsxs("div",{className:"flex h-full max-h-screen flex-col gap-2",children:[d.jsx("div",{className:"flex h-14 items-center border-b px-4 lg:h-[60px] lg:px-6",children:d.jsxs(Kn,{to:"/",className:"flex items-center gap-2 font-semibold",children:[d.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),d.jsx("span",{className:"",children:"Certimate"})]})}),d.jsx("div",{className:"flex-1",children:d.jsxs("nav",{className:"grid items-start px-2 text-sm font-medium lg:px-4",children:[d.jsxs(Kn,{to:"/",className:we("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/")),children:[d.jsx(Sp,{className:"h-4 w-4"}),"域名列表"]}),d.jsxs(Kn,{to:"/access",className:we("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/access")),children:[d.jsx(v0,{className:"h-4 w-4"}),"授权管理"]}),d.jsxs(Kn,{to:"/history",className:we("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/history")),children:[d.jsx(m0,{className:"h-4 w-4"}),"部署历史"]})]})})]})}),d.jsxs("div",{className:"flex flex-col",children:[d.jsxs("header",{className:"flex h-14 items-center gap-4 border-b bg-muted/40 px-4 lg:h-[60px] lg:px-6",children:[d.jsxs(lS,{children:[d.jsx(cS,{asChild:!0,children:d.jsxs(Lt,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[d.jsx(VP,{className:"h-5 w-5"}),d.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),d.jsx(Ug,{side:"left",className:"flex flex-col",children:d.jsxs("nav",{className:"grid gap-2 text-lg font-medium",children:[d.jsxs(Kn,{to:"/",className:"flex items-center gap-2 text-lg font-semibold",children:[d.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),d.jsx("span",{className:"",children:"Certimate"}),d.jsx("span",{className:"sr-only",children:"Certimate"})]}),d.jsxs(Kn,{to:"/",className:we("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/")),children:[d.jsx(Sp,{className:"h-5 w-5"}),"域名列表"]}),d.jsxs(Kn,{to:"/access",className:we("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/dns_provider")),children:[d.jsx(v0,{className:"h-5 w-5"}),"授权管理"]}),d.jsxs(Kn,{to:"/history",className:we("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/history")),children:[d.jsx(m0,{className:"h-5 w-5"}),"部署历史"]})]})})]}),d.jsx("div",{className:"w-full flex-1"}),d.jsxs(cM,{children:[d.jsx(uM,{asChild:!0,children:d.jsxs(Lt,{variant:"secondary",size:"icon",className:"rounded-full",children:[d.jsx(UP,{className:"h-5 w-5"}),d.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),d.jsxs($b,{align:"end",children:[d.jsx(Bb,{children:"My Account"}),d.jsx(Wb,{}),d.jsx(Vb,{onClick:s,children:"Logout"})]})]})]}),d.jsxs("main",{className:"flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 relative",children:[d.jsx(q_,{}),d.jsxs("div",{className:"fixed right-0 bottom-0 w-full flex justify-between p-5",children:[d.jsx("div",{className:""}),d.jsx("div",{className:"text-muted-foreground text-sm hover:text-stone-900",children:d.jsx("a",{href:"https://github.com/usual2970/certimate/releases",target:"_blank",children:"Certimate v0.0.3"})})]})]})]})]})})})}var q4="Separator",J0="horizontal",X4=["horizontal","vertical"],ck=w.forwardRef((e,t)=>{const{decorative:r,orientation:n=J0,...s}=e,o=Q4(n)?n:J0,a=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return d.jsx(De.div,{"data-orientation":o,...a,...s,ref:t})});ck.displayName=q4;function Q4(e){return X4.includes(e)}var uk=ck;const Gt=w.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>d.jsx(uk,{ref:s,decorative:r,orientation:t,className:we("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Gt.displayName=uk.displayName;const dk=({phase:e,phaseSuccess:t})=>{let r=d.jsx(d.Fragment,{children:" "});return e==="check"&&(t?r=d.jsxs("div",{className:"flex items-center",children:[d.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),d.jsx(Gt,{className:"h-1 grow"}),d.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),d.jsx(Gt,{className:"h-1 grow"}),d.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=d.jsxs("div",{className:"flex items-center",children:[d.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"检查 "}),d.jsx(Gt,{className:"h-1 grow"}),d.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),d.jsx(Gt,{className:"h-1 grow"}),d.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="apply"&&(t?r=d.jsxs("div",{className:"flex items-center",children:[d.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),d.jsx(Gt,{className:"h-1 grow bg-green-600"}),d.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),d.jsx(Gt,{className:"h-1 grow"}),d.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=d.jsxs("div",{className:"flex items-center",children:[d.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),d.jsx(Gt,{className:"h-1 grow bg-green-600"}),d.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"获取"}),d.jsx(Gt,{className:"h-1 grow"}),d.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="deploy"&&(t?r=d.jsxs("div",{className:"flex items-center",children:[d.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),d.jsx(Gt,{className:"h-1 grow bg-green-600"}),d.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),d.jsx(Gt,{className:"h-1 grow bg-green-600"}),d.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"部署"})]}):r=d.jsxs("div",{className:"flex items-center",children:[d.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),d.jsx(Gt,{className:"h-1 grow bg-green-600"}),d.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),d.jsx(Gt,{className:"h-1 grow bg-green-600"}),d.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"部署"})]})),r},ew=({when:e,children:t,fallback:r})=>e?t:r;var fk="AlertDialog",[J4,fU]=Er(fk,[Yb]),Es=Yb(),hk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Es(t);return d.jsx(Lg,{...n,...r,modal:!0})};hk.displayName=fk;var e3="AlertDialogTrigger",pk=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Es(r);return d.jsx(Fg,{...s,...n,ref:t})});pk.displayName=e3;var t3="AlertDialogPortal",mk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Es(t);return d.jsx(zg,{...n,...r})};mk.displayName=t3;var r3="AlertDialogOverlay",gk=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Es(r);return d.jsx(rc,{...s,...n,ref:t})});gk.displayName=r3;var Ui="AlertDialogContent",[n3,s3]=J4(Ui),vk=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,o=Es(r),i=w.useRef(null),a=ze(t,i),l=w.useRef(null);return d.jsx(xM,{contentName:Ui,titleName:yk,docsSlug:"alert-dialog",children:d.jsx(n3,{scope:r,cancelRef:l,children:d.jsxs(nc,{role:"alertdialog",...o,...s,ref:a,onOpenAutoFocus:le(s.onOpenAutoFocus,c=>{var f;c.preventDefault(),(f=l.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[d.jsx(ig,{children:n}),d.jsx(i3,{contentRef:i})]})})})});vk.displayName=Ui;var yk="AlertDialogTitle",wk=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Es(r);return d.jsx(sc,{...s,...n,ref:t})});wk.displayName=yk;var xk="AlertDialogDescription",_k=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Es(r);return d.jsx(oc,{...s,...n,ref:t})});_k.displayName=xk;var o3="AlertDialogAction",bk=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Es(r);return d.jsx(rf,{...s,...n,ref:t})});bk.displayName=o3;var Sk="AlertDialogCancel",kk=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=s3(Sk,r),o=Es(r),i=ze(t,s);return d.jsx(rf,{...o,...n,ref:i})});kk.displayName=Sk;var i3=({contentRef:e})=>{const t=`\`${Ui}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${Ui}\` by passing a \`${xk}\` 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 \`${Ui}\`. 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 w.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},a3=hk,l3=pk,c3=mk,Ck=gk,Ek=vk,Tk=bk,Rk=kk,Nk=wk,Pk=_k;const u3=a3,d3=l3,f3=c3,jk=w.forwardRef(({className:e,...t},r)=>d.jsx(Ck,{className:we("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}));jk.displayName=Ck.displayName;const Dk=w.forwardRef(({className:e,...t},r)=>d.jsxs(f3,{children:[d.jsx(jk,{}),d.jsx(Ek,{ref:r,className:we("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})]}));Dk.displayName=Ek.displayName;const Ok=({className:e,...t})=>d.jsx("div",{className:we("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ok.displayName="AlertDialogHeader";const Ak=({className:e,...t})=>d.jsx("div",{className:we("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ak.displayName="AlertDialogFooter";const Mk=w.forwardRef(({className:e,...t},r)=>d.jsx(Nk,{ref:r,className:we("text-lg font-semibold",e),...t}));Mk.displayName=Nk.displayName;const Ik=w.forwardRef(({className:e,...t},r)=>d.jsx(Pk,{ref:r,className:we("text-sm text-muted-foreground",e),...t}));Ik.displayName=Pk.displayName;const Lk=w.forwardRef(({className:e,...t},r)=>d.jsx(Tk,{ref:r,className:we(lg(),e),...t}));Lk.displayName=Tk.displayName;const Fk=w.forwardRef(({className:e,...t},r)=>d.jsx(Rk,{ref:r,className:we(lg({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Fk.displayName=Rk.displayName;function dv(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var fv="Switch",[h3,hU]=Er(fv),[p3,m3]=h3(fv),zk=w.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:o,required:i,disabled:a,value:l="on",onCheckedChange:c,...f}=e,[u,h]=w.useState(null),m=ze(t,v=>h(v)),y=w.useRef(!1),p=u?!!u.closest("form"):!0,[x=!1,g]=ps({prop:s,defaultProp:o,onChange:c});return d.jsxs(p3,{scope:r,checked:x,disabled:a,children:[d.jsx(De.button,{type:"button",role:"switch","aria-checked":x,"aria-required":i,"data-state":Vk(x),"data-disabled":a?"":void 0,disabled:a,value:l,...f,ref:m,onClick:le(e.onClick,v=>{g(_=>!_),p&&(y.current=v.isPropagationStopped(),y.current||v.stopPropagation())})}),p&&d.jsx(g3,{control:u,bubbles:!y.current,name:n,value:l,checked:x,required:i,disabled:a,style:{transform:"translateX(-100%)"}})]})});zk.displayName=fv;var Uk="SwitchThumb",$k=w.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=m3(Uk,r);return d.jsx(De.span,{"data-state":Vk(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});$k.displayName=Uk;var g3=e=>{const{control:t,checked:r,bubbles:n=!0,...s}=e,o=w.useRef(null),i=dv(r),a=vg(t);return w.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"checked").set;if(i!==r&&u){const h=new Event("click",{bubbles:n});u.call(l,r),l.dispatchEvent(h)}},[i,r,n]),d.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 Vk(e){return e?"checked":"unchecked"}var Bk=zk,v3=$k;const Wk=w.forwardRef(({className:e,...t},r)=>d.jsx(Bk,{className:we("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:d.jsx(v3,{className:we("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")})}));Wk.displayName=Bk.displayName;var y3="VisuallyHidden",dc=w.forwardRef((e,t)=>d.jsx(De.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}}));dc.displayName=y3;var w3=dc,hv="ToastProvider",[pv,x3,_3]=Yd("Toast"),[Hk,pU]=Er("Toast",[_3]),[b3,mf]=Hk(hv),Yk=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:i}=e,[a,l]=w.useState(null),[c,f]=w.useState(0),u=w.useRef(!1),h=w.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${hv}\`. Expected non-empty \`string\`.`),d.jsx(pv.Provider,{scope:t,children:d.jsx(b3,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:w.useCallback(()=>f(m=>m+1),[]),onToastRemove:w.useCallback(()=>f(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:u,isClosePausedRef:h,children:i})})};Yk.displayName=hv;var Zk="ToastViewport",S3=["F8"],zp="toast.viewportPause",Up="toast.viewportResume",Gk=w.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=S3,label:s="Notifications ({hotkey})",...o}=e,i=mf(Zk,r),a=x3(r),l=w.useRef(null),c=w.useRef(null),f=w.useRef(null),u=w.useRef(null),h=ze(t,u,i.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=i.toastCount>0;w.useEffect(()=>{const x=g=>{var _;n.every(C=>g[C]||g.code===C)&&((_=u.current)==null||_.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[n]),w.useEffect(()=>{const x=l.current,g=u.current;if(y&&x&&g){const v=()=>{if(!i.isClosePausedRef.current){const T=new CustomEvent(zp);g.dispatchEvent(T),i.isClosePausedRef.current=!0}},_=()=>{if(i.isClosePausedRef.current){const T=new CustomEvent(Up);g.dispatchEvent(T),i.isClosePausedRef.current=!1}},C=T=>{!x.contains(T.relatedTarget)&&_()},E=()=>{x.contains(document.activeElement)||_()};return x.addEventListener("focusin",v),x.addEventListener("focusout",C),x.addEventListener("pointermove",v),x.addEventListener("pointerleave",E),window.addEventListener("blur",v),window.addEventListener("focus",_),()=>{x.removeEventListener("focusin",v),x.removeEventListener("focusout",C),x.removeEventListener("pointermove",v),x.removeEventListener("pointerleave",E),window.removeEventListener("blur",v),window.removeEventListener("focus",_)}}},[y,i.isClosePausedRef]);const p=w.useCallback(({tabbingDirection:x})=>{const v=a().map(_=>{const C=_.ref.current,E=[C,...I3(C)];return x==="forwards"?E:E.reverse()});return(x==="forwards"?v.reverse():v).flat()},[a]);return w.useEffect(()=>{const x=u.current;if(x){const g=v=>{var E,T,P;const _=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!_){const O=document.activeElement,j=v.shiftKey;if(v.target===x&&j){(E=c.current)==null||E.focus();return}const R=p({tabbingDirection:j?"backwards":"forwards"}),F=R.findIndex(b=>b===O);xh(R.slice(F+1))?v.preventDefault():j?(T=c.current)==null||T.focus():(P=f.current)==null||P.focus()}};return x.addEventListener("keydown",g),()=>x.removeEventListener("keydown",g)}},[a,p]),d.jsxs($j,{ref:l,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&d.jsx($p,{ref:c,onFocusFromOutsideViewport:()=>{const x=p({tabbingDirection:"forwards"});xh(x)}}),d.jsx(pv.Slot,{scope:r,children:d.jsx(De.ol,{tabIndex:-1,...o,ref:h})}),y&&d.jsx($p,{ref:f,onFocusFromOutsideViewport:()=>{const x=p({tabbingDirection:"backwards"});xh(x)}})]})});Gk.displayName=Zk;var Kk="ToastFocusProxy",$p=w.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=mf(Kk,r);return d.jsx(dc,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=o.viewport)!=null&&c.contains(a))&&n()}})});$p.displayName=Kk;var gf="Toast",k3="toast.swipeStart",C3="toast.swipeMove",E3="toast.swipeCancel",T3="toast.swipeEnd",qk=w.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...i}=e,[a=!0,l]=ps({prop:n,defaultProp:s,onChange:o});return d.jsx(vr,{present:r||a,children:d.jsx(P3,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:Pt(e.onPause),onResume:Pt(e.onResume),onSwipeStart:le(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:le(e.onSwipeMove,c=>{const{x:f,y:u}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${u}px`)}),onSwipeCancel:le(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:le(e.onSwipeEnd,c=>{const{x:f,y:u}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${u}px`),l(!1)})})})});qk.displayName=gf;var[R3,N3]=Hk(gf,{onClose(){}}),P3=w.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:f,onSwipeMove:u,onSwipeCancel:h,onSwipeEnd:m,...y}=e,p=mf(gf,r),[x,g]=w.useState(null),v=ze(t,b=>g(b)),_=w.useRef(null),C=w.useRef(null),E=s||p.duration,T=w.useRef(0),P=w.useRef(E),O=w.useRef(0),{onToastAdd:j,onToastRemove:L}=p,q=Pt(()=>{var V;(x==null?void 0:x.contains(document.activeElement))&&((V=p.viewport)==null||V.focus()),i()}),R=w.useCallback(b=>{!b||b===1/0||(window.clearTimeout(O.current),T.current=new Date().getTime(),O.current=window.setTimeout(q,b))},[q]);w.useEffect(()=>{const b=p.viewport;if(b){const V=()=>{R(P.current),c==null||c()},te=()=>{const B=new Date().getTime()-T.current;P.current=P.current-B,window.clearTimeout(O.current),l==null||l()};return b.addEventListener(zp,te),b.addEventListener(Up,V),()=>{b.removeEventListener(zp,te),b.removeEventListener(Up,V)}}},[p.viewport,E,l,c,R]),w.useEffect(()=>{o&&!p.isClosePausedRef.current&&R(E)},[o,E,p.isClosePausedRef,R]),w.useEffect(()=>(j(),()=>L()),[j,L]);const F=w.useMemo(()=>x?nC(x):null,[x]);return p.viewport?d.jsxs(d.Fragment,{children:[F&&d.jsx(j3,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:F}),d.jsx(R3,{scope:r,onClose:q,children:xs.createPortal(d.jsx(pv.ItemSlot,{scope:r,children:d.jsx(Uj,{asChild:!0,onEscapeKeyDown:le(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||q(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:d.jsx(De.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":p.swipeDirection,...y,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:le(e.onKeyDown,b=>{b.key==="Escape"&&(a==null||a(b.nativeEvent),b.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:le(e.onPointerDown,b=>{b.button===0&&(_.current={x:b.clientX,y:b.clientY})}),onPointerMove:le(e.onPointerMove,b=>{if(!_.current)return;const V=b.clientX-_.current.x,te=b.clientY-_.current.y,B=!!C.current,Z=["left","right"].includes(p.swipeDirection),I=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,Q=Z?I(0,V):0,z=Z?0:I(0,te),$=b.pointerType==="touch"?10:2,de={x:Q,y:z},ne={originalEvent:b,delta:de};B?(C.current=de,eu(C3,u,ne,{discrete:!1})):tw(de,p.swipeDirection,$)?(C.current=de,eu(k3,f,ne,{discrete:!1}),b.target.setPointerCapture(b.pointerId)):(Math.abs(V)>$||Math.abs(te)>$)&&(_.current=null)}),onPointerUp:le(e.onPointerUp,b=>{const V=C.current,te=b.target;if(te.hasPointerCapture(b.pointerId)&&te.releasePointerCapture(b.pointerId),C.current=null,_.current=null,V){const B=b.currentTarget,Z={originalEvent:b,delta:V};tw(V,p.swipeDirection,p.swipeThreshold)?eu(T3,m,Z,{discrete:!0}):eu(E3,h,Z,{discrete:!0}),B.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),j3=e=>{const{__scopeToast:t,children:r,...n}=e,s=mf(gf,t),[o,i]=w.useState(!1),[a,l]=w.useState(!1);return A3(()=>i(!0)),w.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:d.jsx(Jl,{asChild:!0,children:d.jsx(dc,{...n,children:o&&d.jsxs(d.Fragment,{children:[s.label," ",r]})})})},D3="ToastTitle",Xk=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return d.jsx(De.div,{...n,ref:t})});Xk.displayName=D3;var O3="ToastDescription",Qk=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return d.jsx(De.div,{...n,ref:t})});Qk.displayName=O3;var Jk="ToastAction",eC=w.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?d.jsx(rC,{altText:r,asChild:!0,children:d.jsx(mv,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Jk}\`. Expected non-empty \`string\`.`),null)});eC.displayName=Jk;var tC="ToastClose",mv=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=N3(tC,r);return d.jsx(rC,{asChild:!0,children:d.jsx(De.button,{type:"button",...n,ref:t,onClick:le(e.onClick,s.onClose)})})});mv.displayName=tC;var rC=w.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return d.jsx(De.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function nC(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),M3(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(...nC(n))}}),t}function eu(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?cg(s,o):s.dispatchEvent(o)}var tw=(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 A3(e=()=>{}){const t=Pt(e);rr(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function M3(e){return e.nodeType===e.ELEMENT_NODE}function I3(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 xh(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var L3=Yk,sC=Gk,oC=qk,iC=Xk,aC=Qk,lC=eC,cC=mv;const F3=L3,uC=w.forwardRef(({className:e,...t},r)=>d.jsx(sC,{ref:r,className:we("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}));uC.displayName=sC.displayName;const z3=ql("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"}}),dC=w.forwardRef(({className:e,variant:t,...r},n)=>d.jsx(oC,{ref:n,className:we(z3({variant:t}),e),...r}));dC.displayName=oC.displayName;const U3=w.forwardRef(({className:e,...t},r)=>d.jsx(lC,{ref:r,className:we("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}));U3.displayName=lC.displayName;const fC=w.forwardRef(({className:e,...t},r)=>d.jsx(cC,{ref:r,className:we("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:d.jsx(og,{className:"h-4 w-4"})}));fC.displayName=cC.displayName;const hC=w.forwardRef(({className:e,...t},r)=>d.jsx(iC,{ref:r,className:we("text-sm font-semibold",e),...t}));hC.displayName=iC.displayName;const pC=w.forwardRef(({className:e,...t},r)=>d.jsx(aC,{ref:r,className:we("text-sm opacity-90",e),...t}));pC.displayName=aC.displayName;const $3=1,V3=1e6;let _h=0;function B3(){return _h=(_h+1)%Number.MAX_SAFE_INTEGER,_h.toString()}const bh=new Map,rw=e=>{if(bh.has(e))return;const t=setTimeout(()=>{bh.delete(e),Xa({type:"REMOVE_TOAST",toastId:e})},V3);bh.set(e,t)},W3=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,$3)};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?rw(r):e.toasts.forEach(n=>{rw(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)}}},bu=[];let Su={toasts:[]};function Xa(e){Su=W3(Su,e),bu.forEach(t=>{t(Su)})}function H3({...e}){const t=B3(),r=s=>Xa({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>Xa({type:"DISMISS_TOAST",toastId:t});return Xa({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function gv(){const[e,t]=w.useState(Su);return w.useEffect(()=>(bu.push(t),()=>{const r=bu.indexOf(t);r>-1&&bu.splice(r,1)}),[e]),{...e,toast:H3,dismiss:r=>Xa({type:"DISMISS_TOAST",toastId:r})}}function mC(){const{toasts:e}=gv();return d.jsxs(F3,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return d.jsxs(dC,{...o,children:[d.jsxs("div",{className:"grid gap-1",children:[r&&d.jsx(hC,{children:r}),n&&d.jsx(pC,{children:n})]}),s,d.jsx(fC,{})]},t)}),d.jsx(uC,{})]})}var[vf,mU]=Er("Tooltip",[ua]),yf=ua(),gC="TooltipProvider",Y3=700,Vp="tooltip.open",[Z3,vv]=vf(gC),vC=e=>{const{__scopeTooltip:t,delayDuration:r=Y3,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,[i,a]=w.useState(!0),l=w.useRef(!1),c=w.useRef(0);return w.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),d.jsx(Z3,{scope:t,isOpenDelayed:i,delayDuration:r,onOpen:w.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:w.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:w.useCallback(f=>{l.current=f},[]),disableHoverableContent:s,children:o})};vC.displayName=gC;var wf="Tooltip",[G3,xf]=vf(wf),yC=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:a}=e,l=vv(wf,e.__scopeTooltip),c=yf(t),[f,u]=w.useState(null),h=On(),m=w.useRef(0),y=i??l.disableHoverableContent,p=a??l.delayDuration,x=w.useRef(!1),[g=!1,v]=ps({prop:n,defaultProp:s,onChange:P=>{P?(l.onOpen(),document.dispatchEvent(new CustomEvent(Vp))):l.onClose(),o==null||o(P)}}),_=w.useMemo(()=>g?x.current?"delayed-open":"instant-open":"closed",[g]),C=w.useCallback(()=>{window.clearTimeout(m.current),x.current=!1,v(!0)},[v]),E=w.useCallback(()=>{window.clearTimeout(m.current),v(!1)},[v]),T=w.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{x.current=!0,v(!0)},p)},[p,v]);return w.useEffect(()=>()=>window.clearTimeout(m.current),[]),d.jsx(xg,{...c,children:d.jsx(G3,{scope:t,contentId:h,open:g,stateAttribute:_,trigger:f,onTriggerChange:u,onTriggerEnter:w.useCallback(()=>{l.isOpenDelayed?T():C()},[l.isOpenDelayed,T,C]),onTriggerLeave:w.useCallback(()=>{y?E():window.clearTimeout(m.current)},[E,y]),onOpen:C,onClose:E,disableHoverableContent:y,children:r})})};yC.displayName=wf;var Bp="TooltipTrigger",wC=w.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=xf(Bp,r),o=vv(Bp,r),i=yf(r),a=w.useRef(null),l=ze(t,a,s.onTriggerChange),c=w.useRef(!1),f=w.useRef(!1),u=w.useCallback(()=>c.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),d.jsx(_g,{asChild:!0,...i,children:d.jsx(De.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:le(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:le(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:le(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:le(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:le(e.onBlur,s.onClose),onClick:le(e.onClick,s.onClose)})})});wC.displayName=Bp;var K3="TooltipPortal",[gU,q3]=vf(K3,{forceMount:void 0}),qi="TooltipContent",yv=w.forwardRef((e,t)=>{const r=q3(qi,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,i=xf(qi,e.__scopeTooltip);return d.jsx(vr,{present:n||i.open,children:i.disableHoverableContent?d.jsx(xC,{side:s,...o,ref:t}):d.jsx(X3,{side:s,...o,ref:t})})}),X3=w.forwardRef((e,t)=>{const r=xf(qi,e.__scopeTooltip),n=vv(qi,e.__scopeTooltip),s=w.useRef(null),o=ze(t,s),[i,a]=w.useState(null),{trigger:l,onClose:c}=r,f=s.current,{onPointerInTransitChange:u}=n,h=w.useCallback(()=>{a(null),u(!1)},[u]),m=w.useCallback((y,p)=>{const x=y.currentTarget,g={x:y.clientX,y:y.clientY},v=t5(g,x.getBoundingClientRect()),_=r5(g,v),C=n5(p.getBoundingClientRect()),E=o5([..._,...C]);a(E),u(!0)},[u]);return w.useEffect(()=>()=>h(),[h]),w.useEffect(()=>{if(l&&f){const y=x=>m(x,f),p=x=>m(x,l);return l.addEventListener("pointerleave",y),f.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",p)}}},[l,f,m,h]),w.useEffect(()=>{if(i){const y=p=>{const x=p.target,g={x:p.clientX,y:p.clientY},v=(l==null?void 0:l.contains(x))||(f==null?void 0:f.contains(x)),_=!s5(g,i);v?h():_&&(h(),c())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,f,i,c,h]),d.jsx(xC,{...e,ref:o})}),[Q3,J3]=vf(wf,{isInside:!1}),xC=w.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...a}=e,l=xf(qi,r),c=yf(r),{onClose:f}=l;return w.useEffect(()=>(document.addEventListener(Vp,f),()=>document.removeEventListener(Vp,f)),[f]),w.useEffect(()=>{if(l.trigger){const u=h=>{const m=h.target;m!=null&&m.contains(l.trigger)&&f()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[l.trigger,f]),d.jsx(aa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:u=>u.preventDefault(),onDismiss:f,children:d.jsxs(bg,{"data-state":l.stateAttribute,...c,...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:[d.jsx(ig,{children:n}),d.jsx(Q3,{scope:r,isInside:!0,children:d.jsx(w3,{id:l.contentId,role:"tooltip",children:s||n})})]})})});yv.displayName=qi;var _C="TooltipArrow",e5=w.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=yf(r);return J3(_C,r).isInside?null:d.jsx(Sg,{...s,...n,ref:t})});e5.displayName=_C;function t5(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 r5(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 n5(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 s5(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;on!=f>n&&r<(c-a)*(n-l)/(f-l)+a&&(s=!s)}return s}function o5(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),i5(t)}function i5(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 a5=yC,l5=wC,bC=yv;const c5=a5,u5=l5,d5=w.forwardRef(({className:e,sideOffset:t=4,...r},n)=>d.jsx(bC,{ref:n,sideOffset:t,className:we("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}));d5.displayName=bC.displayName;function tu(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 SC={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(c,f){if(!s[c]){if(!n[c]){var u=typeof tu=="function"&&tu;if(!f&&u)return u(c,!0);if(a)return a(c,!0);var h=new Error("Cannot find module '"+c+"'");throw h.code="MODULE_NOT_FOUND",h}var m=s[c]={exports:{}};n[c][0].call(m.exports,function(y){var p=n[c][1][y];return i(p||y)},m,m.exports,r,n,s,o)}return s[c].exports}for(var a=typeof tu=="function"&&tu,l=0;l>2,m=(3&c)<<4|f>>4,y=1<_?(15&f)<<2|u>>6:64,p=2<_?63&u:64,x.push(a.charAt(h)+a.charAt(m)+a.charAt(y)+a.charAt(p));return x.join("")},s.decode=function(l){var c,f,u,h,m,y,p=0,x=0,g="data:";if(l.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");var v,_=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(v=i.uint8array?new Uint8Array(0|_):new Array(0|_);p>4,f=(15&h)<<4|(m=a.indexOf(l.charAt(p++)))>>2,u=(3&m)<<6|(y=a.indexOf(l.charAt(p++))),v[x++]=c,m!==64&&(v[x++]=f),y!==64&&(v[x++]=u);return v}},{"./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 c(f,u,h,m,y){this.compressedSize=f,this.uncompressedSize=u,this.crc32=h,this.compression=m,this.compressedContent=y}c.prototype={getContentWorker:function(){var f=new i(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),u=this;return f.on("end",function(){if(this.streamInfo.data_length!==u.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),f},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)}},c.createWorkerFrom=function(f,u,h){return f.pipe(new a).pipe(new l("uncompressedSize")).pipe(u.compressWorker(h)).pipe(new l("compressedSize")).withStreamInfo("compression",u)},n.exports=c},{"./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=[],c=0;c<256;c++){a=c;for(var f=0;f<8;f++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l}();n.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(c,f,u,h){var m=i,y=h+u;c^=-1;for(var p=h;p>>8^m[255&(c^f[p])];return-1^c}(0|l,a,a.length,0):function(c,f,u,h){var m=i,y=h+u;c^=-1;for(var p=h;p>>8^m[255&(c^f.charCodeAt(p))];return-1^c}(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"),c=o?"uint8array":"array";function f(u,h){l.call(this,"FlateWorker/"+u),this._pako=null,this._pakoAction=u,this._pakoOptions=h,this.meta={}}s.magic="\b\0",a.inherits(f,l),f.prototype.processChunk=function(u){this.meta=u.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,u.data),!1)},f.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},f.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},f.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var u=this;this._pako.onData=function(h){u.push({data:h,meta:u.meta})}},s.compressWorker=function(u){return new f("Deflate",u)},s.uncompressWorker=function(){return new f("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,s){function o(m,y){var p,x="";for(p=0;p>>=8;return x}function i(m,y,p,x,g,v){var _,C,E=m.file,T=m.compression,P=v!==c.utf8encode,O=a.transformTo("string",v(E.name)),j=a.transformTo("string",c.utf8encode(E.name)),L=E.comment,q=a.transformTo("string",v(L)),R=a.transformTo("string",c.utf8encode(L)),F=j.length!==E.name.length,b=R.length!==L.length,V="",te="",B="",Z=E.dir,I=E.date,Q={crc32:0,compressedSize:0,uncompressedSize:0};y&&!p||(Q.crc32=m.crc32,Q.compressedSize=m.compressedSize,Q.uncompressedSize=m.uncompressedSize);var z=0;y&&(z|=8),P||!F&&!b||(z|=2048);var $=0,de=0;Z&&($|=16),g==="UNIX"?(de=798,$|=function(se,Ee){var fe=se;return se||(fe=Ee?16893:33204),(65535&fe)<<16}(E.unixPermissions,Z)):(de=20,$|=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(f(O),4)+j,V+="up"+o(te.length,2)+te),b&&(B=o(1,1)+o(f(q),4)+R,V+="uc"+o(B.length,2)+B);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(O.length,2),ne+=o(V.length,2),{fileRecord:u.LOCAL_FILE_HEADER+ne+O+V,dirRecord:u.CENTRAL_FILE_HEADER+o(de,2)+ne+o(q.length,2)+"\0\0\0\0"+o($,4)+o(x,4)+O+V+q}}var a=r("../utils"),l=r("../stream/GenericWorker"),c=r("../utf8"),f=r("../crc32"),u=r("../signature");function h(m,y,p,x){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=p,this.encodeFileName=x,this.streamFiles=m,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(h,l),h.prototype.push=function(m){var y=m.meta.percent||0,p=this.entriesCount,x=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:p?(y+100*(p-x-1))/p:100}}))},h.prototype.openedSource=function(m){this.currentSourceOffset=this.bytesWritten,this.currentFile=m.file.name;var y=this.streamFiles&&!m.file.dir;if(y){var p=i(m,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:p.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(m){this.accumulate=!1;var y=this.streamFiles&&!m.file.dir,p=i(m,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(p.dirRecord),y)this.push({data:function(x){return u.DATA_DESCRIPTOR+o(x.crc32,4)+o(x.compressedSize,4)+o(x.uncompressedSize,4)}(m),meta:{percent:100}});else for(this.push({data:p.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var m=this.bytesWritten,y=0;y=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},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"),c=r("./NodeBufferReader"),f=r("./Uint8ArrayReader");n.exports=function(u){var h=o.getTypeOf(u);return o.checkSupport(h),h!=="string"||i.uint8array?h==="nodebuffer"?new c(u):i.uint8array?new f(o.transformTo("uint8array",u)):new a(o.transformTo("array",u)):new l(u)}},{"../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 c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+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 c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(f){c.dataIsReady=!0,c.data=f,c.max=f&&f.length||0,c.type=o.getTypeOf(f),c.isPaused||c._tickAndRepeat()},function(f){c.error(f)})}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,c=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,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,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"),c=r("../support"),f=r("../external"),u=null;if(c.nodestream)try{u=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function h(y,p){return new f.Promise(function(x,g){var v=[],_=y._internalType,C=y._outputType,E=y._mimeType;y.on("data",function(T,P){v.push(T),p&&p(P)}).on("error",function(T){v=[],g(T)}).on("end",function(){try{var T=function(P,O,j){switch(P){case"blob":return o.newBlob(o.transformTo("arraybuffer",O),j);case"base64":return l.encode(O);default:return o.transformTo(P,O)}}(C,function(P,O){var j,L=0,q=null,R=0;for(j=0;j"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"),c=new Array(256),f=0;f<256;f++)c[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;c[254]=c[254]=1;function u(){l.call(this,"utf-8 decode"),this.leftOver=null}function h(){l.call(this,"utf-8 encode")}s.utf8encode=function(m){return i.nodebuffer?a.newBufferFrom(m,"utf-8"):function(y){var p,x,g,v,_,C=y.length,E=0;for(v=0;v>>6:(x<65536?p[_++]=224|x>>>12:(p[_++]=240|x>>>18,p[_++]=128|x>>>12&63),p[_++]=128|x>>>6&63),p[_++]=128|63&x);return p}(m)},s.utf8decode=function(m){return i.nodebuffer?o.transformTo("nodebuffer",m).toString("utf-8"):function(y){var p,x,g,v,_=y.length,C=new Array(2*_);for(p=x=0;p<_;)if((g=y[p++])<128)C[x++]=g;else if(4<(v=c[g]))C[x++]=65533,p+=v-1;else{for(g&=v===2?31:v===3?15:7;1>10&1023,C[x++]=56320|1023&g)}return C.length!==x&&(C.subarray?C=C.subarray(0,x):C.length=x),o.applyFromCharCode(C)}(m=o.transformTo(i.uint8array?"uint8array":"array",m))},o.inherits(u,l),u.prototype.processChunk=function(m){var y=o.transformTo(i.uint8array?"uint8array":"array",m.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var p=y;(y=new Uint8Array(p.length+this.leftOver.length)).set(this.leftOver,0),y.set(p,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var x=function(v,_){var C;for((_=_||v.length)>v.length&&(_=v.length),C=_-1;0<=C&&(192&v[C])==128;)C--;return C<0||C===0?_:C+c[v[C]]>_?C:_}(y),g=y;x!==y.length&&(i.uint8array?(g=y.subarray(0,x),this.leftOver=y.subarray(x,y.length)):(g=y.slice(0,x),this.leftOver=y.slice(x,y.length))),this.push({data:s.utf8decode(g),meta:m.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=u,o.inherits(h,l),h.prototype.processChunk=function(m){this.push({data:s.utf8encode(m.data),meta:m.meta})},s.Utf8EncodeWorker=h},{"./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 c(p){return p}function f(p,x){for(var g=0;g>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 y,p,x,g=m.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});m.index+4>>6:(m<65536?h[x++]=224|m>>>12:(h[x++]=240|m>>>18,h[x++]=128|m>>>12&63),h[x++]=128|m>>>6&63),h[x++]=128|63&m);return h},s.buf2binstring=function(u){return f(u,u.length)},s.binstring2buf=function(u){for(var h=new o.Buf8(u.length),m=0,y=h.length;m>10&1023,v[y++]=56320|1023&p)}return f(v,y)},s.utf8border=function(u,h){var m;for((h=h||u.length)>u.length&&(h=u.length),m=h-1;0<=m&&(192&u[m])==128;)m--;return m<0||m===0?h:m+l[u[m]]>h?m:h}},{"./common":41}],43:[function(r,n,s){n.exports=function(o,i,a,l){for(var c=65535&o|0,f=o>>>16&65535|0,u=0;a!==0;){for(a-=u=2e3>>1:i>>>1;a[l]=i}return a}();n.exports=function(i,a,l,c){var f=o,u=c+l;i^=-1;for(var h=c;h>>8^f[255&(i^a[h])];return-1^i}},{}],46:[function(r,n,s){var o,i=r("../utils/common"),a=r("./trees"),l=r("./adler32"),c=r("./crc32"),f=r("./messages"),u=0,h=4,m=0,y=-2,p=-1,x=4,g=2,v=8,_=9,C=286,E=30,T=19,P=2*C+1,O=15,j=3,L=258,q=L+j+1,R=42,F=113,b=1,V=2,te=3,B=4;function Z(k,J){return k.msg=f[J],J}function I(k){return(k<<1)-(4k.avail_out&&(G=k.avail_out),G!==0&&(i.arraySet(k.output,J.pending_buf,J.pending_out,G,k.next_out),k.next_out+=G,J.pending_out+=G,k.total_out+=G,k.avail_out-=G,J.pending-=G,J.pending===0&&(J.pending_out=0))}function $(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 G,D,S=k.max_chain_length,N=k.strstart,A=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,Le=H[N+A-1],Oe=H[N+A];k.prev_length>=k.good_match&&(S>>=2),Y>k.lookahead&&(Y=k.lookahead);do if(H[(G=J)+A]===Oe&&H[G+A-1]===Le&&H[G]===H[N]&&H[++G]===H[N+1]){N+=2,G++;do;while(H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&H[++N]===H[++G]&&NM&&--S!=0);return A<=k.lookahead?A:k.lookahead}function Ee(k){var J,G,D,S,N,A,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=G=k.hash_size;D=k.head[--J],k.head[J]=ee<=D?D-ee:0,--G;);for(J=G=ee;D=k.prev[--J],k.prev[J]=ee<=D?D-ee:0,--G;);S+=ee}if(k.strm.avail_in===0)break;if(A=k.strm,Y=k.window,M=k.strstart+k.lookahead,H=S,X=void 0,X=A.avail_in,H=j)for(N=k.strstart-k.insert,k.ins_h=k.window[N],k.ins_h=(k.ins_h<=j&&(k.ins_h=(k.ins_h<=j)if(D=a._tr_tally(k,k.strstart-k.match_start,k.match_length-j),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=j){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<=j&&(k.ins_h=(k.ins_h<=j&&k.match_length<=k.prev_length){for(S=k.strstart+k.lookahead-j,D=a._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-j),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=S&&(k.ins_h=(k.ins_h<k.pending_buf_size-5&&(G=k.pending_buf_size-5);;){if(k.lookahead<=1){if(Ee(k),k.lookahead===0&&J===u)return b;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var D=k.block_start+G;if((k.strstart===0||k.strstart>=D)&&(k.lookahead=k.strstart-D,k.strstart=D,$(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-q&&($(k,!1),k.strm.avail_out===0))return b}return k.insert=0,J===h?($(k,!0),k.strm.avail_out===0?te:B):(k.strstart>k.block_start&&($(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,ge),new be(8,16,32,32,ge),new be(8,16,128,128,ge),new be(8,32,128,256,ge),new be(32,128,258,1024,ge),new be(32,258,258,4096,ge)],s.deflateInit=function(k,J){return Ke(k,J,v,15,8,0)},s.deflateInit2=Ke,s.deflateReset=Se,s.deflateResetKeep=Te,s.deflateSetHeader=function(k,J){return k&&k.state?k.state.wrap!==2?y:(k.state.gzhead=J,m):y},s.deflate=function(k,J){var G,D,S,N;if(!k||!k.state||5>8&255),de(D,D.gzhead.time>>16&255),de(D,D.gzhead.time>>24&255),de(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),de(D,255&D.gzhead.os),D.gzhead.extra&&D.gzhead.extra.length&&(de(D,255&D.gzhead.extra.length),de(D,D.gzhead.extra.length>>8&255)),D.gzhead.hcrc&&(k.adler=c(k.adler,D.pending_buf,D.pending,0)),D.gzindex=0,D.status=69):(de(D,0),de(D,0),de(D,0),de(D,0),de(D,0),de(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),de(D,3),D.status=F);else{var A=v+(D.w_bits-8<<4)<<8;A|=(2<=D.strategy||D.level<2?0:D.level<6?1:D.level===6?2:3)<<6,D.strstart!==0&&(A|=32),A+=31-A%31,D.status=F,ne(D,A),D.strstart!==0&&(ne(D,k.adler>>>16),ne(D,65535&k.adler)),k.adler=1}if(D.status===69)if(D.gzhead.extra){for(S=D.pending;D.gzindex<(65535&D.gzhead.extra.length)&&(D.pending!==D.pending_buf_size||(D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending!==D.pending_buf_size));)de(D,255&D.gzhead.extra[D.gzindex]),D.gzindex++;D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),D.gzindex===D.gzhead.extra.length&&(D.gzindex=0,D.status=73)}else D.status=73;if(D.status===73)if(D.gzhead.name){S=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending===D.pending_buf_size)){N=1;break}N=D.gzindexS&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),N===0&&(D.gzindex=0,D.status=91)}else D.status=91;if(D.status===91)if(D.gzhead.comment){S=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending===D.pending_buf_size)){N=1;break}N=D.gzindexS&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),N===0&&(D.status=103)}else D.status=103;if(D.status===103&&(D.gzhead.hcrc?(D.pending+2>D.pending_buf_size&&z(k),D.pending+2<=D.pending_buf_size&&(de(D,255&k.adler),de(D,k.adler>>8&255),k.adler=0,D.status=F)):D.status=F),D.pending!==0){if(z(k),k.avail_out===0)return D.last_flush=-1,m}else if(k.avail_in===0&&I(J)<=I(G)&&J!==h)return Z(k,-5);if(D.status===666&&k.avail_in!==0)return Z(k,-5);if(k.avail_in!==0||D.lookahead!==0||J!==u&&D.status!==666){var Y=D.strategy===2?function(M,H){for(var X;;){if(M.lookahead===0&&(Ee(M),M.lookahead===0)){if(H===u)return b;break}if(M.match_length=0,X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,X&&($(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===h?($(M,!0),M.strm.avail_out===0?te:B):M.last_lit&&($(M,!1),M.strm.avail_out===0)?b:V}(D,J):D.strategy===3?function(M,H){for(var X,ee,he,Le,Oe=M.window;;){if(M.lookahead<=L){if(Ee(M),M.lookahead<=L&&H===u)return b;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=j&&0M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=j?(X=a._tr_tally(M,1,M.match_length-j),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&&($(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===h?($(M,!0),M.strm.avail_out===0?te:B):M.last_lit&&($(M,!1),M.strm.avail_out===0)?b:V}(D,J):o[D.level].func(D,J);if(Y!==te&&Y!==B||(D.status=666),Y===b||Y===te)return k.avail_out===0&&(D.last_flush=-1),m;if(Y===V&&(J===1?a._tr_align(D):J!==5&&(a._tr_stored_block(D,0,0,!1),J===3&&(Q(D.head),D.lookahead===0&&(D.strstart=0,D.block_start=0,D.insert=0))),z(k),k.avail_out===0))return D.last_flush=-1,m}return J!==h?m:D.wrap<=0?1:(D.wrap===2?(de(D,255&k.adler),de(D,k.adler>>8&255),de(D,k.adler>>16&255),de(D,k.adler>>24&255),de(D,255&k.total_in),de(D,k.total_in>>8&255),de(D,k.total_in>>16&255),de(D,k.total_in>>24&255)):(ne(D,k.adler>>>16),ne(D,65535&k.adler)),z(k),0=G.w_size&&(N===0&&(Q(G.head),G.strstart=0,G.block_start=0,G.insert=0),H=new i.Buf8(G.w_size),i.arraySet(H,J,X-G.w_size,G.w_size,0),J=H,X=G.w_size),A=k.avail_in,Y=k.next_in,M=k.input,k.avail_in=X,k.next_in=0,k.input=J,Ee(G);G.lookahead>=j;){for(D=G.strstart,S=G.lookahead-(j-1);G.ins_h=(G.ins_h<>>=j=O>>>24,_-=j,(j=O>>>16&255)===0)V[f++]=65535&O;else{if(!(16&j)){if(!(64&j)){O=C[(65535&O)+(v&(1<>>=j,_-=j),_<15&&(v+=b[l++]<<_,_+=8,v+=b[l++]<<_,_+=8),O=E[v&P];r:for(;;){if(v>>>=j=O>>>24,_-=j,!(16&(j=O>>>16&255))){if(!(64&j)){O=E[(65535&O)+(v&(1<>>=j,_-=j,(j=f-u)>3,v&=(1<<(_-=L<<3))-1,o.next_in=l,o.next_out=f,o.avail_in=l>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function v(){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 _(R){var F;return R&&R.state?(F=R.state,R.total_in=R.total_out=F.total=0,R.msg="",F.wrap&&(R.adler=1&F.wrap),F.mode=y,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new o.Buf32(p),F.distcode=F.distdyn=new o.Buf32(x),F.sane=1,F.back=-1,h):m}function C(R){var F;return R&&R.state?((F=R.state).wsize=0,F.whave=0,F.wnext=0,_(R)):m}function E(R,F){var b,V;return R&&R.state?(V=R.state,F<0?(b=0,F=-F):(b=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15=B.wsize?(o.arraySet(B.window,F,b-B.wsize,B.wsize,0),B.wnext=0,B.whave=B.wsize):(V<(te=B.wsize-B.wnext)&&(te=V),o.arraySet(B.window,F,b-V,te,B.wnext),(V-=te)?(o.arraySet(B.window,F,b-V,V,0),B.wnext=V,B.whave=B.wsize):(B.wnext+=te,B.wnext===B.wsize&&(B.wnext=0),B.whave>>8&255,b.check=a(b.check,N,2,0),$=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){R.msg="incorrect header check",b.mode=30;break}if((15&z)!=8){R.msg="unknown compression method",b.mode=30;break}if($-=4,k=8+(15&(z>>>=4)),b.wbits===0)b.wbits=k;else if(k>b.wbits){R.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)),$=z=0,b.mode=3;case 3:for(;$<32;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}b.head&&(b.head.time=z),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,N[2]=z>>>16&255,N[3]=z>>>24&255,b.check=a(b.check,N,4,0)),$=z=0,b.mode=4;case 4:for(;$<16;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}b.head&&(b.head.xflags=255&z,b.head.os=z>>8),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,b.check=a(b.check,N,2,0)),$=z=0,b.mode=5;case 5:if(1024&b.flags){for(;$<16;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}b.length=z,b.head&&(b.head.extra_len=z),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,b.check=a(b.check,N,2,0)),$=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,V,B,se,k)),512&b.flags&&(b.check=a(b.check,V,se,B)),I-=se,B+=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=V[B+se++],b.head&&k&&b.length<65536&&(b.head.name+=String.fromCharCode(k)),k&&se>9&1,b.head.done=!0),R.adler=b.check=0,b.mode=12;break;case 10:for(;$<32;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}R.adler=b.check=g(z),$=z=0,b.mode=11;case 11:if(b.havedict===0)return R.next_out=Z,R.avail_out=Q,R.next_in=B,R.avail_in=I,b.hold=z,b.bits=$,2;R.adler=b.check=1,b.mode=12;case 12:if(F===5||F===6)break e;case 13:if(b.last){z>>>=7&$,$-=7&$,b.mode=27;break}for(;$<3;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}switch(b.last=1&z,$-=1,3&(z>>>=1)){case 0:b.mode=14;break;case 1:if(L(b),b.mode=20,F!==6)break;z>>>=2,$-=2;break e;case 2:b.mode=17;break;case 3:R.msg="invalid block type",b.mode=30}z>>>=2,$-=2;break;case 14:for(z>>>=7&$,$-=7&$;$<32;){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}if((65535&z)!=(z>>>16^65535)){R.msg="invalid stored block lengths",b.mode=30;break}if(b.length=65535&z,$=z=0,b.mode=15,F===6)break e;case 15:b.mode=16;case 16:if(se=b.length){if(I>>=5,$-=5,b.ndist=1+(31&z),z>>>=5,$-=5,b.ncode=4+(15&z),z>>>=4,$-=4,286>>=3,$-=3}for(;b.have<19;)b.lens[A[b.have++]]=0;if(b.lencode=b.lendyn,b.lenbits=7,G={bits:b.lenbits},J=c(0,b.lens,0,19,b.lencode,0,b.work,G),b.lenbits=G.bits,J){R.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,!((ge=S>>>24)<=$);){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}if(Pe<16)z>>>=ge,$-=ge,b.lens[b.have++]=Pe;else{if(Pe===16){for(D=ge+2;$>>=ge,$-=ge,b.have===0){R.msg="invalid bit length repeat",b.mode=30;break}k=b.lens[b.have-1],se=3+(3&z),z>>>=2,$-=2}else if(Pe===17){for(D=ge+3;$>>=ge)),z>>>=3,$-=3}else{for(D=ge+7;$>>=ge)),z>>>=7,$-=7}if(b.have+se>b.nlen+b.ndist){R.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){R.msg="invalid code -- missing end-of-block",b.mode=30;break}if(b.lenbits=9,G={bits:b.lenbits},J=c(f,b.lens,0,b.nlen,b.lencode,0,b.work,G),b.lenbits=G.bits,J){R.msg="invalid literal/lengths set",b.mode=30;break}if(b.distbits=6,b.distcode=b.distdyn,G={bits:b.distbits},J=c(u,b.lens,b.nlen,b.ndist,b.distcode,0,b.work,G),b.distbits=G.bits,J){R.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){R.next_out=Z,R.avail_out=Q,R.next_in=B,R.avail_in=I,b.hold=z,b.bits=$,l(R,ne),Z=R.next_out,te=R.output,Q=R.avail_out,B=R.next_in,V=R.input,I=R.avail_in,z=b.hold,$=b.bits,b.mode===12&&(b.back=-1);break}for(b.back=0;be=(S=b.lencode[z&(1<>>16&255,Pe=65535&S,!((ge=S>>>24)<=$);){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}if(be&&!(240&be)){for(Te=ge,Se=be,Ke=Pe;be=(S=b.lencode[Ke+((z&(1<>Te)])>>>16&255,Pe=65535&S,!(Te+(ge=S>>>24)<=$);){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}z>>>=Te,$-=Te,b.back+=Te}if(z>>>=ge,$-=ge,b.back+=ge,b.length=Pe,be===0){b.mode=26;break}if(32&be){b.back=-1,b.mode=12;break}if(64&be){R.msg="invalid literal/length code",b.mode=30;break}b.extra=15&be,b.mode=22;case 22:if(b.extra){for(D=b.extra;$>>=b.extra,$-=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,!((ge=S>>>24)<=$);){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}if(!(240&be)){for(Te=ge,Se=be,Ke=Pe;be=(S=b.distcode[Ke+((z&(1<>Te)])>>>16&255,Pe=65535&S,!(Te+(ge=S>>>24)<=$);){if(I===0)break e;I--,z+=V[B++]<<$,$+=8}z>>>=Te,$-=Te,b.back+=Te}if(z>>>=ge,$-=ge,b.back+=ge,64&be){R.msg="invalid distance code",b.mode=30;break}b.offset=Pe,b.extra=15&be,b.mode=24;case 24:if(b.extra){for(D=b.extra;$>>=b.extra,$-=b.extra,b.back+=b.extra}if(b.offset>b.dmax){R.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){R.msg="invalid distance too far back",b.mode=30;break}Ee=se>b.wnext?(se-=b.wnext,b.wsize-se):b.wnext-se,se>b.length&&(se=b.length),fe=b.window}else fe=te,Ee=Z-b.offset,se=b.length;for(QP?(j=Ee[fe+x[F]],$[de+x[F]]):(j=96,0),v=1<>Z)+(_-=v)]=O<<24|j<<16|L|0,_!==0;);for(v=1<>=1;if(v!==0?(z&=v-1,z+=v):z=0,F++,--ne[R]==0){if(R===V)break;R=u[h+x[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,A){S.bi_valid>g-A?(S.bi_buf|=N<>g-S.bi_valid,S.bi_valid+=A-g):(S.bi_buf|=N<>>=1,A<<=1,0<--N;);return A>>>1}function fe(S,N,A){var Y,M,H=new Array(x+1),X=0;for(Y=1;Y<=x;Y++)H[Y]=X=X+A[Y-1]<<1;for(M=0;M<=N;M++){var ee=S[2*M+1];ee!==0&&(S[2*M]=Ee(H[ee]++,ee))}}function ge(S){var N;for(N=0;N>1;1<=A;A--)Te(S,H,A);for(M=he;A=S.heap[1],S.heap[1]=S.heap[S.heap_len--],Te(S,H,1),Y=S.heap[1],S.heap[--S.heap_max]=A,S.heap[--S.heap_max]=Y,H[2*M]=H[2*A]+H[2*Y],S.depth[M]=(S.depth[A]>=S.depth[Y]?S.depth[A]:S.depth[Y])+1,H[2*A+1]=H[2*Y+1]=M,S.heap[1]=M++,Te(S,H,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(Oe,St){var Vr,Vt,Vn,Je,Bn,Wn,Br=St.dyn_tree,yc=St.max_code,wc=St.stat_desc.static_tree,Qo=St.stat_desc.has_stree,xc=St.stat_desc.extra_bits,Jo=St.stat_desc.extra_base,_n=St.stat_desc.max_length,Ts=0;for(Je=0;Je<=x;Je++)Oe.bl_count[Je]=0;for(Br[2*Oe.heap[Oe.heap_max]+1]=0,Vr=Oe.heap_max+1;Vr>=7;M>>=1)if(1&Le&&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=A+5,A+4<=M&&N!==-1?D(S,N,A,Y):S.strategy===4||H===M?(ne(S,2+(Y?1:0),3),Se(S,q,R)):(ne(S,4+(Y?1:0),3),function(ee,he,Le,Oe){var St;for(ne(ee,he-257,5),ne(ee,Le-1,5),ne(ee,Oe-4,4),St=0;St>>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&A,S.last_lit++,N===0?S.dyn_ltree[2*A]++:(S.matches++,N--,S.dyn_ltree[2*(b[A]+u+1)]++,S.dyn_dtree[2*$(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,c,f,u,h=1,m={},y=!1,p=i.document,x=Object.getPrototypeOf&&Object.getPrototypeOf(i);x=x&&x.setTimeout?x:i,l={}.toString.call(i.process)==="[object process]"?function(C){process.nextTick(function(){v(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}}()?(u="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",_,!1):i.attachEvent("onmessage",_),function(C){i.postMessage(u+C,"*")}):i.MessageChannel?((f=new MessageChannel).port1.onmessage=function(C){v(C.data)},function(C){f.port2.postMessage(C)}):p&&"onreadystatechange"in p.createElement("script")?(c=p.documentElement,function(C){var E=p.createElement("script");E.onreadystatechange=function(){v(C),E.onreadystatechange=null,c.removeChild(E),E=null},c.appendChild(E)}):function(C){setTimeout(v,0,C)},x.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 Cc<"u"?Cc:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(SC);var f5=SC.exports;const h5=im(f5);function p5(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 m5=async(e,t)=>{const r=new h5;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()},Nl=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)},g5=e=>Nl(e).split(" ")[0],v5=async()=>Xt().collection("domains").getFullList({sort:"-created",expand:"lastDeployment"}),y5=async e=>await Xt().collection("domains").getOne(e),Wp=async e=>e.id?await Xt().collection("domains").update(e.id,e):await Xt().collection("domains").create(e),w5=async e=>await Xt().collection("domains").delete(e),x5=(e,t)=>Xt().collection("domains").subscribe(e,r=>{r.action==="update"&&t(r.record)},{expand:"lastDeployment"}),_5=e=>{Xt().collection("domains").unsubscribe(e)},b5=()=>{const e=gv(),t=po(),r=()=>{t("/edit")},n=u=>{t(`/edit?id=${u}`)},s=u=>{t(`/history?domain=${u}`)},o=async u=>{try{await w5(u),a(i.filter(h=>h.id!==u))}catch(h){console.error("Error deleting domain:",h)}},[i,a]=w.useState([]);w.useEffect(()=>{(async()=>{const h=await v5();a(h)})()},[]);const l=async u=>{const h=i.filter(x=>x.id===u),m=h[0].enabled,y=h[0];y.enabled=!m,await Wp(y);const p=i.map(x=>x.id===u?{...x,checked:!m}:x);a(p)},c=async u=>{try{_5(u.id),x5(u.id,h=>{console.log(h);const m=i.map(y=>y.id===h.id?{...h}:y);a(m)}),u.rightnow=!0,await Wp(u),e.toast({title:"操作成功",description:"已发起部署,请稍后查看部署日志。"})}catch{e.toast({title:"执行失败",description:d.jsxs(d.Fragment,{children:["执行失败,请查看",d.jsx(Kn,{to:`/history?domain=${u.id}`,className:"underline text-blue-500",children:"部署日志"}),"查看详情。"]}),variant:"destructive"})}},f=async u=>{const h=`${u.id}-${u.domain}.zip`,m=[{name:`${u.domain}.pem`,content:u.certificate?u.certificate:""},{name:`${u.domain}.key`,content:u.privateKey?u.privateKey:""}];await m5(h,m)};return d.jsx(d.Fragment,{children:d.jsxs("div",{className:"",children:[d.jsx(mC,{}),d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsx("div",{className:"text-muted-foreground",children:"域名列表"}),d.jsx(Lt,{onClick:r,children:"新增域名"})]}),i.length?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b sm:p-2 mt-5",children:[d.jsx("div",{className:"w-40",children:"域名"}),d.jsx("div",{className:"w-48",children:"有效期限"}),d.jsx("div",{className:"w-32",children:"最近执行状态"}),d.jsx("div",{className:"w-64",children:"最近执行阶段"}),d.jsx("div",{className:"w-40 sm:ml-2",children:"最近执行时间"}),d.jsx("div",{className:"w-32",children:"是否启用"}),d.jsx("div",{className:"grow",children:"操作"})]}),d.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"域名"}),i.map(u=>{var h,m,y,p,x,g;return d.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b sm:p-2 hover:bg-muted/50 text-sm",children:[d.jsx("div",{className:"sm:w-40 w-full pt-1 sm:pt-0 flex items-center",children:u.domain}),d.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:d.jsx("div",{children:u.expiredAt?d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"有效期90天"}),d.jsxs("div",{children:[g5(u.expiredAt),"到期"]})]}):"---"})}),d.jsx("div",{className:"sm:w-32 w-full pt-1 sm:pt-0 flex items-center",children:u.lastDeployedAt&&((h=u.expand)!=null&&h.lastDeployment)?d.jsx(d.Fragment,{children:((m=u.expand.lastDeployment)==null?void 0:m.phase)==="deploy"&&((y=u.expand.lastDeployment)!=null&&y.phaseSuccess)?d.jsx(e1,{size:16,className:"text-green-700"}):d.jsx(t1,{size:16,className:"text-red-700"})}):"---"}),d.jsx("div",{className:"sm:w-64 w-full pt-1 sm:pt-0 flex items-center",children:u.lastDeployedAt&&((p=u.expand)!=null&&p.lastDeployment)?d.jsx(dk,{phase:(x=u.expand.lastDeployment)==null?void 0:x.phase,phaseSuccess:(g=u.expand.lastDeployment)==null?void 0:g.phaseSuccess}):"---"}),d.jsx("div",{className:"sm:w-40 pt-1 sm:pt-0 sm:ml-2 flex items-center",children:u.lastDeployedAt?Nl(u.lastDeployedAt):"---"}),d.jsx("div",{className:"sm:w-32 flex items-center",children:d.jsx(vC,{children:d.jsxs(c5,{children:[d.jsx(u5,{children:d.jsx(Wk,{checked:u.enabled,onCheckedChange:()=>{l(u.id)}})}),d.jsx(yv,{children:d.jsx("div",{className:"border rounded-sm px-3 bg-background text-muted-foreground text-xs",children:u.enabled?"禁用":"启用"})})]})})}),d.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[d.jsx(Lt,{variant:"link",className:"p-0",onClick:()=>s(u.id),children:"部署历史"}),d.jsxs(ew,{when:!!u.enabled,children:[d.jsx(Gt,{orientation:"vertical",className:"h-4 mx-2"}),d.jsx(Lt,{variant:"link",className:"p-0",onClick:()=>c(u),children:"立即部署"})]}),d.jsxs(ew,{when:!!u.expiredAt,children:[d.jsx(Gt,{orientation:"vertical",className:"h-4 mx-2"}),d.jsx(Lt,{variant:"link",className:"p-0",onClick:()=>f(u),children:"下载"})]}),!u.enabled&&d.jsxs(d.Fragment,{children:[d.jsx(Gt,{orientation:"vertical",className:"h-4 mx-2"}),d.jsxs(u3,{children:[d.jsx(d3,{asChild:!0,children:d.jsx(Lt,{variant:"link",className:"p-0",children:"删除"})}),d.jsxs(Dk,{children:[d.jsxs(Ok,{children:[d.jsx(Mk,{children:"删除域名"}),d.jsx(Ik,{children:"确定要删除域名吗?"})]}),d.jsxs(Ak,{children:[d.jsx(Fk,{children:"取消"}),d.jsx(Lk,{onClick:()=>{o(u.id)},children:"确认"})]})]})]}),d.jsx(Gt,{orientation:"vertical",className:"h-4 mx-2"}),d.jsx(Lt,{variant:"link",className:"p-0",onClick:()=>n(u.id),children:"编辑"})]})]})]},u.id)})]}):d.jsx(d.Fragment,{children:d.jsxs("div",{className:"flex flex-col items-center mt-10",children:[d.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:d.jsx(Sp,{size:40,className:"text-primary"})}),d.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),d.jsx(Lt,{onClick:r,className:"mt-3",children:"添加域名"})]})})]})})},wt=w.forwardRef(({className:e,type:t,...r},n)=>d.jsx("input",{type:t,className:we("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}));wt.displayName="Input";var fc=e=>e.type==="checkbox",Ei=e=>e instanceof Date,fr=e=>e==null;const kC=e=>typeof e=="object";var Zt=e=>!fr(e)&&!Array.isArray(e)&&kC(e)&&!Ei(e),CC=e=>Zt(e)&&e.target?fc(e.target)?e.target.checked:e.target.value:e,S5=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,EC=(e,t)=>e.has(S5(t)),k5=e=>{const t=e.constructor&&e.constructor.prototype;return Zt(t)&&t.hasOwnProperty("isPrototypeOf")},wv=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function xr(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(!(wv&&(e instanceof Blob||e instanceof FileList))&&(r||Zt(e)))if(t=r?[]:{},!r&&!k5(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=xr(e[n]));else return e;return t}var _f=e=>Array.isArray(e)?e.filter(Boolean):[],Mt=e=>e===void 0,ce=(e,t,r)=>{if(!t||!Zt(e))return r;const n=_f(t.split(/[,[\].]+?/)).reduce((s,o)=>fr(s)?s:s[o],e);return Mt(n)||n===e?Mt(e[t])?r:e[t]:n},Rn=e=>typeof e=="boolean",xv=e=>/^\w*$/.test(e),TC=e=>_f(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ot=(e,t,r)=>{let n=-1;const s=xv(t)?[t]:TC(t),o=s.length,i=o-1;for(;++nZe.useContext(RC),C5=e=>{const{children:t,...r}=e;return Ze.createElement(RC.Provider,{value:r},t)};var NC=(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]!==an.all&&(t._proxyFormState[i]=!n||an.all),r&&(r[i]=!0),e[i]}});return s},Nr=e=>Zt(e)&&!Object.keys(e).length,PC=(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||an.all))},Qa=e=>Array.isArray(e)?e:[e],jC=(e,t,r)=>!e||!t||e===t||Qa(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function _v(e){const t=Ze.useRef(e);t.current=e,Ze.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function E5(e){const t=bf(),{control:r=t.control,disabled:n,name:s,exact:o}=e||{},[i,a]=Ze.useState(r._formState),l=Ze.useRef(!0),c=Ze.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=Ze.useRef(s);return f.current=s,_v({disabled:n,next:u=>l.current&&jC(f.current,u.name,o)&&PC(u,c.current,r._updateFormState)&&a({...r._formState,...u}),subject:r._subjects.state}),Ze.useEffect(()=>(l.current=!0,c.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),NC(i,r,c.current,!1)}var Pn=e=>typeof e=="string",DC=(e,t,r,n,s)=>Pn(e)?(n&&t.watch.add(e),ce(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),ce(r,o))):(n&&(t.watchAll=!0),r);function T5(e){const t=bf(),{control:r=t.control,name:n,defaultValue:s,disabled:o,exact:i}=e||{},a=Ze.useRef(n);a.current=n,_v({disabled:o,subject:r._subjects.values,next:f=>{jC(a.current,f.name,i)&&c(xr(DC(a.current,r._names,f.values||r._formValues,!1,s)))}});const[l,c]=Ze.useState(r._getWatch(n,s));return Ze.useEffect(()=>r._removeUnmounted()),l}function R5(e){const t=bf(),{name:r,disabled:n,control:s=t.control,shouldUnregister:o}=e,i=EC(s._names.array,r),a=T5({control:s,name:r,defaultValue:ce(s._formValues,r,ce(s._defaultValues,r,e.defaultValue)),exact:!0}),l=E5({control:s,name:r}),c=Ze.useRef(s.register(r,{...e.rules,value:a,...Rn(e.disabled)?{disabled:e.disabled}:{}}));return Ze.useEffect(()=>{const f=s._options.shouldUnregister||o,u=(h,m)=>{const y=ce(s._fields,h);y&&y._f&&(y._f.mount=m)};if(u(r,!0),f){const h=xr(ce(s._options.defaultValues,r));ot(s._defaultValues,r,h),Mt(ce(s._formValues,r))&&ot(s._formValues,r,h)}return()=>{(i?f&&!s._state.action:f)?s.unregister(r):u(r,!1)}},[r,s,i,o]),Ze.useEffect(()=>{ce(s._fields,r)&&s._updateDisabledField({disabled:n,fields:s._fields,name:r,value:ce(s._fields,r)._f.value})},[n,r,s]),{field:{name:r,value:a,...Rn(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:Ze.useCallback(f=>c.current.onChange({target:{value:CC(f),name:r},type:ud.CHANGE}),[r]),onBlur:Ze.useCallback(()=>c.current.onBlur({target:{value:ce(s._formValues,r),name:r},type:ud.BLUR}),[r,s]),ref:f=>{const u=ce(s._fields,r);u&&f&&(u._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:h=>f.setCustomValidity(h),reportValidity:()=>f.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ce(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!ce(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!ce(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!ce(l.validatingFields,r)},error:{enumerable:!0,get:()=>ce(l.errors,r)}})}}const N5=e=>e.render(R5(e));var OC=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},nw=e=>({isOnSubmit:!e||e===an.onSubmit,isOnBlur:e===an.onBlur,isOnChange:e===an.onChange,isOnAll:e===an.all,isOnTouch:e===an.onTouched}),sw=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Ja=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=ce(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;Ja(a,t)}else Zt(a)&&Ja(a,t)}}};var P5=(e,t,r)=>{const n=Qa(ce(e,r));return ot(n,"root",t[r]),ot(e,r,n),e},bv=e=>e.type==="file",Bs=e=>typeof e=="function",dd=e=>{if(!wv)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ku=e=>Pn(e),Sv=e=>e.type==="radio",fd=e=>e instanceof RegExp;const ow={value:!1,isValid:!1},iw={value:!0,isValid:!0};var AC=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&&!Mt(e[0].attributes.value)?Mt(e[0].value)||e[0].value===""?iw:{value:e[0].value,isValid:!0}:iw:ow}return ow};const aw={isValid:!1,value:null};var MC=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,aw):aw;function lw(e,t,r="validate"){if(ku(e)||Array.isArray(e)&&e.every(ku)||Rn(e)&&!e)return{type:r,message:ku(e)?e:"",ref:t}}var ci=e=>Zt(e)&&!fd(e)?e:{value:e,message:""},cw=async(e,t,r,n,s)=>{const{ref:o,refs:i,required:a,maxLength:l,minLength:c,min:f,max:u,pattern:h,validate:m,name:y,valueAsNumber:p,mount:x,disabled:g}=e._f,v=ce(t,y);if(!x||g)return{};const _=i?i[0]:o,C=R=>{n&&_.reportValidity&&(_.setCustomValidity(Rn(R)?"":R||""),_.reportValidity())},E={},T=Sv(o),P=fc(o),O=T||P,j=(p||bv(o))&&Mt(o.value)&&Mt(v)||dd(o)&&o.value===""||v===""||Array.isArray(v)&&!v.length,L=OC.bind(null,y,r,E),q=(R,F,b,V=Gn.maxLength,te=Gn.minLength)=>{const B=R?F:b;E[y]={type:R?V:te,message:B,ref:o,...L(R?V:te,B)}};if(s?!Array.isArray(v)||!v.length:a&&(!O&&(j||fr(v))||Rn(v)&&!v||P&&!AC(i).isValid||T&&!MC(i).isValid)){const{value:R,message:F}=ku(a)?{value:!!a,message:a}:ci(a);if(R&&(E[y]={type:Gn.required,message:F,ref:_,...L(Gn.required,F)},!r))return C(F),E}if(!j&&(!fr(f)||!fr(u))){let R,F;const b=ci(u),V=ci(f);if(!fr(v)&&!isNaN(v)){const te=o.valueAsNumber||v&&+v;fr(b.value)||(R=te>b.value),fr(V.value)||(F=tenew Date(new Date().toDateString()+" "+Q),Z=o.type=="time",I=o.type=="week";Pn(b.value)&&v&&(R=Z?B(v)>B(b.value):I?v>b.value:te>new Date(b.value)),Pn(V.value)&&v&&(F=Z?B(v)+R.value,V=!fr(F.value)&&v.length<+F.value;if((b||V)&&(q(b,R.message,F.message),!r))return C(E[y].message),E}if(h&&!j&&Pn(v)){const{value:R,message:F}=ci(h);if(fd(R)&&!v.match(R)&&(E[y]={type:Gn.pattern,message:F,ref:o,...L(Gn.pattern,F)},!r))return C(F),E}if(m){if(Bs(m)){const R=await m(v,t),F=lw(R,_);if(F&&(E[y]={...F,...L(Gn.validate,F.message)},!r))return C(F.message),E}else if(Zt(m)){let R={};for(const F in m){if(!Nr(R)&&!r)break;const b=lw(await m[F](v,t),_,F);b&&(R={...b,...L(F,b.message)},C(b.message),r&&(E[y]=R))}if(!Nr(R)&&(E[y]={ref:_,...R},!r))return E}}return C(!0),E};function j5(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=[]}}},hd=e=>fr(e)||!kC(e);function Ro(e,t){if(hd(e)||hd(t))return e===t;if(Ei(e)&&Ei(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(Ei(o)&&Ei(i)||Zt(o)&&Zt(i)||Array.isArray(o)&&Array.isArray(i)?!Ro(o,i):o!==i)return!1}}return!0}var IC=e=>e.type==="select-multiple",O5=e=>Sv(e)||fc(e),kh=e=>dd(e)&&e.isConnected,LC=e=>{for(const t in e)if(Bs(e[t]))return!0;return!1};function pd(e,t={}){const r=Array.isArray(e);if(Zt(e)||r)for(const n in e)Array.isArray(e[n])||Zt(e[n])&&!LC(e[n])?(t[n]=Array.isArray(e[n])?[]:{},pd(e[n],t[n])):fr(e[n])||(t[n]=!0);return t}function FC(e,t,r){const n=Array.isArray(e);if(Zt(e)||n)for(const s in e)Array.isArray(e[s])||Zt(e[s])&&!LC(e[s])?Mt(t)||hd(r[s])?r[s]=Array.isArray(e[s])?pd(e[s],[]):{...pd(e[s])}:FC(e[s],fr(t)?{}:t[s],r[s]):r[s]=!Ro(e[s],t[s]);return r}var ru=(e,t)=>FC(e,t,pd(t)),zC=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Mt(e)?e:t?e===""?NaN:e&&+e:r&&Pn(e)?new Date(e):n?n(e):e;function Ch(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return bv(t)?t.files:Sv(t)?MC(e.refs).value:IC(t)?[...t.selectedOptions].map(({value:r})=>r):fc(t)?AC(e.refs).value:zC(Mt(t.value)?e.ref.value:t.value,e)}var A5=(e,t,r,n)=>{const s={};for(const o of e){const i=ce(t,o);i&&ot(s,o,i._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},ja=e=>Mt(e)?e:fd(e)?e.source:Zt(e)?fd(e.value)?e.value.source:e.value:e,M5=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function uw(e,t,r){const n=ce(e,r);if(n||xv(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),i=ce(t,o),a=ce(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 I5=(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,L5=(e,t)=>!_f(ce(e,t)).length&&Bt(e,t);const F5={mode:an.onSubmit,reValidateMode:an.onChange,shouldFocusError:!0};function z5(e={}){let t={...F5,...e},r={submitCount:0,isDirty:!1,isLoading:Bs(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=Zt(t.defaultValues)||Zt(t.values)?xr(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:xr(s),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},u={values:Sh(),array:Sh(),state:Sh()},h=nw(t.mode),m=nw(t.reValidateMode),y=t.criteriaMode===an.all,p=S=>N=>{clearTimeout(c),c=setTimeout(S,N)},x=async S=>{if(f.isValid||S){const N=t.resolver?Nr((await O()).errors):await L(n,!0);N!==r.isValid&&u.state.next({isValid:N})}},g=(S,N)=>{(f.isValidating||f.validatingFields)&&((S||Array.from(a.mount)).forEach(A=>{A&&(N?ot(r.validatingFields,A,N):Bt(r.validatingFields,A))}),u.state.next({validatingFields:r.validatingFields,isValidating:!Nr(r.validatingFields)}))},v=(S,N=[],A,Y,M=!0,H=!0)=>{if(Y&&A){if(i.action=!0,H&&Array.isArray(ce(n,S))){const X=A(ce(n,S),Y.argA,Y.argB);M&&ot(n,S,X)}if(H&&Array.isArray(ce(r.errors,S))){const X=A(ce(r.errors,S),Y.argA,Y.argB);M&&ot(r.errors,S,X),L5(r.errors,S)}if(f.touchedFields&&H&&Array.isArray(ce(r.touchedFields,S))){const X=A(ce(r.touchedFields,S),Y.argA,Y.argB);M&&ot(r.touchedFields,S,X)}f.dirtyFields&&(r.dirtyFields=ru(s,o)),u.state.next({name:S,isDirty:R(S,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ot(o,S,N)},_=(S,N)=>{ot(r.errors,S,N),u.state.next({errors:r.errors})},C=S=>{r.errors=S,u.state.next({errors:r.errors,isValid:!1})},E=(S,N,A,Y)=>{const M=ce(n,S);if(M){const H=ce(o,S,Mt(A)?ce(s,S):A);Mt(H)||Y&&Y.defaultChecked||N?ot(o,S,N?H:Ch(M._f)):V(S,H),i.mount&&x()}},T=(S,N,A,Y,M)=>{let H=!1,X=!1;const ee={name:S},he=!!(ce(n,S)&&ce(n,S)._f&&ce(n,S)._f.disabled);if(!A||Y){f.isDirty&&(X=r.isDirty,r.isDirty=ee.isDirty=R(),H=X!==ee.isDirty);const Le=he||Ro(ce(s,S),N);X=!!(!he&&ce(r.dirtyFields,S)),Le||he?Bt(r.dirtyFields,S):ot(r.dirtyFields,S,!0),ee.dirtyFields=r.dirtyFields,H=H||f.dirtyFields&&X!==!Le}if(A){const Le=ce(r.touchedFields,S);Le||(ot(r.touchedFields,S,A),ee.touchedFields=r.touchedFields,H=H||f.touchedFields&&Le!==A)}return H&&M&&u.state.next(ee),H?ee:{}},P=(S,N,A,Y)=>{const M=ce(r.errors,S),H=f.isValid&&Rn(N)&&r.isValid!==N;if(e.delayError&&A?(l=p(()=>_(S,A)),l(e.delayError)):(clearTimeout(c),l=null,A?ot(r.errors,S,A):Bt(r.errors,S)),(A?!Ro(M,A):M)||!Nr(Y)||H){const X={...Y,...H&&Rn(N)?{isValid:N}:{},errors:r.errors,name:S};r={...r,...X},u.state.next(X)}},O=async S=>{g(S,!0);const N=await t.resolver(o,t.context,A5(S||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return g(S),N},j=async S=>{const{errors:N}=await O(S);if(S)for(const A of S){const Y=ce(N,A);Y?ot(r.errors,A,Y):Bt(r.errors,A)}else r.errors=N;return N},L=async(S,N,A={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);g([Y],!0);const he=await cw(M,o,y,t.shouldUseNativeValidation&&!N,ee);if(g([Y]),he[H.name]&&(A.valid=!1,N))break;!N&&(ce(he,H.name)?ee?P5(r.errors,he,H.name):ot(r.errors,H.name,he[H.name]):Bt(r.errors,H.name))}X&&await L(X,N,A)}}return A.valid},q=()=>{for(const S of a.unMount){const N=ce(n,S);N&&(N._f.refs?N._f.refs.every(A=>!kh(A)):!kh(N._f.ref))&&Ee(S)}a.unMount=new Set},R=(S,N)=>(S&&N&&ot(o,S,N),!Ro(z(),s)),F=(S,N,A)=>DC(S,a,{...i.mount?o:Mt(N)?s:Pn(S)?{[S]:N}:N},A,N),b=S=>_f(ce(i.mount?o:s,S,e.shouldUnregister?ce(s,S,[]):[])),V=(S,N,A={})=>{const Y=ce(n,S);let M=N;if(Y){const H=Y._f;H&&(!H.disabled&&ot(o,S,zC(N,H)),M=dd(H.ref)&&fr(N)?"":N,IC(H.ref)?[...H.ref.options].forEach(X=>X.selected=M.includes(X.value)):H.refs?fc(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):bv(H.ref)?H.ref.value="":(H.ref.value=M,H.ref.type||u.values.next({name:S,values:{...o}})))}(A.shouldDirty||A.shouldTouch)&&T(S,M,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&Q(S)},te=(S,N,A)=>{for(const Y in N){const M=N[Y],H=`${S}.${Y}`,X=ce(n,H);(a.array.has(S)||!hd(M)||X&&!X._f)&&!Ei(M)?te(H,M,A):V(H,M,A)}},B=(S,N,A={})=>{const Y=ce(n,S),M=a.array.has(S),H=xr(N);ot(o,S,H),M?(u.array.next({name:S,values:{...o}}),(f.isDirty||f.dirtyFields)&&A.shouldDirty&&u.state.next({name:S,dirtyFields:ru(s,o),isDirty:R(S,H)})):Y&&!Y._f&&!fr(H)?te(S,H,A):V(S,H,A),sw(S,a)&&u.state.next({...r}),u.values.next({name:i.mount?S:void 0,values:{...o}})},Z=async S=>{i.mount=!0;const N=S.target;let A=N.name,Y=!0;const M=ce(n,A),H=()=>N.type?Ch(M._f):CC(S),X=ee=>{Y=Number.isNaN(ee)||ee===ce(o,A,ee)};if(M){let ee,he;const Le=H(),Oe=S.type===ud.BLUR||S.type===ud.FOCUS_OUT,St=!M5(M._f)&&!t.resolver&&!ce(r.errors,A)&&!M._f.deps||I5(Oe,ce(r.touchedFields,A),r.isSubmitted,m,h),Vr=sw(A,a,Oe);ot(o,A,Le),Oe?(M._f.onBlur&&M._f.onBlur(S),l&&l(0)):M._f.onChange&&M._f.onChange(S);const Vt=T(A,Le,Oe,!1),Vn=!Nr(Vt)||Vr;if(!Oe&&u.values.next({name:A,type:S.type,values:{...o}}),St)return f.isValid&&x(),Vn&&u.state.next({name:A,...Vr?{}:Vt});if(!Oe&&Vr&&u.state.next({...r}),t.resolver){const{errors:Je}=await O([A]);if(X(Le),Y){const Bn=uw(r.errors,n,A),Wn=uw(Je,n,Bn.name||A);ee=Wn.error,A=Wn.name,he=Nr(Je)}}else g([A],!0),ee=(await cw(M,o,y,t.shouldUseNativeValidation))[A],g([A]),X(Le),Y&&(ee?he=!1:f.isValid&&(he=await L(n,!0)));Y&&(M._f.deps&&Q(M._f.deps),P(A,he,ee,Vt))}},I=(S,N)=>{if(ce(r.errors,N)&&S.focus)return S.focus(),1},Q=async(S,N={})=>{let A,Y;const M=Qa(S);if(t.resolver){const H=await j(Mt(S)?S:M);A=Nr(H),Y=S?!M.some(X=>ce(H,X)):A}else S?(Y=(await Promise.all(M.map(async H=>{const X=ce(n,H);return await L(X&&X._f?{[H]:X}:X)}))).every(Boolean),!(!Y&&!r.isValid)&&x()):Y=A=await L(n);return u.state.next({...!Pn(S)||f.isValid&&A!==r.isValid?{}:{name:S},...t.resolver||!S?{isValid:A}:{},errors:r.errors}),N.shouldFocus&&!Y&&Ja(n,I,S?M:a.mount),Y},z=S=>{const N={...i.mount?o:s};return Mt(S)?N:Pn(S)?ce(N,S):S.map(A=>ce(N,A))},$=(S,N)=>({invalid:!!ce((N||r).errors,S),isDirty:!!ce((N||r).dirtyFields,S),error:ce((N||r).errors,S),isValidating:!!ce(r.validatingFields,S),isTouched:!!ce((N||r).touchedFields,S)}),de=S=>{S&&Qa(S).forEach(N=>Bt(r.errors,N)),u.state.next({errors:S?r.errors:{}})},ne=(S,N,A)=>{const Y=(ce(n,S,{_f:{}})._f||{}).ref,M=ce(r.errors,S)||{},{ref:H,message:X,type:ee,...he}=M;ot(r.errors,S,{...he,...N,ref:Y}),u.state.next({name:S,errors:r.errors,isValid:!1}),A&&A.shouldFocus&&Y&&Y.focus&&Y.focus()},se=(S,N)=>Bs(S)?u.values.subscribe({next:A=>S(F(void 0,N),A)}):F(S,N,!0),Ee=(S,N={})=>{for(const A of S?Qa(S):a.mount)a.mount.delete(A),a.array.delete(A),N.keepValue||(Bt(n,A),Bt(o,A)),!N.keepError&&Bt(r.errors,A),!N.keepDirty&&Bt(r.dirtyFields,A),!N.keepTouched&&Bt(r.touchedFields,A),!N.keepIsValidating&&Bt(r.validatingFields,A),!t.shouldUnregister&&!N.keepDefaultValue&&Bt(s,A);u.values.next({values:{...o}}),u.state.next({...r,...N.keepDirty?{isDirty:R()}:{}}),!N.keepIsValid&&x()},fe=({disabled:S,name:N,field:A,fields:Y,value:M})=>{if(Rn(S)&&i.mount||S){const H=S?void 0:Mt(M)?Ch(A?A._f:ce(Y,N)._f):M;ot(o,N,H),T(N,H,!1,!1,!0)}},ge=(S,N={})=>{let A=ce(n,S);const Y=Rn(N.disabled);return ot(n,S,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:S}},name:S,mount:!0,...N}}),a.mount.add(S),A?fe({field:A,disabled:N.disabled,name:S,value:N.value}):E(S,!0,N.value),{...Y?{disabled:N.disabled}:{},...t.progressive?{required:!!N.required,min:ja(N.min),max:ja(N.max),minLength:ja(N.minLength),maxLength:ja(N.maxLength),pattern:ja(N.pattern)}:{},name:S,onChange:Z,onBlur:Z,ref:M=>{if(M){ge(S,N),A=ce(n,S);const H=Mt(M.value)&&M.querySelectorAll&&M.querySelectorAll("input,select,textarea")[0]||M,X=O5(H),ee=A._f.refs||[];if(X?ee.find(he=>he===H):H===A._f.ref)return;ot(n,S,{_f:{...A._f,...X?{refs:[...ee.filter(kh),H,...Array.isArray(ce(s,S))?[{}]:[]],ref:{type:H.type,name:S}}:{ref:H}}}),E(S,!1,void 0,H)}else A=ce(n,S,{}),A._f&&(A._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(EC(a.array,S)&&i.action)&&a.unMount.add(S)}}},be=()=>t.shouldFocusError&&Ja(n,I,a.mount),Pe=S=>{Rn(S)&&(u.state.next({disabled:S}),Ja(n,(N,A)=>{const Y=ce(n,A);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))},Te=(S,N)=>async A=>{let Y;A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist());let M=xr(o);if(u.state.next({isSubmitting:!0}),t.resolver){const{errors:H,values:X}=await O();r.errors=H,M=X}else await L(n);if(Bt(r.errors,"root"),Nr(r.errors)){u.state.next({errors:{}});try{await S(M,A)}catch(H){Y=H}}else N&&await N({...r.errors},A),be(),setTimeout(be);if(u.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Nr(r.errors)&&!Y,submitCount:r.submitCount+1,errors:r.errors}),Y)throw Y},Se=(S,N={})=>{ce(n,S)&&(Mt(N.defaultValue)?B(S,xr(ce(s,S))):(B(S,N.defaultValue),ot(s,S,xr(N.defaultValue))),N.keepTouched||Bt(r.touchedFields,S),N.keepDirty||(Bt(r.dirtyFields,S),r.isDirty=N.defaultValue?R(S,xr(ce(s,S))):R()),N.keepError||(Bt(r.errors,S),f.isValid&&x()),u.state.next({...r}))},Ke=(S,N={})=>{const A=S?xr(S):s,Y=xr(A),M=Nr(S),H=M?s:Y;if(N.keepDefaultValues||(s=A),!N.keepValues){if(N.keepDirtyValues)for(const X of a.mount)ce(r.dirtyFields,X)?ot(H,X,ce(o,X)):B(X,ce(H,X));else{if(wv&&Mt(S))for(const X of a.mount){const ee=ce(n,X);if(ee&&ee._f){const he=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if(dd(he)){const Le=he.closest("form");if(Le){Le.reset();break}}}}n={}}o=e.shouldUnregister?N.keepDefaultValues?xr(s):{}:xr(H),u.array.next({values:{...H}}),u.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=!f.isValid||!!N.keepIsValid||!!N.keepDirtyValues,i.watch=!!e.shouldUnregister,u.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:M?!1:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!Ro(S,s)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:M?{}:N.keepDirtyValues?N.keepDefaultValues&&o?ru(s,o):r.dirtyFields:N.keepDefaultValues&&S?ru(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)=>Ke(Bs(S)?S(o):S,N);return{control:{register:ge,unregister:Ee,getFieldState:$,handleSubmit:Te,setError:ne,_executeSchema:O,_getWatch:F,_getDirty:R,_updateValid:x,_removeUnmounted:q,_updateFieldArray:v,_updateDisabledField:fe,_getFieldArray:b,_reset:Ke,_resetDefaultValues:()=>Bs(t.defaultValues)&&t.defaultValues().then(S=>{k(S,t.resetOptions),u.state.next({isLoading:!1})}),_updateFormState:S=>{r={...r,...S}},_disableForm:Pe,_subjects:u,_proxyFormState:f,_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:ge,handleSubmit:Te,watch:se,setValue:B,getValues:z,reset:k,resetField:Se,clearErrors:de,unregister:Ee,setError:ne,setFocus:(S,N={})=>{const A=ce(n,S),Y=A&&A._f;if(Y){const M=Y.refs?Y.refs[0]:Y.ref;M.focus&&(M.focus(),N.shouldSelect&&M.select())}},getFieldState:$}}function hc(e={}){const t=Ze.useRef(),r=Ze.useRef(),[n,s]=Ze.useState({isDirty:!1,isValidating:!1,isLoading:Bs(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Bs(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...z5(e),formState:n});const o=t.current.control;return o._options=e,_v({subject:o._subjects.state,next:i=>{PC(i,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),Ze.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),Ze.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==n.isDirty&&o._subjects.state.next({isDirty:i})}},[o,n.isDirty]),Ze.useEffect(()=>{e.values&&!Ro(e.values,r.current)?(o._reset(e.values,o._options.resetOptions),r.current=e.values,s(i=>({...i}))):o._resetDefaultValues()},[e.values,o]),Ze.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),Ze.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()}),Ze.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=NC(n,o),t.current}const dw=(e,t,r)=>{if(e&&"reportValidity"in e){const n=ce(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},UC=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?dw(n.ref,r,e):n.refs&&n.refs.forEach(s=>dw(s,r,e))}},U5=(e,t)=>{t.shouldUseNativeValidation&&UC(e,t);const r={};for(const n in e){const s=ce(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if($5(t.names||Object.keys(e),n)){const i=Object.assign({},ce(r,n));ot(i,"root",o),ot(r,n,i)}else ot(r,n,o)}return r},$5=(e,t)=>e.some(r=>r.startsWith(t+"."));var V5=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(f){return f.errors.forEach(function(u){return e.push(u)})}),t){var l=r[i].types,c=l&&l[n.code];r[i]=OC(i,t,r,s,c?[].concat(c,n.message):n.message)}e.shift()}return r},pc=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(c){return o.shouldUseNativeValidation&&UC({},o),{errors:{},values:r.raw?n:c}})}catch(c){return a(c)}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:U5(V5(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}}},Xe;(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})(Xe||(Xe={}));var Hp;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Hp||(Hp={}));const ye=Xe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Fs=e=>{switch(typeof e){case"undefined":return ye.undefined;case"string":return ye.string;case"number":return isNaN(e)?ye.nan:ye.number;case"boolean":return ye.boolean;case"function":return ye.function;case"bigint":return ye.bigint;case"symbol":return ye.symbol;case"object":return Array.isArray(e)?ye.array:e===null?ye.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ye.promise:typeof Map<"u"&&e instanceof Map?ye.map:typeof Set<"u"&&e instanceof Set?ye.set:typeof Date<"u"&&e instanceof Date?ye.date:ye.object;default:return ye.unknown}},ie=Xe.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"]),B5=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 Xi=(e,t)=>{let r;switch(e.code){case ie.invalid_type:e.received===ye.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Xe.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${Xe.joinValues(e.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Xe.joinValues(e.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${Xe.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}"`:Xe.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,Xe.assertNever(e)}return{message:r}};let $C=Xi;function W5(e){$C=e}function md(){return $C}const gd=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(c=>!!c).slice().reverse();for(const c of l)a=c(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},H5=[];function pe(e,t){const r=md(),n=gd({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Xi?void 0:Xi].filter(s=>!!s)});e.common.issues.push(n)}class lr{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 Ie;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 lr.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 Ie;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 Ie=Object.freeze({status:"aborted"}),Ti=e=>({status:"dirty",value:e}),pr=e=>({status:"valid",value:e}),Yp=e=>e.status==="aborted",Zp=e=>e.status==="dirty",Pl=e=>e.status==="valid",jl=e=>typeof Promise<"u"&&e instanceof Promise;function vd(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 VC(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 Ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ce||(Ce={}));var Fa,za;class Ln{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 fw=(e,t)=>{if(Pl(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 Fe(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,c;const{message:f}=e;return i.code==="invalid_enum_value"?{message:f??a.defaultError}:typeof a.data>"u"?{message:(l=f??n)!==null&&l!==void 0?l:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(c=f??r)!==null&&c!==void 0?c:a.defaultError}},description:s}}class We{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 Fs(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Fs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new lr,ctx:{common:t.parent.common,data:t.data,parsedType:Fs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(jl(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:Fs(t)},o=this._parseSync({data:t,path:s.path,parent:s});return fw(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:Fs(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(jl(s)?s:Promise.resolve(s));return fw(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 yn({schema:this,typeName:Ae.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return An.create(this,this._def)}nullable(){return ao.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fn.create(this,this._def)}promise(){return Ji.create(this,this._def)}or(t){return Ml.create([this,t],this._def)}and(t){return Il.create(this,t,this._def)}transform(t){return new yn({...Fe(this._def),schema:this,typeName:Ae.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new $l({...Fe(this._def),innerType:this,defaultValue:r,typeName:Ae.ZodDefault})}brand(){return new kv({typeName:Ae.ZodBranded,type:this,...Fe(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Vl({...Fe(this._def),innerType:this,catchValue:r,typeName:Ae.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return mc.create(this,t)}readonly(){return Bl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Y5=/^c[^\s-]{8,}$/i,Z5=/^[0-9a-z]+$/,G5=/^[0-9A-HJKMNP-TV-Z]{26}$/,K5=/^[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,q5=/^[a-z0-9_-]{21}$/i,X5=/^[-+]?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)?)??$/,Q5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,J5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Eh;const ez=/^(?:(?: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])$/,tz=/^(([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})))$/,rz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,BC="((\\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])))",nz=new RegExp(`^${BC}$`);function WC(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 sz(e){return new RegExp(`^${WC(e)}$`)}function HC(e){let t=`${BC}T${WC(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 oz(e,t){return!!((t==="v4"||!t)&&ez.test(e)||(t==="v6"||!t)&&tz.test(e))}class cn extends We{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ye.string){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:ye.string,received:o.parsedType}),Ie}const n=new lr;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,...Ce.errToObj(n)})}_addCheck(t){return new cn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ce.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ce.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ce.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,...Ce.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,...Ce.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ce.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Ce.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...Ce.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Ce.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Ce.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Ce.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Ce.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Ce.errToObj(r)})}nonempty(t){return this.min(1,Ce.errToObj(t))}trim(){return new cn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new cn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new cn({...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 cn({checks:[],typeName:Ae.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Fe(e)})};function iz(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 so extends We{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)!==ye.number){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:ye.number,received:o.parsedType}),Ie}let n;const s=new lr;for(const o of this._def.checks)o.kind==="int"?Xe.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"?iz(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()):Xe.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ce.toString(r))}setLimit(t,r,n,s){return new so({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ce.toString(s)}]})}_addCheck(t){return new so({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ce.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"&&Xe.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 so({checks:[],typeName:Ae.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Fe(e)});class oo extends We{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)!==ye.bigint){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:ye.bigint,received:o.parsedType}),Ie}let n;const s=new lr;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()):Xe.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ce.toString(r))}setLimit(t,r,n,s){return new oo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ce.toString(s)}]})}_addCheck(t){return new oo({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ce.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 oo({checks:[],typeName:Ae.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Fe(e)})};class Dl extends We{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ye.boolean){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.boolean,received:n.parsedType}),Ie}return pr(t.data)}}Dl.create=e=>new Dl({typeName:Ae.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Fe(e)});class Bo extends We{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ye.date){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:ye.date,received:o.parsedType}),Ie}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_date}),Ie}const n=new lr;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()):Xe.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Bo({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Ce.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Ce.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 Bo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ae.ZodDate,...Fe(e)});class yd extends We{_parse(t){if(this._getType(t)!==ye.symbol){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.symbol,received:n.parsedType}),Ie}return pr(t.data)}}yd.create=e=>new yd({typeName:Ae.ZodSymbol,...Fe(e)});class Ol extends We{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.undefined,received:n.parsedType}),Ie}return pr(t.data)}}Ol.create=e=>new Ol({typeName:Ae.ZodUndefined,...Fe(e)});class Al extends We{_parse(t){if(this._getType(t)!==ye.null){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.null,received:n.parsedType}),Ie}return pr(t.data)}}Al.create=e=>new Al({typeName:Ae.ZodNull,...Fe(e)});class Qi extends We{constructor(){super(...arguments),this._any=!0}_parse(t){return pr(t.data)}}Qi.create=e=>new Qi({typeName:Ae.ZodAny,...Fe(e)});class Do extends We{constructor(){super(...arguments),this._unknown=!0}_parse(t){return pr(t.data)}}Do.create=e=>new Do({typeName:Ae.ZodUnknown,...Fe(e)});class ys extends We{_parse(t){const r=this._getOrReturnCtx(t);return pe(r,{code:ie.invalid_type,expected:ye.never,received:r.parsedType}),Ie}}ys.create=e=>new ys({typeName:Ae.ZodNever,...Fe(e)});class wd extends We{_parse(t){if(this._getType(t)!==ye.undefined){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.void,received:n.parsedType}),Ie}return pr(t.data)}}wd.create=e=>new wd({typeName:Ae.ZodVoid,...Fe(e)});class fn extends We{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==ye.array)return pe(r,{code:ie.invalid_type,expected:ye.array,received:r.parsedType}),Ie;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 Ln(r,i,r.path,a)))).then(i=>lr.mergeArray(n,i));const o=[...r.data].map((i,a)=>s.type._parseSync(new Ln(r,i,r.path,a)));return lr.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new fn({...this._def,minLength:{value:t,message:Ce.toString(r)}})}max(t,r){return new fn({...this._def,maxLength:{value:t,message:Ce.toString(r)}})}length(t,r){return new fn({...this._def,exactLength:{value:t,message:Ce.toString(r)}})}nonempty(t){return this.min(1,t)}}fn.create=(e,t)=>new fn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ae.ZodArray,...Fe(t)});function di(e){if(e instanceof Tt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=An.create(di(n))}return new Tt({...e._def,shape:()=>t})}else return e instanceof fn?new fn({...e._def,type:di(e.element)}):e instanceof An?An.create(di(e.unwrap())):e instanceof ao?ao.create(di(e.unwrap())):e instanceof Fn?Fn.create(e.items.map(t=>di(t))):e}class Tt extends We{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=Xe.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==ye.object){const c=this._getOrReturnCtx(t);return pe(c,{code:ie.invalid_type,expected:ye.object,received:c.parsedType}),Ie}const{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ys&&this._def.unknownKeys==="strip"))for(const c in s.data)i.includes(c)||a.push(c);const l=[];for(const c of i){const f=o[c],u=s.data[c];l.push({key:{status:"valid",value:c},value:f._parse(new Ln(s,u,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof ys){const c=this._def.unknownKeys;if(c==="passthrough")for(const f of a)l.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(c==="strict")a.length>0&&(pe(s,{code:ie.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const f of a){const u=s.data[f];l.push({key:{status:"valid",value:f},value:c._parse(new Ln(s,u,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const c=[];for(const f of l){const u=await f.key,h=await f.value;c.push({key:u,value:h,alwaysSet:f.alwaysSet})}return c}).then(c=>lr.mergeObjectSync(n,c)):lr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return Ce.errToObj,new Tt({...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=Ce.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Tt({...this._def,unknownKeys:"strip"})}passthrough(){return new Tt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Tt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Tt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ae.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Tt({...this._def,catchall:t})}pick(t){const r={};return Xe.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Tt({...this._def,shape:()=>r})}omit(t){const r={};return Xe.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Tt({...this._def,shape:()=>r})}deepPartial(){return di(this)}partial(t){const r={};return Xe.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}),new Tt({...this._def,shape:()=>r})}required(t){const r={};return Xe.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof An;)o=o._def.innerType;r[n]=o}}),new Tt({...this._def,shape:()=>r})}keyof(){return YC(Xe.objectKeys(this.shape))}}Tt.create=(e,t)=>new Tt({shape:()=>e,unknownKeys:"strip",catchall:ys.create(),typeName:Ae.ZodObject,...Fe(t)});Tt.strictCreate=(e,t)=>new Tt({shape:()=>e,unknownKeys:"strict",catchall:ys.create(),typeName:Ae.ZodObject,...Fe(t)});Tt.lazycreate=(e,t)=>new Tt({shape:e,unknownKeys:"strip",catchall:ys.create(),typeName:Ae.ZodObject,...Fe(t)});class Ml extends We{_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}),Ie}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 c={...r,common:{...r.common,issues:[]},parent:null},f=l._parseSync({data:r.data,path:r.path,parent:c});if(f.status==="valid")return f;f.status==="dirty"&&!o&&(o={result:f,ctx:c}),c.common.issues.length&&i.push(c.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}),Ie}}get options(){return this._def.options}}Ml.create=(e,t)=>new Ml({options:e,typeName:Ae.ZodUnion,...Fe(t)});const qn=e=>e instanceof Fl?qn(e.schema):e instanceof yn?qn(e.innerType()):e instanceof zl?[e.value]:e instanceof io?e.options:e instanceof Ul?Xe.objectValues(e.enum):e instanceof $l?qn(e._def.innerType):e instanceof Ol?[void 0]:e instanceof Al?[null]:e instanceof An?[void 0,...qn(e.unwrap())]:e instanceof ao?[null,...qn(e.unwrap())]:e instanceof kv||e instanceof Bl?qn(e.unwrap()):e instanceof Vl?qn(e._def.innerType):[];class Sf extends We{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.object)return pe(r,{code:ie.invalid_type,expected:ye.object,received:r.parsedType}),Ie;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]}),Ie)}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=qn(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 Sf({typeName:Ae.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...Fe(n)})}}function Gp(e,t){const r=Fs(e),n=Fs(t);if(e===t)return{valid:!0,data:e};if(r===ye.object&&n===ye.object){const s=Xe.objectKeys(t),o=Xe.objectKeys(e).filter(a=>s.indexOf(a)!==-1),i={...e,...t};for(const a of o){const l=Gp(e[a],t[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(r===ye.array&&n===ye.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{if(Yp(o)||Yp(i))return Ie;const a=Gp(o.value,i.value);return a.valid?((Zp(o)||Zp(i))&&r.dirty(),{status:r.value,value:a.data}):(pe(n,{code:ie.invalid_intersection_types}),Ie)};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}))}}Il.create=(e,t,r)=>new Il({left:e,right:t,typeName:Ae.ZodIntersection,...Fe(r)});class Fn extends We{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.array)return pe(n,{code:ie.invalid_type,expected:ye.array,received:n.parsedType}),Ie;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 Ln(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>lr.mergeArray(r,i)):lr.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new Fn({...this._def,rest:t})}}Fn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fn({items:e,typeName:Ae.ZodTuple,rest:null,...Fe(t)})};class Ll extends We{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!==ye.object)return pe(n,{code:ie.invalid_type,expected:ye.object,received:n.parsedType}),Ie;const s=[],o=this._def.keyType,i=this._def.valueType;for(const a in n.data)s.push({key:o._parse(new Ln(n,a,n.path,a)),value:i._parse(new Ln(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?lr.mergeObjectAsync(r,s):lr.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof We?new Ll({keyType:t,valueType:r,typeName:Ae.ZodRecord,...Fe(n)}):new Ll({keyType:cn.create(),valueType:t,typeName:Ae.ZodRecord,...Fe(r)})}}class xd extends We{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!==ye.map)return pe(n,{code:ie.invalid_type,expected:ye.map,received:n.parsedType}),Ie;const s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([a,l],c)=>({key:s._parse(new Ln(n,a,n.path,[c,"key"])),value:o._parse(new Ln(n,l,n.path,[c,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of i){const c=await l.key,f=await l.value;if(c.status==="aborted"||f.status==="aborted")return Ie;(c.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(c.value,f.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const l of i){const c=l.key,f=l.value;if(c.status==="aborted"||f.status==="aborted")return Ie;(c.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(c.value,f.value)}return{status:r.value,value:a}}}}xd.create=(e,t,r)=>new xd({valueType:t,keyType:e,typeName:Ae.ZodMap,...Fe(r)});class Wo extends We{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.set)return pe(n,{code:ie.invalid_type,expected:ye.set,received:n.parsedType}),Ie;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 c=new Set;for(const f of l){if(f.status==="aborted")return Ie;f.status==="dirty"&&r.dirty(),c.add(f.value)}return{status:r.value,value:c}}const a=[...n.data.values()].map((l,c)=>o._parse(new Ln(n,l,n.path,c)));return n.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(t,r){return new Wo({...this._def,minSize:{value:t,message:Ce.toString(r)}})}max(t,r){return new Wo({...this._def,maxSize:{value:t,message:Ce.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Wo.create=(e,t)=>new Wo({valueType:e,minSize:null,maxSize:null,typeName:Ae.ZodSet,...Fe(t)});class $i extends We{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.function)return pe(r,{code:ie.invalid_type,expected:ye.function,received:r.parsedType}),Ie;function n(a,l){return gd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,md(),Xi].filter(c=>!!c),issueData:{code:ie.invalid_arguments,argumentsError:l}})}function s(a,l){return gd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,md(),Xi].filter(c=>!!c),issueData:{code:ie.invalid_return_type,returnTypeError:l}})}const o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Ji){const a=this;return pr(async function(...l){const c=new Lr([]),f=await a._def.args.parseAsync(l,o).catch(m=>{throw c.addIssue(n(l,m)),c}),u=await Reflect.apply(i,this,f);return await a._def.returns._def.type.parseAsync(u,o).catch(m=>{throw c.addIssue(s(u,m)),c})})}else{const a=this;return pr(function(...l){const c=a._def.args.safeParse(l,o);if(!c.success)throw new Lr([n(l,c.error)]);const f=Reflect.apply(i,this,c.data),u=a._def.returns.safeParse(f,o);if(!u.success)throw new Lr([s(f,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new $i({...this._def,args:Fn.create(t).rest(Do.create())})}returns(t){return new $i({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new $i({args:t||Fn.create([]).rest(Do.create()),returns:r||Do.create(),typeName:Ae.ZodFunction,...Fe(n)})}}class Fl extends We{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})}}Fl.create=(e,t)=>new Fl({getter:e,typeName:Ae.ZodLazy,...Fe(t)});class zl extends We{_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}),Ie}return{status:"valid",value:t.data}}get value(){return this._def.value}}zl.create=(e,t)=>new zl({value:e,typeName:Ae.ZodLiteral,...Fe(t)});function YC(e,t){return new io({values:e,typeName:Ae.ZodEnum,...Fe(t)})}class io extends We{constructor(){super(...arguments),Fa.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return pe(r,{expected:Xe.joinValues(n),received:r.parsedType,code:ie.invalid_type}),Ie}if(vd(this,Fa)||VC(this,Fa,new Set(this._def.values)),!vd(this,Fa).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}),Ie}return pr(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 io.create(t,{...this._def,...r})}exclude(t,r=this._def){return io.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Fa=new WeakMap;io.create=YC;class Ul extends We{constructor(){super(...arguments),za.set(this,void 0)}_parse(t){const r=Xe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ye.string&&n.parsedType!==ye.number){const s=Xe.objectValues(r);return pe(n,{expected:Xe.joinValues(s),received:n.parsedType,code:ie.invalid_type}),Ie}if(vd(this,za)||VC(this,za,new Set(Xe.getValidEnumValues(this._def.values))),!vd(this,za).has(t.data)){const s=Xe.objectValues(r);return pe(n,{received:n.data,code:ie.invalid_enum_value,options:s}),Ie}return pr(t.data)}get enum(){return this._def.values}}za=new WeakMap;Ul.create=(e,t)=>new Ul({values:e,typeName:Ae.ZodNativeEnum,...Fe(t)});class Ji extends We{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.promise&&r.common.async===!1)return pe(r,{code:ie.invalid_type,expected:ye.promise,received:r.parsedType}),Ie;const n=r.parsedType===ye.promise?r.data:Promise.resolve(r.data);return pr(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Ji.create=(e,t)=>new Ji({type:e,typeName:Ae.ZodPromise,...Fe(t)});class yn extends We{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ae.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 Ie;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?Ie:l.status==="dirty"||r.value==="dirty"?Ti(l.value):l});{if(r.value==="aborted")return Ie;const a=this._def.schema._parseSync({data:i,path:n.path,parent:n});return a.status==="aborted"?Ie:a.status==="dirty"||r.value==="dirty"?Ti(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"?Ie:(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"?Ie:(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(!Pl(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=>Pl(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:r.value,value:a})):i);Xe.assertNever(s)}}yn.create=(e,t,r)=>new yn({schema:e,typeName:Ae.ZodEffects,effect:t,...Fe(r)});yn.createWithPreprocess=(e,t,r)=>new yn({schema:t,effect:{type:"preprocess",transform:e},typeName:Ae.ZodEffects,...Fe(r)});class An extends We{_parse(t){return this._getType(t)===ye.undefined?pr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}An.create=(e,t)=>new An({innerType:e,typeName:Ae.ZodOptional,...Fe(t)});class ao extends We{_parse(t){return this._getType(t)===ye.null?pr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ao.create=(e,t)=>new ao({innerType:e,typeName:Ae.ZodNullable,...Fe(t)});class $l extends We{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ye.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}$l.create=(e,t)=>new $l({innerType:e,typeName:Ae.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Fe(t)});class Vl extends We{_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 jl(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}}Vl.create=(e,t)=>new Vl({innerType:e,typeName:Ae.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Fe(t)});class _d extends We{_parse(t){if(this._getType(t)!==ye.nan){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:ye.nan,received:n.parsedType}),Ie}return{status:"valid",value:t.data}}}_d.create=e=>new _d({typeName:Ae.ZodNaN,...Fe(e)});const az=Symbol("zod_brand");class kv extends We{_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 mc extends We{_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"?Ie:o.status==="dirty"?(r.dirty(),Ti(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"?Ie: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 mc({in:t,out:r,typeName:Ae.ZodPipeline})}}class Bl extends We{_parse(t){const r=this._def.innerType._parse(t),n=s=>(Pl(s)&&(s.value=Object.freeze(s.value)),s);return jl(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}Bl.create=(e,t)=>new Bl({innerType:e,typeName:Ae.ZodReadonly,...Fe(t)});function ZC(e,t={},r){return e?Qi.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,c=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...c,fatal:l})}}):Qi.create()}const lz={object:Tt.lazycreate};var Ae;(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"})(Ae||(Ae={}));const cz=(e,t={message:`Input not instance of ${e.name}`})=>ZC(r=>r instanceof e,t),GC=cn.create,KC=so.create,uz=_d.create,dz=oo.create,qC=Dl.create,fz=Bo.create,hz=yd.create,pz=Ol.create,mz=Al.create,gz=Qi.create,vz=Do.create,yz=ys.create,wz=wd.create,xz=fn.create,_z=Tt.create,bz=Tt.strictCreate,Sz=Ml.create,kz=Sf.create,Cz=Il.create,Ez=Fn.create,Tz=Ll.create,Rz=xd.create,Nz=Wo.create,Pz=$i.create,jz=Fl.create,Dz=zl.create,Oz=io.create,Az=Ul.create,Mz=Ji.create,hw=yn.create,Iz=An.create,Lz=ao.create,Fz=yn.createWithPreprocess,zz=mc.create,Uz=()=>GC().optional(),$z=()=>KC().optional(),Vz=()=>qC().optional(),Bz={string:e=>cn.create({...e,coerce:!0}),number:e=>so.create({...e,coerce:!0}),boolean:e=>Dl.create({...e,coerce:!0}),bigint:e=>oo.create({...e,coerce:!0}),date:e=>Bo.create({...e,coerce:!0})},Wz=Ie;var qe=Object.freeze({__proto__:null,defaultErrorMap:Xi,setErrorMap:W5,getErrorMap:md,makeIssue:gd,EMPTY_PATH:H5,addIssueToContext:pe,ParseStatus:lr,INVALID:Ie,DIRTY:Ti,OK:pr,isAborted:Yp,isDirty:Zp,isValid:Pl,isAsync:jl,get util(){return Xe},get objectUtil(){return Hp},ZodParsedType:ye,getParsedType:Fs,ZodType:We,datetimeRegex:HC,ZodString:cn,ZodNumber:so,ZodBigInt:oo,ZodBoolean:Dl,ZodDate:Bo,ZodSymbol:yd,ZodUndefined:Ol,ZodNull:Al,ZodAny:Qi,ZodUnknown:Do,ZodNever:ys,ZodVoid:wd,ZodArray:fn,ZodObject:Tt,ZodUnion:Ml,ZodDiscriminatedUnion:Sf,ZodIntersection:Il,ZodTuple:Fn,ZodRecord:Ll,ZodMap:xd,ZodSet:Wo,ZodFunction:$i,ZodLazy:Fl,ZodLiteral:zl,ZodEnum:io,ZodNativeEnum:Ul,ZodPromise:Ji,ZodEffects:yn,ZodTransformer:yn,ZodOptional:An,ZodNullable:ao,ZodDefault:$l,ZodCatch:Vl,ZodNaN:_d,BRAND:az,ZodBranded:kv,ZodPipeline:mc,ZodReadonly:Bl,custom:ZC,Schema:We,ZodSchema:We,late:lz,get ZodFirstPartyTypeKind(){return Ae},coerce:Bz,any:gz,array:xz,bigint:dz,boolean:qC,date:fz,discriminatedUnion:kz,effect:hw,enum:Oz,function:Pz,instanceof:cz,intersection:Cz,lazy:jz,literal:Dz,map:Rz,nan:uz,nativeEnum:Az,never:yz,null:mz,nullable:Lz,number:KC,object:_z,oboolean:Vz,onumber:$z,optional:Iz,ostring:Uz,pipeline:zz,preprocess:Fz,promise:Mz,record:Tz,set:Nz,strictObject:bz,string:GC,symbol:hz,transformer:hw,tuple:Ez,undefined:pz,union:Sz,unknown:vz,void:wz,NEVER:Wz,ZodIssueCode:ie,quotelessJson:B5,ZodError:Lr}),Hz="Label",XC=w.forwardRef((e,t)=>d.jsx(De.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())}}));XC.displayName=Hz;var QC=XC;const Yz=ql("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Wl=w.forwardRef(({className:e,...t},r)=>d.jsx(QC,{ref:r,className:we(Yz(),e),...t}));Wl.displayName=QC.displayName;const gc=C5,JC=w.createContext({}),ft=({...e})=>d.jsx(JC.Provider,{value:{name:e.name},children:d.jsx(N5,{...e})}),kf=()=>{const e=w.useContext(JC),t=w.useContext(eE),{getFieldState:r,formState:n}=bf(),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}},eE=w.createContext({}),at=w.forwardRef(({className:e,...t},r)=>{const n=w.useId();return d.jsx(eE.Provider,{value:{id:n},children:d.jsx("div",{ref:r,className:we("space-y-2",e),...t})})});at.displayName="FormItem";const lt=w.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=kf();return d.jsx(Wl,{ref:r,className:we(n&&"text-destructive",e),htmlFor:s,...t})});lt.displayName="FormLabel";const ct=w.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:o}=kf();return d.jsx(hs,{ref:t,id:n,"aria-describedby":r?`${s} ${o}`:`${s}`,"aria-invalid":!!r,...e})});ct.displayName="FormControl";const Zz=w.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=kf();return d.jsx("p",{ref:r,id:n,className:we("text-sm text-muted-foreground",e),...t})});Zz.displayName="FormDescription";const nt=w.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:o}=kf(),i=s?String(s==null?void 0:s.message):t;return i?d.jsx("p",{ref:n,id:o,className:we("text-sm font-medium text-destructive",e),...r,children:i}):null});nt.displayName="FormMessage";function Kp(e,[t,r]){return Math.min(r,Math.max(t,e))}var Gz=[" ","Enter","ArrowUp","ArrowDown"],Kz=[" ","Enter"],vc="Select",[Cf,Ef,qz]=Yd(vc),[pa,vU]=Er(vc,[qz,ua]),Tf=ua(),[Xz,mo]=pa(vc),[Qz,Jz]=pa(vc),tE=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:l,dir:c,name:f,autoComplete:u,disabled:h,required:m}=e,y=Tf(t),[p,x]=w.useState(null),[g,v]=w.useState(null),[_,C]=w.useState(!1),E=Xl(c),[T=!1,P]=ps({prop:n,defaultProp:s,onChange:o}),[O,j]=ps({prop:i,defaultProp:a,onChange:l}),L=w.useRef(null),q=p?!!p.closest("form"):!0,[R,F]=w.useState(new Set),b=Array.from(R).map(V=>V.props.value).join(";");return d.jsx(xg,{...y,children:d.jsxs(Xz,{required:m,scope:t,trigger:p,onTriggerChange:x,valueNode:g,onValueNodeChange:v,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:On(),value:O,onValueChange:j,open:T,onOpenChange:P,dir:E,triggerPointerDownPosRef:L,disabled:h,children:[d.jsx(Cf.Provider,{scope:t,children:d.jsx(Qz,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(V=>{F(te=>new Set(te).add(V))},[]),onNativeOptionRemove:w.useCallback(V=>{F(te=>{const B=new Set(te);return B.delete(V),B})},[]),children:r})}),q?d.jsxs(TE,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:u,value:O,onChange:V=>j(V.target.value),disabled:h,children:[O===void 0?d.jsx("option",{value:""}):null,Array.from(R)]},b):null]})})};tE.displayName=vc;var rE="SelectTrigger",nE=w.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=Tf(r),i=mo(rE,r),a=i.disabled||n,l=ze(t,i.onTriggerChange),c=Ef(r),[f,u,h]=RE(y=>{const p=c().filter(v=>!v.disabled),x=p.find(v=>v.value===i.value),g=NE(p,y,x);g!==void 0&&i.onValueChange(g.value)}),m=()=>{a||(i.onOpenChange(!0),h())};return d.jsx(_g,{asChild:!0,...o,children:d.jsx(De.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":EE(i.value)?"":void 0,...s,ref:l,onClick:le(s.onClick,y=>{y.currentTarget.focus()}),onPointerDown:le(s.onPointerDown,y=>{const p=y.target;p.hasPointerCapture(y.pointerId)&&p.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&(m(),i.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)},y.preventDefault())}),onKeyDown:le(s.onKeyDown,y=>{const p=f.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&u(y.key),!(p&&y.key===" ")&&Gz.includes(y.key)&&(m(),y.preventDefault())})})})});nE.displayName=rE;var sE="SelectValue",oE=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:i="",...a}=e,l=mo(sE,r),{onValueNodeHasChildrenChange:c}=l,f=o!==void 0,u=ze(t,l.onValueNodeChange);return rr(()=>{c(f)},[c,f]),d.jsx(De.span,{...a,ref:u,style:{pointerEvents:"none"},children:EE(l.value)?d.jsx(d.Fragment,{children:i}):o})});oE.displayName=sE;var e6="SelectIcon",iE=w.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return d.jsx(De.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});iE.displayName=e6;var t6="SelectPortal",aE=e=>d.jsx(Jl,{asChild:!0,...e});aE.displayName=t6;var Ho="SelectContent",lE=w.forwardRef((e,t)=>{const r=mo(Ho,e.__scopeSelect),[n,s]=w.useState();if(rr(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?xs.createPortal(d.jsx(cE,{scope:e.__scopeSelect,children:d.jsx(Cf.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),o):null}return d.jsx(uE,{...e,ref:t})});lE.displayName=Ho;var Jn=10,[cE,go]=pa(Ho),r6="SelectContentImpl",uE=w.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:h,collisionPadding:m,sticky:y,hideWhenDetached:p,avoidCollisions:x,...g}=e,v=mo(Ho,r),[_,C]=w.useState(null),[E,T]=w.useState(null),P=ze(t,fe=>C(fe)),[O,j]=w.useState(null),[L,q]=w.useState(null),R=Ef(r),[F,b]=w.useState(!1),V=w.useRef(!1);w.useEffect(()=>{if(_)return kg(_)},[_]),ug();const te=w.useCallback(fe=>{const[ge,...be]=R().map(Se=>Se.ref.current),[Pe]=be.slice(-1),Te=document.activeElement;for(const Se of fe)if(Se===Te||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===ge&&E&&(E.scrollTop=0),Se===Pe&&E&&(E.scrollTop=E.scrollHeight),Se==null||Se.focus(),document.activeElement!==Te))return},[R,E]),B=w.useCallback(()=>te([O,_]),[te,O,_]);w.useEffect(()=>{F&&B()},[F,B]);const{onOpenChange:Z,triggerPointerDownPosRef:I}=v;w.useEffect(()=>{if(_){let fe={x:0,y:0};const ge=Pe=>{var Te,Se;fe={x:Math.abs(Math.round(Pe.pageX)-(((Te=I.current)==null?void 0:Te.x)??0)),y:Math.abs(Math.round(Pe.pageY)-(((Se=I.current)==null?void 0:Se.y)??0))}},be=Pe=>{fe.x<=10&&fe.y<=10?Pe.preventDefault():_.contains(Pe.target)||Z(!1),document.removeEventListener("pointermove",ge),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",be,{capture:!0})}}},[_,Z,I]),w.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]=RE(fe=>{const ge=R().filter(Te=>!Te.disabled),be=ge.find(Te=>Te.ref.current===document.activeElement),Pe=NE(ge,fe,be);Pe&&setTimeout(()=>Pe.ref.current.focus())}),$=w.useCallback((fe,ge,be)=>{const Pe=!V.current&&!be;(v.value!==void 0&&v.value===ge||Pe)&&(j(fe),Pe&&(V.current=!0))},[v.value]),de=w.useCallback(()=>_==null?void 0:_.focus(),[_]),ne=w.useCallback((fe,ge,be)=>{const Pe=!V.current&&!be;(v.value!==void 0&&v.value===ge||Pe)&&q(fe)},[v.value]),se=n==="popper"?qp:dE,Ee=se===qp?{side:a,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:h,collisionPadding:m,sticky:y,hideWhenDetached:p,avoidCollisions:x}:{};return d.jsx(cE,{scope:r,content:_,viewport:E,onViewportChange:T,itemRefCallback:$,selectedItem:O,onItemLeave:de,itemTextRefCallback:ne,focusSelectedItem:B,selectedItemText:L,position:n,isPositioned:F,searchRef:Q,children:d.jsx(Jd,{as:hs,allowPinchZoom:!0,children:d.jsx(Zd,{asChild:!0,trapped:v.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:le(s,fe=>{var ge;(ge=v.trigger)==null||ge.focus({preventScroll:!0}),fe.preventDefault()}),children:d.jsx(aa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:d.jsx(se,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:fe=>fe.preventDefault(),...g,...Ee,onPlaced:()=>b(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:le(g.onKeyDown,fe=>{const ge=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!ge&&fe.key.length===1&&z(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let Pe=R().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(Pe=Pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const Te=fe.target,Se=Pe.indexOf(Te);Pe=Pe.slice(Se+1)}setTimeout(()=>te(Pe)),fe.preventDefault()}})})})})})})});uE.displayName=r6;var n6="SelectItemAlignedPosition",dE=w.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=mo(Ho,r),i=go(Ho,r),[a,l]=w.useState(null),[c,f]=w.useState(null),u=ze(t,P=>f(P)),h=Ef(r),m=w.useRef(!1),y=w.useRef(!0),{viewport:p,selectedItem:x,selectedItemText:g,focusSelectedItem:v}=i,_=w.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&p&&x&&g){const P=o.trigger.getBoundingClientRect(),O=c.getBoundingClientRect(),j=o.valueNode.getBoundingClientRect(),L=g.getBoundingClientRect();if(o.dir!=="rtl"){const Te=L.left-O.left,Se=j.left-Te,Ke=P.left-Se,k=P.width+Ke,J=Math.max(k,O.width),G=window.innerWidth-Jn,D=Kp(Se,[Jn,G-J]);a.style.minWidth=k+"px",a.style.left=D+"px"}else{const Te=O.right-L.right,Se=window.innerWidth-j.right-Te,Ke=window.innerWidth-P.right-Se,k=P.width+Ke,J=Math.max(k,O.width),G=window.innerWidth-Jn,D=Kp(Se,[Jn,G-J]);a.style.minWidth=k+"px",a.style.right=D+"px"}const q=h(),R=window.innerHeight-Jn*2,F=p.scrollHeight,b=window.getComputedStyle(c),V=parseInt(b.borderTopWidth,10),te=parseInt(b.paddingTop,10),B=parseInt(b.borderBottomWidth,10),Z=parseInt(b.paddingBottom,10),I=V+te+F+Z+B,Q=Math.min(x.offsetHeight*5,I),z=window.getComputedStyle(p),$=parseInt(z.paddingTop,10),de=parseInt(z.paddingBottom,10),ne=P.top+P.height/2-Jn,se=R-ne,Ee=x.offsetHeight/2,fe=x.offsetTop+Ee,ge=V+te+fe,be=I-ge;if(ge<=ne){const Te=x===q[q.length-1].ref.current;a.style.bottom="0px";const Se=c.clientHeight-p.offsetTop-p.offsetHeight,Ke=Math.max(se,Ee+(Te?de:0)+Se+B),k=ge+Ke;a.style.height=k+"px"}else{const Te=x===q[0].ref.current;a.style.top="0px";const Ke=Math.max(ne,V+p.offsetTop+(Te?$:0)+Ee)+be;a.style.height=Ke+"px",p.scrollTop=ge-ne+p.offsetTop}a.style.margin=`${Jn}px 0`,a.style.minHeight=Q+"px",a.style.maxHeight=R+"px",n==null||n(),requestAnimationFrame(()=>m.current=!0)}},[h,o.trigger,o.valueNode,a,c,p,x,g,o.dir,n]);rr(()=>_(),[_]);const[C,E]=w.useState();rr(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const T=w.useCallback(P=>{P&&y.current===!0&&(_(),v==null||v(),y.current=!1)},[_,v]);return d.jsx(o6,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:T,children:d.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:d.jsx(De.div,{...s,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});dE.displayName=n6;var s6="SelectPopperPosition",qp=w.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=Jn,...o}=e,i=Tf(r);return d.jsx(bg,{...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)"}})});qp.displayName=s6;var[o6,Cv]=pa(Ho,{}),Xp="SelectViewport",fE=w.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=go(Xp,r),i=Cv(Xp,r),a=ze(t,o.onViewportChange),l=w.useRef(0);return d.jsxs(d.Fragment,{children:[d.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}),d.jsx(Cf.Slot,{scope:r,children:d.jsx(De.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:le(s.onScroll,c=>{const f=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&u){const m=Math.abs(l.current-f.scrollTop);if(m>0){const y=window.innerHeight-Jn*2,p=parseFloat(u.style.minHeight),x=parseFloat(u.style.height),g=Math.max(p,x);if(g0?C:0,u.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});fE.displayName=Xp;var hE="SelectGroup",[i6,a6]=pa(hE),pE=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=On();return d.jsx(i6,{scope:r,id:s,children:d.jsx(De.div,{role:"group","aria-labelledby":s,...n,ref:t})})});pE.displayName=hE;var mE="SelectLabel",gE=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=a6(mE,r);return d.jsx(De.div,{id:s.id,...n,ref:t})});gE.displayName=mE;var bd="SelectItem",[l6,vE]=pa(bd),yE=w.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...i}=e,a=mo(bd,r),l=go(bd,r),c=a.value===n,[f,u]=w.useState(o??""),[h,m]=w.useState(!1),y=ze(t,g=>{var v;return(v=l.itemRefCallback)==null?void 0:v.call(l,g,n,s)}),p=On(),x=()=>{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 d.jsx(l6,{scope:r,value:n,disabled:s,textId:p,isSelected:c,onItemTextChange:w.useCallback(g=>{u(v=>v||((g==null?void 0:g.textContent)??"").trim())},[]),children:d.jsx(Cf.ItemSlot,{scope:r,value:n,disabled:s,textValue:f,children:d.jsx(De.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:y,onFocus:le(i.onFocus,()=>m(!0)),onBlur:le(i.onBlur,()=>m(!1)),onPointerUp:le(i.onPointerUp,x),onPointerMove:le(i.onPointerMove,g=>{var v;s?(v=l.onItemLeave)==null||v.call(l):g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:le(i.onPointerLeave,g=>{var v;g.currentTarget===document.activeElement&&((v=l.onItemLeave)==null||v.call(l))}),onKeyDown:le(i.onKeyDown,g=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&g.key===" "||(Kz.includes(g.key)&&x(),g.key===" "&&g.preventDefault())})})})})});yE.displayName=bd;var Ua="SelectItemText",wE=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,i=mo(Ua,r),a=go(Ua,r),l=vE(Ua,r),c=Jz(Ua,r),[f,u]=w.useState(null),h=ze(t,g=>u(g),l.onItemTextChange,g=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,g,l.value,l.disabled)}),m=f==null?void 0:f.textContent,y=w.useMemo(()=>d.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:p,onNativeOptionRemove:x}=c;return rr(()=>(p(y),()=>x(y)),[p,x,y]),d.jsxs(d.Fragment,{children:[d.jsx(De.span,{id:l.textId,...o,ref:h}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?xs.createPortal(o.children,i.valueNode):null]})});wE.displayName=Ua;var xE="SelectItemIndicator",_E=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return vE(xE,r).isSelected?d.jsx(De.span,{"aria-hidden":!0,...n,ref:t}):null});_E.displayName=xE;var Qp="SelectScrollUpButton",bE=w.forwardRef((e,t)=>{const r=go(Qp,e.__scopeSelect),n=Cv(Qp,e.__scopeSelect),[s,o]=w.useState(!1),i=ze(t,n.onScrollButtonChange);return rr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollTop>0;o(c)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?d.jsx(kE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});bE.displayName=Qp;var Jp="SelectScrollDownButton",SE=w.forwardRef((e,t)=>{const r=go(Jp,e.__scopeSelect),n=Cv(Jp,e.__scopeSelect),[s,o]=w.useState(!1),i=ze(t,n.onScrollButtonChange);return rr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?d.jsx(kE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});SE.displayName=Jp;var kE=w.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=go("SelectScrollButton",r),i=w.useRef(null),a=Ef(r),l=w.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),rr(()=>{var f;const c=a().find(u=>u.ref.current===document.activeElement);(f=c==null?void 0:c.ref.current)==null||f.scrollIntoView({block:"nearest"})},[a]),d.jsx(De.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:le(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:le(s.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:le(s.onPointerLeave,()=>{l()})})}),c6="SelectSeparator",CE=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return d.jsx(De.div,{"aria-hidden":!0,...n,ref:t})});CE.displayName=c6;var em="SelectArrow",u6=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Tf(r),o=mo(em,r),i=go(em,r);return o.open&&i.position==="popper"?d.jsx(Sg,{...s,...n,ref:t}):null});u6.displayName=em;function EE(e){return e===""||e===void 0}var TE=w.forwardRef((e,t)=>{const{value:r,...n}=e,s=w.useRef(null),o=ze(t,s),i=dv(r);return w.useEffect(()=>{const a=s.current,l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==r&&f){const u=new Event("change",{bubbles:!0});f.call(a,r),a.dispatchEvent(u)}},[i,r]),d.jsx(dc,{asChild:!0,children:d.jsx("select",{...n,ref:o,defaultValue:r})})});TE.displayName="BubbleSelect";function RE(e){const t=Pt(e),r=w.useRef(""),n=w.useRef(0),s=w.useCallback(i=>{const a=r.current+i;t(a),function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=w.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function NE(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=d6(e,Math.max(o,0));s.length===1&&(i=i.filter(c=>c!==r));const l=i.find(c=>c.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function d6(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var f6=tE,PE=nE,h6=oE,p6=iE,m6=aE,jE=lE,g6=fE,v6=pE,DE=gE,OE=yE,y6=wE,w6=_E,AE=bE,ME=SE,IE=CE;const pw=f6,mw=v6,gw=h6,tm=w.forwardRef(({className:e,children:t,...r},n)=>d.jsxs(PE,{ref:n,className:we("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,d.jsx(p6,{asChild:!0,children:d.jsx(J_,{className:"h-4 w-4 opacity-50"})})]}));tm.displayName=PE.displayName;const LE=w.forwardRef(({className:e,...t},r)=>d.jsx(AE,{ref:r,className:we("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(zP,{className:"h-4 w-4"})}));LE.displayName=AE.displayName;const FE=w.forwardRef(({className:e,...t},r)=>d.jsx(ME,{ref:r,className:we("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(J_,{className:"h-4 w-4"})}));FE.displayName=ME.displayName;const rm=w.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>d.jsx(m6,{children:d.jsxs(jE,{ref:s,className:we("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:[d.jsx(LE,{}),d.jsx(g6,{className:we("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),d.jsx(FE,{})]})}));rm.displayName=jE.displayName;const nm=w.forwardRef(({className:e,...t},r)=>d.jsx(DE,{ref:r,className:we("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));nm.displayName=DE.displayName;const sm=w.forwardRef(({className:e,children:t,...r},n)=>d.jsxs(OE,{ref:n,className:we("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:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(w6,{children:d.jsx(Q_,{className:"h-4 w-4"})})}),d.jsx(y6,{children:t})]}));sm.displayName=OE.displayName;const x6=w.forwardRef(({className:e,...t},r)=>d.jsx(IE,{ref:r,className:we("-mx-1 my-1 h-px bg-muted",e),...t}));x6.displayName=IE.displayName;const om=new Map([["aliyun-cdn",["阿里云-CDN","/imgs/providers/aliyun.svg"]],["aliyun-oss",["阿里云-OSS","/imgs/providers/aliyun.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.png"]]]),_6=Array.from(om.keys()),b6=Lg,S6=Fg,k6=zg,zE=w.forwardRef(({className:e,...t},r)=>d.jsx(rc,{ref:r,className:we("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}));zE.displayName=rc.displayName;const UE=w.forwardRef(({className:e,children:t,...r},n)=>d.jsxs(k6,{children:[d.jsx(zE,{}),d.jsxs(nc,{ref:n,className:we("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,d.jsxs(rf,{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:[d.jsx(og,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));UE.displayName=nc.displayName;const $E=({className:e,...t})=>d.jsx("div",{className:we("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});$E.displayName="DialogHeader";const VE=w.forwardRef(({className:e,...t},r)=>d.jsx(sc,{ref:r,className:we("text-lg font-semibold leading-none tracking-tight",e),...t}));VE.displayName=sc.displayName;const C6=w.forwardRef(({className:e,...t},r)=>d.jsx(oc,{ref:r,className:we("text-sm text-muted-foreground",e),...t}));C6.displayName=oc.displayName;const Oo=new Map([["tencent",["腾讯云","/imgs/providers/tencent.svg"]],["aliyun",["阿里云","/imgs/providers/aliyun.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.png"]]]),Ev=qe.union([qe.literal("aliyun"),qe.literal("tencent"),qe.literal("ssh")],{message:"请选择云服务商"}),E6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=uc(),s=qe.object({id:qe.string().optional(),name:qe.string().min(1).max(64),configType:Ev,secretId:qe.string().min(1).max(64),secretKey:qe.string().min(1).max(64)});let o={secretId:"",secretKey:""};e&&(o=e.config);const i=hc({resolver:pc(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 c={id:l.id,name:l.name,configType:l.configType,config:{secretId:l.secretId,secretKey:l.secretKey}};try{const f=await uv(c);if(t(),c.id=f.id,c.created=f.created,c.updated=f.updated,l.id){n(c);return}r(c)}catch(f){Object.entries(f.response.data).forEach(([h,m])=>{i.setError(h,{type:"manual",message:m.message})})}};return d.jsx(d.Fragment,{children:d.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:d.jsx(gc,{...i,children:d.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[d.jsx(ft,{control:i.control,name:"name",render:({field:l})=>d.jsxs(at,{children:[d.jsx(lt,{children:"名称"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入授权名称",...l})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"id",render:({field:l})=>d.jsxs(at,{className:"hidden",children:[d.jsx(lt,{children:"配置类型"}),d.jsx(ct,{children:d.jsx(wt,{...l})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"configType",render:({field:l})=>d.jsxs(at,{className:"hidden",children:[d.jsx(lt,{children:"配置类型"}),d.jsx(ct,{children:d.jsx(wt,{...l})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"secretId",render:({field:l})=>d.jsxs(at,{children:[d.jsx(lt,{children:"SecretId"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入SecretId",...l})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"secretKey",render:({field:l})=>d.jsxs(at,{children:[d.jsx(lt,{children:"SecretKey"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入SecretKey",...l})}),d.jsx(nt,{})]})}),d.jsx("div",{className:"flex justify-end",children:d.jsx(Lt,{type:"submit",children:"保存"})})]})})})})},T6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=uc(),s=qe.object({id:qe.string().optional(),name:qe.string().min(1).max(64),configType:Ev,accessKeyId:qe.string().min(1).max(64),accessSecretId:qe.string().min(1).max(64)});let o={accessKeyId:"",accessKeySecret:""};e&&(o=e.config);const i=hc({resolver:pc(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 c={id:l.id,name:l.name,configType:l.configType,config:{accessKeyId:l.accessKeyId,accessKeySecret:l.accessSecretId}};try{const f=await uv(c);if(t(),c.id=f.id,c.created=f.created,c.updated=f.updated,l.id){n(c);return}r(c)}catch(f){Object.entries(f.response.data).forEach(([h,m])=>{i.setError(h,{type:"manual",message:m.message})});return}};return d.jsx(d.Fragment,{children:d.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:d.jsx(gc,{...i,children:d.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[d.jsx(ft,{control:i.control,name:"name",render:({field:l})=>d.jsxs(at,{children:[d.jsx(lt,{children:"名称"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入授权名称",...l})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"id",render:({field:l})=>d.jsxs(at,{className:"hidden",children:[d.jsx(lt,{children:"配置类型"}),d.jsx(ct,{children:d.jsx(wt,{...l})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"configType",render:({field:l})=>d.jsxs(at,{className:"hidden",children:[d.jsx(lt,{children:"配置类型"}),d.jsx(ct,{children:d.jsx(wt,{...l})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"accessKeyId",render:({field:l})=>d.jsxs(at,{children:[d.jsx(lt,{children:"AccessKeyId"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入AccessKeyId",...l})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"accessSecretId",render:({field:l})=>d.jsxs(at,{children:[d.jsx(lt,{children:"AccessKeySecret"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入AccessKeySecret",...l})}),d.jsx(nt,{})]})}),d.jsx(nt,{}),d.jsx("div",{className:"flex justify-end",children:d.jsx(Lt,{type:"submit",children:"保存"})})]})})})})};var Tv="Radio",[R6,BE]=Er(Tv),[N6,P6]=R6(Tv),WE=w.forwardRef((e,t)=>{const{__scopeRadio:r,name:n,checked:s=!1,required:o,disabled:i,value:a="on",onCheck:l,...c}=e,[f,u]=w.useState(null),h=ze(t,p=>u(p)),m=w.useRef(!1),y=f?!!f.closest("form"):!0;return d.jsxs(N6,{scope:r,checked:s,disabled:i,children:[d.jsx(De.button,{type:"button",role:"radio","aria-checked":s,"data-state":ZE(s),"data-disabled":i?"":void 0,disabled:i,value:a,...c,ref:h,onClick:le(e.onClick,p=>{s||l==null||l(),y&&(m.current=p.isPropagationStopped(),m.current||p.stopPropagation())})}),y&&d.jsx(j6,{control:f,bubbles:!m.current,name:n,value:a,checked:s,required:o,disabled:i,style:{transform:"translateX(-100%)"}})]})});WE.displayName=Tv;var HE="RadioIndicator",YE=w.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...s}=e,o=P6(HE,r);return d.jsx(vr,{present:n||o.checked,children:d.jsx(De.span,{"data-state":ZE(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})})});YE.displayName=HE;var j6=e=>{const{control:t,checked:r,bubbles:n=!0,...s}=e,o=w.useRef(null),i=dv(r),a=vg(t);return w.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"checked").set;if(i!==r&&u){const h=new Event("click",{bubbles:n});u.call(l,r),l.dispatchEvent(h)}},[i,r,n]),d.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ZE(e){return e?"checked":"unchecked"}var D6=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Rv="RadioGroup",[O6,yU]=Er(Rv,[Xd,BE]),GE=Xd(),KE=BE(),[A6,M6]=O6(Rv),qE=w.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:s,value:o,required:i=!1,disabled:a=!1,orientation:l,dir:c,loop:f=!0,onValueChange:u,...h}=e,m=GE(r),y=Xl(c),[p,x]=ps({prop:o,defaultProp:s,onChange:u});return d.jsx(A6,{scope:r,name:n,required:i,disabled:a,value:p,onValueChange:x,children:d.jsx(F1,{asChild:!0,...m,orientation:l,dir:y,loop:f,children:d.jsx(De.div,{role:"radiogroup","aria-required":i,"aria-orientation":l,"data-disabled":a?"":void 0,dir:y,...h,ref:t})})})});qE.displayName=Rv;var XE="RadioGroupItem",QE=w.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...s}=e,o=M6(XE,r),i=o.disabled||n,a=GE(r),l=KE(r),c=w.useRef(null),f=ze(t,c),u=o.value===s.value,h=w.useRef(!1);return w.useEffect(()=>{const m=p=>{D6.includes(p.key)&&(h.current=!0)},y=()=>h.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",y)}},[]),d.jsx(z1,{asChild:!0,...a,focusable:!i,active:u,children:d.jsx(WE,{disabled:i,required:o.required,checked:u,...l,...s,name:o.name,ref:f,onCheck:()=>o.onValueChange(s.value),onKeyDown:le(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:le(s.onFocus,()=>{var m;h.current&&((m=c.current)==null||m.click())})})})});QE.displayName=XE;var I6="RadioGroupIndicator",JE=w.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,s=KE(r);return d.jsx(YE,{...s,...n,ref:t})});JE.displayName=I6;var eT=qE,tT=QE,L6=JE;const Nv=w.forwardRef(({className:e,...t},r)=>d.jsx(eT,{className:we("grid gap-2",e),...t,ref:r}));Nv.displayName=eT.displayName;const Pv=w.forwardRef(({className:e,...t},r)=>d.jsx(tT,{ref:r,className:we("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:d.jsx(L6,{className:"flex items-center justify-center",children:d.jsx(r1,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Pv.displayName=tT.displayName;const rT=w.forwardRef(({className:e,...t},r)=>d.jsx("textarea",{className:we("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}));rT.displayName="Textarea";const F6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=uc(),s=qe.object({id:qe.string().optional(),name:qe.string().min(1).max(64),configType:Ev,host:qe.string().ip({message:"请输入合法的IP地址"}),port:qe.string().min(1).max(5),username:qe.string().min(1).max(64),password:qe.string().min(0).max(64),key:qe.string().min(0).max(20480),keyFile:qe.string().optional(),command:qe.string().min(1).max(2048),certPath:qe.string().min(0).max(2048),keyPath:qe.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=hc({resolver:pc(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 c=>{console.log(c);const f={id:c.id,name:c.name,configType:c.configType,config:{host:c.host,port:c.port,username:c.username,password:c.password,key:c.key,command:c.command,certPath:c.certPath,keyPath:c.keyPath}};try{const u=await uv(f);if(t(),f.id=u.id,f.created=u.created,f.updated=u.updated,c.id){n(f);return}r(f)}catch(u){Object.entries(u.response.data).forEach(([m,y])=>{i.setError(m,{type:"manual",message:y.message})});return}},l=async c=>{var h;const f=(h=c.target.files)==null?void 0:h[0];if(!f)return;const u=await p5(f);i.setValue("key",u),i.setValue("keyFile","")};return d.jsx(d.Fragment,{children:d.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:d.jsx(gc,{...i,children:d.jsxs("form",{onSubmit:c=>{c.stopPropagation(),i.handleSubmit(a)(c)},className:"space-y-3",children:[d.jsx(ft,{control:i.control,name:"name",render:({field:c})=>d.jsxs(at,{children:[d.jsx(lt,{children:"名称"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入授权名称",...c})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"id",render:({field:c})=>d.jsxs(at,{className:"hidden",children:[d.jsx(lt,{children:"配置类型"}),d.jsx(ct,{children:d.jsx(wt,{...c})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"configType",render:({field:c})=>d.jsxs(at,{className:"hidden",children:[d.jsx(lt,{children:"配置类型"}),d.jsx(ct,{children:d.jsx(wt,{...c})}),d.jsx(nt,{})]})}),d.jsxs("div",{className:"flex space-x-2",children:[d.jsx(ft,{control:i.control,name:"host",render:({field:c})=>d.jsxs(at,{className:"grow",children:[d.jsx(lt,{children:"服务器IP"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入Host",...c})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"port",render:({field:c})=>d.jsxs(at,{children:[d.jsx(lt,{children:"SSH端口"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入Port",...c,type:"number"})}),d.jsx(nt,{})]})})]}),d.jsx(ft,{control:i.control,name:"username",render:({field:c})=>d.jsxs(at,{children:[d.jsx(lt,{children:"用户名"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入用户名",...c})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"password",render:({field:c})=>d.jsxs(at,{children:[d.jsx(lt,{children:"密码"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入密码",...c,type:"password"})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"key",render:({field:c})=>d.jsxs(at,{hidden:!0,children:[d.jsx(lt,{children:"Key(使用证书登录)"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入Key",...c})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"keyFile",render:({field:c})=>d.jsxs(at,{children:[d.jsx(lt,{children:"Key(使用证书登录)"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入Key",...c,type:"file",onChange:l})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"certPath",render:({field:c})=>d.jsxs(at,{children:[d.jsx(lt,{children:"证书上传路径"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入证书上传路径",...c})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"keyPath",render:({field:c})=>d.jsxs(at,{children:[d.jsx(lt,{children:"私钥上传路径"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入私钥上传路径",...c})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:i.control,name:"command",render:({field:c})=>d.jsxs(at,{children:[d.jsx(lt,{children:"Command"}),d.jsx(ct,{children:d.jsx(rT,{placeholder:"请输入要执行的命令",...c})}),d.jsx(nt,{})]})}),d.jsx(nt,{}),d.jsx("div",{className:"flex justify-end",children:d.jsx(Lt,{type:"submit",children:"保存"})})]})})})})};function el({trigger:e,op:t,data:r,className:n}){const[s,o]=w.useState(!1),i=Array.from(Oo.keys()),[a,l]=w.useState((r==null?void 0:r.configType)||"");let c=d.jsx(d.Fragment,{children:" "});switch(a){case"tencent":c=d.jsx(E6,{data:r,onAfterReq:()=>{o(!1)}});break;case"aliyun":c=d.jsx(T6,{data:r,onAfterReq:()=>{o(!1)}});break;case"ssh":c=d.jsx(F6,{data:r,onAfterReq:()=>{o(!1)}});break}const f=u=>u==a?"border-primary":"";return d.jsxs(b6,{onOpenChange:o,open:s,children:[d.jsx(S6,{asChild:!0,className:we(n),children:e}),d.jsxs(UE,{className:"sm:max-w-[600px] w-full",children:[d.jsx($E,{children:d.jsxs(VE,{children:[t=="add"?"添加":"编辑","授权"]})}),d.jsxs("div",{className:"container",children:[d.jsx(Wl,{children:"服务商"}),d.jsx(Nv,{value:a,className:"flex mt-3 space-x-2",onValueChange:u=>{console.log(u),l(u)},children:i.map(u=>{var h,m;return d.jsx("div",{className:"flex items-center space-x-2",children:d.jsxs(Wl,{children:[d.jsx(Pv,{value:u,hidden:!0}),d.jsxs("div",{className:we("flex items-center space-x-2 border p-2 rounded cursor-pointer",f(u)),children:[d.jsx("img",{src:(h=Oo.get(u))==null?void 0:h[1],className:"h-6"}),d.jsx("div",{children:(m=Oo.get(u))==null?void 0:m[0]})]})]})},u)})}),c]})]})]})}const z6=()=>{const{config:{accesses:e}}=uc(),[t,r]=w.useState(),n=ho();w.useEffect(()=>{const y=new URLSearchParams(n.search).get("id");y&&(async()=>{const x=await y5(y);r(x)})()},[n.search]);const s=qe.object({id:qe.string().optional(),domain:qe.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:"请输入正确的域名"}),access:qe.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择DNS服务商授权配置"}),targetAccess:qe.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择部署服务商配置"}),targetType:qe.string().regex(/^[a-zA-Z0-9-]+$/,{message:"请选择部署服务类型"})}),o=hc({resolver:pc(s),defaultValues:{id:"",domain:"",access:"",targetAccess:"",targetType:""}});w.useEffect(()=>{t&&o.reset({id:t.id,domain:t.domain,access:t.access,targetAccess:t.targetAccess,targetType:t.targetType})},[t,o]);const[i,a]=w.useState(t?t.targetType:""),l=e.filter(m=>{if(i=="")return!0;const y=o.getValues().targetType.split("-");return m.configType===y[0]}),{toast:c}=gv(),f=po(),u=async m=>{const y={id:m.id,crontab:"0 0 * * *",domain:m.domain,access:m.access,targetAccess:m.targetAccess,targetType:m.targetType};try{await Wp(y);let p="域名编辑成功";y.id==""&&(p="域名添加成功"),c({title:"成功",description:p}),f("/")}catch(p){Object.entries(p.response.data).forEach(([g,v])=>{o.setError(g,{type:"manual",message:v.message})});return}},h=m=>o.getValues().targetType==m?"border-primary":"";return d.jsx(d.Fragment,{children:d.jsxs("div",{className:"",children:[d.jsx(mC,{}),d.jsxs("div",{className:"border-b h-10 text-muted-foreground",children:[t!=null&&t.id?"编辑":"新增","域名"]}),d.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:d.jsx(gc,{...o,children:d.jsxs("form",{onSubmit:o.handleSubmit(u),className:"space-y-8",children:[d.jsx(ft,{control:o.control,name:"domain",render:({field:m})=>d.jsxs(at,{children:[d.jsx(lt,{children:"域名"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"请输入域名",...m})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:o.control,name:"access",render:({field:m})=>d.jsxs(at,{children:[d.jsxs(lt,{className:"flex w-full justify-between",children:[d.jsx("div",{children:"DNS 服务商授权配置"}),d.jsx(el,{trigger:d.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[d.jsx(g0,{size:14}),"新增"]}),op:"add"})]}),d.jsx(ct,{children:d.jsxs(pw,{...m,value:m.value,onValueChange:y=>{o.setValue("access",y)},children:[d.jsx(tm,{children:d.jsx(gw,{placeholder:"请选择授权配置"})}),d.jsx(rm,{children:d.jsxs(mw,{children:[d.jsx(nm,{children:"服务商授权配置"}),e.map(y=>{var p;return d.jsx(sm,{value:y.id,children:d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx("img",{className:"w-6",src:(p=Oo.get(y.configType))==null?void 0:p[1]}),d.jsx("div",{children:y.name})]})},y.id)})]})})]})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:o.control,name:"targetType",render:({field:m})=>d.jsxs(at,{children:[d.jsx(lt,{children:"部署服务类型"}),d.jsx(ct,{children:d.jsx(Nv,{className:"flex mt-3 space-x-2",onValueChange:y=>{a(y),o.setValue("targetType",y)},...m,children:_6.map(y=>{var p,x;return d.jsx("div",{className:"flex items-center space-x-2",children:d.jsxs(Wl,{children:[d.jsx(Pv,{value:y,id:y,hidden:!0}),d.jsxs("div",{className:we("flex items-center space-x-2 border p-2 rounded cursor-pointer",h(y)),children:[d.jsx("img",{src:(p=om.get(y))==null?void 0:p[1],className:"h-6"}),d.jsx("div",{children:(x=om.get(y))==null?void 0:x[0]})]})]})},y)})})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:o.control,name:"targetAccess",render:({field:m})=>d.jsxs(at,{children:[d.jsxs(lt,{className:"w-full flex justify-between",children:[d.jsx("div",{children:"部署服务商授权配置"}),d.jsx(el,{trigger:d.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[d.jsx(g0,{size:14}),"新增"]}),op:"add"})]}),d.jsx(ct,{children:d.jsxs(pw,{...m,onValueChange:y=>{o.setValue("targetAccess",y)},children:[d.jsx(tm,{children:d.jsx(gw,{placeholder:"请选择授权配置"})}),d.jsx(rm,{children:d.jsxs(mw,{children:[d.jsx(nm,{children:"服务商授权配置"}),l.map(y=>{var p;return d.jsx(sm,{value:y.id,children:d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx("img",{className:"w-6",src:(p=Oo.get(y.configType))==null?void 0:p[1]}),d.jsx("div",{children:y.name})]})},y.id)})]})})]})}),d.jsx(nt,{})]})}),d.jsx("div",{className:"flex justify-end",children:d.jsx(Lt,{type:"submit",children:"保存"})})]})})})]})})},U6=()=>{const{config:e,deleteAccess:t}=uc(),{accesses:r}=e,n=async s=>{const o=await Y4(s);t(o.id)};return d.jsxs("div",{className:"",children:[d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsx("div",{className:"text-muted-foreground",children:"授权管理"}),d.jsx(el,{trigger:d.jsx(Lt,{children:"添加授权"}),op:"add"})]}),r.length===0?d.jsxs("div",{className:"flex flex-col items-center mt-10",children:[d.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:d.jsx($P,{size:40,className:"text-primary"})}),d.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加授权开始部署证书吧。"}),d.jsx(el,{trigger:d.jsx(Lt,{children:"添加授权"}),op:"add",className:"mt-3"})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b sm:p-2 mt-5",children:[d.jsx("div",{className:"w-48",children:"名称"}),d.jsx("div",{className:"w-48",children:"服务商"}),d.jsx("div",{className:"w-52",children:"创建时间"}),d.jsx("div",{className:"w-52",children:"更新时间"}),d.jsx("div",{className:"grow",children:"操作"})]}),d.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"授权列表"}),r.map(s=>{var o,i;return d.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b sm:p-2 hover:bg-muted/50 text-sm",children:[d.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:s.name}),d.jsxs("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center space-x-2",children:[d.jsx("img",{src:(o=Oo.get(s.configType))==null?void 0:o[1],className:"w-6"}),d.jsx("div",{children:(i=Oo.get(s.configType))==null?void 0:i[0]})]}),d.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["创建于 ",s.created&&Nl(s.created)]}),d.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["更新于 ",s.updated&&Nl(s.updated)]}),d.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[d.jsx(el,{trigger:d.jsx(Lt,{variant:"link",className:"p-0",children:"编辑"}),op:"edit",data:s}),d.jsx(Gt,{orientation:"vertical",className:"h-4 mx-2"}),d.jsx(Lt,{variant:"link",className:"p-0",onClick:()=>{n(s)},children:"删除"})]})]},s.id)})]})]})},$6=ql("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"}}),nT=w.forwardRef(({className:e,variant:t,...r},n)=>d.jsx("div",{ref:n,role:"alert",className:we($6({variant:t}),e),...r}));nT.displayName="Alert";const sT=w.forwardRef(({className:e,...t},r)=>d.jsx("h5",{ref:r,className:we("mb-1 font-medium leading-none tracking-tight",e),...t}));sT.displayName="AlertTitle";const oT=w.forwardRef(({className:e,...t},r)=>d.jsx("div",{ref:r,className:we("text-sm [&_p]:leading-relaxed",e),...t}));oT.displayName="AlertDescription";function V6(e,t){return w.useReducer((r,n)=>t[r][n]??r,e)}var jv="ScrollArea",[iT,wU]=Er(jv),[B6,en]=iT(jv),aT=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:o=600,...i}=e,[a,l]=w.useState(null),[c,f]=w.useState(null),[u,h]=w.useState(null),[m,y]=w.useState(null),[p,x]=w.useState(null),[g,v]=w.useState(0),[_,C]=w.useState(0),[E,T]=w.useState(!1),[P,O]=w.useState(!1),j=ze(t,q=>l(q)),L=Xl(s);return d.jsx(B6,{scope:r,type:n,dir:L,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:f,content:u,onContentChange:h,scrollbarX:m,onScrollbarXChange:y,scrollbarXEnabled:E,onScrollbarXEnabledChange:T,scrollbarY:p,onScrollbarYChange:x,scrollbarYEnabled:P,onScrollbarYEnabledChange:O,onCornerWidthChange:v,onCornerHeightChange:C,children:d.jsx(De.div,{dir:L,...i,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});aT.displayName=jv;var lT="ScrollAreaViewport",cT=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...o}=e,i=en(lT,r),a=w.useRef(null),l=ze(t,a,i.onViewportChange);return d.jsxs(d.Fragment,{children:[d.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}),d.jsx(De.div,{"data-radix-scroll-area-viewport":"",...o,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:d.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});cT.displayName=lT;var $n="ScrollAreaScrollbar",Dv=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=en($n,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,a=e.orientation==="horizontal";return w.useEffect(()=>(a?o(!0):i(!0),()=>{a?o(!1):i(!1)}),[a,o,i]),s.type==="hover"?d.jsx(W6,{...n,ref:t,forceMount:r}):s.type==="scroll"?d.jsx(H6,{...n,ref:t,forceMount:r}):s.type==="auto"?d.jsx(uT,{...n,ref:t,forceMount:r}):s.type==="always"?d.jsx(Ov,{...n,ref:t}):null});Dv.displayName=$n;var W6=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=en($n,e.__scopeScrollArea),[o,i]=w.useState(!1);return w.useEffect(()=>{const a=s.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),i(!0)},f=()=>{l=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),d.jsx(vr,{present:r||o,children:d.jsx(uT,{"data-state":o?"visible":"hidden",...n,ref:t})})}),H6=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=en($n,e.__scopeScrollArea),o=e.orientation==="horizontal",i=Nf(()=>l("SCROLL_END"),100),[a,l]=V6("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 w.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,s.scrollHideDelay,l]),w.useEffect(()=>{const c=s.viewport,f=o?"scrollLeft":"scrollTop";if(c){let u=c[f];const h=()=>{const m=c[f];u!==m&&(l("SCROLL"),i()),u=m};return c.addEventListener("scroll",h),()=>c.removeEventListener("scroll",h)}},[s.viewport,o,l,i]),d.jsx(vr,{present:r||a!=="hidden",children:d.jsx(Ov,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:le(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:le(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),uT=w.forwardRef((e,t)=>{const r=en($n,e.__scopeScrollArea),{forceMount:n,...s}=e,[o,i]=w.useState(!1),a=e.orientation==="horizontal",l=Nf(()=>{if(r.viewport){const c=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,s=en($n,e.__scopeScrollArea),o=w.useRef(null),i=w.useRef(0),[a,l]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=mT(a.viewport,a.content),f={...n,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:h=>o.current=h,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:h=>i.current=h};function u(h,m){return X6(h,i.current,a,m)}return r==="horizontal"?d.jsx(Y6,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const h=s.viewport.scrollLeft,m=vw(h,a,s.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollLeft=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollLeft=u(h,s.dir))}}):r==="vertical"?d.jsx(Z6,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const h=s.viewport.scrollTop,m=vw(h,a);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollTop=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollTop=u(h))}}):null}),Y6=w.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=en($n,e.__scopeScrollArea),[i,a]=w.useState(),l=w.useRef(null),c=ze(t,l,o.onScrollbarXChange);return w.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),d.jsx(fT,{"data-orientation":"horizontal",...s,ref:c,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":Rf(r)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,u)=>{if(o.viewport){const h=o.viewport.scrollLeft+f.deltaX;e.onWheelScroll(h),vT(h,u)&&f.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:kd(i.paddingLeft),paddingEnd:kd(i.paddingRight)}})}})}),Z6=w.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=en($n,e.__scopeScrollArea),[i,a]=w.useState(),l=w.useRef(null),c=ze(t,l,o.onScrollbarYChange);return w.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),d.jsx(fT,{"data-orientation":"vertical",...s,ref:c,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":Rf(r)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,u)=>{if(o.viewport){const h=o.viewport.scrollTop+f.deltaY;e.onWheelScroll(h),vT(h,u)&&f.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:kd(i.paddingTop),paddingEnd:kd(i.paddingBottom)}})}})}),[G6,dT]=iT($n),fT=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:f,onResize:u,...h}=e,m=en($n,r),[y,p]=w.useState(null),x=ze(t,j=>p(j)),g=w.useRef(null),v=w.useRef(""),_=m.viewport,C=n.content-n.viewport,E=Pt(f),T=Pt(l),P=Nf(u,10);function O(j){if(g.current){const L=j.clientX-g.current.left,q=j.clientY-g.current.top;c({x:L,y:q})}}return w.useEffect(()=>{const j=L=>{const q=L.target;(y==null?void 0:y.contains(q))&&E(L,C)};return document.addEventListener("wheel",j,{passive:!1}),()=>document.removeEventListener("wheel",j,{passive:!1})},[_,y,C,E]),w.useEffect(T,[n,T]),ea(y,P),ea(m.content,P),d.jsx(G6,{scope:r,scrollbar:y,hasThumb:s,onThumbChange:Pt(o),onThumbPointerUp:Pt(i),onThumbPositionChange:T,onThumbPointerDown:Pt(a),children:d.jsx(De.div,{...h,ref:x,style:{position:"absolute",...h.style},onPointerDown:le(e.onPointerDown,j=>{j.button===0&&(j.target.setPointerCapture(j.pointerId),g.current=y.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),O(j))}),onPointerMove:le(e.onPointerMove,O),onPointerUp:le(e.onPointerUp,j=>{const L=j.target;L.hasPointerCapture(j.pointerId)&&L.releasePointerCapture(j.pointerId),document.body.style.webkitUserSelect=v.current,m.viewport&&(m.viewport.style.scrollBehavior=""),g.current=null})})})}),Sd="ScrollAreaThumb",hT=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=dT(Sd,e.__scopeScrollArea);return d.jsx(vr,{present:r||s.hasThumb,children:d.jsx(K6,{ref:t,...n})})}),K6=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,o=en(Sd,r),i=dT(Sd,r),{onThumbPositionChange:a}=i,l=ze(t,u=>i.onThumbChange(u)),c=w.useRef(),f=Nf(()=>{c.current&&(c.current(),c.current=void 0)},100);return w.useEffect(()=>{const u=o.viewport;if(u){const h=()=>{if(f(),!c.current){const m=Q6(u,a);c.current=m,a()}};return a(),u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[o.viewport,f,a]),d.jsx(De.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:le(e.onPointerDownCapture,u=>{const m=u.target.getBoundingClientRect(),y=u.clientX-m.left,p=u.clientY-m.top;i.onThumbPointerDown({x:y,y:p})}),onPointerUp:le(e.onPointerUp,i.onThumbPointerUp)})});hT.displayName=Sd;var Av="ScrollAreaCorner",pT=w.forwardRef((e,t)=>{const r=en(Av,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?d.jsx(q6,{...e,ref:t}):null});pT.displayName=Av;var q6=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=en(Av,r),[o,i]=w.useState(0),[a,l]=w.useState(0),c=!!(o&&a);return ea(s.scrollbarX,()=>{var u;const f=((u=s.scrollbarX)==null?void 0:u.offsetHeight)||0;s.onCornerHeightChange(f),l(f)}),ea(s.scrollbarY,()=>{var u;const f=((u=s.scrollbarY)==null?void 0:u.offsetWidth)||0;s.onCornerWidthChange(f),i(f)}),c?d.jsx(De.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 kd(e){return e?parseInt(e,10):0}function mT(e,t){const r=e/t;return isNaN(r)?0:r}function Rf(e){const t=mT(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function X6(e,t,r,n="ltr"){const s=Rf(r),o=s/2,i=t||o,a=s-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-a,f=r.content-r.viewport,u=n==="ltr"?[0,f]:[f*-1,0];return gT([l,c],u)(e)}function vw(e,t,r="ltr"){const n=Rf(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],c=Kp(e,l);return gT([0,i],[0,a])(c)}function gT(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 vT(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 Nf(e,t){const r=Pt(e),n=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(n.current),[]),w.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ea(e,t){const r=Pt(t);rr(()=>{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 yT=aT,J6=cT,eU=pT;const wT=w.forwardRef(({className:e,children:t,...r},n)=>d.jsxs(yT,{ref:n,className:we("relative overflow-hidden",e),...r,children:[d.jsx(J6,{className:"h-full w-full rounded-[inherit]",children:t}),d.jsx(xT,{}),d.jsx(eU,{})]}));wT.displayName=yT.displayName;const xT=w.forwardRef(({className:e,orientation:t="vertical",...r},n)=>d.jsx(Dv,{ref:n,orientation:t,className:we("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:d.jsx(hT,{className:"relative flex-1 rounded-full bg-border"})}));xT.displayName=Dv.displayName;const tU=async e=>{let t=1;e.page&&(t=e.page);let r=50;e.perPage&&(r=e.perPage);let n="domain!=null";return e.domain&&(n=`domain="${e.domain}"`),await Xt().collection("deployments").getList(t,r,{filter:n,sort:"-deployedAt",expand:"domain"})},rU=()=>{const e=po(),[t,r]=w.useState(),[n]=AP(),s=n.get("domain");return w.useEffect(()=>{(async()=>{const i={};s&&(i.domain=s);const a=await tU(i);r(a.items)})()},[s]),d.jsxs(wT,{className:"h-[80vh] overflow-hidden",children:[d.jsx("div",{className:"text-muted-foreground",children:"部署历史"}),t!=null&&t.length?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b sm:p-2 mt-5",children:[d.jsx("div",{className:"w-48",children:"域名"}),d.jsx("div",{className:"w-24",children:"状态"}),d.jsx("div",{className:"w-56",children:"阶段"}),d.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),d.jsx("div",{className:"grow",children:"操作"})]}),d.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),t==null?void 0:t.map(o=>{var i,a;return d.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b sm:p-2 hover:bg-muted/50 text-sm",children:[d.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}),d.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:o.phase==="deploy"&&o.phaseSuccess?d.jsx(e1,{size:16,className:"text-green-700"}):d.jsx(t1,{size:16,className:"text-red-700"})}),d.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:d.jsx(dk,{phase:o.phase,phaseSuccess:o.phaseSuccess})}),d.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:Nl(o.deployedAt)}),d.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:d.jsxs(lS,{children:[d.jsx(cS,{asChild:!0,children:d.jsx(Lt,{variant:"link",className:"p-0",children:"日志"})}),d.jsxs(Ug,{className:"sm:max-w-5xl",children:[d.jsx(dS,{children:d.jsxs(fS,{children:[(a=o.expand.domain)==null?void 0:a.domain,"-",o.id,"部署详情"]})}),d.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[o.log.check&&d.jsx(d.Fragment,{children:o.log.check.map(l=>d.jsxs("div",{className:"flex flex-col mt-2",children:[d.jsxs("div",{className:"flex",children:[d.jsxs("div",{children:["[",l.time,"]"]}),d.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&d.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),o.log.apply&&d.jsx(d.Fragment,{children:o.log.apply.map(l=>d.jsxs("div",{className:"flex flex-col mt-2",children:[d.jsxs("div",{className:"flex",children:[d.jsxs("div",{children:["[",l.time,"]"]}),d.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&d.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),o.log.deploy&&d.jsx(d.Fragment,{children:o.log.deploy.map(l=>d.jsxs("div",{className:"flex flex-col mt-2",children:[d.jsxs("div",{className:"flex",children:[d.jsxs("div",{children:["[",l.time,"]"]}),d.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&d.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))})]})]})]})})]},o.id)})]}):d.jsx(d.Fragment,{children:d.jsxs(nT,{className:"max-w-[40em] mx-auto mt-20",children:[d.jsx(sT,{children:"暂无数据"}),d.jsxs(oT,{children:[d.jsxs("div",{className:"flex items-center mt-5",children:[d.jsx("div",{children:d.jsx(BP,{className:"text-yellow-400",size:36})}),d.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),d.jsx("div",{className:"mt-2 flex justify-end",children:d.jsx(Lt,{onClick:()=>{e("/")},children:"添加域名"})})]})]})})]})},nU=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",sU=qe.object({username:qe.string().email({message:"请输入正确的邮箱地址"}),password:qe.string().min(10,{message:"密码至少10个字符"})}),oU=()=>{const e=hc({resolver:pc(sU),defaultValues:{username:"",password:""}}),t=async n=>{try{await Xt().admins.authWithPassword(n.username,n.password),r("/")}catch(s){const o=nU(s);e.setError("username",{message:o}),e.setError("password",{message:o})}},r=po();return d.jsxs("div",{className:"max-w-[35em] border mx-auto mt-32 p-10 rounded-md shadow-md",children:[d.jsx("div",{className:"flex justify-center mb-10",children:d.jsx("img",{src:"/vite.svg",className:"w-16"})}),d.jsx(gc,{...e,children:d.jsxs("form",{onSubmit:e.handleSubmit(t),className:"space-y-8",children:[d.jsx(ft,{control:e.control,name:"username",render:({field:n})=>d.jsxs(at,{children:[d.jsx(lt,{children:"用户名"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"email",...n})}),d.jsx(nt,{})]})}),d.jsx(ft,{control:e.control,name:"password",render:({field:n})=>d.jsxs(at,{children:[d.jsx(lt,{children:"密码"}),d.jsx(ct,{children:d.jsx(wt,{placeholder:"shadcn",...n,type:"password"})}),d.jsx(nt,{})]})}),d.jsx("div",{className:"flex justify-end",children:d.jsx(Lt,{type:"submit",children:"登录"})})]})})]})},iU=()=>Xt().authStore.isValid&&Xt().authStore.isAdmin?d.jsx(K_,{to:"/"}):d.jsx("div",{className:"container",children:d.jsx(q_,{})}),aU=wP([{path:"/",element:d.jsx(K4,{}),children:[{path:"/",element:d.jsx(b5,{})},{path:"/edit",element:d.jsx(z6,{})},{path:"/access",element:d.jsx(U6,{})},{path:"/history",element:d.jsx(rU,{})}]},{path:"/login",element:d.jsx(iU,{}),children:[{path:"/login",element:d.jsx(oU,{})}]},{path:"/about",element:d.jsx("div",{children:"About"})}]);Th.createRoot(document.getElementById("root")).render(d.jsx(Ze.StrictMode,{children:d.jsx(RP,{router:aU})}))});export default lU(); diff --git a/ui/dist/assets/index-FyOtRun2.js b/ui/dist/assets/index-FyOtRun2.js deleted file mode 100644 index afb24dd3..00000000 --- a/ui/dist/assets/index-FyOtRun2.js +++ /dev/null @@ -1,228 +0,0 @@ -var _T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var n3=_T((p3,gu)=>{function hw(e,t){for(var n=0;nr[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function pw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mw={exports:{}},gd={},gw={exports:{}},Pe={};/** - * @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 Fl=Symbol.for("react.element"),bT=Symbol.for("react.portal"),CT=Symbol.for("react.fragment"),kT=Symbol.for("react.strict_mode"),ET=Symbol.for("react.profiler"),TT=Symbol.for("react.provider"),RT=Symbol.for("react.context"),NT=Symbol.for("react.forward_ref"),PT=Symbol.for("react.suspense"),jT=Symbol.for("react.memo"),DT=Symbol.for("react.lazy"),Ov=Symbol.iterator;function MT(e){return e===null||typeof e!="object"?null:(e=Ov&&e[Ov]||e["@@iterator"],typeof e=="function"?e:null)}var vw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yw=Object.assign,xw={};function Gi(e,t,n){this.props=e,this.context=t,this.refs=xw,this.updater=n||vw}Gi.prototype.isReactComponent={};Gi.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")};Gi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ww(){}ww.prototype=Gi.prototype;function em(e,t,n){this.props=e,this.context=t,this.refs=xw,this.updater=n||vw}var tm=em.prototype=new ww;tm.constructor=em;yw(tm,Gi.prototype);tm.isPureReactComponent=!0;var Av=Array.isArray,Sw=Object.prototype.hasOwnProperty,nm={current:null},_w={key:!0,ref:!0,__self:!0,__source:!0};function bw(e,t,n){var r,o={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)Sw.call(t,r)&&!_w.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1>>1,me=F[le];if(0>>1;leo(gt,X))Ueo(ce,gt)?(F[le]=ce,F[Ue]=X,le=Ue):(F[le]=gt,F[je]=X,le=je);else if(Ueo(ce,X))F[le]=ce,F[Ue]=X,le=Ue;else break e}}return M}function o(F,M){var X=F.sortIndex-M.sortIndex;return X!==0?X:F.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.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,x=!1,g=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(F){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=F)r(u),M.sortIndex=M.expirationTime,t(l,M);else break;M=n(u)}}function b(F){if(y=!1,w(F),!g)if(n(l)!==null)g=!0,ne(C);else{var M=n(u);M!==null&&W(b,M.startTime-F)}}function C(F,M){g=!1,y&&(y=!1,v(N),N=-1),x=!0;var X=p;try{for(w(M),f=n(l);f!==null&&(!(f.expirationTime>M)||F&&!B());){var le=f.callback;if(typeof le=="function"){f.callback=null,p=f.priorityLevel;var me=le(f.expirationTime<=M);M=e.unstable_now(),typeof me=="function"?f.callback=me:f===n(l)&&r(l),w(M)}else r(l);f=n(l)}if(f!==null)var rt=!0;else{var je=n(u);je!==null&&W(b,je.startTime-M),rt=!1}return rt}finally{f=null,p=X,x=!1}}var _=!1,R=null,N=-1,D=5,O=-1;function B(){return!(e.unstable_now()-OF||125le?(F.sortIndex=X,t(u,F),n(l)===null&&F===n(u)&&(y?(v(N),N=-1):y=!0,W(b,X-le))):(F.sortIndex=me,t(l,F),g||x||(g=!0,ne(C))),F},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(F){var M=p;return function(){var X=p;p=M;try{return F.apply(this,arguments)}finally{p=X}}}})(Nw);Rw.exports=Nw;var YT=Rw.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 HT=h,On=YT;function $(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_h=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]*$/,Lv={},Fv={};function GT(e){return _h.call(Fv,e)?!0:_h.call(Lv,e)?!1:BT.test(e)?Fv[e]=!0:(Lv[e]=!0,!1)}function KT(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ZT(e,t,n,r){if(t===null||typeof t>"u"||KT(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 dn(e,t,n,r,o,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var Gt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Gt[e]=new dn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Gt[t]=new dn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Gt[e]=new dn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Gt[e]=new dn(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){Gt[e]=new dn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Gt[e]=new dn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Gt[e]=new dn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Gt[e]=new dn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Gt[e]=new dn(e,5,!1,e.toLowerCase(),null,!1,!1)});var om=/[\-:]([a-z])/g;function sm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(om,sm);Gt[t]=new dn(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(om,sm);Gt[t]=new dn(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(om,sm);Gt[t]=new dn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Gt[e]=new dn(e,1,!1,e.toLowerCase(),null,!1,!1)});Gt.xlinkHref=new dn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Gt[e]=new dn(e,1,!1,e.toLowerCase(),null,!0,!0)});function im(e,t,n,r){var o=Gt.hasOwnProperty(t)?Gt[t]:null;(o!==null?o.type!==0:r||!(2a||o[i]!==s[a]){var l=` -`+o[i].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=i&&0<=a);break}}}finally{Tf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ka(e):""}function qT(e){switch(e.tag){case 5:return ka(e.type);case 16:return ka("Lazy");case 13:return ka("Suspense");case 19:return ka("SuspenseList");case 0:case 2:case 15:return e=Rf(e.type,!1),e;case 11:return e=Rf(e.type.render,!1),e;case 1:return e=Rf(e.type,!0),e;default:return""}}function Eh(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 si:return"Fragment";case oi:return"Portal";case bh:return"Profiler";case am:return"StrictMode";case Ch:return"Suspense";case kh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Dw:return(e.displayName||"Context")+".Consumer";case jw:return(e._context.displayName||"Context")+".Provider";case lm: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:Eh(e.type)||"Memo";case Ro:t=e._payload,e=e._init;try{return Eh(e(t))}catch{}}return null}function XT(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 Eh(t);case 8:return t===am?"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 Go(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ow(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function QT(e){var t=Ow(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function wc(e){e._valueTracker||(e._valueTracker=QT(e))}function Aw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ow(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function vu(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 Th(e,t){var n=t.checked;return Ct({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function $v(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Go(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Iw(e,t){t=t.checked,t!=null&&im(e,"checked",t,!1)}function Rh(e,t){Iw(e,t);var n=Go(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Nh(e,t.type,n):t.hasOwnProperty("defaultValue")&&Nh(e,t.type,Go(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Vv(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Nh(e,t,n){(t!=="number"||vu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ea=Array.isArray;function wi(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Sc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Za(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Oa={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},JT=["Webkit","ms","Moz","O"];Object.keys(Oa).forEach(function(e){JT.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Oa[t]=Oa[e]})});function $w(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Oa.hasOwnProperty(e)&&Oa[e]?(""+t).trim():t+"px"}function Vw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=$w(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var eR=Ct({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 Dh(e,t){if(t){if(eR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error($(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error($(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error($(61))}if(t.style!=null&&typeof t.style!="object")throw Error($(62))}}function Mh(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 Oh=null;function um(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ah=null,Si=null,_i=null;function Yv(e){if(e=Vl(e)){if(typeof Ah!="function")throw Error($(280));var t=e.stateNode;t&&(t=Sd(t),Ah(e.stateNode,e.type,t))}}function zw(e){Si?_i?_i.push(e):_i=[e]:Si=e}function Ww(){if(Si){var e=Si,t=_i;if(_i=Si=null,Yv(e),t)for(e=0;e>>=0,e===0?32:31-(dR(e)/fR|0)|0}var _c=64,bc=4194304;function Ta(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 Su(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~o;a!==0?r=Ta(a):(s&=i,s!==0&&(r=Ta(s)))}else i=n&~o,i!==0?r=Ta(i):s!==0&&(r=Ta(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ul(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-sr(t),e[t]=n}function gR(e,t){var n=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 r=e.eventTimes;for(e=e.expirationTimes;0=Ia),Jv=" ",ey=!1;function c0(e,t){switch(e){case"keyup":return YR.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function u0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ii=!1;function BR(e,t){switch(e){case"compositionend":return u0(t);case"keypress":return t.which!==32?null:(ey=!0,Jv);case"textInput":return e=t.data,e===Jv&&ey?null:e;default:return null}}function GR(e,t){if(ii)return e==="compositionend"||!ym&&c0(e,t)?(e=a0(),Xc=mm=Mo=null,ii=!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:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=oy(n)}}function p0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?p0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function m0(){for(var e=window,t=vu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=vu(e.document)}return t}function xm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function nN(e){var t=m0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&p0(n.ownerDocument.documentElement,n)){if(r!==null&&xm(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=sy(n,s);var i=sy(n,r);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ai=null,Vh=null,Fa=null,zh=!1;function iy(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zh||ai==null||ai!==vu(r)||(r=ai,"selectionStart"in r&&xm(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fa&&tl(Fa,r)||(Fa=r,r=Cu(Vh,"onSelect"),0ui||(e.current=Kh[ui],Kh[ui]=null,ui--)}function it(e,t){ui++,Kh[ui]=e.current,e.current=t}var Ko={},en=rs(Ko),xn=rs(!1),Ts=Ko;function Ai(e,t){var n=e.type.contextTypes;if(!n)return Ko;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function wn(e){return e=e.childContextTypes,e!=null}function Eu(){ut(xn),ut(en)}function hy(e,t,n){if(en.current!==Ko)throw Error($(168));it(en,t),it(xn,n)}function C0(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error($(108,XT(e)||"Unknown",o));return Ct({},n,r)}function Tu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ko,Ts=en.current,it(en,e),it(xn,xn.current),!0}function py(e,t,n){var r=e.stateNode;if(!r)throw Error($(169));n?(e=C0(e,t,Ts),r.__reactInternalMemoizedMergedChildContext=e,ut(xn),ut(en),it(en,e)):ut(xn),it(xn,n)}var Hr=null,_d=!1,zf=!1;function k0(e){Hr===null?Hr=[e]:Hr.push(e)}function pN(e){_d=!0,k0(e)}function os(){if(!zf&&Hr!==null){zf=!0;var e=0,t=Je;try{var n=Hr;for(Je=1;e>=i,o-=i,Br=1<<32-sr(t)+o|n<N?(D=R,R=null):D=R.sibling;var O=p(v,R,w[N],b);if(O===null){R===null&&(R=D);break}e&&R&&O.alternate===null&&t(v,R),m=s(O,m,N),_===null?C=O:_.sibling=O,_=O,R=D}if(N===w.length)return n(v,R),mt&&ds(v,N),C;if(R===null){for(;NN?(D=R,R=null):D=R.sibling;var B=p(v,R,O.value,b);if(B===null){R===null&&(R=D);break}e&&R&&B.alternate===null&&t(v,R),m=s(B,m,N),_===null?C=B:_.sibling=B,_=B,R=D}if(O.done)return n(v,R),mt&&ds(v,N),C;if(R===null){for(;!O.done;N++,O=w.next())O=f(v,O.value,b),O!==null&&(m=s(O,m,N),_===null?C=O:_.sibling=O,_=O);return mt&&ds(v,N),C}for(R=r(v,R);!O.done;N++,O=w.next())O=x(R,v,N,O.value,b),O!==null&&(e&&O.alternate!==null&&R.delete(O.key===null?N:O.key),m=s(O,m,N),_===null?C=O:_.sibling=O,_=O);return e&&R.forEach(function(A){return t(v,A)}),mt&&ds(v,N),C}function S(v,m,w,b){if(typeof w=="object"&&w!==null&&w.type===si&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case xc:e:{for(var C=w.key,_=m;_!==null;){if(_.key===C){if(C=w.type,C===si){if(_.tag===7){n(v,_.sibling),m=o(_,w.props.children),m.return=v,v=m;break e}}else if(_.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Ro&&vy(C)===_.type){n(v,_.sibling),m=o(_,w.props),m.ref=pa(v,_,w),m.return=v,v=m;break e}n(v,_);break}else t(v,_);_=_.sibling}w.type===si?(m=bs(w.props.children,v.mode,b,w.key),m.return=v,v=m):(b=su(w.type,w.key,w.props,null,v.mode,b),b.ref=pa(v,m,w),b.return=v,v=b)}return i(v);case oi:e:{for(_=w.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===w.containerInfo&&m.stateNode.implementation===w.implementation){n(v,m.sibling),m=o(m,w.children||[]),m.return=v,v=m;break e}else{n(v,m);break}else t(v,m);m=m.sibling}m=qf(w,v.mode,b),m.return=v,v=m}return i(v);case Ro:return _=w._init,S(v,m,_(w._payload),b)}if(Ea(w))return g(v,m,w,b);if(ca(w))return y(v,m,w,b);Pc(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,m!==null&&m.tag===6?(n(v,m.sibling),m=o(m,w),m.return=v,v=m):(n(v,m),m=Zf(w,v.mode,b),m.return=v,v=m),i(v)):n(v,m)}return S}var Li=N0(!0),P0=N0(!1),Pu=rs(null),ju=null,hi=null,bm=null;function Cm(){bm=hi=ju=null}function km(e){var t=Pu.current;ut(Pu),e._currentValue=t}function Xh(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ci(e,t){ju=e,bm=hi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(yn=!0),e.firstContext=null)}function Yn(e){var t=e._currentValue;if(bm!==e)if(e={context:e,memoizedValue:t,next:null},hi===null){if(ju===null)throw Error($(308));hi=e,ju.dependencies={lanes:0,firstContext:e}}else hi=hi.next=e;return t}var ms=null;function Em(e){ms===null?ms=[e]:ms.push(e)}function j0(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Em(t)):(n.next=o.next,o.next=n),t.interleaved=n,no(e,r)}function no(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var No=!1;function Tm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function D0(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 qr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function zo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ze&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,no(e,n)}return o=r.interleaved,o===null?(t.next=t,Em(r)):(t.next=o.next,o.next=t),r.interleaved=t,no(e,n)}function Jc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,fm(e,n)}}function yy(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?o=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?o=s=t:s=s.next=t}else o=s=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Du(e,t,n,r){var o=e.updateQueue;No=!1;var s=o.firstBaseUpdate,i=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,i===null?s=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(s!==null){var f=o.baseState;i=0,d=u=l=null,a=s;do{var p=a.lane,x=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:x,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,y=a;switch(p=t,x=n,y.tag){case 1:if(g=y.payload,typeof g=="function"){f=g.call(x,f,p);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,p=typeof g=="function"?g.call(x,f,p):g,p==null)break e;f=Ct({},f,p);break e;case 2:No=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[a]:p.push(a))}else x={eventTime:x,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=x,l=f):d=d.next=x,i|=p;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;p=a,a=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);if(d===null&&(l=f),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do i|=o.lane,o=o.next;while(o!==t)}else s===null&&(o.shared.lanes=0);Ps|=i,e.lanes=i,e.memoizedState=f}}function xy(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Yf.transition;Yf.transition={};try{e(!1),t()}finally{Je=n,Yf.transition=r}}function Z0(){return Hn().memoizedState}function yN(e,t,n){var r=Yo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},q0(e))X0(t,n);else if(n=j0(e,t,n,r),n!==null){var o=ln();ir(n,e,r,o),Q0(n,t,r)}}function xN(e,t,n){var r=Yo(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(q0(e))X0(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,a=s(i,n);if(o.hasEagerState=!0,o.eagerState=a,lr(a,i)){var l=t.interleaved;l===null?(o.next=o,Em(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=j0(e,t,o,r),n!==null&&(o=ln(),ir(n,e,r,o),Q0(n,t,r))}}function q0(e){var t=e.alternate;return e===bt||t!==null&&t===bt}function X0(e,t){Ua=Ou=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Q0(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,fm(e,n)}}var Au={readContext:Yn,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useInsertionEffect:qt,useLayoutEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useMutableSource:qt,useSyncExternalStore:qt,useId:qt,unstable_isNewReconciler:!1},wN={readContext:Yn,useCallback:function(e,t){return yr().memoizedState=[e,t===void 0?null:t],e},useContext:Yn,useEffect:Sy,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,tu(4194308,4,Y0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return tu(4194308,4,e,t)},useInsertionEffect:function(e,t){return tu(4,2,e,t)},useMemo:function(e,t){var n=yr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=yr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=yN.bind(null,bt,e),[r.memoizedState,e]},useRef:function(e){var t=yr();return e={current:e},t.memoizedState=e},useState:wy,useDebugValue:Am,useDeferredValue:function(e){return yr().memoizedState=e},useTransition:function(){var e=wy(!1),t=e[0];return e=vN.bind(null,e[1]),yr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=bt,o=yr();if(mt){if(n===void 0)throw Error($(407));n=n()}else{if(n=t(),$t===null)throw Error($(349));Ns&30||I0(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,Sy(F0.bind(null,r,s,e),[e]),r.flags|=2048,cl(9,L0.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=yr(),t=$t.identifierPrefix;if(mt){var n=Gr,r=Br;n=(r&~(1<<32-sr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=al++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[xr]=t,e[ol]=r,lS(e,t,!1,!1),t.stateNode=e;e:{switch(i=Mh(n,r),n){case"dialog":lt("cancel",e),lt("close",e),o=r;break;case"iframe":case"object":case"embed":lt("load",e),o=r;break;case"video":case"audio":for(o=0;o$i&&(t.flags|=128,r=!0,ma(s,!1),t.lanes=4194304)}else{if(!r)if(e=Mu(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ma(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!mt)return Xt(t),null}else 2*Nt()-s.renderingStartTime>$i&&n!==1073741824&&(t.flags|=128,r=!0,ma(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Nt(),t.sibling=null,n=St.current,it(St,r?n&1|2:n&1),t):(Xt(t),null);case 22:case 23:return Vm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?En&1073741824&&(Xt(t),t.subtreeFlags&6&&(t.flags|=8192)):Xt(t),null;case 24:return null;case 25:return null}throw Error($(156,t.tag))}function RN(e,t){switch(Sm(t),t.tag){case 1:return wn(t.type)&&Eu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fi(),ut(xn),ut(en),Pm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Nm(t),null;case 13:if(ut(St),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error($(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ut(St),null;case 4:return Fi(),null;case 10:return km(t.type._context),null;case 22:case 23:return Vm(),null;case 24:return null;default:return null}}var Dc=!1,Qt=!1,NN=typeof WeakSet=="function"?WeakSet:Set,ae=null;function pi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Et(e,t,r)}else n.current=null}function ip(e,t,n){try{n()}catch(r){Et(e,t,r)}}var Dy=!1;function PN(e,t){if(Wh=_u,e=m0(),xm(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,a=-1,l=-1,u=0,d=0,f=e,p=null;t:for(;;){for(var x;f!==n||o!==0&&f.nodeType!==3||(a=i+o),f!==s||r!==0&&f.nodeType!==3||(l=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(x=f.firstChild)!==null;)p=f,f=x;for(;;){if(f===e)break t;if(p===n&&++u===o&&(a=i),p===s&&++d===r&&(l=i),(x=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=x}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yh={focusedElem:e,selectionRange:n},_u=!1,ae=t;ae!==null;)if(t=ae,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ae=e;else for(;ae!==null;){t=ae;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,S=g.memoizedState,v=t.stateNode,m=v.getSnapshotBeforeUpdate(t.elementType===t.type?y:Qn(t.type,y),S);v.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error($(163))}}catch(b){Et(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,ae=e;break}ae=t.return}return g=Dy,Dy=!1,g}function $a(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&ip(t,n,s)}o=o.next}while(o!==r)}}function kd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ap(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function dS(e){var t=e.alternate;t!==null&&(e.alternate=null,dS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xr],delete t[ol],delete t[Gh],delete t[fN],delete t[hN])),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 fS(e){return e.tag===5||e.tag===3||e.tag===4}function My(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fS(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 lp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ku));else if(r!==4&&(e=e.child,e!==null))for(lp(e,t,n),e=e.sibling;e!==null;)lp(e,t,n),e=e.sibling}function cp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(cp(e,t,n),e=e.sibling;e!==null;)cp(e,t,n),e=e.sibling}var Yt=null,Jn=!1;function bo(e,t,n){for(n=n.child;n!==null;)hS(e,t,n),n=n.sibling}function hS(e,t,n){if(kr&&typeof kr.onCommitFiberUnmount=="function")try{kr.onCommitFiberUnmount(vd,n)}catch{}switch(n.tag){case 5:Qt||pi(n,t);case 6:var r=Yt,o=Jn;Yt=null,bo(e,t,n),Yt=r,Jn=o,Yt!==null&&(Jn?(e=Yt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Yt.removeChild(n.stateNode));break;case 18:Yt!==null&&(Jn?(e=Yt,n=n.stateNode,e.nodeType===8?Vf(e.parentNode,n):e.nodeType===1&&Vf(e,n),Ja(e)):Vf(Yt,n.stateNode));break;case 4:r=Yt,o=Jn,Yt=n.stateNode.containerInfo,Jn=!0,bo(e,t,n),Yt=r,Jn=o;break;case 0:case 11:case 14:case 15:if(!Qt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&ip(n,t,i),o=o.next}while(o!==r)}bo(e,t,n);break;case 1:if(!Qt&&(pi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Et(n,t,a)}bo(e,t,n);break;case 21:bo(e,t,n);break;case 22:n.mode&1?(Qt=(r=Qt)||n.memoizedState!==null,bo(e,t,n),Qt=r):bo(e,t,n);break;default:bo(e,t,n)}}function Oy(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new NN),t.forEach(function(r){var o=UN.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Xn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=i),r&=~s}if(r=o,r=Nt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*DN(r/1960))-r,10e?16:e,Oo===null)var r=!1;else{if(e=Oo,Oo=null,Fu=0,ze&6)throw Error($(331));var o=ze;for(ze|=4,ae=e.current;ae!==null;){var s=ae,i=s.child;if(ae.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lNt()-Um?_s(e,0):Fm|=n),Sn(e,t)}function SS(e,t){t===0&&(e.mode&1?(t=bc,bc<<=1,!(bc&130023424)&&(bc=4194304)):t=1);var n=ln();e=no(e,t),e!==null&&(Ul(e,t,n),Sn(e,n))}function FN(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),SS(e,n)}function UN(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error($(314))}r!==null&&r.delete(t),SS(e,n)}var _S;_S=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||xn.current)yn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return yn=!1,EN(e,t,n);yn=!!(e.flags&131072)}else yn=!1,mt&&t.flags&1048576&&E0(t,Nu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;nu(e,t),e=t.pendingProps;var o=Ai(t,en.current);Ci(t,n),o=Dm(null,t,r,e,o,n);var s=Mm();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,wn(r)?(s=!0,Tu(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Tm(t),o.updater=Cd,t.stateNode=o,o._reactInternals=t,Jh(t,r,e,n),t=np(null,t,r,!0,s,n)):(t.tag=0,mt&&s&&wm(t),sn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(nu(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=VN(r),e=Qn(r,e),o){case 0:t=tp(null,t,r,e,n);break e;case 1:t=Ny(null,t,r,e,n);break e;case 11:t=Ty(null,t,r,e,n);break e;case 14:t=Ry(null,t,r,Qn(r.type,e),n);break e}throw Error($(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Qn(r,o),tp(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Qn(r,o),Ny(e,t,r,o,n);case 3:e:{if(sS(t),e===null)throw Error($(387));r=t.pendingProps,s=t.memoizedState,o=s.element,D0(e,t),Du(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=Ui(Error($(423)),t),t=Py(e,t,r,n,o);break e}else if(r!==o){o=Ui(Error($(424)),t),t=Py(e,t,r,n,o);break e}else for(Nn=Vo(t.stateNode.containerInfo.firstChild),Pn=t,mt=!0,tr=null,n=P0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ii(),r===o){t=ro(e,t,n);break e}sn(e,t,r,n)}t=t.child}return t;case 5:return M0(t),e===null&&qh(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,Hh(r,o)?i=null:s!==null&&Hh(r,s)&&(t.flags|=32),oS(e,t),sn(e,t,i,n),t.child;case 6:return e===null&&qh(t),null;case 13:return iS(e,t,n);case 4:return Rm(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Li(t,null,r,n):sn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Qn(r,o),Ty(e,t,r,o,n);case 7:return sn(e,t,t.pendingProps,n),t.child;case 8:return sn(e,t,t.pendingProps.children,n),t.child;case 12:return sn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value,it(Pu,r._currentValue),r._currentValue=i,s!==null)if(lr(s.value,i)){if(s.children===o.children&&!xn.current){t=ro(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){i=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=qr(-1,n&-n),l.tag=2;var u=s.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}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Xh(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error($(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Xh(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}sn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Ci(t,n),o=Yn(o),r=r(o),t.flags|=1,sn(e,t,r,n),t.child;case 14:return r=t.type,o=Qn(r,t.pendingProps),o=Qn(r.type,o),Ry(e,t,r,o,n);case 15:return nS(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Qn(r,o),nu(e,t),t.tag=1,wn(r)?(e=!0,Tu(t)):e=!1,Ci(t,n),J0(t,r,o),Jh(t,r,o,n),np(null,t,r,!0,e,n);case 19:return aS(e,t,n);case 22:return rS(e,t,n)}throw Error($(156,t.tag))};function bS(e,t){return qw(e,t)}function $N(e,t,n,r){this.tag=e,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vn(e,t,n,r){return new $N(e,t,n,r)}function Wm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function VN(e){if(typeof e=="function")return Wm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===lm)return 11;if(e===cm)return 14}return 2}function Ho(e,t){var n=e.alternate;return n===null?(n=Vn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function su(e,t,n,r,o,s){var i=2;if(r=e,typeof e=="function")Wm(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case si:return bs(n.children,o,s,t);case am:i=8,o|=8;break;case bh:return e=Vn(12,n,t,o|2),e.elementType=bh,e.lanes=s,e;case Ch:return e=Vn(13,n,t,o),e.elementType=Ch,e.lanes=s,e;case kh:return e=Vn(19,n,t,o),e.elementType=kh,e.lanes=s,e;case Mw:return Td(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case jw:i=10;break e;case Dw:i=9;break e;case lm:i=11;break e;case cm:i=14;break e;case Ro:i=16,r=null;break e}throw Error($(130,e==null?e:typeof e,""))}return t=Vn(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function bs(e,t,n,r){return e=Vn(7,e,r,t),e.lanes=n,e}function Td(e,t,n,r){return e=Vn(22,e,r,t),e.elementType=Mw,e.lanes=n,e.stateNode={isHidden:!1},e}function Zf(e,t,n){return e=Vn(6,e,null,t),e.lanes=n,e}function qf(e,t,n){return t=Vn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function zN(e,t,n,r,o){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=Pf(0),this.expirationTimes=Pf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pf(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ym(e,t,n,r,o,s,i,a,l){return e=new zN(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Vn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Tm(s),e}function WN(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(TS)}catch(e){console.error(e)}}TS(),Tw.exports=An;var fo=Tw.exports;const RS=pw(fo),KN=hw({__proto__:null,default:RS},[fo]);var zy=fo;Sh.createRoot=zy.createRoot,Sh.hydrateRoot=zy.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 wt(){return wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Ds(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function qN(){return Math.random().toString(36).substr(2,8)}function Yy(e,t){return{usr:e.state,key:e.key,idx:t}}function dl(e,t,n,r){return n===void 0&&(n=null),wt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ho(t):t,{state:n,key:t&&t.key||r||qN()})}function Ms(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ho(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function XN(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:s=!1}=r,i=o.history,a=jt.Pop,l=null,u=d();u==null&&(u=0,i.replaceState(wt({},i.state,{idx:u}),""));function d(){return(i.state||{idx:null}).idx}function f(){a=jt.Pop;let S=d(),v=S==null?null:S-u;u=S,l&&l({action:a,location:y.location,delta:v})}function p(S,v){a=jt.Push;let m=dl(y.location,S,v);n&&n(m,S),u=d()+1;let w=Yy(m,u),b=y.createHref(m);try{i.pushState(w,"",b)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(b)}s&&l&&l({action:a,location:y.location,delta:1})}function x(S,v){a=jt.Replace;let m=dl(y.location,S,v);n&&n(m,S),u=d();let w=Yy(m,u),b=y.createHref(m);i.replaceState(w,"",b),s&&l&&l({action:a,location:y.location,delta:0})}function g(S){let v=o.location.origin!=="null"?o.location.origin:o.location.href,m=typeof S=="string"?S:Ms(S);return m=m.replace(/ $/,"%20"),Ne(v,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,v)}let y={get action(){return a},get location(){return e(o,i)},listen(S){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(Wy,f),l=S,()=>{o.removeEventListener(Wy,f),l=null}},createHref(S){return t(o,S)},createURL:g,encodeLocation(S){let v=g(S);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:x,go(S){return i.go(S)}};return y}var st;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(st||(st={}));const QN=new Set(["lazy","caseSensitive","path","id","index","children"]);function JN(e){return e.index===!0}function fl(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,s)=>{let i=[...n,String(s)],a=typeof o.id=="string"?o.id:i.join("-");if(Ne(o.index!==!0||!o.children,"Cannot specify children on an index route"),Ne(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),JN(o)){let l=wt({},o,t(o),{id:a});return r[a]=l,l}else{let l=wt({},o,t(o),{id:a,children:void 0});return r[a]=l,o.children&&(l.children=fl(o.children,t,i,r)),l}})}function hs(e,t,n){return n===void 0&&(n="/"),iu(e,t,n,!1)}function iu(e,t,n,r){let o=typeof t=="string"?ho(t):t,s=qi(o.pathname||"/",n);if(s==null)return null;let i=NS(e);tP(i);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:i,route:s};l.relativePath.startsWith("/")&&(Ne(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Xr([r,l.relativePath]),d=n.concat(l);s.children&&s.children.length>0&&(Ne(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),NS(s.children,t,d,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:lP(u,s.index),routesMeta:d})};return e.forEach((s,i)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))o(s,i);else for(let l of PS(s.path))o(s,i,l)}),t}function PS(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let i=PS(r.join("/")),a=[];return a.push(...i.map(l=>l===""?s:[s,l].join("/"))),o&&a.push(...i),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function tP(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:cP(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const nP=/^:[\w-]+$/,rP=3,oP=2,sP=1,iP=10,aP=-2,Hy=e=>e==="*";function lP(e,t){let n=e.split("/"),r=n.length;return n.some(Hy)&&(r+=aP),t&&(r+=oP),n.filter(o=>!Hy(o)).reduce((o,s)=>o+(nP.test(s)?rP:s===""?sP:iP),r)}function cP(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function uP(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},s="/",i=[];for(let a=0;a{let{paramName:p,isOptional:x}=d;if(p==="*"){let y=a[f]||"";i=s.slice(0,s.length-y.length).replace(/(.)\/+$/,"$1")}const g=a[f];return x&&!g?u[p]=void 0:u[p]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:i,pattern:e}}function dP(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ds(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 r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function fP(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ds(!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 qi(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function hP(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?ho(e):e;return{pathname:n?n.startsWith("/")?n:pP(n,t):t,search:gP(r),hash:vP(o)}}function pP(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Xf(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function jS(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Dd(e,t){let n=jS(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Md(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=ho(e):(o=wt({},e),Ne(!o.pathname||!o.pathname.includes("?"),Xf("?","pathname","search",o)),Ne(!o.pathname||!o.pathname.includes("#"),Xf("#","pathname","hash",o)),Ne(!o.search||!o.search.includes("#"),Xf("#","search","hash",o)));let s=e===""||o.pathname==="",i=s?"/":o.pathname,a;if(i==null)a=n;else{let f=t.length-1;if(!r&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),f-=1;o.pathname=p.join("/")}a=f>=0?t[f]:"/"}let l=hP(o,a),u=i&&i!=="/"&&i.endsWith("/"),d=(s||i===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const Xr=e=>e.join("/").replace(/\/\/+/g,"/"),mP=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),gP=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,vP=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Km{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Od(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const DS=["post","put","patch","delete"],yP=new Set(DS),xP=["get",...DS],wP=new Set(xP),SP=new Set([301,302,303,307,308]),_P=new Set([307,308]),Qf={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},bP={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},va={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Zm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,CP=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),MS="remix-router-transitions";function kP(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Ne(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let E=e.detectErrorBoundary;o=T=>({hasErrorBoundary:E(T)})}else o=CP;let s={},i=fl(e.routes,o,void 0,s),a,l=e.basename||"/",u=e.unstable_dataStrategy||PP,d=e.unstable_patchRoutesOnMiss,f=wt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),p=null,x=new Set,g=null,y=null,S=null,v=e.hydrationData!=null,m=hs(i,e.history.location,l),w=null;if(m==null&&!d){let E=on(404,{pathname:e.history.location.pathname}),{matches:T,route:j}=nx(i);m=T,w={[j.id]:E}}m&&d&&!e.hydrationData&&Cf(m,i,e.history.location.pathname).active&&(m=null);let b;if(!m)b=!1,m=[];else if(m.some(E=>E.route.lazy))b=!1;else if(!m.some(E=>E.route.loader))b=!0;else if(f.v7_partialHydration){let E=e.hydrationData?e.hydrationData.loaderData:null,T=e.hydrationData?e.hydrationData.errors:null,j=U=>U.route.loader?typeof U.route.loader=="function"&&U.route.loader.hydrate===!0?!1:E&&E[U.route.id]!==void 0||T&&T[U.route.id]!==void 0:!0;if(T){let U=m.findIndex(re=>T[re.route.id]!==void 0);b=m.slice(0,U+1).every(j)}else b=m.every(j)}else b=e.hydrationData!=null;let C,_={historyAction:e.history.action,location:e.history.location,matches:m,initialized:b,navigation:Qf,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||w,fetchers:new Map,blockers:new Map},R=jt.Pop,N=!1,D,O=!1,B=new Map,A=null,H=!1,L=!1,K=[],ne=[],W=new Map,F=0,M=-1,X=new Map,le=new Set,me=new Map,rt=new Map,je=new Set,gt=new Map,Ue=new Map,ce=new Map,De=!1;function He(){if(p=e.history.listen(E=>{let{action:T,location:j,delta:U}=E;if(De){De=!1;return}Ds(Ue.size===0||U!=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 re=Pv({currentLocation:_.location,nextLocation:j,historyAction:T});if(re&&U!=null){De=!0,e.history.go(U*-1),fc(re,{state:"blocked",location:j,proceed(){fc(re,{state:"proceeding",proceed:void 0,reset:void 0,location:j}),e.history.go(U)},reset(){let de=new Map(_.blockers);de.set(re,va),Se({blockers:de})}});return}return pn(T,j)}),n){WP(t,B);let E=()=>YP(t,B);t.addEventListener("pagehide",E),A=()=>t.removeEventListener("pagehide",E)}return _.initialized||pn(jt.Pop,_.location,{initialHydration:!0}),C}function $e(){p&&p(),A&&A(),x.clear(),D&&D.abort(),_.fetchers.forEach((E,T)=>So(T)),_.blockers.forEach((E,T)=>Nv(T))}function Ve(E){return x.add(E),()=>x.delete(E)}function Se(E,T){T===void 0&&(T={}),_=wt({},_,E);let j=[],U=[];f.v7_fetcherPersist&&_.fetchers.forEach((re,de)=>{re.state==="idle"&&(je.has(de)?U.push(de):j.push(de))}),[...x].forEach(re=>re(_,{deletedFetchers:U,unstable_viewTransitionOpts:T.viewTransitionOpts,unstable_flushSync:T.flushSync===!0})),f.v7_fetcherPersist&&(j.forEach(re=>_.fetchers.delete(re)),U.forEach(re=>So(re)))}function vt(E,T,j){var U,re;let{flushSync:de}=j===void 0?{}:j,xe=_.actionData!=null&&_.navigation.formMethod!=null&&er(_.navigation.formMethod)&&_.navigation.state==="loading"&&((U=E.state)==null?void 0:U._isRedirect)!==!0,q;T.actionData?Object.keys(T.actionData).length>0?q=T.actionData:q=null:xe?q=_.actionData:q=null;let Ce=T.loaderData?ex(_.loaderData,T.loaderData,T.matches||[],T.errors):_.loaderData,pe=_.blockers;pe.size>0&&(pe=new Map(pe),pe.forEach((Ze,ot)=>pe.set(ot,va)));let ge=N===!0||_.navigation.formMethod!=null&&er(_.navigation.formMethod)&&((re=E.state)==null?void 0:re._isRedirect)!==!0;a&&(i=a,a=void 0),H||R===jt.Pop||(R===jt.Push?e.history.push(E,E.state):R===jt.Replace&&e.history.replace(E,E.state));let et;if(R===jt.Pop){let Ze=B.get(_.location.pathname);Ze&&Ze.has(E.pathname)?et={currentLocation:_.location,nextLocation:E}:B.has(E.pathname)&&(et={currentLocation:E,nextLocation:_.location})}else if(O){let Ze=B.get(_.location.pathname);Ze?Ze.add(E.pathname):(Ze=new Set([E.pathname]),B.set(_.location.pathname,Ze)),et={currentLocation:_.location,nextLocation:E}}Se(wt({},T,{actionData:q,loaderData:Ce,historyAction:R,location:E,initialized:!0,navigation:Qf,revalidation:"idle",restoreScrollPosition:Dv(E,T.matches||_.matches),preventScrollReset:ge,blockers:pe}),{viewTransitionOpts:et,flushSync:de===!0}),R=jt.Pop,N=!1,O=!1,H=!1,L=!1,K=[],ne=[]}async function Zt(E,T){if(typeof E=="number"){e.history.go(E);return}let j=pp(_.location,_.matches,l,f.v7_prependBasename,E,f.v7_relativeSplatPath,T==null?void 0:T.fromRouteId,T==null?void 0:T.relative),{path:U,submission:re,error:de}=Gy(f.v7_normalizeFormMethod,!1,j,T),xe=_.location,q=dl(_.location,U,T&&T.state);q=wt({},q,e.history.encodeLocation(q));let Ce=T&&T.replace!=null?T.replace:void 0,pe=jt.Push;Ce===!0?pe=jt.Replace:Ce===!1||re!=null&&er(re.formMethod)&&re.formAction===_.location.pathname+_.location.search&&(pe=jt.Replace);let ge=T&&"preventScrollReset"in T?T.preventScrollReset===!0:void 0,et=(T&&T.unstable_flushSync)===!0,Ze=Pv({currentLocation:xe,nextLocation:q,historyAction:pe});if(Ze){fc(Ze,{state:"blocked",location:q,proceed(){fc(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:q}),Zt(E,T)},reset(){let ot=new Map(_.blockers);ot.set(Ze,va),Se({blockers:ot})}});return}return await pn(pe,q,{submission:re,pendingError:de,preventScrollReset:ge,replace:T&&T.replace,enableViewTransition:T&&T.unstable_viewTransition,flushSync:et})}function xo(){if(zt(),Se({revalidation:"loading"}),_.navigation.state!=="submitting"){if(_.navigation.state==="idle"){pn(_.historyAction,_.location,{startUninterruptedRevalidation:!0});return}pn(R||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation})}}async function pn(E,T,j){D&&D.abort(),D=null,R=E,H=(j&&j.startUninterruptedRevalidation)===!0,yT(_.location,_.matches),N=(j&&j.preventScrollReset)===!0,O=(j&&j.enableViewTransition)===!0;let U=a||i,re=j&&j.overrideNavigation,de=hs(U,T,l),xe=(j&&j.flushSync)===!0,q=Cf(de,U,T.pathname);if(q.active&&q.matches&&(de=q.matches),!de){let{error:Ge,notFoundMatches:Wt,route:Pt}=_f(T.pathname);vt(T,{matches:Wt,loaderData:{},errors:{[Pt.id]:Ge}},{flushSync:xe});return}if(_.initialized&&!L&&IP(_.location,T)&&!(j&&j.submission&&er(j.submission.formMethod))){vt(T,{matches:de},{flushSync:xe});return}D=new AbortController;let Ce=qs(e.history,T,D.signal,j&&j.submission),pe;if(j&&j.pendingError)pe=[gi(de).route.id,{type:st.error,error:j.pendingError}];else if(j&&j.submission&&er(j.submission.formMethod)){let Ge=await wo(Ce,T,j.submission,de,q.active,{replace:j.replace,flushSync:xe});if(Ge.shortCircuited)return;if(Ge.pendingActionResult){let[Wt,Pt]=Ge.pendingActionResult;if(Tn(Pt)&&Od(Pt.error)&&Pt.error.status===404){D=null,vt(T,{matches:Ge.matches,loaderData:{},errors:{[Wt]:Pt.error}});return}}de=Ge.matches||de,pe=Ge.pendingActionResult,re=Jf(T,j.submission),xe=!1,q.active=!1,Ce=qs(e.history,Ce.url,Ce.signal)}let{shortCircuited:ge,matches:et,loaderData:Ze,errors:ot}=await k(Ce,T,de,q.active,re,j&&j.submission,j&&j.fetcherSubmission,j&&j.replace,j&&j.initialHydration===!0,xe,pe);ge||(D=null,vt(T,wt({matches:et||de},tx(pe),{loaderData:Ze,errors:ot})))}async function wo(E,T,j,U,re,de){de===void 0&&(de={}),zt();let xe=VP(T,j);if(Se({navigation:xe},{flushSync:de.flushSync===!0}),re){let pe=await pc(U,T.pathname,E.signal);if(pe.type==="aborted")return{shortCircuited:!0};if(pe.type==="error"){let{boundaryId:ge,error:et}=hc(T.pathname,pe);return{matches:pe.partialMatches,pendingActionResult:[ge,{type:st.error,error:et}]}}else if(pe.matches)U=pe.matches;else{let{notFoundMatches:ge,error:et,route:Ze}=_f(T.pathname);return{matches:ge,pendingActionResult:[Ze.id,{type:st.error,error:et}]}}}let q,Ce=Na(U,T);if(!Ce.route.action&&!Ce.route.lazy)q={type:st.error,error:on(405,{method:E.method,pathname:T.pathname,routeId:Ce.route.id})};else if(q=(await Me("action",E,[Ce],U))[0],E.signal.aborted)return{shortCircuited:!0};if(ys(q)){let pe;return de&&de.replace!=null?pe=de.replace:pe=Xy(q.response.headers.get("Location"),new URL(E.url),l)===_.location.pathname+_.location.search,await ue(E,q,{submission:j,replace:pe}),{shortCircuited:!0}}if(vs(q))throw on(400,{type:"defer-action"});if(Tn(q)){let pe=gi(U,Ce.route.id);return(de&&de.replace)!==!0&&(R=jt.Push),{matches:U,pendingActionResult:[pe.route.id,q]}}return{matches:U,pendingActionResult:[Ce.route.id,q]}}async function k(E,T,j,U,re,de,xe,q,Ce,pe,ge){let et=re||Jf(T,de),Ze=de||xe||sx(et),ot=!H&&(!f.v7_partialHydration||!Ce);if(U){if(ot){let kt=P(ge);Se(wt({navigation:et},kt!==void 0?{actionData:kt}:{}),{flushSync:pe})}let Te=await pc(j,T.pathname,E.signal);if(Te.type==="aborted")return{shortCircuited:!0};if(Te.type==="error"){let{boundaryId:kt,error:bn}=hc(T.pathname,Te);return{matches:Te.partialMatches,loaderData:{},errors:{[kt]:bn}}}else if(Te.matches)j=Te.matches;else{let{error:kt,notFoundMatches:bn,route:ht}=_f(T.pathname);return{matches:bn,loaderData:{},errors:{[ht.id]:kt}}}}let Ge=a||i,[Wt,Pt]=Ky(e.history,_,j,Ze,T,f.v7_partialHydration&&Ce===!0,f.v7_skipActionErrorRevalidation,L,K,ne,je,me,le,Ge,l,ge);if(bf(Te=>!(j&&j.some(kt=>kt.route.id===Te))||Wt&&Wt.some(kt=>kt.route.id===Te)),M=++F,Wt.length===0&&Pt.length===0){let Te=aa();return vt(T,wt({matches:j,loaderData:{},errors:ge&&Tn(ge[1])?{[ge[0]]:ge[1].error}:null},tx(ge),Te?{fetchers:new Map(_.fetchers)}:{}),{flushSync:pe}),{shortCircuited:!0}}if(ot){let Te={};if(!U){Te.navigation=et;let kt=P(ge);kt!==void 0&&(Te.actionData=kt)}Pt.length>0&&(Te.fetchers=I(Pt)),Se(Te,{flushSync:pe})}Pt.forEach(Te=>{W.has(Te.key)&&qn(Te.key),Te.controller&&W.set(Te.key,Te.controller)});let la=()=>Pt.forEach(Te=>qn(Te.key));D&&D.signal.addEventListener("abort",la);let{loaderResults:_o,fetcherResults:Bs}=await yt(_.matches,j,Wt,Pt,E);if(E.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",la),Pt.forEach(Te=>W.delete(Te.key));let Gs=rx([..._o,...Bs]);if(Gs){if(Gs.idx>=Wt.length){let Te=Pt[Gs.idx-Wt.length].key;le.add(Te)}return await ue(E,Gs.result,{replace:q}),{shortCircuited:!0}}let{loaderData:Ks,errors:gr}=Jy(_,j,Wt,_o,ge,Pt,Bs,gt);gt.forEach((Te,kt)=>{Te.subscribe(bn=>{(bn||Te.done)&>.delete(kt)})}),f.v7_partialHydration&&Ce&&_.errors&&Object.entries(_.errors).filter(Te=>{let[kt]=Te;return!Wt.some(bn=>bn.route.id===kt)}).forEach(Te=>{let[kt,bn]=Te;gr=Object.assign(gr||{},{[kt]:bn})});let mc=aa(),gc=Rv(M),vc=mc||gc||Pt.length>0;return wt({matches:j,loaderData:Ks,errors:gr},vc?{fetchers:new Map(_.fetchers)}:{})}function P(E){if(E&&!Tn(E[1]))return{[E[0]]:E[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function I(E){return E.forEach(T=>{let j=_.fetchers.get(T.key),U=ya(void 0,j?j.data:void 0);_.fetchers.set(T.key,U)}),new Map(_.fetchers)}function J(E,T,j,U){if(r)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.");W.has(E)&&qn(E);let re=(U&&U.unstable_flushSync)===!0,de=a||i,xe=pp(_.location,_.matches,l,f.v7_prependBasename,j,f.v7_relativeSplatPath,T,U==null?void 0:U.relative),q=hs(de,xe,l),Ce=Cf(q,de,xe);if(Ce.active&&Ce.matches&&(q=Ce.matches),!q){Zn(E,T,on(404,{pathname:xe}),{flushSync:re});return}let{path:pe,submission:ge,error:et}=Gy(f.v7_normalizeFormMethod,!0,xe,U);if(et){Zn(E,T,et,{flushSync:re});return}let Ze=Na(q,pe);if(N=(U&&U.preventScrollReset)===!0,ge&&er(ge.formMethod)){Q(E,T,pe,Ze,q,Ce.active,re,ge);return}me.set(E,{routeId:T,path:pe}),Y(E,T,pe,Ze,q,Ce.active,re,ge)}async function Q(E,T,j,U,re,de,xe,q){zt(),me.delete(E);function Ce(ht){if(!ht.route.action&&!ht.route.lazy){let Ir=on(405,{method:q.formMethod,pathname:j,routeId:T});return Zn(E,T,Ir,{flushSync:xe}),!0}return!1}if(!de&&Ce(U))return;let pe=_.fetchers.get(E);rn(E,zP(q,pe),{flushSync:xe});let ge=new AbortController,et=qs(e.history,j,ge.signal,q);if(de){let ht=await pc(re,j,et.signal);if(ht.type==="aborted")return;if(ht.type==="error"){let{error:Ir}=hc(j,ht);Zn(E,T,Ir,{flushSync:xe});return}else if(ht.matches){if(re=ht.matches,U=Na(re,j),Ce(U))return}else{Zn(E,T,on(404,{pathname:j}),{flushSync:xe});return}}W.set(E,ge);let Ze=F,Ge=(await Me("action",et,[U],re))[0];if(et.signal.aborted){W.get(E)===ge&&W.delete(E);return}if(f.v7_fetcherPersist&&je.has(E)){if(ys(Ge)||Tn(Ge)){rn(E,Eo(void 0));return}}else{if(ys(Ge))if(W.delete(E),M>Ze){rn(E,Eo(void 0));return}else return le.add(E),rn(E,ya(q)),ue(et,Ge,{fetcherSubmission:q});if(Tn(Ge)){Zn(E,T,Ge.error);return}}if(vs(Ge))throw on(400,{type:"defer-action"});let Wt=_.navigation.location||_.location,Pt=qs(e.history,Wt,ge.signal),la=a||i,_o=_.navigation.state!=="idle"?hs(la,_.navigation.location,l):_.matches;Ne(_o,"Didn't find any matches after fetcher action");let Bs=++F;X.set(E,Bs);let Gs=ya(q,Ge.data);_.fetchers.set(E,Gs);let[Ks,gr]=Ky(e.history,_,_o,q,Wt,!1,f.v7_skipActionErrorRevalidation,L,K,ne,je,me,le,la,l,[U.route.id,Ge]);gr.filter(ht=>ht.key!==E).forEach(ht=>{let Ir=ht.key,Mv=_.fetchers.get(Ir),ST=ya(void 0,Mv?Mv.data:void 0);_.fetchers.set(Ir,ST),W.has(Ir)&&qn(Ir),ht.controller&&W.set(Ir,ht.controller)}),Se({fetchers:new Map(_.fetchers)});let mc=()=>gr.forEach(ht=>qn(ht.key));ge.signal.addEventListener("abort",mc);let{loaderResults:gc,fetcherResults:vc}=await yt(_.matches,_o,Ks,gr,Pt);if(ge.signal.aborted)return;ge.signal.removeEventListener("abort",mc),X.delete(E),W.delete(E),gr.forEach(ht=>W.delete(ht.key));let Te=rx([...gc,...vc]);if(Te){if(Te.idx>=Ks.length){let ht=gr[Te.idx-Ks.length].key;le.add(ht)}return ue(Pt,Te.result)}let{loaderData:kt,errors:bn}=Jy(_,_.matches,Ks,gc,void 0,gr,vc,gt);if(_.fetchers.has(E)){let ht=Eo(Ge.data);_.fetchers.set(E,ht)}Rv(Bs),_.navigation.state==="loading"&&Bs>M?(Ne(R,"Expected pending action"),D&&D.abort(),vt(_.navigation.location,{matches:_o,loaderData:kt,errors:bn,fetchers:new Map(_.fetchers)})):(Se({errors:bn,loaderData:ex(_.loaderData,kt,_o,bn),fetchers:new Map(_.fetchers)}),L=!1)}async function Y(E,T,j,U,re,de,xe,q){let Ce=_.fetchers.get(E);rn(E,ya(q,Ce?Ce.data:void 0),{flushSync:xe});let pe=new AbortController,ge=qs(e.history,j,pe.signal);if(de){let Ge=await pc(re,j,ge.signal);if(Ge.type==="aborted")return;if(Ge.type==="error"){let{error:Wt}=hc(j,Ge);Zn(E,T,Wt,{flushSync:xe});return}else if(Ge.matches)re=Ge.matches,U=Na(re,j);else{Zn(E,T,on(404,{pathname:j}),{flushSync:xe});return}}W.set(E,pe);let et=F,ot=(await Me("loader",ge,[U],re))[0];if(vs(ot)&&(ot=await FS(ot,ge.signal,!0)||ot),W.get(E)===pe&&W.delete(E),!ge.signal.aborted){if(je.has(E)){rn(E,Eo(void 0));return}if(ys(ot))if(M>et){rn(E,Eo(void 0));return}else{le.add(E),await ue(ge,ot);return}if(Tn(ot)){Zn(E,T,ot.error);return}Ne(!vs(ot),"Unhandled fetcher deferred data"),rn(E,Eo(ot.data))}}async function ue(E,T,j){let{submission:U,fetcherSubmission:re,replace:de}=j===void 0?{}:j;T.response.headers.has("X-Remix-Revalidate")&&(L=!0);let xe=T.response.headers.get("Location");Ne(xe,"Expected a Location header on the redirect Response"),xe=Xy(xe,new URL(E.url),l);let q=dl(_.location,xe,{_isRedirect:!0});if(n){let ot=!1;if(T.response.headers.has("X-Remix-Reload-Document"))ot=!0;else if(Zm.test(xe)){const Ge=e.history.createURL(xe);ot=Ge.origin!==t.location.origin||qi(Ge.pathname,l)==null}if(ot){de?t.location.replace(xe):t.location.assign(xe);return}}D=null;let Ce=de===!0?jt.Replace:jt.Push,{formMethod:pe,formAction:ge,formEncType:et}=_.navigation;!U&&!re&&pe&&ge&&et&&(U=sx(_.navigation));let Ze=U||re;if(_P.has(T.response.status)&&Ze&&er(Ze.formMethod))await pn(Ce,q,{submission:wt({},Ze,{formAction:xe}),preventScrollReset:N});else{let ot=Jf(q,U);await pn(Ce,q,{overrideNavigation:ot,fetcherSubmission:re,preventScrollReset:N})}}async function Me(E,T,j,U){try{let re=await jP(u,E,T,j,U,s,o);return await Promise.all(re.map((de,xe)=>{if(FP(de)){let q=de.result;return{type:st.redirect,response:OP(q,T,j[xe].route.id,U,l,f.v7_relativeSplatPath)}}return MP(de)}))}catch(re){return j.map(()=>({type:st.error,error:re}))}}async function yt(E,T,j,U,re){let[de,...xe]=await Promise.all([j.length?Me("loader",re,j,T):[],...U.map(q=>{if(q.matches&&q.match&&q.controller){let Ce=qs(e.history,q.path,q.controller.signal);return Me("loader",Ce,[q.match],q.matches).then(pe=>pe[0])}else return Promise.resolve({type:st.error,error:on(404,{pathname:q.path})})})]);return await Promise.all([ox(E,j,de,de.map(()=>re.signal),!1,_.loaderData),ox(E,U.map(q=>q.match),xe,U.map(q=>q.controller?q.controller.signal:null),!0)]),{loaderResults:de,fetcherResults:xe}}function zt(){L=!0,K.push(...bf()),me.forEach((E,T)=>{W.has(T)&&(ne.push(T),qn(T))})}function rn(E,T,j){j===void 0&&(j={}),_.fetchers.set(E,T),Se({fetchers:new Map(_.fetchers)},{flushSync:(j&&j.flushSync)===!0})}function Zn(E,T,j,U){U===void 0&&(U={});let re=gi(_.matches,T);So(E),Se({errors:{[re.route.id]:j},fetchers:new Map(_.fetchers)},{flushSync:(U&&U.flushSync)===!0})}function Hs(E){return f.v7_fetcherPersist&&(rt.set(E,(rt.get(E)||0)+1),je.has(E)&&je.delete(E)),_.fetchers.get(E)||bP}function So(E){let T=_.fetchers.get(E);W.has(E)&&!(T&&T.state==="loading"&&X.has(E))&&qn(E),me.delete(E),X.delete(E),le.delete(E),je.delete(E),_.fetchers.delete(E)}function Sf(E){if(f.v7_fetcherPersist){let T=(rt.get(E)||0)-1;T<=0?(rt.delete(E),je.add(E)):rt.set(E,T)}else So(E);Se({fetchers:new Map(_.fetchers)})}function qn(E){let T=W.get(E);Ne(T,"Expected fetch controller: "+E),T.abort(),W.delete(E)}function dc(E){for(let T of E){let j=Hs(T),U=Eo(j.data);_.fetchers.set(T,U)}}function aa(){let E=[],T=!1;for(let j of le){let U=_.fetchers.get(j);Ne(U,"Expected fetcher: "+j),U.state==="loading"&&(le.delete(j),E.push(j),T=!0)}return dc(E),T}function Rv(E){let T=[];for(let[j,U]of X)if(U0}function gT(E,T){let j=_.blockers.get(E)||va;return Ue.get(E)!==T&&Ue.set(E,T),j}function Nv(E){_.blockers.delete(E),Ue.delete(E)}function fc(E,T){let j=_.blockers.get(E)||va;Ne(j.state==="unblocked"&&T.state==="blocked"||j.state==="blocked"&&T.state==="blocked"||j.state==="blocked"&&T.state==="proceeding"||j.state==="blocked"&&T.state==="unblocked"||j.state==="proceeding"&&T.state==="unblocked","Invalid blocker state transition: "+j.state+" -> "+T.state);let U=new Map(_.blockers);U.set(E,T),Se({blockers:U})}function Pv(E){let{currentLocation:T,nextLocation:j,historyAction:U}=E;if(Ue.size===0)return;Ue.size>1&&Ds(!1,"A router only supports one blocker at a time");let re=Array.from(Ue.entries()),[de,xe]=re[re.length-1],q=_.blockers.get(de);if(!(q&&q.state==="proceeding")&&xe({currentLocation:T,nextLocation:j,historyAction:U}))return de}function _f(E){let T=on(404,{pathname:E}),j=a||i,{matches:U,route:re}=nx(j);return bf(),{notFoundMatches:U,route:re,error:T}}function hc(E,T){return{boundaryId:gi(T.partialMatches).route.id,error:on(400,{type:"route-discovery",pathname:E,message:T.error!=null&&"message"in T.error?T.error:String(T.error)})}}function bf(E){let T=[];return gt.forEach((j,U)=>{(!E||E(U))&&(j.cancel(),T.push(U),gt.delete(U))}),T}function vT(E,T,j){if(g=E,S=T,y=j||null,!v&&_.navigation===Qf){v=!0;let U=Dv(_.location,_.matches);U!=null&&Se({restoreScrollPosition:U})}return()=>{g=null,S=null,y=null}}function jv(E,T){return y&&y(E,T.map(U=>eP(U,_.loaderData)))||E.key}function yT(E,T){if(g&&S){let j=jv(E,T);g[j]=S()}}function Dv(E,T){if(g){let j=jv(E,T),U=g[j];if(typeof U=="number")return U}return null}function Cf(E,T,j){if(d)if(E){let U=E[E.length-1].route;if(U.path&&(U.path==="*"||U.path.endsWith("/*")))return{active:!0,matches:iu(T,j,l,!0)}}else return{active:!0,matches:iu(T,j,l,!0)||[]};return{active:!1,matches:null}}async function pc(E,T,j){let U=E,re=U.length>0?U[U.length-1].route:null;for(;;){let de=a==null,xe=a||i;try{await NP(d,T,U,xe,s,o,ce,j)}catch(ge){return{type:"error",error:ge,partialMatches:U}}finally{de&&(i=[...i])}if(j.aborted)return{type:"aborted"};let q=hs(xe,T,l),Ce=!1;if(q){let ge=q[q.length-1].route;if(ge.index)return{type:"success",matches:q};if(ge.path&&ge.path.length>0)if(ge.path==="*")Ce=!0;else return{type:"success",matches:q}}let pe=iu(xe,T,l,!0);if(!pe||U.map(ge=>ge.route.id).join("-")===pe.map(ge=>ge.route.id).join("-"))return{type:"success",matches:Ce?q:null};if(U=pe,re=U[U.length-1].route,re.path==="*")return{type:"success",matches:U}}}function xT(E){s={},a=fl(E,o,void 0,s)}function wT(E,T){let j=a==null;AS(E,T,a||i,s,o),j&&(i=[...i],Se({}))}return C={get basename(){return l},get future(){return f},get state(){return _},get routes(){return i},get window(){return t},initialize:He,subscribe:Ve,enableScrollRestoration:vT,navigate:Zt,fetch:J,revalidate:xo,createHref:E=>e.history.createHref(E),encodeLocation:E=>e.history.encodeLocation(E),getFetcher:Hs,deleteFetcher:Sf,dispose:$e,getBlocker:gT,deleteBlocker:Nv,patchRoutes:wT,_internalFetchControllers:W,_internalActiveDeferreds:gt,_internalSetRoutes:xT},C}function EP(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function pp(e,t,n,r,o,s,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=Md(o||".",Dd(l,s),qi(e.pathname,n)||e.pathname,a==="path");return o==null&&(d.search=e.search,d.hash=e.hash),(o==null||o===""||o===".")&&u&&u.route.index&&!qm(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:Xr([n,d.pathname])),Ms(d)}function Gy(e,t,n,r){if(!r||!EP(r))return{path:n};if(r.formMethod&&!$P(r.formMethod))return{path:n,error:on(405,{method:r.formMethod})};let o=()=>({path:n,error:on(400,{type:"invalid-body"})}),s=r.formMethod||"get",i=e?s.toUpperCase():s.toLowerCase(),a=IS(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!er(i))return o();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((x,g)=>{let[y,S]=g;return""+x+y+"="+S+` -`},""):String(r.body);return{path:n,submission:{formMethod:i,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:p}}}else if(r.formEncType==="application/json"){if(!er(i))return o();try{let p=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:i,formAction:a,formEncType:r.formEncType,formData:void 0,json:p,text:void 0}}}catch{return o()}}}Ne(typeof FormData=="function","FormData is not available in this environment");let l,u;if(r.formData)l=mp(r.formData),u=r.formData;else if(r.body instanceof FormData)l=mp(r.body),u=r.body;else if(r.body instanceof URLSearchParams)l=r.body,u=Qy(l);else if(r.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(r.body),u=Qy(l)}catch{return o()}let d={formMethod:i,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(er(d.formMethod))return{path:n,submission:d};let f=ho(n);return t&&f.search&&qm(f.search)&&l.append("index",""),f.search="?"+l,{path:Ms(f),submission:d}}function TP(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function Ky(e,t,n,r,o,s,i,a,l,u,d,f,p,x,g,y){let S=y?Tn(y[1])?y[1].error:y[1].data:void 0,v=e.createURL(t.location),m=e.createURL(o),w=y&&Tn(y[1])?y[0]:void 0,b=w?TP(n,w):n,C=y?y[1].statusCode:void 0,_=i&&C&&C>=400,R=b.filter((D,O)=>{let{route:B}=D;if(B.lazy)return!0;if(B.loader==null)return!1;if(s)return typeof B.loader!="function"||B.loader.hydrate?!0:t.loaderData[B.id]===void 0&&(!t.errors||t.errors[B.id]===void 0);if(RP(t.loaderData,t.matches[O],D)||l.some(L=>L===D.route.id))return!0;let A=t.matches[O],H=D;return Zy(D,wt({currentUrl:v,currentParams:A.params,nextUrl:m,nextParams:H.params},r,{actionResult:S,actionStatus:C,defaultShouldRevalidate:_?!1:a||v.pathname+v.search===m.pathname+m.search||v.search!==m.search||OS(A,H)}))}),N=[];return f.forEach((D,O)=>{if(s||!n.some(K=>K.route.id===D.routeId)||d.has(O))return;let B=hs(x,D.path,g);if(!B){N.push({key:O,routeId:D.routeId,path:D.path,matches:null,match:null,controller:null});return}let A=t.fetchers.get(O),H=Na(B,D.path),L=!1;p.has(O)?L=!1:u.includes(O)?L=!0:A&&A.state!=="idle"&&A.data===void 0?L=a:L=Zy(H,wt({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:m,nextParams:n[n.length-1].params},r,{actionResult:S,actionStatus:C,defaultShouldRevalidate:_?!1:a})),L&&N.push({key:O,routeId:D.routeId,path:D.path,matches:B,match:H,controller:new AbortController})}),[R,N]}function RP(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function OS(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Zy(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function NP(e,t,n,r,o,s,i,a){let l=[t,...n.map(u=>u.route.id)].join("-");try{let u=i.get(l);u||(u=e({path:t,matches:n,patch:(d,f)=>{a.aborted||AS(d,f,r,o,s)}}),i.set(l,u)),u&&LP(u)&&await u}finally{i.delete(l)}}function AS(e,t,n,r,o){if(e){var s;let i=r[e];Ne(i,"No route found to patch children into: routeId = "+e);let a=fl(t,o,[e,"patch",String(((s=i.children)==null?void 0:s.length)||"0")],r);i.children?i.children.push(...a):i.children=a}else{let i=fl(t,o,["patch",String(n.length||"0")],r);n.push(...i)}}async function qy(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Ne(o,"No route found in manifest");let s={};for(let i in r){let l=o[i]!==void 0&&i!=="hasErrorBoundary";Ds(!l,'Route "'+o.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)&&(s[i]=r[i])}Object.assign(o,s),Object.assign(o,wt({},t(o),{lazy:void 0}))}function PP(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function jP(e,t,n,r,o,s,i,a){let l=r.reduce((f,p)=>f.add(p.route.id),new Set),u=new Set,d=await e({matches:o.map(f=>{let p=l.has(f.route.id);return wt({},f,{shouldLoad:p,resolve:g=>(u.add(f.route.id),p?DP(t,n,f,s,i,g,a):Promise.resolve({type:st.data,result:void 0}))})}),request:n,params:o[0].params,context:a});return o.forEach(f=>Ne(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(o[p].route.id))}async function DP(e,t,n,r,o,s,i){let a,l,u=d=>{let f,p=new Promise((y,S)=>f=S);l=()=>f(),t.signal.addEventListener("abort",l);let x=y=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):d({request:t,params:n.params,context:i},...y!==void 0?[y]:[]),g;return s?g=s(y=>x(y)):g=(async()=>{try{return{type:"data",result:await x()}}catch(y){return{type:"error",result:y}}})(),Promise.race([g,p])};try{let d=n.route[e];if(n.route.lazy)if(d){let f,[p]=await Promise.all([u(d).catch(x=>{f=x}),qy(n.route,o,r)]);if(f!==void 0)throw f;a=p}else if(await qy(n.route,o,r),d=n.route[e],d)a=await u(d);else if(e==="action"){let f=new URL(t.url),p=f.pathname+f.search;throw on(405,{method:t.method,pathname:p,routeId:n.route.id})}else return{type:st.data,result:void 0};else if(d)a=await u(d);else{let f=new URL(t.url),p=f.pathname+f.search;throw on(404,{pathname:p})}Ne(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:st.error,result:d}}finally{l&&t.signal.removeEventListener("abort",l)}return a}async function MP(e){let{result:t,type:n,status:r}=e;if(LS(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:st.error,error:a}}return n===st.error?{type:st.error,error:new Km(t.status,t.statusText,i),statusCode:t.status,headers:t.headers}:{type:st.data,data:i,statusCode:t.status,headers:t.headers}}if(n===st.error)return{type:st.error,error:t,statusCode:Od(t)?t.status:r};if(UP(t)){var o,s;return{type:st.deferred,deferredData:t,statusCode:(o=t.init)==null?void 0:o.status,headers:((s=t.init)==null?void 0:s.headers)&&new Headers(t.init.headers)}}return{type:st.data,data:t,statusCode:r}}function OP(e,t,n,r,o,s){let i=e.headers.get("Location");if(Ne(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Zm.test(i)){let a=r.slice(0,r.findIndex(l=>l.route.id===n)+1);i=pp(new URL(t.url),a,o,!0,i,s),e.headers.set("Location",i)}return e}function Xy(e,t,n){if(Zm.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),s=qi(o.pathname,n)!=null;if(o.origin===t.origin&&s)return o.pathname+o.search+o.hash}return e}function qs(e,t,n,r){let o=e.createURL(IS(t)).toString(),s={signal:n};if(r&&er(r.formMethod)){let{formMethod:i,formEncType:a}=r;s.method=i.toUpperCase(),a==="application/json"?(s.headers=new Headers({"Content-Type":a}),s.body=JSON.stringify(r.json)):a==="text/plain"?s.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?s.body=mp(r.formData):s.body=r.formData}return new Request(o,s)}function mp(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Qy(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function AP(e,t,n,r,o,s){let i={},a=null,l,u=!1,d={},f=r&&Tn(r[1])?r[1].error:void 0;return n.forEach((p,x)=>{let g=t[x].route.id;if(Ne(!ys(p),"Cannot handle redirect results in processLoaderData"),Tn(p)){let y=p.error;f!==void 0&&(y=f,f=void 0),a=a||{};{let S=gi(e,g);a[S.route.id]==null&&(a[S.route.id]=y)}i[g]=void 0,u||(u=!0,l=Od(p.error)?p.error.status:500),p.headers&&(d[g]=p.headers)}else vs(p)?(o.set(g,p.deferredData),i[g]=p.deferredData.data,p.statusCode!=null&&p.statusCode!==200&&!u&&(l=p.statusCode),p.headers&&(d[g]=p.headers)):(i[g]=p.data,p.statusCode&&p.statusCode!==200&&!u&&(l=p.statusCode),p.headers&&(d[g]=p.headers))}),f!==void 0&&r&&(a={[r[0]]:f},i[r[0]]=void 0),{loaderData:i,errors:a,statusCode:l||200,loaderHeaders:d}}function Jy(e,t,n,r,o,s,i,a){let{loaderData:l,errors:u}=AP(t,n,r,o,a);for(let d=0;dr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function nx(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function on(e,t){let{pathname:n,routeId:r,method:o,type:s,message:i}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",s==="route-discovery"?l='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnMiss()` '+(`function threw the following error: -`+i):o&&n&&r?l="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":s==="defer-action"?l="defer() is not supported in actions":s==="invalid-body"&&(l="Unable to encode submission body")):e===403?(a="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",l='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",o&&n&&r?l="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new Km(e||500,a,new Error(l),!0)}function rx(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(ys(n))return{result:n,idx:t}}}function IS(e){let t=typeof e=="string"?ho(e):e;return Ms(wt({},t,{hash:""}))}function IP(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function LP(e){return typeof e=="object"&&e!=null&&"then"in e}function FP(e){return LS(e.result)&&SP.has(e.result.status)}function vs(e){return e.type===st.deferred}function Tn(e){return e.type===st.error}function ys(e){return(e&&e.type)===st.redirect}function UP(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 LS(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function $P(e){return wP.has(e.toLowerCase())}function er(e){return yP.has(e.toLowerCase())}async function ox(e,t,n,r,o,s){for(let i=0;if.route.id===l.route.id),d=u!=null&&!OS(u,l)&&(s&&s[l.route.id])!==void 0;if(vs(a)&&(o||d)){let f=r[i];Ne(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await FS(a,f,o).then(p=>{p&&(n[i]=p||n[i])})}}}async function FS(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:st.data,data:e.deferredData.unwrappedData}}catch(o){return{type:st.error,error:o}}return{type:st.data,data:e.deferredData.data}}}function qm(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Na(e,t){let n=typeof t=="string"?ho(t).search:t.search;if(e[e.length-1].route.index&&qm(n||""))return e[e.length-1];let r=jS(e);return r[r.length-1]}function sx(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:s,json:i}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:i,text:void 0}}}function Jf(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 VP(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 ya(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 zP(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 Eo(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 WP(e,t){try{let n=e.sessionStorage.getItem(MS);if(n){let r=JSON.parse(n);for(let[o,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(o,new Set(s||[]))}}catch{}}function YP(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(MS,JSON.stringify(n))}catch(r){Ds(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** - * 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 Vu(){return Vu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),h.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let f=Md(u,JSON.parse(i),s,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Xr([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,i,s,e])}const GP=h.createContext(null);function KP(e){let t=h.useContext(po).outlet;return t&&h.createElement(GP.Provider,{value:e},t)}function zS(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=h.useContext(ss),{matches:o}=h.useContext(po),{pathname:s}=is(),i=JSON.stringify(Dd(o,r.v7_relativeSplatPath));return h.useMemo(()=>Md(e,JSON.parse(i),s,n==="path"),[e,i,s,n])}function ZP(e,t,n,r){Xi()||Ne(!1);let{navigator:o}=h.useContext(ss),{matches:s}=h.useContext(po),i=s[s.length-1],a=i?i.params:{};i&&i.pathname;let l=i?i.pathnameBase:"/";i&&i.route;let u=is(),d;d=u;let f=d.pathname||"/",p=f;if(l!=="/"){let y=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let x=hs(e,{pathname:p});return ej(x&&x.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:Xr([l,o.encodeLocation?o.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Xr([l,o.encodeLocation?o.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,n,r)}function qP(){let e=oj(),t=Od(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:o},n):null,null)}const XP=h.createElement(qP,null);class QP extends h.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,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?h.createElement(po.Provider,{value:this.props.routeContext},h.createElement($S.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function JP(e){let{routeContext:t,match:n,children:r}=e,o=h.useContext(Ad);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(po.Provider,{value:t},r)}function ej(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if((s=n)!=null&&s.errors)e=n.matches;else return null}let i=e,a=(o=n)==null?void 0:o.errors;if(a!=null){let d=i.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||Ne(!1),i=i.slice(0,Math.min(i.length,d+1))}let l=!1,u=-1;if(n&&r&&r.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 x,g=!1,y=null,S=null;n&&(x=a&&f.route.id?a[f.route.id]:void 0,y=f.route.errorElement||XP,l&&(u<0&&p===0?(ij("route-fallback"),g=!0,S=null):u===p&&(g=!0,S=f.route.hydrateFallbackElement||null)));let v=t.concat(i.slice(0,p+1)),m=()=>{let w;return x?w=y:g?w=S:f.route.Component?w=h.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,h.createElement(JP,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?h.createElement(QP,{location:n.location,revalidation:n.revalidation,component:y,error:x,children:m(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):m()},null)}var WS=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(WS||{}),zu=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}(zu||{});function tj(e){let t=h.useContext(Ad);return t||Ne(!1),t}function nj(e){let t=h.useContext(US);return t||Ne(!1),t}function rj(e){let t=h.useContext(po);return t||Ne(!1),t}function YS(e){let t=rj(),n=t.matches[t.matches.length-1];return n.route.id||Ne(!1),n.route.id}function oj(){var e;let t=h.useContext($S),n=nj(zu.UseRouteError),r=YS(zu.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function sj(){let{router:e}=tj(WS.UseNavigateStable),t=YS(zu.UseNavigateStable),n=h.useRef(!1);return VS(()=>{n.current=!0}),h.useCallback(function(o,s){s===void 0&&(s={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Vu({fromRouteId:t},s)))},[e,t])}const ix={};function ij(e,t,n){ix[e]||(ix[e]=!0)}function HS(e){let{to:t,replace:n,state:r,relative:o}=e;Xi()||Ne(!1);let{future:s,static:i}=h.useContext(ss),{matches:a}=h.useContext(po),{pathname:l}=is(),u=as(),d=Md(t,Dd(a,s.v7_relativeSplatPath),l,o==="path"),f=JSON.stringify(d);return h.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:o}),[u,f,o,n,r]),null}function BS(e){return KP(e.context)}function aj(e){let{basename:t="/",children:n=null,location:r,navigationType:o=jt.Pop,navigator:s,static:i=!1,future:a}=e;Xi()&&Ne(!1);let l=t.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:l,navigator:s,static:i,future:Vu({v7_relativeSplatPath:!1},a)}),[l,a,s,i]);typeof r=="string"&&(r=ho(r));let{pathname:d="/",search:f="",hash:p="",state:x=null,key:g="default"}=r,y=h.useMemo(()=>{let S=qi(d,l);return S==null?null:{location:{pathname:S,search:f,hash:p,state:x,key:g},navigationType:o}},[l,d,f,p,x,g,o]);return y==null?null:h.createElement(ss.Provider,{value:u},h.createElement(Xm.Provider,{children:n,value:y}))}new Promise(()=>{});function lj(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:h.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:h.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 hl(){return hl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function uj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dj(e,t){return e.button===0&&(!t||t==="_self")&&!uj(e)}function gp(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function fj(e,t){let n=gp(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(s=>{n.append(o,s)})}),n}const hj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],pj="6";try{window.__reactRouterVersion=pj}catch{}function mj(e,t){return kP({basename:void 0,future:hl({},void 0,{v7_prependBasename:!0}),history:ZN({window:void 0}),hydrationData:gj(),routes:e,mapRouteProperties:lj,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function gj(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=hl({},t,{errors:vj(t.errors)})),t}function vj(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new Km(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let s=window[o.__subType];if(typeof s=="function")try{let i=new s(o.message);i.stack="",n[r]=i}catch{}}if(n[r]==null){let s=new Error(o.message);s.stack="",n[r]=s}}else n[r]=o;return n}const yj=h.createContext({isTransitioning:!1}),xj=h.createContext(new Map),wj="startTransition",ax=kw[wj],Sj="flushSync",lx=KN[Sj];function _j(e){ax?ax(e):e()}function xa(e){lx?lx(e):e()}class bj{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function Cj(e){let{fallbackElement:t,router:n,future:r}=e,[o,s]=h.useState(n.state),[i,a]=h.useState(),[l,u]=h.useState({isTransitioning:!1}),[d,f]=h.useState(),[p,x]=h.useState(),[g,y]=h.useState(),S=h.useRef(new Map),{v7_startTransition:v}=r||{},m=h.useCallback(N=>{v?_j(N):N()},[v]),w=h.useCallback((N,D)=>{let{deletedFetchers:O,unstable_flushSync:B,unstable_viewTransitionOpts:A}=D;O.forEach(L=>S.current.delete(L)),N.fetchers.forEach((L,K)=>{L.data!==void 0&&S.current.set(K,L.data)});let H=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!A||H){B?xa(()=>s(N)):m(()=>s(N));return}if(B){xa(()=>{p&&(d&&d.resolve(),p.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:A.currentLocation,nextLocation:A.nextLocation})});let L=n.window.document.startViewTransition(()=>{xa(()=>s(N))});L.finished.finally(()=>{xa(()=>{f(void 0),x(void 0),a(void 0),u({isTransitioning:!1})})}),xa(()=>x(L));return}p?(d&&d.resolve(),p.skipTransition(),y({state:N,currentLocation:A.currentLocation,nextLocation:A.nextLocation})):(a(N),u({isTransitioning:!0,flushSync:!1,currentLocation:A.currentLocation,nextLocation:A.nextLocation}))},[n.window,p,d,S,m]);h.useLayoutEffect(()=>n.subscribe(w),[n,w]),h.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new bj)},[l]),h.useEffect(()=>{if(d&&i&&n.window){let N=i,D=d.promise,O=n.window.document.startViewTransition(async()=>{m(()=>s(N)),await D});O.finished.finally(()=>{f(void 0),x(void 0),a(void 0),u({isTransitioning:!1})}),x(O)}},[m,i,d,n.window]),h.useEffect(()=>{d&&i&&o.location.key===i.location.key&&d.resolve()},[d,p,o.location,i]),h.useEffect(()=>{!l.isTransitioning&&g&&(a(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),y(void 0))},[l.isTransitioning,g]),h.useEffect(()=>{},[]);let b=h.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:N=>n.navigate(N),push:(N,D,O)=>n.navigate(N,{state:D,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(N,D,O)=>n.navigate(N,{replace:!0,state:D,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[n]),C=n.basename||"/",_=h.useMemo(()=>({router:n,navigator:b,static:!1,basename:C}),[n,b,C]),R=h.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return h.createElement(h.Fragment,null,h.createElement(Ad.Provider,{value:_},h.createElement(US.Provider,{value:o},h.createElement(xj.Provider,{value:S.current},h.createElement(yj.Provider,{value:l},h.createElement(aj,{basename:C,location:o.location,navigationType:o.historyAction,navigator:b,future:R},o.initialized||n.future.v7_partialHydration?h.createElement(kj,{routes:n.routes,future:n.future,state:o}):t))))),null)}const kj=h.memo(Ej);function Ej(e){let{routes:t,future:n,state:r}=e;return ZP(t,void 0,r,n)}const Tj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Rj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$r=h.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:s,replace:i,state:a,target:l,to:u,preventScrollReset:d,unstable_viewTransition:f}=t,p=cj(t,hj),{basename:x}=h.useContext(ss),g,y=!1;if(typeof u=="string"&&Rj.test(u)&&(g=u,Tj))try{let w=new URL(window.location.href),b=u.startsWith("//")?new URL(w.protocol+u):new URL(u),C=qi(b.pathname,x);b.origin===w.origin&&C!=null?u=C+b.search+b.hash:y=!0}catch{}let S=HP(u,{relative:o}),v=Nj(u,{replace:i,state:a,target:l,preventScrollReset:d,relative:o,unstable_viewTransition:f});function m(w){r&&r(w),w.defaultPrevented||v(w)}return h.createElement("a",hl({},p,{href:g||S,onClick:y||s?r:m,ref:n,target:l}))});var cx;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(cx||(cx={}));var ux;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(ux||(ux={}));function Nj(e,t){let{target:n,replace:r,state:o,preventScrollReset:s,relative:i,unstable_viewTransition:a}=t===void 0?{}:t,l=as(),u=is(),d=zS(e,{relative:i});return h.useCallback(f=>{if(dj(f,n)){f.preventDefault();let p=r!==void 0?r:Ms(u)===Ms(d);l(e,{replace:p,state:o,preventScrollReset:s,relative:i,unstable_viewTransition:a})}},[u,l,d,r,o,n,e,s,i,a])}function Pj(e){let t=h.useRef(gp(e)),n=h.useRef(!1),r=is(),o=h.useMemo(()=>fj(r.search,n.current?null:t.current),[r.search]),s=as(),i=h.useCallback((a,l)=>{const u=gp(typeof a=="function"?a(o):a);n.current=!0,s("?"+u,l)},[s,o]);return[o,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 jj=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),GS=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).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 Dj={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 Mj=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>h.createElement("svg",{ref:l,...Dj,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:GS("lucide",o),...a},[...i.map(([u,d])=>h.createElement(u,d)),...Array.isArray(s)?s:[s]]));/** - * @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 nn=(e,t)=>{const n=h.forwardRef(({className:r,...o},s)=>h.createElement(Mj,{ref:s,iconNode:t,className:GS(`lucide-${jj(e)}`,r),...o}));return n.displayName=`${e}`,n};/** - * @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 KS=nn("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 ZS=nn("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 Oj=nn("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 Aj=nn("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 qS=nn("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 Ij=nn("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 XS=nn("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 QS=nn("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 vp=nn("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 dx=nn("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 Lj=nn("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 Fj=nn("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 fx=nn("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 hx=nn("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 Uj=nn("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 Qm=nn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function $j(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Id(...e){return t=>e.forEach(n=>$j(n,t))}function be(...e){return h.useCallback(Id(...e),e)}var oo=h.forwardRef((e,t)=>{const{children:n,...r}=e,o=h.Children.toArray(n),s=o.find(Vj);if(s){const i=s.props.children,a=o.map(l=>l===s?h.Children.count(i)>1?h.Children.only(null):h.isValidElement(i)?i.props.children:null:l);return c.jsx(yp,{...r,ref:t,children:h.isValidElement(i)?h.cloneElement(i,void 0,a):null})}return c.jsx(yp,{...r,ref:t,children:n})});oo.displayName="Slot";var yp=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const o=Wj(n);return h.cloneElement(n,{...zj(r,n.props),ref:t?Id(t,o):o})}return h.Children.count(n)>1?h.Children.only(null):null});yp.displayName="SlotClone";var Jm=({children:e})=>c.jsx(c.Fragment,{children:e});function Vj(e){return h.isValidElement(e)&&e.type===Jm}function zj(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Wj(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function JS(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,mx=Yj,Wl=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return mx(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],f=s==null?void 0:s[u];if(d===null)return null;const p=px(d)||px(f);return o[u][p]}),a=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...x}=d;return Object.entries(x).every(g=>{let[y,S]=g;return Array.isArray(S)?S.includes({...s,...a}[y]):{...s,...a}[y]===S})?[...u,f,p]:u},[]);return mx(e,i,l,n==null?void 0:n.class,n==null?void 0:n.className)};function e_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;ta(s)))==null?void 0:i.classGroupId}const gx=/^\[(.+)\]$/;function Gj(e){if(gx.test(e)){const t=gx.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function Kj(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return qj(Object.entries(e.classGroups),n).forEach(([s,i])=>{xp(i,r,s,t)}),r}function xp(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:vx(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Zj(o)){xp(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{xp(i,vx(t,s),n,r)})})}function vx(e,t){let n=e;return t.split(eg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function Zj(e){return e.isThemeGetter}function qj(e,t){return t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e}function Xj(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(s,i){n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)}return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}}const n_="!";function Qj(e){const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length;function i(a){const l=[];let u=0,d=0,f;for(let S=0;Sd?f-d:void 0;return{modifiers:l,hasImportantModifier:x,baseClassName:g,maybePostfixModifierPosition:y}}return n?function(l){return n({className:l,parseClassName:i})}:i}function Jj(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function eD(e){return{cache:Xj(e.cacheSize),parseClassName:Qj(e),...Bj(e)}}const tD=/\s+/;function nD(e,t){const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=new Set;return e.trim().split(tD).map(i=>{const{modifiers:a,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(i);let f=!!d,p=r(f?u.substring(0,d):u);if(!p){if(!f)return{isTailwindClass:!1,originalClassName:i};if(p=r(u),!p)return{isTailwindClass:!1,originalClassName:i};f=!1}const x=Jj(a).join(":");return{isTailwindClass:!0,modifierId:l?x+n_:x,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 s.has(d)?!1:(s.add(d),o(l,u).forEach(f=>s.add(a+f)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function rD(){let e=0,t,n,r="";for(;ef(d),e());return n=eD(u),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=nD(l,n);return o(l,d),d}return function(){return s(rD.apply(null,arguments))}}function at(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const o_=/^\[(?:([a-z-]+):)?(.+)\]$/i,sD=/^\d+\/\d+$/,iD=new Set(["px","full","screen"]),aD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lD=/\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$/,cD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,uD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Lr(e){return xs(e)||iD.has(e)||sD.test(e)}function Co(e){return Qi(e,"length",xD)}function xs(e){return!!e&&!Number.isNaN(Number(e))}function Ac(e){return Qi(e,"number",xs)}function wa(e){return!!e&&Number.isInteger(Number(e))}function fD(e){return e.endsWith("%")&&xs(e.slice(0,-1))}function ke(e){return o_.test(e)}function ko(e){return aD.test(e)}const hD=new Set(["length","size","percentage"]);function pD(e){return Qi(e,hD,s_)}function mD(e){return Qi(e,"position",s_)}const gD=new Set(["image","url"]);function vD(e){return Qi(e,gD,SD)}function yD(e){return Qi(e,"",wD)}function Sa(){return!0}function Qi(e,t,n){const r=o_.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function xD(e){return lD.test(e)&&!cD.test(e)}function s_(){return!1}function wD(e){return uD.test(e)}function SD(e){return dD.test(e)}function _D(){const e=at("colors"),t=at("spacing"),n=at("blur"),r=at("brightness"),o=at("borderColor"),s=at("borderRadius"),i=at("borderSpacing"),a=at("borderWidth"),l=at("contrast"),u=at("grayscale"),d=at("hueRotate"),f=at("invert"),p=at("gap"),x=at("gradientColorStops"),g=at("gradientColorStopPositions"),y=at("inset"),S=at("margin"),v=at("opacity"),m=at("padding"),w=at("saturate"),b=at("scale"),C=at("sepia"),_=at("skew"),R=at("space"),N=at("translate"),D=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",ke,t],A=()=>[ke,t],H=()=>["",Lr,Co],L=()=>["auto",xs,ke],K=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ne=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",ke],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],le=()=>[xs,Ac],me=()=>[xs,ke];return{cacheSize:500,separator:":",theme:{colors:[Sa],spacing:[Lr,Co],blur:["none","",ko,ke],brightness:le(),borderColor:[e],borderRadius:["none","","full",ko,ke],borderSpacing:A(),borderWidth:H(),contrast:le(),grayscale:M(),hueRotate:me(),invert:M(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[fD,Co],inset:B(),margin:B(),opacity:le(),padding:A(),saturate:le(),scale:le(),sepia:M(),skew:me(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",ke]}],container:["container"],columns:[{columns:[ko]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"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:[...K(),ke]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",wa,ke]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ke]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",wa,ke]}],"grid-cols":[{"grid-cols":[Sa]}],"col-start-end":[{col:["auto",{span:["full",wa,ke]},ke]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Sa]}],"row-start-end":[{row:["auto",{span:[wa,ke]},ke]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ke]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ke]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"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",ke,t]}],"min-w":[{"min-w":[ke,t,"min","max","fit"]}],"max-w":[{"max-w":[ke,t,"none","full","min","max","fit","prose",{screen:[ko]},ko]}],h:[{h:[ke,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ke,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ke,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ke,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ko,Co]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ac]}],"font-family":[{font:[Sa]}],"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",ke]}],"line-clamp":[{"line-clamp":["none",xs,Ac]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Lr,ke]}],"list-image":[{"list-image":["none",ke]}],"list-style-type":[{list:["none","disc","decimal",ke]}],"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:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Lr,Co]}],"underline-offset":[{"underline-offset":["auto",Lr,ke]}],"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:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke]}],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",ke]}],"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:[...K(),mD]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pD]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},vD]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"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:[...ne(),"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:ne()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...ne()]}],"outline-offset":[{"outline-offset":[Lr,ke]}],"outline-w":[{outline:[Lr,Co]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Lr,Co]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ko,yD]}],"shadow-color":[{shadow:[Sa]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ko,ke]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"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":[w]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"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",ke]}],duration:[{duration:me()}],ease:[{ease:["linear","in","out","in-out",ke]}],delay:[{delay:me()}],animate:[{animate:["none","spin","ping","pulse","bounce",ke]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[wa,ke]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ke]}],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",ke]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",ke]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Lr,Co,Ac]}],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 bD=oD(_D);function se(...e){return bD(Hj(e))}const tg=Wl("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"}}),Dt=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?oo:"button";return c.jsx(i,{className:se(tg({variant:t,size:n,className:e})),ref:s,...o})});Dt.displayName="Button";function G(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function CD(e,t){const n=h.createContext(t);function r(s){const{children:i,...a}=s,l=h.useMemo(()=>a,Object.values(a));return c.jsx(n.Provider,{value:l,children:i})}function o(s){const i=h.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,o]}function _n(e,t=[]){let n=[];function r(s,i){const a=h.createContext(i),l=n.length;n=[...n,i];function u(f){const{scope:p,children:x,...g}=f,y=(p==null?void 0:p[e][l])||a,S=h.useMemo(()=>g,Object.values(g));return c.jsx(y.Provider,{value:S,children:x})}function d(f,p){const x=(p==null?void 0:p[e][l])||a,g=h.useContext(x);if(g)return g;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,d]}const o=()=>{const s=n.map(i=>h.createContext(i));return function(a){const l=(a==null?void 0:a[e])||s;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,kD(o,...t)]}function kD(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function _t(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function so({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=ED({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=_t(n),l=h.useCallback(u=>{if(s){const f=typeof u=="function"?u(e):u;f!==e&&a(f)}else o(u)},[s,e,o,a]);return[i,l]}function ED({defaultProp:e,onChange:t}){const n=h.useState(e),[r]=n,o=h.useRef(r),s=_t(t);return h.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var TD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ve=TD.reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?oo:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ng(e,t){e&&fo.flushSync(()=>e.dispatchEvent(t))}function Ld(e){const t=e+"CollectionProvider",[n,r]=_n(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=x=>{const{scope:g,children:y}=x,S=Oe.useRef(null),v=Oe.useRef(new Map).current;return c.jsx(o,{scope:g,itemMap:v,collectionRef:S,children:y})};i.displayName=t;const a=e+"CollectionSlot",l=Oe.forwardRef((x,g)=>{const{scope:y,children:S}=x,v=s(a,y),m=be(g,v.collectionRef);return c.jsx(oo,{ref:m,children:S})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=Oe.forwardRef((x,g)=>{const{scope:y,children:S,...v}=x,m=Oe.useRef(null),w=be(g,m),b=s(u,y);return Oe.useEffect(()=>(b.itemMap.set(m,{ref:m,...v}),()=>void b.itemMap.delete(m))),c.jsx(oo,{[d]:"",ref:w,children:S})});f.displayName=u;function p(x){const g=s(e+"CollectionConsumer",x);return Oe.useCallback(()=>{const S=g.collectionRef.current;if(!S)return[];const v=Array.from(S.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((b,C)=>v.indexOf(b.ref.current)-v.indexOf(C.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:i,Slot:l,ItemSlot:f},p,r]}var RD=h.createContext(void 0);function Yl(e){const t=h.useContext(RD);return e||t||"ltr"}function ND(e,t=globalThis==null?void 0:globalThis.document){const n=_t(e);h.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var PD="DismissableLayer",wp="dismissableLayer.update",jD="dismissableLayer.pointerDownOutside",DD="dismissableLayer.focusOutside",yx,i_=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ji=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,u=h.useContext(i_),[d,f]=h.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=h.useState({}),g=be(t,R=>f(R)),y=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=y.indexOf(S),m=d?y.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,b=m>=v,C=OD(R=>{const N=R.target,D=[...u.branches].some(O=>O.contains(N));!b||D||(o==null||o(R),i==null||i(R),R.defaultPrevented||a==null||a())},p),_=AD(R=>{const N=R.target;[...u.branches].some(O=>O.contains(N))||(s==null||s(R),i==null||i(R),R.defaultPrevented||a==null||a())},p);return ND(R=>{m===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},p),h.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(yx=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),xx(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=yx)}},[d,p,n,u]),h.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),xx())},[d,u]),h.useEffect(()=>{const R=()=>x({});return document.addEventListener(wp,R),()=>document.removeEventListener(wp,R)},[]),c.jsx(ve.div,{...l,ref:g,style:{pointerEvents:w?b?"auto":"none":void 0,...e.style},onFocusCapture:G(e.onFocusCapture,_.onFocusCapture),onBlurCapture:G(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:G(e.onPointerDownCapture,C.onPointerDownCapture)})});Ji.displayName=PD;var MD="DismissableLayerBranch",a_=h.forwardRef((e,t)=>{const n=h.useContext(i_),r=h.useRef(null),o=be(t,r);return h.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(ve.div,{...e,ref:o})});a_.displayName=MD;function OD(e,t=globalThis==null?void 0:globalThis.document){const n=_t(e),r=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){l_(jD,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function AD(e,t=globalThis==null?void 0:globalThis.document){const n=_t(e),r=h.useRef(!1);return h.useEffect(()=>{const o=s=>{s.target&&!r.current&&l_(DD,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function xx(){const e=new CustomEvent(wp);document.dispatchEvent(e)}function l_(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ng(o,s):o.dispatchEvent(s)}var ID=Ji,LD=a_,eh=0;function rg(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??wx()),document.body.insertAdjacentElement("beforeend",e[1]??wx()),eh++,()=>{eh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),eh--}},[])}function wx(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var th="focusScope.autoFocusOnMount",nh="focusScope.autoFocusOnUnmount",Sx={bubbles:!1,cancelable:!0},FD="FocusScope",Fd=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,l]=h.useState(null),u=_t(o),d=_t(s),f=h.useRef(null),p=be(t,y=>l(y)),x=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let y=function(w){if(x.paused||!a)return;const b=w.target;a.contains(b)?f.current=b:To(f.current,{select:!0})},S=function(w){if(x.paused||!a)return;const b=w.relatedTarget;b!==null&&(a.contains(b)||To(f.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&To(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",S);const m=new MutationObserver(v);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",S),m.disconnect()}}},[r,a,x.paused]),h.useEffect(()=>{if(a){bx.add(x);const y=document.activeElement;if(!a.contains(y)){const v=new CustomEvent(th,Sx);a.addEventListener(th,u),a.dispatchEvent(v),v.defaultPrevented||(UD(YD(c_(a)),{select:!0}),document.activeElement===y&&To(a))}return()=>{a.removeEventListener(th,u),setTimeout(()=>{const v=new CustomEvent(nh,Sx);a.addEventListener(nh,d),a.dispatchEvent(v),v.defaultPrevented||To(y??document.body,{select:!0}),a.removeEventListener(nh,d),bx.remove(x)},0)}}},[a,u,d,x]);const g=h.useCallback(y=>{if(!n&&!r||x.paused)return;const S=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,v=document.activeElement;if(S&&v){const m=y.currentTarget,[w,b]=$D(m);w&&b?!y.shiftKey&&v===b?(y.preventDefault(),n&&To(w,{select:!0})):y.shiftKey&&v===w&&(y.preventDefault(),n&&To(b,{select:!0})):v===m&&y.preventDefault()}},[n,r,x.paused]);return c.jsx(ve.div,{tabIndex:-1,...i,ref:p,onKeyDown:g})});Fd.displayName=FD;function UD(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(To(r,{select:t}),document.activeElement!==n)return}function $D(e){const t=c_(e),n=_x(t,e),r=_x(t.reverse(),e);return[n,r]}function c_(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _x(e,t){for(const n of e)if(!VD(n,{upTo:t}))return n}function VD(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 zD(e){return e instanceof HTMLInputElement&&"select"in e}function To(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&zD(e)&&t&&e.select()}}var bx=WD();function WD(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Cx(e,t),e.unshift(t)},remove(t){var n;e=Cx(e,t),(n=e[0])==null||n.resume()}}}function Cx(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function YD(e){return e.filter(t=>t.tagName!=="A")}var Kt=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},HD=kw.useId||(()=>{}),BD=0;function Tr(e){const[t,n]=h.useState(HD());return Kt(()=>{n(r=>r??String(BD++))},[e]),t?`radix-${t}`:""}const GD=["top","right","bottom","left"],br=Math.min,Rn=Math.max,Wu=Math.round,Ic=Math.floor,Zo=e=>({x:e,y:e}),KD={left:"right",right:"left",bottom:"top",top:"bottom"},ZD={start:"end",end:"start"};function Sp(e,t,n){return Rn(e,br(t,n))}function io(e,t){return typeof e=="function"?e(t):e}function ao(e){return e.split("-")[0]}function ea(e){return e.split("-")[1]}function og(e){return e==="x"?"y":"x"}function sg(e){return e==="y"?"height":"width"}function qo(e){return["top","bottom"].includes(ao(e))?"y":"x"}function ig(e){return og(qo(e))}function qD(e,t,n){n===void 0&&(n=!1);const r=ea(e),o=ig(e),s=sg(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Yu(i)),[i,Yu(i)]}function XD(e){const t=Yu(e);return[_p(e),t,_p(t)]}function _p(e){return e.replace(/start|end/g,t=>ZD[t])}function QD(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function JD(e,t,n,r){const o=ea(e);let s=QD(ao(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(_p)))),s}function Yu(e){return e.replace(/left|right|bottom|top/g,t=>KD[t])}function eM(e){return{top:0,right:0,bottom:0,left:0,...e}}function u_(e){return typeof e!="number"?eM(e):{top:e,right:e,bottom:e,left:e}}function Hu(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function kx(e,t,n){let{reference:r,floating:o}=e;const s=qo(t),i=ig(t),a=sg(i),l=ao(t),u=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let x;switch(l){case"top":x={x:d,y:r.y-o.height};break;case"bottom":x={x:d,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:f};break;case"left":x={x:r.x-o.width,y:f};break;default:x={x:r.x,y:r.y}}switch(ea(t)){case"start":x[i]-=p*(n&&u?-1:1);break;case"end":x[i]+=p*(n&&u?-1:1);break}return x}const tM=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=kx(u,r,l),p=r,x={},g=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:u,padding:d=0}=io(e,t)||{};if(u==null)return{};const f=u_(d),p={x:n,y:r},x=ig(o),g=sg(x),y=await i.getDimensions(u),S=x==="y",v=S?"top":"left",m=S?"bottom":"right",w=S?"clientHeight":"clientWidth",b=s.reference[g]+s.reference[x]-p[x]-s.floating[g],C=p[x]-s.reference[x],_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let R=_?_[w]:0;(!R||!await(i.isElement==null?void 0:i.isElement(_)))&&(R=a.floating[w]||s.floating[g]);const N=b/2-C/2,D=R/2-y[g]/2-1,O=br(f[v],D),B=br(f[m],D),A=O,H=R-y[g]-B,L=R/2-y[g]/2+N,K=Sp(A,L,H),ne=!l.arrow&&ea(o)!=null&&L!==K&&s.reference[g]/2-(LL<=0)){var B,A;const L=(((B=s.flip)==null?void 0:B.index)||0)+1,K=R[L];if(K)return{data:{index:L,overflows:O},reset:{placement:K}};let ne=(A=O.filter(W=>W.overflows[0]<=0).sort((W,F)=>W.overflows[1]-F.overflows[1])[0])==null?void 0:A.placement;if(!ne)switch(x){case"bestFit":{var H;const W=(H=O.filter(F=>{if(_){const M=qo(F.placement);return M===m||M==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(M=>M>0).reduce((M,X)=>M+X,0)]).sort((F,M)=>F[1]-M[1])[0])==null?void 0:H[0];W&&(ne=W);break}case"initialPlacement":ne=a;break}if(o!==ne)return{reset:{placement:ne}}}return{}}}};function Ex(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Tx(e){return GD.some(t=>e[t]>=0)}const oM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=io(e,t);switch(r){case"referenceHidden":{const s=await pl(t,{...o,elementContext:"reference"}),i=Ex(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Tx(i)}}}case"escaped":{const s=await pl(t,{...o,altBoundary:!0}),i=Ex(s,n.floating);return{data:{escapedOffsets:i,escaped:Tx(i)}}}default:return{}}}}};async function sM(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ao(n),a=ea(n),l=qo(n)==="y",u=["left","top"].includes(i)?-1:1,d=s&&l?-1:1,f=io(t,e);let{mainAxis:p,crossAxis:x,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof g=="number"&&(x=a==="end"?g*-1:g),l?{x:x*d,y:p*u}:{x:p*u,y:x*d}}const iM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await sM(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},aM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:S=>{let{x:v,y:m}=S;return{x:v,y:m}}},...l}=io(e,t),u={x:n,y:r},d=await pl(t,l),f=qo(ao(o)),p=og(f);let x=u[p],g=u[f];if(s){const S=p==="y"?"top":"left",v=p==="y"?"bottom":"right",m=x+d[S],w=x-d[v];x=Sp(m,x,w)}if(i){const S=f==="y"?"top":"left",v=f==="y"?"bottom":"right",m=g+d[S],w=g-d[v];g=Sp(m,g,w)}const y=a.fn({...t,[p]:x,[f]:g});return{...y,data:{x:y.x-n,y:y.y-r}}}}},lM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=io(e,t),d={x:n,y:r},f=qo(o),p=og(f);let x=d[p],g=d[f];const y=io(a,t),S=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const w=p==="y"?"height":"width",b=s.reference[p]-s.floating[w]+S.mainAxis,C=s.reference[p]+s.reference[w]-S.mainAxis;xC&&(x=C)}if(u){var v,m;const w=p==="y"?"width":"height",b=["top","left"].includes(ao(o)),C=s.reference[f]-s.floating[w]+(b&&((v=i.offset)==null?void 0:v[f])||0)+(b?0:S.crossAxis),_=s.reference[f]+s.reference[w]+(b?0:((m=i.offset)==null?void 0:m[f])||0)-(b?S.crossAxis:0);g_&&(g=_)}return{[p]:x,[f]:g}}}},cM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...a}=io(e,t),l=await pl(t,a),u=ao(n),d=ea(n),f=qo(n)==="y",{width:p,height:x}=r.floating;let g,y;u==="top"||u==="bottom"?(g=u,y=d===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(y=u,g=d==="end"?"top":"bottom");const S=x-l.top-l.bottom,v=p-l.left-l.right,m=br(x-l[g],S),w=br(p-l[y],v),b=!t.middlewareData.shift;let C=m,_=w;if(f?_=d||b?br(w,v):v:C=d||b?br(m,S):S,b&&!d){const N=Rn(l.left,0),D=Rn(l.right,0),O=Rn(l.top,0),B=Rn(l.bottom,0);f?_=p-2*(N!==0||D!==0?N+D:Rn(l.left,l.right)):C=x-2*(O!==0||B!==0?O+B:Rn(l.top,l.bottom))}await i({...t,availableWidth:_,availableHeight:C});const R=await o.getDimensions(s.floating);return p!==R.width||x!==R.height?{reset:{rects:!0}}:{}}}};function ta(e){return d_(e)?(e.nodeName||"").toLowerCase():"#document"}function jn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mo(e){var t;return(t=(d_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function d_(e){return e instanceof Node||e instanceof jn(e).Node}function cr(e){return e instanceof Element||e instanceof jn(e).Element}function Nr(e){return e instanceof HTMLElement||e instanceof jn(e).HTMLElement}function Rx(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof jn(e).ShadowRoot}function Hl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ur(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function uM(e){return["table","td","th"].includes(ta(e))}function Ud(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ag(e){const t=lg(),n=cr(e)?ur(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function dM(e){let t=Xo(e);for(;Nr(t)&&!Vi(t);){if(ag(t))return t;if(Ud(t))return null;t=Xo(t)}return null}function lg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Vi(e){return["html","body","#document"].includes(ta(e))}function ur(e){return jn(e).getComputedStyle(e)}function $d(e){return cr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xo(e){if(ta(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Rx(e)&&e.host||mo(e);return Rx(t)?t.host:t}function f_(e){const t=Xo(e);return Vi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Nr(t)&&Hl(t)?t:f_(t)}function ml(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=f_(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=jn(o);return s?t.concat(i,i.visualViewport||[],Hl(o)?o:[],i.frameElement&&n?ml(i.frameElement):[]):t.concat(o,ml(o,[],n))}function h_(e){const t=ur(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Nr(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Wu(n)!==s||Wu(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function cg(e){return cr(e)?e:e.contextElement}function Ei(e){const t=cg(e);if(!Nr(t))return Zo(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=h_(t);let i=(s?Wu(n.width):n.width)/r,a=(s?Wu(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const fM=Zo(0);function p_(e){const t=jn(e);return!lg()||!t.visualViewport?fM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==jn(e)?!1:t}function Os(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=cg(e);let i=Zo(1);t&&(r?cr(r)&&(i=Ei(r)):i=Ei(e));const a=hM(s,n,r)?p_(s):Zo(0);let l=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const p=jn(s),x=r&&cr(r)?jn(r):r;let g=p,y=g.frameElement;for(;y&&r&&x!==g;){const S=Ei(y),v=y.getBoundingClientRect(),m=ur(y),w=v.left+(y.clientLeft+parseFloat(m.paddingLeft))*S.x,b=v.top+(y.clientTop+parseFloat(m.paddingTop))*S.y;l*=S.x,u*=S.y,d*=S.x,f*=S.y,l+=w,u+=b,g=jn(y),y=g.frameElement}}return Hu({width:d,height:f,x:l,y:u})}function pM(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=mo(r),a=t?Ud(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Zo(1);const d=Zo(0),f=Nr(r);if((f||!f&&!s)&&((ta(r)!=="body"||Hl(i))&&(l=$d(r)),Nr(r))){const p=Os(r);u=Ei(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x,y:n.y*u.y-l.scrollTop*u.y+d.y}}function mM(e){return Array.from(e.getClientRects())}function m_(e){return Os(mo(e)).left+$d(e).scrollLeft}function gM(e){const t=mo(e),n=$d(e),r=e.ownerDocument.body,o=Rn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Rn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+m_(e);const a=-n.scrollTop;return ur(r).direction==="rtl"&&(i+=Rn(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function vM(e,t){const n=jn(e),r=mo(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const u=lg();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function yM(e,t){const n=Os(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Nr(e)?Ei(e):Zo(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:i,height:a,x:l,y:u}}function Nx(e,t,n){let r;if(t==="viewport")r=vM(e,n);else if(t==="document")r=gM(mo(e));else if(cr(t))r=yM(t,n);else{const o=p_(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Hu(r)}function g_(e,t){const n=Xo(e);return n===t||!cr(n)||Vi(n)?!1:ur(n).position==="fixed"||g_(n,t)}function xM(e,t){const n=t.get(e);if(n)return n;let r=ml(e,[],!1).filter(a=>cr(a)&&ta(a)!=="body"),o=null;const s=ur(e).position==="fixed";let i=s?Xo(e):e;for(;cr(i)&&!Vi(i);){const a=ur(i),l=ag(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Hl(i)&&!l&&g_(e,i))?r=r.filter(d=>d!==i):o=a,i=Xo(i)}return t.set(e,r),r}function wM(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Ud(t)?[]:xM(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((u,d)=>{const f=Nx(t,d,o);return u.top=Rn(f.top,u.top),u.right=br(f.right,u.right),u.bottom=br(f.bottom,u.bottom),u.left=Rn(f.left,u.left),u},Nx(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function SM(e){const{width:t,height:n}=h_(e);return{width:t,height:n}}function _M(e,t,n){const r=Nr(t),o=mo(t),s=n==="fixed",i=Os(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Zo(0);if(r||!r&&!s)if((ta(t)!=="body"||Hl(o))&&(a=$d(t)),r){const f=Os(t,!0,s,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&(l.x=m_(o));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 rh(e){return ur(e).position==="static"}function Px(e,t){return!Nr(e)||ur(e).position==="fixed"?null:t?t(e):e.offsetParent}function v_(e,t){const n=jn(e);if(Ud(e))return n;if(!Nr(e)){let o=Xo(e);for(;o&&!Vi(o);){if(cr(o)&&!rh(o))return o;o=Xo(o)}return n}let r=Px(e,t);for(;r&&uM(r)&&rh(r);)r=Px(r,t);return r&&Vi(r)&&rh(r)&&!ag(r)?n:r||dM(e)||n}const bM=async function(e){const t=this.getOffsetParent||v_,n=this.getDimensions,r=await n(e.floating);return{reference:_M(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function CM(e){return ur(e).direction==="rtl"}const kM={convertOffsetParentRelativeRectToViewportRelativeRect:pM,getDocumentElement:mo,getClippingRect:wM,getOffsetParent:v_,getElementRects:bM,getClientRects:mM,getDimensions:SM,getScale:Ei,isElement:cr,isRTL:CM};function EM(e,t){let n=null,r;const o=mo(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:d,width:f,height:p}=e.getBoundingClientRect();if(a||t(),!f||!p)return;const x=Ic(d),g=Ic(o.clientWidth-(u+f)),y=Ic(o.clientHeight-(d+p)),S=Ic(u),m={rootMargin:-x+"px "+-g+"px "+-y+"px "+-S+"px",threshold:Rn(0,br(1,l))||1};let w=!0;function b(C){const _=C[0].intersectionRatio;if(_!==l){if(!w)return i();_?i(!1,_):r=setTimeout(()=>{i(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(b,{...m,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,m)}n.observe(e)}return i(!0),s}function TM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=cg(e),d=o||s?[...u?ml(u):[],...ml(t)]:[];d.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const f=u&&a?EM(u,n):null;let p=-1,x=null;i&&(x=new ResizeObserver(v=>{let[m]=v;m&&m.target===u&&x&&(x.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=x)==null||w.observe(t)})),n()}),u&&!l&&x.observe(u),x.observe(t));let g,y=l?Os(e):null;l&&S();function S(){const v=Os(e);y&&(v.x!==y.x||v.y!==y.y||v.width!==y.width||v.height!==y.height)&&n(),y=v,g=requestAnimationFrame(S)}return n(),()=>{var v;d.forEach(m=>{o&&m.removeEventListener("scroll",n),s&&m.removeEventListener("resize",n)}),f==null||f(),(v=x)==null||v.disconnect(),x=null,l&&cancelAnimationFrame(g)}}const RM=iM,NM=aM,PM=rM,jM=cM,DM=oM,jx=nM,MM=lM,OM=(e,t,n)=>{const r=new Map,o={platform:kM,...n},s={...o.platform,_c:r};return tM(e,t,{...o,platform:s})};var au=typeof document<"u"?h.useLayoutEffect:h.useEffect;function Bu(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 n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Bu(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Bu(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function y_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Dx(e,t){const n=y_(e);return Math.round(t*n)/n}function Mx(e){const t=h.useRef(e);return au(()=>{t.current=e}),t}function AM(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,f]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,x]=h.useState(r);Bu(p,r)||x(r);const[g,y]=h.useState(null),[S,v]=h.useState(null),m=h.useCallback(W=>{W!==_.current&&(_.current=W,y(W))},[]),w=h.useCallback(W=>{W!==R.current&&(R.current=W,v(W))},[]),b=s||g,C=i||S,_=h.useRef(null),R=h.useRef(null),N=h.useRef(d),D=l!=null,O=Mx(l),B=Mx(o),A=h.useCallback(()=>{if(!_.current||!R.current)return;const W={placement:t,strategy:n,middleware:p};B.current&&(W.platform=B.current),OM(_.current,R.current,W).then(F=>{const M={...F,isPositioned:!0};H.current&&!Bu(N.current,M)&&(N.current=M,fo.flushSync(()=>{f(M)}))})},[p,t,n,B]);au(()=>{u===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,f(W=>({...W,isPositioned:!1})))},[u]);const H=h.useRef(!1);au(()=>(H.current=!0,()=>{H.current=!1}),[]),au(()=>{if(b&&(_.current=b),C&&(R.current=C),b&&C){if(O.current)return O.current(b,C,A);A()}},[b,C,A,O,D]);const L=h.useMemo(()=>({reference:_,floating:R,setReference:m,setFloating:w}),[m,w]),K=h.useMemo(()=>({reference:b,floating:C}),[b,C]),ne=h.useMemo(()=>{const W={position:n,left:0,top:0};if(!K.floating)return W;const F=Dx(K.floating,d.x),M=Dx(K.floating,d.y);return a?{...W,transform:"translate("+F+"px, "+M+"px)",...y_(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:M}},[n,a,K.floating,d.x,d.y]);return h.useMemo(()=>({...d,update:A,refs:L,elements:K,floatingStyles:ne}),[d,A,L,K,ne])}const IM=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?jx({element:r.current,padding:o}).fn(n):{}:r?jx({element:r,padding:o}).fn(n):{}}}},LM=(e,t)=>({...RM(e),options:[e,t]}),FM=(e,t)=>({...NM(e),options:[e,t]}),UM=(e,t)=>({...MM(e),options:[e,t]}),$M=(e,t)=>({...PM(e),options:[e,t]}),VM=(e,t)=>({...jM(e),options:[e,t]}),zM=(e,t)=>({...DM(e),options:[e,t]}),WM=(e,t)=>({...IM(e),options:[e,t]});var YM="Arrow",x_=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return c.jsx(ve.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});x_.displayName=YM;var HM=x_;function ug(e){const[t,n]=h.useState(void 0);return Kt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var dg="Popper",[w_,na]=_n(dg),[BM,S_]=w_(dg),__=e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null);return c.jsx(BM,{scope:t,anchor:r,onAnchorChange:o,children:n})};__.displayName=dg;var b_="PopperAnchor",C_=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=S_(b_,n),i=h.useRef(null),a=be(t,i);return h.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:c.jsx(ve.div,{...o,ref:a})});C_.displayName=b_;var fg="PopperContent",[GM,KM]=w_(fg),k_=h.forwardRef((e,t)=>{var ce,De,He,$e,Ve,Se;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:x="optimized",onPlaced:g,...y}=e,S=S_(fg,n),[v,m]=h.useState(null),w=be(t,vt=>m(vt)),[b,C]=h.useState(null),_=ug(b),R=(_==null?void 0:_.width)??0,N=(_==null?void 0:_.height)??0,D=r+(s!=="center"?"-"+s:""),O=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},B=Array.isArray(u)?u:[u],A=B.length>0,H={padding:O,boundary:B.filter(qM),altBoundary:A},{refs:L,floatingStyles:K,placement:ne,isPositioned:W,middlewareData:F}=AM({strategy:"fixed",placement:D,whileElementsMounted:(...vt)=>TM(...vt,{animationFrame:x==="always"}),elements:{reference:S.anchor},middleware:[LM({mainAxis:o+N,alignmentAxis:i}),l&&FM({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?UM():void 0,...H}),l&&$M({...H}),VM({...H,apply:({elements:vt,rects:Zt,availableWidth:xo,availableHeight:pn})=>{const{width:wo,height:k}=Zt.reference,P=vt.floating.style;P.setProperty("--radix-popper-available-width",`${xo}px`),P.setProperty("--radix-popper-available-height",`${pn}px`),P.setProperty("--radix-popper-anchor-width",`${wo}px`),P.setProperty("--radix-popper-anchor-height",`${k}px`)}}),b&&WM({element:b,padding:a}),XM({arrowWidth:R,arrowHeight:N}),p&&zM({strategy:"referenceHidden",...H})]}),[M,X]=R_(ne),le=_t(g);Kt(()=>{W&&(le==null||le())},[W,le]);const me=(ce=F.arrow)==null?void 0:ce.x,rt=(De=F.arrow)==null?void 0:De.y,je=((He=F.arrow)==null?void 0:He.centerOffset)!==0,[gt,Ue]=h.useState();return Kt(()=>{v&&Ue(window.getComputedStyle(v).zIndex)},[v]),c.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:W?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:gt,"--radix-popper-transform-origin":[($e=F.transformOrigin)==null?void 0:$e.x,(Ve=F.transformOrigin)==null?void 0:Ve.y].join(" "),...((Se=F.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(GM,{scope:n,placedSide:M,onArrowChange:C,arrowX:me,arrowY:rt,shouldHideArrow:je,children:c.jsx(ve.div,{"data-side":M,"data-align":X,...y,ref:w,style:{...y.style,animation:W?void 0:"none"}})})})});k_.displayName=fg;var E_="PopperArrow",ZM={top:"bottom",right:"left",bottom:"top",left:"right"},T_=h.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=KM(E_,r),i=ZM[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(HM,{...o,ref:n,style:{...o.style,display:"block"}})})});T_.displayName=E_;function qM(e){return e!==null}var XM=e=>({name:"transformOrigin",options:e,fn(t){var S,v,m;const{placement:n,rects:r,middlewareData:o}=t,i=((S=o.arrow)==null?void 0:S.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,d]=R_(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((v=o.arrow)==null?void 0:v.x)??0)+a/2,x=(((m=o.arrow)==null?void 0:m.y)??0)+l/2;let g="",y="";return u==="bottom"?(g=i?f:`${p}px`,y=`${-l}px`):u==="top"?(g=i?f:`${p}px`,y=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,y=i?f:`${x}px`):u==="left"&&(g=`${r.floating.width+l}px`,y=i?f:`${x}px`),{data:{x:g,y}}}});function R_(e){const[t,n="center"]=e.split("-");return[t,n]}var hg=__,pg=C_,mg=k_,gg=T_,QM="Portal",Bl=h.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=h.useState(!1);Kt(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?RS.createPortal(c.jsx(ve.div,{...r,ref:t}),i):null});Bl.displayName=QM;function JM(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var fn=e=>{const{present:t,children:n}=e,r=eO(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),s=be(r.ref,tO(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:s}):null};fn.displayName="Presence";function eO(e){const[t,n]=h.useState(),r=h.useRef({}),o=h.useRef(e),s=h.useRef("none"),i=e?"mounted":"unmounted",[a,l]=JM(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=Lc(r.current);s.current=a==="mounted"?u:"none"},[a]),Kt(()=>{const u=r.current,d=o.current;if(d!==e){const p=s.current,x=Lc(u);e?l("MOUNT"):x==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Kt(()=>{if(t){const u=f=>{const x=Lc(r.current).includes(f.animationName);f.target===t&&x&&fo.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(s.current=Lc(r.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:h.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Lc(e){return(e==null?void 0:e.animationName)||"none"}function tO(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var oh="rovingFocusGroup.onEntryFocus",nO={bubbles:!1,cancelable:!0},Vd="RovingFocusGroup",[bp,N_,rO]=Ld(Vd),[oO,zd]=_n(Vd,[rO]),[sO,iO]=oO(Vd),P_=h.forwardRef((e,t)=>c.jsx(bp.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(bp.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(aO,{...e,ref:t})})}));P_.displayName=Vd;var aO=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=h.useRef(null),x=be(t,p),g=Yl(s),[y=null,S]=so({prop:i,defaultProp:a,onChange:l}),[v,m]=h.useState(!1),w=_t(u),b=N_(n),C=h.useRef(!1),[_,R]=h.useState(0);return h.useEffect(()=>{const N=p.current;if(N)return N.addEventListener(oh,w),()=>N.removeEventListener(oh,w)},[w]),c.jsx(sO,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:y,onItemFocus:h.useCallback(N=>S(N),[S]),onItemShiftTab:h.useCallback(()=>m(!0),[]),onFocusableItemAdd:h.useCallback(()=>R(N=>N+1),[]),onFocusableItemRemove:h.useCallback(()=>R(N=>N-1),[]),children:c.jsx(ve.div,{tabIndex:v||_===0?-1:0,"data-orientation":r,...f,ref:x,style:{outline:"none",...e.style},onMouseDown:G(e.onMouseDown,()=>{C.current=!0}),onFocus:G(e.onFocus,N=>{const D=!C.current;if(N.target===N.currentTarget&&D&&!v){const O=new CustomEvent(oh,nO);if(N.currentTarget.dispatchEvent(O),!O.defaultPrevented){const B=b().filter(ne=>ne.focusable),A=B.find(ne=>ne.active),H=B.find(ne=>ne.id===y),K=[A,H,...B].filter(Boolean).map(ne=>ne.ref.current);M_(K,d)}}C.current=!1}),onBlur:G(e.onBlur,()=>m(!1))})})}),j_="RovingFocusGroupItem",D_=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=Tr(),l=s||a,u=iO(j_,n),d=u.currentTabStopId===l,f=N_(n),{onFocusableItemAdd:p,onFocusableItemRemove:x}=u;return h.useEffect(()=>{if(r)return p(),()=>x()},[r,p,x]),c.jsx(bp.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:c.jsx(ve.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...i,ref:t,onMouseDown:G(e.onMouseDown,g=>{r?u.onItemFocus(l):g.preventDefault()}),onFocus:G(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:G(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const y=uO(g,u.orientation,u.dir);if(y!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let v=f().filter(m=>m.focusable).map(m=>m.ref.current);if(y==="last")v.reverse();else if(y==="prev"||y==="next"){y==="prev"&&v.reverse();const m=v.indexOf(g.currentTarget);v=u.loop?dO(v,m+1):v.slice(m+1)}setTimeout(()=>M_(v))}})})})});D_.displayName=j_;var lO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function cO(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function uO(e,t,n){const r=cO(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return lO[r]}function M_(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function dO(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var O_=P_,A_=D_,fO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xs=new WeakMap,Fc=new WeakMap,Uc={},sh=0,I_=function(e){return e&&(e.host||I_(e.parentNode))},hO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=I_(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},pO=function(e,t,n,r){var o=hO(t,Array.isArray(e)?e:[e]);Uc[n]||(Uc[n]=new WeakMap);var s=Uc[n],i=[],a=new Set,l=new Set(o),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};o.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 x=p.getAttribute(r),g=x!==null&&x!=="false",y=(Xs.get(p)||0)+1,S=(s.get(p)||0)+1;Xs.set(p,y),s.set(p,S),i.push(p),y===1&&g&&Fc.set(p,!0),S===1&&p.setAttribute(n,"true"),g||p.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return d(t),a.clear(),sh++,function(){i.forEach(function(f){var p=Xs.get(f)-1,x=s.get(f)-1;Xs.set(f,p),s.set(f,x),p||(Fc.has(f)||f.removeAttribute(r),Fc.delete(f)),x||f.removeAttribute(n)}),sh--,sh||(Xs=new WeakMap,Xs=new WeakMap,Fc=new WeakMap,Uc={})}},vg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=fO(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),pO(r,o,n,"aria-hidden")):function(){return null}},wr=function(){return wr=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return jO;var t=DO(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},OO=$_(),Ti="data-scroll-locked",AO=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),` - .`.concat(gO,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(a,"px ").concat(r,`; - } - body[`).concat(Ti,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(o,`px; - padding-top: `).concat(s,`px; - padding-right: `).concat(i,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(a,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(lu,` { - right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(cu,` { - margin-right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(lu," .").concat(lu,` { - right: 0 `).concat(r,`; - } - - .`).concat(cu," .").concat(cu,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(Ti,`] { - `).concat(vO,": ").concat(a,`px; - } -`)},Ax=function(){var e=parseInt(document.body.getAttribute(Ti)||"0",10);return isFinite(e)?e:0},IO=function(){h.useEffect(function(){return document.body.setAttribute(Ti,(Ax()+1).toString()),function(){var e=Ax()-1;e<=0?document.body.removeAttribute(Ti):document.body.setAttribute(Ti,e.toString())}},[])},LO=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;IO();var s=h.useMemo(function(){return MO(o)},[o]);return h.createElement(OO,{styles:AO(s,!t,o,n?"":"!important")})},Cp=!1;if(typeof window<"u")try{var $c=Object.defineProperty({},"passive",{get:function(){return Cp=!0,!0}});window.addEventListener("test",$c,$c),window.removeEventListener("test",$c,$c)}catch{Cp=!1}var Qs=Cp?{passive:!1}:!1,FO=function(e){return e.tagName==="TEXTAREA"},V_=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!FO(e)&&n[t]==="visible")},UO=function(e){return V_(e,"overflowY")},$O=function(e){return V_(e,"overflowX")},Ix=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=z_(e,r);if(o){var s=W_(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},VO=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},zO=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},z_=function(e,t){return e==="v"?UO(t):$O(t)},W_=function(e,t){return e==="v"?VO(t):zO(t)},WO=function(e,t){return e==="h"&&t==="rtl"?-1:1},YO=function(e,t,n,r,o){var s=WO(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,l=t.contains(a),u=!1,d=i>0,f=0,p=0;do{var x=W_(e,a),g=x[0],y=x[1],S=x[2],v=y-S-s*g;(g||v)&&z_(e,a)&&(f+=v,p+=g),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||!o)||!d&&(Math.abs(p)<1||!o))&&(u=!0),u},Vc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Lx=function(e){return[e.deltaX,e.deltaY]},Fx=function(e){return e&&"current"in e?e.current:e},HO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},BO=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},GO=0,Js=[];function KO(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(GO++)[0],s=h.useState($_)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=mO([e.lockRef.current],(e.shards||[]).map(Fx),!0).filter(Boolean);return y.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(y,S){if("touches"in y&&y.touches.length===2)return!i.current.allowPinchZoom;var v=Vc(y),m=n.current,w="deltaX"in y?y.deltaX:m[0]-v[0],b="deltaY"in y?y.deltaY:m[1]-v[1],C,_=y.target,R=Math.abs(w)>Math.abs(b)?"h":"v";if("touches"in y&&R==="h"&&_.type==="range")return!1;var N=Ix(R,_);if(!N)return!0;if(N?C=R:(C=R==="v"?"h":"v",N=Ix(R,_)),!N)return!1;if(!r.current&&"changedTouches"in y&&(w||b)&&(r.current=C),!C)return!0;var D=r.current||C;return YO(D,S,y,D==="h"?w:b,!0)},[]),l=h.useCallback(function(y){var S=y;if(!(!Js.length||Js[Js.length-1]!==s)){var v="deltaY"in S?Lx(S):Vc(S),m=t.current.filter(function(C){return C.name===S.type&&(C.target===S.target||S.target===C.shadowParent)&&HO(C.delta,v)})[0];if(m&&m.should){S.cancelable&&S.preventDefault();return}if(!m){var w=(i.current.shards||[]).map(Fx).filter(Boolean).filter(function(C){return C.contains(S.target)}),b=w.length>0?a(S,w[0]):!i.current.noIsolation;b&&S.cancelable&&S.preventDefault()}}},[]),u=h.useCallback(function(y,S,v,m){var w={name:y,delta:S,target:v,should:m,shadowParent:ZO(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(b){return b!==w})},1)},[]),d=h.useCallback(function(y){n.current=Vc(y),r.current=void 0},[]),f=h.useCallback(function(y){u(y.type,Lx(y),y.target,a(y,e.lockRef.current))},[]),p=h.useCallback(function(y){u(y.type,Vc(y),y.target,a(y,e.lockRef.current))},[]);h.useEffect(function(){return Js.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Qs),document.addEventListener("touchmove",l,Qs),document.addEventListener("touchstart",d,Qs),function(){Js=Js.filter(function(y){return y!==s}),document.removeEventListener("wheel",l,Qs),document.removeEventListener("touchmove",l,Qs),document.removeEventListener("touchstart",d,Qs)}},[]);var x=e.removeScrollBar,g=e.inert;return h.createElement(h.Fragment,null,g?h.createElement(s,{styles:BO(o)}):null,x?h.createElement(LO,{gapMode:e.gapMode}):null)}function ZO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const qO=CO(U_,KO);var Yd=h.forwardRef(function(e,t){return h.createElement(Wd,wr({},e,{ref:t,sideCar:qO}))});Yd.classNames=Wd.classNames;var kp=["Enter"," "],XO=["ArrowDown","PageUp","Home"],Y_=["ArrowUp","PageDown","End"],QO=[...XO,...Y_],JO={ltr:[...kp,"ArrowRight"],rtl:[...kp,"ArrowLeft"]},eA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Gl="Menu",[gl,tA,nA]=Ld(Gl),[Vs,H_]=_n(Gl,[nA,na,zd]),Hd=na(),B_=zd(),[rA,zs]=Vs(Gl),[oA,Kl]=Vs(Gl),G_=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=Hd(t),[l,u]=h.useState(null),d=h.useRef(!1),f=_t(s),p=Yl(o);return h.useEffect(()=>{const x=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),c.jsx(hg,{...a,children:c.jsx(rA,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:c.jsx(oA,{scope:t,onClose:h.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:i,children:r})})})};G_.displayName=Gl;var sA="MenuAnchor",yg=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Hd(n);return c.jsx(pg,{...o,...r,ref:t})});yg.displayName=sA;var xg="MenuPortal",[iA,K_]=Vs(xg,{forceMount:void 0}),Z_=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=zs(xg,t);return c.jsx(iA,{scope:t,forceMount:n,children:c.jsx(fn,{present:n||s.open,children:c.jsx(Bl,{asChild:!0,container:o,children:r})})})};Z_.displayName=xg;var Wn="MenuContent",[aA,wg]=Vs(Wn),q_=h.forwardRef((e,t)=>{const n=K_(Wn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=zs(Wn,e.__scopeMenu),i=Kl(Wn,e.__scopeMenu);return c.jsx(gl.Provider,{scope:e.__scopeMenu,children:c.jsx(fn,{present:r||s.open,children:c.jsx(gl.Slot,{scope:e.__scopeMenu,children:i.modal?c.jsx(lA,{...o,ref:t}):c.jsx(cA,{...o,ref:t})})})})}),lA=h.forwardRef((e,t)=>{const n=zs(Wn,e.__scopeMenu),r=h.useRef(null),o=be(t,r);return h.useEffect(()=>{const s=r.current;if(s)return vg(s)},[]),c.jsx(Sg,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:G(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),cA=h.forwardRef((e,t)=>{const n=zs(Wn,e.__scopeMenu);return c.jsx(Sg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Sg=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:x,disableOutsideScroll:g,...y}=e,S=zs(Wn,n),v=Kl(Wn,n),m=Hd(n),w=B_(n),b=tA(n),[C,_]=h.useState(null),R=h.useRef(null),N=be(t,R,S.onContentChange),D=h.useRef(0),O=h.useRef(""),B=h.useRef(0),A=h.useRef(null),H=h.useRef("right"),L=h.useRef(0),K=g?Yd:h.Fragment,ne=g?{as:oo,allowPinchZoom:!0}:void 0,W=M=>{var ce,De;const X=O.current+M,le=b().filter(He=>!He.disabled),me=document.activeElement,rt=(ce=le.find(He=>He.ref.current===me))==null?void 0:ce.textValue,je=le.map(He=>He.textValue),gt=SA(je,X,rt),Ue=(De=le.find(He=>He.textValue===gt))==null?void 0:De.ref.current;(function He($e){O.current=$e,window.clearTimeout(D.current),$e!==""&&(D.current=window.setTimeout(()=>He(""),1e3))})(X),Ue&&setTimeout(()=>Ue.focus())};h.useEffect(()=>()=>window.clearTimeout(D.current),[]),rg();const F=h.useCallback(M=>{var le,me;return H.current===((le=A.current)==null?void 0:le.side)&&bA(M,(me=A.current)==null?void 0:me.area)},[]);return c.jsx(aA,{scope:n,searchRef:O,onItemEnter:h.useCallback(M=>{F(M)&&M.preventDefault()},[F]),onItemLeave:h.useCallback(M=>{var X;F(M)||((X=R.current)==null||X.focus(),_(null))},[F]),onTriggerLeave:h.useCallback(M=>{F(M)&&M.preventDefault()},[F]),pointerGraceTimerRef:B,onPointerGraceIntentChange:h.useCallback(M=>{A.current=M},[]),children:c.jsx(K,{...ne,children:c.jsx(Fd,{asChild:!0,trapped:o,onMountAutoFocus:G(s,M=>{var X;M.preventDefault(),(X=R.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:c.jsx(Ji,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:x,children:c.jsx(O_,{asChild:!0,...w,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:_,onEntryFocus:G(l,M=>{v.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(mg,{role:"menu","aria-orientation":"vertical","data-state":fb(S.open),"data-radix-menu-content":"",dir:v.dir,...m,...y,ref:N,style:{outline:"none",...y.style},onKeyDown:G(y.onKeyDown,M=>{const le=M.target.closest("[data-radix-menu-content]")===M.currentTarget,me=M.ctrlKey||M.altKey||M.metaKey,rt=M.key.length===1;le&&(M.key==="Tab"&&M.preventDefault(),!me&&rt&&W(M.key));const je=R.current;if(M.target!==je||!QO.includes(M.key))return;M.preventDefault();const Ue=b().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);Y_.includes(M.key)&&Ue.reverse(),xA(Ue)}),onBlur:G(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(D.current),O.current="")}),onPointerMove:G(e.onPointerMove,vl(M=>{const X=M.target,le=L.current!==M.clientX;if(M.currentTarget.contains(X)&&le){const me=M.clientX>L.current?"right":"left";H.current=me,L.current=M.clientX}}))})})})})})})});q_.displayName=Wn;var uA="MenuGroup",_g=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(ve.div,{role:"group",...r,ref:t})});_g.displayName=uA;var dA="MenuLabel",X_=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(ve.div,{...r,ref:t})});X_.displayName=dA;var Gu="MenuItem",Ux="menu.itemSelect",Bd=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=h.useRef(null),i=Kl(Gu,e.__scopeMenu),a=wg(Gu,e.__scopeMenu),l=be(t,s),u=h.useRef(!1),d=()=>{const f=s.current;if(!n&&f){const p=new CustomEvent(Ux,{bubbles:!0,cancelable:!0});f.addEventListener(Ux,x=>r==null?void 0:r(x),{once:!0}),ng(f,p),p.defaultPrevented?u.current=!1:i.onClose()}};return c.jsx(Q_,{...o,ref:l,disabled:n,onClick:G(e.onClick,d),onPointerDown:f=>{var p;(p=e.onPointerDown)==null||p.call(e,f),u.current=!0},onPointerUp:G(e.onPointerUp,f=>{var p;u.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:G(e.onKeyDown,f=>{const p=a.searchRef.current!=="";n||p&&f.key===" "||kp.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Bd.displayName=Gu;var Q_=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=wg(Gu,n),a=B_(n),l=h.useRef(null),u=be(t,l),[d,f]=h.useState(!1),[p,x]=h.useState("");return h.useEffect(()=>{const g=l.current;g&&x((g.textContent??"").trim())},[s.children]),c.jsx(gl.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:c.jsx(A_,{asChild:!0,...a,focusable:!r,children:c.jsx(ve.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:G(e.onPointerMove,vl(g=>{r?i.onItemLeave(g):(i.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:G(e.onPointerLeave,vl(g=>i.onItemLeave(g))),onFocus:G(e.onFocus,()=>f(!0)),onBlur:G(e.onBlur,()=>f(!1))})})})}),fA="MenuCheckboxItem",J_=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return c.jsx(ob,{scope:e.__scopeMenu,checked:n,children:c.jsx(Bd,{role:"menuitemcheckbox","aria-checked":Ku(n)?"mixed":n,...o,ref:t,"data-state":Cg(n),onSelect:G(o.onSelect,()=>r==null?void 0:r(Ku(n)?!0:!n),{checkForDefaultPrevented:!1})})})});J_.displayName=fA;var eb="MenuRadioGroup",[hA,pA]=Vs(eb,{value:void 0,onValueChange:()=>{}}),tb=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=_t(r);return c.jsx(hA,{scope:e.__scopeMenu,value:n,onValueChange:s,children:c.jsx(_g,{...o,ref:t})})});tb.displayName=eb;var nb="MenuRadioItem",rb=h.forwardRef((e,t)=>{const{value:n,...r}=e,o=pA(nb,e.__scopeMenu),s=n===o.value;return c.jsx(ob,{scope:e.__scopeMenu,checked:s,children:c.jsx(Bd,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Cg(s),onSelect:G(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});rb.displayName=nb;var bg="MenuItemIndicator",[ob,mA]=Vs(bg,{checked:!1}),sb=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=mA(bg,n);return c.jsx(fn,{present:r||Ku(s.checked)||s.checked===!0,children:c.jsx(ve.span,{...o,ref:t,"data-state":Cg(s.checked)})})});sb.displayName=bg;var gA="MenuSeparator",ib=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(ve.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});ib.displayName=gA;var vA="MenuArrow",ab=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Hd(n);return c.jsx(gg,{...o,...r,ref:t})});ab.displayName=vA;var yA="MenuSub",[o3,lb]=Vs(yA),Pa="MenuSubTrigger",cb=h.forwardRef((e,t)=>{const n=zs(Pa,e.__scopeMenu),r=Kl(Pa,e.__scopeMenu),o=lb(Pa,e.__scopeMenu),s=wg(Pa,e.__scopeMenu),i=h.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,u={__scopeMenu:e.__scopeMenu},d=h.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return h.useEffect(()=>d,[d]),h.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),c.jsx(yg,{asChild:!0,...u,children:c.jsx(Q_,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":fb(n.open),...e,ref:Id(t,o.onTriggerChange),onClick:f=>{var p;(p=e.onClick)==null||p.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:G(e.onPointerMove,vl(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:G(e.onPointerLeave,vl(f=>{var x,g;d();const p=(x=n.content)==null?void 0:x.getBoundingClientRect();if(p){const y=(g=n.content)==null?void 0:g.dataset.side,S=y==="right",v=S?-5:5,m=p[S?"left":"right"],w=p[S?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+v,y:f.clientY},{x:m,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x:m,y:p.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:G(e.onKeyDown,f=>{var x;const p=s.searchRef.current!=="";e.disabled||p&&f.key===" "||JO[r.dir].includes(f.key)&&(n.onOpenChange(!0),(x=n.content)==null||x.focus(),f.preventDefault())})})})});cb.displayName=Pa;var ub="MenuSubContent",db=h.forwardRef((e,t)=>{const n=K_(Wn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=zs(Wn,e.__scopeMenu),i=Kl(Wn,e.__scopeMenu),a=lb(ub,e.__scopeMenu),l=h.useRef(null),u=be(t,l);return c.jsx(gl.Provider,{scope:e.__scopeMenu,children:c.jsx(fn,{present:r||s.open,children:c.jsx(gl.Slot,{scope:e.__scopeMenu,children:c.jsx(Sg,{id:a.contentId,"aria-labelledby":a.triggerId,...o,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:G(e.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:G(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:G(e.onKeyDown,d=>{var x;const f=d.currentTarget.contains(d.target),p=eA[i.dir].includes(d.key);f&&p&&(s.onOpenChange(!1),(x=a.trigger)==null||x.focus(),d.preventDefault())})})})})})});db.displayName=ub;function fb(e){return e?"open":"closed"}function Ku(e){return e==="indeterminate"}function Cg(e){return Ku(e)?"indeterminate":e?"checked":"unchecked"}function xA(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function wA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function SA(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=wA(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const l=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function _A(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;sr!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function bA(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return _A(n,t)}function vl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var CA=G_,kA=yg,EA=Z_,TA=q_,RA=_g,NA=X_,PA=Bd,jA=J_,DA=tb,MA=rb,OA=sb,AA=ib,IA=ab,LA=cb,FA=db,kg="DropdownMenu",[UA,s3]=_n(kg,[H_]),hn=H_(),[$A,hb]=UA(kg),pb=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,l=hn(t),u=h.useRef(null),[d=!1,f]=so({prop:o,defaultProp:s,onChange:i});return c.jsx($A,{scope:t,triggerId:Tr(),triggerRef:u,contentId:Tr(),open:d,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(p=>!p),[f]),modal:a,children:c.jsx(CA,{...l,open:d,onOpenChange:f,dir:r,modal:a,children:n})})};pb.displayName=kg;var mb="DropdownMenuTrigger",gb=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=hb(mb,n),i=hn(n);return c.jsx(kA,{asChild:!0,...i,children:c.jsx(ve.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Id(t,s.triggerRef),onPointerDown:G(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:G(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});gb.displayName=mb;var VA="DropdownMenuPortal",vb=e=>{const{__scopeDropdownMenu:t,...n}=e,r=hn(t);return c.jsx(EA,{...r,...n})};vb.displayName=VA;var yb="DropdownMenuContent",xb=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=hb(yb,n),s=hn(n),i=h.useRef(!1);return c.jsx(TA,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:G(e.onCloseAutoFocus,a=>{var l;i.current||(l=o.triggerRef.current)==null||l.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:G(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;(!o.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)"}})});xb.displayName=yb;var zA="DropdownMenuGroup",WA=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=hn(n);return c.jsx(RA,{...o,...r,ref:t})});WA.displayName=zA;var YA="DropdownMenuLabel",wb=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=hn(n);return c.jsx(NA,{...o,...r,ref:t})});wb.displayName=YA;var HA="DropdownMenuItem",Sb=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=hn(n);return c.jsx(PA,{...o,...r,ref:t})});Sb.displayName=HA;var BA="DropdownMenuCheckboxItem",_b=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=hn(n);return c.jsx(jA,{...o,...r,ref:t})});_b.displayName=BA;var GA="DropdownMenuRadioGroup",KA=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=hn(n);return c.jsx(DA,{...o,...r,ref:t})});KA.displayName=GA;var ZA="DropdownMenuRadioItem",bb=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=hn(n);return c.jsx(MA,{...o,...r,ref:t})});bb.displayName=ZA;var qA="DropdownMenuItemIndicator",Cb=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=hn(n);return c.jsx(OA,{...o,...r,ref:t})});Cb.displayName=qA;var XA="DropdownMenuSeparator",kb=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=hn(n);return c.jsx(AA,{...o,...r,ref:t})});kb.displayName=XA;var QA="DropdownMenuArrow",JA=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=hn(n);return c.jsx(IA,{...o,...r,ref:t})});JA.displayName=QA;var eI="DropdownMenuSubTrigger",Eb=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=hn(n);return c.jsx(LA,{...o,...r,ref:t})});Eb.displayName=eI;var tI="DropdownMenuSubContent",Tb=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=hn(n);return c.jsx(FA,{...o,...r,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)"}})});Tb.displayName=tI;var nI=pb,rI=gb,oI=vb,Rb=xb,Nb=wb,Pb=Sb,jb=_b,Db=bb,Mb=Cb,Ob=kb,Ab=Eb,Ib=Tb;const sI=nI,iI=rI,aI=h.forwardRef(({className:e,inset:t,children:n,...r},o)=>c.jsxs(Ab,{ref:o,className:se("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),...r,children:[n,c.jsx(Oj,{className:"ml-auto h-4 w-4"})]}));aI.displayName=Ab.displayName;const lI=h.forwardRef(({className:e,...t},n)=>c.jsx(Ib,{ref:n,className:se("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}));lI.displayName=Ib.displayName;const Lb=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(oI,{children:c.jsx(Rb,{ref:r,sideOffset:t,className:se("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),...n})}));Lb.displayName=Rb.displayName;const Fb=h.forwardRef(({className:e,inset:t,...n},r)=>c.jsx(Pb,{ref:r,className:se("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),...n}));Fb.displayName=Pb.displayName;const cI=h.forwardRef(({className:e,children:t,checked:n,...r},o)=>c.jsxs(jb,{ref:o,className:se("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:n,...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Mb,{children:c.jsx(KS,{className:"h-4 w-4"})})}),t]}));cI.displayName=jb.displayName;const uI=h.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(Db,{ref:r,className:se("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),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Mb,{children:c.jsx(QS,{className:"h-2 w-2 fill-current"})})}),t]}));uI.displayName=Db.displayName;const Ub=h.forwardRef(({className:e,inset:t,...n},r)=>c.jsx(Nb,{ref:r,className:se("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Ub.displayName=Nb.displayName;const $b=h.forwardRef(({className:e,...t},n)=>c.jsx(Ob,{ref:n,className:se("-mx-1 my-1 h-px bg-muted",e),...t}));$b.displayName=Ob.displayName;var Eg="Dialog",[Vb,zb]=_n(Eg),[dI,pr]=Vb(Eg),Wb=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=h.useRef(null),l=h.useRef(null),[u=!1,d]=so({prop:r,defaultProp:o,onChange:s});return c.jsx(dI,{scope:t,triggerRef:a,contentRef:l,contentId:Tr(),titleId:Tr(),descriptionId:Tr(),open:u,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(f=>!f),[d]),modal:i,children:n})};Wb.displayName=Eg;var Yb="DialogTrigger",Hb=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=pr(Yb,n),s=be(t,o.triggerRef);return c.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ng(o.open),...r,ref:s,onClick:G(e.onClick,o.onOpenToggle)})});Hb.displayName=Yb;var Tg="DialogPortal",[fI,Bb]=Vb(Tg,{forceMount:void 0}),Gb=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=pr(Tg,t);return c.jsx(fI,{scope:t,forceMount:n,children:h.Children.map(r,i=>c.jsx(fn,{present:n||s.open,children:c.jsx(Bl,{asChild:!0,container:o,children:i})}))})};Gb.displayName=Tg;var Zu="DialogOverlay",Kb=h.forwardRef((e,t)=>{const n=Bb(Zu,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=pr(Zu,e.__scopeDialog);return s.modal?c.jsx(fn,{present:r||s.open,children:c.jsx(hI,{...o,ref:t})}):null});Kb.displayName=Zu;var hI=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=pr(Zu,n);return c.jsx(Yd,{as:oo,allowPinchZoom:!0,shards:[o.contentRef],children:c.jsx(ve.div,{"data-state":Ng(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),As="DialogContent",Zb=h.forwardRef((e,t)=>{const n=Bb(As,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=pr(As,e.__scopeDialog);return c.jsx(fn,{present:r||s.open,children:s.modal?c.jsx(pI,{...o,ref:t}):c.jsx(mI,{...o,ref:t})})});Zb.displayName=As;var pI=h.forwardRef((e,t)=>{const n=pr(As,e.__scopeDialog),r=h.useRef(null),o=be(t,n.contentRef,r);return h.useEffect(()=>{const s=r.current;if(s)return vg(s)},[]),c.jsx(qb,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:G(e.onFocusOutside,s=>s.preventDefault())})}),mI=h.forwardRef((e,t)=>{const n=pr(As,e.__scopeDialog),r=h.useRef(!1),o=h.useRef(!1);return c.jsx(qb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),qb=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=pr(As,n),l=h.useRef(null),u=be(t,l);return rg(),c.jsxs(c.Fragment,{children:[c.jsx(Fd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:c.jsx(Ji,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Ng(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(vI,{titleId:a.titleId}),c.jsx(xI,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Rg="DialogTitle",Xb=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=pr(Rg,n);return c.jsx(ve.h2,{id:o.titleId,...r,ref:t})});Xb.displayName=Rg;var Qb="DialogDescription",Jb=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=pr(Qb,n);return c.jsx(ve.p,{id:o.descriptionId,...r,ref:t})});Jb.displayName=Qb;var e1="DialogClose",t1=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=pr(e1,n);return c.jsx(ve.button,{type:"button",...r,ref:t,onClick:G(e.onClick,()=>o.onOpenChange(!1))})});t1.displayName=e1;function Ng(e){return e?"open":"closed"}var n1="DialogTitleWarning",[gI,r1]=CD(n1,{contentName:As,titleName:Rg,docsSlug:"dialog"}),vI=({titleId:e})=>{const t=r1(n1),n=`\`${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 h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},yI="DialogDescriptionWarning",xI=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r1(yI).contentName}}.`;return h.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Pg=Wb,jg=Hb,Dg=Gb,Zl=Kb,ql=Zb,Xl=Xb,Ql=Jb,Gd=t1;const o1=Pg,s1=jg,wI=Dg,i1=h.forwardRef(({className:e,...t},n)=>c.jsx(Zl,{className:se("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:n}));i1.displayName=Zl.displayName;const SI=Wl("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"}}),Mg=h.forwardRef(({side:e="right",className:t,children:n,...r},o)=>c.jsxs(wI,{children:[c.jsx(i1,{}),c.jsxs(ql,{ref:o,className:se(SI({side:e}),t),...r,children:[n,c.jsxs(Gd,{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(Qm,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Mg.displayName=ql.displayName;const a1=({className:e,...t})=>c.jsx("div",{className:se("flex flex-col space-y-2 text-center sm:text-left",e),...t});a1.displayName="SheetHeader";const l1=h.forwardRef(({className:e,...t},n)=>c.jsx(Xl,{ref:n,className:se("text-lg font-semibold text-foreground",e),...t}));l1.displayName=Xl.displayName;const _I=h.forwardRef(({className:e,...t},n)=>c.jsx(Ql,{ref:n,className:se("text-sm text-muted-foreground",e),...t}));_I.displayName=Ql.displayName;class Dn extends Error{constructor(t){var n,r,o,s;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Dn.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 Dn||(this.originalError=t),typeof DOMException<"u"&&t instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(n=this.response)==null?void 0:n.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.":(s=(o=(r=this.originalError)==null?void 0:r.cause)==null?void 0:o.message)!=null&&s.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 zc=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function bI(e,t){const n={};if(typeof e!="string")return n;const r=Object.assign({},{}).decode||CI;let o=0;for(;o0&&(!n.exp||n.exp-t>Date.now()/1e3))}c1=typeof atob!="function"||EI?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 n,r,o=0,s=0,i="";r=t.charAt(s++);~r&&(n=o%4?64*n+r:r,o++%4)?i+=String.fromCharCode(255&n>>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return i}:atob;const Vx="pb_auth";class TI{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!u1(this.token)}get isAdmin(){return Ri(this.token).type==="admin"}get isAuthRecord(){return Ri(this.token).type==="authRecord"}save(t,n){this.baseToken=t||"",this.baseModel=n||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(t,n=Vx){const r=bI(t||"")[n]||"";let o={};try{o=JSON.parse(r),(typeof o===null||typeof o!="object"||Array.isArray(o))&&(o={})}catch{}this.save(o.token||"",o.model||null)}exportToCookie(t,n=Vx){var l,u;const r={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},o=Ri(this.token);r.expires=o!=null&&o.exp?new Date(1e3*o.exp):new Date("1970-01-01"),t=Object.assign({},r,t);const s={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let i=$x(n,JSON.stringify(s),t);const a=typeof Blob<"u"?new Blob([i]).size:i.length;if(s.model&&a>4096){s.model={id:(l=s==null?void 0:s.model)==null?void 0:l.id,email:(u=s==null?void 0:s.model)==null?void 0:u.email};const d=["collectionId","username","verified"];for(const f in this.model)d.includes(f)&&(s.model[f]=this.model[f]);i=$x(n,JSON.stringify(s),t)}return i}onChange(t,n=!1){return this._onChangeCallbacks.push(t),n&&t(this.token,this.model),()=>{for(let r=this._onChangeCallbacks.length-1;r>=0;r--)if(this._onChangeCallbacks[r]==t)return delete this._onChangeCallbacks[r],void this._onChangeCallbacks.splice(r,1)}}triggerChange(){for(const t of this._onChangeCallbacks)t&&t(this.token,this.model)}}class RI extends TI{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,n){this._storageSet(this.storageKey,{token:t,model:n}),super.save(t,n)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(t){if(typeof window<"u"&&(window!=null&&window.localStorage)){const n=window.localStorage.getItem(t)||"";try{return JSON.parse(n)}catch{return n}}return this.storageFallback[t]}_storageSet(t,n){if(typeof window<"u"&&(window!=null&&window.localStorage)){let r=n;typeof n!="string"&&(r=JSON.stringify(n)),window.localStorage.setItem(t,r)}else this.storageFallback[t]=n}_storageRemove(t){var n;typeof window<"u"&&(window!=null&&window.localStorage)&&((n=window.localStorage)==null||n.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 n=this._storageGet(this.storageKey)||{};super.save(n.token||"",n.model||null)})}}class Ws{constructor(t){this.client=t}}class NI extends Ws{async getAll(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/settings",t)}async update(t,n){return n=Object.assign({method:"PATCH",body:t},n),this.client.send("/api/settings",n)}async testS3(t="storage",n){return n=Object.assign({method:"POST",body:{filesystem:t}},n),this.client.send("/api/settings/test/s3",n).then(()=>!0)}async testEmail(t,n,r){return r=Object.assign({method:"POST",body:{email:t,template:n}},r),this.client.send("/api/settings/test/email",r).then(()=>!0)}async generateAppleClientSecret(t,n,r,o,s,i){return i=Object.assign({method:"POST",body:{clientId:t,teamId:n,keyId:r,privateKey:o,duration:s}},i),this.client.send("/api/settings/apple/generate-client-secret",i)}}class Og extends Ws{decode(t){return t}async getFullList(t,n){if(typeof t=="number")return this._getFullList(t,n);let r=500;return(n=Object.assign({},t,n)).batch&&(r=n.batch,delete n.batch),this._getFullList(r,n)}async getList(t=1,n=30,r){return(r=Object.assign({method:"GET"},r)).query=Object.assign({page:t,perPage:n},r.query),this.client.send(this.baseCrudPath,r).then(o=>{var s;return o.items=((s=o.items)==null?void 0:s.map(i=>this.decode(i)))||[],o})}async getFirstListItem(t,n){return(n=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+t},n)).query=Object.assign({filter:t,skipTotal:1},n.query),this.getList(1,1,n).then(r=>{var o;if(!((o=r==null?void 0:r.items)!=null&&o.length))throw new Dn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return r.items[0]})}async getOne(t,n){if(!t)throw new Dn({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return n=Object.assign({method:"GET"},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),n).then(r=>this.decode(r))}async create(t,n){return n=Object.assign({method:"POST",body:t},n),this.client.send(this.baseCrudPath,n).then(r=>this.decode(r))}async update(t,n,r){return r=Object.assign({method:"PATCH",body:n},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(o=>this.decode(o))}async delete(t,n){return n=Object.assign({method:"DELETE"},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),n).then(()=>!0)}_getFullList(t=500,n){(n=n||{}).query=Object.assign({skipTotal:1},n.query);let r=[],o=async s=>this.getList(s,t||500,n).then(i=>{const a=i.items;return r=r.concat(a),a.length==i.perPage?o(s+1):r});return o(1)}}function Cn(e,t,n,r){const o=r!==void 0;return o||n!==void 0?o?(console.warn(e),t.body=Object.assign({},t.body,n),t.query=Object.assign({},t.query,r),t):Object.assign(t,n):t}function ch(e){var t;(t=e._resetAutoRefresh)==null||t.call(e)}class PI extends Og{get baseCrudPath(){return"/api/admins"}async update(t,n,r){return super.update(t,n,r).then(o=>{var s,i;return((s=this.client.authStore.model)==null?void 0:s.id)===o.id&&((i=this.client.authStore.model)==null?void 0:i.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,o),o})}async delete(t,n){return super.delete(t,n).then(r=>{var o,s;return r&&((o=this.client.authStore.model)==null?void 0:o.id)===t&&((s=this.client.authStore.model)==null?void 0:s.collectionId)===void 0&&this.client.authStore.clear(),r})}authResponse(t){const n=this.decode((t==null?void 0:t.admin)||{});return t!=null&&t.token&&(t!=null&&t.admin)&&this.client.authStore.save(t.token,n),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:n})}async authWithPassword(t,n,r,o){let s={method:"POST",body:{identity:t,password:n}};s=Cn("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",s,r,o);const i=s.autoRefreshThreshold;delete s.autoRefreshThreshold,s.autoRefresh||ch(this.client);let a=await this.client.send(this.baseCrudPath+"/auth-with-password",s);return a=this.authResponse(a),i&&function(u,d,f,p){ch(u);const x=u.beforeSend,g=u.authStore.model,y=u.authStore.onChange((S,v)=>{(!S||(v==null?void 0:v.id)!=(g==null?void 0:g.id)||(v!=null&&v.collectionId||g!=null&&g.collectionId)&&(v==null?void 0:v.collectionId)!=(g==null?void 0:g.collectionId))&&ch(u)});u._resetAutoRefresh=function(){y(),u.beforeSend=x,delete u._resetAutoRefresh},u.beforeSend=async(S,v)=>{var C;const m=u.authStore.token;if((C=v.query)!=null&&C.autoRefresh)return x?x(S,v):{url:S,sendOptions:v};let w=u.authStore.isValid;if(w&&u1(u.authStore.token,d))try{await f()}catch{w=!1}w||await p();const b=v.headers||{};for(let _ in b)if(_.toLowerCase()=="authorization"&&m==b[_]&&u.authStore.token){b[_]=u.authStore.token;break}return v.headers=b,x?x(S,v):{url:S,sendOptions:v}}}(this.client,i,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(t,n,Object.assign({autoRefresh:!0},s))),a}async authRefresh(t,n){let r={method:"POST"};return r=Cn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",r,t,n),this.client.send(this.baseCrudPath+"/auth-refresh",r).then(this.authResponse.bind(this))}async requestPasswordReset(t,n,r){let o={method:"POST",body:{email:t}};return o=Cn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",o,n,r),this.client.send(this.baseCrudPath+"/request-password-reset",o).then(()=>!0)}async confirmPasswordReset(t,n,r,o,s){let i={method:"POST",body:{token:t,password:n,passwordConfirm:r}};return i=Cn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",i,o,s),this.client.send(this.baseCrudPath+"/confirm-password-reset",i).then(()=>!0)}}const jI=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function d1(e){if(e){e.query=e.query||{};for(let t in e)jI.includes(t)||(e.query[t]=e[t],delete e[t])}}class f1 extends Ws{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,n,r){var i;if(!t)throw new Error("topic must be set.");let o=t;if(r){d1(r);const a="options="+encodeURIComponent(JSON.stringify({query:r.query,headers:r.headers}));o+=(o.includes("?")?"&":"?")+a}const s=function(a){const l=a;let u;try{u=JSON.parse(l==null?void 0:l.data)}catch{}n(u||{})};return this.subscriptions[o]||(this.subscriptions[o]=[]),this.subscriptions[o].push(s),this.isConnected?this.subscriptions[o].length===1?await this.submitSubscriptions():(i=this.eventSource)==null||i.addEventListener(o,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(t,s)}async unsubscribe(t){var r;let n=!1;if(t){const o=this.getSubscriptionsByTopic(t);for(let s in o)if(this.hasSubscriptionListeners(s)){for(let i of this.subscriptions[s])(r=this.eventSource)==null||r.removeEventListener(s,i);delete this.subscriptions[s],n||(n=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?n&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(t){var r;let n=!1;for(let o in this.subscriptions)if((o+"?").startsWith(t)){n=!0;for(let s of this.subscriptions[o])(r=this.eventSource)==null||r.removeEventListener(o,s);delete this.subscriptions[o]}n&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(t,n){var s;let r=!1;const o=this.getSubscriptionsByTopic(t);for(let i in o){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]===n&&(a=!0,delete this.subscriptions[i][l],this.subscriptions[i].splice(l,1),(s=this.eventSource)==null||s.removeEventListener(i,n));a&&(this.subscriptions[i].length||delete this.subscriptions[i],r||this.hasSubscriptionListeners(i)||(r=!0))}this.hasSubscriptionListeners()?r&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(t){var n,r;if(this.subscriptions=this.subscriptions||{},t)return!!((n=this.subscriptions[t])!=null&&n.length);for(let o in this.subscriptions)if((r=this.subscriptions[o])!=null&&r.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 n={};t=t.includes("?")?t:t+"?";for(let r in this.subscriptions)(r+"?").startsWith(t)&&(n[r]=this.subscriptions[r]);return n}getNonEmptySubscriptionKeys(){const t=[];for(let n in this.subscriptions)this.subscriptions[n].length&&t.push(n);return t}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let t in this.subscriptions)for(let n of this.subscriptions[t])this.eventSource.addEventListener(t,n)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let t in this.subscriptions)for(let n of this.subscriptions[t])this.eventSource.removeEventListener(t,n)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((t,n)=>{this.pendingConnects.push({resolve:t,reject:n}),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 n=t;this.clientId=n==null?void 0:n.lastEventId,this.submitSubscriptions().then(async()=>{let r=3;for(;this.hasUnsentSubscriptions()&&r>0;)r--,await this.submitSubscriptions()}).then(()=>{for(let o of this.pendingConnects)o.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const r=this.getSubscriptionsByTopic("PB_CONNECT");for(let o in r)for(let s of r[o])s(t)}).catch(r=>{this.clientId="",this.connectErrorHandler(r)})})}hasUnsentSubscriptions(){const t=this.getNonEmptySubscriptionKeys();if(t.length!=this.lastSentSubscriptions.length)return!0;for(const n of t)if(!this.lastSentSubscriptions.includes(n))return!0;return!1}connectErrorHandler(t){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let r of this.pendingConnects)r.reject(new Dn(t));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const n=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},n)}disconnect(t=!1){var n;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(n=this.eventSource)==null||n.close(),this.eventSource=null,this.clientId="",!t){this.reconnectAttempts=0;for(let r of this.pendingConnects)r.resolve();this.pendingConnects=[]}}}class DI extends Og{constructor(t,n){super(t),this.collectionIdOrName=n}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(t,n,r){if(!t)throw new Error("Missing topic.");if(!n)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+t,n,r)}async unsubscribe(t){return t?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+t):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(t,n){if(typeof t=="number")return super.getFullList(t,n);const r=Object.assign({},t,n);return super.getFullList(r)}async getList(t=1,n=30,r){return super.getList(t,n,r)}async getFirstListItem(t,n){return super.getFirstListItem(t,n)}async getOne(t,n){return super.getOne(t,n)}async create(t,n){return super.create(t,n)}async update(t,n,r){return super.update(t,n,r).then(o=>{var s,i,a;return((s=this.client.authStore.model)==null?void 0:s.id)!==(o==null?void 0:o.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,o),o})}async delete(t,n){return super.delete(t,n).then(r=>{var o,s,i;return!r||((o=this.client.authStore.model)==null?void 0:o.id)!==t||((s=this.client.authStore.model)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((i=this.client.authStore.model)==null?void 0:i.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),r})}authResponse(t){const n=this.decode((t==null?void 0:t.record)||{});return this.client.authStore.save(t==null?void 0:t.token,n),Object.assign({},t,{token:(t==null?void 0:t.token)||"",record:n})}async listAuthMethods(t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCollectionPath+"/auth-methods",t).then(n=>Object.assign({},n,{usernamePassword:!!(n!=null&&n.usernamePassword),emailPassword:!!(n!=null&&n.emailPassword),authProviders:Array.isArray(n==null?void 0:n.authProviders)?n==null?void 0:n.authProviders:[]}))}async authWithPassword(t,n,r,o){let s={method:"POST",body:{identity:t,password:n}};return s=Cn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",s,r,o),this.client.send(this.baseCollectionPath+"/auth-with-password",s).then(i=>this.authResponse(i))}async authWithOAuth2Code(t,n,r,o,s,i,a){let l={method:"POST",body:{provider:t,code:n,codeVerifier:r,redirectUrl:o,createData:s}};return l=Cn("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 n=(t==null?void 0:t[0])||{};let r=null;n.urlCallback||(r=zx(void 0));const o=new f1(this.client);function s(){r==null||r.close(),o.unsubscribe()}const i={},a=n.requestKey;return a&&(i.requestKey=a),this.listAuthMethods(i).then(l=>{var p;const u=l.authProviders.find(x=>x.name===n.provider);if(!u)throw new Dn(new Error(`Missing or invalid provider "${n.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=()=>{s()}),new Promise(async(x,g)=>{var y;try{await o.subscribe("@oauth2",async w=>{var C;const b=o.clientId;try{if(!w.state||b!==w.state)throw new Error("State parameters don't match.");if(w.error||!w.code)throw new Error("OAuth2 redirect error or missing code: "+w.error);const _=Object.assign({},n);delete _.provider,delete _.scopes,delete _.createData,delete _.urlCallback,(C=f==null?void 0:f.signal)!=null&&C.onabort&&(f.signal.onabort=null);const R=await this.authWithOAuth2Code(u.name,w.code,u.codeVerifier,d,n.createData,_);x(R)}catch(_){g(new Dn(_))}s()});const S={state:o.clientId};(y=n.scopes)!=null&&y.length&&(S.scope=n.scopes.join(" "));const v=this._replaceQueryParams(u.authUrl+d,S);await(n.urlCallback||function(w){r?r.location.href=w:r=zx(w)})(v)}catch(S){s(),g(new Dn(S))}})}).catch(l=>{throw s(),l})}async authRefresh(t,n){let r={method:"POST"};return r=Cn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",r,t,n),this.client.send(this.baseCollectionPath+"/auth-refresh",r).then(o=>this.authResponse(o))}async requestPasswordReset(t,n,r){let o={method:"POST",body:{email:t}};return o=Cn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",o,n,r),this.client.send(this.baseCollectionPath+"/request-password-reset",o).then(()=>!0)}async confirmPasswordReset(t,n,r,o,s){let i={method:"POST",body:{token:t,password:n,passwordConfirm:r}};return i=Cn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",i,o,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",i).then(()=>!0)}async requestVerification(t,n,r){let o={method:"POST",body:{email:t}};return o=Cn("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",o,n,r),this.client.send(this.baseCollectionPath+"/request-verification",o).then(()=>!0)}async confirmVerification(t,n,r){let o={method:"POST",body:{token:t}};return o=Cn("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",o,n,r),this.client.send(this.baseCollectionPath+"/confirm-verification",o).then(()=>{const s=Ri(t),i=this.client.authStore.model;return i&&!i.verified&&i.id===s.id&&i.collectionId===s.collectionId&&(i.verified=!0,this.client.authStore.save(this.client.authStore.token,i)),!0})}async requestEmailChange(t,n,r){let o={method:"POST",body:{newEmail:t}};return o=Cn("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",o,n,r),this.client.send(this.baseCollectionPath+"/request-email-change",o).then(()=>!0)}async confirmEmailChange(t,n,r,o){let s={method:"POST",body:{token:t,password:n}};return s=Cn("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,r,o),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>{const i=Ri(t),a=this.client.authStore.model;return a&&a.id===i.id&&a.collectionId===i.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(t,n){return n=Object.assign({method:"GET"},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths",n)}async unlinkExternalAuth(t,n,r){return r=Object.assign({method:"DELETE"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(n),r).then(()=>!0)}_replaceQueryParams(t,n={}){let r=t,o="";t.indexOf("?")>=0&&(r=t.substring(0,t.indexOf("?")),o=t.substring(t.indexOf("?")+1));const s={},i=o.split("&");for(const a of i){if(a=="")continue;const l=a.split("=");s[decodeURIComponent(l[0].replace(/\+/g," "))]=decodeURIComponent((l[1]||"").replace(/\+/g," "))}for(let a in n)n.hasOwnProperty(a)&&(n[a]==null?delete s[a]:s[a]=n[a]);o="";for(let a in s)s.hasOwnProperty(a)&&(o!=""&&(o+="&"),o+=encodeURIComponent(a.replace(/%20/g,"+"))+"="+encodeURIComponent(s[a].replace(/%20/g,"+")));return o!=""?r+"?"+o:r}}function zx(e){if(typeof window>"u"||!(window!=null&&window.open))throw new Dn(new Error("Not in a browser context - please pass a custom urlCallback function."));let t=1024,n=768,r=window.innerWidth,o=window.innerHeight;t=t>r?r:t,n=n>o?o:n;let s=r/2-t/2,i=o/2-n/2;return window.open(e,"popup_window","width="+t+",height="+n+",top="+i+",left="+s+",resizable,menubar=no")}class MI extends Og{get baseCrudPath(){return"/api/collections"}async import(t,n=!1,r){return r=Object.assign({method:"PUT",body:{collections:t,deleteMissing:n}},r),this.client.send(this.baseCrudPath+"/import",r).then(()=>!0)}}class OI extends Ws{async getList(t=1,n=30,r){return(r=Object.assign({method:"GET"},r)).query=Object.assign({page:t,perPage:n},r.query),this.client.send("/api/logs",r)}async getOne(t,n){if(!t)throw new Dn({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return n=Object.assign({method:"GET"},n),this.client.send("/api/logs/"+encodeURIComponent(t),n)}async getStats(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/stats",t)}}class AI extends Ws{async check(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/health",t)}}class II extends Ws{getUrl(t,n,r={}){if(!n||!(t!=null&&t.id)||!(t!=null&&t.collectionId)&&!(t!=null&&t.collectionName))return"";const o=[];o.push("api"),o.push("files"),o.push(encodeURIComponent(t.collectionId||t.collectionName)),o.push(encodeURIComponent(t.id)),o.push(encodeURIComponent(n));let s=this.client.buildUrl(o.join("/"));if(Object.keys(r).length){r.download===!1&&delete r.download;const i=new URLSearchParams(r);s+=(s.includes("?")?"&":"?")+i}return s}async getToken(t){return t=Object.assign({method:"POST"},t),this.client.send("/api/files/token",t).then(n=>(n==null?void 0:n.token)||"")}}class LI extends Ws{async getFullList(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/backups",t)}async create(t,n){return n=Object.assign({method:"POST",body:{name:t}},n),this.client.send("/api/backups",n).then(()=>!0)}async upload(t,n){return n=Object.assign({method:"POST",body:t},n),this.client.send("/api/backups/upload",n).then(()=>!0)}async delete(t,n){return n=Object.assign({method:"DELETE"},n),this.client.send(`/api/backups/${encodeURIComponent(t)}`,n).then(()=>!0)}async restore(t,n){return n=Object.assign({method:"POST"},n),this.client.send(`/api/backups/${encodeURIComponent(t)}/restore`,n).then(()=>!0)}getDownloadUrl(t,n){return this.client.buildUrl(`/api/backups/${encodeURIComponent(n)}?token=${encodeURIComponent(t)}`)}}class FI{constructor(t="/",n,r="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=t,this.lang=r,this.authStore=n||new RI,this.admins=new PI(this),this.collections=new MI(this),this.files=new II(this),this.logs=new OI(this),this.settings=new NI(this),this.realtime=new f1(this),this.health=new AI(this),this.backups=new LI(this)}collection(t){return this.recordServices[t]||(this.recordServices[t]=new DI(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,n){if(!n)return t;for(let r in n){let o=n[r];switch(typeof o){case"boolean":case"number":o=""+o;break;case"string":o="'"+o.replace(/'/g,"\\'")+"'";break;default:o=o===null?"null":o instanceof Date?"'"+o.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(o).replace(/'/g,"\\'")+"'"}t=t.replaceAll("{:"+r+"}",o)}return t}getFileUrl(t,n,r={}){return this.files.getUrl(t,n,r)}buildUrl(t){var r;let n=this.baseUrl;return typeof window>"u"||!window.location||n.startsWith("https://")||n.startsWith("http://")||(n=(r=window.location.origin)!=null&&r.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(n+=window.location.pathname||"/",n+=n.endsWith("/")?"":"/"),n+=this.baseUrl),t&&(n+=n.endsWith("/")?"":"/",n+=t.startsWith("/")?t.substring(1):t),n}async send(t,n){n=this.initSendOptions(t,n);let r=this.buildUrl(t);if(this.beforeSend){const o=Object.assign({},await this.beforeSend(r,n));o.url!==void 0||o.options!==void 0?(r=o.url||r,n=o.options||n):Object.keys(o).length&&(n=o,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(n.query!==void 0){const o=this.serializeQueryParams(n.query);o&&(r+=(r.includes("?")?"&":"?")+o),delete n.query}return this.getHeader(n.headers,"Content-Type")=="application/json"&&n.body&&typeof n.body!="string"&&(n.body=JSON.stringify(n.body)),(n.fetch||fetch)(r,n).then(async o=>{let s={};try{s=await o.json()}catch{}if(this.afterSend&&(s=await this.afterSend(o,s)),o.status>=400)throw new Dn({url:o.url,status:o.status,data:s});return s}).catch(o=>{throw new Dn(o)})}initSendOptions(t,n){if((n=Object.assign({method:"GET"},n)).body=this.convertToFormDataIfNeeded(n.body),d1(n),n.query=Object.assign({},n.params,n.query),n.requestKey===void 0&&(n.$autoCancel===!1||n.query.$autoCancel===!1?n.requestKey=null:(n.$cancelKey||n.query.$cancelKey)&&(n.requestKey=n.$cancelKey||n.query.$cancelKey)),delete n.$autoCancel,delete n.query.$autoCancel,delete n.$cancelKey,delete n.query.$cancelKey,this.getHeader(n.headers,"Content-Type")!==null||this.isFormData(n.body)||(n.headers=Object.assign({},n.headers,{"Content-Type":"application/json"})),this.getHeader(n.headers,"Accept-Language")===null&&(n.headers=Object.assign({},n.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(n.headers,"Authorization")===null&&(n.headers=Object.assign({},n.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&n.requestKey!==null){const r=n.requestKey||(n.method||"GET")+t;delete n.requestKey,this.cancelRequest(r);const o=new AbortController;this.cancelControllers[r]=o,n.signal=o.signal}return n}convertToFormDataIfNeeded(t){if(typeof FormData>"u"||t===void 0||typeof t!="object"||t===null||this.isFormData(t)||!this.hasBlobField(t))return t;const n=new FormData;for(const r in t){const o=t[r];if(typeof o!="object"||this.hasBlobField({data:o})){const s=Array.isArray(o)?o:[o];for(let i of s)n.append(r,i)}else{let s={};s[r]=o,n.append("@jsonPayload",JSON.stringify(s))}}return n}hasBlobField(t){for(const n in t){const r=Array.isArray(t[n])?t[n]:[t[n]];for(const o of r)if(typeof Blob<"u"&&o instanceof Blob||typeof File<"u"&&o instanceof File)return!0}return!1}getHeader(t,n){t=t||{},n=n.toLowerCase();for(let r in t)if(r.toLowerCase()==n)return t[r];return null}isFormData(t){return t&&(t.constructor.name==="FormData"||typeof FormData<"u"&&t instanceof FormData)}serializeQueryParams(t){const n=[];for(const r in t){if(t[r]===null)continue;const o=t[r],s=encodeURIComponent(r);if(Array.isArray(o))for(const i of o)n.push(s+"="+encodeURIComponent(i));else o instanceof Date?n.push(s+"="+encodeURIComponent(o.toISOString())):typeof o!==null&&typeof o=="object"?n.push(s+"="+encodeURIComponent(JSON.stringify(o))):n.push(s+"="+encodeURIComponent(o))}return n.join("&")}}var UI={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const $I=UI.VITE_API_DOMAIN;console.log($I);let Wc;const Vt=()=>Wc||(Wc=new FI("/"),Wc);//! moment.js -//! version : 2.30.1 -//! authors : Tim Wood, Iskren Chernev, Moment.js contributors -//! license : MIT -//! momentjs.com -var h1;function te(){return h1.apply(null,arguments)}function VI(e){h1=e}function dr(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Cs(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function We(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ag(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(We(e,t))return!1;return!0}function mn(e){return e===void 0}function lo(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function Jl(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function p1(e,t){var n=[],r,o=e.length;for(r=0;r>>0,r;for(r=0;r0)for(n=0;n=0;return(s?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+r}var Ug=/(\[[^\[]*\])|(\\)?([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,Yc=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,dh={},Ni={};function he(e,t,n,r){var o=r;typeof r=="string"&&(o=function(){return this[r]()}),e&&(Ni[e]=o),t&&(Ni[t[0]]=function(){return Pr(o.apply(this,arguments),t[1],t[2])}),n&&(Ni[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function BI(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function GI(e){var t=e.match(Ug),n,r;for(n=0,r=t.length;n=0&&Yc.test(e);)e=e.replace(Yc,r),Yc.lastIndex=0,n-=1;return e}var KI={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 ZI(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(Ug).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var qI="Invalid date";function XI(){return this._invalidDate}var QI="%d",JI=/\d{1,2}/;function e2(e){return this._ordinal.replace("%d",e)}var t2={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 n2(e,t,n,r){var o=this._relativeTime[n];return Or(o)?o(e,t,n,r):o.replace(/%d/i,e)}function r2(e,t){var n=this._relativeTime[e>0?"future":"past"];return Or(n)?n(t):n.replace(/%s/i,t)}var Hx={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 Gn(e){return typeof e=="string"?Hx[e]||Hx[e.toLowerCase()]:void 0}function $g(e){var t={},n,r;for(r in e)We(e,r)&&(n=Gn(r),n&&(t[n]=e[r]));return t}var o2={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 s2(e){var t=[],n;for(n in e)We(e,n)&&t.push({unit:n,priority:o2[n]});return t.sort(function(r,o){return r.priority-o.priority}),t}var y1=/\d/,Ln=/\d\d/,x1=/\d{3}/,Vg=/\d{4}/,Zd=/[+-]?\d{6}/,ft=/\d\d?/,w1=/\d\d\d\d?/,S1=/\d\d\d\d\d\d?/,qd=/\d{1,3}/,zg=/\d{1,4}/,Xd=/[+-]?\d{1,6}/,ra=/\d+/,Qd=/[+-]?\d+/,i2=/Z|[+-]\d\d:?\d\d/gi,Jd=/Z|[+-]\d\d(?::?\d\d)?/gi,a2=/[+-]?\d+(\.\d{1,3})?/,tc=/[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,oa=/^[1-9]\d?/,Wg=/^([1-9]\d|\d)/,qu;qu={};function ie(e,t,n){qu[e]=Or(t)?t:function(r,o){return r&&n?n:t}}function l2(e,t){return We(qu,e)?qu[e](t._strict,t._locale):new RegExp(c2(e))}function c2(e){return Qr(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,o,s){return n||r||o||s}))}function Qr(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $n(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Ae(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=$n(t)),n}var Np={};function nt(e,t){var n,r=t,o;for(typeof e=="string"&&(e=[e]),lo(t)&&(r=function(s,i){i[t]=Ae(s)}),o=e.length,n=0;n68?1900:2e3)};var _1=sa("FullYear",!0);function h2(){return ef(this.year())}function sa(e,t){return function(n){return n!=null?(b1(this,e,n),te.updateOffset(this,t),this):yl(this,e)}}function yl(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function b1(e,t,n){var r,o,s,i,a;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,o=e._isUTC,t){case"Milliseconds":return void(o?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(o?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(o?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(o?r.setUTCHours(n):r.setHours(n));case"Date":return void(o?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}s=n,i=e.month(),a=e.date(),a=a===29&&i===1&&!ef(s)?28:a,o?r.setUTCFullYear(s,i,a):r.setFullYear(s,i,a)}}function p2(e){return e=Gn(e),Or(this[e])?this[e]():this}function m2(e,t){if(typeof e=="object"){e=$g(e);var n=s2(e),r,o=n.length;for(r=0;r=0?(a=new Date(e+400,t,n,r,o,s,i),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,n,r,o,s,i),a}function xl(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Xu(e,t,n){var r=7+t-n,o=(7+xl(e,0,r).getUTCDay()-t)%7;return-o+r-1}function N1(e,t,n,r,o){var s=(7+n-r)%7,i=Xu(e,r,o),a=1+7*(t-1)+s+i,l,u;return a<=0?(l=e-1,u=Wa(l)+a):a>Wa(e)?(l=e+1,u=a-Wa(e)):(l=e,u=a),{year:l,dayOfYear:u}}function wl(e,t,n){var r=Xu(e.year(),t,n),o=Math.floor((e.dayOfYear()-r-1)/7)+1,s,i;return o<1?(i=e.year()-1,s=o+Jr(i,t,n)):o>Jr(e.year(),t,n)?(s=o-Jr(e.year(),t,n),i=e.year()+1):(i=e.year(),s=o),{week:s,year:i}}function Jr(e,t,n){var r=Xu(e,t,n),o=Xu(e+1,t,n);return(Wa(e)-r+o)/7}he("w",["ww",2],"wo","week");he("W",["WW",2],"Wo","isoWeek");ie("w",ft,oa);ie("ww",ft,Ln);ie("W",ft,oa);ie("WW",ft,Ln);nc(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=Ae(e)});function R2(e){return wl(e,this._week.dow,this._week.doy).week}var N2={dow:0,doy:6};function P2(){return this._week.dow}function j2(){return this._week.doy}function D2(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function M2(e){var t=wl(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}he("d",0,"do","day");he("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});he("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});he("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});he("e",0,0,"weekday");he("E",0,0,"isoWeekday");ie("d",ft);ie("e",ft);ie("E",ft);ie("dd",function(e,t){return t.weekdaysMinRegex(e)});ie("ddd",function(e,t){return t.weekdaysShortRegex(e)});ie("dddd",function(e,t){return t.weekdaysRegex(e)});nc(["dd","ddd","dddd"],function(e,t,n,r){var o=n._locale.weekdaysParse(e,r,n._strict);o!=null?t.d=o:Ee(n).invalidWeekday=e});nc(["d","e","E"],function(e,t,n,r){t[r]=Ae(e)});function O2(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function A2(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Hg(e,t){return e.slice(t,7).concat(e.slice(0,t))}var I2="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),P1="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),L2="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),F2=tc,U2=tc,$2=tc;function V2(e,t){var n=dr(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Hg(n,this._week.dow):e?n[e.day()]:n}function z2(e){return e===!0?Hg(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function W2(e){return e===!0?Hg(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Y2(e,t,n){var r,o,s,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)s=Mr([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(s,"").toLocaleLowerCase();return n?t==="dddd"?(o=Rt.call(this._weekdaysParse,i),o!==-1?o:null):t==="ddd"?(o=Rt.call(this._shortWeekdaysParse,i),o!==-1?o:null):(o=Rt.call(this._minWeekdaysParse,i),o!==-1?o:null):t==="dddd"?(o=Rt.call(this._weekdaysParse,i),o!==-1||(o=Rt.call(this._shortWeekdaysParse,i),o!==-1)?o:(o=Rt.call(this._minWeekdaysParse,i),o!==-1?o:null)):t==="ddd"?(o=Rt.call(this._shortWeekdaysParse,i),o!==-1||(o=Rt.call(this._weekdaysParse,i),o!==-1)?o:(o=Rt.call(this._minWeekdaysParse,i),o!==-1?o:null)):(o=Rt.call(this._minWeekdaysParse,i),o!==-1||(o=Rt.call(this._weekdaysParse,i),o!==-1)?o:(o=Rt.call(this._shortWeekdaysParse,i),o!==-1?o:null))}function H2(e,t,n){var r,o,s;if(this._weekdaysParseExact)return Y2.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(o=Mr([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(s="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[r]=new RegExp(s.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function B2(e){if(!this.isValid())return e!=null?this:NaN;var t=yl(this,"Day");return e!=null?(e=O2(e,this.localeData()),this.add(e-t,"d")):t}function G2(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 K2(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=A2(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Z2(e){return this._weekdaysParseExact?(We(this,"_weekdaysRegex")||Bg.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(We(this,"_weekdaysRegex")||(this._weekdaysRegex=F2),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function q2(e){return this._weekdaysParseExact?(We(this,"_weekdaysRegex")||Bg.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(We(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=U2),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function X2(e){return this._weekdaysParseExact?(We(this,"_weekdaysRegex")||Bg.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(We(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=$2),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Bg(){function e(d,f){return f.length-d.length}var t=[],n=[],r=[],o=[],s,i,a,l,u;for(s=0;s<7;s++)i=Mr([2e3,1]).day(s),a=Qr(this.weekdaysMin(i,"")),l=Qr(this.weekdaysShort(i,"")),u=Qr(this.weekdays(i,"")),t.push(a),n.push(l),r.push(u),o.push(a),o.push(l),o.push(u);t.sort(e),n.sort(e),r.sort(e),o.sort(e),this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Gg(){return this.hours()%12||12}function Q2(){return this.hours()||24}he("H",["HH",2],0,"hour");he("h",["hh",2],0,Gg);he("k",["kk",2],0,Q2);he("hmm",0,0,function(){return""+Gg.apply(this)+Pr(this.minutes(),2)});he("hmmss",0,0,function(){return""+Gg.apply(this)+Pr(this.minutes(),2)+Pr(this.seconds(),2)});he("Hmm",0,0,function(){return""+this.hours()+Pr(this.minutes(),2)});he("Hmmss",0,0,function(){return""+this.hours()+Pr(this.minutes(),2)+Pr(this.seconds(),2)});function j1(e,t){he(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}j1("a",!0);j1("A",!1);function D1(e,t){return t._meridiemParse}ie("a",D1);ie("A",D1);ie("H",ft,Wg);ie("h",ft,oa);ie("k",ft,oa);ie("HH",ft,Ln);ie("hh",ft,Ln);ie("kk",ft,Ln);ie("hmm",w1);ie("hmmss",S1);ie("Hmm",w1);ie("Hmmss",S1);nt(["H","HH"],Lt);nt(["k","kk"],function(e,t,n){var r=Ae(e);t[Lt]=r===24?0:r});nt(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e});nt(["h","hh"],function(e,t,n){t[Lt]=Ae(e),Ee(n).bigHour=!0});nt("hmm",function(e,t,n){var r=e.length-2;t[Lt]=Ae(e.substr(0,r)),t[rr]=Ae(e.substr(r)),Ee(n).bigHour=!0});nt("hmmss",function(e,t,n){var r=e.length-4,o=e.length-2;t[Lt]=Ae(e.substr(0,r)),t[rr]=Ae(e.substr(r,2)),t[Zr]=Ae(e.substr(o)),Ee(n).bigHour=!0});nt("Hmm",function(e,t,n){var r=e.length-2;t[Lt]=Ae(e.substr(0,r)),t[rr]=Ae(e.substr(r))});nt("Hmmss",function(e,t,n){var r=e.length-4,o=e.length-2;t[Lt]=Ae(e.substr(0,r)),t[rr]=Ae(e.substr(r,2)),t[Zr]=Ae(e.substr(o))});function J2(e){return(e+"").toLowerCase().charAt(0)==="p"}var eL=/[ap]\.?m?\.?/i,tL=sa("Hours",!0);function nL(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var M1={calendar:YI,longDateFormat:KI,invalidDate:qI,ordinal:QI,dayOfMonthOrdinalParse:JI,relativeTime:t2,months:v2,monthsShort:C1,week:N2,weekdays:I2,weekdaysMin:L2,weekdaysShort:P1,meridiemParse:eL},pt={},_a={},Sl;function rL(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n0;){if(o=tf(s.slice(0,n).join("-")),o)return o;if(r&&r.length>=n&&rL(s,r)>=n-1)break;n--}t++}return Sl}function sL(e){return!!(e&&e.match("^[^/\\\\]*$"))}function tf(e){var t=null,n;if(pt[e]===void 0&&typeof gu<"u"&&gu&&gu.exports&&sL(e))try{t=Sl._abbr,n=require,n("./locale/"+e),Bo(t)}catch{pt[e]=null}return pt[e]}function Bo(e,t){var n;return e&&(mn(t)?n=go(e):n=Kg(e,t),n?Sl=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Sl._abbr}function Kg(e,t){if(t!==null){var n,r=M1;if(t.abbr=e,pt[e]!=null)g1("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."),r=pt[e]._config;else if(t.parentLocale!=null)if(pt[t.parentLocale]!=null)r=pt[t.parentLocale]._config;else if(n=tf(t.parentLocale),n!=null)r=n._config;else return _a[t.parentLocale]||(_a[t.parentLocale]=[]),_a[t.parentLocale].push({name:e,config:t}),null;return pt[e]=new Fg(Tp(r,t)),_a[e]&&_a[e].forEach(function(o){Kg(o.name,o.config)}),Bo(e),pt[e]}else return delete pt[e],null}function iL(e,t){if(t!=null){var n,r,o=M1;pt[e]!=null&&pt[e].parentLocale!=null?pt[e].set(Tp(pt[e]._config,t)):(r=tf(e),r!=null&&(o=r._config),t=Tp(o,t),r==null&&(t.abbr=e),n=new Fg(t),n.parentLocale=pt[e],pt[e]=n),Bo(e)}else pt[e]!=null&&(pt[e].parentLocale!=null?(pt[e]=pt[e].parentLocale,e===Bo()&&Bo(e)):pt[e]!=null&&delete pt[e]);return pt[e]}function go(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Sl;if(!dr(e)){if(t=tf(e),t)return t;e=[e]}return oL(e)}function aL(){return Rp(pt)}function Zg(e){var t,n=e._a;return n&&Ee(e).overflow===-2&&(t=n[Kr]<0||n[Kr]>11?Kr:n[Sr]<1||n[Sr]>Yg(n[Jt],n[Kr])?Sr:n[Lt]<0||n[Lt]>24||n[Lt]===24&&(n[rr]!==0||n[Zr]!==0||n[ws]!==0)?Lt:n[rr]<0||n[rr]>59?rr:n[Zr]<0||n[Zr]>59?Zr:n[ws]<0||n[ws]>999?ws:-1,Ee(e)._overflowDayOfYear&&(tSr)&&(t=Sr),Ee(e)._overflowWeeks&&t===-1&&(t=d2),Ee(e)._overflowWeekday&&t===-1&&(t=f2),Ee(e).overflow=t),e}var lL=/^\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)?)?$/,cL=/^\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)?)?$/,uL=/Z|[+-]\d\d(?::?\d\d)?/,Hc=[["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]],fh=[["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/]],dL=/^\/?Date\((-?\d+)/i,fL=/^(?:(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}))$/,hL={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 O1(e){var t,n,r=e._i,o=lL.exec(r)||cL.exec(r),s,i,a,l,u=Hc.length,d=fh.length;if(o){for(Ee(e).iso=!0,t=0,n=u;tWa(i)||e._dayOfYear===0)&&(Ee(e)._overflowDayOfYear=!0),n=xl(i,0,e._dayOfYear),e._a[Kr]=n.getUTCMonth(),e._a[Sr]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=o[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Lt]===24&&e._a[rr]===0&&e._a[Zr]===0&&e._a[ws]===0&&(e._nextDay=!0,e._a[Lt]=0),e._d=(e._useUTC?xl:T2).apply(null,r),s=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Lt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==s&&(Ee(e).weekdayMismatch=!0)}}function SL(e){var t,n,r,o,s,i,a,l,u;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(s=1,i=4,n=ni(t.GG,e._a[Jt],wl(dt(),1,4).year),r=ni(t.W,1),o=ni(t.E,1),(o<1||o>7)&&(l=!0)):(s=e._locale._week.dow,i=e._locale._week.doy,u=wl(dt(),s,i),n=ni(t.gg,e._a[Jt],u.year),r=ni(t.w,u.week),t.d!=null?(o=t.d,(o<0||o>6)&&(l=!0)):t.e!=null?(o=t.e+s,(t.e<0||t.e>6)&&(l=!0)):o=s),r<1||r>Jr(n,s,i)?Ee(e)._overflowWeeks=!0:l!=null?Ee(e)._overflowWeekday=!0:(a=N1(n,r,o,s,i),e._a[Jt]=a.year,e._dayOfYear=a.dayOfYear)}te.ISO_8601=function(){};te.RFC_2822=function(){};function Xg(e){if(e._f===te.ISO_8601){O1(e);return}if(e._f===te.RFC_2822){A1(e);return}e._a=[],Ee(e).empty=!0;var t=""+e._i,n,r,o,s,i,a=t.length,l=0,u,d;for(o=v1(e._f,e._locale).match(Ug)||[],d=o.length,n=0;n0&&Ee(e).unusedInput.push(i),t=t.slice(t.indexOf(r)+r.length),l+=r.length),Ni[s]?(r?Ee(e).empty=!1:Ee(e).unusedTokens.push(s),u2(s,r,e)):e._strict&&!r&&Ee(e).unusedTokens.push(s);Ee(e).charsLeftOver=a-l,t.length>0&&Ee(e).unusedInput.push(t),e._a[Lt]<=12&&Ee(e).bigHour===!0&&e._a[Lt]>0&&(Ee(e).bigHour=void 0),Ee(e).parsedDateParts=e._a.slice(0),Ee(e).meridiem=e._meridiem,e._a[Lt]=_L(e._locale,e._a[Lt],e._meridiem),u=Ee(e).era,u!==null&&(e._a[Jt]=e._locale.erasConvertYear(u,e._a[Jt])),qg(e),Zg(e)}function _L(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function bL(e){var t,n,r,o,s,i,a=!1,l=e._f.length;if(l===0){Ee(e).invalidFormat=!0,e._d=new Date(NaN);return}for(o=0;othis?this:e:Kd()});function F1(e,t){var n,r;if(t.length===1&&dr(t[0])&&(t=t[0]),!t.length)return dt();for(n=t[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function YL(){if(!mn(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Lg(e,this),e=I1(e),e._a?(t=e._isUTC?Mr(e._a):dt(e._a),this._isDSTShifted=this.isValid()&&AL(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function HL(){return this.isValid()?!this._isUTC:!1}function BL(){return this.isValid()?this._isUTC:!1}function $1(){return this.isValid()?this._isUTC&&this._offset===0:!1}var GL=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,KL=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function mr(e,t){var n=e,r=null,o,s,i;return du(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:lo(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=GL.exec(e))?(o=r[1]==="-"?-1:1,n={y:0,d:Ae(r[Sr])*o,h:Ae(r[Lt])*o,m:Ae(r[rr])*o,s:Ae(r[Zr])*o,ms:Ae(Pp(r[ws]*1e3))*o}):(r=KL.exec(e))?(o=r[1]==="-"?-1:1,n={y:us(r[2],o),M:us(r[3],o),w:us(r[4],o),d:us(r[5],o),h:us(r[6],o),m:us(r[7],o),s:us(r[8],o)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(i=ZL(dt(n.from),dt(n.to)),n={},n.ms=i.milliseconds,n.M=i.months),s=new nf(n),du(e)&&We(e,"_locale")&&(s._locale=e._locale),du(e)&&We(e,"_isValid")&&(s._isValid=e._isValid),s}mr.fn=nf.prototype;mr.invalid=OL;function us(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Gx(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function ZL(e,t){var n;return e.isValid()&&t.isValid()?(t=Jg(t,e),e.isBefore(t)?n=Gx(e,t):(n=Gx(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function V1(e,t){return function(n,r){var o,s;return r!==null&&!isNaN(+r)&&(g1(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."),s=n,n=r,r=s),o=mr(n,r),z1(this,o,e),this}}function z1(e,t,n,r){var o=t._milliseconds,s=Pp(t._days),i=Pp(t._months);e.isValid()&&(r=r??!0,i&&E1(e,yl(e,"Month")+i*n),s&&b1(e,"Date",yl(e,"Date")+s*n),o&&e._d.setTime(e._d.valueOf()+o*n),r&&te.updateOffset(e,s||i))}var qL=V1(1,"add"),XL=V1(-1,"subtract");function W1(e){return typeof e=="string"||e instanceof String}function QL(e){return fr(e)||Jl(e)||W1(e)||lo(e)||eF(e)||JL(e)||e===null||e===void 0}function JL(e){var t=Cs(e)&&!Ag(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],o,s,i=r.length;for(o=0;on.valueOf():n.valueOf()9999?uu(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Or(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",uu(n,"Z")):uu(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function pF(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,o,s;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",o="-MM-DD[T]HH:mm:ss.SSS",s=t+'[")]',this.format(n+r+o+s)}function mF(e){e||(e=this.isUtc()?te.defaultFormatUtc:te.defaultFormat);var t=uu(this,e);return this.localeData().postformat(t)}function gF(e,t){return this.isValid()&&(fr(e)&&e.isValid()||dt(e).isValid())?mr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function vF(e){return this.from(dt(),e)}function yF(e,t){return this.isValid()&&(fr(e)&&e.isValid()||dt(e).isValid())?mr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function xF(e){return this.to(dt(),e)}function Y1(e){var t;return e===void 0?this._locale._abbr:(t=go(e),t!=null&&(this._locale=t),this)}var H1=Bn("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 B1(){return this._locale}var Qu=1e3,Pi=60*Qu,Ju=60*Pi,G1=(365*400+97)*24*Ju;function ji(e,t){return(e%t+t)%t}function K1(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-G1:new Date(e,t,n).valueOf()}function Z1(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-G1:Date.UTC(e,t,n)}function wF(e){var t,n;if(e=Gn(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Z1:K1,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=ji(t+(this._isUTC?0:this.utcOffset()*Pi),Ju);break;case"minute":t=this._d.valueOf(),t-=ji(t,Pi);break;case"second":t=this._d.valueOf(),t-=ji(t,Qu);break}return this._d.setTime(t),te.updateOffset(this,!0),this}function SF(e){var t,n;if(e=Gn(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Z1:K1,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Ju-ji(t+(this._isUTC?0:this.utcOffset()*Pi),Ju)-1;break;case"minute":t=this._d.valueOf(),t+=Pi-ji(t,Pi)-1;break;case"second":t=this._d.valueOf(),t+=Qu-ji(t,Qu)-1;break}return this._d.setTime(t),te.updateOffset(this,!0),this}function _F(){return this._d.valueOf()-(this._offset||0)*6e4}function bF(){return Math.floor(this.valueOf()/1e3)}function CF(){return new Date(this.valueOf())}function kF(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function EF(){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 TF(){return this.isValid()?this.toISOString():null}function RF(){return Ig(this)}function NF(){return Ao({},Ee(this))}function PF(){return Ee(this).overflow}function jF(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}he("N",0,0,"eraAbbr");he("NN",0,0,"eraAbbr");he("NNN",0,0,"eraAbbr");he("NNNN",0,0,"eraName");he("NNNNN",0,0,"eraNarrow");he("y",["y",1],"yo","eraYear");he("y",["yy",2],0,"eraYear");he("y",["yyy",3],0,"eraYear");he("y",["yyyy",4],0,"eraYear");ie("N",ev);ie("NN",ev);ie("NNN",ev);ie("NNNN",zF);ie("NNNNN",WF);nt(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var o=n._locale.erasParse(e,r,n._strict);o?Ee(n).era=o:Ee(n).invalidEra=e});ie("y",ra);ie("yy",ra);ie("yyy",ra);ie("yyyy",ra);ie("yo",YF);nt(["y","yy","yyy","yyyy"],Jt);nt(["yo"],function(e,t,n,r){var o;n._locale._eraYearOrdinalRegex&&(o=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Jt]=n._locale.eraYearOrdinalParse(e,o):t[Jt]=parseInt(e,10)});function DF(e,t){var n,r,o,s=this._eras||go("en")._eras;for(n=0,r=s.length;n=0)return s[r]}function OF(e,t){var n=e.since<=e.until?1:-1;return t===void 0?te(e.since).year():te(e.since).year()+(t-e.offset)*n}function AF(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;es&&(t=s),XF.call(this,e,t,n,r,o))}function XF(e,t,n,r,o){var s=N1(e,t,n,r,o),i=xl(s.year,0,s.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}he("Q",0,"Qo","quarter");ie("Q",y1);nt("Q",function(e,t){t[Kr]=(Ae(e)-1)*3});function QF(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}he("D",["DD",2],"Do","date");ie("D",ft,oa);ie("DD",ft,Ln);ie("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});nt(["D","DD"],Sr);nt("Do",function(e,t){t[Sr]=Ae(e.match(ft)[0])});var X1=sa("Date",!0);he("DDD",["DDDD",3],"DDDo","dayOfYear");ie("DDD",qd);ie("DDDD",x1);nt(["DDD","DDDD"],function(e,t,n){n._dayOfYear=Ae(e)});function JF(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}he("m",["mm",2],0,"minute");ie("m",ft,Wg);ie("mm",ft,Ln);nt(["m","mm"],rr);var e4=sa("Minutes",!1);he("s",["ss",2],0,"second");ie("s",ft,Wg);ie("ss",ft,Ln);nt(["s","ss"],Zr);var t4=sa("Seconds",!1);he("S",0,0,function(){return~~(this.millisecond()/100)});he(0,["SS",2],0,function(){return~~(this.millisecond()/10)});he(0,["SSS",3],0,"millisecond");he(0,["SSSS",4],0,function(){return this.millisecond()*10});he(0,["SSSSS",5],0,function(){return this.millisecond()*100});he(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});he(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});he(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});he(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});ie("S",qd,y1);ie("SS",qd,Ln);ie("SSS",qd,x1);var Io,Q1;for(Io="SSSS";Io.length<=9;Io+="S")ie(Io,ra);function n4(e,t){t[ws]=Ae(("0."+e)*1e3)}for(Io="S";Io.length<=9;Io+="S")nt(Io,n4);Q1=sa("Milliseconds",!1);he("z",0,0,"zoneAbbr");he("zz",0,0,"zoneName");function r4(){return this._isUTC?"UTC":""}function o4(){return this._isUTC?"Coordinated Universal Time":""}var z=ec.prototype;z.add=qL;z.calendar=rF;z.clone=oF;z.diff=dF;z.endOf=SF;z.format=mF;z.from=gF;z.fromNow=vF;z.to=yF;z.toNow=xF;z.get=p2;z.invalidAt=PF;z.isAfter=sF;z.isBefore=iF;z.isBetween=aF;z.isSame=lF;z.isSameOrAfter=cF;z.isSameOrBefore=uF;z.isValid=RF;z.lang=H1;z.locale=Y1;z.localeData=B1;z.max=RL;z.min=TL;z.parsingFlags=NF;z.set=m2;z.startOf=wF;z.subtract=XL;z.toArray=kF;z.toObject=EF;z.toDate=CF;z.toISOString=hF;z.inspect=pF;typeof Symbol<"u"&&Symbol.for!=null&&(z[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});z.toJSON=TF;z.toString=fF;z.unix=bF;z.valueOf=_F;z.creationData=jF;z.eraName=AF;z.eraNarrow=IF;z.eraAbbr=LF;z.eraYear=FF;z.year=_1;z.isLeapYear=h2;z.weekYear=HF;z.isoWeekYear=BF;z.quarter=z.quarters=QF;z.month=T1;z.daysInMonth=C2;z.week=z.weeks=D2;z.isoWeek=z.isoWeeks=M2;z.weeksInYear=ZF;z.weeksInWeekYear=qF;z.isoWeeksInYear=GF;z.isoWeeksInISOWeekYear=KF;z.date=X1;z.day=z.days=B2;z.weekday=G2;z.isoWeekday=K2;z.dayOfYear=JF;z.hour=z.hours=tL;z.minute=z.minutes=e4;z.second=z.seconds=t4;z.millisecond=z.milliseconds=Q1;z.utcOffset=LL;z.utc=UL;z.local=$L;z.parseZone=VL;z.hasAlignedHourOffset=zL;z.isDST=WL;z.isLocal=HL;z.isUtcOffset=BL;z.isUtc=$1;z.isUTC=$1;z.zoneAbbr=r4;z.zoneName=o4;z.dates=Bn("dates accessor is deprecated. Use date instead.",X1);z.months=Bn("months accessor is deprecated. Use month instead",T1);z.years=Bn("years accessor is deprecated. Use year instead",_1);z.zone=Bn("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",FL);z.isDSTShifted=Bn("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",YL);function s4(e){return dt(e*1e3)}function i4(){return dt.apply(null,arguments).parseZone()}function J1(e){return e}var Ye=Fg.prototype;Ye.calendar=HI;Ye.longDateFormat=ZI;Ye.invalidDate=XI;Ye.ordinal=e2;Ye.preparse=J1;Ye.postformat=J1;Ye.relativeTime=n2;Ye.pastFuture=r2;Ye.set=WI;Ye.eras=DF;Ye.erasParse=MF;Ye.erasConvertYear=OF;Ye.erasAbbrRegex=$F;Ye.erasNameRegex=UF;Ye.erasNarrowRegex=VF;Ye.months=w2;Ye.monthsShort=S2;Ye.monthsParse=b2;Ye.monthsRegex=E2;Ye.monthsShortRegex=k2;Ye.week=R2;Ye.firstDayOfYear=j2;Ye.firstDayOfWeek=P2;Ye.weekdays=V2;Ye.weekdaysMin=W2;Ye.weekdaysShort=z2;Ye.weekdaysParse=H2;Ye.weekdaysRegex=Z2;Ye.weekdaysShortRegex=q2;Ye.weekdaysMinRegex=X2;Ye.isPM=J2;Ye.meridiem=nL;function ed(e,t,n,r){var o=go(),s=Mr().set(r,t);return o[n](s,e)}function eC(e,t,n){if(lo(e)&&(t=e,e=void 0),e=e||"",t!=null)return ed(e,t,n,"month");var r,o=[];for(r=0;r<12;r++)o[r]=ed(e,r,n,"month");return o}function nv(e,t,n,r){typeof e=="boolean"?(lo(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,lo(t)&&(n=t,t=void 0),t=t||"");var o=go(),s=e?o._week.dow:0,i,a=[];if(n!=null)return ed(t,(n+s)%7,r,"day");for(i=0;i<7;i++)a[i]=ed(t,(i+s)%7,r,"day");return a}function a4(e,t){return eC(e,t,"months")}function l4(e,t){return eC(e,t,"monthsShort")}function c4(e,t,n){return nv(e,t,n,"weekdays")}function u4(e,t,n){return nv(e,t,n,"weekdaysShort")}function d4(e,t,n){return nv(e,t,n,"weekdaysMin")}Bo("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,n=Ae(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}});te.lang=Bn("moment.lang is deprecated. Use moment.locale instead.",Bo);te.langData=Bn("moment.langData is deprecated. Use moment.localeData instead.",go);var Fr=Math.abs;function f4(){var e=this._data;return this._milliseconds=Fr(this._milliseconds),this._days=Fr(this._days),this._months=Fr(this._months),e.milliseconds=Fr(e.milliseconds),e.seconds=Fr(e.seconds),e.minutes=Fr(e.minutes),e.hours=Fr(e.hours),e.months=Fr(e.months),e.years=Fr(e.years),this}function tC(e,t,n,r){var o=mr(t,n);return e._milliseconds+=r*o._milliseconds,e._days+=r*o._days,e._months+=r*o._months,e._bubble()}function h4(e,t){return tC(this,e,t,1)}function p4(e,t){return tC(this,e,t,-1)}function Kx(e){return e<0?Math.floor(e):Math.ceil(e)}function m4(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,o,s,i,a,l;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Kx(Dp(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,o=$n(e/1e3),r.seconds=o%60,s=$n(o/60),r.minutes=s%60,i=$n(s/60),r.hours=i%24,t+=$n(i/24),l=$n(nC(t)),n+=l,t-=Kx(Dp(l)),a=$n(n/12),n%=12,r.days=t,r.months=n,r.years=a,this}function nC(e){return e*4800/146097}function Dp(e){return e*146097/4800}function g4(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=Gn(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+nC(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Dp(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function vo(e){return function(){return this.as(e)}}var rC=vo("ms"),v4=vo("s"),y4=vo("m"),x4=vo("h"),w4=vo("d"),S4=vo("w"),_4=vo("M"),b4=vo("Q"),C4=vo("y"),k4=rC;function E4(){return mr(this)}function T4(e){return e=Gn(e),this.isValid()?this[e+"s"]():NaN}function Ys(e){return function(){return this.isValid()?this._data[e]:NaN}}var R4=Ys("milliseconds"),N4=Ys("seconds"),P4=Ys("minutes"),j4=Ys("hours"),D4=Ys("days"),M4=Ys("months"),O4=Ys("years");function A4(){return $n(this.days()/7)}var Wr=Math.round,vi={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function I4(e,t,n,r,o){return o.relativeTime(t||1,!!n,e,r)}function L4(e,t,n,r){var o=mr(e).abs(),s=Wr(o.as("s")),i=Wr(o.as("m")),a=Wr(o.as("h")),l=Wr(o.as("d")),u=Wr(o.as("M")),d=Wr(o.as("w")),f=Wr(o.as("y")),p=s<=n.ss&&["s",s]||s0,p[4]=r,I4.apply(null,p)}function F4(e){return e===void 0?Wr:typeof e=="function"?(Wr=e,!0):!1}function U4(e,t){return vi[e]===void 0?!1:t===void 0?vi[e]:(vi[e]=t,e==="s"&&(vi.ss=t-1),!0)}function $4(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=vi,o,s;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Object.assign({},vi,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),o=this.localeData(),s=L4(this,!n,r,o),n&&(s=o.pastFuture(+this,s)),o.postformat(s)}var hh=Math.abs;function ei(e){return(e>0)-(e<0)||+e}function of(){if(!this.isValid())return this.localeData().invalidDate();var e=hh(this._milliseconds)/1e3,t=hh(this._days),n=hh(this._months),r,o,s,i,a=this.asSeconds(),l,u,d,f;return a?(r=$n(e/60),o=$n(r/60),e%=60,r%=60,s=$n(n/12),n%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=ei(this._months)!==ei(a)?"-":"",d=ei(this._days)!==ei(a)?"-":"",f=ei(this._milliseconds)!==ei(a)?"-":"",l+"P"+(s?u+s+"Y":"")+(n?u+n+"M":"")+(t?d+t+"D":"")+(o||r||e?"T":"")+(o?f+o+"H":"")+(r?f+r+"M":"")+(e?f+i+"S":"")):"P0D"}var Fe=nf.prototype;Fe.isValid=ML;Fe.abs=f4;Fe.add=h4;Fe.subtract=p4;Fe.as=g4;Fe.asMilliseconds=rC;Fe.asSeconds=v4;Fe.asMinutes=y4;Fe.asHours=x4;Fe.asDays=w4;Fe.asWeeks=S4;Fe.asMonths=_4;Fe.asQuarters=b4;Fe.asYears=C4;Fe.valueOf=k4;Fe._bubble=m4;Fe.clone=E4;Fe.get=T4;Fe.milliseconds=R4;Fe.seconds=N4;Fe.minutes=P4;Fe.hours=j4;Fe.days=D4;Fe.weeks=A4;Fe.months=M4;Fe.years=O4;Fe.humanize=$4;Fe.toISOString=of;Fe.toString=of;Fe.toJSON=of;Fe.locale=Y1;Fe.localeData=B1;Fe.toIsoString=Bn("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",of);Fe.lang=H1;he("X",0,0,"unix");he("x",0,0,"valueOf");ie("x",Qd);ie("X",a2);nt("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)});nt("x",function(e,t,n){n._d=new Date(Ae(e))});//! moment.js -te.version="2.30.1";VI(dt);te.fn=z;te.min=NL;te.max=PL;te.now=jL;te.utc=Mr;te.unix=s4;te.months=a4;te.isDate=Jl;te.locale=Bo;te.invalid=Kd;te.duration=mr;te.isMoment=fr;te.weekdays=c4;te.parseZone=i4;te.localeData=go;te.isDuration=du;te.monthsShort=l4;te.weekdaysMin=d4;te.defineLocale=Kg;te.updateLocale=iL;te.locales=aL;te.weekdaysShort=u4;te.normalizeUnits=Gn;te.relativeTimeRounding=F4;te.relativeTimeThreshold=U4;te.calendarFormat=nF;te.prototype=z;te.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 V4=async()=>await Vt().collection("access").getFullList({sort:"-created",filter:"deleted = null"}),rv=async e=>e.id?await Vt().collection("access").update(e.id,e):await Vt().collection("access").create(e),z4=async e=>(e.deleted=te.utc().format("YYYY-MM-DD HH:mm:ss"),await Vt().collection("access").update(e.id,e)),W4=(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(n=>n.id!==t.payload)};case"UPDATE_ACCESS":return{...e,accesses:e.accesses.map(n=>n.id===t.payload.id?t.payload:n)};default:return e}},oC=h.createContext({}),rc=()=>h.useContext(oC),Y4=({children:e})=>{const[t,n]=h.useReducer(W4,{accesses:[]});h.useEffect(()=>{(async()=>{const a=await V4();n({type:"SET_ACCESSES",payload:a})})()},[]);const r=h.useCallback(i=>{n({type:"DELETE_ACCESS",payload:i})},[]),o=h.useCallback(i=>{n({type:"ADD_ACCESS",payload:i})},[]),s=h.useCallback(i=>{n({type:"UPDATE_ACCESS",payload:i})},[]);return c.jsx(oC.Provider,{value:{config:{accesses:t.accesses},deleteAccess:r,addAccess:o,updateAccess:s},children:e&&e})};function H4(){const e=as(),t=is();if(!Vt().authStore.isValid||!Vt().authStore.isAdmin)return c.jsx(HS,{to:"/login"});const n=t.pathname,r=s=>(console.log(n),s==n?"bg-muted text-primary":"text-muted-foreground"),o=()=>{Vt().authStore.clear(),e("/login")};return c.jsx(c.Fragment,{children:c.jsx(Y4,{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 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 px-4 lg:h-[60px] lg:px-6",children:c.jsxs($r,{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:"",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($r,{to:"/",className:se("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",r("/")),children:[c.jsx(vp,{className:"h-4 w-4"}),"域名列表"]}),c.jsxs($r,{to:"/access",className:se("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",r("/access")),children:[c.jsx(hx,{className:"h-4 w-4"}),"授权管理"]}),c.jsxs($r,{to:"/history",className:se("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",r("/history")),children:[c.jsx(dx,{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 bg-muted/40 px-4 lg:h-[60px] lg:px-6",children:[c.jsxs(o1,{children:[c.jsx(s1,{asChild:!0,children:c.jsxs(Dt,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[c.jsx(Fj,{className:"h-5 w-5"}),c.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),c.jsx(Mg,{side:"left",className:"flex flex-col",children:c.jsxs("nav",{className:"grid gap-2 text-lg font-medium",children:[c.jsxs($r,{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:"",children:"Certimate"}),c.jsx("span",{className:"sr-only",children:"Certimate"})]}),c.jsxs($r,{to:"/",className:se("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",r("/")),children:[c.jsx(vp,{className:"h-5 w-5"}),"域名列表"]}),c.jsxs($r,{to:"/access",className:se("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",r("/dns_provider")),children:[c.jsx(hx,{className:"h-5 w-5"}),"授权管理"]}),c.jsxs($r,{to:"/history",className:se("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",r("/history")),children:[c.jsx(dx,{className:"h-5 w-5"}),"部署历史"]})]})})]}),c.jsx("div",{className:"w-full flex-1"}),c.jsxs(sI,{children:[c.jsx(iI,{asChild:!0,children:c.jsxs(Dt,{variant:"secondary",size:"icon",className:"rounded-full",children:[c.jsx(Ij,{className:"h-5 w-5"}),c.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),c.jsxs(Lb,{align:"end",children:[c.jsx(Ub,{children:"My Account"}),c.jsx($b,{}),c.jsx(Fb,{onClick:o,children:"Logout"})]})]})]}),c.jsxs("main",{className:"flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 relative",children:[c.jsx(BS,{}),c.jsxs("div",{className:"fixed right-0 bottom-0 w-full flex justify-between p-5",children:[c.jsx("div",{className:""}),c.jsx("div",{className:"text-muted-foreground text-sm hover:text-stone-900",children:c.jsx("a",{href:"https://github.com/usual2970/certimate/releases",target:"_blank",children:"Certimate v0.0.3"})})]})]})]})]})})})}var B4="Separator",Zx="horizontal",G4=["horizontal","vertical"],sC=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=Zx,...o}=e,s=K4(r)?r:Zx,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return c.jsx(ve.div,{"data-orientation":s,...a,...o,ref:t})});sC.displayName=B4;function K4(e){return G4.includes(e)}var iC=sC;const Ht=h.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>c.jsx(iC,{ref:o,decorative:n,orientation:t,className:se("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Ht.displayName=iC.displayName;const aC=({phase:e,phaseSuccess:t})=>{let n=c.jsx(c.Fragment,{children:" "});return e==="check"&&(t?n=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Ht,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),c.jsx(Ht,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):n=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"检查 "}),c.jsx(Ht,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),c.jsx(Ht,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="apply"&&(t?n=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Ht,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),c.jsx(Ht,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):n=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Ht,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"获取"}),c.jsx(Ht,{className:"h-1 grow"}),c.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="deploy"&&(t?n=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Ht,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),c.jsx(Ht,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"部署"})]}):n=c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),c.jsx(Ht,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),c.jsx(Ht,{className:"h-1 grow bg-green-600"}),c.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"部署"})]})),n},Z4=({when:e,children:t,fallback:n})=>e?t:n;var lC="AlertDialog",[q4,i3]=_n(lC,[zb]),yo=zb(),cC=e=>{const{__scopeAlertDialog:t,...n}=e,r=yo(t);return c.jsx(Pg,{...r,...n,modal:!0})};cC.displayName=lC;var X4="AlertDialogTrigger",uC=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=yo(n);return c.jsx(jg,{...o,...r,ref:t})});uC.displayName=X4;var Q4="AlertDialogPortal",dC=e=>{const{__scopeAlertDialog:t,...n}=e,r=yo(t);return c.jsx(Dg,{...r,...n})};dC.displayName=Q4;var J4="AlertDialogOverlay",fC=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=yo(n);return c.jsx(Zl,{...o,...r,ref:t})});fC.displayName=J4;var Di="AlertDialogContent",[eU,tU]=q4(Di),hC=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,s=yo(n),i=h.useRef(null),a=be(t,i),l=h.useRef(null);return c.jsx(gI,{contentName:Di,titleName:pC,docsSlug:"alert-dialog",children:c.jsx(eU,{scope:n,cancelRef:l,children:c.jsxs(ql,{role:"alertdialog",...s,...o,ref:a,onOpenAutoFocus:G(o.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(Jm,{children:r}),c.jsx(rU,{contentRef:i})]})})})});hC.displayName=Di;var pC="AlertDialogTitle",mC=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=yo(n);return c.jsx(Xl,{...o,...r,ref:t})});mC.displayName=pC;var gC="AlertDialogDescription",vC=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=yo(n);return c.jsx(Ql,{...o,...r,ref:t})});vC.displayName=gC;var nU="AlertDialogAction",yC=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=yo(n);return c.jsx(Gd,{...o,...r,ref:t})});yC.displayName=nU;var xC="AlertDialogCancel",wC=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=tU(xC,n),s=yo(n),i=be(t,o);return c.jsx(Gd,{...s,...r,ref:i})});wC.displayName=xC;var rU=({contentRef:e})=>{const t=`\`${Di}\` requires a description for the component to be accessible for screen reader users. - -You can add a description to the \`${Di}\` by passing a \`${gC}\` 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 \`${Di}\`. 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 h.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},oU=cC,sU=uC,iU=dC,SC=fC,_C=hC,bC=yC,CC=wC,kC=mC,EC=vC;const aU=oU,lU=sU,cU=iU,TC=h.forwardRef(({className:e,...t},n)=>c.jsx(SC,{className:se("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:n}));TC.displayName=SC.displayName;const RC=h.forwardRef(({className:e,...t},n)=>c.jsxs(cU,{children:[c.jsx(TC,{}),c.jsx(_C,{ref:n,className:se("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})]}));RC.displayName=_C.displayName;const NC=({className:e,...t})=>c.jsx("div",{className:se("flex flex-col space-y-2 text-center sm:text-left",e),...t});NC.displayName="AlertDialogHeader";const PC=({className:e,...t})=>c.jsx("div",{className:se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});PC.displayName="AlertDialogFooter";const jC=h.forwardRef(({className:e,...t},n)=>c.jsx(kC,{ref:n,className:se("text-lg font-semibold",e),...t}));jC.displayName=kC.displayName;const DC=h.forwardRef(({className:e,...t},n)=>c.jsx(EC,{ref:n,className:se("text-sm text-muted-foreground",e),...t}));DC.displayName=EC.displayName;const MC=h.forwardRef(({className:e,...t},n)=>c.jsx(bC,{ref:n,className:se(tg(),e),...t}));MC.displayName=bC.displayName;const OC=h.forwardRef(({className:e,...t},n)=>c.jsx(CC,{ref:n,className:se(tg({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));OC.displayName=CC.displayName;function ov(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var sv="Switch",[uU,a3]=_n(sv),[dU,fU]=uU(sv),AC=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:l="on",onCheckedChange:u,...d}=e,[f,p]=h.useState(null),x=be(t,m=>p(m)),g=h.useRef(!1),y=f?!!f.closest("form"):!0,[S=!1,v]=so({prop:o,defaultProp:s,onChange:u});return c.jsxs(dU,{scope:n,checked:S,disabled:a,children:[c.jsx(ve.button,{type:"button",role:"switch","aria-checked":S,"aria-required":i,"data-state":FC(S),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:x,onClick:G(e.onClick,m=>{v(w=>!w),y&&(g.current=m.isPropagationStopped(),g.current||m.stopPropagation())})}),y&&c.jsx(hU,{control:f,bubbles:!g.current,name:r,value:l,checked:S,required:i,disabled:a,style:{transform:"translateX(-100%)"}})]})});AC.displayName=sv;var IC="SwitchThumb",LC=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=fU(IC,n);return c.jsx(ve.span,{"data-state":FC(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});LC.displayName=IC;var hU=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,s=h.useRef(null),i=ov(n),a=ug(t);return h.useEffect(()=>{const l=s.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==n&&f){const p=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(p)}},[i,n,r]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function FC(e){return e?"checked":"unchecked"}var UC=AC,pU=LC;const $C=h.forwardRef(({className:e,...t},n)=>c.jsx(UC,{className:se("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:n,children:c.jsx(pU,{className:se("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")})}));$C.displayName=UC.displayName;var mU="VisuallyHidden",oc=h.forwardRef((e,t)=>c.jsx(ve.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));oc.displayName=mU;var gU=oc,iv="ToastProvider",[av,vU,yU]=Ld("Toast"),[VC,l3]=_n("Toast",[yU]),[xU,sf]=VC(iv),zC=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,l]=h.useState(null),[u,d]=h.useState(0),f=h.useRef(!1),p=h.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${iv}\`. Expected non-empty \`string\`.`),c.jsx(av.Provider,{scope:t,children:c.jsx(xU,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:h.useCallback(()=>d(x=>x+1),[]),onToastRemove:h.useCallback(()=>d(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:i})})};zC.displayName=iv;var WC="ToastViewport",wU=["F8"],Mp="toast.viewportPause",Op="toast.viewportResume",YC=h.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=wU,label:o="Notifications ({hotkey})",...s}=e,i=sf(WC,n),a=vU(n),l=h.useRef(null),u=h.useRef(null),d=h.useRef(null),f=h.useRef(null),p=be(t,f,i.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=i.toastCount>0;h.useEffect(()=>{const S=v=>{var w;r.every(b=>v[b]||v.code===b)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[r]),h.useEffect(()=>{const S=l.current,v=f.current;if(g&&S&&v){const m=()=>{if(!i.isClosePausedRef.current){const _=new CustomEvent(Mp);v.dispatchEvent(_),i.isClosePausedRef.current=!0}},w=()=>{if(i.isClosePausedRef.current){const _=new CustomEvent(Op);v.dispatchEvent(_),i.isClosePausedRef.current=!1}},b=_=>{!S.contains(_.relatedTarget)&&w()},C=()=>{S.contains(document.activeElement)||w()};return S.addEventListener("focusin",m),S.addEventListener("focusout",b),S.addEventListener("pointermove",m),S.addEventListener("pointerleave",C),window.addEventListener("blur",m),window.addEventListener("focus",w),()=>{S.removeEventListener("focusin",m),S.removeEventListener("focusout",b),S.removeEventListener("pointermove",m),S.removeEventListener("pointerleave",C),window.removeEventListener("blur",m),window.removeEventListener("focus",w)}}},[g,i.isClosePausedRef]);const y=h.useCallback(({tabbingDirection:S})=>{const m=a().map(w=>{const b=w.ref.current,C=[b,...MU(b)];return S==="forwards"?C:C.reverse()});return(S==="forwards"?m.reverse():m).flat()},[a]);return h.useEffect(()=>{const S=f.current;if(S){const v=m=>{var C,_,R;const w=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!w){const N=document.activeElement,D=m.shiftKey;if(m.target===S&&D){(C=u.current)==null||C.focus();return}const A=y({tabbingDirection:D?"backwards":"forwards"}),H=A.findIndex(L=>L===N);ph(A.slice(H+1))?m.preventDefault():D?(_=u.current)==null||_.focus():(R=d.current)==null||R.focus()}};return S.addEventListener("keydown",v),()=>S.removeEventListener("keydown",v)}},[a,y]),c.jsxs(LD,{ref:l,role:"region","aria-label":o.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&c.jsx(Ap,{ref:u,onFocusFromOutsideViewport:()=>{const S=y({tabbingDirection:"forwards"});ph(S)}}),c.jsx(av.Slot,{scope:n,children:c.jsx(ve.ol,{tabIndex:-1,...s,ref:p})}),g&&c.jsx(Ap,{ref:d,onFocusFromOutsideViewport:()=>{const S=y({tabbingDirection:"backwards"});ph(S)}})]})});YC.displayName=WC;var HC="ToastFocusProxy",Ap=h.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=sf(HC,n);return c.jsx(oc,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var u;const a=i.relatedTarget;!((u=s.viewport)!=null&&u.contains(a))&&r()}})});Ap.displayName=HC;var af="Toast",SU="toast.swipeStart",_U="toast.swipeMove",bU="toast.swipeCancel",CU="toast.swipeEnd",BC=h.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,l]=so({prop:r,defaultProp:o,onChange:s});return c.jsx(fn,{present:n||a,children:c.jsx(TU,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:_t(e.onPause),onResume:_t(e.onResume),onSwipeStart:G(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:G(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:G(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:G(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)})})})});BC.displayName=af;var[kU,EU]=VC(af,{onClose(){}}),TU=h.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:x,...g}=e,y=sf(af,n),[S,v]=h.useState(null),m=be(t,L=>v(L)),w=h.useRef(null),b=h.useRef(null),C=o||y.duration,_=h.useRef(0),R=h.useRef(C),N=h.useRef(0),{onToastAdd:D,onToastRemove:O}=y,B=_t(()=>{var K;(S==null?void 0:S.contains(document.activeElement))&&((K=y.viewport)==null||K.focus()),i()}),A=h.useCallback(L=>{!L||L===1/0||(window.clearTimeout(N.current),_.current=new Date().getTime(),N.current=window.setTimeout(B,L))},[B]);h.useEffect(()=>{const L=y.viewport;if(L){const K=()=>{A(R.current),u==null||u()},ne=()=>{const W=new Date().getTime()-_.current;R.current=R.current-W,window.clearTimeout(N.current),l==null||l()};return L.addEventListener(Mp,ne),L.addEventListener(Op,K),()=>{L.removeEventListener(Mp,ne),L.removeEventListener(Op,K)}}},[y.viewport,C,l,u,A]),h.useEffect(()=>{s&&!y.isClosePausedRef.current&&A(C)},[s,C,y.isClosePausedRef,A]),h.useEffect(()=>(D(),()=>O()),[D,O]);const H=h.useMemo(()=>S?JC(S):null,[S]);return y.viewport?c.jsxs(c.Fragment,{children:[H&&c.jsx(RU,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:H}),c.jsx(kU,{scope:n,onClose:B,children:fo.createPortal(c.jsx(av.ItemSlot,{scope:n,children:c.jsx(ID,{asChild:!0,onEscapeKeyDown:G(a,()=>{y.isFocusedToastEscapeKeyDownRef.current||B(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(ve.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":y.swipeDirection,...g,ref:m,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:G(e.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:G(e.onPointerDown,L=>{L.button===0&&(w.current={x:L.clientX,y:L.clientY})}),onPointerMove:G(e.onPointerMove,L=>{if(!w.current)return;const K=L.clientX-w.current.x,ne=L.clientY-w.current.y,W=!!b.current,F=["left","right"].includes(y.swipeDirection),M=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,X=F?M(0,K):0,le=F?0:M(0,ne),me=L.pointerType==="touch"?10:2,rt={x:X,y:le},je={originalEvent:L,delta:rt};W?(b.current=rt,Bc(_U,f,je,{discrete:!1})):qx(rt,y.swipeDirection,me)?(b.current=rt,Bc(SU,d,je,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(K)>me||Math.abs(ne)>me)&&(w.current=null)}),onPointerUp:G(e.onPointerUp,L=>{const K=b.current,ne=L.target;if(ne.hasPointerCapture(L.pointerId)&&ne.releasePointerCapture(L.pointerId),b.current=null,w.current=null,K){const W=L.currentTarget,F={originalEvent:L,delta:K};qx(K,y.swipeDirection,y.swipeThreshold)?Bc(CU,x,F,{discrete:!0}):Bc(bU,p,F,{discrete:!0}),W.addEventListener("click",M=>M.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),RU=e=>{const{__scopeToast:t,children:n,...r}=e,o=sf(af,t),[s,i]=h.useState(!1),[a,l]=h.useState(!1);return jU(()=>i(!0)),h.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:c.jsx(Bl,{asChild:!0,children:c.jsx(oc,{...r,children:s&&c.jsxs(c.Fragment,{children:[o.label," ",n]})})})},NU="ToastTitle",GC=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.jsx(ve.div,{...r,ref:t})});GC.displayName=NU;var PU="ToastDescription",KC=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.jsx(ve.div,{...r,ref:t})});KC.displayName=PU;var ZC="ToastAction",qC=h.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?c.jsx(QC,{altText:n,asChild:!0,children:c.jsx(lv,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${ZC}\`. Expected non-empty \`string\`.`),null)});qC.displayName=ZC;var XC="ToastClose",lv=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=EU(XC,n);return c.jsx(QC,{asChild:!0,children:c.jsx(ve.button,{type:"button",...r,ref:t,onClick:G(e.onClick,o.onClose)})})});lv.displayName=XC;var QC=h.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return c.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function JC(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),DU(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...JC(r))}}),t}function Bc(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ng(o,s):o.dispatchEvent(s)}var qx=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function jU(e=()=>{}){const t=_t(e);Kt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function DU(e){return e.nodeType===e.ELEMENT_NODE}function MU(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ph(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var OU=zC,ek=YC,tk=BC,nk=GC,rk=KC,ok=qC,sk=lv;const AU=OU,ik=h.forwardRef(({className:e,...t},n)=>c.jsx(ek,{ref:n,className:se("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}));ik.displayName=ek.displayName;const IU=Wl("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"}}),ak=h.forwardRef(({className:e,variant:t,...n},r)=>c.jsx(tk,{ref:r,className:se(IU({variant:t}),e),...n}));ak.displayName=tk.displayName;const LU=h.forwardRef(({className:e,...t},n)=>c.jsx(ok,{ref:n,className:se("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}));LU.displayName=ok.displayName;const lk=h.forwardRef(({className:e,...t},n)=>c.jsx(sk,{ref:n,className:se("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(Qm,{className:"h-4 w-4"})}));lk.displayName=sk.displayName;const ck=h.forwardRef(({className:e,...t},n)=>c.jsx(nk,{ref:n,className:se("text-sm font-semibold",e),...t}));ck.displayName=nk.displayName;const uk=h.forwardRef(({className:e,...t},n)=>c.jsx(rk,{ref:n,className:se("text-sm opacity-90",e),...t}));uk.displayName=rk.displayName;const FU=1,UU=1e6;let mh=0;function $U(){return mh=(mh+1)%Number.MAX_SAFE_INTEGER,mh.toString()}const gh=new Map,Xx=e=>{if(gh.has(e))return;const t=setTimeout(()=>{gh.delete(e),Ya({type:"REMOVE_TOAST",toastId:e})},UU);gh.set(e,t)},VU=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,FU)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?Xx(n):e.toasts.forEach(r=>{Xx(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},hu=[];let pu={toasts:[]};function Ya(e){pu=VU(pu,e),hu.forEach(t=>{t(pu)})}function zU({...e}){const t=$U(),n=o=>Ya({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Ya({type:"DISMISS_TOAST",toastId:t});return Ya({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function cv(){const[e,t]=h.useState(pu);return h.useEffect(()=>(hu.push(t),()=>{const n=hu.indexOf(t);n>-1&&hu.splice(n,1)}),[e]),{...e,toast:zU,dismiss:n=>Ya({type:"DISMISS_TOAST",toastId:n})}}function dk(){const{toasts:e}=cv();return c.jsxs(AU,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return c.jsxs(ak,{...s,children:[c.jsxs("div",{className:"grid gap-1",children:[n&&c.jsx(ck,{children:n}),r&&c.jsx(uk,{children:r})]}),o,c.jsx(lk,{})]},t)}),c.jsx(ik,{})]})}var[lf,c3]=_n("Tooltip",[na]),cf=na(),fk="TooltipProvider",WU=700,Ip="tooltip.open",[YU,uv]=lf(fk),hk=e=>{const{__scopeTooltip:t,delayDuration:n=WU,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,[i,a]=h.useState(!0),l=h.useRef(!1),u=h.useRef(0);return h.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),c.jsx(YU,{scope:t,isOpenDelayed:i,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:h.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:h.useCallback(d=>{l.current=d},[]),disableHoverableContent:o,children:s})};hk.displayName=fk;var uf="Tooltip",[HU,df]=lf(uf),pk=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,l=uv(uf,e.__scopeTooltip),u=cf(t),[d,f]=h.useState(null),p=Tr(),x=h.useRef(0),g=i??l.disableHoverableContent,y=a??l.delayDuration,S=h.useRef(!1),[v=!1,m]=so({prop:r,defaultProp:o,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(Ip))):l.onClose(),s==null||s(R)}}),w=h.useMemo(()=>v?S.current?"delayed-open":"instant-open":"closed",[v]),b=h.useCallback(()=>{window.clearTimeout(x.current),S.current=!1,m(!0)},[m]),C=h.useCallback(()=>{window.clearTimeout(x.current),m(!1)},[m]),_=h.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{S.current=!0,m(!0)},y)},[y,m]);return h.useEffect(()=>()=>window.clearTimeout(x.current),[]),c.jsx(hg,{...u,children:c.jsx(HU,{scope:t,contentId:p,open:v,stateAttribute:w,trigger:d,onTriggerChange:f,onTriggerEnter:h.useCallback(()=>{l.isOpenDelayed?_():b()},[l.isOpenDelayed,_,b]),onTriggerLeave:h.useCallback(()=>{g?C():window.clearTimeout(x.current)},[C,g]),onOpen:b,onClose:C,disableHoverableContent:g,children:n})})};pk.displayName=uf;var Lp="TooltipTrigger",mk=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=df(Lp,n),s=uv(Lp,n),i=cf(n),a=h.useRef(null),l=be(t,a,o.onTriggerChange),u=h.useRef(!1),d=h.useRef(!1),f=h.useCallback(()=>u.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(pg,{asChild:!0,...i,children:c.jsx(ve.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:G(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:G(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:G(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:G(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:G(e.onBlur,o.onClose),onClick:G(e.onClick,o.onClose)})})});mk.displayName=Lp;var BU="TooltipPortal",[u3,GU]=lf(BU,{forceMount:void 0}),zi="TooltipContent",dv=h.forwardRef((e,t)=>{const n=GU(zi,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=df(zi,e.__scopeTooltip);return c.jsx(fn,{present:r||i.open,children:i.disableHoverableContent?c.jsx(gk,{side:o,...s,ref:t}):c.jsx(KU,{side:o,...s,ref:t})})}),KU=h.forwardRef((e,t)=>{const n=df(zi,e.__scopeTooltip),r=uv(zi,e.__scopeTooltip),o=h.useRef(null),s=be(t,o),[i,a]=h.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,p=h.useCallback(()=>{a(null),f(!1)},[f]),x=h.useCallback((g,y)=>{const S=g.currentTarget,v={x:g.clientX,y:g.clientY},m=QU(v,S.getBoundingClientRect()),w=JU(v,m),b=e$(y.getBoundingClientRect()),C=n$([...w,...b]);a(C),f(!0)},[f]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(l&&d){const g=S=>x(S,d),y=S=>x(S,l);return l.addEventListener("pointerleave",g),d.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",y)}}},[l,d,x,p]),h.useEffect(()=>{if(i){const g=y=>{const S=y.target,v={x:y.clientX,y:y.clientY},m=(l==null?void 0:l.contains(S))||(d==null?void 0:d.contains(S)),w=!t$(v,i);m?p():w&&(p(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,d,i,u,p]),c.jsx(gk,{...e,ref:s})}),[ZU,qU]=lf(uf,{isInside:!1}),gk=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=df(zi,n),u=cf(n),{onClose:d}=l;return h.useEffect(()=>(document.addEventListener(Ip,d),()=>document.removeEventListener(Ip,d)),[d]),h.useEffect(()=>{if(l.trigger){const f=p=>{const x=p.target;x!=null&&x.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),c.jsx(Ji,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:c.jsxs(mg,{"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(Jm,{children:r}),c.jsx(ZU,{scope:n,isInside:!0,children:c.jsx(gU,{id:l.contentId,role:"tooltip",children:o||r})})]})})});dv.displayName=zi;var vk="TooltipArrow",XU=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=cf(n);return qU(vk,n).isInside?null:c.jsx(gg,{...o,...r,ref:t})});XU.displayName=vk;function QU(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function JU(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function e$(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function t$(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;sr!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function n$(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),r$(t)}function r$(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var o$=pk,s$=mk,yk=dv;const i$=o$,a$=s$,l$=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(yk,{ref:r,sideOffset:t,className:se("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),...n}));l$.displayName=yk.displayName;const _l=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)},c$=e=>_l(e).split(" ")[0],u$=async()=>Vt().collection("domains").getFullList({sort:"-created",expand:"lastDeployment"}),d$=async e=>await Vt().collection("domains").getOne(e),Fp=async e=>e.id?await Vt().collection("domains").update(e.id,e):await Vt().collection("domains").create(e),f$=async e=>await Vt().collection("domains").delete(e),h$=(e,t)=>Vt().collection("domains").subscribe(e,n=>{n.action==="update"&&t(n.record)},{expand:"lastDeployment"}),p$=e=>{Vt().collection("domains").unsubscribe(e)},m$=()=>{const e=cv(),t=as(),n=()=>{t("/edit")},r=d=>{t(`/edit?id=${d}`)},o=d=>{t(`/history?domain=${d}`)},s=async d=>{try{await f$(d),a(i.filter(f=>f.id!==d))}catch(f){console.error("Error deleting domain:",f)}},[i,a]=h.useState([]);h.useEffect(()=>{(async()=>{const f=await u$();a(f)})()},[]);const l=async d=>{const f=i.filter(y=>y.id===d),p=f[0].enabled,x=f[0];x.enabled=!p,await Fp(x);const g=i.map(y=>y.id===d?{...y,checked:!p}:y);a(g)},u=async d=>{try{p$(d.id),h$(d.id,f=>{console.log(f);const p=i.map(x=>x.id===f.id?{...f}:x);a(p)}),d.rightnow=!0,await Fp(d),e.toast({title:"操作成功",description:"已发起部署,请稍后查看部署日志。"})}catch{e.toast({title:"执行失败",description:c.jsxs(c.Fragment,{children:["执行失败,请查看",c.jsx($r,{to:`/history?domain=${d.id}`,className:"underline text-blue-500",children:"部署日志"}),"查看详情。"]}),variant:"destructive"})}};return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"",children:[c.jsx(dk,{}),c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("div",{className:"text-muted-foreground",children:"域名列表"}),c.jsx(Dt,{onClick:n,children:"新增域名"})]}),i.length?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b 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:"域名"}),i.map(d=>{var f,p,x,g,y,S;return c.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b 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:d.domain}),c.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:c.jsx("div",{children:d.expiredAt?c.jsxs(c.Fragment,{children:[c.jsx("div",{children:"有效期90天"}),c.jsxs("div",{children:[c$(d.expiredAt),"到期"]})]}):"---"})}),c.jsx("div",{className:"sm:w-32 w-full pt-1 sm:pt-0 flex items-center",children:d.lastDeployedAt&&((f=d.expand)!=null&&f.lastDeployment)?c.jsx(c.Fragment,{children:((p=d.expand.lastDeployment)==null?void 0:p.phase)==="deploy"&&((x=d.expand.lastDeployment)!=null&&x.phaseSuccess)?c.jsx(qS,{size:16,className:"text-green-700"}):c.jsx(XS,{size:16,className:"text-red-700"})}):"---"}),c.jsx("div",{className:"sm:w-64 w-full pt-1 sm:pt-0 flex items-center",children:d.lastDeployedAt&&((g=d.expand)!=null&&g.lastDeployment)?c.jsx(aC,{phase:(y=d.expand.lastDeployment)==null?void 0:y.phase,phaseSuccess:(S=d.expand.lastDeployment)==null?void 0:S.phaseSuccess}):"---"}),c.jsx("div",{className:"sm:w-40 pt-1 sm:pt-0 sm:ml-2 flex items-center",children:d.lastDeployedAt?_l(d.lastDeployedAt):"---"}),c.jsx("div",{className:"sm:w-32 flex items-center",children:c.jsx(hk,{children:c.jsxs(i$,{children:[c.jsx(a$,{children:c.jsx($C,{checked:d.enabled,onCheckedChange:()=>{l(d.id)}})}),c.jsx(dv,{children:c.jsx("div",{className:"border rounded-sm px-3 bg-background text-muted-foreground text-xs",children:d.enabled?"禁用":"启用"})})]})})}),c.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[c.jsx(Dt,{variant:"link",className:"p-0",onClick:()=>o(d.id),children:"部署历史"}),c.jsxs(Z4,{when:!!d.enabled,children:[c.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(Dt,{variant:"link",className:"p-0",onClick:()=>u(d),children:"立即部署"})]}),!d.enabled&&c.jsxs(c.Fragment,{children:[c.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),c.jsxs(aU,{children:[c.jsx(lU,{asChild:!0,children:c.jsx(Dt,{variant:"link",className:"p-0",children:"删除"})}),c.jsxs(RC,{children:[c.jsxs(NC,{children:[c.jsx(jC,{children:"删除域名"}),c.jsx(DC,{children:"确定要删除域名吗?"})]}),c.jsxs(PC,{children:[c.jsx(OC,{children:"取消"}),c.jsx(MC,{onClick:()=>{s(d.id)},children:"确认"})]})]})]}),c.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(Dt,{variant:"link",className:"p-0",onClick:()=>r(d.id),children:"编辑"})]})]})]},d.id)})]}):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(vp,{size:40,className:"text-primary"})}),c.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),c.jsx(Dt,{onClick:n,className:"mt-3",children:"添加域名"})]})})]})})},ct=h.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{type:t,className:se("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:r,...n}));ct.displayName="Input";var sc=e=>e.type==="checkbox",yi=e=>e instanceof Date,an=e=>e==null;const xk=e=>typeof e=="object";var Ft=e=>!an(e)&&!Array.isArray(e)&&xk(e)&&!yi(e),wk=e=>Ft(e)&&e.target?sc(e.target)?e.target.checked:e.target.value:e,g$=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Sk=(e,t)=>e.has(g$(t)),v$=e=>{const t=e.constructor&&e.constructor.prototype;return Ft(t)&&t.hasOwnProperty("isPrototypeOf")},fv=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function gn(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(fv&&(e instanceof Blob||e instanceof FileList))&&(n||Ft(e)))if(t=n?[]:{},!n&&!v$(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=gn(e[r]));else return e;return t}var ff=e=>Array.isArray(e)?e.filter(Boolean):[],Tt=e=>e===void 0,Z=(e,t,n)=>{if(!t||!Ft(e))return n;const r=ff(t.split(/[,[\].]+?/)).reduce((o,s)=>an(o)?o:o[s],e);return Tt(r)||r===e?Tt(e[t])?n:e[t]:r},_r=e=>typeof e=="boolean",hv=e=>/^\w*$/.test(e),_k=e=>ff(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ke=(e,t,n)=>{let r=-1;const o=hv(t)?[t]:_k(t),s=o.length,i=s-1;for(;++rOe.useContext(bk),y$=e=>{const{children:t,...n}=e;return Oe.createElement(bk.Provider,{value:n},t)};var Ck=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==nr.all&&(t._proxyFormState[i]=!r||nr.all),n&&(n[i]=!0),e[i]}});return o},kn=e=>Ft(e)&&!Object.keys(e).length,kk=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return kn(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===(!r||nr.all))},Ha=e=>Array.isArray(e)?e:[e],Ek=(e,t,n)=>!e||!t||e===t||Ha(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function pv(e){const t=Oe.useRef(e);t.current=e,Oe.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function x$(e){const t=hf(),{control:n=t.control,disabled:r,name:o,exact:s}=e||{},[i,a]=Oe.useState(n._formState),l=Oe.useRef(!0),u=Oe.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=Oe.useRef(o);return d.current=o,pv({disabled:r,next:f=>l.current&&Ek(d.current,f.name,s)&&kk(f,u.current,n._updateFormState)&&a({...n._formState,...f}),subject:n._subjects.state}),Oe.useEffect(()=>(l.current=!0,u.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),Ck(i,n,u.current,!1)}var Cr=e=>typeof e=="string",Tk=(e,t,n,r,o)=>Cr(e)?(r&&t.watch.add(e),Z(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),Z(n,s))):(r&&(t.watchAll=!0),n);function w$(e){const t=hf(),{control:n=t.control,name:r,defaultValue:o,disabled:s,exact:i}=e||{},a=Oe.useRef(r);a.current=r,pv({disabled:s,subject:n._subjects.values,next:d=>{Ek(a.current,d.name,i)&&u(gn(Tk(a.current,n._names,d.values||n._formValues,!1,o)))}});const[l,u]=Oe.useState(n._getWatch(r,o));return Oe.useEffect(()=>n._removeUnmounted()),l}function S$(e){const t=hf(),{name:n,disabled:r,control:o=t.control,shouldUnregister:s}=e,i=Sk(o._names.array,n),a=w$({control:o,name:n,defaultValue:Z(o._formValues,n,Z(o._defaultValues,n,e.defaultValue)),exact:!0}),l=x$({control:o,name:n}),u=Oe.useRef(o.register(n,{...e.rules,value:a,..._r(e.disabled)?{disabled:e.disabled}:{}}));return Oe.useEffect(()=>{const d=o._options.shouldUnregister||s,f=(p,x)=>{const g=Z(o._fields,p);g&&g._f&&(g._f.mount=x)};if(f(n,!0),d){const p=gn(Z(o._options.defaultValues,n));Ke(o._defaultValues,n,p),Tt(Z(o._formValues,n))&&Ke(o._formValues,n,p)}return()=>{(i?d&&!o._state.action:d)?o.unregister(n):f(n,!1)}},[n,o,i,s]),Oe.useEffect(()=>{Z(o._fields,n)&&o._updateDisabledField({disabled:r,fields:o._fields,name:n,value:Z(o._fields,n)._f.value})},[r,n,o]),{field:{name:n,value:a,..._r(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:Oe.useCallback(d=>u.current.onChange({target:{value:wk(d),name:n},type:td.CHANGE}),[n]),onBlur:Oe.useCallback(()=>u.current.onBlur({target:{value:Z(o._formValues,n),name:n},type:td.BLUR}),[n,o]),ref:d=>{const f=Z(o._fields,n);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:()=>!!Z(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!Z(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Z(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Z(l.validatingFields,n)},error:{enumerable:!0,get:()=>Z(l.errors,n)}})}}const _$=e=>e.render(S$(e));var Rk=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Qx=e=>({isOnSubmit:!e||e===nr.onSubmit,isOnBlur:e===nr.onBlur,isOnChange:e===nr.onChange,isOnAll:e===nr.all,isOnTouch:e===nr.onTouched}),Jx=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Ba=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=Z(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!r)break;if(i.ref&&t(i.ref,i.name)&&!r)break;Ba(a,t)}else Ft(a)&&Ba(a,t)}}};var b$=(e,t,n)=>{const r=Ha(Z(e,n));return Ke(r,"root",t[n]),Ke(e,n,r),e},mv=e=>e.type==="file",Lo=e=>typeof e=="function",nd=e=>{if(!fv)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},mu=e=>Cr(e),gv=e=>e.type==="radio",rd=e=>e instanceof RegExp;const ew={value:!1,isValid:!1},tw={value:!0,isValid:!0};var Nk=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Tt(e[0].attributes.value)?Tt(e[0].value)||e[0].value===""?tw:{value:e[0].value,isValid:!0}:tw:ew}return ew};const nw={isValid:!1,value:null};var Pk=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,nw):nw;function rw(e,t,n="validate"){if(mu(e)||Array.isArray(e)&&e.every(mu)||_r(e)&&!e)return{type:n,message:mu(e)?e:"",ref:t}}var ti=e=>Ft(e)&&!rd(e)?e:{value:e,message:""},ow=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:a,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:x,name:g,valueAsNumber:y,mount:S,disabled:v}=e._f,m=Z(t,g);if(!S||v)return{};const w=i?i[0]:s,b=A=>{r&&w.reportValidity&&(w.setCustomValidity(_r(A)?"":A||""),w.reportValidity())},C={},_=gv(s),R=sc(s),N=_||R,D=(y||mv(s))&&Tt(s.value)&&Tt(m)||nd(s)&&s.value===""||m===""||Array.isArray(m)&&!m.length,O=Rk.bind(null,g,n,C),B=(A,H,L,K=Ur.maxLength,ne=Ur.minLength)=>{const W=A?H:L;C[g]={type:A?K:ne,message:W,ref:s,...O(A?K:ne,W)}};if(o?!Array.isArray(m)||!m.length:a&&(!N&&(D||an(m))||_r(m)&&!m||R&&!Nk(i).isValid||_&&!Pk(i).isValid)){const{value:A,message:H}=mu(a)?{value:!!a,message:a}:ti(a);if(A&&(C[g]={type:Ur.required,message:H,ref:w,...O(Ur.required,H)},!n))return b(H),C}if(!D&&(!an(d)||!an(f))){let A,H;const L=ti(f),K=ti(d);if(!an(m)&&!isNaN(m)){const ne=s.valueAsNumber||m&&+m;an(L.value)||(A=ne>L.value),an(K.value)||(H=nenew Date(new Date().toDateString()+" "+X),F=s.type=="time",M=s.type=="week";Cr(L.value)&&m&&(A=F?W(m)>W(L.value):M?m>L.value:ne>new Date(L.value)),Cr(K.value)&&m&&(H=F?W(m)+A.value,K=!an(H.value)&&m.length<+H.value;if((L||K)&&(B(L,A.message,H.message),!n))return b(C[g].message),C}if(p&&!D&&Cr(m)){const{value:A,message:H}=ti(p);if(rd(A)&&!m.match(A)&&(C[g]={type:Ur.pattern,message:H,ref:s,...O(Ur.pattern,H)},!n))return b(H),C}if(x){if(Lo(x)){const A=await x(m,t),H=rw(A,w);if(H&&(C[g]={...H,...O(Ur.validate,H.message)},!n))return b(H.message),C}else if(Ft(x)){let A={};for(const H in x){if(!kn(A)&&!n)break;const L=rw(await x[H](m,t),w,H);L&&(A={...L,...O(H,L.message)},b(L.message),n&&(C[g]=A))}if(!kn(A)&&(C[g]={ref:w,...A},!n))return C}}return b(!0),C};function C$(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}},od=e=>an(e)||!xk(e);function Ss(e,t){if(od(e)||od(t))return e===t;if(yi(e)&&yi(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const i=t[o];if(yi(s)&&yi(i)||Ft(s)&&Ft(i)||Array.isArray(s)&&Array.isArray(i)?!Ss(s,i):s!==i)return!1}}return!0}var jk=e=>e.type==="select-multiple",E$=e=>gv(e)||sc(e),yh=e=>nd(e)&&e.isConnected,Dk=e=>{for(const t in e)if(Lo(e[t]))return!0;return!1};function sd(e,t={}){const n=Array.isArray(e);if(Ft(e)||n)for(const r in e)Array.isArray(e[r])||Ft(e[r])&&!Dk(e[r])?(t[r]=Array.isArray(e[r])?[]:{},sd(e[r],t[r])):an(e[r])||(t[r]=!0);return t}function Mk(e,t,n){const r=Array.isArray(e);if(Ft(e)||r)for(const o in e)Array.isArray(e[o])||Ft(e[o])&&!Dk(e[o])?Tt(t)||od(n[o])?n[o]=Array.isArray(e[o])?sd(e[o],[]):{...sd(e[o])}:Mk(e[o],an(t)?{}:t[o],n[o]):n[o]=!Ss(e[o],t[o]);return n}var Gc=(e,t)=>Mk(e,t,sd(t)),Ok=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Tt(e)?e:t?e===""?NaN:e&&+e:n&&Cr(e)?new Date(e):r?r(e):e;function xh(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return mv(t)?t.files:gv(t)?Pk(e.refs).value:jk(t)?[...t.selectedOptions].map(({value:n})=>n):sc(t)?Nk(e.refs).value:Ok(Tt(t.value)?e.ref.value:t.value,e)}var T$=(e,t,n,r)=>{const o={};for(const s of e){const i=Z(t,s);i&&Ke(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Ca=e=>Tt(e)?e:rd(e)?e.source:Ft(e)?rd(e.value)?e.value.source:e.value:e,R$=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function sw(e,t,n){const r=Z(e,n);if(r||hv(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=Z(t,s),a=Z(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};o.pop()}return{name:n}}var N$=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,P$=(e,t)=>!ff(Z(e,t)).length&&Ot(e,t);const j$={mode:nr.onSubmit,reValidateMode:nr.onChange,shouldFocusError:!0};function D$(e={}){let t={...j$,...e},n={submitCount:0,isDirty:!1,isLoading:Lo(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Ft(t.defaultValues)||Ft(t.values)?gn(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:gn(o),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:vh(),array:vh(),state:vh()},p=Qx(t.mode),x=Qx(t.reValidateMode),g=t.criteriaMode===nr.all,y=k=>P=>{clearTimeout(u),u=setTimeout(k,P)},S=async k=>{if(d.isValid||k){const P=t.resolver?kn((await N()).errors):await O(r,!0);P!==n.isValid&&f.state.next({isValid:P})}},v=(k,P)=>{(d.isValidating||d.validatingFields)&&((k||Array.from(a.mount)).forEach(I=>{I&&(P?Ke(n.validatingFields,I,P):Ot(n.validatingFields,I))}),f.state.next({validatingFields:n.validatingFields,isValidating:!kn(n.validatingFields)}))},m=(k,P=[],I,J,Q=!0,Y=!0)=>{if(J&&I){if(i.action=!0,Y&&Array.isArray(Z(r,k))){const ue=I(Z(r,k),J.argA,J.argB);Q&&Ke(r,k,ue)}if(Y&&Array.isArray(Z(n.errors,k))){const ue=I(Z(n.errors,k),J.argA,J.argB);Q&&Ke(n.errors,k,ue),P$(n.errors,k)}if(d.touchedFields&&Y&&Array.isArray(Z(n.touchedFields,k))){const ue=I(Z(n.touchedFields,k),J.argA,J.argB);Q&&Ke(n.touchedFields,k,ue)}d.dirtyFields&&(n.dirtyFields=Gc(o,s)),f.state.next({name:k,isDirty:A(k,P),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ke(s,k,P)},w=(k,P)=>{Ke(n.errors,k,P),f.state.next({errors:n.errors})},b=k=>{n.errors=k,f.state.next({errors:n.errors,isValid:!1})},C=(k,P,I,J)=>{const Q=Z(r,k);if(Q){const Y=Z(s,k,Tt(I)?Z(o,k):I);Tt(Y)||J&&J.defaultChecked||P?Ke(s,k,P?Y:xh(Q._f)):K(k,Y),i.mount&&S()}},_=(k,P,I,J,Q)=>{let Y=!1,ue=!1;const Me={name:k},yt=!!(Z(r,k)&&Z(r,k)._f&&Z(r,k)._f.disabled);if(!I||J){d.isDirty&&(ue=n.isDirty,n.isDirty=Me.isDirty=A(),Y=ue!==Me.isDirty);const zt=yt||Ss(Z(o,k),P);ue=!!(!yt&&Z(n.dirtyFields,k)),zt||yt?Ot(n.dirtyFields,k):Ke(n.dirtyFields,k,!0),Me.dirtyFields=n.dirtyFields,Y=Y||d.dirtyFields&&ue!==!zt}if(I){const zt=Z(n.touchedFields,k);zt||(Ke(n.touchedFields,k,I),Me.touchedFields=n.touchedFields,Y=Y||d.touchedFields&&zt!==I)}return Y&&Q&&f.state.next(Me),Y?Me:{}},R=(k,P,I,J)=>{const Q=Z(n.errors,k),Y=d.isValid&&_r(P)&&n.isValid!==P;if(e.delayError&&I?(l=y(()=>w(k,I)),l(e.delayError)):(clearTimeout(u),l=null,I?Ke(n.errors,k,I):Ot(n.errors,k)),(I?!Ss(Q,I):Q)||!kn(J)||Y){const ue={...J,...Y&&_r(P)?{isValid:P}:{},errors:n.errors,name:k};n={...n,...ue},f.state.next(ue)}},N=async k=>{v(k,!0);const P=await t.resolver(s,t.context,T$(k||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return v(k),P},D=async k=>{const{errors:P}=await N(k);if(k)for(const I of k){const J=Z(P,I);J?Ke(n.errors,I,J):Ot(n.errors,I)}else n.errors=P;return P},O=async(k,P,I={valid:!0})=>{for(const J in k){const Q=k[J];if(Q){const{_f:Y,...ue}=Q;if(Y){const Me=a.array.has(Y.name);v([J],!0);const yt=await ow(Q,s,g,t.shouldUseNativeValidation&&!P,Me);if(v([J]),yt[Y.name]&&(I.valid=!1,P))break;!P&&(Z(yt,Y.name)?Me?b$(n.errors,yt,Y.name):Ke(n.errors,Y.name,yt[Y.name]):Ot(n.errors,Y.name))}ue&&await O(ue,P,I)}}return I.valid},B=()=>{for(const k of a.unMount){const P=Z(r,k);P&&(P._f.refs?P._f.refs.every(I=>!yh(I)):!yh(P._f.ref))&&Ue(k)}a.unMount=new Set},A=(k,P)=>(k&&P&&Ke(s,k,P),!Ss(le(),o)),H=(k,P,I)=>Tk(k,a,{...i.mount?s:Tt(P)?o:Cr(k)?{[k]:P}:P},I,P),L=k=>ff(Z(i.mount?s:o,k,e.shouldUnregister?Z(o,k,[]):[])),K=(k,P,I={})=>{const J=Z(r,k);let Q=P;if(J){const Y=J._f;Y&&(!Y.disabled&&Ke(s,k,Ok(P,Y)),Q=nd(Y.ref)&&an(P)?"":P,jk(Y.ref)?[...Y.ref.options].forEach(ue=>ue.selected=Q.includes(ue.value)):Y.refs?sc(Y.ref)?Y.refs.length>1?Y.refs.forEach(ue=>(!ue.defaultChecked||!ue.disabled)&&(ue.checked=Array.isArray(Q)?!!Q.find(Me=>Me===ue.value):Q===ue.value)):Y.refs[0]&&(Y.refs[0].checked=!!Q):Y.refs.forEach(ue=>ue.checked=ue.value===Q):mv(Y.ref)?Y.ref.value="":(Y.ref.value=Q,Y.ref.type||f.values.next({name:k,values:{...s}})))}(I.shouldDirty||I.shouldTouch)&&_(k,Q,I.shouldTouch,I.shouldDirty,!0),I.shouldValidate&&X(k)},ne=(k,P,I)=>{for(const J in P){const Q=P[J],Y=`${k}.${J}`,ue=Z(r,Y);(a.array.has(k)||!od(Q)||ue&&!ue._f)&&!yi(Q)?ne(Y,Q,I):K(Y,Q,I)}},W=(k,P,I={})=>{const J=Z(r,k),Q=a.array.has(k),Y=gn(P);Ke(s,k,Y),Q?(f.array.next({name:k,values:{...s}}),(d.isDirty||d.dirtyFields)&&I.shouldDirty&&f.state.next({name:k,dirtyFields:Gc(o,s),isDirty:A(k,Y)})):J&&!J._f&&!an(Y)?ne(k,Y,I):K(k,Y,I),Jx(k,a)&&f.state.next({...n}),f.values.next({name:i.mount?k:void 0,values:{...s}})},F=async k=>{i.mount=!0;const P=k.target;let I=P.name,J=!0;const Q=Z(r,I),Y=()=>P.type?xh(Q._f):wk(k),ue=Me=>{J=Number.isNaN(Me)||Me===Z(s,I,Me)};if(Q){let Me,yt;const zt=Y(),rn=k.type===td.BLUR||k.type===td.FOCUS_OUT,Zn=!R$(Q._f)&&!t.resolver&&!Z(n.errors,I)&&!Q._f.deps||N$(rn,Z(n.touchedFields,I),n.isSubmitted,x,p),Hs=Jx(I,a,rn);Ke(s,I,zt),rn?(Q._f.onBlur&&Q._f.onBlur(k),l&&l(0)):Q._f.onChange&&Q._f.onChange(k);const So=_(I,zt,rn,!1),Sf=!kn(So)||Hs;if(!rn&&f.values.next({name:I,type:k.type,values:{...s}}),Zn)return d.isValid&&S(),Sf&&f.state.next({name:I,...Hs?{}:So});if(!rn&&Hs&&f.state.next({...n}),t.resolver){const{errors:qn}=await N([I]);if(ue(zt),J){const dc=sw(n.errors,r,I),aa=sw(qn,r,dc.name||I);Me=aa.error,I=aa.name,yt=kn(qn)}}else v([I],!0),Me=(await ow(Q,s,g,t.shouldUseNativeValidation))[I],v([I]),ue(zt),J&&(Me?yt=!1:d.isValid&&(yt=await O(r,!0)));J&&(Q._f.deps&&X(Q._f.deps),R(I,yt,Me,So))}},M=(k,P)=>{if(Z(n.errors,P)&&k.focus)return k.focus(),1},X=async(k,P={})=>{let I,J;const Q=Ha(k);if(t.resolver){const Y=await D(Tt(k)?k:Q);I=kn(Y),J=k?!Q.some(ue=>Z(Y,ue)):I}else k?(J=(await Promise.all(Q.map(async Y=>{const ue=Z(r,Y);return await O(ue&&ue._f?{[Y]:ue}:ue)}))).every(Boolean),!(!J&&!n.isValid)&&S()):J=I=await O(r);return f.state.next({...!Cr(k)||d.isValid&&I!==n.isValid?{}:{name:k},...t.resolver||!k?{isValid:I}:{},errors:n.errors}),P.shouldFocus&&!J&&Ba(r,M,k?Q:a.mount),J},le=k=>{const P={...i.mount?s:o};return Tt(k)?P:Cr(k)?Z(P,k):k.map(I=>Z(P,I))},me=(k,P)=>({invalid:!!Z((P||n).errors,k),isDirty:!!Z((P||n).dirtyFields,k),error:Z((P||n).errors,k),isValidating:!!Z(n.validatingFields,k),isTouched:!!Z((P||n).touchedFields,k)}),rt=k=>{k&&Ha(k).forEach(P=>Ot(n.errors,P)),f.state.next({errors:k?n.errors:{}})},je=(k,P,I)=>{const J=(Z(r,k,{_f:{}})._f||{}).ref,Q=Z(n.errors,k)||{},{ref:Y,message:ue,type:Me,...yt}=Q;Ke(n.errors,k,{...yt,...P,ref:J}),f.state.next({name:k,errors:n.errors,isValid:!1}),I&&I.shouldFocus&&J&&J.focus&&J.focus()},gt=(k,P)=>Lo(k)?f.values.subscribe({next:I=>k(H(void 0,P),I)}):H(k,P,!0),Ue=(k,P={})=>{for(const I of k?Ha(k):a.mount)a.mount.delete(I),a.array.delete(I),P.keepValue||(Ot(r,I),Ot(s,I)),!P.keepError&&Ot(n.errors,I),!P.keepDirty&&Ot(n.dirtyFields,I),!P.keepTouched&&Ot(n.touchedFields,I),!P.keepIsValidating&&Ot(n.validatingFields,I),!t.shouldUnregister&&!P.keepDefaultValue&&Ot(o,I);f.values.next({values:{...s}}),f.state.next({...n,...P.keepDirty?{isDirty:A()}:{}}),!P.keepIsValid&&S()},ce=({disabled:k,name:P,field:I,fields:J,value:Q})=>{if(_r(k)&&i.mount||k){const Y=k?void 0:Tt(Q)?xh(I?I._f:Z(J,P)._f):Q;Ke(s,P,Y),_(P,Y,!1,!1,!0)}},De=(k,P={})=>{let I=Z(r,k);const J=_r(P.disabled);return Ke(r,k,{...I||{},_f:{...I&&I._f?I._f:{ref:{name:k}},name:k,mount:!0,...P}}),a.mount.add(k),I?ce({field:I,disabled:P.disabled,name:k,value:P.value}):C(k,!0,P.value),{...J?{disabled:P.disabled}:{},...t.progressive?{required:!!P.required,min:Ca(P.min),max:Ca(P.max),minLength:Ca(P.minLength),maxLength:Ca(P.maxLength),pattern:Ca(P.pattern)}:{},name:k,onChange:F,onBlur:F,ref:Q=>{if(Q){De(k,P),I=Z(r,k);const Y=Tt(Q.value)&&Q.querySelectorAll&&Q.querySelectorAll("input,select,textarea")[0]||Q,ue=E$(Y),Me=I._f.refs||[];if(ue?Me.find(yt=>yt===Y):Y===I._f.ref)return;Ke(r,k,{_f:{...I._f,...ue?{refs:[...Me.filter(yh),Y,...Array.isArray(Z(o,k))?[{}]:[]],ref:{type:Y.type,name:k}}:{ref:Y}}}),C(k,!1,void 0,Y)}else I=Z(r,k,{}),I._f&&(I._f.mount=!1),(t.shouldUnregister||P.shouldUnregister)&&!(Sk(a.array,k)&&i.action)&&a.unMount.add(k)}}},He=()=>t.shouldFocusError&&Ba(r,M,a.mount),$e=k=>{_r(k)&&(f.state.next({disabled:k}),Ba(r,(P,I)=>{const J=Z(r,I);J&&(P.disabled=J._f.disabled||k,Array.isArray(J._f.refs)&&J._f.refs.forEach(Q=>{Q.disabled=J._f.disabled||k}))},0,!1))},Ve=(k,P)=>async I=>{let J;I&&(I.preventDefault&&I.preventDefault(),I.persist&&I.persist());let Q=gn(s);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:Y,values:ue}=await N();n.errors=Y,Q=ue}else await O(r);if(Ot(n.errors,"root"),kn(n.errors)){f.state.next({errors:{}});try{await k(Q,I)}catch(Y){J=Y}}else P&&await P({...n.errors},I),He(),setTimeout(He);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:kn(n.errors)&&!J,submitCount:n.submitCount+1,errors:n.errors}),J)throw J},Se=(k,P={})=>{Z(r,k)&&(Tt(P.defaultValue)?W(k,gn(Z(o,k))):(W(k,P.defaultValue),Ke(o,k,gn(P.defaultValue))),P.keepTouched||Ot(n.touchedFields,k),P.keepDirty||(Ot(n.dirtyFields,k),n.isDirty=P.defaultValue?A(k,gn(Z(o,k))):A()),P.keepError||(Ot(n.errors,k),d.isValid&&S()),f.state.next({...n}))},vt=(k,P={})=>{const I=k?gn(k):o,J=gn(I),Q=kn(k),Y=Q?o:J;if(P.keepDefaultValues||(o=I),!P.keepValues){if(P.keepDirtyValues)for(const ue of a.mount)Z(n.dirtyFields,ue)?Ke(Y,ue,Z(s,ue)):W(ue,Z(Y,ue));else{if(fv&&Tt(k))for(const ue of a.mount){const Me=Z(r,ue);if(Me&&Me._f){const yt=Array.isArray(Me._f.refs)?Me._f.refs[0]:Me._f.ref;if(nd(yt)){const zt=yt.closest("form");if(zt){zt.reset();break}}}}r={}}s=e.shouldUnregister?P.keepDefaultValues?gn(o):{}:gn(Y),f.array.next({values:{...Y}}),f.values.next({values:{...Y}})}a={mount:P.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!d.isValid||!!P.keepIsValid||!!P.keepDirtyValues,i.watch=!!e.shouldUnregister,f.state.next({submitCount:P.keepSubmitCount?n.submitCount:0,isDirty:Q?!1:P.keepDirty?n.isDirty:!!(P.keepDefaultValues&&!Ss(k,o)),isSubmitted:P.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Q?{}:P.keepDirtyValues?P.keepDefaultValues&&s?Gc(o,s):n.dirtyFields:P.keepDefaultValues&&k?Gc(o,k):P.keepDirty?n.dirtyFields:{},touchedFields:P.keepTouched?n.touchedFields:{},errors:P.keepErrors?n.errors:{},isSubmitSuccessful:P.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Zt=(k,P)=>vt(Lo(k)?k(s):k,P);return{control:{register:De,unregister:Ue,getFieldState:me,handleSubmit:Ve,setError:je,_executeSchema:N,_getWatch:H,_getDirty:A,_updateValid:S,_removeUnmounted:B,_updateFieldArray:m,_updateDisabledField:ce,_getFieldArray:L,_reset:vt,_resetDefaultValues:()=>Lo(t.defaultValues)&&t.defaultValues().then(k=>{Zt(k,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:k=>{n={...n,...k}},_disableForm:$e,_subjects:f,_proxyFormState:d,_setErrors:b,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(k){i=k},get _defaultValues(){return o},get _names(){return a},set _names(k){a=k},get _formState(){return n},set _formState(k){n=k},get _options(){return t},set _options(k){t={...t,...k}}},trigger:X,register:De,handleSubmit:Ve,watch:gt,setValue:W,getValues:le,reset:Zt,resetField:Se,clearErrors:rt,unregister:Ue,setError:je,setFocus:(k,P={})=>{const I=Z(r,k),J=I&&I._f;if(J){const Q=J.refs?J.refs[0]:J.ref;Q.focus&&(Q.focus(),P.shouldSelect&&Q.select())}},getFieldState:me}}function ic(e={}){const t=Oe.useRef(),n=Oe.useRef(),[r,o]=Oe.useState({isDirty:!1,isValidating:!1,isLoading:Lo(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Lo(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...D$(e),formState:r});const s=t.current.control;return s._options=e,pv({subject:s._subjects.state,next:i=>{kk(i,s._proxyFormState,s._updateFormState,!0)&&o({...s._formState})}}),Oe.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),Oe.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),Oe.useEffect(()=>{e.values&&!Ss(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),Oe.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),Oe.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),Oe.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),t.current.formState=Ck(r,s),t.current}const iw=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Z(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Ak=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?iw(r.ref,n,e):r.refs&&r.refs.forEach(o=>iw(o,n,e))}},M$=(e,t)=>{t.shouldUseNativeValidation&&Ak(e,t);const n={};for(const r in e){const o=Z(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.ref});if(O$(t.names||Object.keys(e),r)){const i=Object.assign({},Z(n,r));Ke(i,"root",s),Ke(n,r,i)}else Ke(n,r,s)}return n},O$=(e,t)=>e.some(n=>n.startsWith(t+"."));var A$=function(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[i]={message:a.message,type:a.code}}else n[i]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var l=n[i].types,u=l&&l[r.code];n[i]=Rk(i,t,n,o,u?[].concat(u,r.message):r.message)}e.shift()}return n},ac=function(e,t,n){return n===void 0&&(n={}),function(r,o,s){try{return Promise.resolve(function(i,a){try{var l=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(u){return s.shouldUseNativeValidation&&Ak({},s),{errors:{},values:n.raw?r: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:M$(A$(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}}},Le;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const s={};for(const i of o)s[i]=i;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(const a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},e.find=(o,s)=>{for(const i of o)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(Le||(Le={}));var Up;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Up||(Up={}));const oe=Le.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Do=e=>{switch(typeof e){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(e)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(e)?oe.array:e===null?oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?oe.promise:typeof Map<"u"&&e instanceof Map?oe.map:typeof Set<"u"&&e instanceof Set?oe.set:typeof Date<"u"&&e instanceof Date?oe.date:oe.object;default:return oe.unknown}},V=Le.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"]),I$=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Mn extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,l=0;for(;ln.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Mn.create=e=>new Mn(e);const Wi=(e,t)=>{let n;switch(e.code){case V.invalid_type:e.received===oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case V.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Le.jsonStringifyReplacer)}`;break;case V.unrecognized_keys:n=`Unrecognized key(s) in object: ${Le.joinValues(e.keys,", ")}`;break;case V.invalid_union:n="Invalid input";break;case V.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Le.joinValues(e.options)}`;break;case V.invalid_enum_value:n=`Invalid enum value. Expected ${Le.joinValues(e.options)}, received '${e.received}'`;break;case V.invalid_arguments:n="Invalid function arguments";break;case V.invalid_return_type:n="Invalid function return type";break;case V.invalid_date:n="Invalid date";break;case V.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Le.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case V.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case V.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case V.custom:n="Invalid input";break;case V.invalid_intersection_types:n="Intersection results could not be merged";break;case V.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case V.not_finite:n="Number must be finite";break;default:n=t.defaultError,Le.assertNever(e)}return{message:n}};let Ik=Wi;function L$(e){Ik=e}function id(){return Ik}const ad=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}},F$=[];function ee(e,t){const n=id(),r=ad({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Wi?void 0:Wi].filter(o=>!!o)});e.common.issues.push(r)}class tn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return we;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n){const s=await o.key,i=await o.value;r.push({key:s,value:i})}return tn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return we;s.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:t.value,value:r}}}const we=Object.freeze({status:"aborted"}),xi=e=>({status:"dirty",value:e}),cn=e=>({status:"valid",value:e}),$p=e=>e.status==="aborted",Vp=e=>e.status==="dirty",bl=e=>e.status==="valid",Cl=e=>typeof Promise<"u"&&e instanceof Promise;function ld(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function Lk(e,t,n,r,o){if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var fe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(fe||(fe={}));var ja,Da;class jr{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}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 aw=(e,t)=>{if(bl(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 n=new Mn(e.common.issues);return this._error=n,this._error}}};function _e(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{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??r)!==null&&l!==void 0?l:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(u=d??n)!==null&&u!==void 0?u:a.defaultError}},description:o}}class Re{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 Do(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Do(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new tn,ctx:{common:t.parent.common,data:t.data,parsedType:Do(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Cl(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Do(t)},s=this._parseSync({data:t,path:o.path,parent:o});return aw(o,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Do(t)},o=this._parse({data:t,path:r.path,parent:r}),s=await(Cl(o)?o:Promise.resolve(o));return aw(r,s)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const i=t(o),a=()=>s.addIssue({code:V.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new hr({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Rr.create(this,this._def)}nullable(){return ts.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ar.create(this,this._def)}promise(){return Hi.create(this,this._def)}or(t){return Rl.create([this,t],this._def)}and(t){return Nl.create(this,t,this._def)}transform(t){return new hr({..._e(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Ol({..._e(this._def),innerType:this,defaultValue:n,typeName:ye.ZodDefault})}brand(){return new vv({typeName:ye.ZodBranded,type:this,..._e(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Al({..._e(this._def),innerType:this,catchValue:n,typeName:ye.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return lc.create(this,t)}readonly(){return Il.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const U$=/^c[^\s-]{8,}$/i,$$=/^[0-9a-z]+$/,V$=/^[0-9A-HJKMNP-TV-Z]{26}$/,z$=/^[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,W$=/^[a-z0-9_-]{21}$/i,Y$=/^[-+]?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)?)??$/,H$=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,B$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let wh;const G$=/^(?:(?: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])$/,K$=/^(([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})))$/,Z$=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Fk="((\\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])))",q$=new RegExp(`^${Fk}$`);function Uk(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 X$(e){return new RegExp(`^${Uk(e)}$`)}function $k(e){let t=`${Fk}T${Uk(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Q$(e,t){return!!((t==="v4"||!t)&&G$.test(e)||(t==="v6"||!t)&&K$.test(e))}class or extends Re{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==oe.string){const s=this._getOrReturnCtx(t);return ee(s,{code:V.invalid_type,expected:oe.string,received:s.parsedType}),we}const r=new tn;let o;for(const s of this._def.checks)if(s.kind==="min")t.data.lengths.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:V.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const i=t.data.length>s.value,a=t.data.lengtht.test(o),{validation:n,code:V.invalid_string,...fe.errToObj(r)})}_addCheck(t){return new or({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...fe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...fe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...fe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...fe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...fe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...fe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...fe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...fe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...fe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...fe.errToObj(t)})}datetime(t){var n,r;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:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...fe.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,...fe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...fe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...fe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...fe.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...fe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...fe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...fe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...fe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...fe.errToObj(n)})}nonempty(t){return this.min(1,fe.errToObj(t))}trim(){return new or({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new or({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new or({...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 n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new or({checks:[],typeName:ye.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,..._e(e)})};function J$(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=parseInt(e.toFixed(o).replace(".","")),i=parseInt(t.toFixed(o).replace(".",""));return s%i/Math.pow(10,o)}class Qo extends Re{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)!==oe.number){const s=this._getOrReturnCtx(t);return ee(s,{code:V.invalid_type,expected:oe.number,received:s.parsedType}),we}let r;const o=new tn;for(const s of this._def.checks)s.kind==="int"?Le.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{code:V.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:V.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?J$(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),ee(r,{code:V.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{code:V.not_finite,message:s.message}),o.dirty()):Le.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,fe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,fe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,fe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,fe.toString(n))}setLimit(t,n,r,o){return new Qo({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:fe.toString(o)}]})}_addCheck(t){return new Qo({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:fe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:fe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:fe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&Le.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew Qo({checks:[],typeName:ye.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,..._e(e)});class Jo extends Re{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)!==oe.bigint){const s=this._getOrReturnCtx(t);return ee(s,{code:V.invalid_type,expected:oe.bigint,received:s.parsedType}),we}let r;const o=new tn;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:V.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:V.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):Le.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,fe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,fe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,fe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,fe.toString(n))}setLimit(t,n,r,o){return new Jo({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:fe.toString(o)}]})}_addCheck(t){return new Jo({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:fe.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Jo({checks:[],typeName:ye.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,..._e(e)})};class kl extends Re{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==oe.boolean){const r=this._getOrReturnCtx(t);return ee(r,{code:V.invalid_type,expected:oe.boolean,received:r.parsedType}),we}return cn(t.data)}}kl.create=e=>new kl({typeName:ye.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,..._e(e)});class Is extends Re{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==oe.date){const s=this._getOrReturnCtx(t);return ee(s,{code:V.invalid_type,expected:oe.date,received:s.parsedType}),we}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return ee(s,{code:V.invalid_date}),we}const r=new tn;let o;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()s.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:V.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):Le.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Is({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:fe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:fe.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Is({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ye.ZodDate,..._e(e)});class cd extends Re{_parse(t){if(this._getType(t)!==oe.symbol){const r=this._getOrReturnCtx(t);return ee(r,{code:V.invalid_type,expected:oe.symbol,received:r.parsedType}),we}return cn(t.data)}}cd.create=e=>new cd({typeName:ye.ZodSymbol,..._e(e)});class El extends Re{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ee(r,{code:V.invalid_type,expected:oe.undefined,received:r.parsedType}),we}return cn(t.data)}}El.create=e=>new El({typeName:ye.ZodUndefined,..._e(e)});class Tl extends Re{_parse(t){if(this._getType(t)!==oe.null){const r=this._getOrReturnCtx(t);return ee(r,{code:V.invalid_type,expected:oe.null,received:r.parsedType}),we}return cn(t.data)}}Tl.create=e=>new Tl({typeName:ye.ZodNull,..._e(e)});class Yi extends Re{constructor(){super(...arguments),this._any=!0}_parse(t){return cn(t.data)}}Yi.create=e=>new Yi({typeName:ye.ZodAny,..._e(e)});class ks extends Re{constructor(){super(...arguments),this._unknown=!0}_parse(t){return cn(t.data)}}ks.create=e=>new ks({typeName:ye.ZodUnknown,..._e(e)});class co extends Re{_parse(t){const n=this._getOrReturnCtx(t);return ee(n,{code:V.invalid_type,expected:oe.never,received:n.parsedType}),we}}co.create=e=>new co({typeName:ye.ZodNever,..._e(e)});class ud extends Re{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ee(r,{code:V.invalid_type,expected:oe.void,received:r.parsedType}),we}return cn(t.data)}}ud.create=e=>new ud({typeName:ye.ZodVoid,..._e(e)});class ar extends Re{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==oe.array)return ee(n,{code:V.invalid_type,expected:oe.array,received:n.parsedType}),we;if(o.exactLength!==null){const i=n.data.length>o.exactLength.value,a=n.data.lengtho.maxLength.value&&(ee(n,{code:V.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new jr(n,i,n.path,a)))).then(i=>tn.mergeArray(r,i));const s=[...n.data].map((i,a)=>o.type._parseSync(new jr(n,i,n.path,a)));return tn.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new ar({...this._def,minLength:{value:t,message:fe.toString(n)}})}max(t,n){return new ar({...this._def,maxLength:{value:t,message:fe.toString(n)}})}length(t,n){return new ar({...this._def,exactLength:{value:t,message:fe.toString(n)}})}nonempty(t){return this.min(1,t)}}ar.create=(e,t)=>new ar({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,..._e(t)});function ri(e){if(e instanceof xt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Rr.create(ri(r))}return new xt({...e._def,shape:()=>t})}else return e instanceof ar?new ar({...e._def,type:ri(e.element)}):e instanceof Rr?Rr.create(ri(e.unwrap())):e instanceof ts?ts.create(ri(e.unwrap())):e instanceof Dr?Dr.create(e.items.map(t=>ri(t))):e}class xt extends Re{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(),n=Le.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==oe.object){const u=this._getOrReturnCtx(t);return ee(u,{code:V.invalid_type,expected:oe.object,received:u.parsedType}),we}const{status:r,ctx:o}=this._processInputParams(t),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof co&&this._def.unknownKeys==="strip"))for(const u in o.data)i.includes(u)||a.push(u);const l=[];for(const u of i){const d=s[u],f=o.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new jr(o,f,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof co){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(u==="strict")a.length>0&&(ee(o,{code:V.unrecognized_keys,keys:a}),r.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=o.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new jr(o,f,o.path,d)),alwaysSet:d in o.data})}}return o.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=>tn.mergeObjectSync(r,u)):tn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return fe.errToObj,new xt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,s,i,a;const l=(i=(s=(o=this._def).errorMap)===null||s===void 0?void 0:s.call(o,n,r).message)!==null&&i!==void 0?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=fe.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new xt({...this._def,unknownKeys:"strip"})}passthrough(){return new xt({...this._def,unknownKeys:"passthrough"})}extend(t){return new xt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new xt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ye.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new xt({...this._def,catchall:t})}pick(t){const n={};return Le.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new xt({...this._def,shape:()=>n})}omit(t){const n={};return Le.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new xt({...this._def,shape:()=>n})}deepPartial(){return ri(this)}partial(t){const n={};return Le.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new xt({...this._def,shape:()=>n})}required(t){const n={};return Le.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Rr;)s=s._def.innerType;n[r]=s}}),new xt({...this._def,shape:()=>n})}keyof(){return Vk(Le.objectKeys(this.shape))}}xt.create=(e,t)=>new xt({shape:()=>e,unknownKeys:"strip",catchall:co.create(),typeName:ye.ZodObject,..._e(t)});xt.strictCreate=(e,t)=>new xt({shape:()=>e,unknownKeys:"strict",catchall:co.create(),typeName:ye.ZodObject,..._e(t)});xt.lazycreate=(e,t)=>new xt({shape:e,unknownKeys:"strip",catchall:co.create(),typeName:ye.ZodObject,..._e(t)});class Rl extends Re{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=s.map(a=>new Mn(a.ctx.common.issues));return ee(n,{code:V.invalid_union,unionErrors:i}),we}if(n.common.async)return Promise.all(r.map(async s=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s;const i=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=l._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=i.map(l=>new Mn(l));return ee(n,{code:V.invalid_union,unionErrors:a}),we}}get options(){return this._def.options}}Rl.create=(e,t)=>new Rl({options:e,typeName:ye.ZodUnion,..._e(t)});const Vr=e=>e instanceof jl?Vr(e.schema):e instanceof hr?Vr(e.innerType()):e instanceof Dl?[e.value]:e instanceof es?e.options:e instanceof Ml?Le.objectValues(e.enum):e instanceof Ol?Vr(e._def.innerType):e instanceof El?[void 0]:e instanceof Tl?[null]:e instanceof Rr?[void 0,...Vr(e.unwrap())]:e instanceof ts?[null,...Vr(e.unwrap())]:e instanceof vv||e instanceof Il?Vr(e.unwrap()):e instanceof Al?Vr(e._def.innerType):[];class pf extends Re{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.object)return ee(n,{code:V.invalid_type,expected:oe.object,received:n.parsedType}),we;const r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(ee(n,{code:V.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),we)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const s of n){const i=Vr(s.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(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,s)}}return new pf({typeName:ye.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,..._e(r)})}}function zp(e,t){const n=Do(e),r=Do(t);if(e===t)return{valid:!0,data:e};if(n===oe.object&&r===oe.object){const o=Le.objectKeys(t),s=Le.objectKeys(e).filter(a=>o.indexOf(a)!==-1),i={...e,...t};for(const a of s){const l=zp(e[a],t[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(n===oe.array&&r===oe.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let s=0;s{if($p(s)||$p(i))return we;const a=zp(s.value,i.value);return a.valid?((Vp(s)||Vp(i))&&n.dirty(),{status:n.value,value:a.data}):(ee(r,{code:V.invalid_intersection_types}),we)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Nl.create=(e,t,n)=>new Nl({left:e,right:t,typeName:ye.ZodIntersection,..._e(n)});class Dr extends Re{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.array)return ee(r,{code:V.invalid_type,expected:oe.array,received:r.parsedType}),we;if(r.data.lengththis._def.items.length&&(ee(r,{code:V.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((i,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new jr(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>tn.mergeArray(n,i)):tn.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Dr({...this._def,rest:t})}}Dr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Dr({items:e,typeName:ye.ZodTuple,rest:null,..._e(t)})};class Pl extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.object)return ee(r,{code:V.invalid_type,expected:oe.object,received:r.parsedType}),we;const o=[],s=this._def.keyType,i=this._def.valueType;for(const a in r.data)o.push({key:s._parse(new jr(r,a,r.path,a)),value:i._parse(new jr(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?tn.mergeObjectAsync(n,o):tn.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Re?new Pl({keyType:t,valueType:n,typeName:ye.ZodRecord,..._e(r)}):new Pl({keyType:or.create(),valueType:t,typeName:ye.ZodRecord,..._e(n)})}}class dd extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.map)return ee(r,{code:V.invalid_type,expected:oe.map,received:r.parsedType}),we;const o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,l],u)=>({key:o._parse(new jr(r,a,r.path,[u,"key"])),value:s._parse(new jr(r,l,r.path,[u,"value"]))}));if(r.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")&&n.dirty(),a.set(u.value,d.value)}return{status:n.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")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}}}}dd.create=(e,t,n)=>new dd({valueType:t,keyType:e,typeName:ye.ZodMap,..._e(n)});class Ls extends Re{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.set)return ee(r,{code:V.invalid_type,expected:oe.set,received:r.parsedType}),we;const o=this._def;o.minSize!==null&&r.data.sizeo.maxSize.value&&(ee(r,{code:V.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=this._def.valueType;function i(l){const u=new Set;for(const d of l){if(d.status==="aborted")return we;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((l,u)=>s._parse(new jr(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(t,n){return new Ls({...this._def,minSize:{value:t,message:fe.toString(n)}})}max(t,n){return new Ls({...this._def,maxSize:{value:t,message:fe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Ls.create=(e,t)=>new Ls({valueType:e,minSize:null,maxSize:null,typeName:ye.ZodSet,..._e(t)});class Mi extends Re{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.function)return ee(n,{code:V.invalid_type,expected:oe.function,received:n.parsedType}),we;function r(a,l){return ad({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,id(),Wi].filter(u=>!!u),issueData:{code:V.invalid_arguments,argumentsError:l}})}function o(a,l){return ad({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,id(),Wi].filter(u=>!!u),issueData:{code:V.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Hi){const a=this;return cn(async function(...l){const u=new Mn([]),d=await a._def.args.parseAsync(l,s).catch(x=>{throw u.addIssue(r(l,x)),u}),f=await Reflect.apply(i,this,d);return await a._def.returns._def.type.parseAsync(f,s).catch(x=>{throw u.addIssue(o(f,x)),u})})}else{const a=this;return cn(function(...l){const u=a._def.args.safeParse(l,s);if(!u.success)throw new Mn([r(l,u.error)]);const d=Reflect.apply(i,this,u.data),f=a._def.returns.safeParse(d,s);if(!f.success)throw new Mn([o(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Mi({...this._def,args:Dr.create(t).rest(ks.create())})}returns(t){return new Mi({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Mi({args:t||Dr.create([]).rest(ks.create()),returns:n||ks.create(),typeName:ye.ZodFunction,..._e(r)})}}class jl extends Re{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}jl.create=(e,t)=>new jl({getter:e,typeName:ye.ZodLazy,..._e(t)});class Dl extends Re{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ee(n,{received:n.data,code:V.invalid_literal,expected:this._def.value}),we}return{status:"valid",value:t.data}}get value(){return this._def.value}}Dl.create=(e,t)=>new Dl({value:e,typeName:ye.ZodLiteral,..._e(t)});function Vk(e,t){return new es({values:e,typeName:ye.ZodEnum,..._e(t)})}class es extends Re{constructor(){super(...arguments),ja.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ee(n,{expected:Le.joinValues(r),received:n.parsedType,code:V.invalid_type}),we}if(ld(this,ja)||Lk(this,ja,new Set(this._def.values)),!ld(this,ja).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ee(n,{received:n.data,code:V.invalid_enum_value,options:r}),we}return cn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return es.create(t,{...this._def,...n})}exclude(t,n=this._def){return es.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}ja=new WeakMap;es.create=Vk;class Ml extends Re{constructor(){super(...arguments),Da.set(this,void 0)}_parse(t){const n=Le.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const o=Le.objectValues(n);return ee(r,{expected:Le.joinValues(o),received:r.parsedType,code:V.invalid_type}),we}if(ld(this,Da)||Lk(this,Da,new Set(Le.getValidEnumValues(this._def.values))),!ld(this,Da).has(t.data)){const o=Le.objectValues(n);return ee(r,{received:r.data,code:V.invalid_enum_value,options:o}),we}return cn(t.data)}get enum(){return this._def.values}}Da=new WeakMap;Ml.create=(e,t)=>new Ml({values:e,typeName:ye.ZodNativeEnum,..._e(t)});class Hi extends Re{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.promise&&n.common.async===!1)return ee(n,{code:V.invalid_type,expected:oe.promise,received:n.parsedType}),we;const r=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return cn(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Hi.create=(e,t)=>new Hi({type:e,typeName:ye.ZodPromise,..._e(t)});class hr extends Re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,s={addIssue:i=>{ee(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){const i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return we;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?we:l.status==="dirty"||n.value==="dirty"?xi(l.value):l});{if(n.value==="aborted")return we;const a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?we:a.status==="dirty"||n.value==="dirty"?xi(a.value):a}}if(o.type==="refinement"){const i=a=>{const l=o.refinement(a,s);if(r.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(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?we:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?we:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!bl(i))return i;const a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>bl(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):i);Le.assertNever(o)}}hr.create=(e,t,n)=>new hr({schema:e,typeName:ye.ZodEffects,effect:t,..._e(n)});hr.createWithPreprocess=(e,t,n)=>new hr({schema:t,effect:{type:"preprocess",transform:e},typeName:ye.ZodEffects,..._e(n)});class Rr extends Re{_parse(t){return this._getType(t)===oe.undefined?cn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Rr.create=(e,t)=>new Rr({innerType:e,typeName:ye.ZodOptional,..._e(t)});class ts extends Re{_parse(t){return this._getType(t)===oe.null?cn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ts.create=(e,t)=>new ts({innerType:e,typeName:ye.ZodNullable,..._e(t)});class Ol extends Re{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ol.create=(e,t)=>new Ol({innerType:e,typeName:ye.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,..._e(t)});class Al extends Re{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Cl(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Mn(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Mn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Al.create=(e,t)=>new Al({innerType:e,typeName:ye.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,..._e(t)});class fd extends Re{_parse(t){if(this._getType(t)!==oe.nan){const r=this._getOrReturnCtx(t);return ee(r,{code:V.invalid_type,expected:oe.nan,received:r.parsedType}),we}return{status:"valid",value:t.data}}}fd.create=e=>new fd({typeName:ye.ZodNaN,..._e(e)});const eV=Symbol("zod_brand");class vv extends Re{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class lc extends Re{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?we:s.status==="dirty"?(n.dirty(),xi(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?we:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new lc({in:t,out:n,typeName:ye.ZodPipeline})}}class Il extends Re{_parse(t){const n=this._def.innerType._parse(t),r=o=>(bl(o)&&(o.value=Object.freeze(o.value)),o);return Cl(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}Il.create=(e,t)=>new Il({innerType:e,typeName:ye.ZodReadonly,..._e(t)});function zk(e,t={},n){return e?Yi.create().superRefine((r,o)=>{var s,i;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(i=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&i!==void 0?i:!0,u=typeof a=="string"?{message:a}:a;o.addIssue({code:"custom",...u,fatal:l})}}):Yi.create()}const tV={object:xt.lazycreate};var ye;(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"})(ye||(ye={}));const nV=(e,t={message:`Input not instance of ${e.name}`})=>zk(n=>n instanceof e,t),Wk=or.create,Yk=Qo.create,rV=fd.create,oV=Jo.create,Hk=kl.create,sV=Is.create,iV=cd.create,aV=El.create,lV=Tl.create,cV=Yi.create,uV=ks.create,dV=co.create,fV=ud.create,hV=ar.create,pV=xt.create,mV=xt.strictCreate,gV=Rl.create,vV=pf.create,yV=Nl.create,xV=Dr.create,wV=Pl.create,SV=dd.create,_V=Ls.create,bV=Mi.create,CV=jl.create,kV=Dl.create,EV=es.create,TV=Ml.create,RV=Hi.create,lw=hr.create,NV=Rr.create,PV=ts.create,jV=hr.createWithPreprocess,DV=lc.create,MV=()=>Wk().optional(),OV=()=>Yk().optional(),AV=()=>Hk().optional(),IV={string:e=>or.create({...e,coerce:!0}),number:e=>Qo.create({...e,coerce:!0}),boolean:e=>kl.create({...e,coerce:!0}),bigint:e=>Jo.create({...e,coerce:!0}),date:e=>Is.create({...e,coerce:!0})},LV=we;var Ie=Object.freeze({__proto__:null,defaultErrorMap:Wi,setErrorMap:L$,getErrorMap:id,makeIssue:ad,EMPTY_PATH:F$,addIssueToContext:ee,ParseStatus:tn,INVALID:we,DIRTY:xi,OK:cn,isAborted:$p,isDirty:Vp,isValid:bl,isAsync:Cl,get util(){return Le},get objectUtil(){return Up},ZodParsedType:oe,getParsedType:Do,ZodType:Re,datetimeRegex:$k,ZodString:or,ZodNumber:Qo,ZodBigInt:Jo,ZodBoolean:kl,ZodDate:Is,ZodSymbol:cd,ZodUndefined:El,ZodNull:Tl,ZodAny:Yi,ZodUnknown:ks,ZodNever:co,ZodVoid:ud,ZodArray:ar,ZodObject:xt,ZodUnion:Rl,ZodDiscriminatedUnion:pf,ZodIntersection:Nl,ZodTuple:Dr,ZodRecord:Pl,ZodMap:dd,ZodSet:Ls,ZodFunction:Mi,ZodLazy:jl,ZodLiteral:Dl,ZodEnum:es,ZodNativeEnum:Ml,ZodPromise:Hi,ZodEffects:hr,ZodTransformer:hr,ZodOptional:Rr,ZodNullable:ts,ZodDefault:Ol,ZodCatch:Al,ZodNaN:fd,BRAND:eV,ZodBranded:vv,ZodPipeline:lc,ZodReadonly:Il,custom:zk,Schema:Re,ZodSchema:Re,late:tV,get ZodFirstPartyTypeKind(){return ye},coerce:IV,any:cV,array:hV,bigint:oV,boolean:Hk,date:sV,discriminatedUnion:vV,effect:lw,enum:EV,function:bV,instanceof:nV,intersection:yV,lazy:CV,literal:kV,map:SV,nan:rV,nativeEnum:TV,never:dV,null:lV,nullable:PV,number:Yk,object:pV,oboolean:AV,onumber:OV,optional:NV,ostring:MV,pipeline:DV,preprocess:jV,promise:RV,record:wV,set:_V,strictObject:mV,string:Wk,symbol:iV,transformer:lw,tuple:xV,undefined:aV,union:gV,unknown:uV,void:fV,NEVER:LV,ZodIssueCode:V,quotelessJson:I$,ZodError:Mn}),FV="Label",Bk=h.forwardRef((e,t)=>c.jsx(ve.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Bk.displayName=FV;var Gk=Bk;const UV=Wl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ll=h.forwardRef(({className:e,...t},n)=>c.jsx(Gk,{ref:n,className:se(UV(),e),...t}));Ll.displayName=Gk.displayName;const cc=y$,Kk=h.createContext({}),tt=({...e})=>c.jsx(Kk.Provider,{value:{name:e.name},children:c.jsx(_$,{...e})}),mf=()=>{const e=h.useContext(Kk),t=h.useContext(Zk),{getFieldState:n,formState:r}=hf(),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within ");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}},Zk=h.createContext({}),qe=h.forwardRef(({className:e,...t},n)=>{const r=h.useId();return c.jsx(Zk.Provider,{value:{id:r},children:c.jsx("div",{ref:n,className:se("space-y-2",e),...t})})});qe.displayName="FormItem";const Xe=h.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:o}=mf();return c.jsx(Ll,{ref:n,className:se(r&&"text-destructive",e),htmlFor:o,...t})});Xe.displayName="FormLabel";const Qe=h.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:o,formMessageId:s}=mf();return c.jsx(oo,{ref:t,id:r,"aria-describedby":n?`${o} ${s}`:`${o}`,"aria-invalid":!!n,...e})});Qe.displayName="FormControl";const $V=h.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=mf();return c.jsx("p",{ref:n,id:r,className:se("text-sm text-muted-foreground",e),...t})});$V.displayName="FormDescription";const Be=h.forwardRef(({className:e,children:t,...n},r)=>{const{error:o,formMessageId:s}=mf(),i=o?String(o==null?void 0:o.message):t;return i?c.jsx("p",{ref:r,id:s,className:se("text-sm font-medium text-destructive",e),...n,children:i}):null});Be.displayName="FormMessage";function Wp(e,[t,n]){return Math.min(n,Math.max(t,e))}var VV=[" ","Enter","ArrowUp","ArrowDown"],zV=[" ","Enter"],uc="Select",[gf,vf,WV]=Ld(uc),[ia,d3]=_n(uc,[WV,na]),yf=na(),[YV,ls]=ia(uc),[HV,BV]=ia(uc),qk=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:x}=e,g=yf(t),[y,S]=h.useState(null),[v,m]=h.useState(null),[w,b]=h.useState(!1),C=Yl(u),[_=!1,R]=so({prop:r,defaultProp:o,onChange:s}),[N,D]=so({prop:i,defaultProp:a,onChange:l}),O=h.useRef(null),B=y?!!y.closest("form"):!0,[A,H]=h.useState(new Set),L=Array.from(A).map(K=>K.props.value).join(";");return c.jsx(hg,{...g,children:c.jsxs(YV,{required:x,scope:t,trigger:y,onTriggerChange:S,valueNode:v,onValueNodeChange:m,valueNodeHasChildren:w,onValueNodeHasChildrenChange:b,contentId:Tr(),value:N,onValueChange:D,open:_,onOpenChange:R,dir:C,triggerPointerDownPosRef:O,disabled:p,children:[c.jsx(gf.Provider,{scope:t,children:c.jsx(HV,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(K=>{H(ne=>new Set(ne).add(K))},[]),onNativeOptionRemove:h.useCallback(K=>{H(ne=>{const W=new Set(ne);return W.delete(K),W})},[]),children:n})}),B?c.jsxs(_E,{"aria-hidden":!0,required:x,tabIndex:-1,name:d,autoComplete:f,value:N,onChange:K=>D(K.target.value),disabled:p,children:[N===void 0?c.jsx("option",{value:""}):null,Array.from(A)]},L):null]})})};qk.displayName=uc;var Xk="SelectTrigger",Qk=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=yf(n),i=ls(Xk,n),a=i.disabled||r,l=be(t,i.onTriggerChange),u=vf(n),[d,f,p]=bE(g=>{const y=u().filter(m=>!m.disabled),S=y.find(m=>m.value===i.value),v=CE(y,g,S);v!==void 0&&i.onValueChange(v.value)}),x=()=>{a||(i.onOpenChange(!0),p())};return c.jsx(pg,{asChild:!0,...s,children:c.jsx(ve.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":SE(i.value)?"":void 0,...o,ref:l,onClick:G(o.onClick,g=>{g.currentTarget.focus()}),onPointerDown:G(o.onPointerDown,g=>{const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&(x(),i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)},g.preventDefault())}),onKeyDown:G(o.onKeyDown,g=>{const y=d.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&f(g.key),!(y&&g.key===" ")&&VV.includes(g.key)&&(x(),g.preventDefault())})})})});Qk.displayName=Xk;var Jk="SelectValue",eE=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,l=ls(Jk,n),{onValueNodeHasChildrenChange:u}=l,d=s!==void 0,f=be(t,l.onValueNodeChange);return Kt(()=>{u(d)},[u,d]),c.jsx(ve.span,{...a,ref:f,style:{pointerEvents:"none"},children:SE(l.value)?c.jsx(c.Fragment,{children:i}):s})});eE.displayName=Jk;var GV="SelectIcon",tE=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return c.jsx(ve.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});tE.displayName=GV;var KV="SelectPortal",nE=e=>c.jsx(Bl,{asChild:!0,...e});nE.displayName=KV;var Fs="SelectContent",rE=h.forwardRef((e,t)=>{const n=ls(Fs,e.__scopeSelect),[r,o]=h.useState();if(Kt(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?fo.createPortal(c.jsx(oE,{scope:e.__scopeSelect,children:c.jsx(gf.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),s):null}return c.jsx(sE,{...e,ref:t})});rE.displayName=Fs;var Yr=10,[oE,cs]=ia(Fs),ZV="SelectContentImpl",sE=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:x,sticky:g,hideWhenDetached:y,avoidCollisions:S,...v}=e,m=ls(Fs,n),[w,b]=h.useState(null),[C,_]=h.useState(null),R=be(t,ce=>b(ce)),[N,D]=h.useState(null),[O,B]=h.useState(null),A=vf(n),[H,L]=h.useState(!1),K=h.useRef(!1);h.useEffect(()=>{if(w)return vg(w)},[w]),rg();const ne=h.useCallback(ce=>{const[De,...He]=A().map(Se=>Se.ref.current),[$e]=He.slice(-1),Ve=document.activeElement;for(const Se of ce)if(Se===Ve||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===De&&C&&(C.scrollTop=0),Se===$e&&C&&(C.scrollTop=C.scrollHeight),Se==null||Se.focus(),document.activeElement!==Ve))return},[A,C]),W=h.useCallback(()=>ne([N,w]),[ne,N,w]);h.useEffect(()=>{H&&W()},[H,W]);const{onOpenChange:F,triggerPointerDownPosRef:M}=m;h.useEffect(()=>{if(w){let ce={x:0,y:0};const De=$e=>{var Ve,Se;ce={x:Math.abs(Math.round($e.pageX)-(((Ve=M.current)==null?void 0:Ve.x)??0)),y:Math.abs(Math.round($e.pageY)-(((Se=M.current)==null?void 0:Se.y)??0))}},He=$e=>{ce.x<=10&&ce.y<=10?$e.preventDefault():w.contains($e.target)||F(!1),document.removeEventListener("pointermove",De),M.current=null};return M.current!==null&&(document.addEventListener("pointermove",De),document.addEventListener("pointerup",He,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",De),document.removeEventListener("pointerup",He,{capture:!0})}}},[w,F,M]),h.useEffect(()=>{const ce=()=>F(!1);return window.addEventListener("blur",ce),window.addEventListener("resize",ce),()=>{window.removeEventListener("blur",ce),window.removeEventListener("resize",ce)}},[F]);const[X,le]=bE(ce=>{const De=A().filter(Ve=>!Ve.disabled),He=De.find(Ve=>Ve.ref.current===document.activeElement),$e=CE(De,ce,He);$e&&setTimeout(()=>$e.ref.current.focus())}),me=h.useCallback((ce,De,He)=>{const $e=!K.current&&!He;(m.value!==void 0&&m.value===De||$e)&&(D(ce),$e&&(K.current=!0))},[m.value]),rt=h.useCallback(()=>w==null?void 0:w.focus(),[w]),je=h.useCallback((ce,De,He)=>{const $e=!K.current&&!He;(m.value!==void 0&&m.value===De||$e)&&B(ce)},[m.value]),gt=r==="popper"?Yp:iE,Ue=gt===Yp?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:x,sticky:g,hideWhenDetached:y,avoidCollisions:S}:{};return c.jsx(oE,{scope:n,content:w,viewport:C,onViewportChange:_,itemRefCallback:me,selectedItem:N,onItemLeave:rt,itemTextRefCallback:je,focusSelectedItem:W,selectedItemText:O,position:r,isPositioned:H,searchRef:X,children:c.jsx(Yd,{as:oo,allowPinchZoom:!0,children:c.jsx(Fd,{asChild:!0,trapped:m.open,onMountAutoFocus:ce=>{ce.preventDefault()},onUnmountAutoFocus:G(o,ce=>{var De;(De=m.trigger)==null||De.focus({preventScroll:!0}),ce.preventDefault()}),children:c.jsx(Ji,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:ce=>ce.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:c.jsx(gt,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:ce=>ce.preventDefault(),...v,...Ue,onPlaced:()=>L(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:G(v.onKeyDown,ce=>{const De=ce.ctrlKey||ce.altKey||ce.metaKey;if(ce.key==="Tab"&&ce.preventDefault(),!De&&ce.key.length===1&&le(ce.key),["ArrowUp","ArrowDown","Home","End"].includes(ce.key)){let $e=A().filter(Ve=>!Ve.disabled).map(Ve=>Ve.ref.current);if(["ArrowUp","End"].includes(ce.key)&&($e=$e.slice().reverse()),["ArrowUp","ArrowDown"].includes(ce.key)){const Ve=ce.target,Se=$e.indexOf(Ve);$e=$e.slice(Se+1)}setTimeout(()=>ne($e)),ce.preventDefault()}})})})})})})});sE.displayName=ZV;var qV="SelectItemAlignedPosition",iE=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=ls(Fs,n),i=cs(Fs,n),[a,l]=h.useState(null),[u,d]=h.useState(null),f=be(t,R=>d(R)),p=vf(n),x=h.useRef(!1),g=h.useRef(!0),{viewport:y,selectedItem:S,selectedItemText:v,focusSelectedItem:m}=i,w=h.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&y&&S&&v){const R=s.trigger.getBoundingClientRect(),N=u.getBoundingClientRect(),D=s.valueNode.getBoundingClientRect(),O=v.getBoundingClientRect();if(s.dir!=="rtl"){const Ve=O.left-N.left,Se=D.left-Ve,vt=R.left-Se,Zt=R.width+vt,xo=Math.max(Zt,N.width),pn=window.innerWidth-Yr,wo=Wp(Se,[Yr,pn-xo]);a.style.minWidth=Zt+"px",a.style.left=wo+"px"}else{const Ve=N.right-O.right,Se=window.innerWidth-D.right-Ve,vt=window.innerWidth-R.right-Se,Zt=R.width+vt,xo=Math.max(Zt,N.width),pn=window.innerWidth-Yr,wo=Wp(Se,[Yr,pn-xo]);a.style.minWidth=Zt+"px",a.style.right=wo+"px"}const B=p(),A=window.innerHeight-Yr*2,H=y.scrollHeight,L=window.getComputedStyle(u),K=parseInt(L.borderTopWidth,10),ne=parseInt(L.paddingTop,10),W=parseInt(L.borderBottomWidth,10),F=parseInt(L.paddingBottom,10),M=K+ne+H+F+W,X=Math.min(S.offsetHeight*5,M),le=window.getComputedStyle(y),me=parseInt(le.paddingTop,10),rt=parseInt(le.paddingBottom,10),je=R.top+R.height/2-Yr,gt=A-je,Ue=S.offsetHeight/2,ce=S.offsetTop+Ue,De=K+ne+ce,He=M-De;if(De<=je){const Ve=S===B[B.length-1].ref.current;a.style.bottom="0px";const Se=u.clientHeight-y.offsetTop-y.offsetHeight,vt=Math.max(gt,Ue+(Ve?rt:0)+Se+W),Zt=De+vt;a.style.height=Zt+"px"}else{const Ve=S===B[0].ref.current;a.style.top="0px";const vt=Math.max(je,K+y.offsetTop+(Ve?me:0)+Ue)+He;a.style.height=vt+"px",y.scrollTop=De-je+y.offsetTop}a.style.margin=`${Yr}px 0`,a.style.minHeight=X+"px",a.style.maxHeight=A+"px",r==null||r(),requestAnimationFrame(()=>x.current=!0)}},[p,s.trigger,s.valueNode,a,u,y,S,v,s.dir,r]);Kt(()=>w(),[w]);const[b,C]=h.useState();Kt(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const _=h.useCallback(R=>{R&&g.current===!0&&(w(),m==null||m(),g.current=!1)},[w,m]);return c.jsx(QV,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:x,onScrollButtonChange:_,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:c.jsx(ve.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});iE.displayName=qV;var XV="SelectPopperPosition",Yp=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Yr,...s}=e,i=yf(n);return c.jsx(mg,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});Yp.displayName=XV;var[QV,yv]=ia(Fs,{}),Hp="SelectViewport",aE=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=cs(Hp,n),i=yv(Hp,n),a=be(t,s.onViewportChange),l=h.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:r}),c.jsx(gf.Slot,{scope:n,children:c.jsx(ve.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"auto",...o.style},onScroll:G(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=i;if(p!=null&&p.current&&f){const x=Math.abs(l.current-d.scrollTop);if(x>0){const g=window.innerHeight-Yr*2,y=parseFloat(f.style.minHeight),S=parseFloat(f.style.height),v=Math.max(y,S);if(v0?b:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});aE.displayName=Hp;var lE="SelectGroup",[JV,ez]=ia(lE),cE=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Tr();return c.jsx(JV,{scope:n,id:o,children:c.jsx(ve.div,{role:"group","aria-labelledby":o,...r,ref:t})})});cE.displayName=lE;var uE="SelectLabel",dE=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ez(uE,n);return c.jsx(ve.div,{id:o.id,...r,ref:t})});dE.displayName=uE;var hd="SelectItem",[tz,fE]=ia(hd),hE=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=ls(hd,n),l=cs(hd,n),u=a.value===r,[d,f]=h.useState(s??""),[p,x]=h.useState(!1),g=be(t,v=>{var m;return(m=l.itemRefCallback)==null?void 0:m.call(l,v,r,o)}),y=Tr(),S=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")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(tz,{scope:n,value:r,disabled:o,textId:y,isSelected:u,onItemTextChange:h.useCallback(v=>{f(m=>m||((v==null?void 0:v.textContent)??"").trim())},[]),children:c.jsx(gf.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:c.jsx(ve.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:g,onFocus:G(i.onFocus,()=>x(!0)),onBlur:G(i.onBlur,()=>x(!1)),onPointerUp:G(i.onPointerUp,S),onPointerMove:G(i.onPointerMove,v=>{var m;o?(m=l.onItemLeave)==null||m.call(l):v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:G(i.onPointerLeave,v=>{var m;v.currentTarget===document.activeElement&&((m=l.onItemLeave)==null||m.call(l))}),onKeyDown:G(i.onKeyDown,v=>{var w;((w=l.searchRef)==null?void 0:w.current)!==""&&v.key===" "||(zV.includes(v.key)&&S(),v.key===" "&&v.preventDefault())})})})})});hE.displayName=hd;var Ma="SelectItemText",pE=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=ls(Ma,n),a=cs(Ma,n),l=fE(Ma,n),u=BV(Ma,n),[d,f]=h.useState(null),p=be(t,v=>f(v),l.onItemTextChange,v=>{var m;return(m=a.itemTextRefCallback)==null?void 0:m.call(a,v,l.value,l.disabled)}),x=d==null?void 0:d.textContent,g=h.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:x},l.value),[l.disabled,l.value,x]),{onNativeOptionAdd:y,onNativeOptionRemove:S}=u;return Kt(()=>(y(g),()=>S(g)),[y,S,g]),c.jsxs(c.Fragment,{children:[c.jsx(ve.span,{id:l.textId,...s,ref:p}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?fo.createPortal(s.children,i.valueNode):null]})});pE.displayName=Ma;var mE="SelectItemIndicator",gE=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return fE(mE,n).isSelected?c.jsx(ve.span,{"aria-hidden":!0,...r,ref:t}):null});gE.displayName=mE;var Bp="SelectScrollUpButton",vE=h.forwardRef((e,t)=>{const n=cs(Bp,e.__scopeSelect),r=yv(Bp,e.__scopeSelect),[o,s]=h.useState(!1),i=be(t,r.onScrollButtonChange);return Kt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?c.jsx(xE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});vE.displayName=Bp;var Gp="SelectScrollDownButton",yE=h.forwardRef((e,t)=>{const n=cs(Gp,e.__scopeSelect),r=yv(Gp,e.__scopeSelect),[o,s]=h.useState(!1),i=be(t,r.onScrollButtonChange);return Kt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?c.jsx(xE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});yE.displayName=Gp;var xE=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=cs("SelectScrollButton",n),i=h.useRef(null),a=vf(n),l=h.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return h.useEffect(()=>()=>l(),[l]),Kt(()=>{var d;const u=a().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),c.jsx(ve.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:G(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:G(o.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:G(o.onPointerLeave,()=>{l()})})}),nz="SelectSeparator",wE=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(ve.div,{"aria-hidden":!0,...r,ref:t})});wE.displayName=nz;var Kp="SelectArrow",rz=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=yf(n),s=ls(Kp,n),i=cs(Kp,n);return s.open&&i.position==="popper"?c.jsx(gg,{...o,...r,ref:t}):null});rz.displayName=Kp;function SE(e){return e===""||e===void 0}var _E=h.forwardRef((e,t)=>{const{value:n,...r}=e,o=h.useRef(null),s=be(t,o),i=ov(n);return h.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==n&&d){const f=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(f)}},[i,n]),c.jsx(oc,{asChild:!0,children:c.jsx("select",{...r,ref:s,defaultValue:n})})});_E.displayName="BubbleSelect";function bE(e){const t=_t(e),n=h.useRef(""),r=h.useRef(0),o=h.useCallback(i=>{const a=n.current+i;t(a),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),s=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function CE(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=oz(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const l=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function oz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var sz=qk,kE=Qk,iz=eE,az=tE,lz=nE,EE=rE,cz=aE,uz=cE,TE=dE,RE=hE,dz=pE,fz=gE,NE=vE,PE=yE,jE=wE;const cw=sz,uw=uz,dw=iz,Zp=h.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(kE,{ref:r,className:se("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),...n,children:[t,c.jsx(az,{asChild:!0,children:c.jsx(ZS,{className:"h-4 w-4 opacity-50"})})]}));Zp.displayName=kE.displayName;const DE=h.forwardRef(({className:e,...t},n)=>c.jsx(NE,{ref:n,className:se("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Aj,{className:"h-4 w-4"})}));DE.displayName=NE.displayName;const ME=h.forwardRef(({className:e,...t},n)=>c.jsx(PE,{ref:n,className:se("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(ZS,{className:"h-4 w-4"})}));ME.displayName=PE.displayName;const qp=h.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>c.jsx(lz,{children:c.jsxs(EE,{ref:o,className:se("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",n==="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:n,...r,children:[c.jsx(DE,{}),c.jsx(cz,{className:se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(ME,{})]})}));qp.displayName=EE.displayName;const Xp=h.forwardRef(({className:e,...t},n)=>c.jsx(TE,{ref:n,className:se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Xp.displayName=TE.displayName;const Qp=h.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(RE,{ref:r,className:se("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),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(fz,{children:c.jsx(KS,{className:"h-4 w-4"})})}),c.jsx(dz,{children:t})]}));Qp.displayName=RE.displayName;const hz=h.forwardRef(({className:e,...t},n)=>c.jsx(jE,{ref:n,className:se("-mx-1 my-1 h-px bg-muted",e),...t}));hz.displayName=jE.displayName;const Jp=new Map([["aliyun-cdn",["阿里云-CDN","/imgs/providers/aliyun.svg"]],["aliyun-oss",["阿里云-OSS","/imgs/providers/aliyun.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.png"]]]),pz=Array.from(Jp.keys()),mz=Pg,gz=jg,vz=Dg,OE=h.forwardRef(({className:e,...t},n)=>c.jsx(Zl,{ref:n,className:se("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}));OE.displayName=Zl.displayName;const AE=h.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(vz,{children:[c.jsx(OE,{}),c.jsxs(ql,{ref:r,className:se("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),...n,children:[t,c.jsxs(Gd,{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(Qm,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));AE.displayName=ql.displayName;const IE=({className:e,...t})=>c.jsx("div",{className:se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});IE.displayName="DialogHeader";const LE=h.forwardRef(({className:e,...t},n)=>c.jsx(Xl,{ref:n,className:se("text-lg font-semibold leading-none tracking-tight",e),...t}));LE.displayName=Xl.displayName;const yz=h.forwardRef(({className:e,...t},n)=>c.jsx(Ql,{ref:n,className:se("text-sm text-muted-foreground",e),...t}));yz.displayName=Ql.displayName;const Es=new Map([["tencent",["腾讯云","/imgs/providers/tencent.svg"]],["aliyun",["阿里云","/imgs/providers/aliyun.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.png"]]]),xv=Ie.union([Ie.literal("aliyun"),Ie.literal("tencent"),Ie.literal("ssh")],{message:"请选择云服务商"}),xz=({data:e,onAfterReq:t})=>{const{addAccess:n,updateAccess:r}=rc(),o=Ie.object({id:Ie.string().optional(),name:Ie.string().min(1).max(64),configType:xv,secretId:Ie.string().min(1).max(64),secretKey:Ie.string().min(1).max(64)});let s={secretId:"",secretKey:""};e&&(s=e.config);const i=ic({resolver:ac(o),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"tencent",secretId:s.secretId,secretKey:s.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 rv(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){r(u);return}n(u)}catch(d){Object.entries(d.response.data).forEach(([p,x])=>{i.setError(p,{type:"manual",message:x.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(cc,{...i,children:c.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(tt,{control:i.control,name:"name",render:({field:l})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"名称"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入授权名称",...l})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"id",render:({field:l})=>c.jsxs(qe,{className:"hidden",children:[c.jsx(Xe,{children:"配置类型"}),c.jsx(Qe,{children:c.jsx(ct,{...l})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"configType",render:({field:l})=>c.jsxs(qe,{className:"hidden",children:[c.jsx(Xe,{children:"配置类型"}),c.jsx(Qe,{children:c.jsx(ct,{...l})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"secretId",render:({field:l})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"SecretId"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入SecretId",...l})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"secretKey",render:({field:l})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"SecretKey"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入SecretKey",...l})}),c.jsx(Be,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(Dt,{type:"submit",children:"保存"})})]})})})})},wz=({data:e,onAfterReq:t})=>{const{addAccess:n,updateAccess:r}=rc(),o=Ie.object({id:Ie.string().optional(),name:Ie.string().min(1).max(64),configType:xv,accessKeyId:Ie.string().min(1).max(64),accessSecretId:Ie.string().min(1).max(64)});let s={accessKeyId:"",accessKeySecret:""};e&&(s=e.config);const i=ic({resolver:ac(o),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"aliyun",accessKeyId:s.accessKeyId,accessSecretId:s.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 rv(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){r(u);return}n(u)}catch(d){Object.entries(d.response.data).forEach(([p,x])=>{i.setError(p,{type:"manual",message:x.message})});return}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(cc,{...i,children:c.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(tt,{control:i.control,name:"name",render:({field:l})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"名称"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入授权名称",...l})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"id",render:({field:l})=>c.jsxs(qe,{className:"hidden",children:[c.jsx(Xe,{children:"配置类型"}),c.jsx(Qe,{children:c.jsx(ct,{...l})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"configType",render:({field:l})=>c.jsxs(qe,{className:"hidden",children:[c.jsx(Xe,{children:"配置类型"}),c.jsx(Qe,{children:c.jsx(ct,{...l})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"accessKeyId",render:({field:l})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"AccessKeyId"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入AccessKeyId",...l})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"accessSecretId",render:({field:l})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"AccessKeySecret"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入AccessKeySecret",...l})}),c.jsx(Be,{})]})}),c.jsx(Be,{}),c.jsx("div",{className:"flex justify-end",children:c.jsx(Dt,{type:"submit",children:"保存"})})]})})})})};var wv="Radio",[Sz,FE]=_n(wv),[_z,bz]=Sz(wv),UE=h.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:i,value:a="on",onCheck:l,...u}=e,[d,f]=h.useState(null),p=be(t,y=>f(y)),x=h.useRef(!1),g=d?!!d.closest("form"):!0;return c.jsxs(_z,{scope:n,checked:o,disabled:i,children:[c.jsx(ve.button,{type:"button",role:"radio","aria-checked":o,"data-state":zE(o),"data-disabled":i?"":void 0,disabled:i,value:a,...u,ref:p,onClick:G(e.onClick,y=>{o||l==null||l(),g&&(x.current=y.isPropagationStopped(),x.current||y.stopPropagation())})}),g&&c.jsx(Cz,{control:d,bubbles:!x.current,name:r,value:a,checked:o,required:s,disabled:i,style:{transform:"translateX(-100%)"}})]})});UE.displayName=wv;var $E="RadioIndicator",VE=h.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=bz($E,n);return c.jsx(fn,{present:r||s.checked,children:c.jsx(ve.span,{"data-state":zE(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});VE.displayName=$E;var Cz=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,s=h.useRef(null),i=ov(n),a=ug(t);return h.useEffect(()=>{const l=s.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==n&&f){const p=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(p)}},[i,n,r]),c.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function zE(e){return e?"checked":"unchecked"}var kz=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Sv="RadioGroup",[Ez,f3]=_n(Sv,[zd,FE]),WE=zd(),YE=FE(),[Tz,Rz]=Ez(Sv),HE=h.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:i=!1,disabled:a=!1,orientation:l,dir:u,loop:d=!0,onValueChange:f,...p}=e,x=WE(n),g=Yl(u),[y,S]=so({prop:s,defaultProp:o,onChange:f});return c.jsx(Tz,{scope:n,name:r,required:i,disabled:a,value:y,onValueChange:S,children:c.jsx(O_,{asChild:!0,...x,orientation:l,dir:g,loop:d,children:c.jsx(ve.div,{role:"radiogroup","aria-required":i,"aria-orientation":l,"data-disabled":a?"":void 0,dir:g,...p,ref:t})})})});HE.displayName=Sv;var BE="RadioGroupItem",GE=h.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=Rz(BE,n),i=s.disabled||r,a=WE(n),l=YE(n),u=h.useRef(null),d=be(t,u),f=s.value===o.value,p=h.useRef(!1);return h.useEffect(()=>{const x=y=>{kz.includes(y.key)&&(p.current=!0)},g=()=>p.current=!1;return document.addEventListener("keydown",x),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",x),document.removeEventListener("keyup",g)}},[]),c.jsx(A_,{asChild:!0,...a,focusable:!i,active:f,children:c.jsx(UE,{disabled:i,required:s.required,checked:f,...l,...o,name:s.name,ref:d,onCheck:()=>s.onValueChange(o.value),onKeyDown:G(x=>{x.key==="Enter"&&x.preventDefault()}),onFocus:G(o.onFocus,()=>{var x;p.current&&((x=u.current)==null||x.click())})})})});GE.displayName=BE;var Nz="RadioGroupIndicator",KE=h.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=YE(n);return c.jsx(VE,{...o,...r,ref:t})});KE.displayName=Nz;var ZE=HE,qE=GE,Pz=KE;const _v=h.forwardRef(({className:e,...t},n)=>c.jsx(ZE,{className:se("grid gap-2",e),...t,ref:n}));_v.displayName=ZE.displayName;const bv=h.forwardRef(({className:e,...t},n)=>c.jsx(qE,{ref:n,className:se("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:c.jsx(Pz,{className:"flex items-center justify-center",children:c.jsx(QS,{className:"h-2.5 w-2.5 fill-current text-current"})})}));bv.displayName=qE.displayName;const XE=h.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:se("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:n,...t}));XE.displayName="Textarea";function jz(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{r.result?t(r.result.toString()):n("No content found")},r.onerror=()=>n(r.error),r.readAsText(e)})}const Dz=({data:e,onAfterReq:t})=>{const{addAccess:n,updateAccess:r}=rc(),o=Ie.object({id:Ie.string().optional(),name:Ie.string().min(1).max(64),configType:xv,host:Ie.string().ip({message:"请输入合法的IP地址"}),port:Ie.string().min(1).max(5),username:Ie.string().min(1).max(64),password:Ie.string().min(0).max(64),key:Ie.string().min(0).max(20480),keyFile:Ie.string().optional(),command:Ie.string().min(1).max(2048),certPath:Ie.string().min(0).max(2048),keyPath:Ie.string().min(0).max(2048)});let s={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&&(s=e.config);const i=ic({resolver:ac(o),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"ssh",host:s.host,port:s.port,username:s.username,password:s.password,key:s.key,keyFile:s.keyFile,certPath:s.certPath,keyPath:s.keyPath,command:s.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 rv(d);if(t(),d.id=f.id,d.created=f.created,d.updated=f.updated,u.id){r(d);return}n(d)}catch(f){Object.entries(f.response.data).forEach(([x,g])=>{i.setError(x,{type:"manual",message:g.message})});return}},l=async u=>{var p;const d=(p=u.target.files)==null?void 0:p[0];if(!d)return;const f=await jz(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(cc,{...i,children:c.jsxs("form",{onSubmit:u=>{u.stopPropagation(),i.handleSubmit(a)(u)},className:"space-y-3",children:[c.jsx(tt,{control:i.control,name:"name",render:({field:u})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"名称"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入授权名称",...u})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"id",render:({field:u})=>c.jsxs(qe,{className:"hidden",children:[c.jsx(Xe,{children:"配置类型"}),c.jsx(Qe,{children:c.jsx(ct,{...u})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"configType",render:({field:u})=>c.jsxs(qe,{className:"hidden",children:[c.jsx(Xe,{children:"配置类型"}),c.jsx(Qe,{children:c.jsx(ct,{...u})}),c.jsx(Be,{})]})}),c.jsxs("div",{className:"flex space-x-2",children:[c.jsx(tt,{control:i.control,name:"host",render:({field:u})=>c.jsxs(qe,{className:"grow",children:[c.jsx(Xe,{children:"服务器IP"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入Host",...u})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"port",render:({field:u})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"SSH端口"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入Port",...u,type:"number"})}),c.jsx(Be,{})]})})]}),c.jsx(tt,{control:i.control,name:"username",render:({field:u})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"用户名"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入用户名",...u})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"password",render:({field:u})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"密码"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入密码",...u})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"key",render:({field:u})=>c.jsxs(qe,{hidden:!0,children:[c.jsx(Xe,{children:"Key(使用证书登录)"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入Key",...u})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"keyFile",render:({field:u})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"Key(使用证书登录)"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入Key",...u,type:"file",onChange:l})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"certPath",render:({field:u})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"证书上传路径"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入证书上传路径",...u})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"keyPath",render:({field:u})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"私钥上传路径"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入私钥上传路径",...u})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:i.control,name:"command",render:({field:u})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"Command"}),c.jsx(Qe,{children:c.jsx(XE,{placeholder:"请输入要执行的命令",...u})}),c.jsx(Be,{})]})}),c.jsx(Be,{}),c.jsx("div",{className:"flex justify-end",children:c.jsx(Dt,{type:"submit",children:"保存"})})]})})})})};function Ga({trigger:e,op:t,data:n,className:r}){const[o,s]=h.useState(!1),i=Array.from(Es.keys()),[a,l]=h.useState((n==null?void 0:n.configType)||"");let u=c.jsx(c.Fragment,{children:" "});switch(a){case"tencent":u=c.jsx(xz,{data:n,onAfterReq:()=>{s(!1)}});break;case"aliyun":u=c.jsx(wz,{data:n,onAfterReq:()=>{s(!1)}});break;case"ssh":u=c.jsx(Dz,{data:n,onAfterReq:()=>{s(!1)}});break}const d=f=>f==a?"border-primary":"";return c.jsxs(mz,{onOpenChange:s,open:o,children:[c.jsx(gz,{asChild:!0,className:se(r),children:e}),c.jsxs(AE,{className:"sm:max-w-[600px] w-full",children:[c.jsx(IE,{children:c.jsxs(LE,{children:[t=="add"?"添加":"编辑","授权"]})}),c.jsxs("div",{className:"container",children:[c.jsx(Ll,{children:"服务商"}),c.jsx(_v,{value:a,className:"flex mt-3 space-x-2",onValueChange:f=>{console.log(f),l(f)},children:i.map(f=>{var p,x;return c.jsx("div",{className:"flex items-center space-x-2",children:c.jsxs(Ll,{children:[c.jsx(bv,{value:f,hidden:!0}),c.jsxs("div",{className:se("flex items-center space-x-2 border p-2 rounded cursor-pointer",d(f)),children:[c.jsx("img",{src:(p=Es.get(f))==null?void 0:p[1],className:"h-6"}),c.jsx("div",{children:(x=Es.get(f))==null?void 0:x[0]})]})]})},f)})}),u]})]})]})}const Mz=()=>{const{config:{accesses:e}}=rc(),[t,n]=h.useState(),r=is();h.useEffect(()=>{const g=new URLSearchParams(r.search).get("id");g&&(async()=>{const S=await d$(g);n(S)})()},[r.search]);const o=Ie.object({id:Ie.string().optional(),domain:Ie.string().regex(/^(?!:\/\/)([a-zA-Z0-9-_]+\.)+[a-zA-Z]{2,}$/,{message:"请输入正确的域名"}),access:Ie.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择DNS服务商授权配置"}),targetAccess:Ie.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择部署服务商配置"}),targetType:Ie.string().regex(/^[a-zA-Z0-9-]+$/,{message:"请选择部署服务类型"})}),s=ic({resolver:ac(o),defaultValues:{id:"",domain:"",access:"",targetAccess:"",targetType:""}});h.useEffect(()=>{t&&s.reset({id:t.id,domain:t.domain,access:t.access,targetAccess:t.targetAccess,targetType:t.targetType})},[t,s]);const[i,a]=h.useState(t?t.targetType:""),l=e.filter(x=>{if(i=="")return!0;const g=s.getValues().targetType.split("-");return x.configType===g[0]}),{toast:u}=cv(),d=as(),f=async x=>{const g={id:x.id,crontab:"0 0 * * *",domain:x.domain,access:x.access,targetAccess:x.targetAccess,targetType:x.targetType};try{await Fp(g);let y="域名编辑成功";g.id==""&&(y="域名添加成功"),u({title:"成功",description:y}),d("/")}catch(y){Object.entries(y.response.data).forEach(([v,m])=>{s.setError(v,{type:"manual",message:m.message})});return}},p=x=>s.getValues().targetType==x?"border-primary":"";return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"",children:[c.jsx(dk,{}),c.jsxs("div",{className:"border-b h-10 text-muted-foreground",children:[t!=null&&t.id?"编辑":"新增","域名"]}),c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(cc,{...s,children:c.jsxs("form",{onSubmit:s.handleSubmit(f),className:"space-y-8",children:[c.jsx(tt,{control:s.control,name:"domain",render:({field:x})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"域名"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"请输入域名",...x})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:s.control,name:"access",render:({field:x})=>c.jsxs(qe,{children:[c.jsxs(Xe,{className:"flex w-full justify-between",children:[c.jsx("div",{children:"DNS 服务商授权配置"}),c.jsx(Ga,{trigger:c.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[c.jsx(fx,{size:14}),"新增"]}),op:"add"})]}),c.jsx(Qe,{children:c.jsxs(cw,{...x,value:x.value,onValueChange:g=>{s.setValue("access",g)},children:[c.jsx(Zp,{children:c.jsx(dw,{placeholder:"请选择授权配置"})}),c.jsx(qp,{children:c.jsxs(uw,{children:[c.jsx(Xp,{children:"服务商授权配置"}),e.map(g=>{var y;return c.jsx(Qp,{value:g.id,children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("img",{className:"w-6",src:(y=Es.get(g.configType))==null?void 0:y[1]}),c.jsx("div",{children:g.name})]})},g.id)})]})})]})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:s.control,name:"targetType",render:({field:x})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"部署服务类型"}),c.jsx(Qe,{children:c.jsx(_v,{className:"flex mt-3 space-x-2",onValueChange:g=>{a(g),s.setValue("targetType",g)},...x,children:pz.map(g=>{var y,S;return c.jsx("div",{className:"flex items-center space-x-2",children:c.jsxs(Ll,{children:[c.jsx(bv,{value:g,id:g,hidden:!0}),c.jsxs("div",{className:se("flex items-center space-x-2 border p-2 rounded cursor-pointer",p(g)),children:[c.jsx("img",{src:(y=Jp.get(g))==null?void 0:y[1],className:"h-6"}),c.jsx("div",{children:(S=Jp.get(g))==null?void 0:S[0]})]})]})},g)})})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:s.control,name:"targetAccess",render:({field:x})=>c.jsxs(qe,{children:[c.jsxs(Xe,{className:"w-full flex justify-between",children:[c.jsx("div",{children:"部署服务商授权配置"}),c.jsx(Ga,{trigger:c.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[c.jsx(fx,{size:14}),"新增"]}),op:"add"})]}),c.jsx(Qe,{children:c.jsxs(cw,{...x,onValueChange:g=>{s.setValue("targetAccess",g)},children:[c.jsx(Zp,{children:c.jsx(dw,{placeholder:"请选择授权配置"})}),c.jsx(qp,{children:c.jsxs(uw,{children:[c.jsx(Xp,{children:"服务商授权配置"}),l.map(g=>{var y;return c.jsx(Qp,{value:g.id,children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("img",{className:"w-6",src:(y=Es.get(g.configType))==null?void 0:y[1]}),c.jsx("div",{children:g.name})]})},g.id)})]})})]})}),c.jsx(Be,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(Dt,{type:"submit",children:"保存"})})]})})})]})})},Oz=()=>{const{config:e,deleteAccess:t}=rc(),{accesses:n}=e,r=async o=>{const s=await z4(o);t(s.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(Ga,{trigger:c.jsx(Dt,{children:"添加授权"}),op:"add"})]}),n.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(Lj,{size:40,className:"text-primary"})}),c.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加授权开始部署证书吧。"}),c.jsx(Ga,{trigger:c.jsx(Dt,{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 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:"授权列表"}),n.map(o=>{var s,i;return c.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b sm:p-2 hover:bg-muted/50 text-sm",children:[c.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:o.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:(s=Es.get(o.configType))==null?void 0:s[1],className:"w-6"}),c.jsx("div",{children:(i=Es.get(o.configType))==null?void 0:i[0]})]}),c.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["创建于 ",o.created&&_l(o.created)]}),c.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["更新于 ",o.updated&&_l(o.updated)]}),c.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[c.jsx(Ga,{trigger:c.jsx(Dt,{variant:"link",className:"p-0",children:"编辑"}),op:"edit",data:o}),c.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(Dt,{variant:"link",className:"p-0",onClick:()=>{r(o)},children:"删除"})]})]},o.id)})]})]})},Az=Wl("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"}}),QE=h.forwardRef(({className:e,variant:t,...n},r)=>c.jsx("div",{ref:r,role:"alert",className:se(Az({variant:t}),e),...n}));QE.displayName="Alert";const JE=h.forwardRef(({className:e,...t},n)=>c.jsx("h5",{ref:n,className:se("mb-1 font-medium leading-none tracking-tight",e),...t}));JE.displayName="AlertTitle";const eT=h.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:se("text-sm [&_p]:leading-relaxed",e),...t}));eT.displayName="AlertDescription";function Iz(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Cv="ScrollArea",[tT,h3]=_n(Cv),[Lz,Kn]=tT(Cv),nT=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[a,l]=h.useState(null),[u,d]=h.useState(null),[f,p]=h.useState(null),[x,g]=h.useState(null),[y,S]=h.useState(null),[v,m]=h.useState(0),[w,b]=h.useState(0),[C,_]=h.useState(!1),[R,N]=h.useState(!1),D=be(t,B=>l(B)),O=Yl(o);return c.jsx(Lz,{scope:n,type:r,dir:O,scrollHideDelay:s,scrollArea:a,viewport:u,onViewportChange:d,content:f,onContentChange:p,scrollbarX:x,onScrollbarXChange:g,scrollbarXEnabled:C,onScrollbarXEnabledChange:_,scrollbarY:y,onScrollbarYChange:S,scrollbarYEnabled:R,onScrollbarYEnabledChange:N,onCornerWidthChange:m,onCornerHeightChange:b,children:c.jsx(ve.div,{dir:O,...i,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});nT.displayName=Cv;var rT="ScrollAreaViewport",oT=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...s}=e,i=Kn(rT,n),a=h.useRef(null),l=be(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:o}),c.jsx(ve.div,{"data-radix-scroll-area-viewport":"",...s,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:r})})]})});oT.displayName=rT;var Ar="ScrollAreaScrollbar",kv=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Kn(Ar,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,a=e.orientation==="horizontal";return h.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),o.type==="hover"?c.jsx(Fz,{...r,ref:t,forceMount:n}):o.type==="scroll"?c.jsx(Uz,{...r,ref:t,forceMount:n}):o.type==="auto"?c.jsx(sT,{...r,ref:t,forceMount:n}):o.type==="always"?c.jsx(Ev,{...r,ref:t}):null});kv.displayName=Ar;var Fz=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Kn(Ar,e.__scopeScrollArea),[s,i]=h.useState(!1);return h.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const u=()=>{window.clearTimeout(l),i(!0)},d=()=>{l=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),c.jsx(fn,{present:n||s,children:c.jsx(sT,{"data-state":s?"visible":"hidden",...r,ref:t})})}),Uz=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Kn(Ar,e.__scopeScrollArea),s=e.orientation==="horizontal",i=wf(()=>l("SCROLL_END"),100),[a,l]=Iz("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return h.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,o.scrollHideDelay,l]),h.useEffect(()=>{const u=o.viewport,d=s?"scrollLeft":"scrollTop";if(u){let f=u[d];const p=()=>{const x=u[d];f!==x&&(l("SCROLL"),i()),f=x};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[o.viewport,s,l,i]),c.jsx(fn,{present:n||a!=="hidden",children:c.jsx(Ev,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:G(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:G(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),sT=h.forwardRef((e,t)=>{const n=Kn(Ar,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=h.useState(!1),a=e.orientation==="horizontal",l=wf(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,o=Kn(Ar,e.__scopeScrollArea),s=h.useRef(null),i=h.useRef(0),[a,l]=h.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=uT(a.viewport,a.content),d={...r,sizes:a,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:p=>s.current=p,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:p=>i.current=p};function f(p,x){return Hz(p,i.current,a,x)}return n==="horizontal"?c.jsx($z,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const p=o.viewport.scrollLeft,x=fw(p,a,o.dir);s.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=f(p,o.dir))}}):n==="vertical"?c.jsx(Vz,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const p=o.viewport.scrollTop,x=fw(p,a);s.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=f(p))}}):null}),$z=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=Kn(Ar,e.__scopeScrollArea),[i,a]=h.useState(),l=h.useRef(null),u=be(t,l,s.onScrollbarXChange);return h.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(aT,{"data-orientation":"horizontal",...o,ref:u,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":xf(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(s.viewport){const p=s.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),fT(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:md(i.paddingLeft),paddingEnd:md(i.paddingRight)}})}})}),Vz=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=Kn(Ar,e.__scopeScrollArea),[i,a]=h.useState(),l=h.useRef(null),u=be(t,l,s.onScrollbarYChange);return h.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(aT,{"data-orientation":"vertical",...o,ref:u,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":xf(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(s.viewport){const p=s.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),fT(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:md(i.paddingTop),paddingEnd:md(i.paddingBottom)}})}})}),[zz,iT]=tT(Ar),aT=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...p}=e,x=Kn(Ar,n),[g,y]=h.useState(null),S=be(t,D=>y(D)),v=h.useRef(null),m=h.useRef(""),w=x.viewport,b=r.content-r.viewport,C=_t(d),_=_t(l),R=wf(f,10);function N(D){if(v.current){const O=D.clientX-v.current.left,B=D.clientY-v.current.top;u({x:O,y:B})}}return h.useEffect(()=>{const D=O=>{const B=O.target;(g==null?void 0:g.contains(B))&&C(O,b)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[w,g,b,C]),h.useEffect(_,[r,_]),Bi(g,R),Bi(x.content,R),c.jsx(zz,{scope:n,scrollbar:g,hasThumb:o,onThumbChange:_t(s),onThumbPointerUp:_t(i),onThumbPositionChange:_,onThumbPointerDown:_t(a),children:c.jsx(ve.div,{...p,ref:S,style:{position:"absolute",...p.style},onPointerDown:G(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),v.current=g.getBoundingClientRect(),m.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),N(D))}),onPointerMove:G(e.onPointerMove,N),onPointerUp:G(e.onPointerUp,D=>{const O=D.target;O.hasPointerCapture(D.pointerId)&&O.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=m.current,x.viewport&&(x.viewport.style.scrollBehavior=""),v.current=null})})})}),pd="ScrollAreaThumb",lT=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=iT(pd,e.__scopeScrollArea);return c.jsx(fn,{present:n||o.hasThumb,children:c.jsx(Wz,{ref:t,...r})})}),Wz=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=Kn(pd,n),i=iT(pd,n),{onThumbPositionChange:a}=i,l=be(t,f=>i.onThumbChange(f)),u=h.useRef(),d=wf(()=>{u.current&&(u.current(),u.current=void 0)},100);return h.useEffect(()=>{const f=s.viewport;if(f){const p=()=>{if(d(),!u.current){const x=Bz(f,a);u.current=x,a()}};return a(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[s.viewport,d,a]),c.jsx(ve.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:G(e.onPointerDownCapture,f=>{const x=f.target.getBoundingClientRect(),g=f.clientX-x.left,y=f.clientY-x.top;i.onThumbPointerDown({x:g,y})}),onPointerUp:G(e.onPointerUp,i.onThumbPointerUp)})});lT.displayName=pd;var Tv="ScrollAreaCorner",cT=h.forwardRef((e,t)=>{const n=Kn(Tv,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?c.jsx(Yz,{...e,ref:t}):null});cT.displayName=Tv;var Yz=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=Kn(Tv,n),[s,i]=h.useState(0),[a,l]=h.useState(0),u=!!(s&&a);return Bi(o.scrollbarX,()=>{var f;const d=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),Bi(o.scrollbarY,()=>{var f;const d=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(d),i(d)}),u?c.jsx(ve.div,{...r,ref:t,style:{width:s,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function md(e){return e?parseInt(e,10):0}function uT(e,t){const n=e/t;return isNaN(n)?0:n}function xf(e){const t=uT(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Hz(e,t,n,r="ltr"){const o=xf(n),s=o/2,i=t||s,a=o-i,l=n.scrollbar.paddingStart+i,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return dT([l,u],f)(e)}function fw(e,t,n="ltr"){const r=xf(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,a=s-r,l=n==="ltr"?[0,i]:[i*-1,0],u=Wp(e,l);return dT([0,i],[0,a])(u)}function dT(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function fT(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,a=n.top!==s.top;(i||a)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function wf(e,t){const n=_t(e),r=h.useRef(0);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),h.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Bi(e,t){const n=_t(t);Kt(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var hT=nT,Gz=oT,Kz=cT;const pT=h.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(hT,{ref:r,className:se("relative overflow-hidden",e),...n,children:[c.jsx(Gz,{className:"h-full w-full rounded-[inherit]",children:t}),c.jsx(mT,{}),c.jsx(Kz,{})]}));pT.displayName=hT.displayName;const mT=h.forwardRef(({className:e,orientation:t="vertical",...n},r)=>c.jsx(kv,{ref:r,orientation:t,className:se("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),...n,children:c.jsx(lT,{className:"relative flex-1 rounded-full bg-border"})}));mT.displayName=kv.displayName;const Zz=async e=>{let t=1;e.page&&(t=e.page);let n=50;e.perPage&&(n=e.perPage);let r="domain!=null";return e.domain&&(r=`domain="${e.domain}"`),await Vt().collection("deployments").getList(t,n,{filter:r,sort:"-deployedAt",expand:"domain"})},qz=()=>{const e=as(),[t,n]=h.useState(),[r]=Pj(),o=r.get("domain");return h.useEffect(()=>{(async()=>{const i={};o&&(i.domain=o);const a=await Zz(i);n(a.items)})()},[o]),c.jsxs(pT,{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 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(s=>{var i,a;return c.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b 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=s.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:s.phase==="deploy"&&s.phaseSuccess?c.jsx(qS,{size:16,className:"text-green-700"}):c.jsx(XS,{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(aC,{phase:s.phase,phaseSuccess:s.phaseSuccess})}),c.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:_l(s.deployedAt)}),c.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:c.jsxs(o1,{children:[c.jsx(s1,{asChild:!0,children:c.jsx(Dt,{variant:"link",className:"p-0",children:"日志"})}),c.jsxs(Mg,{className:"sm:max-w-5xl",children:[c.jsx(a1,{children:c.jsxs(l1,{children:[(a=s.expand.domain)==null?void 0:a.domain,"-",s.id,"部署详情"]})}),c.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[s.log.check&&c.jsx(c.Fragment,{children:s.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})]}))}),s.log.apply&&c.jsx(c.Fragment,{children:s.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.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),s.log.deploy&&c.jsx(c.Fragment,{children:s.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})]}))})]})]})]})})]},s.id)})]}):c.jsx(c.Fragment,{children:c.jsxs(QE,{className:"max-w-[40em] mx-auto mt-20",children:[c.jsx(JE,{children:"暂无数据"}),c.jsxs(eT,{children:[c.jsxs("div",{className:"flex items-center mt-5",children:[c.jsx("div",{children:c.jsx(Uj,{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(Dt,{onClick:()=>{e("/")},children:"添加域名"})})]})]})})]})},Xz=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",Qz=Ie.object({username:Ie.string().email({message:"请输入正确的邮箱地址"}),password:Ie.string().min(10,{message:"密码至少10个字符"})}),Jz=()=>{const e=ic({resolver:ac(Qz),defaultValues:{username:"",password:""}}),t=async r=>{try{await Vt().admins.authWithPassword(r.username,r.password),n("/")}catch(o){const s=Xz(o);e.setError("username",{message:s}),e.setError("password",{message:s})}},n=as();return c.jsxs("div",{className:"max-w-[35em] border 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(cc,{...e,children:c.jsxs("form",{onSubmit:e.handleSubmit(t),className:"space-y-8",children:[c.jsx(tt,{control:e.control,name:"username",render:({field:r})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"用户名"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"email",...r})}),c.jsx(Be,{})]})}),c.jsx(tt,{control:e.control,name:"password",render:({field:r})=>c.jsxs(qe,{children:[c.jsx(Xe,{children:"密码"}),c.jsx(Qe,{children:c.jsx(ct,{placeholder:"shadcn",...r,type:"password"})}),c.jsx(Be,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(Dt,{type:"submit",children:"登录"})})]})})]})},e3=()=>Vt().authStore.isValid&&Vt().authStore.isAdmin?c.jsx(HS,{to:"/"}):c.jsx("div",{className:"container",children:c.jsx(BS,{})}),t3=mj([{path:"/",element:c.jsx(H4,{}),children:[{path:"/",element:c.jsx(m$,{})},{path:"/edit",element:c.jsx(Mz,{})},{path:"/access",element:c.jsx(Oz,{})},{path:"/history",element:c.jsx(qz,{})}]},{path:"/login",element:c.jsx(e3,{}),children:[{path:"/login",element:c.jsx(Jz,{})}]},{path:"/about",element:c.jsx("div",{children:"About"})}]);Sh.createRoot(document.getElementById("root")).render(c.jsx(Oe.StrictMode,{children:c.jsx(Cj,{router:t3})}))});export default n3(); diff --git a/ui/dist/index.html b/ui/dist/index.html index c1707feb..f977444b 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -5,7 +5,7 @@ Certimate - Your Trusted SSL Automation Partner - + diff --git a/ui/package-lock.json b/ui/package-lock.json index 0beb9c76..eebcaeb3 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -24,6 +24,7 @@ "@radix-ui/react-tooltip": "^1.1.2", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", + "jszip": "^3.10.1", "lucide-react": "^0.417.0", "moment": "^2.30.1", "pocketbase": "^0.21.4", @@ -2827,6 +2828,11 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -3574,6 +3580,11 @@ "node": ">= 4" } }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmmirror.com/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==" + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmmirror.com/import-fresh/-/import-fresh-3.3.0.tgz", @@ -3613,8 +3624,7 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/invariant": { "version": "2.2.4", @@ -3693,6 +3703,11 @@ "node": ">=8" } }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz", @@ -3779,6 +3794,17 @@ "node": ">=6" } }, + "node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmmirror.com/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmmirror.com/keyv/-/keyv-4.5.4.tgz", @@ -3801,6 +3827,14 @@ "node": ">= 0.8.0" } }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmmirror.com/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dependencies": { + "immediate": "~3.0.5" + } + }, "node_modules/lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmmirror.com/lilconfig/-/lilconfig-2.1.0.tgz", @@ -4052,6 +4086,11 @@ "resolved": "https://registry.npmmirror.com/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==" }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmmirror.com/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmmirror.com/parent-module/-/parent-module-1.0.1.tgz", @@ -4317,6 +4356,11 @@ "node": ">= 0.8.0" } }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmmirror.com/punycode/-/punycode-2.3.1.tgz", @@ -4497,6 +4541,20 @@ "pify": "^2.3.0" } }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmmirror.com/readdirp/-/readdirp-3.6.0.tgz", @@ -4615,6 +4673,11 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, "node_modules/scheduler": { "version": "0.23.2", "resolved": "https://registry.npmmirror.com/scheduler/-/scheduler-0.23.2.tgz", @@ -4635,6 +4698,11 @@ "node": ">=10" } }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz", @@ -4682,6 +4750,14 @@ "node": ">=0.10.0" } }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmmirror.com/string-width/-/string-width-5.1.2.tgz", diff --git a/ui/package.json b/ui/package.json index 00381ce4..17cb0ef4 100644 --- a/ui/package.json +++ b/ui/package.json @@ -26,6 +26,7 @@ "@radix-ui/react-tooltip": "^1.1.2", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", + "jszip": "^3.10.1", "lucide-react": "^0.417.0", "moment": "^2.30.1", "pocketbase": "^0.21.4", diff --git a/ui/src/domain/domain.ts b/ui/src/domain/domain.ts index 6b1a6d02..d31f7b25 100644 --- a/ui/src/domain/domain.ts +++ b/ui/src/domain/domain.ts @@ -16,6 +16,8 @@ export type Domain = { updated?: string; deleted?: string; rightnow?: boolean; + certificate?: string; + privateKey?: string; expand?: { lastDeployment?: Deployment; }; diff --git a/ui/src/lib/file.ts b/ui/src/lib/file.ts index 409f7fe2..38764ed7 100644 --- a/ui/src/lib/file.ts +++ b/ui/src/lib/file.ts @@ -1,3 +1,5 @@ +import JSZip from "jszip"; + export function readFileContent(file: File): Promise { return new Promise((resolve, reject) => { const reader = new FileReader(); @@ -15,3 +17,24 @@ export function readFileContent(file: File): Promise { reader.readAsText(file); }); } + +export type CustomFile = { + name: string; + content: string; +}; + +export const saveFiles2ZIP = async (zipName: string, files: CustomFile[]) => { + const zip = new JSZip(); + + files.forEach((file) => { + zip.file(file.name, file.content); + }); + + const content = await zip.generateAsync({ type: "blob" }); + + // Save the zip file to the local system + const link = document.createElement("a"); + link.href = URL.createObjectURL(content); + link.download = zipName; + link.click(); +}; diff --git a/ui/src/pages/domains/Edit.tsx b/ui/src/pages/domains/Edit.tsx index d79d60cc..8c1a3170 100644 --- a/ui/src/pages/domains/Edit.tsx +++ b/ui/src/pages/domains/Edit.tsx @@ -62,7 +62,7 @@ const Edit = () => { const formSchema = z.object({ id: z.string().optional(), - domain: z.string().regex(/^(?!:\/\/)([a-zA-Z0-9-_]+\.)+[a-zA-Z]{2,}$/, { + domain: z.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/, { message: "请输入正确的域名", }), access: z.string().regex(/^[a-zA-Z0-9]+$/, { diff --git a/ui/src/pages/domains/Home.tsx b/ui/src/pages/domains/Home.tsx index 6bedb0bd..6703de9d 100644 --- a/ui/src/pages/domains/Home.tsx +++ b/ui/src/pages/domains/Home.tsx @@ -19,6 +19,7 @@ import { Toaster } from "@/components/ui/toaster"; import { Tooltip, TooltipTrigger } from "@/components/ui/tooltip"; import { useToast } from "@/components/ui/use-toast"; import { Domain } from "@/domain/domain"; +import { CustomFile, saveFiles2ZIP } from "@/lib/file"; import { convertZulu2Beijing, getDate } from "@/lib/time"; import { list, @@ -127,6 +128,22 @@ const Home = () => { } }; + const handleDownloadClick = async (domain: Domain) => { + const zipName = `${domain.id}-${domain.domain}.zip`; + const files: CustomFile[] = [ + { + name: `${domain.domain}.pem`, + content: domain.certificate ? domain.certificate : "", + }, + { + name: `${domain.domain}.key`, + content: domain.privateKey ? domain.privateKey : "", + }, + ]; + + await saveFiles2ZIP(zipName, files); + }; + return ( <>
@@ -253,6 +270,17 @@ const Home = () => { + + + + + {!domain.enabled && ( <>