function Qg(t,e){for(var n=0;ni[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();var Na=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Il(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var jc={exports:{}},va={},Cc={exports:{}},ze={};var Up;function Ox(){if(Up)return ze;Up=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.iterator;function w(O){return O===null||typeof O!="object"?null:(O=v&&O[v]||O["@@iterator"],typeof O=="function"?O:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,_={};function S(O,q,ae){this.props=O,this.context=q,this.refs=_,this.updater=ae||x}S.prototype.isReactComponent={},S.prototype.setState=function(O,q){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,q,"setState")},S.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function I(){}I.prototype=S.prototype;function E(O,q,ae){this.props=O,this.context=q,this.refs=_,this.updater=ae||x}var z=E.prototype=new I;z.constructor=E,j(z,S.prototype),z.isPureReactComponent=!0;var M=Array.isArray,L=Object.prototype.hasOwnProperty,Q={current:null},le={key:!0,ref:!0,__self:!0,__source:!0};function ue(O,q,ae){var fe,Ee={},Ie=null,ke=null;if(q!=null)for(fe in q.ref!==void 0&&(ke=q.ref),q.key!==void 0&&(Ie=""+q.key),q)L.call(q,fe)&&!le.hasOwnProperty(fe)&&(Ee[fe]=q[fe]);var Ue=arguments.length-2;if(Ue===1)Ee.children=ae;else if(1>>1,q=V[O];if(0>>1;Oo(Ee,W))Ieo(ke,Ee)?(V[O]=ke,V[Ie]=W,O=Ie):(V[O]=Ee,V[fe]=W,O=fe);else if(Ieo(ke,W))V[O]=ke,V[Ie]=W,O=Ie;else break e}}return H}function o(V,H){var W=V.sortIndex-H.sortIndex;return W!==0?W:V.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var c=Date,f=c.now();t.unstable_now=function(){return c.now()-f}}var h=[],g=[],y=1,v=null,w=3,x=!1,j=!1,_=!1,S=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,E=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(V){for(var H=n(g);H!==null;){if(H.callback===null)i(g);else if(H.startTime<=V)i(g),H.sortIndex=H.expirationTime,e(h,H);else break;H=n(g)}}function M(V){if(_=!1,z(V),!j)if(n(h)!==null)j=!0,P(L);else{var H=n(g);H!==null&&K(M,H.startTime-V)}}function L(V,H){j=!1,_&&(_=!1,I(ue),ue=-1),x=!0;var W=w;try{for(z(H),v=n(h);v!==null&&(!(v.expirationTime>H)||V&&!Oe());){var O=v.callback;if(typeof O=="function"){v.callback=null,w=v.priorityLevel;var q=O(v.expirationTime<=H);H=t.unstable_now(),typeof q=="function"?v.callback=q:v===n(h)&&i(h),z(H)}else i(h);v=n(h)}if(v!==null)var ae=!0;else{var fe=n(g);fe!==null&&K(M,fe.startTime-H),ae=!1}return ae}finally{v=null,w=W,x=!1}}var Q=!1,le=null,ue=-1,pe=5,_e=-1;function Oe(){return!(t.unstable_now()-_eV||125O?(V.sortIndex=W,e(g,V),n(h)===null&&V===n(g)&&(_?(I(ue),ue=-1):_=!0,K(M,W-O))):(V.sortIndex=q,e(h,V),j||x||(j=!0,P(L))),V},t.unstable_shouldYield=Oe,t.unstable_wrapCallback=function(V){var H=w;return function(){var W=w;w=H;try{return V.apply(this,arguments)}finally{w=W}}}})(Pc)),Pc}var Wp;function Ix(){return Wp||(Wp=1,Nc.exports=Ax()),Nc.exports}var Qp;function Fx(){if(Qp)return pr;Qp=1;var t=qa(),e=Ix();function n(r){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+r,a=1;a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,g=/^[: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]*$/,y={},v={};function w(r){return h.call(v,r)?!0:h.call(y,r)?!1:g.test(r)?v[r]=!0:(y[r]=!0,!1)}function x(r,s,a,u){if(a!==null&&a.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return u?!1:a!==null?!a.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function j(r,s,a,u){if(s===null||typeof s>"u"||x(r,s,a,u))return!0;if(u)return!1;if(a!==null)switch(a.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function _(r,s,a,u,d,p,b){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=u,this.attributeNamespace=d,this.mustUseProperty=a,this.propertyName=r,this.type=s,this.sanitizeURL=p,this.removeEmptyString=b}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){S[r]=new _(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var s=r[0];S[s]=new _(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){S[r]=new _(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){S[r]=new _(r,2,!1,r,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(r){S[r]=new _(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){S[r]=new _(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){S[r]=new _(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){S[r]=new _(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){S[r]=new _(r,5,!1,r.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function E(r){return r[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(r){var s=r.replace(I,E);S[s]=new _(s,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var s=r.replace(I,E);S[s]=new _(s,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var s=r.replace(I,E);S[s]=new _(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){S[r]=new _(r,1,!1,r.toLowerCase(),null,!1,!1)}),S.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){S[r]=new _(r,1,!1,r.toLowerCase(),null,!0,!0)});function z(r,s,a,u){var d=S.hasOwnProperty(s)?S[s]:null;(d!==null?d.type!==0:u||!(2k||d[b]!==p[k]){var N=` `+d[b].replace(" at new "," at ");return r.displayName&&N.includes("")&&(N=N.replace("",r.displayName)),N}while(1<=b&&0<=k);break}}}finally{ae=!1,Error.prepareStackTrace=a}return(r=r?r.displayName||r.name:"")?q(r):""}function Ee(r){switch(r.tag){case 5:return q(r.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return r=fe(r.type,!1),r;case 11:return r=fe(r.type.render,!1),r;case 1:return r=fe(r.type,!0),r;default:return""}}function Ie(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case le:return"Fragment";case Q:return"Portal";case pe:return"Profiler";case ue:return"StrictMode";case me:return"Suspense";case he:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case Oe:return(r.displayName||"Context")+".Consumer";case _e:return(r._context.displayName||"Context")+".Provider";case Z:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case T:return s=r.displayName||null,s!==null?s:Ie(r.type)||"Memo";case P:s=r._payload,r=r._init;try{return Ie(r(s))}catch{}}return null}function ke(r){var s=r.type;switch(r.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=s.render,r=r.displayName||r.name||"",s.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ie(s);case 8:return s===ue?"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 s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function Ue(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Be(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function _t(r){var s=Be(r)?"checked":"value",a=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),u=""+r[s];if(!r.hasOwnProperty(s)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var d=a.get,p=a.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return d.call(this)},set:function(b){u=""+b,p.call(this,b)}}),Object.defineProperty(r,s,{enumerable:a.enumerable}),{getValue:function(){return u},setValue:function(b){u=""+b},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function ir(r){r._valueTracker||(r._valueTracker=_t(r))}function dn(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var a=s.getValue(),u="";return r&&(u=Be(r)?r.checked?"true":"false":r.value),r=u,r!==a?(s.setValue(r),!0):!1}function Ir(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function fn(r,s){var a=s.checked;return W({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??r._wrapperState.initialChecked})}function Hs(r,s){var a=s.defaultValue==null?"":s.defaultValue,u=s.checked!=null?s.checked:s.defaultChecked;a=Ue(s.value!=null?s.value:a),r._wrapperState={initialChecked:u,initialValue:a,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function Ln(r,s){s=s.checked,s!=null&&z(r,"checked",s,!1)}function ws(r,s){Ln(r,s);var a=Ue(s.value),u=s.type;if(a!=null)u==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+a):r.value!==""+a&&(r.value=""+a);else if(u==="submit"||u==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?An(r,s.type,a):s.hasOwnProperty("defaultValue")&&An(r,s.type,Ue(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function hn(r,s,a){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var u=s.type;if(!(u!=="submit"&&u!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+r._wrapperState.initialValue,a||s===r.value||(r.value=s),r.defaultValue=s}a=r.name,a!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,a!==""&&(r.name=a)}function An(r,s,a){(s!=="number"||Ir(r.ownerDocument)!==r)&&(a==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+a&&(r.defaultValue=""+a))}var Gr=Array.isArray;function ar(r,s,a,u){if(r=r.options,s){s={};for(var d=0;d"+s.valueOf().toString()+"",s=ie.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function oe(r,s){if(s){var a=r.firstChild;if(a&&a===r.lastChild&&a.nodeType===3){a.nodeValue=s;return}}r.textContent=s}var Ne={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},De=["Webkit","ms","Moz","O"];Object.keys(Ne).forEach(function(r){De.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),Ne[s]=Ne[r]})});function ht(r,s,a){return s==null||typeof s=="boolean"||s===""?"":a||typeof s!="number"||s===0||Ne.hasOwnProperty(r)&&Ne[r]?(""+s).trim():s+"px"}function kt(r,s){r=r.style;for(var a in s)if(s.hasOwnProperty(a)){var u=a.indexOf("--")===0,d=ht(a,s[a],u);a==="float"&&(a="cssFloat"),u?r.setProperty(a,d):r[a]=d}}var Pt=W({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 Cr(r,s){if(s){if(Pt[r]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(n(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(n(61))}if(s.style!=null&&typeof s.style!="object")throw Error(n(62))}}function pn(r,s){if(r.indexOf("-")===-1)return typeof s.is=="string";switch(r){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 mn=null;function In(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var gn=null,Jr=null,yr=null;function Fr(r){if(r=na(r)){if(typeof gn!="function")throw Error(n(280));var s=r.stateNode;s&&(s=wo(s),gn(r.stateNode,r.type,s))}}function Ga(r){Jr?yr?yr.push(r):yr=[r]:Jr=r}function Re(){if(Jr){var r=Jr,s=yr;if(yr=Jr=null,Fr(r),s)for(r=0;r>>=0,r===0?32:31-(Wv(r)/Qv|0)|0}var to=64,ro=4194304;function $i(r){switch(r&-r){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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function no(r,s){var a=r.pendingLanes;if(a===0)return 0;var u=0,d=r.suspendedLanes,p=r.pingedLanes,b=a&268435455;if(b!==0){var k=b&~d;k!==0?u=$i(k):(p&=b,p!==0&&(u=$i(p)))}else b=a&~d,b!==0?u=$i(b):p!==0&&(u=$i(p));if(u===0)return 0;if(s!==0&&s!==u&&(s&d)===0&&(d=u&-u,p=s&-s,d>=p||d===16&&(p&4194240)!==0))return s;if((u&4)!==0&&(u|=a&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=u;0a;a++)s.push(r);return s}function zi(r,s,a){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-Dr(s),r[s]=a}function Jv(r,s){var a=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s,s=r.entanglements;var u=r.eventTimes;for(r=r.expirationTimes;0=Ki),Af=" ",If=!1;function Ff(r,s){switch(r){case"keyup":return j0.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mf(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Qs=!1;function E0(r,s){switch(r){case"compositionend":return Mf(s);case"keypress":return s.which!==32?null:(If=!0,Af);case"textInput":return r=s.data,r===Af&&If?null:r;default:return null}}function N0(r,s){if(Qs)return r==="compositionend"||!iu&&Ff(r,s)?(r=Nf(),lo=Xl=zn=null,Qs=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:a,offset:s-r};r=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Hf(a)}}function Wf(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?Wf(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function Qf(){for(var r=window,s=Ir();s instanceof r.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)r=s.contentWindow;else break;s=Ir(r.document)}return s}function lu(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}function M0(r){var s=Qf(),a=r.focusedElem,u=r.selectionRange;if(s!==a&&a&&a.ownerDocument&&Wf(a.ownerDocument.documentElement,a)){if(u!==null&&lu(a)){if(s=u.start,r=u.end,r===void 0&&(r=s),"selectionStart"in a)a.selectionStart=s,a.selectionEnd=Math.min(r,a.value.length);else if(r=(s=a.ownerDocument||document)&&s.defaultView||window,r.getSelection){r=r.getSelection();var d=a.textContent.length,p=Math.min(u.start,d);u=u.end===void 0?p:Math.min(u.end,d),!r.extend&&p>u&&(d=u,u=p,p=d),d=qf(a,p);var b=qf(a,u);d&&b&&(r.rangeCount!==1||r.anchorNode!==d.node||r.anchorOffset!==d.offset||r.focusNode!==b.node||r.focusOffset!==b.offset)&&(s=s.createRange(),s.setStart(d.node,d.offset),r.removeAllRanges(),p>u?(r.addRange(s),r.extend(b.node,b.offset)):(s.setEnd(b.node,b.offset),r.addRange(s)))}}for(s=[],r=a;r=r.parentNode;)r.nodeType===1&&s.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a=document.documentMode,Ks=null,uu=null,Yi=null,cu=!1;function Kf(r,s,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;cu||Ks==null||Ks!==Ir(u)||(u=Ks,"selectionStart"in u&&lu(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Yi&&Ji(Yi,u)||(Yi=u,u=yo(uu,"onSelect"),0Xs||(r.current=Su[Xs],Su[Xs]=null,Xs--)}function nt(r,s){Xs++,Su[Xs]=r.current,r.current=s}var Hn={},Ut=Bn(Hn),ur=Bn(!1),ks=Hn;function ei(r,s){var a=r.type.contextTypes;if(!a)return Hn;var u=r.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===s)return u.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in a)d[p]=s[p];return u&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=d),d}function cr(r){return r=r.childContextTypes,r!=null}function bo(){it(ur),it(Ut)}function uh(r,s,a){if(Ut.current!==Hn)throw Error(n(168));nt(Ut,s),nt(ur,a)}function ch(r,s,a){var u=r.stateNode;if(s=s.childContextTypes,typeof u.getChildContext!="function")return a;u=u.getChildContext();for(var d in u)if(!(d in s))throw Error(n(108,ke(r)||"Unknown",d));return W({},a,u)}function So(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Hn,ks=Ut.current,nt(Ut,r),nt(ur,ur.current),!0}function dh(r,s,a){var u=r.stateNode;if(!u)throw Error(n(169));a?(r=ch(r,s,ks),u.__reactInternalMemoizedMergedChildContext=r,it(ur),it(Ut),nt(Ut,r)):it(ur),nt(ur,a)}var vn=null,_o=!1,_u=!1;function fh(r){vn===null?vn=[r]:vn.push(r)}function Z0(r){_o=!0,fh(r)}function qn(){if(!_u&&vn!==null){_u=!0;var r=0,s=Ge;try{var a=vn;for(Ge=1;r>=b,d-=b,xn=1<<32-Dr(s)+d|a<Pe?(It=Ce,Ce=null):It=Ce.sibling;var qe=G(F,Ce,$[Pe],te);if(qe===null){Ce===null&&(Ce=It);break}r&&Ce&&qe.alternate===null&&s(F,Ce),R=p(qe,R,Pe),je===null?be=qe:je.sibling=qe,je=qe,Ce=It}if(Pe===$.length)return a(F,Ce),lt&&Cs(F,Pe),be;if(Ce===null){for(;Pe<$.length;Pe++)Ce=Y(F,$[Pe],te),Ce!==null&&(R=p(Ce,R,Pe),je===null?be=Ce:je.sibling=Ce,je=Ce);return lt&&Cs(F,Pe),be}for(Ce=u(F,Ce);Pe<$.length;Pe++)It=de(Ce,F,Pe,$[Pe],te),It!==null&&(r&&It.alternate!==null&&Ce.delete(It.key===null?Pe:It.key),R=p(It,R,Pe),je===null?be=It:je.sibling=It,je=It);return r&&Ce.forEach(function(es){return s(F,es)}),lt&&Cs(F,Pe),be}function we(F,R,$,te){var be=H($);if(typeof be!="function")throw Error(n(150));if($=be.call($),$==null)throw Error(n(151));for(var je=be=null,Ce=R,Pe=R=0,It=null,qe=$.next();Ce!==null&&!qe.done;Pe++,qe=$.next()){Ce.index>Pe?(It=Ce,Ce=null):It=Ce.sibling;var es=G(F,Ce,qe.value,te);if(es===null){Ce===null&&(Ce=It);break}r&&Ce&&es.alternate===null&&s(F,Ce),R=p(es,R,Pe),je===null?be=es:je.sibling=es,je=es,Ce=It}if(qe.done)return a(F,Ce),lt&&Cs(F,Pe),be;if(Ce===null){for(;!qe.done;Pe++,qe=$.next())qe=Y(F,qe.value,te),qe!==null&&(R=p(qe,R,Pe),je===null?be=qe:je.sibling=qe,je=qe);return lt&&Cs(F,Pe),be}for(Ce=u(F,Ce);!qe.done;Pe++,qe=$.next())qe=de(Ce,F,Pe,qe.value,te),qe!==null&&(r&&qe.alternate!==null&&Ce.delete(qe.key===null?Pe:qe.key),R=p(qe,R,Pe),je===null?be=qe:je.sibling=qe,je=qe);return r&&Ce.forEach(function(Px){return s(F,Px)}),lt&&Cs(F,Pe),be}function bt(F,R,$,te){if(typeof $=="object"&&$!==null&&$.type===le&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case L:e:{for(var be=$.key,je=R;je!==null;){if(je.key===be){if(be=$.type,be===le){if(je.tag===7){a(F,je.sibling),R=d(je,$.props.children),R.return=F,F=R;break e}}else if(je.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===P&&vh(be)===je.type){a(F,je.sibling),R=d(je,$.props),R.ref=sa(F,je,$),R.return=F,F=R;break e}a(F,je);break}else s(F,je);je=je.sibling}$.type===le?(R=As($.props.children,F.mode,te,$.key),R.return=F,F=R):(te=Jo($.type,$.key,$.props,null,F.mode,te),te.ref=sa(F,R,$),te.return=F,F=te)}return b(F);case Q:e:{for(je=$.key;R!==null;){if(R.key===je)if(R.tag===4&&R.stateNode.containerInfo===$.containerInfo&&R.stateNode.implementation===$.implementation){a(F,R.sibling),R=d(R,$.children||[]),R.return=F,F=R;break e}else{a(F,R);break}else s(F,R);R=R.sibling}R=wc($,F.mode,te),R.return=F,F=R}return b(F);case P:return je=$._init,bt(F,R,je($._payload),te)}if(Gr($))return ve(F,R,$,te);if(H($))return we(F,R,$,te);Eo(F,$)}return typeof $=="string"&&$!==""||typeof $=="number"?($=""+$,R!==null&&R.tag===6?(a(F,R.sibling),R=d(R,$),R.return=F,F=R):(a(F,R),R=xc($,F.mode,te),R.return=F,F=R),b(F)):a(F,R)}return bt}var si=xh(!0),wh=xh(!1),No=Bn(null),Po=null,ii=null,Pu=null;function Ou(){Pu=ii=Po=null}function Ru(r){var s=No.current;it(No),r._currentValue=s}function Tu(r,s,a){for(;r!==null;){var u=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,u!==null&&(u.childLanes|=s)):u!==null&&(u.childLanes&s)!==s&&(u.childLanes|=s),r===a)break;r=r.return}}function ai(r,s){Po=r,Pu=ii=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(dr=!0),r.firstContext=null)}function Pr(r){var s=r._currentValue;if(Pu!==r)if(r={context:r,memoizedValue:s,next:null},ii===null){if(Po===null)throw Error(n(308));ii=r,Po.dependencies={lanes:0,firstContext:r}}else ii=ii.next=r;return s}var Es=null;function Lu(r){Es===null?Es=[r]:Es.push(r)}function bh(r,s,a,u){var d=s.interleaved;return d===null?(a.next=a,Lu(s)):(a.next=d.next,d.next=a),s.interleaved=a,bn(r,u)}function bn(r,s){r.lanes|=s;var a=r.alternate;for(a!==null&&(a.lanes|=s),a=r,r=r.return;r!==null;)r.childLanes|=s,a=r.alternate,a!==null&&(a.childLanes|=s),a=r,r=r.return;return a.tag===3?a.stateNode:null}var Wn=!1;function Au(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Sh(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Sn(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function Qn(r,s,a){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(He&2)!==0){var d=u.pending;return d===null?s.next=s:(s.next=d.next,d.next=s),u.pending=s,bn(r,a)}return d=u.interleaved,d===null?(s.next=s,Lu(u)):(s.next=d.next,d.next=s),u.interleaved=s,bn(r,a)}function Oo(r,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194240)!==0)){var u=s.lanes;u&=r.pendingLanes,a|=u,s.lanes=a,Kl(r,a)}}function _h(r,s){var a=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var d=null,p=null;if(a=a.firstBaseUpdate,a!==null){do{var b={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};p===null?d=p=b:p=p.next=b,a=a.next}while(a!==null);p===null?d=p=s:p=p.next=s}else d=p=s;a={baseState:u.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:u.shared,effects:u.effects},r.updateQueue=a;return}r=a.lastBaseUpdate,r===null?a.firstBaseUpdate=s:r.next=s,a.lastBaseUpdate=s}function Ro(r,s,a,u){var d=r.updateQueue;Wn=!1;var p=d.firstBaseUpdate,b=d.lastBaseUpdate,k=d.shared.pending;if(k!==null){d.shared.pending=null;var N=k,U=N.next;N.next=null,b===null?p=U:b.next=U,b=N;var J=r.alternate;J!==null&&(J=J.updateQueue,k=J.lastBaseUpdate,k!==b&&(k===null?J.firstBaseUpdate=U:k.next=U,J.lastBaseUpdate=N))}if(p!==null){var Y=d.baseState;b=0,J=U=N=null,k=p;do{var G=k.lane,de=k.eventTime;if((u&G)===G){J!==null&&(J=J.next={eventTime:de,lane:0,tag:k.tag,payload:k.payload,callback:k.callback,next:null});e:{var ve=r,we=k;switch(G=s,de=a,we.tag){case 1:if(ve=we.payload,typeof ve=="function"){Y=ve.call(de,Y,G);break e}Y=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=we.payload,G=typeof ve=="function"?ve.call(de,Y,G):ve,G==null)break e;Y=W({},Y,G);break e;case 2:Wn=!0}}k.callback!==null&&k.lane!==0&&(r.flags|=64,G=d.effects,G===null?d.effects=[k]:G.push(k))}else de={eventTime:de,lane:G,tag:k.tag,payload:k.payload,callback:k.callback,next:null},J===null?(U=J=de,N=Y):J=J.next=de,b|=G;if(k=k.next,k===null){if(k=d.shared.pending,k===null)break;G=k,k=G.next,G.next=null,d.lastBaseUpdate=G,d.shared.pending=null}}while(!0);if(J===null&&(N=Y),d.baseState=N,d.firstBaseUpdate=U,d.lastBaseUpdate=J,s=d.shared.interleaved,s!==null){d=s;do b|=d.lane,d=d.next;while(d!==s)}else p===null&&(d.shared.lanes=0);Os|=b,r.lanes=b,r.memoizedState=Y}}function kh(r,s,a){if(r=s.effects,s.effects=null,r!==null)for(s=0;sa?a:4,r(!0);var u=$u.transition;$u.transition={};try{r(!1),s()}finally{Ge=a,$u.transition=u}}function Bh(){return Or().memoizedState}function X0(r,s,a){var u=Jn(r);if(a={lane:u,action:a,hasEagerState:!1,eagerState:null,next:null},Hh(r))qh(s,a);else if(a=bh(r,s,a,u),a!==null){var d=er();Hr(a,r,u,d),Wh(a,s,u)}}function ex(r,s,a){var u=Jn(r),d={lane:u,action:a,hasEagerState:!1,eagerState:null,next:null};if(Hh(r))qh(s,d);else{var p=r.alternate;if(r.lanes===0&&(p===null||p.lanes===0)&&(p=s.lastRenderedReducer,p!==null))try{var b=s.lastRenderedState,k=p(b,a);if(d.hasEagerState=!0,d.eagerState=k,$r(k,b)){var N=s.interleaved;N===null?(d.next=d,Lu(s)):(d.next=N.next,N.next=d),s.interleaved=d;return}}catch{}a=bh(r,s,d,u),a!==null&&(d=er(),Hr(a,r,u,d),Wh(a,s,u))}}function Hh(r){var s=r.alternate;return r===ft||s!==null&&s===ft}function qh(r,s){la=Ao=!0;var a=r.pending;a===null?s.next=s:(s.next=a.next,a.next=s),r.pending=s}function Wh(r,s,a){if((a&4194240)!==0){var u=s.lanes;u&=r.pendingLanes,a|=u,s.lanes=a,Kl(r,a)}}var Mo={readContext:Pr,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useInsertionEffect:Vt,useLayoutEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useMutableSource:Vt,useSyncExternalStore:Vt,useId:Vt,unstable_isNewReconciler:!1},tx={readContext:Pr,useCallback:function(r,s){return rn().memoizedState=[r,s===void 0?null:s],r},useContext:Pr,useEffect:Ih,useImperativeHandle:function(r,s,a){return a=a!=null?a.concat([r]):null,Io(4194308,4,Dh.bind(null,s,r),a)},useLayoutEffect:function(r,s){return Io(4194308,4,r,s)},useInsertionEffect:function(r,s){return Io(4,2,r,s)},useMemo:function(r,s){var a=rn();return s=s===void 0?null:s,r=r(),a.memoizedState=[r,s],r},useReducer:function(r,s,a){var u=rn();return s=a!==void 0?a(s):s,u.memoizedState=u.baseState=s,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:s},u.queue=r,r=r.dispatch=X0.bind(null,ft,r),[u.memoizedState,r]},useRef:function(r){var s=rn();return r={current:r},s.memoizedState=r},useState:Lh,useDebugValue:Wu,useDeferredValue:function(r){return rn().memoizedState=r},useTransition:function(){var r=Lh(!1),s=r[0];return r=Y0.bind(null,r[1]),rn().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,a){var u=ft,d=rn();if(lt){if(a===void 0)throw Error(n(407));a=a()}else{if(a=s(),At===null)throw Error(n(349));(Ps&30)!==0||Nh(u,s,a)}d.memoizedState=a;var p={value:a,getSnapshot:s};return d.queue=p,Ih(Oh.bind(null,u,p,r),[r]),u.flags|=2048,da(9,Ph.bind(null,u,p,a,s),void 0,null),a},useId:function(){var r=rn(),s=At.identifierPrefix;if(lt){var a=wn,u=xn;a=(u&~(1<<32-Dr(u)-1)).toString(32)+a,s=":"+s+"R"+a,a=ua++,0<\/script>",r=r.removeChild(r.firstChild)):typeof u.is=="string"?r=b.createElement(a,{is:u.is}):(r=b.createElement(a),a==="select"&&(b=r,u.multiple?b.multiple=!0:u.size&&(b.size=u.size))):r=b.createElementNS(r,a),r[en]=s,r[ra]=u,fp(r,s,!1,!1),s.stateNode=r;e:{switch(b=pn(a,u),a){case"dialog":st("cancel",r),st("close",r),d=u;break;case"iframe":case"object":case"embed":st("load",r),d=u;break;case"video":case"audio":for(d=0;ddi&&(s.flags|=128,u=!0,fa(p,!1),s.lanes=4194304)}else{if(!u)if(r=To(b),r!==null){if(s.flags|=128,u=!0,a=r.updateQueue,a!==null&&(s.updateQueue=a,s.flags|=4),fa(p,!0),p.tail===null&&p.tailMode==="hidden"&&!b.alternate&&!lt)return Bt(s),null}else 2*wt()-p.renderingStartTime>di&&a!==1073741824&&(s.flags|=128,u=!0,fa(p,!1),s.lanes=4194304);p.isBackwards?(b.sibling=s.child,s.child=b):(a=p.last,a!==null?a.sibling=b:s.child=b,p.last=b)}return p.tail!==null?(s=p.tail,p.rendering=s,p.tail=s.sibling,p.renderingStartTime=wt(),s.sibling=null,a=dt.current,nt(dt,u?a&1|2:a&1),s):(Bt(s),null);case 22:case 23:return gc(),u=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==u&&(s.flags|=8192),u&&(s.mode&1)!==0?(br&1073741824)!==0&&(Bt(s),s.subtreeFlags&6&&(s.flags|=8192)):Bt(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function ux(r,s){switch(ju(s),s.tag){case 1:return cr(s.type)&&bo(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return oi(),it(ur),it(Ut),Du(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return Fu(s),null;case 13:if(it(dt),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));ni()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return it(dt),null;case 4:return oi(),null;case 10:return Ru(s.type._context),null;case 22:case 23:return gc(),null;case 24:return null;default:return null}}var Uo=!1,Ht=!1,cx=typeof WeakSet=="function"?WeakSet:Set,ge=null;function ui(r,s){var a=r.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(u){pt(r,s,u)}else a.current=null}function sc(r,s,a){try{a()}catch(u){pt(r,s,u)}}var mp=!1;function dx(r,s){if(gu=ao,r=Qf(),lu(r)){if("selectionStart"in r)var a={start:r.selectionStart,end:r.selectionEnd};else e:{a=(a=r.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var d=u.anchorOffset,p=u.focusNode;u=u.focusOffset;try{a.nodeType,p.nodeType}catch{a=null;break e}var b=0,k=-1,N=-1,U=0,J=0,Y=r,G=null;t:for(;;){for(var de;Y!==a||d!==0&&Y.nodeType!==3||(k=b+d),Y!==p||u!==0&&Y.nodeType!==3||(N=b+u),Y.nodeType===3&&(b+=Y.nodeValue.length),(de=Y.firstChild)!==null;)G=Y,Y=de;for(;;){if(Y===r)break t;if(G===a&&++U===d&&(k=b),G===p&&++J===u&&(N=b),(de=Y.nextSibling)!==null)break;Y=G,G=Y.parentNode}Y=de}a=k===-1||N===-1?null:{start:k,end:N}}else a=null}a=a||{start:0,end:0}}else a=null;for(yu={focusedElem:r,selectionRange:a},ao=!1,ge=s;ge!==null;)if(s=ge,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,ge=r;else for(;ge!==null;){s=ge;try{var ve=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(ve!==null){var we=ve.memoizedProps,bt=ve.memoizedState,F=s.stateNode,R=F.getSnapshotBeforeUpdate(s.elementType===s.type?we:Ur(s.type,we),bt);F.__reactInternalSnapshotBeforeUpdate=R}break;case 3:var $=s.stateNode.containerInfo;$.nodeType===1?$.textContent="":$.nodeType===9&&$.documentElement&&$.removeChild($.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(te){pt(s,s.return,te)}if(r=s.sibling,r!==null){r.return=s.return,ge=r;break}ge=s.return}return ve=mp,mp=!1,ve}function ha(r,s,a){var u=s.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var d=u=u.next;do{if((d.tag&r)===r){var p=d.destroy;d.destroy=void 0,p!==void 0&&sc(s,a,p)}d=d.next}while(d!==u)}}function Vo(r,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var a=s=s.next;do{if((a.tag&r)===r){var u=a.create;a.destroy=u()}a=a.next}while(a!==s)}}function ic(r){var s=r.ref;if(s!==null){var a=r.stateNode;r.tag,r=a,typeof s=="function"?s(r):s.current=r}}function gp(r){var s=r.alternate;s!==null&&(r.alternate=null,gp(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[en],delete s[ra],delete s[bu],delete s[Q0],delete s[K0])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function yp(r){return r.tag===5||r.tag===3||r.tag===4}function vp(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||yp(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function ac(r,s,a){var u=r.tag;if(u===5||u===6)r=r.stateNode,s?a.nodeType===8?a.parentNode.insertBefore(r,s):a.insertBefore(r,s):(a.nodeType===8?(s=a.parentNode,s.insertBefore(r,a)):(s=a,s.appendChild(r)),a=a._reactRootContainer,a!=null||s.onclick!==null||(s.onclick=xo));else if(u!==4&&(r=r.child,r!==null))for(ac(r,s,a),r=r.sibling;r!==null;)ac(r,s,a),r=r.sibling}function oc(r,s,a){var u=r.tag;if(u===5||u===6)r=r.stateNode,s?a.insertBefore(r,s):a.appendChild(r);else if(u!==4&&(r=r.child,r!==null))for(oc(r,s,a),r=r.sibling;r!==null;)oc(r,s,a),r=r.sibling}var Mt=null,Vr=!1;function Kn(r,s,a){for(a=a.child;a!==null;)xp(r,s,a),a=a.sibling}function xp(r,s,a){if(Xr&&typeof Xr.onCommitFiberUnmount=="function")try{Xr.onCommitFiberUnmount(eo,a)}catch{}switch(a.tag){case 5:Ht||ui(a,s);case 6:var u=Mt,d=Vr;Mt=null,Kn(r,s,a),Mt=u,Vr=d,Mt!==null&&(Vr?(r=Mt,a=a.stateNode,r.nodeType===8?r.parentNode.removeChild(a):r.removeChild(a)):Mt.removeChild(a.stateNode));break;case 18:Mt!==null&&(Vr?(r=Mt,a=a.stateNode,r.nodeType===8?wu(r.parentNode,a):r.nodeType===1&&wu(r,a),qi(r)):wu(Mt,a.stateNode));break;case 4:u=Mt,d=Vr,Mt=a.stateNode.containerInfo,Vr=!0,Kn(r,s,a),Mt=u,Vr=d;break;case 0:case 11:case 14:case 15:if(!Ht&&(u=a.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){d=u=u.next;do{var p=d,b=p.destroy;p=p.tag,b!==void 0&&((p&2)!==0||(p&4)!==0)&&sc(a,s,b),d=d.next}while(d!==u)}Kn(r,s,a);break;case 1:if(!Ht&&(ui(a,s),u=a.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=a.memoizedProps,u.state=a.memoizedState,u.componentWillUnmount()}catch(k){pt(a,s,k)}Kn(r,s,a);break;case 21:Kn(r,s,a);break;case 22:a.mode&1?(Ht=(u=Ht)||a.memoizedState!==null,Kn(r,s,a),Ht=u):Kn(r,s,a);break;default:Kn(r,s,a)}}function wp(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var a=r.stateNode;a===null&&(a=r.stateNode=new cx),s.forEach(function(u){var d=wx.bind(null,r,u);a.has(u)||(a.add(u),u.then(d,d))})}}function Br(r,s){var a=s.deletions;if(a!==null)for(var u=0;ud&&(d=b),u&=~p}if(u=d,u=wt()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*hx(u/1960))-u,10r?16:r,Gn===null)var u=!1;else{if(r=Gn,Gn=null,Qo=0,(He&6)!==0)throw Error(n(331));var d=He;for(He|=4,ge=r.current;ge!==null;){var p=ge,b=p.child;if((ge.flags&16)!==0){var k=p.deletions;if(k!==null){for(var N=0;Nwt()-cc?Ts(r,0):uc|=a),hr(r,s)}function Lp(r,s){s===0&&((r.mode&1)===0?s=1:(s=ro,ro<<=1,(ro&130023424)===0&&(ro=4194304)));var a=er();r=bn(r,s),r!==null&&(zi(r,s,a),hr(r,a))}function xx(r){var s=r.memoizedState,a=0;s!==null&&(a=s.retryLane),Lp(r,a)}function wx(r,s){var a=0;switch(r.tag){case 13:var u=r.stateNode,d=r.memoizedState;d!==null&&(a=d.retryLane);break;case 19:u=r.stateNode;break;default:throw Error(n(314))}u!==null&&u.delete(s),Lp(r,a)}var Ap;Ap=function(r,s,a){if(r!==null)if(r.memoizedProps!==s.pendingProps||ur.current)dr=!0;else{if((r.lanes&a)===0&&(s.flags&128)===0)return dr=!1,ox(r,s,a);dr=(r.flags&131072)!==0}else dr=!1,lt&&(s.flags&1048576)!==0&&hh(s,jo,s.index);switch(s.lanes=0,s.tag){case 2:var u=s.type;zo(r,s),r=s.pendingProps;var d=ei(s,Ut.current);ai(s,a),d=Uu(null,s,u,r,d,a);var p=Vu();return s.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,cr(u)?(p=!0,So(s)):p=!1,s.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,Au(s),d.updater=Do,s.stateNode=d,d._reactInternals=s,Ku(s,u,r,a),s=Yu(null,s,u,!0,p,a)):(s.tag=0,lt&&p&&ku(s),Xt(null,s,d,a),s=s.child),s;case 16:u=s.elementType;e:{switch(zo(r,s),r=s.pendingProps,d=u._init,u=d(u._payload),s.type=u,d=s.tag=Sx(u),r=Ur(u,r),d){case 0:s=Ju(null,s,u,r,a);break e;case 1:s=ap(null,s,u,r,a);break e;case 11:s=tp(null,s,u,r,a);break e;case 14:s=rp(null,s,u,Ur(u.type,r),a);break e}throw Error(n(306,u,""))}return s;case 0:return u=s.type,d=s.pendingProps,d=s.elementType===u?d:Ur(u,d),Ju(r,s,u,d,a);case 1:return u=s.type,d=s.pendingProps,d=s.elementType===u?d:Ur(u,d),ap(r,s,u,d,a);case 3:e:{if(op(s),r===null)throw Error(n(387));u=s.pendingProps,p=s.memoizedState,d=p.element,Sh(r,s),Ro(s,u,null,a);var b=s.memoizedState;if(u=b.element,p.isDehydrated)if(p={element:u,isDehydrated:!1,cache:b.cache,pendingSuspenseBoundaries:b.pendingSuspenseBoundaries,transitions:b.transitions},s.updateQueue.baseState=p,s.memoizedState=p,s.flags&256){d=li(Error(n(423)),s),s=lp(r,s,u,a,d);break e}else if(u!==d){d=li(Error(n(424)),s),s=lp(r,s,u,a,d);break e}else for(wr=Vn(s.stateNode.containerInfo.firstChild),xr=s,lt=!0,zr=null,a=wh(s,null,u,a),s.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ni(),u===d){s=_n(r,s,a);break e}Xt(r,s,u,a)}s=s.child}return s;case 5:return jh(s),r===null&&Eu(s),u=s.type,d=s.pendingProps,p=r!==null?r.memoizedProps:null,b=d.children,vu(u,d)?b=null:p!==null&&vu(u,p)&&(s.flags|=32),ip(r,s),Xt(r,s,b,a),s.child;case 6:return r===null&&Eu(s),null;case 13:return up(r,s,a);case 4:return Iu(s,s.stateNode.containerInfo),u=s.pendingProps,r===null?s.child=si(s,null,u,a):Xt(r,s,u,a),s.child;case 11:return u=s.type,d=s.pendingProps,d=s.elementType===u?d:Ur(u,d),tp(r,s,u,d,a);case 7:return Xt(r,s,s.pendingProps,a),s.child;case 8:return Xt(r,s,s.pendingProps.children,a),s.child;case 12:return Xt(r,s,s.pendingProps.children,a),s.child;case 10:e:{if(u=s.type._context,d=s.pendingProps,p=s.memoizedProps,b=d.value,nt(No,u._currentValue),u._currentValue=b,p!==null)if($r(p.value,b)){if(p.children===d.children&&!ur.current){s=_n(r,s,a);break e}}else for(p=s.child,p!==null&&(p.return=s);p!==null;){var k=p.dependencies;if(k!==null){b=p.child;for(var N=k.firstContext;N!==null;){if(N.context===u){if(p.tag===1){N=Sn(-1,a&-a),N.tag=2;var U=p.updateQueue;if(U!==null){U=U.shared;var J=U.pending;J===null?N.next=N:(N.next=J.next,J.next=N),U.pending=N}}p.lanes|=a,N=p.alternate,N!==null&&(N.lanes|=a),Tu(p.return,a,s),k.lanes|=a;break}N=N.next}}else if(p.tag===10)b=p.type===s.type?null:p.child;else if(p.tag===18){if(b=p.return,b===null)throw Error(n(341));b.lanes|=a,k=b.alternate,k!==null&&(k.lanes|=a),Tu(b,a,s),b=p.sibling}else b=p.child;if(b!==null)b.return=p;else for(b=p;b!==null;){if(b===s){b=null;break}if(p=b.sibling,p!==null){p.return=b.return,b=p;break}b=b.return}p=b}Xt(r,s,d.children,a),s=s.child}return s;case 9:return d=s.type,u=s.pendingProps.children,ai(s,a),d=Pr(d),u=u(d),s.flags|=1,Xt(r,s,u,a),s.child;case 14:return u=s.type,d=Ur(u,s.pendingProps),d=Ur(u.type,d),rp(r,s,u,d,a);case 15:return np(r,s,s.type,s.pendingProps,a);case 17:return u=s.type,d=s.pendingProps,d=s.elementType===u?d:Ur(u,d),zo(r,s),s.tag=1,cr(u)?(r=!0,So(s)):r=!1,ai(s,a),Kh(s,u,d),Ku(s,u,d,a),Yu(null,s,u,!0,r,a);case 19:return dp(r,s,a);case 22:return sp(r,s,a)}throw Error(n(156,s.tag))};function Ip(r,s){return pf(r,s)}function bx(r,s,a,u){this.tag=r,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tr(r,s,a,u){return new bx(r,s,a,u)}function vc(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Sx(r){if(typeof r=="function")return vc(r)?1:0;if(r!=null){if(r=r.$$typeof,r===Z)return 11;if(r===T)return 14}return 2}function Xn(r,s){var a=r.alternate;return a===null?(a=Tr(r.tag,s,r.key,r.mode),a.elementType=r.elementType,a.type=r.type,a.stateNode=r.stateNode,a.alternate=r,r.alternate=a):(a.pendingProps=s,a.type=r.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=r.flags&14680064,a.childLanes=r.childLanes,a.lanes=r.lanes,a.child=r.child,a.memoizedProps=r.memoizedProps,a.memoizedState=r.memoizedState,a.updateQueue=r.updateQueue,s=r.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},a.sibling=r.sibling,a.index=r.index,a.ref=r.ref,a}function Jo(r,s,a,u,d,p){var b=2;if(u=r,typeof r=="function")vc(r)&&(b=1);else if(typeof r=="string")b=5;else e:switch(r){case le:return As(a.children,d,p,s);case ue:b=8,d|=8;break;case pe:return r=Tr(12,a,s,d|2),r.elementType=pe,r.lanes=p,r;case me:return r=Tr(13,a,s,d),r.elementType=me,r.lanes=p,r;case he:return r=Tr(19,a,s,d),r.elementType=he,r.lanes=p,r;case K:return Yo(a,d,p,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case _e:b=10;break e;case Oe:b=9;break e;case Z:b=11;break e;case T:b=14;break e;case P:b=16,u=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=Tr(b,a,s,d),s.elementType=r,s.type=u,s.lanes=p,s}function As(r,s,a,u){return r=Tr(7,r,u,s),r.lanes=a,r}function Yo(r,s,a,u){return r=Tr(22,r,u,s),r.elementType=K,r.lanes=a,r.stateNode={isHidden:!1},r}function xc(r,s,a){return r=Tr(6,r,null,s),r.lanes=a,r}function wc(r,s,a){return s=Tr(4,r.children!==null?r.children:[],r.key,s),s.lanes=a,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function _x(r,s,a,u,d){this.tag=s,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ql(0),this.expirationTimes=Ql(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ql(0),this.identifierPrefix=u,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function bc(r,s,a,u,d,p,b,k,N){return r=new _x(r,s,a,k,N),s===1?(s=1,p===!0&&(s|=8)):s=0,p=Tr(3,null,null,s),r.current=p,p.stateNode=r,p.memoizedState={element:u,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Au(p),r}function kx(r,s,a){var u=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Ec.exports=Fx(),Ec.exports}var Zp;function Mx(){if(Zp)return il;Zp=1;var t=Kg();return il.createRoot=t.createRoot,il.hydrateRoot=t.hydrateRoot,il}var Dx=Mx();const $x=Il(Dx);var Oc={exports:{}},Rc={};var Gp;function zx(){if(Gp)return Rc;Gp=1;var t=qa();function e(v,w){return v===w&&(v!==0||1/v===1/w)||v!==v&&w!==w}var n=typeof Object.is=="function"?Object.is:e,i=t.useState,o=t.useEffect,l=t.useLayoutEffect,c=t.useDebugValue;function f(v,w){var x=w(),j=i({inst:{value:x,getSnapshot:w}}),_=j[0].inst,S=j[1];return l(function(){_.value=x,_.getSnapshot=w,h(_)&&S({inst:_})},[v,x,w]),o(function(){return h(_)&&S({inst:_}),v(function(){h(_)&&S({inst:_})})},[v]),c(x),x}function h(v){var w=v.getSnapshot;v=v.value;try{var x=w();return!n(v,x)}catch{return!0}}function g(v,w){return w()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:f;return Rc.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:y,Rc}var Jp;function Zg(){return Jp||(Jp=1,Oc.exports=zx()),Oc.exports}Zg();var Tc={exports:{}},Lc={};var Yp;function Ux(){if(Yp)return Lc;Yp=1;var t=qa(),e=Zg();function n(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var i=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,l=t.useRef,c=t.useEffect,f=t.useMemo,h=t.useDebugValue;return Lc.useSyncExternalStoreWithSelector=function(g,y,v,w,x){var j=l(null);if(j.current===null){var _={hasValue:!1,value:null};j.current=_}else _=j.current;j=f(function(){function I(Q){if(!E){if(E=!0,z=Q,Q=w(Q),x!==void 0&&_.hasValue){var le=_.value;if(x(le,Q))return M=le}return M=Q}if(le=M,i(z,Q))return le;var ue=w(Q);return x!==void 0&&x(le,ue)?(z=Q,le):(z=Q,M=ue)}var E=!1,z,M,L=v===void 0?null:v;return[function(){return I(y())},L===null?void 0:function(){return I(L())}]},[y,v,w,x]);var S=o(g,j[0],j[1]);return c(function(){_.hasValue=!0,_.value=S},[S]),h(S),S},Lc}var Xp;function Vx(){return Xp||(Xp=1,Tc.exports=Ux()),Tc.exports}var Bx=Vx(),Gg=Kg();const Hx=Il(Gg);function qx(t){t()}let Jg=qx;const Wx=t=>Jg=t,Qx=()=>Jg,em=Symbol.for("react-redux-context"),tm=typeof globalThis<"u"?globalThis:{};function Kx(){var t;if(!B.createContext)return{};const e=(t=tm[em])!=null?t:tm[em]=new Map;let n=e.get(B.createContext);return n||(n=B.createContext(null),e.set(B.createContext,n)),n}const fs=Kx();function Md(t=fs){return function(){return B.useContext(t)}}const Yg=Md(),Zx=()=>{throw new Error("uSES not initialized!")};let Xg=Zx;const Gx=t=>{Xg=t},Jx=(t,e)=>t===e;function Yx(t=fs){const e=t===fs?Yg:Md(t);return function(i,o={}){const{equalityFn:l=Jx,stabilityCheck:c=void 0,noopCheck:f=void 0}=typeof o=="function"?{equalityFn:o}:o,{store:h,subscription:g,getServerState:y,stabilityCheck:v,noopCheck:w}=e();B.useRef(!0);const x=B.useCallback({[i.name](_){return i(_)}}[i.name],[i,v,c]),j=Xg(g.addNestedSub,h.getState,y||h.getState,x,l);return B.useDebugValue(j),j}}const Xx=Yx();var Ac={exports:{}},Ke={};var rm;function e1(){if(rm)return Ke;rm=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,i=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,l=t?Symbol.for("react.profiler"):60114,c=t?Symbol.for("react.provider"):60109,f=t?Symbol.for("react.context"):60110,h=t?Symbol.for("react.async_mode"):60111,g=t?Symbol.for("react.concurrent_mode"):60111,y=t?Symbol.for("react.forward_ref"):60112,v=t?Symbol.for("react.suspense"):60113,w=t?Symbol.for("react.suspense_list"):60120,x=t?Symbol.for("react.memo"):60115,j=t?Symbol.for("react.lazy"):60116,_=t?Symbol.for("react.block"):60121,S=t?Symbol.for("react.fundamental"):60117,I=t?Symbol.for("react.responder"):60118,E=t?Symbol.for("react.scope"):60119;function z(L){if(typeof L=="object"&&L!==null){var Q=L.$$typeof;switch(Q){case e:switch(L=L.type,L){case h:case g:case i:case l:case o:case v:return L;default:switch(L=L&&L.$$typeof,L){case f:case y:case j:case x:case c:return L;default:return Q}}case n:return Q}}}function M(L){return z(L)===g}return Ke.AsyncMode=h,Ke.ConcurrentMode=g,Ke.ContextConsumer=f,Ke.ContextProvider=c,Ke.Element=e,Ke.ForwardRef=y,Ke.Fragment=i,Ke.Lazy=j,Ke.Memo=x,Ke.Portal=n,Ke.Profiler=l,Ke.StrictMode=o,Ke.Suspense=v,Ke.isAsyncMode=function(L){return M(L)||z(L)===h},Ke.isConcurrentMode=M,Ke.isContextConsumer=function(L){return z(L)===f},Ke.isContextProvider=function(L){return z(L)===c},Ke.isElement=function(L){return typeof L=="object"&&L!==null&&L.$$typeof===e},Ke.isForwardRef=function(L){return z(L)===y},Ke.isFragment=function(L){return z(L)===i},Ke.isLazy=function(L){return z(L)===j},Ke.isMemo=function(L){return z(L)===x},Ke.isPortal=function(L){return z(L)===n},Ke.isProfiler=function(L){return z(L)===l},Ke.isStrictMode=function(L){return z(L)===o},Ke.isSuspense=function(L){return z(L)===v},Ke.isValidElementType=function(L){return typeof L=="string"||typeof L=="function"||L===i||L===g||L===l||L===o||L===v||L===w||typeof L=="object"&&L!==null&&(L.$$typeof===j||L.$$typeof===x||L.$$typeof===c||L.$$typeof===f||L.$$typeof===y||L.$$typeof===S||L.$$typeof===I||L.$$typeof===E||L.$$typeof===_)},Ke.typeOf=z,Ke}var nm;function t1(){return nm||(nm=1,Ac.exports=e1()),Ac.exports}var Ic,sm;function r1(){if(sm)return Ic;sm=1;var t=t1(),e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};l[t.ForwardRef]=i,l[t.Memo]=o;function c(j){return t.isMemo(j)?o:l[j.$$typeof]||e}var f=Object.defineProperty,h=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols,y=Object.getOwnPropertyDescriptor,v=Object.getPrototypeOf,w=Object.prototype;function x(j,_,S){if(typeof _!="string"){if(w){var I=v(_);I&&I!==w&&x(j,I,S)}var E=h(_);g&&(E=E.concat(g(_)));for(var z=c(j),M=c(_),L=0;L{let i=e;for(;i;)i.callback(),i=i.next})},get(){let i=[],o=e;for(;o;)i.push(o),o=o.next;return i},subscribe(i){let o=!0,l=n={callback:i,next:null,prev:n};return l.prev?l.prev.next=l:e=l,function(){!o||e===null||(o=!1,l.next?l.next.prev=l.prev:n=l.prev,l.prev?l.prev.next=l.next:e=l.next)}}}}const om={notify(){},get:()=>[]};function a1(t,e){let n,i=om,o=0,l=!1;function c(_){y();const S=i.subscribe(_);let I=!1;return()=>{I||(I=!0,S(),v())}}function f(){i.notify()}function h(){j.onStateChange&&j.onStateChange()}function g(){return l}function y(){o++,n||(n=t.subscribe(h),i=i1())}function v(){o--,n&&o===0&&(n(),n=void 0,i.clear(),i=om)}function w(){l||(l=!0,y())}function x(){l&&(l=!1,v())}const j={addNestedSub:c,notifyNestedSubs:f,handleChangeWrapper:h,isSubscribed:g,trySubscribe:w,tryUnsubscribe:x,getListeners:()=>i};return j}const o1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",l1=o1?B.useLayoutEffect:B.useEffect;function u1({store:t,context:e,children:n,serverState:i,stabilityCheck:o="once",noopCheck:l="once"}){const c=B.useMemo(()=>{const g=a1(t);return{store:t,subscription:g,getServerState:i?()=>i:void 0,stabilityCheck:o,noopCheck:l}},[t,i,o,l]),f=B.useMemo(()=>t.getState(),[t]);l1(()=>{const{subscription:g}=c;return g.onStateChange=g.notifyNestedSubs,g.trySubscribe(),f!==t.getState()&&g.notifyNestedSubs(),()=>{g.tryUnsubscribe(),g.onStateChange=void 0}},[c,f]);const h=e||fs;return B.createElement(h.Provider,{value:c},n)}function ey(t=fs){const e=t===fs?Yg:Md(t);return function(){const{store:i}=e();return i}}const c1=ey();function d1(t=fs){const e=t===fs?c1:ey(t);return function(){return e().dispatch}}const f1=d1();Gx(Bx.useSyncExternalStoreWithSelector);Wx(Gg.unstable_batchedUpdates);function Ta(){return Ta=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function Dd(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function p1(){return Math.random().toString(36).substr(2,8)}function um(t,e){return{usr:t.state,key:t.key,idx:e}}function td(t,e,n,i){return n===void 0&&(n=null),Ta({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Ti(e):e,{state:n,key:e&&e.key||i||p1()})}function hl(t){let{pathname:e="/",search:n="",hash:i=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function Ti(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let i=t.indexOf("?");i>=0&&(e.search=t.substr(i),t=t.substr(0,i)),t&&(e.pathname=t)}return e}function m1(t,e,n,i){i===void 0&&(i={});let{window:o=document.defaultView,v5Compat:l=!1}=i,c=o.history,f=is.Pop,h=null,g=y();g==null&&(g=0,c.replaceState(Ta({},c.state,{idx:g}),""));function y(){return(c.state||{idx:null}).idx}function v(){f=is.Pop;let S=y(),I=S==null?null:S-g;g=S,h&&h({action:f,location:_.location,delta:I})}function w(S,I){f=is.Push;let E=td(_.location,S,I);g=y()+1;let z=um(E,g),M=_.createHref(E);try{c.pushState(z,"",M)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;o.location.assign(M)}l&&h&&h({action:f,location:_.location,delta:1})}function x(S,I){f=is.Replace;let E=td(_.location,S,I);g=y();let z=um(E,g),M=_.createHref(E);c.replaceState(z,"",M),l&&h&&h({action:f,location:_.location,delta:0})}function j(S){let I=o.location.origin!=="null"?o.location.origin:o.location.href,E=typeof S=="string"?S:hl(S);return E=E.replace(/ $/,"%20"),vt(I,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,I)}let _={get action(){return f},get location(){return t(o,c)},listen(S){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(lm,v),h=S,()=>{o.removeEventListener(lm,v),h=null}},createHref(S){return e(o,S)},createURL:j,encodeLocation(S){let I=j(S);return{pathname:I.pathname,search:I.search,hash:I.hash}},push:w,replace:x,go(S){return c.go(S)}};return _}var cm;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(cm||(cm={}));function g1(t,e,n){return n===void 0&&(n="/"),y1(t,e,n)}function y1(t,e,n,i){let o=typeof e=="string"?Ti(e):e,l=Si(o.pathname||"/",n);if(l==null)return null;let c=ty(t);v1(c);let f=null;for(let h=0;f==null&&h{let h={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};h.relativePath.startsWith("/")&&(vt(h.relativePath.startsWith(i),'Absolute route path "'+h.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),h.relativePath=h.relativePath.slice(i.length));let g=as([i,h.relativePath]),y=n.concat(h);l.children&&l.children.length>0&&(vt(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),ty(l.children,e,y,g)),!(l.path==null&&!l.index)&&e.push({path:g,score:j1(g,l.index),routesMeta:y})};return t.forEach((l,c)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))o(l,c);else for(let h of ry(l.path))o(l,c,h)}),e}function ry(t){let e=t.split("/");if(e.length===0)return[];let[n,...i]=e,o=n.endsWith("?"),l=n.replace(/\?$/,"");if(i.length===0)return o?[l,""]:[l];let c=ry(i.join("/")),f=[];return f.push(...c.map(h=>h===""?l:[l,h].join("/"))),o&&f.push(...c),f.map(h=>t.startsWith("/")&&h===""?"/":h)}function v1(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:C1(e.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}const x1=/^:[\w-]+$/,w1=3,b1=2,S1=1,_1=10,k1=-2,dm=t=>t==="*";function j1(t,e){let n=t.split("/"),i=n.length;return n.some(dm)&&(i+=k1),e&&(i+=b1),n.filter(o=>!dm(o)).reduce((o,l)=>o+(x1.test(l)?w1:l===""?S1:_1),i)}function C1(t,e){return t.length===e.length&&t.slice(0,-1).every((i,o)=>i===e[o])?t[t.length-1]-e[e.length-1]:0}function E1(t,e,n){let{routesMeta:i}=t,o={},l="/",c=[];for(let f=0;f{let{paramName:w,isOptional:x}=y;if(w==="*"){let _=f[v]||"";c=l.slice(0,l.length-_.length).replace(/(.)\/+$/,"$1")}const j=f[v];return x&&!j?g[w]=void 0:g[w]=(j||"").replace(/%2F/g,"/"),g},{}),pathname:l,pathnameBase:c,pattern:t}}function N1(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),Dd(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let i=[],o="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,h)=>(i.push({paramName:f,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(i.push({paramName:"*"}),o+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":t!==""&&t!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,e?void 0:"i"),i]}function P1(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Dd(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Si(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,i=t.charAt(n);return i&&i!=="/"?null:t.slice(n)||"/"}const O1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,R1=t=>O1.test(t);function T1(t,e){e===void 0&&(e="/");let{pathname:n,search:i="",hash:o=""}=typeof t=="string"?Ti(t):t,l;if(n)if(R1(n))l=n;else{if(n.includes("//")){let c=n;n=n.replace(/\/\/+/g,"/"),Dd(!1,"Pathnames cannot have embedded double slashes - normalizing "+(c+" -> "+n))}n.startsWith("/")?l=fm(n.substring(1),"/"):l=fm(n,e)}else l=e;return{pathname:l,search:I1(i),hash:F1(o)}}function fm(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Mc(t,e,n,i){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. 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 L1(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function ny(t,e){let n=L1(t);return e?n.map((i,o)=>o===n.length-1?i.pathname:i.pathnameBase):n.map(i=>i.pathnameBase)}function sy(t,e,n,i){i===void 0&&(i=!1);let o;typeof t=="string"?o=Ti(t):(o=Ta({},t),vt(!o.pathname||!o.pathname.includes("?"),Mc("?","pathname","search",o)),vt(!o.pathname||!o.pathname.includes("#"),Mc("#","pathname","hash",o)),vt(!o.search||!o.search.includes("#"),Mc("#","search","hash",o)));let l=t===""||o.pathname==="",c=l?"/":o.pathname,f;if(c==null)f=n;else{let v=e.length-1;if(!i&&c.startsWith("..")){let w=c.split("/");for(;w[0]==="..";)w.shift(),v-=1;o.pathname=w.join("/")}f=v>=0?e[v]:"/"}let h=T1(o,f),g=c&&c!=="/"&&c.endsWith("/"),y=(l||c===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(g||y)&&(h.pathname+="/"),h}const as=t=>t.join("/").replace(/\/\/+/g,"/"),A1=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),I1=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,F1=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function M1(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const iy=["post","put","patch","delete"];new Set(iy);const D1=["get",...iy];new Set(D1);function Aa(){return Aa=Object.assign?Object.assign.bind():function(t){for(var e=1;e{f.current=!0}),B.useCallback(function(g,y){if(y===void 0&&(y={}),!f.current)return;if(typeof g=="number"){i.go(g);return}let v=sy(g,JSON.parse(c),l,y.relative==="path");t==null&&e!=="/"&&(v.pathname=v.pathname==="/"?e:as([e,v.pathname])),(y.replace?i.replace:i.push)(v,y.state,y)},[e,i,c,l,t])}const U1=B.createContext(null);function V1(t){let e=B.useContext(Rn).outlet;return e&&B.createElement(U1.Provider,{value:t},e)}function Qa(){let{matches:t}=B.useContext(Rn),e=t[t.length-1];return e?e.params:{}}function Dl(t,e){let{relative:n}=e===void 0?{}:e,{future:i}=B.useContext(ys),{matches:o}=B.useContext(Rn),{pathname:l}=Li(),c=JSON.stringify(ny(o,i.v7_relativeSplatPath));return B.useMemo(()=>sy(t,JSON.parse(c),l,n==="path"),[t,c,l,n])}function B1(t,e){return H1(t,e)}function H1(t,e,n,i){Wa()||vt(!1);let{navigator:o}=B.useContext(ys),{matches:l}=B.useContext(Rn),c=l[l.length-1],f=c?c.params:{};c&&c.pathname;let h=c?c.pathnameBase:"/";c&&c.route;let g=Li(),y;if(e){var v;let S=typeof e=="string"?Ti(e):e;h==="/"||(v=S.pathname)!=null&&v.startsWith(h)||vt(!1),y=S}else y=g;let w=y.pathname||"/",x=w;if(h!=="/"){let S=h.replace(/^\//,"").split("/");x="/"+w.replace(/^\//,"").split("/").slice(S.length).join("/")}let j=g1(t,{pathname:x}),_=Z1(j&&j.map(S=>Object.assign({},S,{params:Object.assign({},f,S.params),pathname:as([h,o.encodeLocation?o.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?h:as([h,o.encodeLocation?o.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),l,n,i);return e&&_?B.createElement(Ml.Provider,{value:{location:Aa({pathname:"/",search:"",hash:"",state:null,key:"default"},y),navigationType:is.Pop}},_):_}function q1(){let t=X1(),e=M1(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return B.createElement(B.Fragment,null,B.createElement("h2",null,"Unexpected Application Error!"),B.createElement("h3",{style:{fontStyle:"italic"}},e),n?B.createElement("pre",{style:o},n):null,null)}const W1=B.createElement(q1,null);class Q1 extends B.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?B.createElement(Rn.Provider,{value:this.props.routeContext},B.createElement(oy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function K1(t){let{routeContext:e,match:n,children:i}=t,o=B.useContext(Fl);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),B.createElement(Rn.Provider,{value:e},i)}function Z1(t,e,n,i){var o;if(e===void 0&&(e=[]),n===void 0&&(n=null),i===void 0&&(i=null),t==null){var l;if(!n)return null;if(n.errors)t=n.matches;else if((l=i)!=null&&l.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let c=t,f=(o=n)==null?void 0:o.errors;if(f!=null){let y=c.findIndex(v=>v.route.id&&f?.[v.route.id]!==void 0);y>=0||vt(!1),c=c.slice(0,Math.min(c.length,y+1))}let h=!1,g=-1;if(n&&i&&i.v7_partialHydration)for(let y=0;y=0?c=c.slice(0,g+1):c=[c[0]];break}}}return c.reduceRight((y,v,w)=>{let x,j=!1,_=null,S=null;n&&(x=f&&v.route.id?f[v.route.id]:void 0,_=v.route.errorElement||W1,h&&(g<0&&w===0?(tw("route-fallback"),j=!0,S=null):g===w&&(j=!0,S=v.route.hydrateFallbackElement||null)));let I=e.concat(c.slice(0,w+1)),E=()=>{let z;return x?z=_:j?z=S:v.route.Component?z=B.createElement(v.route.Component,null):v.route.element?z=v.route.element:z=y,B.createElement(K1,{match:v,routeContext:{outlet:y,matches:I,isDataRoute:n!=null},children:z})};return n&&(v.route.ErrorBoundary||v.route.errorElement||w===0)?B.createElement(Q1,{location:n.location,revalidation:n.revalidation,component:_,error:x,children:E(),routeContext:{outlet:null,matches:I,isDataRoute:!0}}):E()},null)}var uy=(function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t})(uy||{}),cy=(function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t})(cy||{});function G1(t){let e=B.useContext(Fl);return e||vt(!1),e}function J1(t){let e=B.useContext(ay);return e||vt(!1),e}function Y1(t){let e=B.useContext(Rn);return e||vt(!1),e}function dy(t){let e=Y1(),n=e.matches[e.matches.length-1];return n.route.id||vt(!1),n.route.id}function X1(){var t;let e=B.useContext(oy),n=J1(),i=dy();return e!==void 0?e:(t=n.errors)==null?void 0:t[i]}function ew(){let{router:t}=G1(uy.UseNavigateStable),e=dy(cy.UseNavigateStable),n=B.useRef(!1);return ly(()=>{n.current=!0}),B.useCallback(function(o,l){l===void 0&&(l={}),n.current&&(typeof o=="number"?t.navigate(o):t.navigate(o,Aa({fromRouteId:e},l)))},[t,e])}const hm={};function tw(t,e,n){hm[t]||(hm[t]=!0)}function rw(t,e){t?.v7_startTransition,t?.v7_relativeSplatPath}function nw(t){return V1(t.context)}function Cn(t){vt(!1)}function sw(t){let{basename:e="/",children:n=null,location:i,navigationType:o=is.Pop,navigator:l,static:c=!1,future:f}=t;Wa()&&vt(!1);let h=e.replace(/^\/*/,"/"),g=B.useMemo(()=>({basename:h,navigator:l,static:c,future:Aa({v7_relativeSplatPath:!1},f)}),[h,f,l,c]);typeof i=="string"&&(i=Ti(i));let{pathname:y="/",search:v="",hash:w="",state:x=null,key:j="default"}=i,_=B.useMemo(()=>{let S=Si(y,h);return S==null?null:{location:{pathname:S,search:v,hash:w,state:x,key:j},navigationType:o}},[h,y,v,w,x,j,o]);return _==null?null:B.createElement(ys.Provider,{value:g},B.createElement(Ml.Provider,{children:n,value:_}))}function iw(t){let{children:e,location:n}=t;return B1(rd(e),n)}new Promise(()=>{});function rd(t,e){e===void 0&&(e=[]);let n=[];return B.Children.forEach(t,(i,o)=>{if(!B.isValidElement(i))return;let l=[...e,o];if(i.type===B.Fragment){n.push.apply(n,rd(i.props.children,l));return}i.type!==Cn&&vt(!1),!i.props.index||!i.props.children||vt(!1);let c={id:i.props.id||l.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(c.children=rd(i.props.children,l)),n.push(c)}),n}function pl(){return pl=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[o]=t[o]);return n}function aw(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function ow(t,e){return t.button===0&&(!e||e==="_self")&&!aw(t)}const lw=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],uw=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],cw="6";try{window.__reactRouterVersion=cw}catch{}const dw=B.createContext({isTransitioning:!1}),fw="startTransition",pm=Lx[fw];function hw(t){let{basename:e,children:n,future:i,window:o}=t,l=B.useRef();l.current==null&&(l.current=h1({window:o,v5Compat:!0}));let c=l.current,[f,h]=B.useState({action:c.action,location:c.location}),{v7_startTransition:g}=i||{},y=B.useCallback(v=>{g&&pm?pm(()=>h(v)):h(v)},[h,g]);return B.useLayoutEffect(()=>c.listen(y),[c,y]),B.useEffect(()=>rw(i),[i]),B.createElement(sw,{basename:e,children:n,location:f.location,navigationType:f.action,navigator:c,future:i})}const pw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",mw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gw=B.forwardRef(function(e,n){let{onClick:i,relative:o,reloadDocument:l,replace:c,state:f,target:h,to:g,preventScrollReset:y,viewTransition:v}=e,w=fy(e,lw),{basename:x}=B.useContext(ys),j,_=!1;if(typeof g=="string"&&mw.test(g)&&(j=g,pw))try{let z=new URL(window.location.href),M=g.startsWith("//")?new URL(z.protocol+g):new URL(g),L=Si(M.pathname,x);M.origin===z.origin&&L!=null?g=L+M.search+M.hash:_=!0}catch{}let S=$1(g,{relative:o}),I=xw(g,{replace:c,state:f,target:h,preventScrollReset:y,relative:o,viewTransition:v});function E(z){i&&i(z),z.defaultPrevented||I(z)}return B.createElement("a",pl({},w,{href:j||S,onClick:_||l?i:E,ref:n,target:h}))}),yw=B.forwardRef(function(e,n){let{"aria-current":i="page",caseSensitive:o=!1,className:l="",end:c=!1,style:f,to:h,viewTransition:g,children:y}=e,v=fy(e,uw),w=Dl(h,{relative:v.relative}),x=Li(),j=B.useContext(ay),{navigator:_,basename:S}=B.useContext(ys),I=j!=null&&ww(w)&&g===!0,E=_.encodeLocation?_.encodeLocation(w).pathname:w.pathname,z=x.pathname,M=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;o||(z=z.toLowerCase(),M=M?M.toLowerCase():null,E=E.toLowerCase()),M&&S&&(M=Si(M,S)||M);const L=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let Q=z===E||!c&&z.startsWith(E)&&z.charAt(L)==="/",le=M!=null&&(M===E||!c&&M.startsWith(E)&&M.charAt(E.length)==="/"),ue={isActive:Q,isPending:le,isTransitioning:I},pe=Q?i:void 0,_e;typeof l=="function"?_e=l(ue):_e=[l,Q?"active":null,le?"pending":null,I?"transitioning":null].filter(Boolean).join(" ");let Oe=typeof f=="function"?f(ue):f;return B.createElement(gw,pl({},v,{"aria-current":pe,className:_e,ref:n,style:Oe,to:h,viewTransition:g}),typeof y=="function"?y(ue):y)});var nd;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(nd||(nd={}));var mm;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(mm||(mm={}));function vw(t){let e=B.useContext(Fl);return e||vt(!1),e}function xw(t,e){let{target:n,replace:i,state:o,preventScrollReset:l,relative:c,viewTransition:f}=e===void 0?{}:e,h=Tn(),g=Li(),y=Dl(t,{relative:c});return B.useCallback(v=>{if(ow(v,n)){v.preventDefault();let w=i!==void 0?i:hl(g)===hl(y);h(t,{replace:w,state:o,preventScrollReset:l,relative:c,viewTransition:f})}},[g,h,y,i,o,n,t,l,c,f])}function ww(t,e){e===void 0&&(e={});let n=B.useContext(dw);n==null&&vt(!1);let{basename:i}=vw(nd.useViewTransitionState),o=Dl(t,{relative:e.relative});if(!n.isTransitioning)return!1;let l=Si(n.currentLocation.pathname,i)||n.currentLocation.pathname,c=Si(n.nextLocation.pathname,i)||n.nextLocation.pathname;return La(o.pathname,c)!=null||La(o.pathname,l)!=null}var Ai=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},bw=class extends Ai{#e;#t;#r;constructor(){super(),this.#r=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#r=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},$d=new bw,Sw={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},_w=class{#e=Sw;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},Fs=new _w;function kw(t){setTimeout(t,0)}var jw=typeof window>"u"||"Deno"in globalThis;function tr(){}function Cw(t,e){return typeof t=="function"?t(e):t}function sd(t){return typeof t=="number"&&t>=0&&t!==1/0}function hy(t,e){return Math.max(t+(e||0)-Date.now(),0)}function os(t,e){return typeof t=="function"?t(e):t}function Sr(t,e){return typeof t=="function"?t(e):t}function gm(t,e){const{type:n="all",exact:i,fetchStatus:o,predicate:l,queryKey:c,stale:f}=t;if(c){if(i){if(e.queryHash!==zd(c,e.options))return!1}else if(!Ia(e.queryKey,c))return!1}if(n!=="all"){const h=e.isActive();if(n==="active"&&!h||n==="inactive"&&h)return!1}return!(typeof f=="boolean"&&e.isStale()!==f||o&&o!==e.state.fetchStatus||l&&!l(e))}function ym(t,e){const{exact:n,status:i,predicate:o,mutationKey:l}=t;if(l){if(!e.options.mutationKey)return!1;if(n){if(Ds(e.options.mutationKey)!==Ds(l))return!1}else if(!Ia(e.options.mutationKey,l))return!1}return!(i&&e.state.status!==i||o&&!o(e))}function zd(t,e){return(e?.queryKeyHashFn||Ds)(t)}function Ds(t){return JSON.stringify(t,(e,n)=>id(n)?Object.keys(n).sort().reduce((i,o)=>(i[o]=n[o],i),{}):n)}function Ia(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Ia(t[n],e[n])):!1}var Ew=Object.prototype.hasOwnProperty;function py(t,e,n=0){if(t===e)return t;if(n>500)return e;const i=vm(t)&&vm(e);if(!i&&!(id(t)&&id(e)))return e;const l=(i?t:Object.keys(t)).length,c=i?e:Object.keys(e),f=c.length,h=i?new Array(f):{};let g=0;for(let y=0;y{Fs.setTimeout(e,t)})}function ad(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?py(t,e):e}function Pw(t,e,n=0){const i=[...t,e];return n&&i.length>n?i.slice(1):i}function Ow(t,e,n=0){const i=[e,...t];return n&&i.length>n?i.slice(0,-1):i}var Ud=Symbol();function my(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===Ud?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Vd(t,e){return typeof t=="function"?t(...e):!!t}function Rw(t,e,n){let i=!1,o;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(o??=e(),i||(i=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),t}var Fa=(()=>{let t=()=>jw;return{isServer(){return t()},setIsServer(e){t=e}}})();function od(){let t,e;const n=new Promise((o,l)=>{t=o,e=l});n.status="pending",n.catch(()=>{});function i(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{i({status:"fulfilled",value:o}),t(o)},n.reject=o=>{i({status:"rejected",reason:o}),e(o)},n}var Tw=kw;function Lw(){let t=[],e=0,n=f=>{f()},i=f=>{f()},o=Tw;const l=f=>{e?t.push(f):o(()=>{n(f)})},c=()=>{const f=t;t=[],f.length&&o(()=>{i(()=>{f.forEach(h=>{n(h)})})})};return{batch:f=>{let h;e++;try{h=f()}finally{e--,e||c()}return h},batchCalls:f=>(...h)=>{l(()=>{f(...h)})},schedule:l,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{i=f},setScheduler:f=>{o=f}}}var Tt=Lw(),Aw=class extends Ai{#e=!0;#t;#r;constructor(){super(),this.#r=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#r=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#e}},gl=new Aw;function Iw(t){return Math.min(1e3*2**t,3e4)}function gy(t){return(t??"online")==="online"?gl.isOnline():!0}var ld=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function yy(t){let e=!1,n=0,i;const o=od(),l=()=>o.status!=="pending",c=_=>{if(!l()){const S=new ld(_);w(S),t.onCancel?.(S)}},f=()=>{e=!0},h=()=>{e=!1},g=()=>$d.isFocused()&&(t.networkMode==="always"||gl.isOnline())&&t.canRun(),y=()=>gy(t.networkMode)&&t.canRun(),v=_=>{l()||(i?.(),o.resolve(_))},w=_=>{l()||(i?.(),o.reject(_))},x=()=>new Promise(_=>{i=S=>{(l()||g())&&_(S)},t.onPause?.()}).then(()=>{i=void 0,l()||t.onContinue?.()}),j=()=>{if(l())return;let _;const S=n===0?t.initialPromise:void 0;try{_=S??t.fn()}catch(I){_=Promise.reject(I)}Promise.resolve(_).then(v).catch(I=>{if(l())return;const E=t.retry??(Fa.isServer()?0:3),z=t.retryDelay??Iw,M=typeof z=="function"?z(n,I):z,L=E===!0||typeof E=="number"&&ng()?void 0:x()).then(()=>{e?w(I):j()})})};return{promise:o,status:()=>o.status,cancel:c,continue:()=>(i?.(),o),cancelRetry:f,continueRetry:h,canStart:y,start:()=>(y()?j():x().then(j),o)}}var vy=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),sd(this.gcTime)&&(this.#e=Fs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Fa.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Fs.clearTimeout(this.#e),this.#e=void 0)}};function Fw(t){return{onFetch:(e,n)=>{const i=e.options,o=e.fetchOptions?.meta?.fetchMore?.direction,l=e.state.data?.pages||[],c=e.state.data?.pageParams||[];let f={pages:[],pageParams:[]},h=0;const g=async()=>{let y=!1;const v=j=>{Rw(j,()=>e.signal,()=>y=!0)},w=my(e.options,e.fetchOptions),x=async(j,_,S)=>{if(y)return Promise.reject(e.signal.reason);if(_==null&&j.pages.length)return Promise.resolve(j);const E=(()=>{const Q={client:e.client,queryKey:e.queryKey,pageParam:_,direction:S?"backward":"forward",meta:e.options.meta};return v(Q),Q})(),z=await w(E),{maxPages:M}=e.options,L=S?Ow:Pw;return{pages:L(j.pages,z,M),pageParams:L(j.pageParams,_,M)}};if(o&&l.length){const j=o==="backward",_=j?Mw:wm,S={pages:l,pageParams:c},I=_(i,S);f=await x(S,I,j)}else{const j=t??l.length;do{const _=h===0?c[0]??i.initialPageParam:wm(i,f);if(h>0&&_==null)break;f=await x(f,_),h++}while(he.options.persister?.(g,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=g}}}function wm(t,{pages:e,pageParams:n}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,n[i],n):void 0}function Mw(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}var Dw=class extends vy{#e;#t;#r;#n;#i;#s;#o;#a;constructor(t){super(),this.#a=!1,this.#o=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#i=t.client,this.#n=this.#i.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=Sm(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#s?.promise}setOptions(t){if(this.options={...this.#o,...t},t?._type&&(this.#e=t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=Sm(this.options);e.data!==void 0&&(this.setState(bm(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(t,e){const n=ad(this.state.data,t,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t){this.#l({type:"setState",state:t})}cancel(t){const e=this.#s?.promise;return this.#s?.cancel(t),e?e.then(tr).catch(tr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Sr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ud||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>os(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!hy(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#s&&(this.#a||this.#c()?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(g=>g.options.queryFn);h&&this.setOptions(h.options)}const n=new AbortController,i=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},o=()=>{const h=my(this.options,e),y=(()=>{const v={client:this.#i,queryKey:this.queryKey,meta:this.meta};return i(v),v})();return this.#a=!1,this.options.persister?this.options.persister(h,y,this):h(y)},c=(()=>{const h={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:o};return i(h),h})();(this.#e==="infinite"?Fw(this.options.pages):this.options.behavior)?.onFetch(c,this),this.#r=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#l({type:"fetch",meta:c.fetchOptions?.meta}),this.#s=yy({initialPromise:e?.initialPromise,fn:c.fetchFn,onCancel:h=>{h instanceof ld&&h.revert&&this.setState({...this.#r,fetchStatus:"idle"}),n.abort()},onFail:(h,g)=>{this.#l({type:"failed",failureCount:h,error:g})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const h=await this.#s.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof ld){if(h.silent)return this.#s.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#l({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#l(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...xy(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...bm(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#r=t.manual?i:void 0,i;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),Tt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:t})})}};function xy(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:gy(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function bm(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Sm(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,i=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var $w=class extends Ai{constructor(t,e){super(),this.options=e,this.#e=t,this.#a=null,this.#o=od(),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#r=void 0;#n=void 0;#i;#s;#o;#a;#c;#l;#p;#d;#f;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),_m(this.#t,this.options)?this.#h():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ud(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ud(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#b(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Sr(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),e._defaulted&&!ml(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&km(this.#t,n,this.options,e)&&this.#h(),this.updateResult(),i&&(this.#t!==n||Sr(this.options.enabled,this.#t)!==Sr(e.enabled,this.#t)||os(this.options.staleTime,this.#t)!==os(e.staleTime,this.#t))&&this.#g();const o=this.#y();i&&(this.#t!==n||Sr(this.options.enabled,this.#t)!==Sr(e.enabled,this.#t)||o!==this.#u)&&this.#v(o)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),n=this.createResult(e,t);return Uw(this,n)&&(this.#n=n,this.#s=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#n}trackResult(t,e){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),e?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(t){this.#m.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),n=this.#e.getQueryCache().build(this.#e,e);return n.fetch().then(()=>this.createResult(n,e))}fetch(t){return this.#h({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#h(t){this.#S();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(tr)),e}#g(){this.#w();const t=os(this.options.staleTime,this.#t);if(Fa.isServer()||this.#n.isStale||!sd(t))return;const n=hy(this.#n.dataUpdatedAt,t)+1;this.#d=Fs.setTimeout(()=>{this.#n.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(t){this.#b(),this.#u=t,!(Fa.isServer()||Sr(this.options.enabled,this.#t)===!1||!sd(this.#u)||this.#u===0)&&(this.#f=Fs.setInterval(()=>{(this.options.refetchIntervalInBackground||$d.isFocused())&&this.#h()},this.#u))}#x(){this.#g(),this.#v(this.#y())}#w(){this.#d!==void 0&&(Fs.clearTimeout(this.#d),this.#d=void 0)}#b(){this.#f!==void 0&&(Fs.clearInterval(this.#f),this.#f=void 0)}createResult(t,e){const n=this.#t,i=this.options,o=this.#n,l=this.#i,c=this.#s,h=t!==n?t.state:this.#r,{state:g}=t;let y={...g},v=!1,w;if(e._optimisticResults){const ue=this.hasListeners(),pe=!ue&&_m(t,e),_e=ue&&km(t,n,e,i);(pe||_e)&&(y={...y,...xy(g.data,t.options)}),e._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:x,errorUpdatedAt:j,status:_}=y;w=y.data;let S=!1;if(e.placeholderData!==void 0&&w===void 0&&_==="pending"){let ue;o?.isPlaceholderData&&e.placeholderData===c?.placeholderData?(ue=o.data,S=!0):ue=typeof e.placeholderData=="function"?e.placeholderData(this.#p?.state.data,this.#p):e.placeholderData,ue!==void 0&&(_="success",w=ad(o?.data,ue,e),v=!0)}if(e.select&&w!==void 0&&!S)if(o&&w===l?.data&&e.select===this.#c)w=this.#l;else try{this.#c=e.select,w=e.select(w),w=ad(o?.data,w,e),this.#l=w,this.#a=null}catch(ue){this.#a=ue}this.#a&&(x=this.#a,w=this.#l,j=Date.now(),_="error");const I=y.fetchStatus==="fetching",E=_==="pending",z=_==="error",M=E&&I,L=w!==void 0,le={status:_,fetchStatus:y.fetchStatus,isPending:E,isSuccess:_==="success",isError:z,isInitialLoading:M,isLoading:M,data:w,dataUpdatedAt:y.dataUpdatedAt,error:x,errorUpdatedAt:j,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:y.dataUpdateCount>h.dataUpdateCount||y.errorUpdateCount>h.errorUpdateCount,isFetching:I,isRefetching:I&&!E,isLoadingError:z&&!L,isPaused:y.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:z&&L,isStale:Bd(t,e),refetch:this.refetch,promise:this.#o,isEnabled:Sr(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const ue=le.data!==void 0,pe=le.status==="error"&&!ue,_e=me=>{pe?me.reject(le.error):ue&&me.resolve(le.data)},Oe=()=>{const me=this.#o=le.promise=od();_e(me)},Z=this.#o;switch(Z.status){case"pending":t.queryHash===n.queryHash&&_e(Z);break;case"fulfilled":(pe||le.data!==Z.value)&&Oe();break;case"rejected":(!pe||le.error!==Z.reason)&&Oe();break}}return le}updateResult(){const t=this.#n,e=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#s=this.options,this.#i.data!==void 0&&(this.#p=this.#t),ml(e,t))return;this.#n=e;const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!this.#m.size)return!0;const l=new Set(o??this.#m);return this.options.throwOnError&&l.add("error"),Object.keys(this.#n).some(c=>{const f=c;return this.#n[f]!==t[f]&&l.has(f)})};this.#_({listeners:n()})}#S(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#r=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#_(t){Tt.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function zw(t,e){return Sr(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Sr(e.retryOnMount,t)===!1)}function _m(t,e){return zw(t,e)||t.state.data!==void 0&&ud(t,e,e.refetchOnMount)}function ud(t,e,n){if(Sr(e.enabled,t)!==!1&&os(e.staleTime,t)!=="static"){const i=typeof n=="function"?n(t):n;return i==="always"||i!==!1&&Bd(t,e)}return!1}function km(t,e,n,i){return(t!==e||Sr(i.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Bd(t,n)}function Bd(t,e){return Sr(e.enabled,t)!==!1&&t.isStaleByTime(os(e.staleTime,t))}function Uw(t,e){return!ml(t.getCurrentResult(),e)}var Vw=class extends vy{#e;#t;#r;#n;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#r=t.mutationCache,this.#t=[],this.state=t.state||wy(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#i({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=yy({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(l,c)=>{this.#i({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const i=this.state.status==="pending",o=!this.#n.canStart();try{if(i)e();else{this.#i({type:"pending",variables:t,isPaused:o}),this.#r.config.onMutate&&await this.#r.config.onMutate(t,this,n);const c=await this.options.onMutate?.(t,n);c!==this.state.context&&this.#i({type:"pending",context:c,variables:t,isPaused:o})}const l=await this.#n.start();return await this.#r.config.onSuccess?.(l,t,this.state.context,this,n),await this.options.onSuccess?.(l,t,this.state.context,n),await this.#r.config.onSettled?.(l,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(l,null,t,this.state.context,n),this.#i({type:"success",data:l}),l}catch(l){try{await this.#r.config.onError?.(l,t,this.state.context,this,n)}catch(c){Promise.reject(c)}try{await this.options.onError?.(l,t,this.state.context,n)}catch(c){Promise.reject(c)}try{await this.#r.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,n)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,l,t,this.state.context,n)}catch(c){Promise.reject(c)}throw this.#i({type:"error",error:l}),l}finally{this.#r.runNext(this)}}#i(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Tt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(t)}),this.#r.notify({mutation:this,type:"updated",action:t})})}};function wy(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Bw=class extends Ai{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(t,e,n){const i=new Vw({client:t,mutationCache:this,mutationId:++this.#r,options:t.defaultMutationOptions(e),state:n});return this.add(i),i}add(t){this.#e.add(t);const e=al(t);if(typeof e=="string"){const n=this.#t.get(e);n?n.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=al(t);if(typeof e=="string"){const n=this.#t.get(e);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=al(t);if(typeof e=="string"){const i=this.#t.get(e)?.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){const e=al(t);return typeof e=="string"?this.#t.get(e)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Tt.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(n=>ym(e,n))}findAll(t={}){return this.getAll().filter(e=>ym(t,e))}notify(t){Tt.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return Tt.batch(()=>Promise.all(t.map(e=>e.continue().catch(tr))))}};function al(t){return t.options.scope?.id}var Hw=class extends Ai{#e;#t=void 0;#r;#n;constructor(e,n){super(),this.#e=e,this.setOptions(n),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const n=this.options;this.options=this.#e.defaultMutationOptions(e),ml(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),n?.mutationKey&&this.options.mutationKey&&Ds(n.mutationKey)!==Ds(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#s(e)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#i(),this.#s()}mutate(e,n){return this.#n=n,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(e)}#i(){const e=this.#r?.state??wy();this.#t={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#s(e){Tt.batch(()=>{if(this.#n&&this.hasListeners()){const n=this.#t.variables,i=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#n.onSuccess?.(e.data,n,i,o)}catch(l){Promise.reject(l)}try{this.#n.onSettled?.(e.data,null,n,i,o)}catch(l){Promise.reject(l)}}else if(e?.type==="error"){try{this.#n.onError?.(e.error,n,i,o)}catch(l){Promise.reject(l)}try{this.#n.onSettled?.(void 0,e.error,n,i,o)}catch(l){Promise.reject(l)}}}this.listeners.forEach(n=>{n(this.#t)})})}},qw=class extends Ai{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,n){const i=e.queryKey,o=e.queryHash??zd(i,e);let l=this.get(o);return l||(l=new Dw({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(e),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(l)),l}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Tt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(n=>gm(e,n))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(n=>gm(t,n)):e}notify(t){Tt.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){Tt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Tt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ww=class{#e;#t;#r;#n;#i;#s;#o;#a;constructor(t={}){this.#e=t.queryCache||new qw,this.#t=t.mutationCache||new Bw,this.#r=t.defaultOptions||{},this.#n=new Map,this.#i=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#o=$d.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=gl.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=this.#e.build(this,e),i=n.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(os(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:n})=>{const i=n.data;return[e,i]})}setQueryData(t,e,n){const i=this.defaultQueryOptions({queryKey:t}),l=this.#e.get(i.queryHash)?.state.data,c=Cw(e,l);if(c!==void 0)return this.#e.build(this,i).setData(c,{...n,manual:!0})}setQueriesData(t,e,n){return Tt.batch(()=>this.#e.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,n)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;Tt.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=this.#e;return Tt.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},i=Tt.batch(()=>this.#e.findAll(t).map(o=>o.cancel(n)));return Promise.all(i).then(tr).catch(tr)}invalidateQueries(t,e={}){return Tt.batch(()=>(this.#e.findAll(t).forEach(n=>{n.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},i=Tt.batch(()=>this.#e.findAll(t).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let l=o.fetch(void 0,n);return n.throwOnError||(l=l.catch(tr)),o.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(tr)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=this.#e.build(this,e);return n.isStaleByTime(os(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(tr).catch(tr)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(tr).catch(tr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return gl.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(t){this.#r=t}setQueryDefaults(t,e){this.#n.set(Ds(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#n.values()],n={};return e.forEach(i=>{Ia(t,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(t,e){this.#i.set(Ds(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#i.values()],n={};return e.forEach(i=>{Ia(t,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#r.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=zd(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Ud&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#r.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},by=B.createContext(void 0),jr=t=>{const e=B.useContext(by);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Qw=({client:t,children:e})=>(B.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),m.jsx(by.Provider,{value:t,children:e})),Sy=B.createContext(!1),Kw=()=>B.useContext(Sy);Sy.Provider;function Zw(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Gw=B.createContext(Zw()),Jw=()=>B.useContext(Gw),Yw=(t,e,n)=>{const i=n?.state.error&&typeof t.throwOnError=="function"?Vd(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||i)&&(e.isReset()||(t.retryOnMount=!1))},Xw=t=>{B.useEffect(()=>{t.clearReset()},[t])},eb=({result:t,errorResetBoundary:e,throwOnError:n,query:i,suspense:o})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(o&&t.data===void 0||Vd(n,[t.error,i])),tb=t=>{if(t.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),i=t.staleTime;t.staleTime=typeof i=="function"?(...o)=>n(i(...o)):n(i),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},rb=(t,e)=>t.isLoading&&t.isFetching&&!e,nb=(t,e)=>t?.suspense&&e.isPending,jm=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function sb(t,e,n){const i=Kw(),o=Jw(),l=jr(),c=l.defaultQueryOptions(t);l.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const f=l.getQueryCache().get(c.queryHash);c._optimisticResults=i?"isRestoring":"optimistic",tb(c),Yw(c,o,f),Xw(o);const h=!l.getQueryCache().get(c.queryHash),[g]=B.useState(()=>new e(l,c)),y=g.getOptimisticResult(c),v=!i&&t.subscribed!==!1;if(B.useSyncExternalStore(B.useCallback(w=>{const x=v?g.subscribe(Tt.batchCalls(w)):tr;return g.updateResult(),x},[g,v]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),B.useEffect(()=>{g.setOptions(c)},[c,g]),nb(c,y))throw jm(c,g,o);if(eb({result:y,errorResetBoundary:o,throwOnError:c.throwOnError,query:f,suspense:c.suspense}))throw y.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(c,y),c.experimental_prefetchInRender&&!Fa.isServer()&&rb(y,i)&&(h?jm(c,g,o):f?.promise)?.catch(tr).finally(()=>{g.updateResult()}),c.notifyOnChangeProps?y:g.trackResult(y)}function vs(t,e){return sb(t,$w)}function Zr(t,e){const n=jr(),[i]=B.useState(()=>new Hw(n,t));B.useEffect(()=>{i.setOptions(t)},[i,t]);const o=B.useSyncExternalStore(B.useCallback(c=>i.subscribe(Tt.batchCalls(c)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),l=B.useCallback((c,f)=>{i.mutate(c,f).catch(tr)},[i]);if(o.error&&Vd(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:l,mutateAsync:o.mutate}}var ib=t=>{switch(t){case"success":return lb;case"info":return cb;case"warning":return ub;case"error":return db;default:return null}},ab=Array(12).fill(0),ob=({visible:t,className:e})=>ee.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ee.createElement("div",{className:"sonner-spinner"},ab.map((n,i)=>ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),lb=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),ub=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),cb=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),db=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),fb=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),hb=()=>{let[t,e]=ee.useState(document.hidden);return ee.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},cd=1,pb=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...i}=t,o=typeof t?.id=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:cd++,l=this.toasts.find(f=>f.id===o),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(f=>f.id===o?(this.publish({...f,...t,id:o,title:n}),{...f,...t,id:o,dismissible:c,title:n}):f):this.addToast({title:n,...i,dismissible:c,id:o}),o},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let i=t instanceof Promise?t:t(),o=n!==void 0,l,c=i.then(async h=>{if(l=["resolve",h],ee.isValidElement(h))o=!1,this.create({id:n,type:"default",message:h});else if(gb(h)&&!h.ok){o=!1;let g=typeof e.error=="function"?await e.error(`HTTP error! status: ${h.status}`):e.error,y=typeof e.description=="function"?await e.description(`HTTP error! status: ${h.status}`):e.description;this.create({id:n,type:"error",message:g,description:y})}else if(e.success!==void 0){o=!1;let g=typeof e.success=="function"?await e.success(h):e.success,y=typeof e.description=="function"?await e.description(h):e.description;this.create({id:n,type:"success",message:g,description:y})}}).catch(async h=>{if(l=["reject",h],e.error!==void 0){o=!1;let g=typeof e.error=="function"?await e.error(h):e.error,y=typeof e.description=="function"?await e.description(h):e.description;this.create({id:n,type:"error",message:g,description:y})}}).finally(()=>{var h;o&&(this.dismiss(n),n=void 0),(h=e.finally)==null||h.call(e)}),f=()=>new Promise((h,g)=>c.then(()=>l[0]==="reject"?g(l[1]):h(l[1])).catch(g));return typeof n!="string"&&typeof n!="number"?{unwrap:f}:Object.assign(n,{unwrap:f})},this.custom=(t,e)=>{let n=e?.id||cd++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},mr=new pb,mb=(t,e)=>{let n=e?.id||cd++;return mr.addToast({title:t,...e,id:n}),n},gb=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",yb=mb,vb=()=>mr.toasts,xb=()=>mr.getActiveToasts(),$t=Object.assign(yb,{success:mr.success,info:mr.info,warning:mr.warning,error:mr.error,custom:mr.custom,message:mr.message,promise:mr.promise,dismiss:mr.dismiss,loading:mr.loading},{getHistory:vb,getToasts:xb});function wb(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",e==="top"&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}wb(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} `);function ol(t){return t.label!==void 0}var bb=3,Sb="32px",_b="16px",Cm=4e3,kb=356,jb=14,Cb=20,Eb=200;function qr(...t){return t.filter(Boolean).join(" ")}function Nb(t){let[e,n]=t.split("-"),i=[];return e&&i.push(e),n&&i.push(n),i}var Pb=t=>{var e,n,i,o,l,c,f,h,g,y,v;let{invert:w,toast:x,unstyled:j,interacting:_,setHeights:S,visibleToasts:I,heights:E,index:z,toasts:M,expanded:L,removeToast:Q,defaultRichColors:le,closeButton:ue,style:pe,cancelButtonStyle:_e,actionButtonStyle:Oe,className:Z="",descriptionClassName:me="",duration:he,position:T,gap:P,loadingIcon:K,expandByDefault:V,classNames:H,icons:W,closeButtonAriaLabel:O="Close toast",pauseWhenPageIsHidden:q}=t,[ae,fe]=ee.useState(null),[Ee,Ie]=ee.useState(null),[ke,Ue]=ee.useState(!1),[Be,_t]=ee.useState(!1),[ir,dn]=ee.useState(!1),[Ir,fn]=ee.useState(!1),[Hs,Ln]=ee.useState(!1),[ws,hn]=ee.useState(0),[An,Gr]=ee.useState(0),ar=ee.useRef(x.duration||he||Cm),bs=ee.useRef(null),gr=ee.useRef(null),C=z===0,A=z+1<=I,D=x.type,se=x.dismissible!==!1,ie=x.className||"",ne=x.descriptionClassName||"",oe=ee.useMemo(()=>E.findIndex(Re=>Re.toastId===x.id)||0,[E,x.id]),Ne=ee.useMemo(()=>{var Re;return(Re=x.closeButton)!=null?Re:ue},[x.closeButton,ue]),De=ee.useMemo(()=>x.duration||he||Cm,[x.duration,he]),ht=ee.useRef(0),kt=ee.useRef(0),Pt=ee.useRef(0),Cr=ee.useRef(null),[pn,mn]=T.split("-"),In=ee.useMemo(()=>E.reduce((Re,Qe,et)=>et>=oe?Re:Re+Qe.height,0),[E,oe]),gn=hb(),Jr=x.invert||w,yr=D==="loading";kt.current=ee.useMemo(()=>oe*P+In,[oe,In]),ee.useEffect(()=>{ar.current=De},[De]),ee.useEffect(()=>{Ue(!0)},[]),ee.useEffect(()=>{let Re=gr.current;if(Re){let Qe=Re.getBoundingClientRect().height;return Gr(Qe),S(et=>[{toastId:x.id,height:Qe,position:x.position},...et]),()=>S(et=>et.filter(Yt=>Yt.toastId!==x.id))}},[S,x.id]),ee.useLayoutEffect(()=>{if(!ke)return;let Re=gr.current,Qe=Re.style.height;Re.style.height="auto";let et=Re.getBoundingClientRect().height;Re.style.height=Qe,Gr(et),S(Yt=>Yt.find(or=>or.toastId===x.id)?Yt.map(or=>or.toastId===x.id?{...or,height:et}:or):[{toastId:x.id,height:et,position:x.position},...Yt])},[ke,x.title,x.description,S,x.id]);let Fr=ee.useCallback(()=>{_t(!0),hn(kt.current),S(Re=>Re.filter(Qe=>Qe.toastId!==x.id)),setTimeout(()=>{Q(x)},Eb)},[x,Q,S,kt]);ee.useEffect(()=>{if(x.promise&&D==="loading"||x.duration===1/0||x.type==="loading")return;let Re;return L||_||q&&gn?(()=>{if(Pt.current{var Qe;(Qe=x.onAutoClose)==null||Qe.call(x,x),Fr()},ar.current)),()=>clearTimeout(Re)},[L,_,x,D,q,gn,Fr]),ee.useEffect(()=>{x.delete&&Fr()},[Fr,x.delete]);function Ga(){var Re,Qe,et;return W!=null&&W.loading?ee.createElement("div",{className:qr(H?.loader,(Re=x?.classNames)==null?void 0:Re.loader,"sonner-loader"),"data-visible":D==="loading"},W.loading):K?ee.createElement("div",{className:qr(H?.loader,(Qe=x?.classNames)==null?void 0:Qe.loader,"sonner-loader"),"data-visible":D==="loading"},K):ee.createElement(ob,{className:qr(H?.loader,(et=x?.classNames)==null?void 0:et.loader),visible:D==="loading"})}return ee.createElement("li",{tabIndex:0,ref:gr,className:qr(Z,ie,H?.toast,(e=x?.classNames)==null?void 0:e.toast,H?.default,H?.[D],(n=x?.classNames)==null?void 0:n[D]),"data-sonner-toast":"","data-rich-colors":(i=x.richColors)!=null?i:le,"data-styled":!(x.jsx||x.unstyled||j),"data-mounted":ke,"data-promise":!!x.promise,"data-swiped":Hs,"data-removed":Be,"data-visible":A,"data-y-position":pn,"data-x-position":mn,"data-index":z,"data-front":C,"data-swiping":ir,"data-dismissible":se,"data-type":D,"data-invert":Jr,"data-swipe-out":Ir,"data-swipe-direction":Ee,"data-expanded":!!(L||V&&ke),style:{"--index":z,"--toasts-before":z,"--z-index":M.length-z,"--offset":`${Be?ws:kt.current}px`,"--initial-height":V?"auto":`${An}px`,...pe,...x.style},onDragEnd:()=>{dn(!1),fe(null),Cr.current=null},onPointerDown:Re=>{yr||!se||(bs.current=new Date,hn(kt.current),Re.target.setPointerCapture(Re.pointerId),Re.target.tagName!=="BUTTON"&&(dn(!0),Cr.current={x:Re.clientX,y:Re.clientY}))},onPointerUp:()=>{var Re,Qe,et,Yt;if(Ir||!se)return;Cr.current=null;let or=Number(((Re=gr.current)==null?void 0:Re.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),lr=Number(((Qe=gr.current)==null?void 0:Qe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Mr=new Date().getTime()-((et=bs.current)==null?void 0:et.getTime()),Ft=ae==="x"?or:lr,Yr=Math.abs(Ft)/Mr;if(Math.abs(Ft)>=Cb||Yr>.11){hn(kt.current),(Yt=x.onDismiss)==null||Yt.call(x,x),Ie(ae==="x"?or>0?"right":"left":lr>0?"down":"up"),Fr(),fn(!0),Ln(!1);return}dn(!1),fe(null)},onPointerMove:Re=>{var Qe,et,Yt,or;if(!Cr.current||!se||((Qe=window.getSelection())==null?void 0:Qe.toString().length)>0)return;let lr=Re.clientY-Cr.current.y,Mr=Re.clientX-Cr.current.x,Ft=(et=t.swipeDirections)!=null?et:Nb(T);!ae&&(Math.abs(Mr)>1||Math.abs(lr)>1)&&fe(Math.abs(Mr)>Math.abs(lr)?"x":"y");let Yr={x:0,y:0};ae==="y"?(Ft.includes("top")||Ft.includes("bottom"))&&(Ft.includes("top")&&lr<0||Ft.includes("bottom")&&lr>0)&&(Yr.y=lr):ae==="x"&&(Ft.includes("left")||Ft.includes("right"))&&(Ft.includes("left")&&Mr<0||Ft.includes("right")&&Mr>0)&&(Yr.x=Mr),(Math.abs(Yr.x)>0||Math.abs(Yr.y)>0)&&Ln(!0),(Yt=gr.current)==null||Yt.style.setProperty("--swipe-amount-x",`${Yr.x}px`),(or=gr.current)==null||or.style.setProperty("--swipe-amount-y",`${Yr.y}px`)}},Ne&&!x.jsx?ee.createElement("button",{"aria-label":O,"data-disabled":yr,"data-close-button":!0,onClick:yr||!se?()=>{}:()=>{var Re;Fr(),(Re=x.onDismiss)==null||Re.call(x,x)},className:qr(H?.closeButton,(o=x?.classNames)==null?void 0:o.closeButton)},(l=W?.close)!=null?l:fb):null,x.jsx||B.isValidElement(x.title)?x.jsx?x.jsx:typeof x.title=="function"?x.title():x.title:ee.createElement(ee.Fragment,null,D||x.icon||x.promise?ee.createElement("div",{"data-icon":"",className:qr(H?.icon,(c=x?.classNames)==null?void 0:c.icon)},x.promise||x.type==="loading"&&!x.icon?x.icon||Ga():null,x.type!=="loading"?x.icon||W?.[D]||ib(D):null):null,ee.createElement("div",{"data-content":"",className:qr(H?.content,(f=x?.classNames)==null?void 0:f.content)},ee.createElement("div",{"data-title":"",className:qr(H?.title,(h=x?.classNames)==null?void 0:h.title)},typeof x.title=="function"?x.title():x.title),x.description?ee.createElement("div",{"data-description":"",className:qr(me,ne,H?.description,(g=x?.classNames)==null?void 0:g.description)},typeof x.description=="function"?x.description():x.description):null),B.isValidElement(x.cancel)?x.cancel:x.cancel&&ol(x.cancel)?ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:x.cancelButtonStyle||_e,onClick:Re=>{var Qe,et;ol(x.cancel)&&se&&((et=(Qe=x.cancel).onClick)==null||et.call(Qe,Re),Fr())},className:qr(H?.cancelButton,(y=x?.classNames)==null?void 0:y.cancelButton)},x.cancel.label):null,B.isValidElement(x.action)?x.action:x.action&&ol(x.action)?ee.createElement("button",{"data-button":!0,"data-action":!0,style:x.actionButtonStyle||Oe,onClick:Re=>{var Qe,et;ol(x.action)&&((et=(Qe=x.action).onClick)==null||et.call(Qe,Re),!Re.defaultPrevented&&Fr())},className:qr(H?.actionButton,(v=x?.classNames)==null?void 0:v.actionButton)},x.action.label):null))};function Em(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function Ob(t,e){let n={};return[t,e].forEach((i,o)=>{let l=o===1,c=l?"--mobile-offset":"--offset",f=l?_b:Sb;function h(g){["top","right","bottom","left"].forEach(y=>{n[`${c}-${y}`]=typeof g=="number"?`${g}px`:g})}typeof i=="number"||typeof i=="string"?h(i):typeof i=="object"?["top","right","bottom","left"].forEach(g=>{i[g]===void 0?n[`${c}-${g}`]=f:n[`${c}-${g}`]=typeof i[g]=="number"?`${i[g]}px`:i[g]}):h(f)}),n}var Rb=B.forwardRef(function(t,e){let{invert:n,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:f,offset:h,mobileOffset:g,theme:y="light",richColors:v,duration:w,style:x,visibleToasts:j=bb,toastOptions:_,dir:S=Em(),gap:I=jb,loadingIcon:E,icons:z,containerAriaLabel:M="Notifications",pauseWhenPageIsHidden:L}=t,[Q,le]=ee.useState([]),ue=ee.useMemo(()=>Array.from(new Set([i].concat(Q.filter(q=>q.position).map(q=>q.position)))),[Q,i]),[pe,_e]=ee.useState([]),[Oe,Z]=ee.useState(!1),[me,he]=ee.useState(!1),[T,P]=ee.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=ee.useRef(null),V=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=ee.useRef(null),W=ee.useRef(!1),O=ee.useCallback(q=>{le(ae=>{var fe;return(fe=ae.find(Ee=>Ee.id===q.id))!=null&&fe.delete||mr.dismiss(q.id),ae.filter(({id:Ee})=>Ee!==q.id)})},[]);return ee.useEffect(()=>mr.subscribe(q=>{if(q.dismiss){le(ae=>ae.map(fe=>fe.id===q.id?{...fe,delete:!0}:fe));return}setTimeout(()=>{Hx.flushSync(()=>{le(ae=>{let fe=ae.findIndex(Ee=>Ee.id===q.id);return fe!==-1?[...ae.slice(0,fe),{...ae[fe],...q},...ae.slice(fe+1)]:[q,...ae]})})})}),[]),ee.useEffect(()=>{if(y!=="system"){P(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),typeof window>"u")return;let q=window.matchMedia("(prefers-color-scheme: dark)");try{q.addEventListener("change",({matches:ae})=>{P(ae?"dark":"light")})}catch{q.addListener(({matches:fe})=>{try{P(fe?"dark":"light")}catch(Ee){console.error(Ee)}})}},[y]),ee.useEffect(()=>{Q.length<=1&&Z(!1)},[Q]),ee.useEffect(()=>{let q=ae=>{var fe,Ee;o.every(Ie=>ae[Ie]||ae.code===Ie)&&(Z(!0),(fe=K.current)==null||fe.focus()),ae.code==="Escape"&&(document.activeElement===K.current||(Ee=K.current)!=null&&Ee.contains(document.activeElement))&&Z(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[o]),ee.useEffect(()=>{if(K.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,W.current=!1)}},[K.current]),ee.createElement("section",{ref:e,"aria-label":`${M} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ue.map((q,ae)=>{var fe;let[Ee,Ie]=q.split("-");return Q.length?ee.createElement("ol",{key:q,dir:S==="auto"?Em():S,tabIndex:-1,ref:K,className:f,"data-sonner-toaster":!0,"data-theme":T,"data-y-position":Ee,"data-lifted":Oe&&Q.length>1&&!l,"data-x-position":Ie,style:{"--front-toast-height":`${((fe=pe[0])==null?void 0:fe.height)||0}px`,"--width":`${kb}px`,"--gap":`${I}px`,...x,...Ob(h,g)},onBlur:ke=>{W.current&&!ke.currentTarget.contains(ke.relatedTarget)&&(W.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:ke=>{ke.target instanceof HTMLElement&&ke.target.dataset.dismissible==="false"||W.current||(W.current=!0,H.current=ke.relatedTarget)},onMouseEnter:()=>Z(!0),onMouseMove:()=>Z(!0),onMouseLeave:()=>{me||Z(!1)},onDragEnd:()=>Z(!1),onPointerDown:ke=>{ke.target instanceof HTMLElement&&ke.target.dataset.dismissible==="false"||he(!0)},onPointerUp:()=>he(!1)},Q.filter(ke=>!ke.position&&ae===0||ke.position===q).map((ke,Ue)=>{var Be,_t;return ee.createElement(Pb,{key:ke.id,icons:z,index:Ue,toast:ke,defaultRichColors:v,duration:(Be=_?.duration)!=null?Be:w,className:_?.className,descriptionClassName:_?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(_t=_?.closeButton)!=null?_t:c,interacting:me,position:q,style:_?.style,unstyled:_?.unstyled,classNames:_?.classNames,cancelButtonStyle:_?.cancelButtonStyle,actionButtonStyle:_?.actionButtonStyle,removeToast:O,toasts:Q.filter(ir=>ir.position==ke.position),heights:pe.filter(ir=>ir.position==ke.position),setHeights:_e,expandByDefault:l,gap:I,loadingIcon:E,expanded:Oe,pauseWhenPageIsHidden:L,swipeDirections:t.swipeDirections})})):null}))});const Le=t=>typeof t=="string",xa=()=>{let t,e;const n=new Promise((i,o)=>{t=i,e=o});return n.resolve=t,n.reject=e,n},Nm=t=>t==null?"":""+t,Tb=(t,e,n)=>{t.forEach(i=>{e[i]&&(n[i]=e[i])})},Lb=/###/g,Pm=t=>t&&t.indexOf("###")>-1?t.replace(Lb,"."):t,Om=t=>!t||Le(t),Pa=(t,e,n)=>{const i=Le(e)?e.split("."):e;let o=0;for(;o{const{obj:i,k:o}=Pa(t,e,Object);if(i!==void 0||e.length===1){i[o]=n;return}let l=e[e.length-1],c=e.slice(0,e.length-1),f=Pa(t,c,Object);for(;f.obj===void 0&&c.length;)l=`${c[c.length-1]}.${l}`,c=c.slice(0,c.length-1),f=Pa(t,c,Object),f&&f.obj&&typeof f.obj[`${f.k}.${l}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${l}`]=n},Ab=(t,e,n,i)=>{const{obj:o,k:l}=Pa(t,e,Object);o[l]=o[l]||[],o[l].push(n)},yl=(t,e)=>{const{obj:n,k:i}=Pa(t,e);if(n)return n[i]},Ib=(t,e,n)=>{const i=yl(t,n);return i!==void 0?i:yl(e,n)},_y=(t,e,n)=>{for(const i in e)i!=="__proto__"&&i!=="constructor"&&(i in t?Le(t[i])||t[i]instanceof String||Le(e[i])||e[i]instanceof String?n&&(t[i]=e[i]):_y(t[i],e[i],n):t[i]=e[i]);return t},hi=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Fb={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Mb=t=>Le(t)?t.replace(/[&<>"'\/]/g,e=>Fb[e]):t;class Db{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}const $b=[" ",",","?","!",";"],zb=new Db(20),Ub=(t,e,n)=>{e=e||"",n=n||"";const i=$b.filter(c=>e.indexOf(c)<0&&n.indexOf(c)<0);if(i.length===0)return!0;const o=zb.getRegExp(`(${i.map(c=>c==="?"?"\\?":c).join("|")})`);let l=!o.test(t);if(!l){const c=t.indexOf(n);c>0&&!o.test(t.substring(0,c))&&(l=!0)}return l},dd=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const i=e.split(n);let o=t;for(let l=0;l-1&&ht&&t.replace("_","-"),Vb={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class xl{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||Vb,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),i=0;i{this.observers[i]||(this.observers[i]=new Map);const o=this.observers[i].get(n)||0;this.observers[i].set(n,o+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o{let[f,h]=c;for(let g=0;g{let[f,h]=c;for(let g=0;g1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const l=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,c=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let f;e.indexOf(".")>-1?f=e.split("."):(f=[e,n],i&&(Array.isArray(i)?f.push(...i):Le(i)&&l?f.push(...i.split(l)):f.push(i)));const h=yl(this.data,f);return!h&&!n&&!i&&e.indexOf(".")>-1&&(e=f[0],n=f[1],i=f.slice(2).join(".")),h||!c||!Le(i)?h:dd(this.data&&this.data[e]&&this.data[e][n],i,l)}addResource(e,n,i,o){let l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const c=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let f=[e,n];i&&(f=f.concat(c?i.split(c):i)),e.indexOf(".")>-1&&(f=e.split("."),o=n,n=f[1]),this.addNamespaces(n),Rm(this.data,f,o),l.silent||this.emit("added",e,n,i,o)}addResources(e,n,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const l in i)(Le(i[l])||Array.isArray(i[l]))&&this.addResource(e,n,l,i[l],{silent:!0});o.silent||this.emit("added",e,n,i)}addResourceBundle(e,n,i,o,l){let c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},f=[e,n];e.indexOf(".")>-1&&(f=e.split("."),o=i,i=n,n=f[1]),this.addNamespaces(n);let h=yl(this.data,f)||{};c.skipCopy||(i=JSON.parse(JSON.stringify(i))),o?_y(h,i,l):h={...h,...i},Rm(this.data,f,h),c.silent||this.emit("added",e,n,i)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,n)}:this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var ky={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,i,o){return t.forEach(l=>{this.processors[l]&&(e=this.processors[l].process(e,n,i,o))}),e}};const Lm={};class wl extends $l{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Tb(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=on.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const i=this.resolve(e,n);return i&&i.res!==void 0}extractFromKey(e,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let l=n.ns||this.options.defaultNS||[];const c=i&&e.indexOf(i)>-1,f=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Ub(e,i,o);if(c&&!f){const h=e.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:e,namespaces:Le(l)?[l]:l};const g=e.split(i);(i!==o||i===o&&this.options.ns.indexOf(g[0])>-1)&&(l=g.shift()),e=g.join(o)}return{key:e,namespaces:Le(l)?[l]:l}}translate(e,n,i){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const o=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,l=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:c,namespaces:f}=this.extractFromKey(e[e.length-1],n),h=f[f.length-1],g=n.lng||this.language,y=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&g.toLowerCase()==="cimode"){if(y){const M=n.nsSeparator||this.options.nsSeparator;return o?{res:`${h}${M}${c}`,usedKey:c,exactUsedKey:c,usedLng:g,usedNS:h,usedParams:this.getUsedParamsDetails(n)}:`${h}${M}${c}`}return o?{res:c,usedKey:c,exactUsedKey:c,usedLng:g,usedNS:h,usedParams:this.getUsedParamsDetails(n)}:c}const v=this.resolve(e,n);let w=v&&v.res;const x=v&&v.usedKey||c,j=v&&v.exactUsedKey||c,_=Object.prototype.toString.apply(w),S=["[object Number]","[object Function]","[object RegExp]"],I=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,z=!Le(w)&&typeof w!="boolean"&&typeof w!="number";if(E&&w&&z&&S.indexOf(_)<0&&!(Le(I)&&Array.isArray(w))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const M=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,w,{...n,ns:f}):`key '${c} (${this.language})' returned an object instead of string.`;return o?(v.res=M,v.usedParams=this.getUsedParamsDetails(n),v):M}if(l){const M=Array.isArray(w),L=M?[]:{},Q=M?j:x;for(const le in w)if(Object.prototype.hasOwnProperty.call(w,le)){const ue=`${Q}${l}${le}`;L[le]=this.translate(ue,{...n,joinArrays:!1,ns:f}),L[le]===ue&&(L[le]=w[le])}w=L}}else if(E&&Le(I)&&Array.isArray(w))w=w.join(I),w&&(w=this.extendTranslation(w,e,n,i));else{let M=!1,L=!1;const Q=n.count!==void 0&&!Le(n.count),le=wl.hasDefaultValue(n),ue=Q?this.pluralResolver.getSuffix(g,n.count,n):"",pe=n.ordinal&&Q?this.pluralResolver.getSuffix(g,n.count,{ordinal:!1}):"",_e=Q&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),Oe=_e&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${ue}`]||n[`defaultValue${pe}`]||n.defaultValue;!this.isValidLookup(w)&&le&&(M=!0,w=Oe),this.isValidLookup(w)||(L=!0,w=c);const me=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:w,he=le&&Oe!==w&&this.options.updateMissing;if(L||M||he){if(this.logger.log(he?"updateKey":"missingKey",g,h,c,he?Oe:w),l){const V=this.resolve(c,{...n,keySeparator:!1});V&&V.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let T=[];const P=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&P&&P[0])for(let V=0;V{const O=le&&W!==w?W:me;this.options.missingKeyHandler?this.options.missingKeyHandler(V,h,H,O,he,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(V,h,H,O,he,n),this.emit("missingKey",V,h,H,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&Q?T.forEach(V=>{const H=this.pluralResolver.getSuffixes(V,n);_e&&n[`defaultValue${this.options.pluralSeparator}zero`]&&H.indexOf(`${this.options.pluralSeparator}zero`)<0&&H.push(`${this.options.pluralSeparator}zero`),H.forEach(W=>{K([V],c+W,n[`defaultValue${W}`]||Oe)})}):K(T,c,Oe))}w=this.extendTranslation(w,e,n,v,i),L&&w===c&&this.options.appendNamespaceToMissingKey&&(w=`${h}:${c}`),(L||M)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}:${c}`:c,M?w:void 0):w=this.options.parseMissingKeyHandler(w))}return o?(v.res=w,v.usedParams=this.getUsedParamsDetails(n),v):w}extendTranslation(e,n,i,o,l){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const g=Le(e)&&(i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let y;if(g){const w=e.match(this.interpolator.nestingRegexp);y=w&&w.length}let v=i.replace&&!Le(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),e=this.interpolator.interpolate(e,v,i.lng||this.language||o.usedLng,i),g){const w=e.match(this.interpolator.nestingRegexp),x=w&&w.length;y1&&arguments[1]!==void 0?arguments[1]:{},i,o,l,c,f;return Le(e)&&(e=[e]),e.forEach(h=>{if(this.isValidLookup(i))return;const g=this.extractFromKey(h,n),y=g.key;o=y;let v=g.namespaces;this.options.fallbackNS&&(v=v.concat(this.options.fallbackNS));const w=n.count!==void 0&&!Le(n.count),x=w&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),j=n.context!==void 0&&(Le(n.context)||typeof n.context=="number")&&n.context!=="",_=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);v.forEach(S=>{this.isValidLookup(i)||(f=S,!Lm[`${_[0]}-${S}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(f)&&(Lm[`${_[0]}-${S}`]=!0,this.logger.warn(`key "${o}" for languages "${_.join(", ")}" won't get resolved as namespace "${f}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),_.forEach(I=>{if(this.isValidLookup(i))return;c=I;const E=[y];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(E,y,I,S,n);else{let M;w&&(M=this.pluralResolver.getSuffix(I,n.count,n));const L=`${this.options.pluralSeparator}zero`,Q=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(w&&(E.push(y+M),n.ordinal&&M.indexOf(Q)===0&&E.push(y+M.replace(Q,this.options.pluralSeparator)),x&&E.push(y+L)),j){const le=`${y}${this.options.contextSeparator}${n.context}`;E.push(le),w&&(E.push(le+M),n.ordinal&&M.indexOf(Q)===0&&E.push(le+M.replace(Q,this.options.pluralSeparator)),x&&E.push(le+L))}}let z;for(;z=E.pop();)this.isValidLookup(i)||(l=z,i=this.getResource(I,S,z,n))}))})}),{res:i,usedKey:o,exactUsedKey:l,usedLng:c,usedNS:f}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,i,o):this.resourceStore.getResource(e,n,i,o)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&!Le(e.replace);let o=i?e.replace:e;if(i&&typeof e.count<"u"&&(o.count=e.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!i){o={...o};for(const l of n)delete o[l]}return o}static hasDefaultValue(e){const n="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&n===i.substring(0,n.length)&&e[i]!==void 0)return!0;return!1}}const Dc=t=>t.charAt(0).toUpperCase()+t.slice(1);class Am{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=on.create("languageUtils")}getScriptPartFromCode(e){if(e=vl(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=vl(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(Le(e)&&e.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let o=Intl.getCanonicalLocales(e)[0];if(o&&this.options.lowerCaseLng&&(o=o.toLowerCase()),o)return o}catch{}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let i=e.split("-");return this.options.lowerCaseLng?i=i.map(o=>o.toLowerCase()):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=Dc(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=Dc(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=Dc(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(i=>{if(n)return;const o=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&e.forEach(i=>{if(n)return;const o=this.getLanguagePartFromCode(i);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(l=>{if(l===o)return l;if(!(l.indexOf("-")<0&&o.indexOf("-")<0)&&(l.indexOf("-")>0&&o.indexOf("-")<0&&l.substring(0,l.indexOf("-"))===o||l.indexOf(o)===0&&o.length>1))return l})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),Le(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let i=e[n];return i||(i=e[this.getScriptPartFromCode(n)]),i||(i=e[this.formatLanguageCode(n)]),i||(i=e[this.getLanguagePartFromCode(n)]),i||(i=e.default),i||[]}toResolveHierarchy(e,n){const i=this.getFallbackCodes(n||this.options.fallbackLng||[],e),o=[],l=c=>{c&&(this.isSupportedCode(c)?o.push(c):this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`))};return Le(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&l(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&l(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&l(this.getLanguagePartFromCode(e))):Le(e)&&l(this.formatLanguageCode(e)),i.forEach(c=>{o.indexOf(c)<0&&l(this.formatLanguageCode(c))}),o}}let Bb=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Hb={1:t=>+(t>1),2:t=>+(t!=1),3:t=>0,4:t=>t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,5:t=>t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5,6:t=>t==1?0:t>=2&&t<=4?1:2,7:t=>t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,8:t=>t==1?0:t==2?1:t!=8&&t!=11?2:3,9:t=>+(t>=2),10:t=>t==1?0:t==2?1:t<7?2:t<11?3:4,11:t=>t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3,12:t=>+(t%10!=1||t%100==11),13:t=>+(t!==0),14:t=>t==1?0:t==2?1:t==3?2:3,15:t=>t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2,16:t=>t%10==1&&t%100!=11?0:t!==0?1:2,17:t=>t==1||t%10==1&&t%100!=11?0:1,18:t=>t==0?0:t==1?1:2,19:t=>t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3,20:t=>t==1?0:t==0||t%100>0&&t%100<20?1:2,21:t=>t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0,22:t=>t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3};const qb=["v1","v2","v3"],Wb=["v4"],Im={zero:0,one:1,two:2,few:3,many:4,other:5},Qb=()=>{const t={};return Bb.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:Hb[e.fc]}})}),t};class Kb{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=on.create("pluralResolver"),(!this.options.compatibilityJSON||Wb.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Qb(),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const i=vl(e==="dev"?"en":e),o=n.ordinal?"ordinal":"cardinal",l=JSON.stringify({cleanedCode:i,type:o});if(l in this.pluralRulesCache)return this.pluralRulesCache[l];let c;try{c=new Intl.PluralRules(i,{type:o})}catch{if(!e.match(/-|_/))return;const h=this.languageUtils.getLanguagePartFromCode(e);c=this.getRule(h,n)}return this.pluralRulesCache[l]=c,c}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=this.getRule(e,n);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}getPluralFormsOfKey(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,i).map(o=>`${n}${o}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=this.getRule(e,n);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort((o,l)=>Im[o]-Im[l]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):i.numbers.map(o=>this.getSuffix(e,o,n)):[]}getSuffix(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(e,i);return o?this.shouldUseIntlApi()?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:this.getSuffixRetroCompatible(o,n):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,n){const i=e.noAbs?e.plurals(n):e.plurals(Math.abs(n));let o=e.numbers[i];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const l=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:l():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?l():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}shouldUseIntlApi(){return!qb.includes(this.options.compatibilityJSON)}}const Fm=function(t,e,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,l=Ib(t,e,n);return!l&&o&&Le(n)&&(l=dd(t,n,i),l===void 0&&(l=dd(e,n,i))),l},$c=t=>t.replace(/\$/g,"$$$$");class Zb{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=on.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:o,prefix:l,prefixEscaped:c,suffix:f,suffixEscaped:h,formatSeparator:g,unescapeSuffix:y,unescapePrefix:v,nestingPrefix:w,nestingPrefixEscaped:x,nestingSuffix:j,nestingSuffixEscaped:_,nestingOptionsSeparator:S,maxReplaces:I,alwaysFormat:E}=e.interpolation;this.escape=n!==void 0?n:Mb,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=l?hi(l):c||"{{",this.suffix=f?hi(f):h||"}}",this.formatSeparator=g||",",this.unescapePrefix=y?"":v||"-",this.unescapeSuffix=this.unescapePrefix?"":y||"",this.nestingPrefix=w?hi(w):x||hi("$t("),this.nestingSuffix=j?hi(j):_||hi(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=I||1e3,this.alwaysFormat=E!==void 0?E:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,i)=>n&&n.source===i?(n.lastIndex=0,n):new RegExp(i,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,i,o){let l,c,f;const h=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},g=x=>{if(x.indexOf(this.formatSeparator)<0){const I=Fm(n,h,x,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(I,void 0,i,{...o,...n,interpolationkey:x}):I}const j=x.split(this.formatSeparator),_=j.shift().trim(),S=j.join(this.formatSeparator).trim();return this.format(Fm(n,h,_,this.options.keySeparator,this.options.ignoreJSONStructure),S,i,{...o,...n,interpolationkey:_})};this.resetRegExp();const y=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,v=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:x=>$c(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?$c(this.escape(x)):$c(x)}].forEach(x=>{for(f=0;l=x.regex.exec(e);){const j=l[1].trim();if(c=g(j),c===void 0)if(typeof y=="function"){const S=y(e,l,o);c=Le(S)?S:""}else if(o&&Object.prototype.hasOwnProperty.call(o,j))c="";else if(v){c=l[0];continue}else this.logger.warn(`missed to pass in variable ${j} for interpolating ${e}`),c="";else!Le(c)&&!this.useRawValueToEscape&&(c=Nm(c));const _=x.safeValue(c);if(e=e.replace(l[0],_),v?(x.regex.lastIndex+=c.length,x.regex.lastIndex-=l[0].length):x.regex.lastIndex=0,f++,f>=this.maxReplaces)break}}),e}nest(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,l,c;const f=(h,g)=>{const y=this.nestingOptionsSeparator;if(h.indexOf(y)<0)return h;const v=h.split(new RegExp(`${y}[ ]*{`));let w=`{${v[1]}`;h=v[0],w=this.interpolate(w,c);const x=w.match(/'/g),j=w.match(/"/g);(x&&x.length%2===0&&!j||j.length%2!==0)&&(w=w.replace(/'/g,'"'));try{c=JSON.parse(w),g&&(c={...g,...c})}catch(_){return this.logger.warn(`failed parsing options string in nesting for key ${h}`,_),`${h}${y}${w}`}return c.defaultValue&&c.defaultValue.indexOf(this.prefix)>-1&&delete c.defaultValue,h};for(;o=this.nestingRegexp.exec(e);){let h=[];c={...i},c=c.replace&&!Le(c.replace)?c.replace:c,c.applyPostProcessor=!1,delete c.defaultValue;let g=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const y=o[1].split(this.formatSeparator).map(v=>v.trim());o[1]=y.shift(),h=y,g=!0}if(l=n(f.call(this,o[1].trim(),c),c),l&&o[0]===e&&!Le(l))return l;Le(l)||(l=Nm(l)),l||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),l=""),g&&(l=h.reduce((y,v)=>this.format(y,v,i.lng,{...i,interpolationkey:o[1].trim()}),l.trim())),e=e.replace(o[0],l),this.regexp.lastIndex=0}return e}}const Gb=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const i=t.split("(");e=i[0].toLowerCase().trim();const o=i[1].substring(0,i[1].length-1);e==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):e==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(c=>{if(c){const[f,...h]=c.split(":"),g=h.join(":").trim().replace(/^'+|'+$/g,""),y=f.trim();n[y]||(n[y]=g),g==="false"&&(n[y]=!1),g==="true"&&(n[y]=!0),isNaN(g)||(n[y]=parseInt(g,10))}})}return{formatName:e,formatOptions:n}},pi=t=>{const e={};return(n,i,o)=>{let l=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(l={...l,[o.interpolationkey]:void 0});const c=i+JSON.stringify(l);let f=e[c];return f||(f=t(vl(i),o),e[c]=f),f(n)}};class Jb{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=on.create("formatter"),this.options=e,this.formats={number:pi((n,i)=>{const o=new Intl.NumberFormat(n,{...i});return l=>o.format(l)}),currency:pi((n,i)=>{const o=new Intl.NumberFormat(n,{...i,style:"currency"});return l=>o.format(l)}),datetime:pi((n,i)=>{const o=new Intl.DateTimeFormat(n,{...i});return l=>o.format(l)}),relativetime:pi((n,i)=>{const o=new Intl.RelativeTimeFormat(n,{...i});return l=>o.format(l,i.range||"day")}),list:pi((n,i)=>{const o=new Intl.ListFormat(n,{...i});return l=>o.format(l)})},this.init(e)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=pi(n)}format(e,n,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const l=n.split(this.formatSeparator);if(l.length>1&&l[0].indexOf("(")>1&&l[0].indexOf(")")<0&&l.find(f=>f.indexOf(")")>-1)){const f=l.findIndex(h=>h.indexOf(")")>-1);l[0]=[l[0],...l.splice(1,f)].join(this.formatSeparator)}return l.reduce((f,h)=>{const{formatName:g,formatOptions:y}=Gb(h);if(this.formats[g]){let v=f;try{const w=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},x=w.locale||w.lng||o.locale||o.lng||i;v=this.formats[g](f,x,{...y,...o,...w})}catch(w){this.logger.warn(w)}return v}else this.logger.warn(`there was no format function for ${g}`);return f},e)}}const Yb=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class Xb extends $l{constructor(e,n,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=o,this.logger=on.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(i,o.backend,o)}queueLoad(e,n,i,o){const l={},c={},f={},h={};return e.forEach(g=>{let y=!0;n.forEach(v=>{const w=`${g}|${v}`;!i.reload&&this.store.hasResourceBundle(g,v)?this.state[w]=2:this.state[w]<0||(this.state[w]===1?c[w]===void 0&&(c[w]=!0):(this.state[w]=1,y=!1,c[w]===void 0&&(c[w]=!0),l[w]===void 0&&(l[w]=!0),h[v]===void 0&&(h[v]=!0)))}),y||(f[g]=!0)}),(Object.keys(l).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(l),pending:Object.keys(c),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(h)}}loaded(e,n,i){const o=e.split("|"),l=o[0],c=o[1];n&&this.emit("failedLoading",l,c,n),!n&&i&&this.store.addResourceBundle(l,c,i,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&i&&(this.state[e]=0);const f={};this.queue.forEach(h=>{Ab(h.loaded,[l],c),Yb(h,e),n&&h.errors.push(n),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(g=>{f[g]||(f[g]={});const y=h.loaded[g];y.length&&y.forEach(v=>{f[g][v]===void 0&&(f[g][v]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(h=>!h.done)}read(e,n,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,c=arguments.length>5?arguments[5]:void 0;if(!e.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:i,tried:o,wait:l,callback:c});return}this.readingCalls++;const f=(g,y)=>{if(this.readingCalls--,this.waitingReads.length>0){const v=this.waitingReads.shift();this.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(g&&y&&o{this.read.call(this,e,n,i,o+1,l*2,c)},l);return}c(g,y)},h=this.backend[i].bind(this.backend);if(h.length===2){try{const g=h(e,n);g&&typeof g.then=="function"?g.then(y=>f(null,y)).catch(f):f(null,g)}catch(g){f(g)}return}return h(e,n,f)}prepareLoading(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();Le(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Le(n)&&(n=[n]);const l=this.queueLoad(e,n,i,o);if(!l.toLoad.length)return l.pending.length||o(),null;l.toLoad.forEach(c=>{this.loadOne(c)})}load(e,n,i){this.prepareLoading(e,n,{},i)}reload(e,n,i){this.prepareLoading(e,n,{reload:!0},i)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const i=e.split("|"),o=i[0],l=i[1];this.read(o,l,"read",void 0,void 0,(c,f)=>{c&&this.logger.warn(`${n}loading namespace ${l} for language ${o} failed`,c),!c&&f&&this.logger.log(`${n}loaded namespace ${l} for language ${o}`,f),this.loaded(e,c,f)})}saveMissing(e,n,i,o,l){let c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},f=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend&&this.backend.create){const h={...c,isUpdate:l},g=this.backend.create.bind(this.backend);if(g.length<6)try{let y;g.length===5?y=g(e,n,i,o,h):y=g(e,n,i,o),y&&typeof y.then=="function"?y.then(v=>f(null,v)).catch(f):f(null,y)}catch(y){f(y)}else g(e,n,i,o,f,h)}!e||!e[0]||this.store.addResource(e[0],n,i,o)}}}const Mm=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),Le(t[1])&&(e.defaultValue=t[1]),Le(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(i=>{e[i]=n[i]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Dm=t=>(Le(t.ns)&&(t.ns=[t.ns]),Le(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),Le(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),ll=()=>{},eS=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class Ma extends $l{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Dm(e),this.services={},this.logger=on,this.modules={external:[]},eS(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(i=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(Le(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=Mm();this.options={...o,...this.options,...Dm(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...o.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const l=y=>y?typeof y=="function"?new y:y:null;if(!this.options.isClone){this.modules.logger?on.init(l(this.modules.logger),this.options):on.init(null,this.options);let y;this.modules.formatter?y=this.modules.formatter:typeof Intl<"u"&&(y=Jb);const v=new Am(this.options);this.store=new Tm(this.options.resources,this.options);const w=this.services;w.logger=on,w.resourceStore=this.store,w.languageUtils=v,w.pluralResolver=new Kb(v,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),y&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(w.formatter=l(y),w.formatter.init(w,this.options),this.options.interpolation.format=w.formatter.format.bind(w.formatter)),w.interpolator=new Zb(this.options),w.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},w.backendConnector=new Xb(l(this.modules.backend),w.resourceStore,w,this.options),w.backendConnector.on("*",function(x){for(var j=arguments.length,_=new Array(j>1?j-1:0),S=1;S1?j-1:0),S=1;S{x.init&&x.init(this)})}if(this.format=this.options.interpolation.format,i||(i=ll),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const y=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);y.length>0&&y[0]!=="dev"&&(this.options.lng=y[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(y=>{this[y]=function(){return e.store[y](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(y=>{this[y]=function(){return e.store[y](...arguments),e}});const h=xa(),g=()=>{const y=(v,w)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),h.resolve(w),i(v,w)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return y(null,this.t.bind(this));this.changeLanguage(this.options.lng,y)};return this.options.resources||!this.options.initImmediate?g():setTimeout(g,0),h}loadResources(e){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ll;const o=Le(e)?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],c=f=>{if(!f||f==="cimode")return;this.services.languageUtils.toResolveHierarchy(f).forEach(g=>{g!=="cimode"&&l.indexOf(g)<0&&l.push(g)})};o?c(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(h=>c(h)),this.options.preload&&this.options.preload.forEach(f=>c(f)),this.services.backendConnector.load(l,this.options.ns,f=>{!f&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(f)})}else i(null)}reloadResources(e,n,i){const o=xa();return typeof e=="function"&&(i=e,e=void 0),typeof n=="function"&&(i=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),i||(i=ll),this.services.backendConnector.reload(e,n,l=>{o.resolve(),i(l)}),o}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&ky.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}changeLanguage(e,n){var i=this;this.isLanguageChangingTo=e;const o=xa();this.emit("languageChanging",e);const l=h=>{this.language=h,this.languages=this.services.languageUtils.toResolveHierarchy(h),this.resolvedLanguage=void 0,this.setResolvedLanguage(h)},c=(h,g)=>{g?(l(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,o.resolve(function(){return i.t(...arguments)}),n&&n(h,function(){return i.t(...arguments)})},f=h=>{!e&&!h&&this.services.languageDetector&&(h=[]);const g=Le(h)?h:this.services.languageUtils.getBestMatchFromCodes(h);g&&(this.language||l(g),this.translator.language||this.translator.changeLanguage(g),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(g)),this.loadResources(g,y=>{c(y,g)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(f):this.services.languageDetector.detect(f):f(e),o}getFixedT(e,n,i){var o=this;const l=function(c,f){let h;if(typeof f!="object"){for(var g=arguments.length,y=new Array(g>2?g-2:0),v=2;v`${h.keyPrefix}${w}${j}`):x=h.keyPrefix?`${h.keyPrefix}${w}${c}`:c,o.t(x,h)};return Le(e)?l.lng=e:l.lngs=e,l.ns=n,l.keyPrefix=i,l}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,l=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const c=(f,h)=>{const g=this.services.backendConnector.state[`${f}|${h}`];return g===-1||g===0||g===2};if(n.precheck){const f=n.precheck(this,c);if(f!==void 0)return f}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(i,e)&&(!o||c(l,e)))}loadNamespaces(e,n){const i=xa();return this.options.ns?(Le(e)&&(e=[e]),e.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{i.resolve(),n&&n(o)}),i):(n&&n(),Promise.resolve())}loadLanguages(e,n){const i=xa();Le(e)&&(e=[e]);const o=this.options.preload||[],l=e.filter(c=>o.indexOf(c)<0&&this.services.languageUtils.isSupportedCode(c));return l.length?(this.options.preload=o.concat(l),this.loadResources(c=>{i.resolve(),n&&n(c)}),i):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services&&this.services.languageUtils||new Am(Mm());return n.indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Ma(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ll;const i=e.forkResourceStore;i&&delete e.forkResourceStore;const o={...this.options,...e,isClone:!0},l=new Ma(o);return(e.debug!==void 0||e.prefix!==void 0)&&(l.logger=l.logger.clone(e)),["store","services","language"].forEach(f=>{l[f]=this[f]}),l.services={...this.services},l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},i&&(l.store=new Tm(this.store.data,o),l.services.resourceStore=l.store),l.translator=new wl(l.services,o),l.translator.on("*",function(f){for(var h=arguments.length,g=new Array(h>1?h-1:0),y=1;y()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}};function zm(t,e,n){t.loadNamespaces(e,jy(t,n))}function Um(t,e,n,i){typeof n=="string"&&(n=[n]),n.forEach(o=>{t.options.ns.indexOf(o)<0&&t.options.ns.push(o)}),t.loadLanguages(e,jy(t,i))}function rS(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=e.languages[0],o=e.options?e.options.fallbackLng:!1,l=e.languages[e.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const c=(f,h)=>{const g=e.services.backendConnector.state[`${f}|${h}`];return g===-1||g===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!c(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(i,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||c(i,t)&&(!o||c(l,t)))}function nS(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(fd("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(t,{lng:n.lng,precheck:(o,l)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!l(o.isLanguageChangingTo,t))return!1}}):rS(t,e,n)}const sS=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,iS={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},aS=t=>iS[t],oS=t=>t.replace(sS,aS);let hd={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:oS};function lS(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};hd={...hd,...t}}function uS(){return hd}let Cy;function cS(t){Cy=t}function dS(){return Cy}const fS={type:"3rdParty",init(t){lS(t.options.react),cS(t)}},hS=B.createContext();class pS{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const mS=(t,e)=>{const n=B.useRef();return B.useEffect(()=>{n.current=t},[t,e]),n.current};function xs(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=e,{i18n:i,defaultNS:o}=B.useContext(hS)||{},l=n||i||dS();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new pS),!l){fd("You will need to pass in an i18next instance by using initReactI18next");const z=(L,Q)=>typeof Q=="string"?Q:Q&&typeof Q=="object"&&typeof Q.defaultValue=="string"?Q.defaultValue:Array.isArray(L)?L[L.length-1]:L,M=[z,{},!1];return M.t=z,M.i18n={},M.ready=!1,M}l.options.react&&l.options.react.wait!==void 0&&fd("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const c={...uS(),...l.options.react,...e},{useSuspense:f,keyPrefix:h}=c;let g=o||l.options&&l.options.defaultNS;g=typeof g=="string"?[g]:g||["translation"],l.reportNamespaces.addUsedNamespaces&&l.reportNamespaces.addUsedNamespaces(g);const y=(l.isInitialized||l.initializedStoreOnce)&&g.every(z=>nS(z,l,c));function v(){return l.getFixedT(e.lng||null,c.nsMode==="fallback"?g:g[0],h)}const[w,x]=B.useState(v);let j=g.join();e.lng&&(j=`${e.lng}${j}`);const _=mS(j),S=B.useRef(!0);B.useEffect(()=>{const{bindI18n:z,bindI18nStore:M}=c;S.current=!0,!y&&!f&&(e.lng?Um(l,e.lng,g,()=>{S.current&&x(v)}):zm(l,g,()=>{S.current&&x(v)})),y&&_&&_!==j&&S.current&&x(v);function L(){S.current&&x(v)}return z&&l&&l.on(z,L),M&&l&&l.store.on(M,L),()=>{S.current=!1,z&&l&&z.split(" ").forEach(Q=>l.off(Q,L)),M&&l&&M.split(" ").forEach(Q=>l.store.off(Q,L))}},[l,j]);const I=B.useRef(!0);B.useEffect(()=>{S.current&&!I.current&&x(v),I.current=!1},[l,h]);const E=[w,l,y];if(E.t=w,E.i18n=l,E.ready=y,y||!y&&!f)return E;throw new Promise(z=>{e.lng?Um(l,e.lng,g,()=>z()):zm(l,g,()=>z())})}function gS(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Da(t){"@babel/helpers - typeof";return Da=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Da(t)}function yS(t,e){if(Da(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(Da(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Ey(t){var e=yS(t,"string");return Da(e)=="symbol"?e:e+""}function vS(t,e){for(var n=0;n0){var f=o.maxAge-0;if(Number.isNaN(f))throw new Error("maxAge should be a Number");c+="; Max-Age=".concat(Math.floor(f))}if(o.domain){if(!Vm.test(o.domain))throw new TypeError("option domain is invalid");c+="; Domain=".concat(o.domain)}if(o.path){if(!Vm.test(o.path))throw new TypeError("option path is invalid");c+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");c+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(c+="; HttpOnly"),o.secure&&(c+="; Secure"),o.sameSite){var h=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(h){case!0:c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"strict":c+="; SameSite=Strict";break;case"none":c+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return c},Bm={create:function(e,n,i,o){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};i&&(l.expires=new Date,l.expires.setTime(l.expires.getTime()+i*60*1e3)),o&&(l.domain=o),document.cookie=_S(e,encodeURIComponent(n),l)},read:function(e){for(var n="".concat(e,"="),i=document.cookie.split(";"),o=0;o-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=i.substring(1),l=o.split("&"),c=0;c0){var h=l[c].substring(0,f);h===e.lookupQuerystring&&(n=l[c].substring(f+1))}}}return n}},wa=null,Hm=function(){if(wa!==null)return wa;try{wa=window!=="undefined"&&window.localStorage!==null;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{wa=!1}return wa},CS={name:"localStorage",lookup:function(e){var n;if(e.lookupLocalStorage&&Hm()){var i=window.localStorage.getItem(e.lookupLocalStorage);i&&(n=i)}return n},cacheUserLanguage:function(e,n){n.lookupLocalStorage&&Hm()&&window.localStorage.setItem(n.lookupLocalStorage,e)}},ba=null,qm=function(){if(ba!==null)return ba;try{ba=window!=="undefined"&&window.sessionStorage!==null;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{ba=!1}return ba},ES={name:"sessionStorage",lookup:function(e){var n;if(e.lookupSessionStorage&&qm()){var i=window.sessionStorage.getItem(e.lookupSessionStorage);i&&(n=i)}return n},cacheUserLanguage:function(e,n){n.lookupSessionStorage&&qm()&&window.sessionStorage.setItem(n.lookupSessionStorage,e)}},NS={name:"navigator",lookup:function(e){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var i=0;i0?n:void 0}},PS={name:"htmlTag",lookup:function(e){var n,i=e.htmlTag||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(n=i.getAttribute("lang")),n}},OS={name:"path",lookup:function(e){var n;if(typeof window<"u"){var i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(i instanceof Array)if(typeof e.lookupFromPathIndex=="number"){if(typeof i[e.lookupFromPathIndex]!="string")return;n=i[e.lookupFromPathIndex].replace("/","")}else n=i[0].replace("/","")}return n}},RS={name:"subdomain",lookup:function(e){var n=typeof e.lookupFromSubdomainIndex=="number"?e.lookupFromSubdomainIndex+1:1,i=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[n]}},Py=!1;try{document.cookie,Py=!0}catch{}var Oy=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Py||Oy.splice(1,1);function TS(){return{order:Oy,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(e){return e}}}var Ry=(function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};gS(this,t),this.type="languageDetector",this.detectors={},this.init(e,n)}return xS(t,[{key:"init",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n||{languageUtils:{}},this.options=SS(i,this.options||{},TS()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(l){return l.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(kS),this.addDetector(jS),this.addDetector(CS),this.addDetector(ES),this.addDetector(NS),this.addDetector(PS),this.addDetector(OS),this.addDetector(RS)}},{key:"addDetector",value:function(n){return this.detectors[n.name]=n,this}},{key:"detect",value:function(n){var i=this;n||(n=this.options.order);var o=[];return n.forEach(function(l){if(i.detectors[l]){var c=i.detectors[l].lookup(i.options);c&&typeof c=="string"&&(c=[c]),c&&(o=o.concat(c))}}),o=o.map(function(l){return i.options.convertDetectedLanguage(l)}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(n,i){var o=this;i||(i=this.options.caches),i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||i.forEach(function(l){o.detectors[l]&&o.detectors[l].cacheUserLanguage(n,o.options)}))}}])})();Ry.type="languageDetector";function pd(t){"@babel/helpers - typeof";return pd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pd(t)}function Ty(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":pd(XMLHttpRequest))==="object"}function LS(t){return!!t&&typeof t.then=="function"}function AS(t){return LS(t)?t:Promise.resolve(t)}function IS(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ul={exports:{}},cl={exports:{}},Wm;function FS(){return Wm||(Wm=1,(function(t,e){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Na<"u"&&Na,i=(function(){function l(){this.fetch=!1,this.DOMException=n.DOMException}return l.prototype=n,new l})();(function(l){(function(c){var f=typeof l<"u"&&l||typeof self<"u"&&self||typeof f<"u"&&f,h={searchParams:"URLSearchParams"in f,iterable:"Symbol"in f&&"iterator"in Symbol,blob:"FileReader"in f&&"Blob"in f&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in f,arrayBuffer:"ArrayBuffer"in f};function g(T){return T&&DataView.prototype.isPrototypeOf(T)}if(h.arrayBuffer)var y=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=ArrayBuffer.isView||function(T){return T&&y.indexOf(Object.prototype.toString.call(T))>-1};function w(T){if(typeof T!="string"&&(T=String(T)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(T)||T==="")throw new TypeError('Invalid character in header field name: "'+T+'"');return T.toLowerCase()}function x(T){return typeof T!="string"&&(T=String(T)),T}function j(T){var P={next:function(){var K=T.shift();return{done:K===void 0,value:K}}};return h.iterable&&(P[Symbol.iterator]=function(){return P}),P}function _(T){this.map={},T instanceof _?T.forEach(function(P,K){this.append(K,P)},this):Array.isArray(T)?T.forEach(function(P){this.append(P[0],P[1])},this):T&&Object.getOwnPropertyNames(T).forEach(function(P){this.append(P,T[P])},this)}_.prototype.append=function(T,P){T=w(T),P=x(P);var K=this.map[T];this.map[T]=K?K+", "+P:P},_.prototype.delete=function(T){delete this.map[w(T)]},_.prototype.get=function(T){return T=w(T),this.has(T)?this.map[T]:null},_.prototype.has=function(T){return this.map.hasOwnProperty(w(T))},_.prototype.set=function(T,P){this.map[w(T)]=x(P)},_.prototype.forEach=function(T,P){for(var K in this.map)this.map.hasOwnProperty(K)&&T.call(P,this.map[K],K,this)},_.prototype.keys=function(){var T=[];return this.forEach(function(P,K){T.push(K)}),j(T)},_.prototype.values=function(){var T=[];return this.forEach(function(P){T.push(P)}),j(T)},_.prototype.entries=function(){var T=[];return this.forEach(function(P,K){T.push([K,P])}),j(T)},h.iterable&&(_.prototype[Symbol.iterator]=_.prototype.entries);function S(T){if(T.bodyUsed)return Promise.reject(new TypeError("Already read"));T.bodyUsed=!0}function I(T){return new Promise(function(P,K){T.onload=function(){P(T.result)},T.onerror=function(){K(T.error)}})}function E(T){var P=new FileReader,K=I(P);return P.readAsArrayBuffer(T),K}function z(T){var P=new FileReader,K=I(P);return P.readAsText(T),K}function M(T){for(var P=new Uint8Array(T),K=new Array(P.length),V=0;V-1?P:T}function pe(T,P){if(!(this instanceof pe))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');P=P||{};var K=P.body;if(T instanceof pe){if(T.bodyUsed)throw new TypeError("Already read");this.url=T.url,this.credentials=T.credentials,P.headers||(this.headers=new _(T.headers)),this.method=T.method,this.mode=T.mode,this.signal=T.signal,!K&&T._bodyInit!=null&&(K=T._bodyInit,T.bodyUsed=!0)}else this.url=String(T);if(this.credentials=P.credentials||this.credentials||"same-origin",(P.headers||!this.headers)&&(this.headers=new _(P.headers)),this.method=ue(P.method||this.method||"GET"),this.mode=P.mode||this.mode||null,this.signal=P.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&K)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(K),(this.method==="GET"||this.method==="HEAD")&&(P.cache==="no-store"||P.cache==="no-cache")){var V=/([?&])_=[^&]*/;if(V.test(this.url))this.url=this.url.replace(V,"$1_="+new Date().getTime());else{var H=/\?/;this.url+=(H.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}pe.prototype.clone=function(){return new pe(this,{body:this._bodyInit})};function _e(T){var P=new FormData;return T.trim().split("&").forEach(function(K){if(K){var V=K.split("="),H=V.shift().replace(/\+/g," "),W=V.join("=").replace(/\+/g," ");P.append(decodeURIComponent(H),decodeURIComponent(W))}}),P}function Oe(T){var P=new _,K=T.replace(/\r?\n[\t ]+/g," ");return K.split("\r").map(function(V){return V.indexOf(` `)===0?V.substr(1,V.length):V}).forEach(function(V){var H=V.split(":"),W=H.shift().trim();if(W){var O=H.join(":").trim();P.append(W,O)}}),P}Q.call(pe.prototype);function Z(T,P){if(!(this instanceof Z))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');P||(P={}),this.type="default",this.status=P.status===void 0?200:P.status,this.ok=this.status>=200&&this.status<300,this.statusText=P.statusText===void 0?"":""+P.statusText,this.headers=new _(P.headers),this.url=P.url||"",this._initBody(T)}Q.call(Z.prototype),Z.prototype.clone=function(){return new Z(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new _(this.headers),url:this.url})},Z.error=function(){var T=new Z(null,{status:0,statusText:""});return T.type="error",T};var me=[301,302,303,307,308];Z.redirect=function(T,P){if(me.indexOf(P)===-1)throw new RangeError("Invalid status code");return new Z(null,{status:P,headers:{location:T}})},c.DOMException=f.DOMException;try{new c.DOMException}catch{c.DOMException=function(P,K){this.message=P,this.name=K;var V=Error(P);this.stack=V.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function he(T,P){return new Promise(function(K,V){var H=new pe(T,P);if(H.signal&&H.signal.aborted)return V(new c.DOMException("Aborted","AbortError"));var W=new XMLHttpRequest;function O(){W.abort()}W.onload=function(){var ae={status:W.status,statusText:W.statusText,headers:Oe(W.getAllResponseHeaders()||"")};ae.url="responseURL"in W?W.responseURL:ae.headers.get("X-Request-URL");var fe="response"in W?W.response:W.responseText;setTimeout(function(){K(new Z(fe,ae))},0)},W.onerror=function(){setTimeout(function(){V(new TypeError("Network request failed"))},0)},W.ontimeout=function(){setTimeout(function(){V(new TypeError("Network request failed"))},0)},W.onabort=function(){setTimeout(function(){V(new c.DOMException("Aborted","AbortError"))},0)};function q(ae){try{return ae===""&&f.location.href?f.location.href:ae}catch{return ae}}W.open(H.method,q(H.url),!0),H.credentials==="include"?W.withCredentials=!0:H.credentials==="omit"&&(W.withCredentials=!1),"responseType"in W&&(h.blob?W.responseType="blob":h.arrayBuffer&&H.headers.get("Content-Type")&&H.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(W.responseType="arraybuffer")),P&&typeof P.headers=="object"&&!(P.headers instanceof _)?Object.getOwnPropertyNames(P.headers).forEach(function(ae){W.setRequestHeader(ae,x(P.headers[ae]))}):H.headers.forEach(function(ae,fe){W.setRequestHeader(fe,ae)}),H.signal&&(H.signal.addEventListener("abort",O),W.onreadystatechange=function(){W.readyState===4&&H.signal.removeEventListener("abort",O)}),W.send(typeof H._bodyInit>"u"?null:H._bodyInit)})}return he.polyfill=!0,f.fetch||(f.fetch=he,f.Headers=_,f.Request=pe,f.Response=Z),c.Headers=_,c.Request=pe,c.Response=Z,c.fetch=he,c})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var o=n.fetch?n:i;e=o.fetch,e.default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,t.exports=e})(cl,cl.exports)),cl.exports}var Qm;function MS(){return Qm||(Qm=1,(function(t,e){var n=typeof fetch=="function"?fetch:void 0;if(typeof Na<"u"&&Na.fetch?n=Na.fetch:typeof window<"u"&&window.fetch&&(n=window.fetch),typeof IS<"u"&&typeof window>"u"){var i=n||FS();i.default&&(i=i.default),e.default=i,t.exports=e.default}})(ul,ul.exports)),ul.exports}var Ly=MS();const Ay=Il(Ly),Km=Qg({__proto__:null,default:Ay},[Ly]);function Zm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,i)}return n}function Gm(t){for(var e=1;e"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(l["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),i&&(l["Content-Type"]="application/json");var c=typeof e.requestOptions=="function"?e.requestOptions(i):e.requestOptions,f=Gm({method:i?"POST":"GET",body:i?e.stringify(i):void 0,headers:l},Ym?{}:c),h=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{Jm(n,f,o,h)}catch(g){if(!c||Object.keys(c).length===0||!g.message||g.message.indexOf("not implemented")<0)return o(g);try{Object.keys(c).forEach(function(y){delete f[y]}),Jm(n,f,o,h),Ym=!0}catch(y){o(y)}}},VS=function(e,n,i,o){i&&$s(i)==="object"&&(i=md("",i).slice(1)),e.queryStringParams&&(n=md(n,e.queryStringParams));try{var l;$a?l=new $a:l=new bl("MSXML2.XMLHTTP.3.0"),l.open(i?"POST":"GET",n,1),e.crossDomain||l.setRequestHeader("X-Requested-With","XMLHttpRequest"),l.withCredentials=!!e.withCredentials,i&&l.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),l.overrideMimeType&&l.overrideMimeType("application/json");var c=e.customHeaders;if(c=typeof c=="function"?c():c,c)for(var f in c)l.setRequestHeader(f,c[f]);l.onreadystatechange=function(){l.readyState>3&&o(l.status>=400?l.statusText:null,{status:l.status,data:l.responseText})},l.send(i)}catch(h){console&&console.log(h)}},BS=function(e,n,i,o){if(typeof i=="function"&&(o=i,i=void 0),o=o||function(){},hs&&n.indexOf("file:")!==0)return US(e,n,i,o);if(Ty()||typeof ActiveXObject=="function")return VS(e,n,i,o);o(new Error("No fetch and no xhr implementation found!"))};function _i(t){"@babel/helpers - typeof";return _i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_i(t)}function Xm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,i)}return n}function zc(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};HS(this,t),this.services=e,this.options=n,this.allOptions=i,this.type="backend",this.init(e,n,i)}return WS(t,[{key:"init",value:function(n){var i=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=zc(zc(zc({},KS()),this.options||{}),o),this.allOptions=l,this.services&&this.options.reloadInterval){var c=setInterval(function(){return i.reload()},this.options.reloadInterval);_i(c)==="object"&&typeof c.unref=="function"&&c.unref()}}},{key:"readMulti",value:function(n,i,o){this._readAny(n,n,i,i,o)}},{key:"read",value:function(n,i,o){this._readAny([n],n,[i],i,o)}},{key:"_readAny",value:function(n,i,o,l,c){var f=this,h=this.options.loadPath;typeof this.options.loadPath=="function"&&(h=this.options.loadPath(n,o)),h=AS(h),h.then(function(g){if(!g)return c(null,{});var y=f.services.interpolator.interpolate(g,{lng:n.join("+"),ns:o.join("+")});f.loadUrl(y,c,i,l)})}},{key:"loadUrl",value:function(n,i,o,l){var c=this,f=typeof o=="string"?[o]:o,h=typeof l=="string"?[l]:l,g=this.options.parseLoadPayload(f,h);this.options.request(this.options,n,g,function(y,v){if(v&&(v.status>=500&&v.status<600||!v.status))return i("failed loading "+n+"; status code: "+v.status,!0);if(v&&v.status>=400&&v.status<500)return i("failed loading "+n+"; status code: "+v.status,!1);if(!v&&y&&y.message){var w=y.message.toLowerCase(),x=["failed","fetch","network","load"].find(function(S){return w.indexOf(S)>-1});if(x)return i("failed loading "+n+": "+y.message,!0)}if(y)return i(y,!1);var j,_;try{typeof v.data=="string"?j=c.options.parse(v.data,o,l):j=v.data}catch{_="failed parsing "+n+" to json"}if(_)return i(_,!1);i(null,j)})}},{key:"create",value:function(n,i,o,l,c){var f=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var h=this.options.parsePayload(i,o,l),g=0,y=[],v=[];n.forEach(function(w){var x=f.options.addPath;typeof f.options.addPath=="function"&&(x=f.options.addPath(w,i));var j=f.services.interpolator.interpolate(x,{lng:w,ns:i});f.options.request(f.options,j,h,function(_,S){g+=1,y.push(_),v.push(S),g===n.length&&typeof c=="function"&&c(y,v)})})}}},{key:"reload",value:function(){var n=this,i=this.services,o=i.backendConnector,l=i.languageUtils,c=i.logger,f=o.language;if(!(f&&f.toLowerCase()==="cimode")){var h=[],g=function(v){var w=l.toResolveHierarchy(v);w.forEach(function(x){h.indexOf(x)<0&&h.push(x)})};g(f),this.allOptions.preload&&this.allOptions.preload.forEach(function(y){return g(y)}),h.forEach(function(y){n.allOptions.ns.forEach(function(v){o.read(y,v,"read",null,null,function(w,x){w&&c.warn("loading namespace ".concat(v," for language ").concat(y," failed"),w),!w&&x&&c.log("loaded namespace ".concat(v," for language ").concat(y),x),o.loaded("".concat(y,"|").concat(v),w,x)})})})}}}])})();My.type="backend";Jt.use(My).use(Ry).use(fS).init({fallbackLng:"en",ns:["common","pages"],defaultNS:"common",backend:{loadPath:"/static/locales/{{lng}}/{{ns}}.json"},interpolation:{escapeValue:!1},react:{useSuspense:!1}});var ZS={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"};const GS=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rt=(t,e)=>{const n=B.forwardRef(({color:i="currentColor",size:o=24,strokeWidth:l=2,absoluteStrokeWidth:c,children:f,...h},g)=>B.createElement("svg",{ref:g,...ZS,width:o,height:o,stroke:i,strokeWidth:c?Number(l)*24/Number(o):l,className:`lucide lucide-${GS(t)}`,...h},[...e.map(([y,v])=>B.createElement(y,v)),...(Array.isArray(f)?f:[f])||[]]));return n.displayName=`${t}`,n},JS=rt("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]),zs=rt("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Ka=rt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),Dy=rt("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),YS=rt("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),$y=rt("Brain",[["path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z",key:"1mhkh5"}],["path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z",key:"1d6s00"}]]),zy=rt("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),XS=rt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]),e_=rt("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]),eg=rt("FileJson",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]),t_=rt("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),r_=rt("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),n_=rt("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"}]]),s_=rt("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),i_=rt("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]),a_=rt("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]),ls=rt("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),o_=rt("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"}]]),Uy=rt("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),l_=rt("PlayCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]),za=rt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),u_=rt("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]),c_=rt("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]),d_=rt("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),gd=rt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),f_=rt("UploadCloud",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M12 12v9",key:"192myk"}],["path",{d:"m16 16-4-4-4 4",key:"119tzi"}]]),h_=rt("XCircle",[["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"}]]);function Qr(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i3?e.i-4:e.i:Array.isArray(t)?1:Hd(t)?2:qd(t)?3:0}function vi(t,e){return Ii(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function p_(t,e){return Ii(t)===2?t.get(e):t[e]}function Vy(t,e,n){var i=Ii(t);i===2?t.set(e,n):i===3?t.add(n):t[e]=n}function By(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Hd(t){return w_&&t instanceof Map}function qd(t){return b_&&t instanceof Set}function Is(t){return t.o||t.t}function Wd(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=qy(t);delete e[ut];for(var n=xi(e),i=0;i1&&(t.set=t.add=t.clear=t.delete=m_),Object.freeze(t),e&&Us(t,(function(n,i){return Qd(i,!0)}),!0)),t}function m_(){Qr(2)}function Kd(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function ln(t){var e=wd[t];return e||Qr(18,t),e}function g_(t,e){wd[t]||(wd[t]=e)}function yd(){return Ua}function Uc(t,e){e&&(ln("Patches"),t.u=[],t.s=[],t.v=e)}function Sl(t){vd(t),t.p.forEach(y_),t.p=null}function vd(t){t===Ua&&(Ua=t.l)}function tg(t){return Ua={p:[],l:Ua,h:t,m:!0,_:0}}function y_(t){var e=t[ut];e.i===0||e.i===1?e.j():e.g=!0}function Vc(t,e){e._=e.p.length;var n=e.p[0],i=t!==void 0&&t!==n;return e.h.O||ln("ES5").S(e,t,i),i?(n[ut].P&&(Sl(e),Qr(4)),Pn(t)&&(t=_l(e,t),e.l||kl(e,t)),e.u&&ln("Patches").M(n[ut].t,t,e.u,e.s)):t=_l(e,n,[]),Sl(e),e.u&&e.v(e.u,e.s),t!==Hy?t:void 0}function _l(t,e,n){if(Kd(e))return e;var i=e[ut];if(!i)return Us(e,(function(f,h){return rg(t,i,e,f,h,n)}),!0),e;if(i.A!==t)return e;if(!i.P)return kl(t,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var o=i.i===4||i.i===5?i.o=Wd(i.k):i.o,l=o,c=!1;i.i===3&&(l=new Set(o),o.clear(),c=!0),Us(l,(function(f,h){return rg(t,i,o,f,h,n,c)})),kl(t,o,!1),n&&t.u&&ln("Patches").N(i,n,t.u,t.s)}return i.o}function rg(t,e,n,i,o,l,c){if(ps(o)){var f=_l(t,o,l&&e&&e.i!==3&&!vi(e.R,i)?l.concat(i):void 0);if(Vy(n,i,f),!ps(f))return;t.m=!1}else c&&n.add(o);if(Pn(o)&&!Kd(o)){if(!t.h.D&&t._<1)return;_l(t,o),e&&e.A.l||kl(t,o)}}function kl(t,e,n){n===void 0&&(n=!1),!t.l&&t.h.D&&t.m&&Qd(e,n)}function Bc(t,e){var n=t[ut];return(n?Is(n):t)[e]}function ng(t,e){if(e in t)for(var n=Object.getPrototypeOf(t);n;){var i=Object.getOwnPropertyDescriptor(n,e);if(i)return i;n=Object.getPrototypeOf(n)}}function ss(t){t.P||(t.P=!0,t.l&&ss(t.l))}function Hc(t){t.o||(t.o=Wd(t.t))}function xd(t,e,n){var i=Hd(e)?ln("MapSet").F(e,n):qd(e)?ln("MapSet").T(e,n):t.O?(function(o,l){var c=Array.isArray(o),f={i:c?1:0,A:l?l.A:yd(),P:!1,I:!1,R:{},l,t:o,k:null,o:null,j:null,C:!1},h=f,g=Va;c&&(h=[f],g=ja);var y=Proxy.revocable(h,g),v=y.revoke,w=y.proxy;return f.k=w,f.j=v,w})(e,n):ln("ES5").J(e,n);return(n?n.A:yd()).p.push(i),i}function v_(t){return ps(t)||Qr(22,t),(function e(n){if(!Pn(n))return n;var i,o=n[ut],l=Ii(n);if(o){if(!o.P&&(o.i<4||!ln("ES5").K(o)))return o.t;o.I=!0,i=sg(n,l),o.I=!1}else i=sg(n,l);return Us(i,(function(c,f){o&&p_(o.t,c)===f||Vy(i,c,e(f))})),l===3?new Set(i):i})(t)}function sg(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Wd(t)}function x_(){function t(l,c){var f=o[l];return f?f.enumerable=c:o[l]=f={configurable:!0,enumerable:c,get:function(){var h=this[ut];return Va.get(h,l)},set:function(h){var g=this[ut];Va.set(g,l,h)}},f}function e(l){for(var c=l.length-1;c>=0;c--){var f=l[c][ut];if(!f.P)switch(f.i){case 5:i(f)&&ss(f);break;case 4:n(f)&&ss(f)}}}function n(l){for(var c=l.t,f=l.k,h=xi(f),g=h.length-1;g>=0;g--){var y=h[g];if(y!==ut){var v=c[y];if(v===void 0&&!vi(c,y))return!0;var w=f[y],x=w&&w[ut];if(x?x.t!==v:!By(w,v))return!0}}var j=!!c[ut];return h.length!==xi(c).length+(j?0:1)}function i(l){var c=l.k;if(c.length!==l.t.length)return!0;var f=Object.getOwnPropertyDescriptor(c,c.length-1);if(f&&!f.get)return!0;for(var h=0;h1?I-1:0),z=1;z1?y-1:0),w=1;w=0;o--){var l=i[o];if(l.path.length===0&&l.op==="replace"){n=l.value;break}}o>-1&&(i=i.slice(o+1));var c=ln("Patches").$;return ps(n)?c(n,i):this.produce(n,(function(f){return c(f,i)}))},t})(),_r=new __,Wy=_r.produce;_r.produceWithPatches.bind(_r);_r.setAutoFreeze.bind(_r);_r.setUseProxies.bind(_r);_r.applyPatches.bind(_r);_r.createDraft.bind(_r);_r.finishDraft.bind(_r);function k_(t,e,n){return(e=Ey(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lg(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,i)}return n}function ug(t){for(var e=1;e"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(qt(1));return n(Qy)(t,e)}if(typeof t!="function")throw new Error(qt(2));var o=t,l=e,c=[],f=c,h=!1;function g(){f===c&&(f=c.slice())}function y(){if(h)throw new Error(qt(3));return l}function v(_){if(typeof _!="function")throw new Error(qt(4));if(h)throw new Error(qt(5));var S=!0;return g(),f.push(_),function(){if(S){if(h)throw new Error(qt(6));S=!1,g();var E=f.indexOf(_);f.splice(E,1),c=null}}}function w(_){if(!j_(_))throw new Error(qt(7));if(typeof _.type>"u")throw new Error(qt(8));if(h)throw new Error(qt(9));try{h=!0,l=o(l,_)}finally{h=!1}for(var S=c=f,I=0;I"u")throw new Error(qt(12));if(typeof n(void 0,{type:jl.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(qt(13))})}function E_(t){for(var e=Object.keys(t),n={},i=0;i"u")throw g&&g.type,new Error(qt(14));v[x]=S,y=y||S!==_}return y=y||l.length!==Object.keys(h).length,y?v:h}}function Cl(){for(var t=arguments.length,e=new Array(t),n=0;n0&&l[l.length-1])&&(g[0]===6||g[0]===2)){n=0;continue}if(g[0]===3&&(!l||g[1]>l[0]&&g[1]{t.sidebarOpen=!t.sidebarOpen},setCurrentStep:(t,e)=>{t.currentStep=e.payload},setSelectedProject:(t,e)=>{t.selectedProjectId=e.payload},setLoading:(t,e)=>{t.isLoading=e.payload},showNotification:(t,e)=>{t.notification=e.payload},clearNotification:t=>{t.notification={type:null,message:""}}}}),{toggleSidebar:ek}=Jy.actions,tk=Jy.reducer;function Yy(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e{const e=sk(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:c=>{const f=c.split(Yd);return f[0]===""&&f.length!==1&&f.shift(),ev(f,e)||nk(c)},getConflictingClassGroupIds:(c,f)=>{const h=n[c]||[];return f&&i[c]?[...h,...i[c]]:h}}},ev=(t,e)=>{if(t.length===0)return e.classGroupId;const n=t[0],i=e.nextPart.get(n),o=i?ev(t.slice(1),i):void 0;if(o)return o;if(e.validators.length===0)return;const l=t.join(Yd);return e.validators.find(({validator:c})=>c(l))?.classGroupId},mg=/^\[(.+)\]$/,nk=t=>{if(mg.test(t)){const e=mg.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},sk=t=>{const{theme:e,prefix:n}=t,i={nextPart:new Map,validators:[]};return ak(Object.entries(t.classGroups),n).forEach(([l,c])=>{_d(c,i,l,e)}),i},_d=(t,e,n,i)=>{t.forEach(o=>{if(typeof o=="string"){const l=o===""?e:gg(e,o);l.classGroupId=n;return}if(typeof o=="function"){if(ik(o)){_d(o(i),e,n,i);return}e.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([l,c])=>{_d(c,gg(e,l),n,i)})})},gg=(t,e)=>{let n=t;return e.split(Yd).forEach(i=>{n.nextPart.has(i)||n.nextPart.set(i,{nextPart:new Map,validators:[]}),n=n.nextPart.get(i)}),n},ik=t=>t.isThemeGetter,ak=(t,e)=>e?t.map(([n,i])=>{const o=i.map(l=>typeof l=="string"?e+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([c,f])=>[e+c,f])):l);return[n,o]}):t,ok=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,i=new Map;const o=(l,c)=>{n.set(l,c),e++,e>t&&(e=0,i=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=i.get(l))!==void 0)return o(l,c),c},set(l,c){n.has(l)?n.set(l,c):o(l,c)}}},tv="!",lk=t=>{const{separator:e,experimentalParseClassName:n}=t,i=e.length===1,o=e[0],l=e.length,c=f=>{const h=[];let g=0,y=0,v;for(let S=0;Sy?v-y:void 0;return{modifiers:h,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:_}};return n?f=>n({className:f,parseClassName:c}):c},uk=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(i=>{i[0]==="["?(e.push(...n.sort(),i),n=[]):n.push(i)}),e.push(...n.sort()),e},ck=t=>({cache:ok(t.cacheSize),parseClassName:lk(t),...rk(t)}),dk=/\s+/,fk=(t,e)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:o}=e,l=[],c=t.trim().split(dk);let f="";for(let h=c.length-1;h>=0;h-=1){const g=c[h],{modifiers:y,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:x}=n(g);let j=!!x,_=i(j?w.substring(0,x):w);if(!_){if(!j){f=g+(f.length>0?" "+f:f);continue}if(_=i(w),!_){f=g+(f.length>0?" "+f:f);continue}j=!1}const S=uk(y).join(":"),I=v?S+tv:S,E=I+_;if(l.includes(E))continue;l.push(E);const z=o(_,j);for(let M=0;M0?" "+f:f)}return f};function hk(){let t=0,e,n,i="";for(;t{if(typeof t=="string")return t;let e,n="";for(let i=0;iv(y),t());return n=ck(g),i=n.cache.get,o=n.cache.set,l=f,f(h)}function f(h){const g=i(h);if(g)return g;const y=fk(h,n);return o(h,y),y}return function(){return l(hk.apply(null,arguments))}}const at=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},nv=/^\[(?:([a-z-]+):)?(.+)\]$/i,mk=/^\d+\/\d+$/,gk=new Set(["px","full","screen"]),yk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vk=/\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$/,xk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jn=t=>wi(t)||gk.has(t)||mk.test(t),ts=t=>Fi(t,"length",Pk),wi=t=>!!t&&!Number.isNaN(Number(t)),Kc=t=>Fi(t,"number",wi),Sa=t=>!!t&&Number.isInteger(Number(t)),Sk=t=>t.endsWith("%")&&wi(t.slice(0,-1)),Me=t=>nv.test(t),rs=t=>yk.test(t),_k=new Set(["length","size","percentage"]),kk=t=>Fi(t,_k,sv),jk=t=>Fi(t,"position",sv),Ck=new Set(["image","url"]),Ek=t=>Fi(t,Ck,Rk),Nk=t=>Fi(t,"",Ok),_a=()=>!0,Fi=(t,e,n)=>{const i=nv.exec(t);return i?i[1]?typeof e=="string"?i[1]===e:e.has(i[1]):n(i[2]):!1},Pk=t=>vk.test(t)&&!xk.test(t),sv=()=>!1,Ok=t=>wk.test(t),Rk=t=>bk.test(t),Tk=()=>{const t=at("colors"),e=at("spacing"),n=at("blur"),i=at("brightness"),o=at("borderColor"),l=at("borderRadius"),c=at("borderSpacing"),f=at("borderWidth"),h=at("contrast"),g=at("grayscale"),y=at("hueRotate"),v=at("invert"),w=at("gap"),x=at("gradientColorStops"),j=at("gradientColorStopPositions"),_=at("inset"),S=at("margin"),I=at("opacity"),E=at("padding"),z=at("saturate"),M=at("scale"),L=at("sepia"),Q=at("skew"),le=at("space"),ue=at("translate"),pe=()=>["auto","contain","none"],_e=()=>["auto","hidden","clip","visible","scroll"],Oe=()=>["auto",Me,e],Z=()=>[Me,e],me=()=>["",jn,ts],he=()=>["auto",wi,Me],T=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],P=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",Me],W=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[wi,Me];return{cacheSize:500,separator:":",theme:{colors:[_a],spacing:[jn,ts],blur:["none","",rs,Me],brightness:O(),borderColor:[t],borderRadius:["none","","full",rs,Me],borderSpacing:Z(),borderWidth:me(),contrast:O(),grayscale:H(),hueRotate:O(),invert:H(),gap:Z(),gradientColorStops:[t],gradientColorStopPositions:[Sk,ts],inset:Oe(),margin:Oe(),opacity:O(),padding:Z(),saturate:O(),scale:O(),sepia:H(),skew:O(),space:Z(),translate:Z()},classGroups:{aspect:[{aspect:["auto","square","video",Me]}],container:["container"],columns:[{columns:[rs]}],"break-after":[{"break-after":W()}],"break-before":[{"break-before":W()}],"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:[...T(),Me]}],overflow:[{overflow:_e()}],"overflow-x":[{"overflow-x":_e()}],"overflow-y":[{"overflow-y":_e()}],overscroll:[{overscroll:pe()}],"overscroll-x":[{"overscroll-x":pe()}],"overscroll-y":[{"overscroll-y":pe()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[_]}],"inset-x":[{"inset-x":[_]}],"inset-y":[{"inset-y":[_]}],start:[{start:[_]}],end:[{end:[_]}],top:[{top:[_]}],right:[{right:[_]}],bottom:[{bottom:[_]}],left:[{left:[_]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Sa,Me]}],basis:[{basis:Oe()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Me]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",Sa,Me]}],"grid-cols":[{"grid-cols":[_a]}],"col-start-end":[{col:["auto",{span:["full",Sa,Me]},Me]}],"col-start":[{"col-start":he()}],"col-end":[{"col-end":he()}],"grid-rows":[{"grid-rows":[_a]}],"row-start-end":[{row:["auto",{span:[Sa,Me]},Me]}],"row-start":[{"row-start":he()}],"row-end":[{"row-end":he()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Me]}],gap:[{gap:[w]}],"gap-x":[{"gap-x":[w]}],"gap-y":[{"gap-y":[w]}],"justify-content":[{justify:["normal",...V()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...V(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...V(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],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":[le]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[le]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Me,e]}],"min-w":[{"min-w":[Me,e,"min","max","fit"]}],"max-w":[{"max-w":[Me,e,"none","full","min","max","fit","prose",{screen:[rs]},rs]}],h:[{h:[Me,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Me,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Me,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Me,e,"auto","min","max","fit"]}],"font-size":[{text:["base",rs,ts]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Kc]}],"font-family":[{font:[_a]}],"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-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Me]}],"line-clamp":[{"line-clamp":["none",wi,Kc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",jn,Me]}],"list-image":[{"list-image":["none",Me]}],"list-style-type":[{list:["none","disc","decimal",Me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[I]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[I]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...P(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",jn,ts]}],"underline-offset":[{"underline-offset":["auto",jn,Me]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me]}],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",Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[I]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...T(),jk]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kk]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ek]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[f]}],"border-w-x":[{"border-x":[f]}],"border-w-y":[{"border-y":[f]}],"border-w-s":[{"border-s":[f]}],"border-w-e":[{"border-e":[f]}],"border-w-t":[{"border-t":[f]}],"border-w-r":[{"border-r":[f]}],"border-w-b":[{"border-b":[f]}],"border-w-l":[{"border-l":[f]}],"border-opacity":[{"border-opacity":[I]}],"border-style":[{border:[...P(),"hidden"]}],"divide-x":[{"divide-x":[f]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[f]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[I]}],"divide-style":[{divide:P()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[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:["",...P()]}],"outline-offset":[{"outline-offset":[jn,Me]}],"outline-w":[{outline:[jn,ts]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[I]}],"ring-offset-w":[{"ring-offset":[jn,ts]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",rs,Nk]}],"shadow-color":[{shadow:[_a]}],opacity:[{opacity:[I]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[i]}],contrast:[{contrast:[h]}],"drop-shadow":[{"drop-shadow":["","none",rs,Me]}],grayscale:[{grayscale:[g]}],"hue-rotate":[{"hue-rotate":[y]}],invert:[{invert:[v]}],saturate:[{saturate:[z]}],sepia:[{sepia:[L]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[h]}],"backdrop-grayscale":[{"backdrop-grayscale":[g]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[y]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[I]}],"backdrop-saturate":[{"backdrop-saturate":[z]}],"backdrop-sepia":[{"backdrop-sepia":[L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Me]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",Me]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",Me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[Sa,Me]}],"translate-x":[{"translate-x":[ue]}],"translate-y":[{"translate-y":[ue]}],"skew-x":[{"skew-x":[Q]}],"skew-y":[{"skew-y":[Q]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Me]}],accent:[{accent:["auto",t]}],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",Me]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Z()}],"scroll-mx":[{"scroll-mx":Z()}],"scroll-my":[{"scroll-my":Z()}],"scroll-ms":[{"scroll-ms":Z()}],"scroll-me":[{"scroll-me":Z()}],"scroll-mt":[{"scroll-mt":Z()}],"scroll-mr":[{"scroll-mr":Z()}],"scroll-mb":[{"scroll-mb":Z()}],"scroll-ml":[{"scroll-ml":Z()}],"scroll-p":[{"scroll-p":Z()}],"scroll-px":[{"scroll-px":Z()}],"scroll-py":[{"scroll-py":Z()}],"scroll-ps":[{"scroll-ps":Z()}],"scroll-pe":[{"scroll-pe":Z()}],"scroll-pt":[{"scroll-pt":Z()}],"scroll-pr":[{"scroll-pr":Z()}],"scroll-pb":[{"scroll-pb":Z()}],"scroll-pl":[{"scroll-pl":Z()}],"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",Me]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[jn,ts,Kc]}],stroke:[{stroke:[t,"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-s","border-color-e","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"]}}},Lk=pk(Tk);function xt(...t){return Lk(Xy(t))}const yg=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,vg=Xy,iv=(t,e)=>n=>{var i;if(e?.variants==null)return vg(t,n?.class,n?.className);const{variants:o,defaultVariants:l}=e,c=Object.keys(o).map(g=>{const y=n?.[g],v=l?.[g];if(y===null)return null;const w=yg(y)||yg(v);return o[g][w]}),f=n&&Object.entries(n).reduce((g,y)=>{let[v,w]=y;return w===void 0||(g[v]=w),g},{}),h=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((g,y)=>{let{class:v,className:w,...x}=y;return Object.entries(x).every(j=>{let[_,S]=j;return Array.isArray(S)?S.includes({...l,...f}[_]):{...l,...f}[_]===S})?[...g,v,w]:g},[]);return vg(t,c,h,n?.class,n?.className)},Ak=iv("inline-flex items-center justify-center gap-2 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"}}),Ye=B.forwardRef(({className:t,variant:e,size:n,...i},o)=>m.jsx("button",{ref:o,className:xt(Ak({variant:e,size:n}),t),...i}));Ye.displayName="Button";var We;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{const l={};for(const c of o)l[c]=c;return l},t.getValidEnumValues=o=>{const l=t.objectKeys(o).filter(f=>typeof o[o[f]]!="number"),c={};for(const f of l)c[f]=o[f];return t.objectValues(c)},t.objectValues=o=>t.objectKeys(o).map(function(l){return o[l]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const l=[];for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&l.push(c);return l},t.find=(o,l)=>{for(const c of o)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function i(o,l=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(o,l)=>typeof l=="bigint"?l.toString():l})(We||(We={}));var xg;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(xg||(xg={}));const xe=We.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ns=t=>{switch(typeof t){case"undefined":return xe.undefined;case"string":return xe.string;case"number":return Number.isNaN(t)?xe.nan:xe.number;case"boolean":return xe.boolean;case"function":return xe.function;case"bigint":return xe.bigint;case"symbol":return xe.symbol;case"object":return Array.isArray(t)?xe.array:t===null?xe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?xe.promise:typeof Map<"u"&&t instanceof Map?xe.map:typeof Set<"u"&&t instanceof Set?xe.set:typeof Date<"u"&&t instanceof Date?xe.date:xe.object;default:return xe.unknown}},re=We.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"]);class On extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(l){return l.message},i={_errors:[]},o=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(c.argumentsError);else if(c.path.length===0)i._errors.push(n(c));else{let f=i,h=0;for(;hn.message){const n={},i=[];for(const o of this.issues)if(o.path.length>0){const l=o.path[0];n[l]=n[l]||[],n[l].push(e(o))}else i.push(e(o));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}On.create=t=>new On(t);const kd=(t,e)=>{let n;switch(t.code){case re.invalid_type:t.received===xe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case re.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,We.jsonStringifyReplacer)}`;break;case re.unrecognized_keys:n=`Unrecognized key(s) in object: ${We.joinValues(t.keys,", ")}`;break;case re.invalid_union:n="Invalid input";break;case re.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${We.joinValues(t.options)}`;break;case re.invalid_enum_value:n=`Invalid enum value. Expected ${We.joinValues(t.options)}, received '${t.received}'`;break;case re.invalid_arguments:n="Invalid function arguments";break;case re.invalid_return_type:n="Invalid function return type";break;case re.invalid_date:n="Invalid date";break;case re.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:We.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case re.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case re.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case re.custom:n="Invalid input";break;case re.invalid_intersection_types:n="Intersection results could not be merged";break;case re.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case re.not_finite:n="Number must be finite";break;default:n=e.defaultError,We.assertNever(t)}return{message:n}};let Ik=kd;function Fk(){return Ik}const Mk=t=>{const{data:e,path:n,errorMaps:i,issueData:o}=t,l=[...n,...o.path||[]],c={...o,path:l};if(o.message!==void 0)return{...o,path:l,message:o.message};let f="";const h=i.filter(g=>!!g).slice().reverse();for(const g of h)f=g(c,{data:e,defaultError:f}).message;return{...o,path:l,message:f}};function ce(t,e){const n=Fk(),i=Mk({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===kd?void 0:kd].filter(o=>!!o)});t.common.issues.push(i)}class sr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const o of n){if(o.status==="aborted")return Ae;o.status==="dirty"&&e.dirty(),i.push(o.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const o of n){const l=await o.key,c=await o.value;i.push({key:l,value:c})}return sr.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const o of n){const{key:l,value:c}=o;if(l.status==="aborted"||c.status==="aborted")return Ae;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(i[l.value]=c.value)}return{status:e.value,value:i}}}const Ae=Object.freeze({status:"aborted"}),Ca=t=>({status:"dirty",value:t}),Ar=t=>({status:"valid",value:t}),wg=t=>t.status==="aborted",bg=t=>t.status==="dirty",ji=t=>t.status==="valid",El=t=>typeof Promise<"u"&&t instanceof Promise;var Se;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Se||(Se={}));class cn{constructor(e,n,i,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Sg=(t,e)=>{if(ji(e))return{success:!0,data:e.value};if(!t.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 On(t.common.issues);return this._error=n,this._error}}};function $e(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:o}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(c,f)=>{const{message:h}=t;return c.code==="invalid_enum_value"?{message:h??f.defaultError}:typeof f.data>"u"?{message:h??i??f.defaultError}:c.code!=="invalid_type"?{message:f.defaultError}:{message:h??n??f.defaultError}},description:o}}class Ve{get description(){return this._def.description}_getType(e){return ns(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ns(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new sr,ctx:{common:e.parent.common,data:e.data,parsedType:ns(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(El(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){const i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ns(e)},o=this._parseSync({data:e,path:i.path,parent:i});return Sg(i,o)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ns(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return ji(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>ji(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ns(e)},o=this._parse({data:e,path:i.path,parent:i}),l=await(El(o)?o:Promise.resolve(o));return Sg(i,l)}refine(e,n){const i=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,l)=>{const c=e(o),f=()=>l.addIssue({code:re.custom,...i(o)});return typeof Promise<"u"&&c instanceof Promise?c.then(h=>h?!0:(f(),!1)):c?!0:(f(),!1)})}refinement(e,n){return this._refinement((i,o)=>e(i)?!0:(o.addIssue(typeof n=="function"?n(i,o):n),!1))}_refinement(e){return new Ni({schema:this,typeName:Te.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return ds.create(this,this._def)}nullable(){return Pi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return un.create(this)}promise(){return Tl.create(this,this._def)}or(e){return Pl.create([this,e],this._def)}and(e){return Ol.create(this,e,this._def)}transform(e){return new Ni({...$e(this._def),schema:this,typeName:Te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Od({...$e(this._def),innerType:this,defaultValue:n,typeName:Te.ZodDefault})}brand(){return new aj({typeName:Te.ZodBranded,type:this,...$e(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Rd({...$e(this._def),innerType:this,catchValue:n,typeName:Te.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Xd.create(this,e)}readonly(){return Td.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Dk=/^c[^\s-]{8,}$/i,$k=/^[0-9a-z]+$/,zk=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Uk=/^[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,Vk=/^[a-z0-9_-]{21}$/i,Bk=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Hk=/^[-+]?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)?)??$/,qk=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Wk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Zc;const Qk=/^(?:(?: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])$/,Kk=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Zk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Gk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Jk=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Yk=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,av="((\\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])))",Xk=new RegExp(`^${av}$`);function ov(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function ej(t){return new RegExp(`^${ov(t)}$`)}function tj(t){let e=`${av}T${ov(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function rj(t,e){return!!((e==="v4"||!e)&&Qk.test(t)||(e==="v6"||!e)&&Zk.test(t))}function nj(t,e){if(!Bk.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(i));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function sj(t,e){return!!((e==="v4"||!e)&&Kk.test(t)||(e==="v6"||!e)&&Gk.test(t))}class Nn extends Ve{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==xe.string){const l=this._getOrReturnCtx(e);return ce(l,{code:re.invalid_type,expected:xe.string,received:l.parsedType}),Ae}const i=new sr;let o;for(const l of this._def.checks)if(l.kind==="min")e.data.lengthl.value&&(o=this._getOrReturnCtx(e,o),ce(o,{code:re.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,f=e.data.lengthe.test(o),{validation:n,code:re.invalid_string,...Se.errToObj(i)})}_addCheck(e){return new Nn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Se.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Se.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Se.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Se.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Se.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Se.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Se.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Se.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Se.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Se.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Se.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Se.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Se.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Se.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Se.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Se.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Se.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Se.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Se.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Se.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Se.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Se.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Se.errToObj(n)})}nonempty(e){return this.min(1,Se.errToObj(e))}trim(){return new Nn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Nn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Nn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew Nn({checks:[],typeName:Te.ZodString,coerce:t?.coerce??!1,...$e(t)});function ij(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,o=n>i?n:i,l=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return l%c/10**o}class Ci extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==xe.number){const l=this._getOrReturnCtx(e);return ce(l,{code:re.invalid_type,expected:xe.number,received:l.parsedType}),Ae}let i;const o=new sr;for(const l of this._def.checks)l.kind==="int"?We.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),ce(i,{code:re.invalid_type,expected:"integer",received:"float",message:l.message}),o.dirty()):l.kind==="min"?(l.inclusive?e.datal.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:re.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),o.dirty()):l.kind==="multipleOf"?ij(e.data,l.value)!==0&&(i=this._getOrReturnCtx(e,i),ce(i,{code:re.not_multiple_of,multipleOf:l.value,message:l.message}),o.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),ce(i,{code:re.not_finite,message:l.message}),o.dirty()):We.assertNever(l);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Se.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Se.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Se.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Se.toString(n))}setLimit(e,n,i,o){return new Ci({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:Se.toString(o)}]})}_addCheck(e){return new Ci({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Se.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Se.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Se.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Se.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Se.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Se.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Se.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Se.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Se.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuee.kind==="int"||e.kind==="multipleOf"&&We.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.valuenew Ci({checks:[],typeName:Te.ZodNumber,coerce:t?.coerce||!1,...$e(t)});class Ba extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==xe.bigint)return this._getInvalidInput(e);let i;const o=new sr;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.datal.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:re.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),o.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:re.not_multiple_of,multipleOf:l.value,message:l.message}),o.dirty()):We.assertNever(l);return{status:o.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return ce(n,{code:re.invalid_type,expected:xe.bigint,received:n.parsedType}),Ae}gte(e,n){return this.setLimit("min",e,!0,Se.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Se.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Se.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Se.toString(n))}setLimit(e,n,i,o){return new Ba({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:Se.toString(o)}]})}_addCheck(e){return new Ba({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Se.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Se.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Se.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Se.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Se.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew Ba({checks:[],typeName:Te.ZodBigInt,coerce:t?.coerce??!1,...$e(t)});class jd extends Ve{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==xe.boolean){const i=this._getOrReturnCtx(e);return ce(i,{code:re.invalid_type,expected:xe.boolean,received:i.parsedType}),Ae}return Ar(e.data)}}jd.create=t=>new jd({typeName:Te.ZodBoolean,coerce:t?.coerce||!1,...$e(t)});class Nl extends Ve{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==xe.date){const l=this._getOrReturnCtx(e);return ce(l,{code:re.invalid_type,expected:xe.date,received:l.parsedType}),Ae}if(Number.isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ce(l,{code:re.invalid_date}),Ae}const i=new sr;let o;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()l.value&&(o=this._getOrReturnCtx(e,o),ce(o,{code:re.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),i.dirty()):We.assertNever(l);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Nl({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Se.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Se.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew Nl({checks:[],coerce:t?.coerce||!1,typeName:Te.ZodDate,...$e(t)});class _g extends Ve{_parse(e){if(this._getType(e)!==xe.symbol){const i=this._getOrReturnCtx(e);return ce(i,{code:re.invalid_type,expected:xe.symbol,received:i.parsedType}),Ae}return Ar(e.data)}}_g.create=t=>new _g({typeName:Te.ZodSymbol,...$e(t)});class kg extends Ve{_parse(e){if(this._getType(e)!==xe.undefined){const i=this._getOrReturnCtx(e);return ce(i,{code:re.invalid_type,expected:xe.undefined,received:i.parsedType}),Ae}return Ar(e.data)}}kg.create=t=>new kg({typeName:Te.ZodUndefined,...$e(t)});class Cd extends Ve{_parse(e){if(this._getType(e)!==xe.null){const i=this._getOrReturnCtx(e);return ce(i,{code:re.invalid_type,expected:xe.null,received:i.parsedType}),Ae}return Ar(e.data)}}Cd.create=t=>new Cd({typeName:Te.ZodNull,...$e(t)});class jg extends Ve{constructor(){super(...arguments),this._any=!0}_parse(e){return Ar(e.data)}}jg.create=t=>new jg({typeName:Te.ZodAny,...$e(t)});class Ed extends Ve{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ar(e.data)}}Ed.create=t=>new Ed({typeName:Te.ZodUnknown,...$e(t)});class ms extends Ve{_parse(e){const n=this._getOrReturnCtx(e);return ce(n,{code:re.invalid_type,expected:xe.never,received:n.parsedType}),Ae}}ms.create=t=>new ms({typeName:Te.ZodNever,...$e(t)});class Cg extends Ve{_parse(e){if(this._getType(e)!==xe.undefined){const i=this._getOrReturnCtx(e);return ce(i,{code:re.invalid_type,expected:xe.void,received:i.parsedType}),Ae}return Ar(e.data)}}Cg.create=t=>new Cg({typeName:Te.ZodVoid,...$e(t)});class un extends Ve{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),o=this._def;if(n.parsedType!==xe.array)return ce(n,{code:re.invalid_type,expected:xe.array,received:n.parsedType}),Ae;if(o.exactLength!==null){const c=n.data.length>o.exactLength.value,f=n.data.lengtho.maxLength.value&&(ce(n,{code:re.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((c,f)=>o.type._parseAsync(new cn(n,c,n.path,f)))).then(c=>sr.mergeArray(i,c));const l=[...n.data].map((c,f)=>o.type._parseSync(new cn(n,c,n.path,f)));return sr.mergeArray(i,l)}get element(){return this._def.type}min(e,n){return new un({...this._def,minLength:{value:e,message:Se.toString(n)}})}max(e,n){return new un({...this._def,maxLength:{value:e,message:Se.toString(n)}})}length(e,n){return new un({...this._def,exactLength:{value:e,message:Se.toString(n)}})}nonempty(e){return this.min(1,e)}}un.create=(t,e)=>new un({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Te.ZodArray,...$e(e)});function yi(t){if(t instanceof Nt){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=ds.create(yi(i))}return new Nt({...t._def,shape:()=>e})}else return t instanceof un?new un({...t._def,type:yi(t.element)}):t instanceof ds?ds.create(yi(t.unwrap())):t instanceof Pi?Pi.create(yi(t.unwrap())):t instanceof Vs?Vs.create(t.items.map(e=>yi(e))):t}class Nt extends Ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=We.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==xe.object){const g=this._getOrReturnCtx(e);return ce(g,{code:re.invalid_type,expected:xe.object,received:g.parsedType}),Ae}const{status:i,ctx:o}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),f=[];if(!(this._def.catchall instanceof ms&&this._def.unknownKeys==="strip"))for(const g in o.data)c.includes(g)||f.push(g);const h=[];for(const g of c){const y=l[g],v=o.data[g];h.push({key:{status:"valid",value:g},value:y._parse(new cn(o,v,o.path,g)),alwaysSet:g in o.data})}if(this._def.catchall instanceof ms){const g=this._def.unknownKeys;if(g==="passthrough")for(const y of f)h.push({key:{status:"valid",value:y},value:{status:"valid",value:o.data[y]}});else if(g==="strict")f.length>0&&(ce(o,{code:re.unrecognized_keys,keys:f}),i.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const g=this._def.catchall;for(const y of f){const v=o.data[y];h.push({key:{status:"valid",value:y},value:g._parse(new cn(o,v,o.path,y)),alwaysSet:y in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const g=[];for(const y of h){const v=await y.key,w=await y.value;g.push({key:v,value:w,alwaysSet:y.alwaysSet})}return g}).then(g=>sr.mergeObjectSync(i,g)):sr.mergeObjectSync(i,h)}get shape(){return this._def.shape()}strict(e){return Se.errToObj,new Nt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{const o=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:Se.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new Nt({...this._def,unknownKeys:"strip"})}passthrough(){return new Nt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Nt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Nt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Te.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Nt({...this._def,catchall:e})}pick(e){const n={};for(const i of We.objectKeys(e))e[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new Nt({...this._def,shape:()=>n})}omit(e){const n={};for(const i of We.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new Nt({...this._def,shape:()=>n})}deepPartial(){return yi(this)}partial(e){const n={};for(const i of We.objectKeys(this.shape)){const o=this.shape[i];e&&!e[i]?n[i]=o:n[i]=o.optional()}return new Nt({...this._def,shape:()=>n})}required(e){const n={};for(const i of We.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let l=this.shape[i];for(;l instanceof ds;)l=l._def.innerType;n[i]=l}return new Nt({...this._def,shape:()=>n})}keyof(){return lv(We.objectKeys(this.shape))}}Nt.create=(t,e)=>new Nt({shape:()=>t,unknownKeys:"strip",catchall:ms.create(),typeName:Te.ZodObject,...$e(e)});Nt.strictCreate=(t,e)=>new Nt({shape:()=>t,unknownKeys:"strict",catchall:ms.create(),typeName:Te.ZodObject,...$e(e)});Nt.lazycreate=(t,e)=>new Nt({shape:t,unknownKeys:"strip",catchall:ms.create(),typeName:Te.ZodObject,...$e(e)});class Pl extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e),i=this._def.options;function o(l){for(const f of l)if(f.result.status==="valid")return f.result;for(const f of l)if(f.result.status==="dirty")return n.common.issues.push(...f.ctx.common.issues),f.result;const c=l.map(f=>new On(f.ctx.common.issues));return ce(n,{code:re.invalid_union,unionErrors:c}),Ae}if(n.common.async)return Promise.all(i.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(o);{let l;const c=[];for(const h of i){const g={...n,common:{...n.common,issues:[]},parent:null},y=h._parseSync({data:n.data,path:n.path,parent:g});if(y.status==="valid")return y;y.status==="dirty"&&!l&&(l={result:y,ctx:g}),g.common.issues.length&&c.push(g.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const f=c.map(h=>new On(h));return ce(n,{code:re.invalid_union,unionErrors:f}),Ae}}get options(){return this._def.options}}Pl.create=(t,e)=>new Pl({options:t,typeName:Te.ZodUnion,...$e(e)});function Nd(t,e){const n=ns(t),i=ns(e);if(t===e)return{valid:!0,data:t};if(n===xe.object&&i===xe.object){const o=We.objectKeys(e),l=We.objectKeys(t).filter(f=>o.indexOf(f)!==-1),c={...t,...e};for(const f of l){const h=Nd(t[f],e[f]);if(!h.valid)return{valid:!1};c[f]=h.data}return{valid:!0,data:c}}else if(n===xe.array&&i===xe.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let l=0;l{if(wg(l)||wg(c))return Ae;const f=Nd(l.value,c.value);return f.valid?((bg(l)||bg(c))&&n.dirty(),{status:n.value,value:f.data}):(ce(i,{code:re.invalid_intersection_types}),Ae)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,c])=>o(l,c)):o(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Ol.create=(t,e,n)=>new Ol({left:t,right:e,typeName:Te.ZodIntersection,...$e(n)});class Vs extends Ve{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==xe.array)return ce(i,{code:re.invalid_type,expected:xe.array,received:i.parsedType}),Ae;if(i.data.lengththis._def.items.length&&(ce(i,{code:re.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...i.data].map((c,f)=>{const h=this._def.items[f]||this._def.rest;return h?h._parse(new cn(i,c,i.path,f)):null}).filter(c=>!!c);return i.common.async?Promise.all(l).then(c=>sr.mergeArray(n,c)):sr.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Vs({...this._def,rest:e})}}Vs.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vs({items:t,typeName:Te.ZodTuple,rest:null,...$e(e)})};class Rl extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==xe.object)return ce(i,{code:re.invalid_type,expected:xe.object,received:i.parsedType}),Ae;const o=[],l=this._def.keyType,c=this._def.valueType;for(const f in i.data)o.push({key:l._parse(new cn(i,f,i.path,f)),value:c._parse(new cn(i,i.data[f],i.path,f)),alwaysSet:f in i.data});return i.common.async?sr.mergeObjectAsync(n,o):sr.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Ve?new Rl({keyType:e,valueType:n,typeName:Te.ZodRecord,...$e(i)}):new Rl({keyType:Nn.create(),valueType:e,typeName:Te.ZodRecord,...$e(n)})}}class Eg extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==xe.map)return ce(i,{code:re.invalid_type,expected:xe.map,received:i.parsedType}),Ae;const o=this._def.keyType,l=this._def.valueType,c=[...i.data.entries()].map(([f,h],g)=>({key:o._parse(new cn(i,f,i.path,[g,"key"])),value:l._parse(new cn(i,h,i.path,[g,"value"]))}));if(i.common.async){const f=new Map;return Promise.resolve().then(async()=>{for(const h of c){const g=await h.key,y=await h.value;if(g.status==="aborted"||y.status==="aborted")return Ae;(g.status==="dirty"||y.status==="dirty")&&n.dirty(),f.set(g.value,y.value)}return{status:n.value,value:f}})}else{const f=new Map;for(const h of c){const g=h.key,y=h.value;if(g.status==="aborted"||y.status==="aborted")return Ae;(g.status==="dirty"||y.status==="dirty")&&n.dirty(),f.set(g.value,y.value)}return{status:n.value,value:f}}}}Eg.create=(t,e,n)=>new Eg({valueType:e,keyType:t,typeName:Te.ZodMap,...$e(n)});class Ha extends Ve{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==xe.set)return ce(i,{code:re.invalid_type,expected:xe.set,received:i.parsedType}),Ae;const o=this._def;o.minSize!==null&&i.data.sizeo.maxSize.value&&(ce(i,{code:re.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const l=this._def.valueType;function c(h){const g=new Set;for(const y of h){if(y.status==="aborted")return Ae;y.status==="dirty"&&n.dirty(),g.add(y.value)}return{status:n.value,value:g}}const f=[...i.data.values()].map((h,g)=>l._parse(new cn(i,h,i.path,g)));return i.common.async?Promise.all(f).then(h=>c(h)):c(f)}min(e,n){return new Ha({...this._def,minSize:{value:e,message:Se.toString(n)}})}max(e,n){return new Ha({...this._def,maxSize:{value:e,message:Se.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Ha.create=(t,e)=>new Ha({valueType:t,minSize:null,maxSize:null,typeName:Te.ZodSet,...$e(e)});class Ng extends Ve{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ng.create=(t,e)=>new Ng({getter:t,typeName:Te.ZodLazy,...$e(e)});class Pd extends Ve{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ce(n,{received:n.data,code:re.invalid_literal,expected:this._def.value}),Ae}return{status:"valid",value:e.data}}get value(){return this._def.value}}Pd.create=(t,e)=>new Pd({value:t,typeName:Te.ZodLiteral,...$e(e)});function lv(t,e){return new Ei({values:t,typeName:Te.ZodEnum,...$e(e)})}class Ei extends Ve{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return ce(n,{expected:We.joinValues(i),received:n.parsedType,code:re.invalid_type}),Ae}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return ce(n,{received:n.data,code:re.invalid_enum_value,options:i}),Ae}return Ar(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Ei.create(e,{...this._def,...n})}exclude(e,n=this._def){return Ei.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}Ei.create=lv;class Pg extends Ve{_parse(e){const n=We.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==xe.string&&i.parsedType!==xe.number){const o=We.objectValues(n);return ce(i,{expected:We.joinValues(o),received:i.parsedType,code:re.invalid_type}),Ae}if(this._cache||(this._cache=new Set(We.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const o=We.objectValues(n);return ce(i,{received:i.data,code:re.invalid_enum_value,options:o}),Ae}return Ar(e.data)}get enum(){return this._def.values}}Pg.create=(t,e)=>new Pg({values:t,typeName:Te.ZodNativeEnum,...$e(e)});class Tl extends Ve{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==xe.promise&&n.common.async===!1)return ce(n,{code:re.invalid_type,expected:xe.promise,received:n.parsedType}),Ae;const i=n.parsedType===xe.promise?n.data:Promise.resolve(n.data);return Ar(i.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Tl.create=(t,e)=>new Tl({type:t,typeName:Te.ZodPromise,...$e(e)});class Ni extends Ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),o=this._def.effect||null,l={addIssue:c=>{ce(i,c),c.fatal?n.abort():n.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),o.type==="preprocess"){const c=o.transform(i.data,l);if(i.common.async)return Promise.resolve(c).then(async f=>{if(n.value==="aborted")return Ae;const h=await this._def.schema._parseAsync({data:f,path:i.path,parent:i});return h.status==="aborted"?Ae:h.status==="dirty"||n.value==="dirty"?Ca(h.value):h});{if(n.value==="aborted")return Ae;const f=this._def.schema._parseSync({data:c,path:i.path,parent:i});return f.status==="aborted"?Ae:f.status==="dirty"||n.value==="dirty"?Ca(f.value):f}}if(o.type==="refinement"){const c=f=>{const h=o.refinement(f,l);if(i.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f};if(i.common.async===!1){const f=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return f.status==="aborted"?Ae:(f.status==="dirty"&&n.dirty(),c(f.value),{status:n.value,value:f.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(f=>f.status==="aborted"?Ae:(f.status==="dirty"&&n.dirty(),c(f.value).then(()=>({status:n.value,value:f.value}))))}if(o.type==="transform")if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!ji(c))return Ae;const f=o.transform(c.value,l);if(f instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:f}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>ji(c)?Promise.resolve(o.transform(c.value,l)).then(f=>({status:n.value,value:f})):Ae);We.assertNever(o)}}Ni.create=(t,e,n)=>new Ni({schema:t,typeName:Te.ZodEffects,effect:e,...$e(n)});Ni.createWithPreprocess=(t,e,n)=>new Ni({schema:e,effect:{type:"preprocess",transform:t},typeName:Te.ZodEffects,...$e(n)});class ds extends Ve{_parse(e){return this._getType(e)===xe.undefined?Ar(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ds.create=(t,e)=>new ds({innerType:t,typeName:Te.ZodOptional,...$e(e)});class Pi extends Ve{_parse(e){return this._getType(e)===xe.null?Ar(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pi.create=(t,e)=>new Pi({innerType:t,typeName:Te.ZodNullable,...$e(e)});class Od extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===xe.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Od.create=(t,e)=>new Od({innerType:t,typeName:Te.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...$e(e)});class Rd extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return El(o)?o.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new On(i.common.issues)},input:i.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new On(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Rd.create=(t,e)=>new Rd({innerType:t,typeName:Te.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...$e(e)});class Og extends Ve{_parse(e){if(this._getType(e)!==xe.nan){const i=this._getOrReturnCtx(e);return ce(i,{code:re.invalid_type,expected:xe.nan,received:i.parsedType}),Ae}return{status:"valid",value:e.data}}}Og.create=t=>new Og({typeName:Te.ZodNaN,...$e(t)});class aj extends Ve{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class Xd extends Ve{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?Ae:l.status==="dirty"?(n.dirty(),Ca(l.value)):this._def.out._parseAsync({data:l.value,path:i.path,parent:i})})();{const o=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?Ae:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:i.path,parent:i})}}static create(e,n){return new Xd({in:e,out:n,typeName:Te.ZodPipeline})}}class Td extends Ve{_parse(e){const n=this._def.innerType._parse(e),i=o=>(ji(o)&&(o.value=Object.freeze(o.value)),o);return El(n)?n.then(o=>i(o)):i(n)}unwrap(){return this._def.innerType}}Td.create=(t,e)=>new Td({innerType:t,typeName:Te.ZodReadonly,...$e(e)});var Te;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Te||(Te={}));const X=Nn.create,Fe=Ci.create,Bs=jd.create,oj=Cd.create,Mi=Ed.create;ms.create;const nr=un.create,ot=Nt.create,kr=Pl.create;Ol.create;Vs.create;const zl=Rl.create,uv=Pd.create,cv=Ei.create;Tl.create;ds.create;Pi.create;class Rg extends Error{constructor(e,n,i,o){super(`${e} ${n} — ${o}`),this.status=e,this.statusText=n,this.body=i,this.url=o,this.name="ApiError"}status;statusText;body;url}function lj(t,e){if(!e)return t;const n=new URLSearchParams;for(const[o,l]of Object.entries(e))l!=null&&n.append(o,String(l));const i=n.toString();return i?`${t}?${i}`:t}async function dl(t,e,n={}){const{body:i,query:o,headers:l,...c}=n,f=lj(t,o),h={...c,headers:{Accept:"application/json",...i!==void 0?{"Content-Type":"application/json"}:{},...l},body:i!==void 0?JSON.stringify(i):void 0},g=await fetch(f,h),v=(g.headers.get("content-type")??"").includes("application/json")&&g.status!==204?await g.json():await g.text();if(!g.ok)throw new Rg(g.status,g.statusText,v,f);const w=e.safeParse(v);if(!w.success)throw new Rg(g.status,"Response schema mismatch",{issues:w.error.issues,raw:v},f);return w.data}const St={get:(t,e,n)=>dl(t,e,{...n,method:"GET"}),post:(t,e,n,i)=>dl(t,e,{...i,method:"POST",body:n}),put:(t,e,n,i)=>dl(t,e,{...i,method:"PUT",body:n}),delete:(t,e,n)=>dl(t,e,{...n,method:"DELETE"})},uj=ot({id:kr([X(),Fe()]).transform(String),name:X(),domain:X(),created_at:X(),updated_at:X()}),cj=nr(uj),dj=ot({id:kr([X(),Fe()]).transform(String),name:X(),type:X(),base_url:X().nullable().optional(),trust_level:kr([X(),Fe()]).nullable().optional(),respect_robots_txt:Bs().nullable().optional(),rate_limit_per_minute:Fe().nullable().optional()}),fj=ot({id:kr([X(),Fe()]).transform(String),name:X(),domain:X(),config:Mi().optional(),sources:nr(dj).default([])}),Tg=ot({id:kr([X(),Fe()]).transform(String),name:X(),domain:X()}),ef={list:()=>St.get("/projects",cj),detail:t=>St.get(`/projects/${encodeURIComponent(t)}`,fj),create:t=>St.post("/projects",Tg,t),createInline:t=>St.post("/projects/inline",Tg,t)},Je={projects:{all:["projects"],list:()=>[...Je.projects.all,"list"],detail:t=>[...Je.projects.all,"detail",t]},domains:{all:["domains"],list:()=>[...Je.domains.all,"list"]},ontology:{all:["ontology"],byDomain:t=>[...Je.ontology.all,"byDomain",t]},crawl:{all:["crawl"],job:t=>[...Je.crawl.all,"job",t]},research:{all:["research"],sessions:t=>[...Je.research.all,"sessions",t],session:t=>[...Je.research.all,"session",t]},entities:{all:["entities"],list:(t,e)=>[...Je.entities.all,"list",t,e??"*"]},claims:{all:["claims"],list:(t,e)=>[...Je.claims.all,"list",t,e??"*"]}};function dv(){return vs({queryKey:Je.projects.list(),queryFn:()=>ef.list()})}function Ul(t){return vs({queryKey:Je.projects.detail(t??""),queryFn:()=>ef.detail(t),enabled:!!t})}function hj(){const t=jr();return Zr({mutationFn:e=>ef.createInline(e),onSuccess:()=>{t.invalidateQueries({queryKey:Je.projects.all})}})}const pj=[{to:"/",labelKey:"nav.dashboard",icon:s_},{to:"/onboard",labelKey:"nav.onboard",icon:f_},{projectPath:"sources",labelKey:"nav.sources",icon:u_},{projectPath:"crawl",labelKey:"nav.crawl",icon:JS},{projectPath:"research",labelKey:"nav.research",icon:$y},{projectPath:"editor",labelKey:"nav.editor",icon:Uy},{projectPath:"review",labelKey:"nav.review",icon:a_}],fv=["/sources/:projectId","/crawl/:projectId","/research/:projectId","/editor/:projectId","/review/:projectId"];function mj(t){for(const e of fv){const n=La({path:e,end:!1},t);if(n?.params.projectId)return n.params.projectId}}function gj(t){for(const e of fv)if(La({path:e,end:!1},t)?.params.projectId)return e.split("/")[1]}function yj(){const{t}=xs(),e=Xx(v=>v.ui.sidebarOpen),n=f1(),i=Li(),o=Tn(),l=mj(i.pathname),c=gj(i.pathname),{data:f}=dv(),h=f?.[0]?.name,g=!l||!f||f.some(v=>v.name===l),y=g?l??h:h;return B.useEffect(()=>{if(l&&f&&!g){const v=c&&h?`/${c}/${encodeURIComponent(h)}`:"/";o(v,{replace:!0})}},[h,o,f,g,l,c]),m.jsxs("div",{className:"flex min-h-screen bg-background text-foreground",children:[m.jsxs("aside",{className:xt("border-r bg-card transition-all duration-200 ease-out",e?"w-60":"w-16"),children:[m.jsxs("div",{className:"flex h-14 items-center justify-between px-4 border-b",children:[e&&m.jsx("span",{className:"text-sm font-semibold",children:t("app.title","Ontology Builder")}),m.jsx(Ye,{variant:"ghost",size:"icon",onClick:()=>n(ek()),"aria-label":t("nav.toggleSidebar","Toggle sidebar"),children:m.jsx(o_,{className:"h-4 w-4"})})]}),e&&m.jsxs("div",{className:"border-b px-4 py-3",children:[m.jsx("p",{className:"text-xs text-muted-foreground",children:t("nav.currentProject","Current project")}),m.jsx("p",{className:"mt-1 truncate text-sm font-medium",children:y??t("nav.noProjectSelected","Select a project")})]}),m.jsx("nav",{className:"flex flex-col gap-1 p-2",children:pj.map(({to:v,projectPath:w,labelKey:x,icon:j})=>{const _=v??(y?`/${w}/${encodeURIComponent(y)}`:void 0);return _?m.jsxs(yw,{to:_,end:_==="/",className:({isActive:S})=>xt("flex items-center gap-3 rounded-md px-3 py-2 text-sm transition-colors",S?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[m.jsx(j,{className:"h-4 w-4 flex-shrink-0"}),e&&m.jsx("span",{children:t(x)})]},x):m.jsxs("div",{className:"flex cursor-not-allowed items-center gap-3 rounded-md px-3 py-2 text-sm text-muted-foreground/50",title:t("nav.selectProjectFirst","Select a project from the dashboard first"),children:[m.jsx(j,{className:"h-4 w-4 flex-shrink-0"}),e&&m.jsx("span",{children:t(x)})]},x)})})]}),m.jsxs("div",{className:"flex flex-1 flex-col",children:[m.jsx("header",{className:"flex h-14 items-center justify-between border-b bg-card px-6",children:m.jsx("h1",{className:"text-sm font-medium text-muted-foreground",children:t("app.subtitle","AI-powered ontology construction")})}),m.jsx("main",{className:"flex-1 overflow-auto",children:m.jsx(nw,{})})]})]})}var Za=t=>t.type==="checkbox",Ms=t=>t instanceof Date,rr=t=>t==null;const hv=t=>typeof t=="object";var yt=t=>!rr(t)&&!Array.isArray(t)&&hv(t)&&!Ms(t),vj=t=>yt(t)&&t.target?Za(t.target)?t.target.checked:t.target.value:t,xj=(t,e)=>e.split(".").some((n,i,o)=>!isNaN(Number(n))&&t.has(o.slice(0,i).join("."))),wj=t=>{const e=t.constructor&&t.constructor.prototype;return yt(e)&&e.hasOwnProperty("isPrototypeOf")},tf=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ct(t){if(t instanceof Date)return new Date(t);const e=typeof FileList<"u"&&t instanceof FileList;if(tf&&(t instanceof Blob||e))return t;const n=Array.isArray(t);if(!n&&!(yt(t)&&wj(t)))return t;const i=n?[]:Object.create(Object.getPrototypeOf(t));for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(i[o]=Ct(t[o]));return i}var Vl=t=>/^\w*$/.test(t),ct=t=>t===void 0,rf=t=>Array.isArray(t)?t.filter(Boolean):[],nf=t=>rf(t.replace(/["|']|\]/g,"").split(/\.|\[/)),ye=(t,e,n)=>{if(!e||!yt(t))return n;const o=(Vl(e)?[e]:nf(e)).reduce((l,c)=>rr(l)?void 0:l[c],t);return ct(o)||o===t?ct(t[e])?n:t[e]:o},sn=t=>typeof t=="boolean",Lr=t=>typeof t=="function",tt=(t,e,n)=>{let i=-1;const o=Vl(e)?[e]:nf(e),l=o.length,c=l-1;for(;++i{const o={};for(const l in t)Object.defineProperty(o,l,{get:()=>{const c=l;return e._proxyFormState[c]!==Kr.all&&(e._proxyFormState[c]=!i||Kr.all),t[c]}});return o};const _j=typeof window<"u"?ee.useLayoutEffect:ee.useEffect;var Qt=t=>typeof t=="string",kj=(t,e,n,i,o)=>Qt(t)?(i&&e.watch.add(t),ye(n,t,o)):Array.isArray(t)?t.map(l=>(i&&e.watch.add(l),ye(n,l))):(i&&(e.watchAll=!0),n),Ld=t=>rr(t)||!hv(t);function an(t,e,n=new WeakSet){if(t===e)return!0;if(Ld(t)||Ld(e))return Object.is(t,e);if(Ms(t)&&Ms(e))return Object.is(t.getTime(),e.getTime());const i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;if(n.has(t)||n.has(e))return!0;n.add(t),n.add(e);for(const l of i){const c=t[l];if(!(l in e))return!1;if(l!=="ref"){const f=e[l];if(Ms(c)&&Ms(f)||(yt(c)||Array.isArray(c))&&(yt(f)||Array.isArray(f))?!an(c,f,n):!Object.is(c,f))return!1}}return!0}const jj=ee.createContext(null);jj.displayName="HookFormContext";var mv=(t,e,n,i,o)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[i]:o||!0}}:{},Oa=t=>Array.isArray(t)?t:[t],Lg=()=>{let t=[];return{get observers(){return t},next:o=>{for(const l of t)l.next&&l.next(o)},subscribe:o=>(t.push(o),{unsubscribe:()=>{t=t.filter(l=>l!==o)}}),unsubscribe:()=>{t=[]}}};function gv(t,e){const n={};for(const i in t)if(t.hasOwnProperty(i)){const o=t[i],l=e[i];if(o&&yt(o)&&l){const c=gv(o,l);yt(c)&&(n[i]=c)}else t[i]&&(n[i]=l)}return n}var Wt=t=>yt(t)&&!Object.keys(t).length,sf=t=>t.type==="file",Ll=t=>{if(!tf)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},yv=t=>t.type==="select-multiple",af=t=>t.type==="radio",Cj=t=>af(t)||Za(t),Jc=t=>Ll(t)&&t.isConnected;function Ej(t,e){const n=e.slice(0,-1).length;let i=0;for(;i{for(const e in t)if(Lr(t[e]))return!0;return!1};function vv(t){return Array.isArray(t)||yt(t)&&!Pj(t)}function Ad(t,e={}){for(const n in t){const i=t[n];vv(i)?(e[n]=Array.isArray(i)?[]:{},Ad(i,e[n])):ct(i)||(e[n]=!0)}return e}function Id(t){if(t!==!1){if(t===!0)return!0;if(Array.isArray(t)){const e=t.map(n=>Id(n));return e.some(n=>n!==void 0)?e:void 0}if(yt(t)){const e={};for(const n in t){const i=Id(t[n]);ct(i)||(e[n]=i)}return Object.keys(e).length?e:void 0}}}function Ea(t,e,n){n||(n=Ad(e));for(const i in t){const o=t[i];if(vv(o))ct(e)||Ld(n[i])?n[i]=Ad(o,Array.isArray(o)?[]:{}):Ea(o,rr(e)?{}:e[i],n[i]);else{const l=e[i];n[i]=!an(o,l)}}return Id(n)||{}}const Ag={value:!1,isValid:!1},Ig={value:!0,isValid:!0};var xv=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!ct(t[0].attributes.value)?ct(t[0].value)||t[0].value===""?Ig:{value:t[0].value,isValid:!0}:Ig:Ag}return Ag},wv=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:i})=>ct(t)?t:e?t===""?NaN:t&&+t:n&&Qt(t)?new Date(t):i?i(t):t;const Fg={isValid:!1,value:null};var bv=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,Fg):Fg;function Mg(t){const e=t.ref;return sf(e)?e.files:af(e)?bv(t.refs).value:yv(e)?[...e.selectedOptions].map(({value:n})=>n):Za(e)?xv(t.refs).value:wv(ct(e.value)?t.ref.value:e.value,t)}var Oj=(t,e,n,i)=>{const o={};for(const l of t){const c=ye(e,l);c&&tt(o,l,c._f)}return{criteriaMode:n,names:[...t],fields:o,shouldUseNativeValidation:i}},Al=t=>t instanceof RegExp,ka=t=>ct(t)?t:Al(t)?t.source:yt(t)?Al(t.value)?t.value.source:t.value:t,Dg=t=>({isOnSubmit:!t||t===Kr.onSubmit,isOnBlur:t===Kr.onBlur,isOnChange:t===Kr.onChange,isOnAll:t===Kr.all,isOnTouch:t===Kr.onTouched});const $g="AsyncFunction";var Rj=t=>!!t&&!!t.validate&&!!(Lr(t.validate)&&t.validate.constructor.name===$g||yt(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===$g)),Tj=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),zg=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(i=>t.startsWith(i)&&/^\.\w+/.test(t.slice(i.length))));const Ra=(t,e,n,i)=>{for(const o of n||Object.keys(t)){const l=ye(t,o);if(l){const{_f:c,...f}=l;if(c){if(c.refs&&c.refs[0]&&e(c.refs[0],o)&&!i)return!0;if(c.ref&&e(c.ref,c.name)&&!i)return!0;if(Ra(f,e))break}else if(yt(f)&&Ra(f,e))break}}};function Ug(t,e,n){const i=ye(t,n);if(i||Vl(n))return{error:i,name:n};const o=n.split(".");for(;o.length;){const l=o.join("."),c=ye(e,l),f=ye(t,l);if(c&&!Array.isArray(c)&&n!==l)return{name:n};if(f&&f.type)return{name:l,error:f};if(f&&f.root&&f.root.type)return{name:`${l}.root`,error:f.root};o.pop()}return{name:n}}var Lj=(t,e,n,i)=>{n(t);const{name:o,...l}=t;return Wt(l)||i&&Object.keys(l).length>=Object.keys(e).length||Object.keys(l).find(c=>e[c]===(!i||Kr.all))},Aj=(t,e,n)=>!t||!e||t===e||Oa(t).some(i=>i&&(n?i===e:i.startsWith(e)||e.startsWith(i))),Ij=(t,e,n,i,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(e||t):(n?i.isOnBlur:o.isOnBlur)?!t:(n?i.isOnChange:o.isOnChange)?t:!0,Fj=(t,e)=>!rf(ye(t,e)).length&&Et(t,e),Mj=(t,e,n)=>{const i=Oa(ye(t,n));return tt(i,pv,e[n]),tt(t,n,i),t};function Vg(t,e,n="validate"){if(Qt(t)||Array.isArray(t)&&t.every(Qt)||sn(t)&&!t)return{type:n,message:Qt(t)?t:"",ref:e}}var gi=t=>yt(t)&&!Al(t)?t:{value:t,message:""},Bg=async(t,e,n,i,o,l)=>{const{ref:c,refs:f,required:h,maxLength:g,minLength:y,min:v,max:w,pattern:x,validate:j,name:_,valueAsNumber:S,mount:I}=t._f,E=ye(n,_);if(!I||e.has(_))return{};const z=f?f[0]:c,M=Z=>{o&&z.reportValidity&&(z.setCustomValidity(sn(Z)?"":Z||""),z.reportValidity())},L={},Q=af(c),le=Za(c),ue=Q||le,pe=(S||sf(c))&&ct(c.value)&&ct(E)||Ll(c)&&c.value===""||E===""||Array.isArray(E)&&!E.length||S&&typeof E=="number"&&isNaN(E),_e=mv.bind(null,_,i,L),Oe=(Z,me,he,T=Wr.maxLength,P=Wr.minLength)=>{const K=Z?me:he;L[_]={type:Z?T:P,message:K,ref:c,..._e(Z?T:P,K)}};if(l?!Array.isArray(E)||!E.length:h&&(!ue&&(pe||rr(E))||sn(E)&&!E||le&&!xv(f).isValid||Q&&!bv(f).isValid)){const{value:Z,message:me}=Qt(h)?{value:!!h,message:h}:gi(h);if(Z&&(L[_]={type:Wr.required,message:me,ref:z,..._e(Wr.required,me)},!i))return M(me),L}if(!pe&&(!rr(v)||!rr(w))){let Z,me;const he=gi(w),T=gi(v);if(!rr(E)&&!isNaN(E)){const P=c.valueAsNumber||E&&+E;rr(he.value)||(Z=P>he.value),rr(T.value)||(me=Pnew Date(new Date().toDateString()+" "+W),V=c.type=="time",H=c.type=="week";Qt(he.value)&&E&&(Z=V?K(E)>K(he.value):H?E>he.value:P>new Date(he.value)),Qt(T.value)&&E&&(me=V?K(E)+Z.value,T=!rr(me.value)&&E.length<+me.value;if((he||T)&&(Oe(he,Z.message,me.message),!i))return M(L[_].message),L}if(x&&!pe&&Qt(E)){const{value:Z,message:me}=gi(x);if(Al(Z)&&!E.match(Z)&&(L[_]={type:Wr.pattern,message:me,ref:c,..._e(Wr.pattern,me)},!i))return M(me),L}if(j){if(Lr(j)){const Z=await j(E,n),me=Vg(Z,z);if(me&&(L[_]={...me,..._e(Wr.validate,me.message)},!i))return M(me.message),L}else if(yt(j)){let Z={};for(const me in j){if(!Wt(Z)&&!i)break;const he=Vg(await j[me](E,n),z,me);he&&(Z={...he,..._e(me,he.message)},M(he.message),i&&(L[_]=Z))}if(!Wt(Z)&&(L[_]={ref:z,...Z},!i))return L}}return M(!0),L};const Dj={mode:Kr.onSubmit,reValidateMode:Kr.onChange,shouldFocusError:!0},Sv={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function $j(t={}){let e={...Dj,...t},n={...Ct(Sv),isLoading:Lr(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1},i={},o=yt(e.defaultValues)||yt(e.values)?Ct(e.defaultValues||e.values)||{}:{},l=e.shouldUnregister?{}:Ct(o),c={action:!1,mount:!1,watch:!1,keepIsValid:!1},f={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},h,g=0;const y={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={...y};let w={...v};const x={array:Lg(),state:Lg()},j=e.criteriaMode===Kr.all,_=C=>A=>{clearTimeout(g),g=setTimeout(C,A)},S=async C=>{if(!c.keepIsValid&&!e.disabled&&(v.isValid||w.isValid||C)){let A;e.resolver?(A=Wt((await pe()).errors),I()):A=await Z({fields:i,onlyCheckValid:!0,eventType:mi.VALID}),A!==n.isValid&&x.state.next({isValid:A})}},I=(C,A)=>{!e.disabled&&(v.isValidating||v.validatingFields||w.isValidating||w.validatingFields)&&((C||Array.from(f.mount)).forEach(D=>{D&&(A?tt(n.validatingFields,D,A):Et(n.validatingFields,D))}),x.state.next({validatingFields:n.validatingFields,isValidating:!Wt(n.validatingFields)}))},E=()=>{n.dirtyFields=Ea(o,l)},z=(C,A=[],D,se,ie=!0,ne=!0)=>{if(se&&D&&!e.disabled){if(c.action=!0,ne&&Array.isArray(ye(i,C))){const oe=D(ye(i,C),se.argA,se.argB);ie&&tt(i,C,oe)}if(ne&&Array.isArray(ye(n.errors,C))){const oe=D(ye(n.errors,C),se.argA,se.argB);ie&&tt(n.errors,C,oe),Fj(n.errors,C)}if((v.touchedFields||w.touchedFields)&&ne&&Array.isArray(ye(n.touchedFields,C))){const oe=D(ye(n.touchedFields,C),se.argA,se.argB);ie&&tt(n.touchedFields,C,oe)}(v.dirtyFields||w.dirtyFields)&&E(),x.state.next({name:C,isDirty:he(C,A),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else tt(l,C,A)},M=(C,A)=>{tt(n.errors,C,A),x.state.next({errors:n.errors})},L=C=>{n.errors=C,x.state.next({errors:n.errors,isValid:!1})},Q=(C,A,D,se)=>{const ie=ye(i,C);if(ie){const ne=ct(ye(l,C)),oe=ye(l,C,ct(D)?ye(o,C):D);ct(oe)||se&&se.defaultChecked||A?tt(l,C,A?oe:Mg(ie._f)):K(C,oe),c.mount&&!c.action&&(S(),ne&&n.isDirty&&(v.isDirty||w.isDirty)&&(he()||(n.isDirty=!1,x.state.next({...n}))))}},le=(C,A,D,se,ie)=>{let ne=!1,oe=!1;const Ne={name:C};if(!e.disabled){if(!D||se){(v.isDirty||w.isDirty)&&(oe=n.isDirty,n.isDirty=Ne.isDirty=he(),ne=oe!==Ne.isDirty);const De=an(ye(o,C),A);oe=!!ye(n.dirtyFields,C),De?Et(n.dirtyFields,C):tt(n.dirtyFields,C,!0),Ne.dirtyFields=n.dirtyFields,ne=ne||(v.dirtyFields||w.dirtyFields)&&oe!==!De}if(D){const De=ye(n.touchedFields,C);De||(tt(n.touchedFields,C,D),Ne.touchedFields=n.touchedFields,ne=ne||(v.touchedFields||w.touchedFields)&&De!==D)}ne&&ie&&x.state.next(Ne)}return ne?Ne:{}},ue=(C,A,D,se)=>{const ie=ye(n.errors,C),ne=(v.isValid||w.isValid)&&sn(A)&&n.isValid!==A;if(e.delayError&&D?(h=_(()=>M(C,D)),h(e.delayError)):(clearTimeout(g),h=null,D?tt(n.errors,C,D):Et(n.errors,C)),(D?!an(ie,D):ie)||!Wt(se)||ne){const oe={...se,...ne&&sn(A)?{isValid:A}:{},errors:n.errors,name:C};n={...n,...oe},x.state.next(oe)}},pe=async C=>(I(C,!0),await e.resolver(l,e.context,Oj(C||f.mount,i,e.criteriaMode,e.shouldUseNativeValidation))),_e=async C=>{const{errors:A}=await pe(C);if(I(C),C)for(const D of C){const se=ye(A,D);se?tt(n.errors,D,se):Et(n.errors,D)}else n.errors=A;return A},Oe=async({name:C,eventType:A})=>{if(t.validate){const D=await t.validate({formValues:l,formState:n,name:C,eventType:A});if(yt(D))for(const se in D)D[se]&&ke(`${Gc}.${se}`,{message:Qt(D.message)?D.message:"",type:Wr.validate});else Qt(D)||!D?ke(Gc,{message:D||"",type:Wr.validate}):Ie(Gc);return D}return!0},Z=async({fields:C,onlyCheckValid:A,name:D,eventType:se,context:ie={valid:!0,runRootValidation:!1}})=>{if(t.validate&&(ie.runRootValidation=!0,!await Oe({name:D,eventType:se})&&(ie.valid=!1,A)))return ie.valid;for(const ne in C){const oe=C[ne];if(oe){const{_f:Ne,...De}=oe;if(Ne){const ht=f.array.has(Ne.name),kt=oe._f&&Rj(oe._f);kt&&v.validatingFields&&I([Ne.name],!0);const Pt=await Bg(oe,f.disabled,l,j,e.shouldUseNativeValidation&&!A,ht);if(kt&&v.validatingFields&&I([Ne.name]),Pt[Ne.name]&&(ie.valid=!1,A)||(!A&&(ye(Pt,Ne.name)?ht?Mj(n.errors,Pt,Ne.name):tt(n.errors,Ne.name,Pt[Ne.name]):Et(n.errors,Ne.name)),t.shouldUseNativeValidation&&Pt[Ne.name]))break}!Wt(De)&&await Z({context:ie,onlyCheckValid:A,fields:De,name:ne,eventType:se})}}return ie.valid},me=()=>{for(const C of f.unMount){const A=ye(i,C);A&&(A._f.refs?A._f.refs.every(D=>!Jc(D)):!Jc(A._f.ref))&&ir(C)}f.unMount=new Set},he=(C,A)=>!e.disabled&&(C&&A&&tt(l,C,A),!an(fe(),o)),T=(C,A,D)=>kj(C,f,{...c.mount?l:ct(A)?o:Qt(C)?{[C]:A}:A},D,A),P=C=>rf(ye(c.mount?l:o,C,e.shouldUnregister?ye(o,C,[]):[])),K=(C,A,D={})=>{const se=ye(i,C);let ie=A;if(se){const ne=se._f;ne&&(!ne.disabled&&tt(l,C,wv(A,ne)),ie=Ll(ne.ref)&&rr(A)?"":A,yv(ne.ref)?[...ne.ref.options].forEach(oe=>oe.selected=ie.includes(oe.value)):ne.refs?Za(ne.ref)?ne.refs.forEach(oe=>{(!oe.defaultChecked||!oe.disabled)&&(Array.isArray(ie)?oe.checked=!!ie.find(Ne=>Ne===oe.value):oe.checked=ie===oe.value||!!ie)}):ne.refs.forEach(oe=>oe.checked=oe.value===ie):sf(ne.ref)?ne.ref.value="":(ne.ref.value=ie,ne.ref.type||x.state.next({name:C,values:Ct(l)})))}(D.shouldDirty||D.shouldTouch)&&le(C,ie,D.shouldTouch,D.shouldDirty,!0),D.shouldValidate&&ae(C)},V=(C,A,D)=>{for(const se in A){if(!A.hasOwnProperty(se))return;const ie=A[se],ne=C+"."+se,oe=ye(i,ne);(f.array.has(C)||yt(ie)||oe&&!oe._f)&&!Ms(ie)?V(ne,ie,D):K(ne,ie,D)}},H=(C,A,D={})=>{const se=ye(i,C),ie=f.array.has(C),ne=Ct(A),oe=ye(l,C),Ne=an(oe,ne);if(tt(l,C,ne),ie)x.array.next({name:C,values:Ct(l)}),(v.isDirty||v.dirtyFields||w.isDirty||w.dirtyFields)&&D.shouldDirty&&(E(),x.state.next({name:C,dirtyFields:n.dirtyFields,isDirty:he(C,ne)}));else{const De=Array.isArray(ne)&&!ne.length||Wt(ne);!se||se._f||rr(ne)||De?K(C,ne,D):V(C,ne,D)}if(!Ne){const De=zg(C,f);x.state.next({...De&&n,name:c.mount||De?C:void 0,values:Ct(l)})}},W=C=>{const A=Lr(C)?C(l):C;an(l,A)||(l={...l,...A},x.state.next({...n,values:l}))},O=async C=>{c.mount=!0;const A=C.target;let D=A.name,se=!0;const ie=ye(i,D),ne=De=>{se=Number.isNaN(De)||Ms(De)&&isNaN(De.getTime())||an(De,ye(l,D,De))},oe=Dg(e.mode),Ne=Dg(e.reValidateMode);if(ie){let De,ht;const kt=A.type?Mg(ie._f):vj(C),Pt=C.type===mi.BLUR||C.type===mi.FOCUS_OUT,Cr=!Tj(ie._f)&&!t.validate&&!e.resolver&&!ye(n.errors,D)&&!ie._f.deps||Ij(Pt,ye(n.touchedFields,D),n.isSubmitted,Ne,oe),pn=zg(D,f,Pt);tt(l,D,kt),Pt?(!A||!A.readOnly)&&(ie._f.onBlur&&ie._f.onBlur(C),h&&h(0)):ie._f.onChange&&ie._f.onChange(C);const mn=le(D,kt,Pt),In=!Wt(mn)||pn;if(!Pt&&x.state.next({name:D,type:C.type,values:Ct(l)}),Cr)return(v.isValid||w.isValid)&&(e.mode==="onBlur"?Pt&&S():Pt||S()),In&&x.state.next({name:D,...pn?{}:mn});if(!e.resolver&&t.validate&&await Oe({name:D,eventType:C.type}),!Pt&&pn&&x.state.next({...n}),e.resolver){const{errors:gn}=await pe([D]);if(I([D]),ne(kt),se){const Jr=Ug(n.errors,i,D),yr=Ug(gn,i,Jr.name||D);De=yr.error,D=yr.name,ht=Wt(gn)}}else I([D],!0),De=(await Bg(ie,f.disabled,l,j,e.shouldUseNativeValidation))[D],I([D]),ne(kt),se&&(De?ht=!1:(v.isValid||w.isValid)&&(ht=await Z({fields:i,onlyCheckValid:!0,name:D,eventType:C.type})));se&&(ie._f.deps&&(!Array.isArray(ie._f.deps)||ie._f.deps.length>0)&&ae(ie._f.deps),ue(D,ht,De,mn))}},q=(C,A)=>{if(ye(n.errors,A)&&C.focus)return C.focus(),1},ae=async(C,A={})=>{let D,se;const ie=Oa(C);if(e.resolver){const ne=await _e(ct(C)?C:ie);D=Wt(ne),se=C?!ie.some(oe=>ye(ne,oe)):D}else C?(se=(await Promise.all(ie.map(async ne=>{const oe=ye(i,ne);return await Z({fields:oe&&oe._f?{[ne]:oe}:oe,eventType:mi.TRIGGER})}))).every(Boolean),!(!se&&!n.isValid)&&S()):se=D=await Z({fields:i,name:C,eventType:mi.TRIGGER});return x.state.next({...!Qt(C)||(v.isValid||w.isValid)&&D!==n.isValid?{}:{name:C},...e.resolver||!C?{isValid:D}:{},errors:n.errors}),A.shouldFocus&&!se&&Ra(i,q,C?ie:f.mount),se},fe=(C,A)=>{let D={...c.mount?l:o};return A&&(D=gv(A.dirtyFields?n.dirtyFields:n.touchedFields,D)),ct(C)?D:Qt(C)?ye(D,C):C.map(se=>ye(D,se))},Ee=(C,A)=>({invalid:!!ye((A||n).errors,C),isDirty:!!ye((A||n).dirtyFields,C),error:ye((A||n).errors,C),isValidating:!!ye(n.validatingFields,C),isTouched:!!ye((A||n).touchedFields,C)}),Ie=C=>{const A=C?Oa(C):void 0;A?.forEach(D=>Et(n.errors,D)),A?A.forEach(D=>{x.state.next({name:D,errors:n.errors})}):x.state.next({errors:{}})},ke=(C,A,D)=>{const se=(ye(i,C,{_f:{}})._f||{}).ref,ie=ye(n.errors,C)||{},{ref:ne,message:oe,type:Ne,...De}=ie;tt(n.errors,C,{...De,...A,ref:se}),x.state.next({name:C,errors:n.errors,isValid:!1}),D&&D.shouldFocus&&se&&se.focus&&se.focus()},Ue=(C,A)=>Lr(C)?x.state.subscribe({next:D=>"values"in D&&C(D.values||T(void 0,A),D)}):T(C,A,!0),Be=C=>x.state.subscribe({next:A=>{if(Aj(C.name,A.name,C.exact)&&Lj(A,C.formState||v,ar,C.reRenderRoot)){const D={...l};C.callback({values:D,...n,...A,defaultValues:o})}}}).unsubscribe,_t=C=>(c.mount=!0,w={...w,...C.formState},Be({...C,formState:{...y,...C.formState}})),ir=(C,A={})=>{for(const D of C?Oa(C):f.mount)f.mount.delete(D),f.array.delete(D),A.keepValue||(Et(i,D),Et(l,D)),!A.keepError&&Et(n.errors,D),!A.keepDirty&&Et(n.dirtyFields,D),!A.keepTouched&&Et(n.touchedFields,D),!A.keepIsValidating&&Et(n.validatingFields,D),!e.shouldUnregister&&!A.keepDefaultValue&&Et(o,D);x.state.next({values:Ct(l)}),x.state.next({...n,...A.keepDirty?{isDirty:he()}:{}}),!A.keepIsValid&&S()},dn=({disabled:C,name:A})=>{if(sn(C)&&c.mount||C||f.disabled.has(A)){const ie=f.disabled.has(A)!==!!C;C?f.disabled.add(A):f.disabled.delete(A),ie&&c.mount&&!c.action&&S()}},Ir=(C,A={})=>{let D=ye(i,C);const se=sn(A.disabled)||sn(e.disabled),ie=!f.registerName.has(C)&&D&&D._f&&!D._f.mount;return tt(i,C,{...D||{},_f:{...D&&D._f?D._f:{ref:{name:C}},name:C,mount:!0,...A}}),f.mount.add(C),D&&!ie?dn({disabled:sn(A.disabled)?A.disabled:e.disabled,name:C}):Q(C,!0,A.value),{...se?{disabled:A.disabled||e.disabled}:{},...e.progressive?{required:!!A.required,min:ka(A.min),max:ka(A.max),minLength:ka(A.minLength),maxLength:ka(A.maxLength),pattern:ka(A.pattern)}:{},name:C,onChange:O,onBlur:O,ref:ne=>{if(ne){f.registerName.add(C),Ir(C,A),f.registerName.delete(C),D=ye(i,C);const oe=ct(ne.value)&&ne.querySelectorAll&&ne.querySelectorAll("input,select,textarea")[0]||ne,Ne=Cj(oe),De=D._f.refs||[];if(Ne?De.find(ht=>ht===oe):oe===D._f.ref)return;tt(i,C,{_f:{...D._f,...Ne?{refs:[...De.filter(Jc),oe,...Array.isArray(ye(o,C))?[{}]:[]],ref:{type:oe.type,name:C}}:{ref:oe}}}),Q(C,!1,void 0,oe)}else D=ye(i,C,{}),D._f&&(D._f.mount=!1),(e.shouldUnregister||A.shouldUnregister)&&!(xj(f.array,C)&&c.action)&&f.unMount.add(C)}}},fn=()=>e.shouldFocusError&&Ra(i,q,f.mount),Hs=C=>{sn(C)&&(x.state.next({disabled:C}),Ra(i,(A,D)=>{const se=ye(i,D);se&&(A.disabled=se._f.disabled||C,Array.isArray(se._f.refs)&&se._f.refs.forEach(ie=>{ie.disabled=se._f.disabled||C}))},0,!1))},Ln=(C,A)=>async D=>{let se;D&&(D.preventDefault&&D.preventDefault(),D.persist&&D.persist());let ie=Ct(l);if(x.state.next({isSubmitting:!0}),e.resolver){const{errors:ne,values:oe}=await pe();I(),n.errors=ne,ie=Ct(oe)}else await Z({fields:i,eventType:mi.SUBMIT});if(f.disabled.size)for(const ne of f.disabled)Et(ie,ne);if(Et(n.errors,pv),Wt(n.errors)){x.state.next({errors:{}});try{await C(ie,D)}catch(ne){se=ne}}else A&&await A({...n.errors},D),fn(),setTimeout(fn);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Wt(n.errors)&&!se,submitCount:n.submitCount+1,errors:n.errors}),se)throw se},ws=(C,A={})=>{ye(i,C)&&(ct(A.defaultValue)?H(C,Ct(ye(o,C))):(H(C,A.defaultValue),tt(o,C,Ct(A.defaultValue))),A.keepTouched||Et(n.touchedFields,C),A.keepDirty||(Et(n.dirtyFields,C),n.isDirty=A.defaultValue?he(C,Ct(ye(o,C))):he()),A.keepError||(Et(n.errors,C),v.isValid&&S()),x.state.next({...n}))},hn=(C,A={})=>{const D=C?Ct(C):o,se=Ct(D),ie=Wt(C),ne=ie?o:se;if(A.keepDefaultValues||(o=D),!A.keepValues){if(A.keepDirtyValues){const oe=new Set([...f.mount,...Object.keys(Ea(o,l))]);for(const Ne of Array.from(oe)){const De=ye(n.dirtyFields,Ne),ht=ye(l,Ne),kt=ye(ne,Ne);De&&!ct(ht)?tt(ne,Ne,ht):!De&&!ct(kt)&&H(Ne,kt)}}else{if(tf&&ct(C))for(const oe of f.mount){const Ne=ye(i,oe);if(Ne&&Ne._f){const De=Array.isArray(Ne._f.refs)?Ne._f.refs[0]:Ne._f.ref;if(Ll(De)){const ht=De.closest("form");if(ht){ht.reset();break}}}}if(A.keepFieldsRef)for(const oe of f.mount)H(oe,ye(ne,oe));else i={}}l=e.shouldUnregister?A.keepDefaultValues?Ct(o):{}:Ct(ne),x.array.next({values:{...ne}}),x.state.next({values:{...ne}})}f={mount:A.keepDirtyValues?f.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!v.isValid||!!A.keepIsValid||!!A.keepDirtyValues||!e.shouldUnregister&&!Wt(ne),c.watch=!!e.shouldUnregister,c.keepIsValid=!!A.keepIsValid,c.action=!1,A.keepErrors||(n.errors={}),x.state.next({submitCount:A.keepSubmitCount?n.submitCount:0,isDirty:ie?!1:A.keepDirty?n.isDirty:!!(A.keepDefaultValues&&!an(C,o)),isSubmitted:A.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ie?{}:A.keepDirtyValues?A.keepDefaultValues&&l?Ea(o,l):n.dirtyFields:A.keepDefaultValues&&C?Ea(o,C):A.keepDirty?n.dirtyFields:{},touchedFields:A.keepTouched?n.touchedFields:{},errors:A.keepErrors?n.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},An=(C,A)=>hn(Lr(C)?C(l):C,{...e.resetOptions,...A}),Gr=(C,A={})=>{const D=ye(i,C),se=D&&D._f;if(se){const ie=se.refs?se.refs[0]:se.ref;ie.focus&&setTimeout(()=>{ie.focus(),A.shouldSelect&&Lr(ie.select)&&ie.select()})}},ar=C=>{n={...n,...C}},gr={control:{register:Ir,unregister:ir,getFieldState:Ee,handleSubmit:Ln,setError:ke,_subscribe:Be,_runSchema:pe,_updateIsValidating:I,_focusError:fn,_getWatch:T,_getDirty:he,_setValid:S,_setFieldArray:z,_setDisabledField:dn,_setErrors:L,_getFieldArray:P,_reset:hn,_resetDefaultValues:()=>Lr(e.defaultValues)&&e.defaultValues().then(C=>{An(C,e.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:me,_disableForm:Hs,_subjects:x,_proxyFormState:v,get _fields(){return i},get _formValues(){return l},get _state(){return c},set _state(C){c=C},get _defaultValues(){return o},get _names(){return f},set _names(C){f=C},get _formState(){return n},get _options(){return e},set _options(C){e={...e,...C}}},subscribe:_t,trigger:ae,register:Ir,handleSubmit:Ln,watch:Ue,setValue:H,setValues:W,getValues:fe,reset:An,resetField:ws,clearErrors:Ie,unregister:ir,setError:ke,setFocus:Gr,getFieldState:Ee};return{...gr,formControl:gr}}function Oi(t={}){const e=ee.useRef(void 0),n=ee.useRef(void 0),[i,o]=ee.useState(()=>({...Ct(Sv),isLoading:Lr(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1,defaultValues:Lr(t.defaultValues)?void 0:t.defaultValues}));if(!e.current)if(t.formControl)e.current={...t.formControl,formState:i},t.defaultValues&&!Lr(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:c,...f}=$j(t);e.current={...f,formState:i}}const l=e.current.control;return l._options=t,_j(()=>{const c=l._subscribe({formState:l._proxyFormState,callback:()=>o({...l._formState}),reRenderRoot:!0});return o(f=>({...f,isReady:!0})),l._formState.isReady=!0,c},[l]),ee.useEffect(()=>l._disableForm(t.disabled),[l,t.disabled]),ee.useEffect(()=>{t.mode&&(l._options.mode=t.mode),t.reValidateMode&&(l._options.reValidateMode=t.reValidateMode)},[l,t.mode,t.reValidateMode]),ee.useEffect(()=>{t.errors&&(l._setErrors(t.errors),l._focusError())},[l,t.errors]),ee.useEffect(()=>{t.shouldUnregister&&l._subjects.state.next({values:l._getWatch()})},[l,t.shouldUnregister]),ee.useEffect(()=>{if(l._proxyFormState.isDirty){const c=l._getDirty();c!==i.isDirty&&l._subjects.state.next({isDirty:c})}},[l,i.isDirty]),ee.useEffect(()=>{var c;t.values&&!an(t.values,n.current)?(l._reset(t.values,{keepFieldsRef:!0,...l._options.resetOptions}),!((c=l._options.resetOptions)===null||c===void 0)&&c.keepIsValid||l._setValid(),n.current=t.values,o(f=>({...f}))):l._resetDefaultValues()},[l,t.values]),ee.useEffect(()=>{l._state.mount||(l._setValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),e.current.formState=ee.useMemo(()=>Sj(i,l),[l,i]),e.current}const Hg=(t,e,n)=>{if(t&&"reportValidity"in t){const i=ye(n,e);t.setCustomValidity(i&&i.message||""),t.reportValidity()}},_v=(t,e)=>{for(const n in e.fields){const i=e.fields[n];i&&i.ref&&"reportValidity"in i.ref?Hg(i.ref,n,t):i.refs&&i.refs.forEach(o=>Hg(o,n,t))}},zj=(t,e)=>{e.shouldUseNativeValidation&&_v(t,e);const n={};for(const i in t){const o=ye(e.fields,i),l=Object.assign(t[i]||{},{ref:o&&o.ref});if(Uj(e.names||Object.keys(t),i)){const c=Object.assign({},ye(n,i));tt(c,"root",l),tt(n,i,c)}else tt(n,i,l)}return n},Uj=(t,e)=>t.some(n=>n.startsWith(e+"."));var Vj=function(t,e){for(var n={};t.length;){var i=t[0],o=i.code,l=i.message,c=i.path.join(".");if(!n[c])if("unionErrors"in i){var f=i.unionErrors[0].errors[0];n[c]={message:f.message,type:f.code}}else n[c]={message:l,type:o};if("unionErrors"in i&&i.unionErrors.forEach(function(y){return y.errors.forEach(function(v){return t.push(v)})}),e){var h=n[c].types,g=h&&h[i.code];n[c]=mv(c,e,n,o,g?[].concat(g,i.message):i.message)}t.shift()}return n},Ri=function(t,e,n){return n===void 0&&(n={}),function(i,o,l){try{return Promise.resolve((function(c,f){try{var h=Promise.resolve(t[n.mode==="sync"?"parse":"parseAsync"](i,e)).then(function(g){return l.shouldUseNativeValidation&&_v({},l),{errors:{},values:n.raw?i:g}})}catch(g){return f(g)}return h&&h.then?h.then(void 0,f):h})(0,function(c){if((function(f){return Array.isArray(f?.errors)})(c))return{values:{},errors:zj(Vj(c.errors,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw c}))}catch(c){return Promise.reject(c)}}};const mt=B.forwardRef(({className:t,...e},n)=>m.jsx("div",{ref:n,className:xt("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));mt.displayName="Card";const Kt=B.forwardRef(({className:t,...e},n)=>m.jsx("div",{ref:n,className:xt("flex flex-col space-y-1.5 p-6",t),...e}));Kt.displayName="CardHeader";const Zt=B.forwardRef(({className:t,...e},n)=>m.jsx("h3",{ref:n,className:xt("text-lg font-semibold leading-none tracking-tight",t),...e}));Zt.displayName="CardTitle";const Gt=B.forwardRef(({className:t,...e},n)=>m.jsx("p",{ref:n,className:xt("text-sm text-muted-foreground",t),...e}));Gt.displayName="CardDescription";const gt=B.forwardRef(({className:t,...e},n)=>m.jsx("div",{ref:n,className:xt("p-6 pt-0",t),...e}));gt.displayName="CardContent";const Bj=B.forwardRef(({className:t,...e},n)=>m.jsx("div",{ref:n,className:xt("flex items-center p-6 pt-0",t),...e}));Bj.displayName="CardFooter";const zt=B.forwardRef(({className:t,type:e="text",...n},i)=>m.jsx("input",{type:e,ref:i,className:xt("flex h-10 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",t),...n}));zt.displayName="Input";const Xe=B.forwardRef(({className:t,...e},n)=>m.jsx("label",{ref:n,className:xt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t),...e}));Xe.displayName="Label";function gs({className:t,...e}){return m.jsx("div",{className:xt("animate-pulse rounded-md bg-muted",t),...e})}const Hj=ot({domain:X(),entity_types:nr(X()),predicates:nr(X()),attribute_count:Fe().int()}),qj=nr(Hj),Wj={list:()=>St.get("/domains",qj)},Qj=ot({domain:X(),entity_types:nr(X()),predicates:nr(X()),attributes:nr(X()),aliases:zl(X(),X()).default({})}),Kj={get:t=>St.get(`/ontology/${encodeURIComponent(t)}`,Qj)};function Zj(){return vs({queryKey:Je.domains.list(),queryFn:()=>Wj.list(),staleTime:1e3*60*30})}function Gj(t){return vs({queryKey:Je.ontology.byDomain(t??""),queryFn:()=>Kj.get(t),enabled:!!t,staleTime:1e3*60*30})}const Jj=/^[a-zA-Z0-9_-]+$/,Yj=ot({project_name:X().min(2,"최소 2자 이상").max(64,"최대 64자").regex(Jj,"영문/숫자/_/- 만 허용"),domain:X().min(1,"도메인을 선택하세요")});function Xj(){const t=Tn(),{t:e}=xs(),{data:n,isLoading:i,isError:o,error:l,refetch:c}=Zj(),f=hj(),{register:h,handleSubmit:g,watch:y,setValue:v,formState:{errors:w,isSubmitting:x}}=Oi({resolver:Ri(Yj),defaultValues:{project_name:"",domain:""}}),j=y("domain"),_=async S=>{const I=n?.find(E=>E.domain===S.domain);try{const E=await f.mutateAsync({project_name:S.project_name,domain:S.domain,target_entities:I?.entity_types??[]});$t.success(e("onboarding.created","프로젝트가 생성되었습니다: {{name}}",{name:E.name})),t(`/sources/${E.name}`)}catch(E){$t.error(e("onboarding.createFailed","생성 실패: {{msg}}",{msg:E.message}))}};return m.jsxs("div",{className:"mx-auto max-w-3xl px-6 py-10",children:[m.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[m.jsx(Ye,{variant:"ghost",size:"icon",onClick:()=>t("/"),"aria-label":e("common.back","이전"),children:m.jsx(Ka,{className:"h-4 w-4"})}),m.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:e("onboarding.title","새 프로젝트 만들기")})]}),m.jsxs(mt,{children:[m.jsxs(Kt,{children:[m.jsx(Zt,{children:e("onboarding.formTitle","온톨로지 도메인 선택")}),m.jsx(Gt,{children:e("onboarding.formDesc","어떤 종류의 온톨로지를 구축할지 도메인을 선택하고 프로젝트 이름을 정해주세요.")})]}),m.jsx(gt,{children:m.jsxs("form",{onSubmit:g(_),className:"space-y-6",noValidate:!0,children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx(Xe,{htmlFor:"project_name",children:e("onboarding.projectName","프로젝트 이름")}),m.jsx(zt,{id:"project_name",placeholder:"my_perfume_project","aria-invalid":!!w.project_name,...h("project_name")}),w.project_name&&m.jsx("p",{className:"text-sm text-destructive",children:w.project_name.message}),m.jsx("p",{className:"text-xs text-muted-foreground",children:e("onboarding.projectNameHint","영문, 숫자, _ , - 만 사용 (2~64자)")})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(Xe,{children:e("onboarding.domain","도메인")}),o&&m.jsx(mt,{className:"border-destructive",children:m.jsxs(gt,{className:"flex items-center justify-between gap-3 py-4",children:[m.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[m.jsx(zs,{className:"h-4 w-4"}),m.jsx("span",{children:l.message})]}),m.jsx(Ye,{variant:"outline",size:"sm",type:"button",onClick:()=>c(),children:e("common.retry","다시 시도")})]})}),i&&m.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:Array.from({length:4}).map((S,I)=>m.jsx(gs,{className:"h-24"},I))}),n&&m.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:n.map(S=>{const I=j===S.domain;return m.jsxs("button",{type:"button",onClick:()=>v("domain",S.domain,{shouldValidate:!0}),className:xt("rounded-lg border bg-card p-4 text-left transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",I&&"border-primary bg-accent/60"),children:[m.jsx("div",{className:"mb-1 font-semibold capitalize",children:S.domain}),m.jsx("div",{className:"text-xs text-muted-foreground",children:e("onboarding.domainSummary",{entities:S.entity_types.length,predicates:S.predicates.length,defaultValue:"엔티티 {{entities}}종 · 관계 {{predicates}}개"})}),m.jsxs("div",{className:"mt-2 line-clamp-2 text-xs text-muted-foreground/70",children:[S.entity_types.slice(0,5).join(", "),S.entity_types.length>5&&" …"]})]},S.domain)})}),w.domain&&m.jsx("p",{className:"text-sm text-destructive",children:w.domain.message})]}),m.jsxs("div",{className:"flex justify-end gap-3 border-t pt-4",children:[m.jsx(Ye,{type:"button",variant:"outline",onClick:()=>t("/"),disabled:x||f.isPending,children:e("common.cancel","취소")}),m.jsxs(Ye,{type:"submit",disabled:x||f.isPending,children:[f.isPending&&m.jsx(ls,{className:"h-4 w-4 animate-spin"}),e("onboarding.submit","프로젝트 만들기")]})]})]})})]})]})}const eC=ot({id:kr([X(),Fe()]).transform(String),name:X(),type:X(),base_url:X().nullable().optional(),trust_level:Fe().nullable().optional(),respect_robots_txt:Bs().nullable().optional(),rate_limit_per_minute:Fe().nullable().optional()}),tC=ot({ok:Bs(),deleted:X()}),kv={create:(t,e)=>St.post(`/projects/${encodeURIComponent(t)}/sources`,eC,e),delete:(t,e)=>St.delete(`/projects/${encodeURIComponent(t)}/sources/${encodeURIComponent(e)}`,tC)};function rC(t){const e=jr();return Zr({mutationFn:n=>kv.create(t,n),onSuccess:()=>{e.invalidateQueries({queryKey:Je.projects.detail(t)})}})}function nC(t){const e=jr();return Zr({mutationFn:n=>kv.delete(t,n),onSuccess:()=>{e.invalidateQueries({queryKey:Je.projects.detail(t)})}})}const jv=["official","review","blog","news","community","unknown"],sC=ot({name:X().min(2,"최소 2자 이상").max(64,"최대 64자").regex(/^[a-zA-Z0-9_-]+$/,"영문/숫자/_/-만 허용"),type:cv(jv),base_url:X().url("올바른 URL 형식이 아닙니다").or(uv("")).optional(),trust_level:Fe({invalid_type_error:"0~1 사이의 숫자"}).min(0).max(1),rate_limit_per_minute:Fe({invalid_type_error:"양의 정수"}).int().min(1).max(600),respect_robots_txt:Bs()});function iC(){const t=Tn(),{projectId:e}=Qa(),{t:n}=xs(),i=e??"",{data:o,isLoading:l,isError:c,error:f,refetch:h}=Ul(i),g=rC(i),y=nC(i),{register:v,handleSubmit:w,reset:x,formState:{errors:j,isSubmitting:_}}=Oi({resolver:Ri(sC),defaultValues:{name:"",type:"official",base_url:"",trust_level:.7,rate_limit_per_minute:30,respect_robots_txt:!0}}),S=async E=>{try{await g.mutateAsync({...E,base_url:E.base_url||null}),$t.success(n("sources.added","소스가 추가되었습니다: {{name}}",{name:E.name})),x()}catch(z){$t.error(n("sources.addFailed","추가 실패: {{msg}}",{msg:z.message}))}},I=async E=>{if(confirm(n("sources.confirmDelete","정말 '{{name}}' 소스를 삭제하시겠습니까?",{name:E})))try{await y.mutateAsync(E),$t.success(n("sources.deleted","소스가 삭제되었습니다: {{name}}",{name:E}))}catch(z){$t.error(n("sources.deleteFailed","삭제 실패: {{msg}}",{msg:z.message}))}};return m.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-10",children:[m.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[m.jsx(Ye,{variant:"ghost",size:"icon",onClick:()=>t("/"),"aria-label":n("common.back","이전"),children:m.jsx(Ka,{className:"h-4 w-4"})}),m.jsxs("div",{className:"flex-1",children:[m.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:n("sources.title","참고 소스 설정")}),o&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:[o.name," ",m.jsxs("span",{className:"capitalize text-muted-foreground/70",children:["· ",o.domain]})]})]}),m.jsxs(Ye,{onClick:()=>t(`/crawl/${i}`),disabled:!o||(o.sources?.length??0)===0,children:[n("sources.next","크롤 진행"),m.jsx(Dy,{className:"h-4 w-4"})]})]}),c&&m.jsx(mt,{className:"mb-6 border-destructive",children:m.jsxs(gt,{className:"flex items-center justify-between gap-3 py-4",children:[m.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[m.jsx(zs,{className:"h-4 w-4"}),m.jsx("span",{children:f.message})]}),m.jsx(Ye,{variant:"outline",size:"sm",type:"button",onClick:()=>h(),children:n("common.retry","다시 시도")})]})}),m.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_360px]",children:[m.jsx("section",{children:m.jsxs(mt,{children:[m.jsxs(Kt,{children:[m.jsx(Zt,{children:n("sources.listTitle","등록된 소스")}),m.jsx(Gt,{children:n("sources.listDesc","프로젝트 온톨로지 구축에 사용할 참고 사이트 목록")})]}),m.jsxs(gt,{children:[l&&m.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((E,z)=>m.jsx(gs,{className:"h-16"},z))}),o&&o.sources.length===0&&m.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:n("sources.empty","아직 등록된 소스가 없습니다. 오른쪽 폼에서 추가하세요.")}),o&&o.sources.length>0&&m.jsx("ul",{className:"divide-y",children:o.sources.map(E=>m.jsxs("li",{className:"flex items-center justify-between gap-4 py-3",children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"font-medium",children:E.name}),m.jsx("span",{className:"rounded bg-secondary px-1.5 py-0.5 text-xs text-secondary-foreground",children:E.type}),typeof E.trust_level=="number"&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:[n("sources.trust","신뢰도")," ",E.trust_level.toFixed(2)]})]}),E.base_url&&m.jsxs("a",{href:E.base_url,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[m.jsx(e_,{className:"h-3 w-3"}),E.base_url]})]}),m.jsx(Ye,{variant:"ghost",size:"icon",onClick:()=>I(E.name),disabled:y.isPending,"aria-label":n("sources.delete","삭제"),children:m.jsx(gd,{className:"h-4 w-4 text-destructive"})})]},E.id))})]})]})}),m.jsx("aside",{children:m.jsxs(mt,{children:[m.jsxs(Kt,{children:[m.jsx(Zt,{children:n("sources.addTitle","소스 추가")}),m.jsx(Gt,{children:n("sources.addDesc","참고할 사이트 정보를 입력하세요")})]}),m.jsx(gt,{children:m.jsxs("form",{onSubmit:w(S),className:"space-y-4",noValidate:!0,children:[m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{htmlFor:"src_name",children:n("sources.name","이름")}),m.jsx(zt,{id:"src_name",placeholder:"official_brand_site",...v("name")}),j.name&&m.jsx("p",{className:"text-xs text-destructive",children:j.name.message})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{htmlFor:"src_type",children:n("sources.type","타입")}),m.jsx("select",{id:"src_type",className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",...v("type"),children:jv.map(E=>m.jsx("option",{value:E,children:E},E))})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{htmlFor:"src_url",children:n("sources.baseUrl","Base URL")}),m.jsx(zt,{id:"src_url",placeholder:"https://example.com",type:"url",...v("base_url")}),j.base_url&&m.jsx("p",{className:"text-xs text-destructive",children:j.base_url.message})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{htmlFor:"src_trust",children:n("sources.trust","신뢰도")}),m.jsx(zt,{id:"src_trust",type:"number",step:"0.05",min:0,max:1,...v("trust_level",{valueAsNumber:!0})}),j.trust_level&&m.jsx("p",{className:"text-xs text-destructive",children:j.trust_level.message})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{htmlFor:"src_rate",children:n("sources.rateLimit","rate/분")}),m.jsx(zt,{id:"src_rate",type:"number",min:1,max:600,...v("rate_limit_per_minute",{valueAsNumber:!0})}),j.rate_limit_per_minute&&m.jsx("p",{className:"text-xs text-destructive",children:j.rate_limit_per_minute.message})]})]}),m.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[m.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-input",...v("respect_robots_txt")}),m.jsx("span",{children:n("sources.respectRobots","robots.txt 준수")})]}),m.jsxs(Ye,{type:"submit",className:"w-full",disabled:_||g.isPending,children:[g.isPending?m.jsx(ls,{className:"h-4 w-4 animate-spin"}):m.jsx(za,{className:"h-4 w-4"}),n("sources.add","소스 추가")]})]})})]})})]})]})}const En=B.forwardRef(({className:t,children:e,...n},i)=>m.jsx("select",{ref:i,className:xt("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:e}));En.displayName="Select";const Cv=B.forwardRef(({className:t,value:e=0,max:n=100,indeterminate:i,...o},l)=>{const c=Math.min(100,Math.max(0,e/n*100));return m.jsx("div",{ref:l,role:"progressbar","aria-valuemin":0,"aria-valuemax":n,"aria-valuenow":i?void 0:e,className:xt("relative h-2 w-full overflow-hidden rounded-full bg-secondary",t),...o,children:m.jsx("div",{className:xt("h-full bg-primary transition-all",i&&"w-1/3 animate-pulse"),style:i?void 0:{width:`${c}%`}})})});Cv.displayName="Progress";const aC=iv("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground",success:"border-transparent bg-green-100 text-green-800",warning:"border-transparent bg-yellow-100 text-yellow-800"}},defaultVariants:{variant:"default"}});function bi({className:t,variant:e,...n}){return m.jsx("span",{className:xt(aC({variant:e}),t),...n})}const oC=kr([X(),Fe()]).transform(String),qg=ot({url:X().optional(),status:X().optional(),page_type:X().optional(),title:X().nullable().optional(),error:X().nullable().optional()}).passthrough(),lC=ot({seed_url:X().optional(),visited_count:Fe().optional(),analyzed_count:Fe().optional(),queued_count:Fe().optional(),skipped_count:Fe().optional(),errors:nr(X()).optional(),pages:nr(qg).optional(),latest_page:qg.optional()}).passthrough(),Yc=ot({job_id:oC,status:X(),url:X().nullable().optional(),error:X().nullable().optional(),scheduled_at:X().nullable().optional(),started_at:X().nullable().optional(),finished_at:X().nullable().optional(),progress:lC.default({}),request:zl(X(),Mi()).default({})}),uC=new Set(["completed","failed","canceled"]);function Ev(t){return uC.has(t)}const of={startByProject:t=>St.post("/crawl-site/by-project",Yc,t),getJob:t=>St.get(`/crawl-site/jobs/${encodeURIComponent(t)}`,Yc),cancel:t=>St.post(`/crawl-site/jobs/${encodeURIComponent(t)}/cancel`,Yc)},Wg=2e3;function cC(){const t=jr();return Zr({mutationFn:e=>of.startByProject(e),onSuccess:e=>{t.setQueryData(Je.crawl.job(e.job_id),e)}})}function dC(t){return vs({queryKey:Je.crawl.job(t??""),queryFn:()=>of.getJob(t),enabled:!!t,refetchInterval:e=>{const n=e.state.data;return n&&Ev(n.status)?!1:Wg},refetchIntervalInBackground:!1})}function fC(){const t=jr();return Zr({mutationFn:e=>of.cancel(e),onSuccess:e=>{t.setQueryData(Je.crawl.job(e.job_id),e)}})}const hC=ot({source_name:X().min(1,"소스를 선택하세요"),url:X().url("올바른 URL 형식이 아닙니다"),max_depth:Fe().int().min(0).max(10),max_pages:Fe().int().min(1).max(500),same_domain_only:Bs()});function pC(t){switch(t){case"completed":return"success";case"failed":return"destructive";case"canceled":return"secondary";case"cancel_requested":return"warning";case"running":case"pending":return"default";default:return"outline"}}function mC({status:t}){return m.jsx(bi,{variant:pC(t),children:t})}function gC(){const t=Tn(),{projectId:e}=Qa(),{t:n}=xs(),i=e??"",{data:o,isLoading:l,isError:c,error:f,refetch:h}=Ul(i),[g,y]=B.useState(null),{data:v}=dC(g),w=cC(),x=fC(),{register:j,handleSubmit:_,setValue:S,watch:I,formState:{errors:E,isSubmitting:z}}=Oi({resolver:Ri(hC),defaultValues:{source_name:"",url:"",max_depth:2,max_pages:30,same_domain_only:!0}}),M=async V=>{try{const H=await w.mutateAsync({project_name:i,...V});y(H.job_id),$t.success(n("crawl.started","크롤이 시작되었습니다 (job #{{id}})",{id:H.job_id}))}catch(H){$t.error(n("crawl.startFailed","시작 실패: {{msg}}",{msg:H.message}))}},L=async()=>{if(g)try{await x.mutateAsync(g),$t.info(n("crawl.cancelRequested","취소 요청됨"))}catch(V){$t.error(n("crawl.cancelFailed","취소 실패: {{msg}}",{msg:V.message}))}},Q=o?.sources??[],le=I("source_name"),ue=Q.find(V=>V.name===le),pe=v?.progress,_e=pe?.visited_count??0,Oe=pe?.queued_count??0,Z=pe?.analyzed_count??0,me=pe?.errors??[],he=I("max_pages"),T=v&&he?Math.min(100,_e/he*100):0,P=v?Ev(v.status):!1,K=v&&!P;return m.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-10",children:[m.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[m.jsx(Ye,{variant:"ghost",size:"icon",onClick:()=>t(`/sources/${i}`),"aria-label":n("common.back","이전"),children:m.jsx(Ka,{className:"h-4 w-4"})}),m.jsxs("div",{className:"flex-1",children:[m.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:n("crawl.title","시드 크롤")}),o&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:[o.name,m.jsxs("span",{className:"capitalize text-muted-foreground/70",children:[" ","· ",o.domain]})]})]}),P&&v?.status==="completed"&&m.jsxs(Ye,{onClick:()=>t(`/review/${i}`),children:[n("crawl.review","결과 검토"),m.jsx(Dy,{className:"h-4 w-4"})]})]}),c&&m.jsx(mt,{className:"mb-6 border-destructive",children:m.jsxs(gt,{className:"flex items-center justify-between gap-3 py-4",children:[m.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[m.jsx(zs,{className:"h-4 w-4"}),m.jsx("span",{children:f.message})]}),m.jsx(Ye,{variant:"outline",size:"sm",type:"button",onClick:()=>h(),children:n("common.retry","다시 시도")})]})}),m.jsxs("div",{className:"grid gap-6 lg:grid-cols-[420px_1fr]",children:[m.jsxs(mt,{children:[m.jsxs(Kt,{children:[m.jsx(Zt,{children:n("crawl.formTitle","크롤 설정")}),m.jsx(Gt,{children:n("crawl.formDesc","시드 URL에서 시작해 링크를 따라가며 정보를 추출합니다")})]}),m.jsx(gt,{children:m.jsxs("form",{onSubmit:_(M),className:"space-y-4",noValidate:!0,children:[m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{htmlFor:"source_name",children:n("crawl.source","참고 소스")}),l?m.jsx(gs,{className:"h-10"}):m.jsxs(En,{id:"source_name",...j("source_name"),onChange:V=>S("source_name",V.target.value,{shouldValidate:!0}),children:[m.jsx("option",{value:"",children:n("crawl.pickSource","소스를 선택하세요...")}),Q.map(V=>m.jsxs("option",{value:V.name,children:[V.name," (",V.type,")"]},V.id))]}),Q.length===0&&!l&&m.jsxs("p",{className:"text-xs text-muted-foreground",children:[n("crawl.noSources","등록된 소스가 없습니다. 먼저 참고 소스를 추가하세요.")," ",m.jsx("button",{type:"button",className:"text-primary underline",onClick:()=>t(`/sources/${i}`),children:n("crawl.addSource","소스 추가")})]}),E.source_name&&m.jsx("p",{className:"text-xs text-destructive",children:E.source_name.message})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{htmlFor:"url",children:n("crawl.seedUrl","시드 URL")}),m.jsx(zt,{id:"url",placeholder:ue?.base_url??"https://example.com/start",...j("url")}),E.url&&m.jsx("p",{className:"text-xs text-destructive",children:E.url.message})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{htmlFor:"max_depth",children:n("crawl.maxDepth","최대 깊이")}),m.jsx(zt,{id:"max_depth",type:"number",min:0,max:10,...j("max_depth",{valueAsNumber:!0})}),E.max_depth&&m.jsx("p",{className:"text-xs text-destructive",children:E.max_depth.message})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{htmlFor:"max_pages",children:n("crawl.maxPages","최대 페이지")}),m.jsx(zt,{id:"max_pages",type:"number",min:1,max:500,...j("max_pages",{valueAsNumber:!0})}),E.max_pages&&m.jsx("p",{className:"text-xs text-destructive",children:E.max_pages.message})]})]}),m.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[m.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-input",...j("same_domain_only")}),m.jsx("span",{children:n("crawl.sameDomainOnly","동일 도메인만 따라가기")})]}),m.jsxs(Ye,{type:"submit",className:"w-full",disabled:z||w.isPending||!!K,children:[w.isPending?m.jsx(ls,{className:"h-4 w-4 animate-spin"}):m.jsx(l_,{className:"h-4 w-4"}),n("crawl.start","크롤 시작")]})]})})]}),m.jsxs(mt,{children:[m.jsx(Kt,{children:m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("div",{children:[m.jsx(Zt,{children:n("crawl.progressTitle","진행 상태")}),v&&m.jsxs(Gt,{className:"flex items-center gap-2",children:[m.jsxs("span",{children:["job #",v.job_id]}),m.jsx(mC,{status:v.status})]})]}),K&&m.jsxs(Ye,{variant:"outline",size:"sm",onClick:L,disabled:x.isPending,children:[m.jsx(YS,{className:"h-4 w-4"}),n("crawl.cancel","취소")]})]})}),m.jsxs(gt,{children:[!v&&m.jsxs("div",{className:"flex flex-col items-center gap-3 py-12 text-center text-muted-foreground",children:[m.jsx(r_,{className:"h-12 w-12 opacity-40"}),m.jsx("p",{children:n("crawl.idleHint","왼쪽에서 시드 URL을 입력하고 시작하세요")})]}),v&&m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{children:[m.jsxs("div",{className:"mb-1 flex items-center justify-between text-sm",children:[m.jsxs("span",{className:"text-muted-foreground",children:[n("crawl.visited","방문")," ",_e," / ",he]}),m.jsxs("span",{className:"text-muted-foreground",children:[n("crawl.queued","대기")," ",Oe," ·"," ",n("crawl.analyzed","분석")," ",Z]})]}),m.jsx(Cv,{value:T,indeterminate:K&&_e===0})]}),v.url&&m.jsxs("div",{className:"rounded-md bg-secondary/30 px-3 py-2 text-xs",children:[m.jsx("div",{className:"text-muted-foreground",children:n("crawl.seedUrl","시드 URL")}),m.jsx("a",{href:v.url,target:"_blank",rel:"noopener noreferrer",className:"break-all text-foreground hover:underline",children:v.url})]}),pe?.latest_page&&m.jsxs("div",{className:"rounded-md border bg-background px-3 py-2 text-xs",children:[m.jsx("div",{className:"mb-1 text-muted-foreground",children:n("crawl.latestPage","최근 페이지")}),m.jsx("div",{className:"truncate font-medium",children:pe.latest_page.title||pe.latest_page.url}),pe.latest_page.page_type&&m.jsx(bi,{variant:"outline",className:"mt-1",children:pe.latest_page.page_type})]}),v.error&&m.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive bg-destructive/5 px-3 py-2 text-sm text-destructive",children:[m.jsx(h_,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),m.jsx("span",{children:v.error})]}),me.length>0&&m.jsxs("details",{className:"rounded-md border bg-background",children:[m.jsx("summary",{className:"cursor-pointer px-3 py-2 text-sm font-medium",children:n("crawl.errorsCount","에러 {{count}}건",{count:me.length})}),m.jsx("ul",{className:"max-h-40 overflow-y-auto px-4 py-2 text-xs text-muted-foreground",children:me.map((V,H)=>m.jsx("li",{className:"border-b py-1 last:border-0",children:V},H))})]}),P&&v.status==="completed"&&m.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-700",children:[m.jsx(zy,{className:"h-4 w-4"}),n("crawl.doneHint","크롤 완료. 결과 검토로 이동하세요.")]})]})]})]})]})]})}const lf=B.forwardRef(({className:t,...e},n)=>m.jsx("textarea",{ref:n,className:xt("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",t),...e}));lf.displayName="Textarea";const Fd=kr([X(),Fe()]).transform(String),yC=ot({job_id:Fd.optional(),project_id:Fd.optional(),project_name:X().optional(),goal:X().optional(),status:X().optional(),started_at:X().nullable().optional(),finished_at:X().nullable().optional(),steps_taken:Fe().optional(),pages_visited:Fe().optional(),entities_found:Fe().optional(),claims_added:Fe().optional(),error:X().nullable().optional()}).passthrough(),Nv=ot({job_id:Fd,status:X().optional(),goal:X().nullable().optional(),seed_url:X().nullable().optional(),started_at:X().nullable().optional(),finished_at:X().nullable().optional(),steps_taken:Fe().nullable().optional(),pages_visited:Fe().nullable().optional(),entities_found:Fe().nullable().optional()}).passthrough(),vC=nr(Nv),xC=Nv.extend({trace:nr(zl(X(),Mi())).optional()}),Pv={startByProject:t=>St.post("/research/run/by-project",yC,t),listSessions:(t,e=25)=>St.get(`/projects/${encodeURIComponent(t)}/research/sessions`,vC,{query:{limit:e}}),getSession:t=>St.get(`/research/sessions/${encodeURIComponent(t)}`,xC)};function wC(t){const e=jr();return Zr({mutationFn:n=>Pv.startByProject(n),onSuccess:()=>{e.invalidateQueries({queryKey:Je.research.sessions(t)})}})}function bC(t,e=25){return vs({queryKey:Je.research.sessions(t),queryFn:()=>Pv.listSessions(t,e),enabled:!!t})}const SC=ot({source_name:X().min(1,"소스를 선택하세요"),url:X().url("올바른 URL 형식이 아닙니다").or(uv("")).optional(),goal:X().min(3,"최소 3자").max(500,"최대 500자"),max_depth:Fe().int().min(0).max(10),max_steps:Fe().int().min(1).max(50),max_branch:Fe().int().min(1).max(30),min_relevance:Fe().min(0).max(1),same_domain_only:Bs()});function _C(t){switch(t){case"completed":return"success";case"failed":return"destructive";case"canceled":return"secondary";case"running":case"pending":return"default";default:return"outline"}}function kC(){const t=Tn(),{projectId:e}=Qa(),{t:n}=xs(),i=e??"",{data:o,isLoading:l,isError:c,error:f,refetch:h}=Ul(i),g=bC(i),y=wC(i),[v,w]=B.useState(null),{register:x,handleSubmit:j,setValue:_,formState:{errors:S,isSubmitting:I}}=Oi({resolver:Ri(SC),defaultValues:{source_name:"",url:"",goal:"Semantic ontology exploration",max_depth:2,max_steps:12,max_branch:8,min_relevance:.35,same_domain_only:!0}}),E=async M=>{try{w(null);const L=await y.mutateAsync({project_name:i,source_name:M.source_name,url:M.url||void 0,goal:M.goal,max_depth:M.max_depth,max_steps:M.max_steps,max_branch:M.max_branch,min_relevance:M.min_relevance,same_domain_only:M.same_domain_only});w(L),$t.success(n("research.completed","자율 연구가 완료되었습니다"))}catch(L){$t.error(n("research.failed","실패: {{msg}}",{msg:L.message}))}},z=o?.sources??[];return m.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-10",children:[m.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[m.jsx(Ye,{variant:"ghost",size:"icon",onClick:()=>t(`/sources/${i}`),"aria-label":n("common.back","이전"),children:m.jsx(Ka,{className:"h-4 w-4"})}),m.jsxs("div",{className:"flex-1",children:[m.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold tracking-tight",children:[m.jsx($y,{className:"h-6 w-6 text-primary"}),n("research.title","자율 연구")]}),o&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:[o.name,m.jsxs("span",{className:"capitalize text-muted-foreground/70",children:[" ","· ",o.domain]})]})]})]}),c&&m.jsx(mt,{className:"mb-6 border-destructive",children:m.jsxs(gt,{className:"flex items-center justify-between gap-3 py-4",children:[m.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[m.jsx(zs,{className:"h-4 w-4"}),m.jsx("span",{children:f.message})]}),m.jsx(Ye,{variant:"outline",size:"sm",type:"button",onClick:()=>h(),children:n("common.retry","다시 시도")})]})}),m.jsxs("div",{className:"grid gap-6 lg:grid-cols-[460px_1fr]",children:[m.jsxs(mt,{children:[m.jsxs(Kt,{children:[m.jsxs(Zt,{className:"flex items-center gap-2",children:[m.jsx(d_,{className:"h-5 w-5"}),n("research.formTitle","자율 연구 설정")]}),m.jsx(Gt,{children:n("research.formDesc","AI가 시드에서 시작해 스스로 링크를 따라가며 온톨로지를 확장합니다")})]}),m.jsx(gt,{children:m.jsxs("form",{onSubmit:j(E),className:"space-y-4",noValidate:!0,children:[m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{htmlFor:"source_name",children:n("research.source","참고 소스")}),l?m.jsx(gs,{className:"h-10"}):m.jsxs(En,{id:"source_name",...x("source_name"),onChange:M=>_("source_name",M.target.value,{shouldValidate:!0}),children:[m.jsx("option",{value:"",children:n("research.pickSource","소스를 선택하세요...")}),z.map(M=>m.jsxs("option",{value:M.name,children:[M.name," (",M.type,")"]},M.id))]}),S.source_name&&m.jsx("p",{className:"text-xs text-destructive",children:S.source_name.message})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{htmlFor:"goal",children:n("research.goal","목표")}),m.jsx(lf,{id:"goal",rows:2,placeholder:n("research.goalPlaceholder","예: 인기 브랜드 향수의 노트 구성과 시즌 추천 정보 수집"),...x("goal")}),S.goal&&m.jsx("p",{className:"text-xs text-destructive",children:S.goal.message})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsxs(Xe,{htmlFor:"url",children:[n("research.seedUrl","시드 URL")," ",m.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",n("research.optional","선택"),")"]})]}),m.jsx(zt,{id:"url",placeholder:"https://example.com/start",...x("url")}),S.url&&m.jsx("p",{className:"text-xs text-destructive",children:S.url.message})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{htmlFor:"max_steps",children:n("research.maxSteps","최대 단계")}),m.jsx(zt,{id:"max_steps",type:"number",min:1,max:50,...x("max_steps",{valueAsNumber:!0})}),S.max_steps&&m.jsx("p",{className:"text-xs text-destructive",children:S.max_steps.message})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{htmlFor:"max_branch",children:n("research.maxBranch","분기 폭")}),m.jsx(zt,{id:"max_branch",type:"number",min:1,max:30,...x("max_branch",{valueAsNumber:!0})}),S.max_branch&&m.jsx("p",{className:"text-xs text-destructive",children:S.max_branch.message})]})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{htmlFor:"max_depth",children:n("research.maxDepth","최대 깊이")}),m.jsx(zt,{id:"max_depth",type:"number",min:0,max:10,...x("max_depth",{valueAsNumber:!0})})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{htmlFor:"min_relevance",children:n("research.minRelevance","최소 관련도")}),m.jsx(zt,{id:"min_relevance",type:"number",step:"0.05",min:0,max:1,...x("min_relevance",{valueAsNumber:!0})})]})]}),m.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[m.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-input",...x("same_domain_only")}),m.jsx("span",{children:n("research.sameDomainOnly","동일 도메인만 탐색")})]}),m.jsxs(Ye,{type:"submit",className:"w-full",disabled:I||y.isPending,children:[y.isPending?m.jsx(ls,{className:"h-4 w-4 animate-spin"}):m.jsx(c_,{className:"h-4 w-4"}),n("research.start","자율 연구 시작")]}),y.isPending&&m.jsx("p",{className:"text-xs text-muted-foreground",children:n("research.runningHint","장시간 걸릴 수 있습니다. 완료될 때까지 페이지를 닫지 마세요.")})]})})]}),m.jsxs("div",{className:"space-y-6",children:[m.jsxs(mt,{children:[m.jsxs(Kt,{children:[m.jsx(Zt,{children:n("research.resultTitle","최근 결과")}),m.jsx(Gt,{children:n("research.resultDesc","이번 세션에서 실행된 연구의 결과")})]}),m.jsxs(gt,{children:[!v&&!y.isPending&&m.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:n("research.idleHint","왼쪽에서 자율 연구를 시작하면 결과가 여기에 표시됩니다")}),y.isPending&&m.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 text-center text-muted-foreground",children:[m.jsx(ls,{className:"h-8 w-8 animate-spin text-primary"}),m.jsx("p",{children:n("research.runningTitle","AI가 연구 중입니다...")})]}),v&&!y.isPending&&m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-700",children:[m.jsx(zy,{className:"h-4 w-4"}),n("research.doneHint","완료")]}),m.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm sm:grid-cols-4",children:[m.jsx(fl,{label:n("research.stepsTaken","단계"),value:v.steps_taken}),m.jsx(fl,{label:n("research.pagesVisited","페이지"),value:v.pages_visited}),m.jsx(fl,{label:n("research.entitiesFound","엔티티"),value:v.entities_found}),m.jsx(fl,{label:n("research.claimsAdded","클레임"),value:v.claims_added})]}),v.error&&m.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive bg-destructive/5 px-3 py-2 text-sm text-destructive",children:[m.jsx(zs,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),m.jsx("span",{children:v.error})]}),m.jsxs("details",{className:"rounded-md border bg-background",children:[m.jsx("summary",{className:"cursor-pointer px-3 py-2 text-sm font-medium",children:n("research.rawResult","원시 응답 JSON")}),m.jsx("pre",{className:"max-h-64 overflow-auto px-4 py-2 text-xs text-muted-foreground",children:JSON.stringify(v,null,2)})]})]})]})]}),m.jsxs(mt,{children:[m.jsxs(Kt,{children:[m.jsxs(Zt,{className:"flex items-center gap-2",children:[m.jsx(n_,{className:"h-5 w-5"}),n("research.historyTitle","세션 이력")]}),m.jsx(Gt,{children:n("research.historyDesc","이 프로젝트의 자율 연구 세션 기록")})]}),m.jsxs(gt,{children:[g.isLoading&&m.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((M,L)=>m.jsx(gs,{className:"h-12"},L))}),g.data&&g.data.length===0&&m.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:n("research.historyEmpty","아직 실행된 세션이 없습니다")}),g.data&&g.data.length>0&&m.jsx("ul",{className:"divide-y",children:g.data.map(M=>m.jsxs("li",{className:"flex items-center justify-between gap-3 py-3 text-sm",children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("span",{className:"font-medium",children:["#",M.job_id]}),M.status&&m.jsx(bi,{variant:_C(M.status),children:M.status})]}),M.goal&&m.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:M.goal})]}),m.jsxs("div",{className:"text-right text-xs text-muted-foreground",children:[typeof M.pages_visited=="number"&&m.jsxs("div",{children:[M.pages_visited," ",n("research.pages","페이지")]}),M.started_at&&m.jsx("div",{children:new Date(M.started_at).toLocaleString()})]})]},M.job_id))})]})]})]})]})]})}function fl({label:t,value:e}){return m.jsxs("div",{className:"rounded-md border bg-background px-3 py-2",children:[m.jsx("div",{className:"text-xs text-muted-foreground",children:t}),m.jsx("div",{className:"mt-1 text-xl font-semibold",children:typeof e=="number"?e:"—"})]})}const Ov=B.createContext(null);function Rv(){const t=B.useContext(Ov);if(!t)throw new Error("Tabs primitives must be used within ");return t}function jC({value:t,onValueChange:e,className:n,children:i}){return m.jsx(Ov.Provider,{value:{value:t,onChange:e},children:m.jsx("div",{className:xt("flex flex-col gap-3",n),children:i})})}function CC({className:t,children:e}){return m.jsx("div",{role:"tablist",className:xt("inline-flex h-10 items-center justify-start gap-1 rounded-md bg-muted p-1 text-muted-foreground",t),children:e})}function Xc({value:t,children:e,className:n}){const i=Rv(),o=i.value===t;return m.jsx("button",{role:"tab",type:"button","aria-selected":o,onClick:()=>i.onChange(t),className:xt("inline-flex items-center justify-center whitespace-nowrap rounded px-3 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",o?"bg-background text-foreground shadow-sm":"hover:text-foreground",n),children:e})}function ed({value:t,children:e,className:n}){return Rv().value!==t?null:m.jsx("div",{role:"tabpanel",className:xt("focus-visible:outline-none",n),children:e})}const Tv=kr([X(),Fe()]).transform(String),Lv=ot({id:Tv,type:X(),name:X(),metadata:zl(X(),Mi()).default({})}),EC=nr(Lv),NC=ot({created:Fe(),entities:nr(ot({id:Tv,type:X(),name:X()}))}),Av=ot({ok:Bs(),deleted:kr([X(),Fe()])}),Bl={list:(t,e,n=200)=>St.get(`/projects/${encodeURIComponent(t)}/entities`,EC,{query:{limit:n,...e?{entity_type:e}:{}}}),create:(t,e)=>St.post(`/projects/${encodeURIComponent(t)}/entities`,Lv,e),bulkCreate:(t,e)=>St.post(`/projects/${encodeURIComponent(t)}/entities/bulk`,NC,e),delete:(t,e)=>St.delete(`/projects/${encodeURIComponent(t)}/entities/${e}`,Av)};function PC(t,e){return vs({queryKey:Je.entities.list(t,e),queryFn:()=>Bl.list(t,e),enabled:!!t})}function OC(t){const e=jr();return Zr({mutationFn:n=>Bl.create(t,n),onSuccess:()=>{e.invalidateQueries({queryKey:Je.entities.all})}})}function RC(t){const e=jr();return Zr({mutationFn:n=>Bl.bulkCreate(t,n),onSuccess:()=>{e.invalidateQueries({queryKey:Je.entities.all})}})}function TC(t){const e=jr();return Zr({mutationFn:n=>Bl.delete(t,n),onSuccess:()=>{e.invalidateQueries({queryKey:Je.entities.all}),e.invalidateQueries({queryKey:Je.claims.all})}})}const Iv=kr([X(),Fe()]).transform(String),LC=ot({id:Iv,subject:X().optional(),subject_type:X().optional(),predicate:X(),object:X().nullable().optional(),object_value:Mi().nullable().optional(),source:X().nullable().optional(),page_url:X().nullable().optional(),confidence:Fe().optional(),confidence_reason:X().nullable().optional(),status:X().optional(),evidence_text:X().nullable().optional(),evidence_summary:X().nullable().optional(),last_seen_at:X().optional()}).passthrough(),AC=nr(LC),IC=ot({id:Iv,subject_entity_id:kr([X(),Fe()]).transform(String),predicate:X(),object_entity_id:kr([X(),Fe(),oj()]).nullable().optional(),object_value:Mi().nullable().optional(),confidence:Fe(),status:X()}),uf={list:(t,e={})=>St.get(`/projects/${encodeURIComponent(t)}/claims`,AC,{query:{limit:e.limit??100,include_candidates:e.includeCandidates,status:e.status}}),create:(t,e)=>St.post(`/projects/${encodeURIComponent(t)}/claims`,IC,e),delete:(t,e)=>St.delete(`/projects/${encodeURIComponent(t)}/claims/${e}`,Av)};function FC(t,e={}){return vs({queryKey:Je.claims.list(t,e.status),queryFn:()=>uf.list(t,{status:e.status,includeCandidates:e.includeCandidates}),enabled:!!t})}function MC(t){const e=jr();return Zr({mutationFn:n=>uf.create(t,n),onSuccess:()=>{e.invalidateQueries({queryKey:Je.claims.all})}})}function DC(t){const e=jr();return Zr({mutationFn:n=>uf.delete(t,n),onSuccess:()=>{e.invalidateQueries({queryKey:Je.claims.all})}})}const $C=ot({entity_type:X().min(1,"타입을 선택하세요"),name:X().min(1,"이름을 입력하세요").max(240)}),zC=ot({source_name:X().min(1,"소스를 선택하세요"),subject_entity_id:Fe().int().min(1,"주어 엔티티 선택"),predicate:X().min(1,"술어를 선택하세요"),object_kind:cv(["entity","value"]),object_entity_id:Fe().int().nullable().optional(),object_value:X().optional(),confidence:Fe().min(0).max(1)});function UC(){const t=Tn(),{projectId:e}=Qa(),{t:n}=xs(),i=e??"",[o,l]=B.useState("entities"),{data:c,isLoading:f,isError:h,error:g,refetch:y}=Ul(i),{data:v}=Gj(c?.domain),w=PC(i),x=FC(i,{includeCandidates:!0}),j=OC(i),_=RC(i),S=TC(i),I=MC(i),E=DC(i),z=c?.sources??[],M=B.useMemo(()=>v?.entity_types?.length?v.entity_types:["Entity","Concept","Attribute"],[v]),L=B.useMemo(()=>v?.predicates?.length?v.predicates:["hasAttribute","relatedTo","sameAs"],[v]),Q=Oi({resolver:Ri($C),defaultValues:{entity_type:"",name:""}}),le=async P=>{try{await j.mutateAsync({entity_type:P.entity_type,name:P.name}),$t.success(n("editor.entityAdded","엔티티가 추가되었습니다: {{name}}",{name:P.name})),Q.reset({entity_type:P.entity_type,name:""})}catch(K){$t.error(n("editor.entityAddFailed","추가 실패: {{msg}}",{msg:K.message}))}},ue=Oi({resolver:Ri(zC),defaultValues:{source_name:"",subject_entity_id:0,predicate:"",object_kind:"entity",object_entity_id:null,object_value:"",confidence:1}}),pe=ue.watch("object_kind"),_e=async P=>{try{await I.mutateAsync({source_name:P.source_name,subject_entity_id:P.subject_entity_id,predicate:P.predicate,object_entity_id:P.object_kind==="entity"?P.object_entity_id:null,object_value:P.object_kind==="value"?P.object_value:void 0,confidence:P.confidence}),$t.success(n("editor.claimAdded","클레임이 추가되었습니다")),ue.reset({...ue.getValues(),object_entity_id:null,object_value:""})}catch(K){$t.error(n("editor.claimAddFailed","추가 실패: {{msg}}",{msg:K.message}))}},[Oe,Z]=B.useState(JSON.stringify({entities:[{entity_type:"Entity",name:"Example A"},{entity_type:"Entity",name:"Example B"}]},null,2)),[me,he]=B.useState(null),T=async()=>{he(null);try{const P=JSON.parse(Oe),K=Array.isArray(P.entities)?P.entities:Array.isArray(P)?P:null;if(!K||K.length===0)throw new Error("최상위에 entities 배열이 있어야 합니다");const V=K.map((W,O)=>{if(typeof W!="object"||W===null||typeof W.entity_type!="string"||typeof W.name!="string")throw new Error(`항목 [${O}]에 entity_type/name 문자열이 필요합니다`);return{entity_type:W.entity_type,name:W.name,metadata:typeof W.metadata=="object"&&W.metadata!==null?W.metadata:{}}}),H=await _.mutateAsync({entities:V});$t.success(n("editor.bulkAdded","{{count}}개 엔티티가 추가되었습니다",{count:H.created}))}catch(P){he(P.message)}};return m.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-10",children:[m.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[m.jsx(Ye,{variant:"ghost",size:"icon",onClick:()=>t(`/sources/${i}`),"aria-label":n("common.back","이전"),children:m.jsx(Ka,{className:"h-4 w-4"})}),m.jsxs("div",{className:"flex-1",children:[m.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold tracking-tight",children:[m.jsx(Uy,{className:"h-6 w-6 text-primary"}),n("editor.title","온톨로지 직접 편집")]}),c&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:[c.name,m.jsxs("span",{className:"capitalize text-muted-foreground/70",children:[" ","· ",c.domain]})]})]})]}),h&&m.jsx(mt,{className:"mb-6 border-destructive",children:m.jsxs(gt,{className:"flex items-center justify-between gap-3 py-4",children:[m.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[m.jsx(zs,{className:"h-4 w-4"}),m.jsx("span",{children:g.message})]}),m.jsx(Ye,{variant:"outline",size:"sm",type:"button",onClick:()=>y(),children:n("common.retry","다시 시도")})]})}),m.jsxs(jC,{value:o,onValueChange:P=>l(P),children:[m.jsxs(CC,{children:[m.jsxs(Xc,{value:"entities",children:[n("editor.entitiesTab","엔티티")," (",w.data?.length??0,")"]}),m.jsxs(Xc,{value:"claims",children:[m.jsx(i_,{className:"mr-1 h-4 w-4"}),n("editor.claimsTab","클레임")," (",x.data?.length??0,")"]}),m.jsxs(Xc,{value:"bulk",children:[m.jsx(eg,{className:"mr-1 h-4 w-4"}),n("editor.bulkTab","JSON 일괄 입력")]})]}),m.jsx(ed,{value:"entities",children:m.jsxs("div",{className:"grid gap-6 lg:grid-cols-[380px_1fr]",children:[m.jsxs(mt,{children:[m.jsxs(Kt,{children:[m.jsx(Zt,{children:n("editor.addEntity","엔티티 추가")}),m.jsx(Gt,{children:n("editor.addEntityDesc","온톨로지 도메인의 entity_types 중에서 선택")})]}),m.jsx(gt,{children:m.jsxs("form",{onSubmit:Q.handleSubmit(le),className:"space-y-3",noValidate:!0,children:[m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{children:n("editor.entityType","타입")}),m.jsxs(En,{...Q.register("entity_type"),children:[m.jsx("option",{value:"",children:n("editor.pickType","타입 선택...")}),M.map(P=>m.jsx("option",{value:P,children:P},P))]}),Q.formState.errors.entity_type&&m.jsx("p",{className:"text-xs text-destructive",children:Q.formState.errors.entity_type.message})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{children:n("editor.entityName","이름")}),m.jsx(zt,{placeholder:"Chanel No.5",...Q.register("name")}),Q.formState.errors.name&&m.jsx("p",{className:"text-xs text-destructive",children:Q.formState.errors.name.message})]}),m.jsxs(Ye,{type:"submit",className:"w-full",disabled:j.isPending,children:[j.isPending?m.jsx(ls,{className:"h-4 w-4 animate-spin"}):m.jsx(za,{className:"h-4 w-4"}),n("editor.add","추가")]})]})})]}),m.jsxs(mt,{children:[m.jsxs(Kt,{children:[m.jsx(Zt,{children:n("editor.entitiesList","엔티티 목록")}),m.jsx(Gt,{children:w.data?n("editor.entityCount","{{count}}개",{count:w.data.length}):n("dashboard.loadFailed","")})]}),m.jsxs(gt,{children:[w.isLoading&&m.jsx("div",{className:"space-y-2",children:Array.from({length:4}).map((P,K)=>m.jsx(gs,{className:"h-10"},K))}),w.data&&w.data.length===0&&m.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:n("editor.entitiesEmpty","아직 등록된 엔티티가 없습니다")}),w.data&&w.data.length>0&&m.jsx("ul",{className:"max-h-[600px] divide-y overflow-y-auto",children:w.data.map(P=>m.jsxs("li",{className:"flex items-center justify-between gap-3 py-2 text-sm",children:[m.jsx("div",{className:"min-w-0 flex-1",children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(bi,{variant:"outline",children:P.type}),m.jsx("span",{className:"truncate font-medium",children:P.name})]})}),m.jsx(Ye,{variant:"ghost",size:"icon",onClick:()=>{confirm(n("editor.confirmDeleteEntity","엔티티 '{{name}}'을 삭제하시겠습니까?",{name:P.name}))&&S.mutate(P.id)},disabled:S.isPending,children:m.jsx(gd,{className:"h-4 w-4 text-destructive"})})]},P.id))})]})]})]})}),m.jsx(ed,{value:"claims",children:m.jsxs("div",{className:"grid gap-6 lg:grid-cols-[420px_1fr]",children:[m.jsxs(mt,{children:[m.jsxs(Kt,{children:[m.jsx(Zt,{children:n("editor.addClaim","클레임 추가")}),m.jsx(Gt,{children:n("editor.addClaimDesc","주어-술어-목적어 형태로 직접 입력")})]}),m.jsx(gt,{children:m.jsxs("form",{onSubmit:ue.handleSubmit(_e),className:"space-y-3",noValidate:!0,children:[m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{children:n("editor.source","소스")}),m.jsxs(En,{...ue.register("source_name"),children:[m.jsx("option",{value:"",children:n("editor.pickSource","소스 선택...")}),z.map(P=>m.jsx("option",{value:P.name,children:P.name},P.id))]}),ue.formState.errors.source_name&&m.jsx("p",{className:"text-xs text-destructive",children:ue.formState.errors.source_name.message})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{children:n("editor.subject","주어 (Subject)")}),m.jsxs(En,{...ue.register("subject_entity_id",{valueAsNumber:!0}),children:[m.jsx("option",{value:0,children:n("editor.pickSubject","엔티티 선택...")}),w.data?.map(P=>m.jsxs("option",{value:P.id,children:["[",P.type,"] ",P.name]},P.id))]}),ue.formState.errors.subject_entity_id&&m.jsx("p",{className:"text-xs text-destructive",children:ue.formState.errors.subject_entity_id.message})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{children:n("editor.predicate","술어 (Predicate)")}),m.jsxs(En,{...ue.register("predicate"),children:[m.jsx("option",{value:"",children:n("editor.pickPredicate","술어 선택...")}),L.map(P=>m.jsx("option",{value:P,children:P},P))]})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{children:n("editor.objectKind","목적어 유형")}),m.jsxs(En,{...ue.register("object_kind"),children:[m.jsx("option",{value:"entity",children:n("editor.objectEntity","다른 엔티티")}),m.jsx("option",{value:"value",children:n("editor.objectValue","리터럴 값")})]})]}),pe==="entity"?m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{children:n("editor.objectEntity","목적 엔티티")}),m.jsxs(En,{...ue.register("object_entity_id",{valueAsNumber:!0,setValueAs:P=>P===""||P===null||P===void 0?null:Number(P)}),children:[m.jsx("option",{value:"",children:n("editor.pickObject","엔티티 선택...")}),w.data?.map(P=>m.jsxs("option",{value:P.id,children:["[",P.type,"] ",P.name]},P.id))]})]}):m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{children:n("editor.objectValue","값")}),m.jsx(zt,{placeholder:"2024-01-15 또는 임의 문자열",...ue.register("object_value")})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx(Xe,{children:n("editor.confidence","신뢰도")}),m.jsx(zt,{type:"number",step:"0.05",min:0,max:1,...ue.register("confidence",{valueAsNumber:!0})})]}),m.jsxs(Ye,{type:"submit",className:"w-full",disabled:I.isPending,children:[I.isPending?m.jsx(ls,{className:"h-4 w-4 animate-spin"}):m.jsx(za,{className:"h-4 w-4"}),n("editor.add","추가")]})]})})]}),m.jsxs(mt,{children:[m.jsxs(Kt,{children:[m.jsx(Zt,{children:n("editor.claimsList","클레임 목록")}),m.jsx(Gt,{children:x.data&&n("editor.claimCount","{{count}}개",{count:x.data.length})})]}),m.jsxs(gt,{children:[x.isLoading&&m.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((P,K)=>m.jsx(gs,{className:"h-12"},K))}),x.data&&x.data.length===0&&m.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:n("editor.claimsEmpty","아직 등록된 클레임이 없습니다")}),x.data&&x.data.length>0&&m.jsx("ul",{className:"max-h-[600px] divide-y overflow-y-auto",children:x.data.map(P=>m.jsxs("li",{className:"flex items-start justify-between gap-3 py-3 text-sm",children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsx("span",{className:"font-medium",children:P.subject??"?"}),m.jsx(bi,{variant:"secondary",children:P.predicate}),m.jsx("span",{className:"font-medium",children:P.object??String(P.object_value??"—")})]}),m.jsxs("div",{className:"mt-1 flex flex-wrap gap-2 text-xs text-muted-foreground",children:[m.jsxs("span",{children:[n("editor.source","소스"),": ",P.source??"—"]}),typeof P.confidence=="number"&&m.jsxs("span",{children:[n("editor.confidence","신뢰도"),":"," ",P.confidence.toFixed(2)]}),P.status&&m.jsx(bi,{variant:"outline",children:P.status})]})]}),m.jsx(Ye,{variant:"ghost",size:"icon",onClick:()=>{confirm(n("editor.confirmDeleteClaim","클레임을 삭제하시겠습니까?"))&&E.mutate(P.id)},children:m.jsx(gd,{className:"h-4 w-4 text-destructive"})})]},P.id))})]})]})]})}),m.jsx(ed,{value:"bulk",children:m.jsxs(mt,{children:[m.jsxs(Kt,{children:[m.jsx(Zt,{children:n("editor.bulkTitle","JSON 일괄 입력")}),m.jsx(Gt,{children:n("editor.bulkDesc","{ entities: [{ entity_type, name, metadata? }] } 형태의 JSON")})]}),m.jsxs(gt,{className:"space-y-3",children:[m.jsx(lf,{value:Oe,onChange:P=>Z(P.target.value),rows:12,className:"font-mono text-xs"}),me&&m.jsx("p",{className:"text-sm text-destructive",children:me}),m.jsxs(Ye,{onClick:T,disabled:_.isPending||f,children:[_.isPending?m.jsx(ls,{className:"h-4 w-4 animate-spin"}):m.jsx(eg,{className:"h-4 w-4"}),n("editor.bulkSubmit","일괄 추가")]})]})]})})]})]})}function VC(){const t=Tn(),{projectId:e}=Qa(),{t:n}=xs();return m.jsx("div",{className:"min-h-screen bg-gray-50 p-4",children:m.jsxs("div",{className:"max-w-4xl mx-auto",children:[m.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:n("Review & Validate")}),m.jsx("p",{className:"text-gray-600 mb-6",children:n("Step 4 of 4: Review extracted entities and relations")}),m.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[m.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[m.jsx("h3",{className:"font-semibold text-lg mb-2",children:n("Phase 5 Entity Merges")}),m.jsx("p",{className:"text-gray-500",children:n("Review merge suggestions")})]}),m.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[m.jsx("h3",{className:"font-semibold text-lg mb-2",children:n("Phase 7 Extractions")}),m.jsx("p",{className:"text-gray-500",children:n("Validate extracted claims")})]})]}),m.jsxs("div",{className:"flex gap-4",children:[m.jsx("button",{onClick:()=>t(`/crawl/${e}`),className:"flex-1 px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition",children:n("Back")}),m.jsx("button",{onClick:()=>t("/"),className:"flex-1 px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition",children:n("Complete")})]})]})})}function BC(t){const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleString()}function HC(){const t=Tn(),{t:e}=xs(),{data:n,isLoading:i,isError:o,error:l,refetch:c}=dv();return m.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-10",children:[m.jsxs("div",{className:"mb-8 flex items-start justify-between",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:e("dashboard.title","Ontology Builder")}),m.jsx("p",{className:"mt-2 text-muted-foreground",children:e("dashboard.subtitle","Build and manage domain ontologies with AI-powered extraction")})]}),m.jsxs(Ye,{onClick:()=>t("/onboard"),children:[m.jsx(za,{className:"h-4 w-4"}),e("dashboard.newProject","New Project")]})]}),m.jsxs("section",{children:[m.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[m.jsx("h2",{className:"text-lg font-semibold",children:e("dashboard.projects","Projects")}),n&&m.jsx("span",{className:"text-sm text-muted-foreground",children:e("dashboard.projectCount","{{count}} total",{count:n.length})})]}),i&&m.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:3}).map((f,h)=>m.jsx(gs,{className:"h-32"},h))}),o&&m.jsxs(mt,{className:"border-destructive",children:[m.jsxs(Kt,{children:[m.jsxs(Zt,{className:"flex items-center gap-2 text-destructive",children:[m.jsx(zs,{className:"h-5 w-5"}),e("dashboard.loadFailed","Failed to load projects")]}),m.jsx(Gt,{children:l.message})]}),m.jsx(gt,{children:m.jsx(Ye,{variant:"outline",onClick:()=>c(),children:e("common.retry","Retry")})})]}),n&&n.length===0&&m.jsx(mt,{children:m.jsxs(gt,{className:"flex flex-col items-center gap-4 py-12 text-center",children:[m.jsx(t_,{className:"h-12 w-12 text-muted-foreground"}),m.jsxs("div",{children:[m.jsx("p",{className:"font-medium",children:e("dashboard.empty.title","No projects yet")}),m.jsx("p",{className:"text-sm text-muted-foreground",children:e("dashboard.empty.hint","Create your first project to start building an ontology")})]}),m.jsxs(Ye,{onClick:()=>t("/onboard"),children:[m.jsx(za,{className:"h-4 w-4"}),e("dashboard.newProject","New Project")]})]})}),n&&n.length>0&&m.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:n.map(f=>m.jsxs(mt,{role:"button",tabIndex:0,onClick:()=>t(`/sources/${f.name}`),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&t(`/sources/${f.name}`)},className:"cursor-pointer transition-colors hover:bg-accent/40",children:[m.jsxs(Kt,{children:[m.jsx(Zt,{children:f.name}),m.jsx(Gt,{children:f.domain})]}),m.jsxs(gt,{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[m.jsx(XS,{className:"h-3 w-3"}),BC(f.updated_at)]})]},f.id))})]})]})}function qC(){return m.jsx(iw,{children:m.jsxs(Cn,{element:m.jsx(yj,{}),children:[m.jsx(Cn,{path:"/",element:m.jsx(HC,{})}),m.jsx(Cn,{path:"/onboard",element:m.jsx(Xj,{})}),m.jsx(Cn,{path:"/sources/:projectId",element:m.jsx(iC,{})}),m.jsx(Cn,{path:"/crawl/:projectId",element:m.jsx(gC,{})}),m.jsx(Cn,{path:"/research/:projectId",element:m.jsx(kC,{})}),m.jsx(Cn,{path:"/editor/:projectId",element:m.jsx(UC,{})}),m.jsx(Cn,{path:"/review/:projectId",element:m.jsx(VC,{})})]})})}const Fv={name:"",domain:"",format:null,fileName:null,rawText:""},WC={draft:Fv,isDirty:!1},QC=Gd({name:"ontology",initialState:WC,reducers:{updateDraft:(t,e)=>{t.draft={...t.draft,...e.payload},t.isDirty=!0},resetDraft:t=>{t.draft=Fv,t.isDirty=!1},markClean:t=>{t.isDirty=!1}}}),KC=QC.reducer,ZC={activeJobId:null,expandedStep:null,showLogs:!0,autoScrollLogs:!0},GC=Gd({name:"crawl",initialState:ZC,reducers:{setActiveJob:(t,e)=>{t.activeJobId=e.payload},expandStep:(t,e)=>{t.expandedStep=e.payload},toggleLogs:t=>{t.showLogs=!t.showLogs},setAutoScroll:(t,e)=>{t.autoScrollLogs=e.payload}}}),JC=GC.reducer,YC=B_({reducer:{ontology:KC,crawl:JC,ui:tk}}),XC=new Ww({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1e3*60*10,retry:1},mutations:{retry:1}}});$x.createRoot(document.getElementById("root")).render(m.jsx(ee.StrictMode,{children:m.jsx(u1,{store:YC,children:m.jsx(Qw,{client:XC,children:m.jsxs(hw,{basename:"/static/",children:[m.jsx(qC,{}),m.jsx(Rb,{position:"top-right"})]})})})})); //# sourceMappingURL=index-DTEQpvfm.js.map