@lunora/studio 1.0.0-alpha.15 → 1.0.0-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -248,7 +248,7 @@ Use (?: \u2026 ) instead`);if(!z.lineBreaks&&te.test(`
248
248
  `))throw new Error("Rule should declare lineBreaks: "+te);D.push(c(X))}}var se=U&&U.fallback,J=o&&!se?"ym":"gm",ne=o||se?"":"|";j===!0&&(J+="u");var pe=new RegExp(d(D)+ne,J);return{regexp:pe,groups:N,fast:W,error:U||b}}n(S,"compileRules");function w(M){var L=S(y(M));return new E({start:L},"start")}n(w,"compile");function C(M,L,U){var W=M&&(M.push||M.next);if(W&&!U[W])throw new Error("Missing state '"+W+"' (in token '"+M.defaultType+"' of state '"+L+"')");if(M&&M.pop&&+M.pop!=1)throw new Error("pop must be 1 (in token '"+M.defaultType+"' of state '"+L+"')")}n(C,"checkStateGroup");function F(M,L){var U=M.$all?y(M.$all):[];delete M.$all;var W=Object.getOwnPropertyNames(M);L||(L=W[0]);for(var V=Object.create(null),j=0;j<W.length;j++){var N=W[j];V[N]=y(M[N]).concat(U)}for(var j=0;j<W.length;j++)for(var N=W[j],D=V[N],B=Object.create(null),z=0;z<D.length;z++){var q=D[z];if(q.include){var H=[z,1];if(q.include!==N&&!B[q.include]){B[q.include]=!0;var Y=V[q.include];if(!Y)throw new Error("Cannot include nonexistent state '"+q.include+"' (in state '"+N+"')");for(var Q=0;Q<Y.length;Q++){var X=Y[Q];D.indexOf(X)===-1&&H.push(X)}}D.splice.apply(D,H),z--}}for(var te=Object.create(null),j=0;j<W.length;j++){var N=W[j];te[N]=S(V[N],!0)}for(var j=0;j<W.length;j++){for(var ae=W[j],se=te[ae],J=se.groups,z=0;z<J.length;z++)C(J[z],ae,te);for(var ne=Object.getOwnPropertyNames(se.fast),z=0;z<ne.length;z++)C(se.fast[ne[z]],ae,te)}return new E(te,L)}n(F,"compileStates");function T(M){for(var L=typeof Map<"u",U=L?new Map:Object.create(null),W=Object.getOwnPropertyNames(M),V=0;V<W.length;V++){var j=W[V],N=M[j],D=Array.isArray(N)?N:[N];D.forEach(function(B){if(typeof B!="string")throw new Error("keyword must be string (in keyword '"+j+"')");L?U.set(B,j):U[B]=j})}return function(B){return L?U.get(B):U[B]}}n(T,"keywordTransform");var E=n(function(M,L){this.startState=L,this.states=M,this.buffer="",this.stack=[],this.reset()},"Lexer");E.prototype.reset=function(M,L){return this.buffer=M||"",this.index=0,this.line=L?L.line:1,this.col=L?L.col:1,this.queuedToken=L?L.queuedToken:null,this.queuedText=L?L.queuedText:"",this.queuedThrow=L?L.queuedThrow:null,this.setState(L?L.state:this.startState),this.stack=L&&L.stack?L.stack.slice():[],this},E.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},E.prototype.setState=function(M){if(!(!M||this.state===M)){this.state=M;var L=this.states[M];this.groups=L.groups,this.error=L.error,this.re=L.regexp,this.fast=L.fast}},E.prototype.popState=function(){this.setState(this.stack.pop())},E.prototype.pushState=function(M){this.stack.push(this.state),this.setState(M)};var k=o?function(M,L){return M.exec(L)}:function(M,L){var U=M.exec(L);return U[0].length===0?null:U};E.prototype._getGroup=function(M){for(var L=this.groups.length,U=0;U<L;U++)if(M[U+1]!==void 0)return this.groups[U];throw new Error("Cannot find token type for matched text")};function P(){return this.value}if(n(P,"tokenToString"),E.prototype.next=function(){var M=this.index;if(this.queuedGroup){var L=this._token(this.queuedGroup,this.queuedText,M);return this.queuedGroup=null,this.queuedText="",L}var U=this.buffer;if(M!==U.length){var N=this.fast[U.charCodeAt(M)];if(N)return this._token(N,U.charAt(M),M);var W=this.re;W.lastIndex=M;var V=k(W,U),j=this.error;if(V==null)return this._token(j,U.slice(M,U.length),M);var N=this._getGroup(V),D=V[0];return j.fallback&&V.index!==M?(this.queuedGroup=N,this.queuedText=D,this._token(j,U.slice(M,V.index),M)):this._token(N,D,M)}},E.prototype._token=function(M,L,U){var W=0;if(M.lineBreaks){var V=/\n/g,j=1;if(L===`
249
249
  `)W=1;else for(;V.exec(L);)W++,j=V.lastIndex}var N={type:typeof M.type=="function"&&M.type(L)||M.defaultType,value:typeof M.value=="function"?M.value(L):L,text:L,toString:P,offset:U,lineBreaks:W,line:this.line,col:this.col},D=L.length;if(this.index+=D,this.line+=W,W!==0?this.col=D-j+1:this.col+=D,M.shouldThrow){var B=new Error(this.formatError(N,"invalid syntax"));throw B}return M.pop?this.popState():M.push?this.pushState(M.push):M.next&&this.setState(M.next),N},typeof Symbol<"u"&&Symbol.iterator){var _=n(function(M){this.lexer=M},"LexerIterator");_.prototype.next=function(){var M=this.lexer.next();return{value:M,done:!M}},_.prototype[Symbol.iterator]=function(){return this},E.prototype[Symbol.iterator]=function(){return new _(this)}}return E.prototype.formatError=function(M,L){if(M==null)var U=this.buffer.slice(this.index),M={text:U,offset:this.index,lineBreaks:U.indexOf(`
250
250
  `)===-1?0:1,line:this.line,col:this.col};var W=2,V=Math.max(M.line-W,1),j=M.line+W,N=String(j).length,D=m(this.buffer,this.line-M.line+W+1).slice(0,5),B=[];B.push(L+" at line "+M.line+" col "+M.col+":"),B.push("");for(var z=0;z<D.length;z++){var q=D[z],H=V+z;B.push(p(String(H),N)+" "+q),H===M.line&&B.push(p("",N+M.col+1)+"^")}return B.join(`
251
- `)},E.prototype.clone=function(){return new E(this.states,this.state)},E.prototype.has=function(M){return!0},{compile:w,states:F,error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:T}})});var cle=Ct(Fp=>{"use strict";var w4e=Fp&&Fp.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fp,"__esModule",{value:!0});Fp.lexer=Fp.states=void 0;var C4e=w4e(lle());Fp.states={body:{doubleapos:{match:"''",value:n(()=>"'","value")},quoted:{lineBreaks:!0,match:/'[{}#](?:[^']|'')*'(?!')/u,value:n(t=>t.slice(1,-1).replace(/''/g,"'"),"value")},argument:{lineBreaks:!0,match:/\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,push:"arg",value:n(t=>t.substring(1).trim(),"value")},octothorpe:"#",end:{match:"}",pop:1},content:{lineBreaks:!0,match:/[^][^{}#']*/u}},arg:{select:{lineBreaks:!0,match:/,\s*(?:plural|select|selectordinal)\s*,\s*/u,next:"select",value:n(t=>t.split(",")[1].trim(),"value")},"func-args":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,next:"body",value:n(t=>t.split(",")[1].trim(),"value")},"func-simple":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,value:n(t=>t.substring(1).trim(),"value")},end:{match:"}",pop:1}},select:{offset:{lineBreaks:!0,match:/\s*offset\s*:\s*\d+\s*/u,value:n(t=>t.split(":")[1].trim(),"value")},case:{lineBreaks:!0,match:/\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,push:"body",value:n(t=>t.substring(0,t.indexOf("{")).trim(),"value")},end:{match:/\s*\}/u,pop:1}}};Fp.lexer=C4e.default.states(Fp.states)});var fle=Ct(wF=>{"use strict";Object.defineProperty(wF,"__esModule",{value:!0});wF.ParseError=void 0;wF.parse=E4e;var dle=cle(),GM=n(t=>({offset:t.offset,line:t.line,col:t.col,text:t.text,lineBreaks:t.lineBreaks}),"getContext"),zH=n(t=>t==="plural"||t==="select"||t==="selectordinal","isSelectType");function F4e(t,e){let o="",r="";for(let s of e){let i=s.ctx.text;switch(r+=i,s.type){case"content":o+=s.value;break;case"argument":case"function":case"octothorpe":o+=i;break;default:throw new $a(t,`Unsupported part in strict mode function arg style: ${i}`)}}return[{type:"content",value:o.trim(),ctx:Object.assign({},e[0].ctx,{text:r})}]}n(F4e,"strictArgStyleParam");var R4e=["number","date","time","spellout","ordinal","duration"],ule=["zero","one","two","few","many","other"],$a=class extends Error{static{n(this,"ParseError")}constructor(e,o){super(dle.lexer.formatError(e,o))}};wF.ParseError=$a;var HH=class{static{n(this,"Parser")}constructor(e,o){var r,a,s,i;this.lexer=dle.lexer.reset(e),this.cardinalKeys=(r=o?.cardinal)!==null&&r!==void 0?r:ule,this.ordinalKeys=(a=o?.ordinal)!==null&&a!==void 0?a:ule,this.strict=(s=o?.strict)!==null&&s!==void 0?s:!1,this.strictPluralKeys=(i=o?.strictPluralKeys)!==null&&i!==void 0?i:!0}parse(){return this.parseBody(!1,!0)}checkSelectKey(e,o,r){if(r[0]==="="){if(o==="select")throw new $a(e,`The case ${r} is not valid with select`)}else if(o!=="select"){let a=o==="plural"?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&a.length>0&&!a.includes(r)){let s=`The ${o} case ${r} is not valid in this locale`;throw new $a(e,s)}}}parseSelect({value:e},o,r,a){let s={type:a,arg:e,cases:[],ctx:r};a==="plural"||a==="selectordinal"?o=!0:this.strict&&(o=!1);for(let i of this.lexer)switch(i.type){case"offset":if(a==="select")throw new $a(i,"Unexpected plural offset for select");if(s.cases.length>0)throw new $a(i,"Plural offset must be set before cases");s.pluralOffset=Number(i.value),r.text+=i.text,r.lineBreaks+=i.lineBreaks;break;case"case":{this.checkSelectKey(i,a,i.value),s.cases.push({key:i.value,tokens:this.parseBody(o),ctx:GM(i)});break}case"end":return s;default:throw new $a(i,`Unexpected lexer token: ${i.type}`)}throw new $a(null,"Unexpected message end")}parseArgToken(e,o){let r=GM(e),a=this.lexer.next();if(!a)throw new $a(null,"Unexpected message end");if(r.text+=a.text,r.lineBreaks+=a.lineBreaks,this.strict&&(a.type==="func-simple"||a.type==="func-args")&&!R4e.includes(a.value)){let s=`Invalid strict mode function arg type: ${a.value}`;throw new $a(e,s)}switch(a.type){case"end":return{type:"argument",arg:e.value,ctx:r};case"func-simple":{let s=this.lexer.next();if(!s)throw new $a(null,"Unexpected message end");if(s.type!=="end")throw new $a(s,`Unexpected lexer token: ${s.type}`);if(r.text+=s.text,zH(a.value.toLowerCase()))throw new $a(a,`Invalid type identifier: ${a.value}`);return{type:"function",arg:e.value,key:a.value,ctx:r}}case"func-args":{if(zH(a.value.toLowerCase())){let i=`Invalid type identifier: ${a.value}`;throw new $a(a,i)}let s=this.parseBody(this.strict?!1:o);return this.strict&&s.length>0&&(s=F4e(e,s)),{type:"function",arg:e.value,key:a.value,param:s,ctx:r}}case"select":if(zH(a.value))return this.parseSelect(e,o,r,a.value);throw new $a(a,`Unexpected select type ${a.value}`);default:throw new $a(a,`Unexpected lexer token: ${a.type}`)}}parseBody(e,o){let r=[],a=null;for(let s of this.lexer)if(s.type==="argument")a&&(a=null),r.push(this.parseArgToken(s,e));else if(s.type==="octothorpe"&&e)a&&(a=null),r.push({type:"octothorpe",ctx:GM(s)});else{if(s.type==="end"&&!o)return r;{let i=s.value;if(!e&&s.type==="quoted"&&i[0]==="#"){if(i.includes("{")){let c=`Unsupported escape pattern: ${i}`;throw new $a(s,c)}i=s.text}a?(a.value+=i,a.ctx.text+=s.text,a.ctx.lineBreaks+=s.lineBreaks):(a={type:"content",value:i,ctx:GM(s)},r.push(a))}}if(o)return r;throw new $a(null,"Unexpected message end")}};function E4e(t,e={}){return new HH(t,e).parse()}n(E4e,"parse")});var Wve=Ct(qve=>{function Qqe(t){return t==="__proto__"}n(Qqe,"isUnsafeProperty");qve.isUnsafeProperty=Qqe});var Mq=Ct(Gve=>{function Zqe(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}n(Zqe,"isDeepKey");Gve.isDeepKey=Zqe});var X_=Ct(Kve=>{function Jqe(t){return typeof t=="string"||typeof t=="symbol"?t:Object.is(t?.valueOf?.(),-0)?"-0":String(t)}n(Jqe,"toKey");Kve.toKey=Jqe});var Qve=Ct(Xve=>{function Yve(t){if(t==null)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(Yve).join(",");let e=String(t);return e==="0"&&Object.is(Number(t),-0)?"-0":e}n(Yve,"toString");Xve.toString=Yve});var Q_=Ct(Zve=>{var eWe=X_(),tWe=Qve();function oWe(t){if(Array.isArray(t))return t.map(eWe.toKey);if(typeof t=="symbol")return[t];t=tWe.toString(t);let e=[],o=t.length;if(o===0)return e;let r=0,a="",s="",i=!1;for(t.charCodeAt(0)===46&&(e.push(""),r++);r<o;){let c=t[r];s?c==="\\"&&r+1<o?(r++,a+=t[r]):c===s?s="":a+=c:i?c==='"'||c==="'"?s=c:c==="]"?(i=!1,e.push(a),a=""):a+=c:c==="["?(i=!0,a&&(e.push(a),a="")):c==="."?a&&(e.push(a),a=""):a+=c,r++}return a&&e.push(a),e}n(oWe,"toPath");Zve.toPath=oWe});var Z_=Ct(exe=>{var Pq=Wve(),rWe=Mq(),nWe=X_(),aWe=Q_();function Jve(t,e,o){if(t==null)return o;switch(typeof e){case"string":{if(Pq.isUnsafeProperty(e))return o;let r=t[e];return r===void 0?rWe.isDeepKey(e)?Jve(t,aWe.toPath(e),o):o:r}case"number":case"symbol":{typeof e=="number"&&(e=nWe.toKey(e));let r=t[e];return r===void 0?o:r}default:{if(Array.isArray(e))return sWe(t,e,o);if(Object.is(e?.valueOf(),-0)?e="-0":e=String(e),Pq.isUnsafeProperty(e))return o;let r=t[e];return r===void 0?o:r}}}n(Jve,"get");function sWe(t,e,o){if(e.length===0)return o;let r=t;for(let a=0;a<e.length;a++){if(r==null||Pq.isUnsafeProperty(e[a]))return o;r=r[e[a]]}return r===void 0?o:r}n(sWe,"getWithPath");exe.get=Jve});var kE=Ct((hFo,txe)=>{txe.exports=Z_().get});var sxe=Ct(axe=>{function mWe(t,e){let o=new Map;for(let r=0;r<t.length;r++){let a=t[r],s=e(a,r,t);o.has(s)||o.set(s,a)}return Array.from(o.values())}n(mWe,"uniqBy");axe.uniqBy=mWe});var lxe=Ct(ixe=>{function hWe(t,e){return function(...o){return t.apply(this,o.slice(0,e))}}n(hWe,"ary");ixe.ary=hWe});var Nq=Ct(cxe=>{function gWe(t){return t}n(gWe,"identity");cxe.identity=gWe});var dxe=Ct(uxe=>{var vWe=Z_();function xWe(t){return function(e){return vWe.get(e,t)}}n(xWe,"property");uxe.property=xWe});var Dq=Ct(fxe=>{function yWe(t){return t==null||typeof t!="object"&&typeof t!="function"}n(yWe,"isPrimitive");fxe.isPrimitive=yWe});var mxe=Ct(pxe=>{function IWe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}n(IWe,"isTypedArray");pxe.isTypedArray=IWe});var gxe=Ct(hxe=>{function bWe(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}n(bWe,"getSymbols");hxe.getSymbols=bWe});var tL=Ct(vxe=>{function SWe(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}n(SWe,"getTag");vxe.getTag=SWe});var _q=Ct(In=>{var wWe="[object RegExp]",CWe="[object String]",FWe="[object Number]",RWe="[object Boolean]",EWe="[object Arguments]",AWe="[object Symbol]",TWe="[object Date]",kWe="[object Map]",MWe="[object Set]",PWe="[object Array]",OWe="[object Function]",NWe="[object ArrayBuffer]",DWe="[object Object]",_We="[object Error]",LWe="[object DataView]",BWe="[object Uint8Array]",VWe="[object Uint8ClampedArray]",UWe="[object Uint16Array]",zWe="[object Uint32Array]",HWe="[object BigUint64Array]",$We="[object Int8Array]",jWe="[object Int16Array]",qWe="[object Int32Array]",WWe="[object BigInt64Array]",GWe="[object Float32Array]",KWe="[object Float64Array]";In.argumentsTag=EWe;In.arrayBufferTag=NWe;In.arrayTag=PWe;In.bigInt64ArrayTag=WWe;In.bigUint64ArrayTag=HWe;In.booleanTag=RWe;In.dataViewTag=LWe;In.dateTag=TWe;In.errorTag=_We;In.float32ArrayTag=GWe;In.float64ArrayTag=KWe;In.functionTag=OWe;In.int16ArrayTag=jWe;In.int32ArrayTag=qWe;In.int8ArrayTag=$We;In.mapTag=kWe;In.numberTag=FWe;In.objectTag=DWe;In.regexpTag=wWe;In.setTag=MWe;In.stringTag=CWe;In.symbolTag=AWe;In.uint16ArrayTag=UWe;In.uint32ArrayTag=zWe;In.uint8ArrayTag=BWe;In.uint8ClampedArrayTag=VWe});var yxe=Ct(xxe=>{var YWe=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();xxe.globalThis_=YWe});var Sxe=Ct(bxe=>{var Ixe=yxe();function XWe(t){return typeof Ixe.globalThis_.Buffer<"u"&&Ixe.globalThis_.Buffer.isBuffer(t)}n(XWe,"isBuffer");bxe.isBuffer=XWe});var Lq=Ct(oL=>{var QWe=Dq(),ZWe=mxe(),JWe=gxe(),eGe=tL(),ha=_q(),tGe=Sxe();function oGe(t,e){return Dx(t,void 0,t,new Map,e)}n(oGe,"cloneDeepWith");function Dx(t,e,o,r=new Map,a=void 0){let s=a?.(t,e,o,r);if(s!==void 0)return s;if(QWe.isPrimitive(t))return t;if(r.has(t))return r.get(t);if(Array.isArray(t)){let i=new Array(t.length);r.set(t,i);for(let c=0;c<t.length;c++)i[c]=Dx(t[c],c,o,r,a);return Object.hasOwn(t,"index")&&(i.index=t.index),Object.hasOwn(t,"input")&&(i.input=t.input),i}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){let i=new RegExp(t.source,t.flags);return i.lastIndex=t.lastIndex,i}if(t instanceof Map){let i=new Map;r.set(t,i);for(let[c,d]of t)i.set(c,Dx(d,c,o,r,a));return i}if(t instanceof Set){let i=new Set;r.set(t,i);for(let c of t)i.add(Dx(c,void 0,o,r,a));return i}if(tGe.isBuffer(t))return t.subarray();if(ZWe.isTypedArray(t)){let i=new(Object.getPrototypeOf(t)).constructor(t.length);r.set(t,i);for(let c=0;c<t.length;c++)i[c]=Dx(t[c],c,o,r,a);return i}if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){let i=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return r.set(t,i),am(i,t,o,r,a),i}if(typeof File<"u"&&t instanceof File){let i=new File([t],t.name,{type:t.type});return r.set(t,i),am(i,t,o,r,a),i}if(typeof Blob<"u"&&t instanceof Blob){let i=new Blob([t],{type:t.type});return r.set(t,i),am(i,t,o,r,a),i}if(t instanceof Error){let i=structuredClone(t);return r.set(t,i),i.message=t.message,i.name=t.name,i.stack=t.stack,i.cause=t.cause,i.constructor=t.constructor,am(i,t,o,r,a),i}if(t instanceof Boolean){let i=new Boolean(t.valueOf());return r.set(t,i),am(i,t,o,r,a),i}if(t instanceof Number){let i=new Number(t.valueOf());return r.set(t,i),am(i,t,o,r,a),i}if(t instanceof String){let i=new String(t.valueOf());return r.set(t,i),am(i,t,o,r,a),i}if(typeof t=="object"&&rGe(t)){let i=Object.create(Object.getPrototypeOf(t));return r.set(t,i),am(i,t,o,r,a),i}return t}n(Dx,"cloneDeepWithImpl");function am(t,e,o=t,r,a){let s=[...Object.keys(e),...JWe.getSymbols(e)];for(let i=0;i<s.length;i++){let c=s[i],d=Object.getOwnPropertyDescriptor(t,c);(d==null||d.writable)&&(t[c]=Dx(e[c],c,o,r,a))}}n(am,"copyProperties");function rGe(t){switch(eGe.getTag(t)){case ha.argumentsTag:case ha.arrayTag:case ha.arrayBufferTag:case ha.dataViewTag:case ha.booleanTag:case ha.dateTag:case ha.float32ArrayTag:case ha.float64ArrayTag:case ha.int8ArrayTag:case ha.int16ArrayTag:case ha.int32ArrayTag:case ha.mapTag:case ha.numberTag:case ha.objectTag:case ha.regexpTag:case ha.setTag:case ha.stringTag:case ha.symbolTag:case ha.uint8ArrayTag:case ha.uint8ClampedArrayTag:case ha.uint16ArrayTag:case ha.uint32ArrayTag:return!0;default:return!1}}n(rGe,"isCloneableObject");oL.cloneDeepWith=oGe;oL.cloneDeepWithImpl=Dx;oL.copyProperties=am});var Cxe=Ct(wxe=>{var nGe=Lq();function aGe(t){return nGe.cloneDeepWithImpl(t,void 0,t,new Map,void 0)}n(aGe,"cloneDeep");wxe.cloneDeep=aGe});var rL=Ct(Fxe=>{function sGe(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}n(sGe,"isEqualsSameValueZero");Fxe.isEqualsSameValueZero=sGe});var Bq=Ct(()=>{rL()});var Vq=Ct(Rxe=>{function iGe(t){return t!==null&&(typeof t=="object"||typeof t=="function")}n(iGe,"isObject");Rxe.isObject=iGe});var Pxe=Ct(Mxe=>{var Exe=Dq(),Axe=rL();Bq();var lGe=Vq();function Txe(t,e,o){return typeof o!="function"?Txe(t,e,()=>{}):Uq(t,e,n(function r(a,s,i,c,d,f){let p=o(a,s,i,c,d,f);return p!==void 0?!!p:Uq(a,s,r,f)},"doesMatch"),new Map)}n(Txe,"isMatchWith");function Uq(t,e,o,r){if(e===t)return!0;switch(typeof e){case"object":return cGe(t,e,o,r);case"function":return Object.keys(e).length>0?Uq(t,{...e},o,r):Axe.isEqualsSameValueZero(t,e);default:return lGe.isObject(t)?typeof e=="string"?e==="":!0:Axe.isEqualsSameValueZero(t,e)}}n(Uq,"isMatchWithInternal");function cGe(t,e,o,r){if(e==null)return!0;if(Array.isArray(e))return kxe(t,e,o,r);if(e instanceof Map)return uGe(t,e,o,r);if(e instanceof Set)return dGe(t,e,o,r);let a=Object.keys(e);if(t==null||Exe.isPrimitive(t))return a.length===0;if(a.length===0)return!0;if(r?.has(e))return r.get(e)===t;r?.set(e,t);try{for(let s=0;s<a.length;s++){let i=a[s];if(!Exe.isPrimitive(t)&&!(i in t)||e[i]===void 0&&t[i]!==void 0||e[i]===null&&t[i]!==null||!o(t[i],e[i],i,t,e,r))return!1}return!0}finally{r?.delete(e)}}n(cGe,"isObjectMatch");function uGe(t,e,o,r){if(e.size===0)return!0;if(!(t instanceof Map))return!1;for(let[a,s]of e.entries())if(o(t.get(a),s,a,t,e,r)===!1)return!1;return!0}n(uGe,"isMapMatch");function kxe(t,e,o,r){if(e.length===0)return!0;if(!Array.isArray(t))return!1;let a=new Set;for(let s=0;s<e.length;s++){let i=e[s],c=!1;for(let d=0;d<t.length;d++){if(a.has(d))continue;let f=t[d],p=!1;if(o(f,i,s,t,e,r)&&(p=!0),p){a.add(d),c=!0;break}}if(!c)return!1}return!0}n(kxe,"isArrayMatch");function dGe(t,e,o,r){return e.size===0?!0:t instanceof Set?kxe([...t],[...e],o,r):!1}n(dGe,"isSetMatch");Mxe.isMatchWith=Txe});var zq=Ct(Oxe=>{var fGe=Pxe();function pGe(t,e){return fGe.isMatchWith(t,e,()=>{})}n(pGe,"isMatch");Oxe.isMatch=pGe});var Dxe=Ct(Nxe=>{var mGe=Cxe(),hGe=zq();function gGe(t){return t=mGe.cloneDeep(t),e=>hGe.isMatch(e,t)}n(gGe,"matches");Nxe.matches=gGe});var Lxe=Ct(_xe=>{var vGe=tL(),nL=_q(),aL=Lq();function xGe(t,e){return aL.cloneDeepWith(t,(o,r,a,s)=>{let i=e?.(o,r,a,s);if(i!==void 0)return i;if(typeof t=="object"){if(vGe.getTag(t)==="[object Object]"&&typeof t.constructor!="function"){let c={};return s.set(t,c),aL.copyProperties(c,t,a,s),c}switch(Object.prototype.toString.call(t)){case nL.numberTag:case nL.stringTag:case nL.booleanTag:{let c=new t.constructor(t?.valueOf());return aL.copyProperties(c,t),c}case nL.argumentsTag:{let c={};return aL.copyProperties(c,t),c.length=t.length,c[Symbol.iterator]=t[Symbol.iterator],c}default:return}}})}n(xGe,"cloneDeepWith");_xe.cloneDeepWith=xGe});var Vxe=Ct(Bxe=>{var yGe=Lxe();function IGe(t){return yGe.cloneDeepWith(t)}n(IGe,"cloneDeep");Bxe.cloneDeep=IGe});var Hq=Ct(Uxe=>{var bGe=/^(?:0|[1-9]\d*)$/;function SGe(t,e=Number.MAX_SAFE_INTEGER){switch(typeof t){case"number":return Number.isInteger(t)&&t>=0&&t<e;case"symbol":return!1;case"string":return bGe.test(t)}}n(SGe,"isIndex");Uxe.isIndex=SGe});var Hxe=Ct(zxe=>{var wGe=tL();function CGe(t){return t!==null&&typeof t=="object"&&wGe.getTag(t)==="[object Arguments]"}n(CGe,"isArguments");zxe.isArguments=CGe});var jxe=Ct($xe=>{var FGe=Mq(),RGe=Q_(),EGe=Hq(),AGe=Hxe();function TGe(t,e){let o;if(Array.isArray(e)?o=e:typeof e=="string"&&FGe.isDeepKey(e)&&t?.[e]==null?o=RGe.toPath(e):o=[e],o.length===0)return!1;let r=t;for(let a=0;a<o.length;a++){let s=o[a];if((r==null||!Object.hasOwn(r,s))&&!((Array.isArray(r)||AGe.isArguments(r))&&EGe.isIndex(s)&&s<r.length))return!1;r=r[s]}return!0}n(TGe,"has");$xe.has=TGe});var Wxe=Ct(qxe=>{var kGe=X_(),MGe=Z_(),PGe=zq(),OGe=Vxe(),NGe=jxe();function DGe(t,e){switch(typeof t){case"object":Object.is(t?.valueOf(),-0)&&(t="-0");break;case"number":t=kGe.toKey(t);break}return e=OGe.cloneDeep(e),function(o){let r=MGe.get(o,t);return r===void 0?NGe.has(o,t):e===void 0?r===void 0:PGe.isMatch(r,e)}}n(DGe,"matchesProperty");qxe.matchesProperty=DGe});var Kxe=Ct(Gxe=>{var _Ge=Nq(),LGe=dxe(),BGe=Dxe(),VGe=Wxe();function UGe(t){if(t==null)return _Ge.identity;switch(typeof t){case"function":return t;case"object":return Array.isArray(t)&&t.length===2?VGe.matchesProperty(t[0],t[1]):BGe.matches(t);case"string":case"symbol":case"number":return LGe.property(t)}}n(UGe,"iteratee");Gxe.iteratee=UGe});var Xxe=Ct(Yxe=>{function zGe(t){return Number.isSafeInteger(t)&&t>=0}n(zGe,"isLength");Yxe.isLength=zGe});var $q=Ct(Qxe=>{var HGe=Xxe();function $Ge(t){return t!=null&&typeof t!="function"&&HGe.isLength(t.length)}n($Ge,"isArrayLike");Qxe.isArrayLike=$Ge});var Jxe=Ct(Zxe=>{function jGe(t){return typeof t=="object"&&t!==null}n(jGe,"isObjectLike");Zxe.isObjectLike=jGe});var tye=Ct(eye=>{var qGe=$q(),WGe=Jxe();function GGe(t){return WGe.isObjectLike(t)&&qGe.isArrayLike(t)}n(GGe,"isArrayLikeObject");eye.isArrayLikeObject=GGe});var rye=Ct(oye=>{var KGe=sxe(),YGe=lxe(),XGe=Nq(),QGe=Kxe(),ZGe=tye();function JGe(t,e=XGe.identity){return ZGe.isArrayLikeObject(t)?KGe.uniqBy(Array.from(t),YGe.ary(QGe.iteratee(e),1)):[]}n(JGe,"uniqBy");oye.uniqBy=JGe});var aye=Ct((PRo,nye)=>{nye.exports=rye().uniqBy});var uye=Ct(cye=>{function rKe(t,e=1){let o=[],r=Math.floor(e),a=n((s,i)=>{for(let c=0;c<s.length;c++){let d=s[c];Array.isArray(d)&&i<r?a(d,i+1):o.push(d)}},"recursive");return a(t,0),o}n(rKe,"flatten");cye.flatten=rKe});var qq=Ct(dye=>{var nKe=rL();Bq();var aKe=$q(),sKe=Vq(),iKe=Hq();function lKe(t,e,o){return sKe.isObject(o)&&(typeof e=="number"&&aKe.isArrayLike(o)&&iKe.isIndex(e)&&e<o.length||typeof e=="string"&&e in o)?nKe.isEqualsSameValueZero(o[e],t):!1}n(lKe,"isIterateeCall");dye.isIterateeCall=lKe});var mye=Ct(pye=>{function fye(t){return typeof t=="symbol"?1:t===null?2:t===void 0?3:t!==t?4:0}n(fye,"getPriority");var cKe=n((t,e,o)=>{if(t!==e){let r=fye(t),a=fye(e);if(r===a&&r===0){if(t<e)return o==="desc"?1:-1;if(t>e)return o==="desc"?-1:1}return o==="desc"?a-r:r-a}return 0},"compareValues");pye.compareValues=cKe});var Wq=Ct(hye=>{function uKe(t){return typeof t=="symbol"||t instanceof Symbol}n(uKe,"isSymbol");hye.isSymbol=uKe});var vye=Ct(gye=>{var dKe=Wq(),fKe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pKe=/^\w*$/;function mKe(t,e){return Array.isArray(t)?!1:typeof t=="number"||typeof t=="boolean"||t==null||dKe.isSymbol(t)?!0:typeof t=="string"&&(pKe.test(t)||!fKe.test(t))||e!=null&&Object.hasOwn(e,t)}n(mKe,"isKey");gye.isKey=mKe});var yye=Ct(xye=>{var hKe=Q_(),gKe=mye(),vKe=vye();function xKe(t,e,o,r){if(t==null)return[];o=r?void 0:o,Array.isArray(t)||(t=Object.values(t)),Array.isArray(e)||(e=e==null?[null]:[e]),e.length===0&&(e=[null]),Array.isArray(o)||(o=o==null?[]:[o]),o=o.map(c=>String(c));let a=n((c,d)=>{let f=c;for(let p=0;p<d.length&&f!=null;++p)f=f[d[p]];return f},"getValueByNestedPath"),s=n((c,d)=>d==null||c==null?d:typeof c=="object"&&"key"in c?Object.hasOwn(d,c.key)?d[c.key]:a(d,c.path):typeof c=="function"?c(d):Array.isArray(c)?a(d,c):typeof d=="object"?d[c]:d,"getValueByCriterion"),i=e.map(c=>(Array.isArray(c)&&c.length===1&&(c=c[0]),c==null||typeof c=="function"||Array.isArray(c)||vKe.isKey(c)?c:{key:c,path:hKe.toPath(c)}));return t.map(c=>({original:c,criteria:i.map(d=>s(d,c))})).slice().sort((c,d)=>{for(let f=0;f<i.length;f++){let p=gKe.compareValues(c.criteria[f],d.criteria[f],o[f]);if(p!==0)return p}return 0}).map(c=>c.original)}n(xKe,"orderBy");xye.orderBy=xKe});var Sye=Ct(bye=>{var yKe=uye(),Iye=qq(),IKe=yye();function bKe(t,...e){let o=e.length;return o>1&&Iye.isIterateeCall(t,e[0],e[1])?e=[]:o>2&&Iye.isIterateeCall(e[0],e[1],e[2])&&(e=[e[0]]),IKe.orderBy(t,yKe.flatten(e),["asc"])}n(bKe,"sortBy");bye.sortBy=bKe});var NE=Ct((JRo,wye)=>{wye.exports=Sye().sortBy});var XIe=Ct(YIe=>{function tXe(t,e,{signal:o,edges:r}={}){let a,s=null,i=r!=null&&r.includes("leading"),c=r==null||r.includes("trailing"),d=n(()=>{s!==null&&(t.apply(a,s),a=void 0,s=null)},"invoke"),f=n(()=>{c&&d(),v()},"onTimerEnd"),p=null,m=n(()=>{p!=null&&clearTimeout(p),p=setTimeout(()=>{p=null,f()},e)},"schedule"),h=n(()=>{p!==null&&(clearTimeout(p),p=null)},"cancelTimer"),v=n(()=>{h(),a=void 0,s=null},"cancel"),x=n(()=>{d()},"flush"),y=n(function(...b){if(o?.aborted)return;a=this,s=b;let S=p==null;m(),i&&S&&d()},"debounced");return y.schedule=m,y.cancel=v,y.flush=x,o?.addEventListener("abort",v,{once:!0}),y}n(tXe,"debounce");YIe.debounce=tXe});var ZIe=Ct(QIe=>{var oXe=XIe();function rXe(t,e=0,o={}){typeof o!="object"&&(o={});let{leading:r=!1,trailing:a=!0,maxWait:s}=o,i=Array(2);r&&(i[0]="leading"),a&&(i[1]="trailing");let c,d=null,f=oXe.debounce(function(...h){c=t.apply(this,h),d=null},e,{edges:i}),p=n(function(...h){return s!=null&&(d===null&&(d=Date.now()),Date.now()-d>=s)?(c=t.apply(this,h),d=Date.now(),f.cancel(),f.schedule(),c):(f.apply(this,h),c)},"debounced"),m=n(()=>(f.flush(),c),"flush");return p.cancel=f.cancel,p.flush=m,p}n(rXe,"debounce");QIe.debounce=rXe});var ebe=Ct(JIe=>{var nXe=ZIe();function aXe(t,e=0,o={}){let{leading:r=!0,trailing:a=!0}=o;return nXe.debounce(t,e,{leading:r,maxWait:e,trailing:a})}n(aXe,"throttle");JIe.throttle=aXe});var obe=Ct((u2o,tbe)=>{tbe.exports=ebe().throttle});var Sbe=Ct(bbe=>{"use strict";(function(){function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}n(t,"is"),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=oe(),o=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,a=e.useRef,s=e.useEffect,i=e.useMemo,c=e.useDebugValue;bbe.useSyncExternalStoreWithSelector=function(d,f,p,m,h){var v=a(null);if(v.current===null){var x={hasValue:!1,value:null};v.current=x}else x=v.current;v=i(function(){function b(T){if(!S){if(S=!0,w=T,T=m(T),h!==void 0&&x.hasValue){var E=x.value;if(h(E,T))return C=E}return C=T}if(E=C,o(w,T))return E;var k=m(T);return h!==void 0&&h(E,k)?(w=T,E):(w=T,C=k)}n(b,"memoizedSelector");var S=!1,w,C,F=p===void 0?null:p;return[function(){return b(f())},F===null?void 0:function(){return b(F())}]},[f,p,m,h]);var y=r(d,v[0],v[1]);return s(function(){x.hasValue=!0,x.value=y},[y]),c(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var Cbe=Ct((V2o,wbe)=>{"use strict";wbe.exports=Sbe()});var z1e=Ct(U1e=>{var bZe=Wq();function SZe(t){return bZe.isSymbol(t)?NaN:Number(t)}n(SZe,"toNumber");U1e.toNumber=SZe});var $1e=Ct(H1e=>{var wZe=z1e();function CZe(t){return t?(t=wZe.toNumber(t),t===1/0||t===-1/0?(t<0?-1:1)*Number.MAX_VALUE:t===t?t:0):t===0?t:0}n(CZe,"toFinite");H1e.toFinite=CZe});var q1e=Ct(j1e=>{var OW=$1e(),FZe=qq();function RZe(t,e,o){o&&typeof o!="number"&&FZe.isIterateeCall(t,e,o)&&(e=o=void 0),t=OW.toFinite(t),e===void 0?(e=t,t=0):e=OW.toFinite(e),o=o===void 0?t<e?1:-1:OW.toFinite(o);let r=Math.max(Math.ceil((e-t)/(o||1)),0),a=new Array(r);for(let s=0;s<r;s++)a[s]=t,t+=o;return a}n(RZe,"range");j1e.range=RZe});var G1e=Ct((LTo,W1e)=>{W1e.exports=q1e().range});var _W=Ct((J1e,o3)=>{(function(t){"use strict";var e=1e9,o={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},r=!0,a="[DecimalError] ",s=a+"Invalid argument: ",i=a+"Exponent out of range: ",c=Math.floor,d=Math.pow,f=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,p,m=1e7,h=7,v=9007199254740991,x=c(v/h),y={};y.absoluteValue=y.abs=function(){var N=new this.constructor(this);return N.s&&(N.s=1),N},y.comparedTo=y.cmp=function(N){var D,B,z,q,H=this;if(N=new H.constructor(N),H.s!==N.s)return H.s||-N.s;if(H.e!==N.e)return H.e>N.e^H.s<0?1:-1;for(z=H.d.length,q=N.d.length,D=0,B=z<q?z:q;D<B;++D)if(H.d[D]!==N.d[D])return H.d[D]>N.d[D]^H.s<0?1:-1;return z===q?0:z>q^H.s<0?1:-1},y.decimalPlaces=y.dp=function(){var N=this,D=N.d.length-1,B=(D-N.e)*h;if(D=N.d[D],D)for(;D%10==0;D/=10)B--;return B<0?0:B},y.dividedBy=y.div=function(N){return C(this,new this.constructor(N))},y.dividedToIntegerBy=y.idiv=function(N){var D=this,B=D.constructor;return M(C(D,new B(N),0,1),B.precision)},y.equals=y.eq=function(N){return!this.cmp(N)},y.exponent=function(){return T(this)},y.greaterThan=y.gt=function(N){return this.cmp(N)>0},y.greaterThanOrEqualTo=y.gte=function(N){return this.cmp(N)>=0},y.isInteger=y.isint=function(){return this.e>this.d.length-2},y.isNegative=y.isneg=function(){return this.s<0},y.isPositive=y.ispos=function(){return this.s>0},y.isZero=function(){return this.s===0},y.lessThan=y.lt=function(N){return this.cmp(N)<0},y.lessThanOrEqualTo=y.lte=function(N){return this.cmp(N)<1},y.logarithm=y.log=function(N){var D,B=this,z=B.constructor,q=z.precision,H=q+5;if(N===void 0)N=new z(10);else if(N=new z(N),N.s<1||N.eq(p))throw Error(a+"NaN");if(B.s<1)throw Error(a+(B.s?"NaN":"-Infinity"));return B.eq(p)?new z(0):(r=!1,D=C(P(B,H),P(N,H),H),r=!0,M(D,q))},y.minus=y.sub=function(N){var D=this;return N=new D.constructor(N),D.s==N.s?L(D,N):b(D,(N.s=-N.s,N))},y.modulo=y.mod=function(N){var D,B=this,z=B.constructor,q=z.precision;if(N=new z(N),!N.s)throw Error(a+"NaN");return B.s?(r=!1,D=C(B,N,0,1).times(N),r=!0,B.minus(D)):M(new z(B),q)},y.naturalExponential=y.exp=function(){return F(this)},y.naturalLogarithm=y.ln=function(){return P(this)},y.negated=y.neg=function(){var N=new this.constructor(this);return N.s=-N.s||0,N},y.plus=y.add=function(N){var D=this;return N=new D.constructor(N),D.s==N.s?b(D,N):L(D,(N.s=-N.s,N))},y.precision=y.sd=function(N){var D,B,z,q=this;if(N!==void 0&&N!==!!N&&N!==1&&N!==0)throw Error(s+N);if(D=T(q)+1,z=q.d.length-1,B=z*h+1,z=q.d[z],z){for(;z%10==0;z/=10)B--;for(z=q.d[0];z>=10;z/=10)B++}return N&&D>B?D:B},y.squareRoot=y.sqrt=function(){var N,D,B,z,q,H,Y,Q=this,X=Q.constructor;if(Q.s<1){if(!Q.s)return new X(0);throw Error(a+"NaN")}for(N=T(Q),r=!1,q=Math.sqrt(+Q),q==0||q==1/0?(D=w(Q.d),(D.length+N)%2==0&&(D+="0"),q=Math.sqrt(D),N=c((N+1)/2)-(N<0||N%2),q==1/0?D="5e"+N:(D=q.toExponential(),D=D.slice(0,D.indexOf("e")+1)+N),z=new X(D)):z=new X(q.toString()),B=X.precision,q=Y=B+3;;)if(H=z,z=H.plus(C(Q,H,Y+2)).times(.5),w(H.d).slice(0,Y)===(D=w(z.d)).slice(0,Y)){if(D=D.slice(Y-3,Y+1),q==Y&&D=="4999"){if(M(H,B+1,0),H.times(H).eq(Q)){z=H;break}}else if(D!="9999")break;Y+=4}return r=!0,M(z,B)},y.times=y.mul=function(N){var D,B,z,q,H,Y,Q,X,te,ae=this,se=ae.constructor,J=ae.d,ne=(N=new se(N)).d;if(!ae.s||!N.s)return new se(0);for(N.s*=ae.s,B=ae.e+N.e,X=J.length,te=ne.length,X<te&&(H=J,J=ne,ne=H,Y=X,X=te,te=Y),H=[],Y=X+te,z=Y;z--;)H.push(0);for(z=te;--z>=0;){for(D=0,q=X+z;q>z;)Q=H[q]+ne[z]*J[q-z-1]+D,H[q--]=Q%m|0,D=Q/m|0;H[q]=(H[q]+D)%m|0}for(;!H[--Y];)H.pop();return D?++B:H.shift(),N.d=H,N.e=B,r?M(N,se.precision):N},y.toDecimalPlaces=y.todp=function(N,D){var B=this,z=B.constructor;return B=new z(B),N===void 0?B:(S(N,0,e),D===void 0?D=z.rounding:S(D,0,8),M(B,N+T(B)+1,D))},y.toExponential=function(N,D){var B,z=this,q=z.constructor;return N===void 0?B=U(z,!0):(S(N,0,e),D===void 0?D=q.rounding:S(D,0,8),z=M(new q(z),N+1,D),B=U(z,!0,N+1)),B},y.toFixed=function(N,D){var B,z,q=this,H=q.constructor;return N===void 0?U(q):(S(N,0,e),D===void 0?D=H.rounding:S(D,0,8),z=M(new H(q),N+T(q)+1,D),B=U(z.abs(),!1,N+T(z)+1),q.isneg()&&!q.isZero()?"-"+B:B)},y.toInteger=y.toint=function(){var N=this,D=N.constructor;return M(new D(N),T(N)+1,D.rounding)},y.toNumber=function(){return+this},y.toPower=y.pow=function(N){var D,B,z,q,H,Y,Q=this,X=Q.constructor,te=12,ae=+(N=new X(N));if(!N.s)return new X(p);if(Q=new X(Q),!Q.s){if(N.s<1)throw Error(a+"Infinity");return Q}if(Q.eq(p))return Q;if(z=X.precision,N.eq(p))return M(Q,z);if(D=N.e,B=N.d.length-1,Y=D>=B,H=Q.s,Y){if((B=ae<0?-ae:ae)<=v){for(q=new X(p),D=Math.ceil(z/h+4),r=!1;B%2&&(q=q.times(Q),W(q.d,D)),B=c(B/2),B!==0;)Q=Q.times(Q),W(Q.d,D);return r=!0,N.s<0?new X(p).div(q):M(q,z)}}else if(H<0)throw Error(a+"NaN");return H=H<0&&N.d[Math.max(D,B)]&1?-1:1,Q.s=1,r=!1,q=N.times(P(Q,z+te)),r=!0,q=F(q),q.s=H,q},y.toPrecision=function(N,D){var B,z,q=this,H=q.constructor;return N===void 0?(B=T(q),z=U(q,B<=H.toExpNeg||B>=H.toExpPos)):(S(N,1,e),D===void 0?D=H.rounding:S(D,0,8),q=M(new H(q),N,D),B=T(q),z=U(q,N<=B||B<=H.toExpNeg,N)),z},y.toSignificantDigits=y.tosd=function(N,D){var B=this,z=B.constructor;return N===void 0?(N=z.precision,D=z.rounding):(S(N,1,e),D===void 0?D=z.rounding:S(D,0,8)),M(new z(B),N,D)},y.toString=y.valueOf=y.val=y.toJSON=function(){var N=this,D=T(N),B=N.constructor;return U(N,D<=B.toExpNeg||D>=B.toExpPos)};function b(N,D){var B,z,q,H,Y,Q,X,te,ae=N.constructor,se=ae.precision;if(!N.s||!D.s)return D.s||(D=new ae(N)),r?M(D,se):D;if(X=N.d,te=D.d,Y=N.e,q=D.e,X=X.slice(),H=Y-q,H){for(H<0?(z=X,H=-H,Q=te.length):(z=te,q=Y,Q=X.length),Y=Math.ceil(se/h),Q=Y>Q?Y+1:Q+1,H>Q&&(H=Q,z.length=1),z.reverse();H--;)z.push(0);z.reverse()}for(Q=X.length,H=te.length,Q-H<0&&(H=Q,z=te,te=X,X=z),B=0;H;)B=(X[--H]=X[H]+te[H]+B)/m|0,X[H]%=m;for(B&&(X.unshift(B),++q),Q=X.length;X[--Q]==0;)X.pop();return D.d=X,D.e=q,r?M(D,se):D}n(b,"add");function S(N,D,B){if(N!==~~N||N<D||N>B)throw Error(s+N)}n(S,"checkInt32");function w(N){var D,B,z,q=N.length-1,H="",Y=N[0];if(q>0){for(H+=Y,D=1;D<q;D++)z=N[D]+"",B=h-z.length,B&&(H+=k(B)),H+=z;Y=N[D],z=Y+"",B=h-z.length,B&&(H+=k(B))}else if(Y===0)return"0";for(;Y%10===0;)Y/=10;return H+Y}n(w,"digitsToString");var C=(function(){function N(z,q){var H,Y=0,Q=z.length;for(z=z.slice();Q--;)H=z[Q]*q+Y,z[Q]=H%m|0,Y=H/m|0;return Y&&z.unshift(Y),z}n(N,"multiplyInteger");function D(z,q,H,Y){var Q,X;if(H!=Y)X=H>Y?1:-1;else for(Q=X=0;Q<H;Q++)if(z[Q]!=q[Q]){X=z[Q]>q[Q]?1:-1;break}return X}n(D,"compare");function B(z,q,H){for(var Y=0;H--;)z[H]-=Y,Y=z[H]<q[H]?1:0,z[H]=Y*m+z[H]-q[H];for(;!z[0]&&z.length>1;)z.shift()}return n(B,"subtract"),function(z,q,H,Y){var Q,X,te,ae,se,J,ne,pe,le,ie,de,ue,he,Re,Ae,ye,ge,Te,ze=z.constructor,Ze=z.s==q.s?1:-1,_e=z.d,Ie=q.d;if(!z.s)return new ze(z);if(!q.s)throw Error(a+"Division by zero");for(X=z.e-q.e,ge=Ie.length,Ae=_e.length,ne=new ze(Ze),pe=ne.d=[],te=0;Ie[te]==(_e[te]||0);)++te;if(Ie[te]>(_e[te]||0)&&--X,H==null?ue=H=ze.precision:Y?ue=H+(T(z)-T(q))+1:ue=H,ue<0)return new ze(0);if(ue=ue/h+2|0,te=0,ge==1)for(ae=0,Ie=Ie[0],ue++;(te<Ae||ae)&&ue--;te++)he=ae*m+(_e[te]||0),pe[te]=he/Ie|0,ae=he%Ie|0;else{for(ae=m/(Ie[0]+1)|0,ae>1&&(Ie=N(Ie,ae),_e=N(_e,ae),ge=Ie.length,Ae=_e.length),Re=ge,le=_e.slice(0,ge),ie=le.length;ie<ge;)le[ie++]=0;Te=Ie.slice(),Te.unshift(0),ye=Ie[0],Ie[1]>=m/2&&++ye;do ae=0,Q=D(Ie,le,ge,ie),Q<0?(de=le[0],ge!=ie&&(de=de*m+(le[1]||0)),ae=de/ye|0,ae>1?(ae>=m&&(ae=m-1),se=N(Ie,ae),J=se.length,ie=le.length,Q=D(se,le,J,ie),Q==1&&(ae--,B(se,ge<J?Te:Ie,J))):(ae==0&&(Q=ae=1),se=Ie.slice()),J=se.length,J<ie&&se.unshift(0),B(le,se,ie),Q==-1&&(ie=le.length,Q=D(Ie,le,ge,ie),Q<1&&(ae++,B(le,ge<ie?Te:Ie,ie))),ie=le.length):Q===0&&(ae++,le=[0]),pe[te++]=ae,Q&&le[0]?le[ie++]=_e[Re]||0:(le=[_e[Re]],ie=1);while((Re++<Ae||le[0]!==void 0)&&ue--)}return pe[0]||pe.shift(),ne.e=X,M(ne,Y?H+T(ne)+1:H)}})();function F(N,D){var B,z,q,H,Y,Q,X=0,te=0,ae=N.constructor,se=ae.precision;if(T(N)>16)throw Error(i+T(N));if(!N.s)return new ae(p);for(D==null?(r=!1,Q=se):Q=D,Y=new ae(.03125);N.abs().gte(.1);)N=N.times(Y),te+=5;for(z=Math.log(d(2,te))/Math.LN10*2+5|0,Q+=z,B=q=H=new ae(p),ae.precision=Q;;){if(q=M(q.times(N),Q),B=B.times(++X),Y=H.plus(C(q,B,Q)),w(Y.d).slice(0,Q)===w(H.d).slice(0,Q)){for(;te--;)H=M(H.times(H),Q);return ae.precision=se,D==null?(r=!0,M(H,se)):H}H=Y}}n(F,"exp");function T(N){for(var D=N.e*h,B=N.d[0];B>=10;B/=10)D++;return D}n(T,"getBase10Exponent");function E(N,D,B){if(D>N.LN10.sd())throw r=!0,B&&(N.precision=B),Error(a+"LN10 precision limit exceeded");return M(new N(N.LN10),D)}n(E,"getLn10");function k(N){for(var D="";N--;)D+="0";return D}n(k,"getZeroString");function P(N,D){var B,z,q,H,Y,Q,X,te,ae,se=1,J=10,ne=N,pe=ne.d,le=ne.constructor,ie=le.precision;if(ne.s<1)throw Error(a+(ne.s?"NaN":"-Infinity"));if(ne.eq(p))return new le(0);if(D==null?(r=!1,te=ie):te=D,ne.eq(10))return D==null&&(r=!0),E(le,te);if(te+=J,le.precision=te,B=w(pe),z=B.charAt(0),H=T(ne),Math.abs(H)<15e14){for(;z<7&&z!=1||z==1&&B.charAt(1)>3;)ne=ne.times(N),B=w(ne.d),z=B.charAt(0),se++;H=T(ne),z>1?(ne=new le("0."+B),H++):ne=new le(z+"."+B.slice(1))}else return X=E(le,te+2,ie).times(H+""),ne=P(new le(z+"."+B.slice(1)),te-J).plus(X),le.precision=ie,D==null?(r=!0,M(ne,ie)):ne;for(Q=Y=ne=C(ne.minus(p),ne.plus(p),te),ae=M(ne.times(ne),te),q=3;;){if(Y=M(Y.times(ae),te),X=Q.plus(C(Y,new le(q),te)),w(X.d).slice(0,te)===w(Q.d).slice(0,te))return Q=Q.times(2),H!==0&&(Q=Q.plus(E(le,te+2,ie).times(H+""))),Q=C(Q,new le(se),te),le.precision=ie,D==null?(r=!0,M(Q,ie)):Q;Q=X,q+=2}}n(P,"ln");function _(N,D){var B,z,q;for((B=D.indexOf("."))>-1&&(D=D.replace(".","")),(z=D.search(/e/i))>0?(B<0&&(B=z),B+=+D.slice(z+1),D=D.substring(0,z)):B<0&&(B=D.length),z=0;D.charCodeAt(z)===48;)++z;for(q=D.length;D.charCodeAt(q-1)===48;)--q;if(D=D.slice(z,q),D){if(q-=z,B=B-z-1,N.e=c(B/h),N.d=[],z=(B+1)%h,B<0&&(z+=h),z<q){for(z&&N.d.push(+D.slice(0,z)),q-=h;z<q;)N.d.push(+D.slice(z,z+=h));D=D.slice(z),z=h-D.length}else z-=q;for(;z--;)D+="0";if(N.d.push(+D),r&&(N.e>x||N.e<-x))throw Error(i+B)}else N.s=0,N.e=0,N.d=[0];return N}n(_,"parseDecimal");function M(N,D,B){var z,q,H,Y,Q,X,te,ae,se=N.d;for(Y=1,H=se[0];H>=10;H/=10)Y++;if(z=D-Y,z<0)z+=h,q=D,te=se[ae=0];else{if(ae=Math.ceil((z+1)/h),H=se.length,ae>=H)return N;for(te=H=se[ae],Y=1;H>=10;H/=10)Y++;z%=h,q=z-h+Y}if(B!==void 0&&(H=d(10,Y-q-1),Q=te/H%10|0,X=D<0||se[ae+1]!==void 0||te%H,X=B<4?(Q||X)&&(B==0||B==(N.s<0?3:2)):Q>5||Q==5&&(B==4||X||B==6&&(z>0?q>0?te/d(10,Y-q):0:se[ae-1])%10&1||B==(N.s<0?8:7))),D<1||!se[0])return X?(H=T(N),se.length=1,D=D-H-1,se[0]=d(10,(h-D%h)%h),N.e=c(-D/h)||0):(se.length=1,se[0]=N.e=N.s=0),N;if(z==0?(se.length=ae,H=1,ae--):(se.length=ae+1,H=d(10,h-z),se[ae]=q>0?(te/d(10,Y-q)%d(10,q)|0)*H:0),X)for(;;)if(ae==0){(se[0]+=H)==m&&(se[0]=1,++N.e);break}else{if(se[ae]+=H,se[ae]!=m)break;se[ae--]=0,H=1}for(z=se.length;se[--z]===0;)se.pop();if(r&&(N.e>x||N.e<-x))throw Error(i+T(N));return N}n(M,"round");function L(N,D){var B,z,q,H,Y,Q,X,te,ae,se,J=N.constructor,ne=J.precision;if(!N.s||!D.s)return D.s?D.s=-D.s:D=new J(N),r?M(D,ne):D;if(X=N.d,se=D.d,z=D.e,te=N.e,X=X.slice(),Y=te-z,Y){for(ae=Y<0,ae?(B=X,Y=-Y,Q=se.length):(B=se,z=te,Q=X.length),q=Math.max(Math.ceil(ne/h),Q)+2,Y>q&&(Y=q,B.length=1),B.reverse(),q=Y;q--;)B.push(0);B.reverse()}else{for(q=X.length,Q=se.length,ae=q<Q,ae&&(Q=q),q=0;q<Q;q++)if(X[q]!=se[q]){ae=X[q]<se[q];break}Y=0}for(ae&&(B=X,X=se,se=B,D.s=-D.s),Q=X.length,q=se.length-Q;q>0;--q)X[Q++]=0;for(q=se.length;q>Y;){if(X[--q]<se[q]){for(H=q;H&&X[--H]===0;)X[H]=m-1;--X[H],X[q]+=m}X[q]-=se[q]}for(;X[--Q]===0;)X.pop();for(;X[0]===0;X.shift())--z;return X[0]?(D.d=X,D.e=z,r?M(D,ne):D):new J(0)}n(L,"subtract");function U(N,D,B){var z,q=T(N),H=w(N.d),Y=H.length;return D?(B&&(z=B-Y)>0?H=H.charAt(0)+"."+H.slice(1)+k(z):Y>1&&(H=H.charAt(0)+"."+H.slice(1)),H=H+(q<0?"e":"e+")+q):q<0?(H="0."+k(-q-1)+H,B&&(z=B-Y)>0&&(H+=k(z))):q>=Y?(H+=k(q+1-Y),B&&(z=B-q-1)>0&&(H=H+"."+k(z))):((z=q+1)<Y&&(H=H.slice(0,z)+"."+H.slice(z)),B&&(z=B-Y)>0&&(q+1===Y&&(H+="."),H+=k(z))),N.s<0?"-"+H:H}n(U,"toString");function W(N,D){if(N.length>D)return N.length=D,!0}n(W,"truncate");function V(N){var D,B,z;function q(H){var Y=this;if(!(Y instanceof q))return new q(H);if(Y.constructor=q,H instanceof q){Y.s=H.s,Y.e=H.e,Y.d=(H=H.d)?H.slice():H;return}if(typeof H=="number"){if(H*0!==0)throw Error(s+H);if(H>0)Y.s=1;else if(H<0)H=-H,Y.s=-1;else{Y.s=0,Y.e=0,Y.d=[0];return}if(H===~~H&&H<1e7){Y.e=0,Y.d=[H];return}return _(Y,H.toString())}else if(typeof H!="string")throw Error(s+H);if(H.charCodeAt(0)===45?(H=H.slice(1),Y.s=-1):Y.s=1,f.test(H))_(Y,H);else throw Error(s+H)}if(n(q,"Decimal"),q.prototype=y,q.ROUND_UP=0,q.ROUND_DOWN=1,q.ROUND_CEIL=2,q.ROUND_FLOOR=3,q.ROUND_HALF_UP=4,q.ROUND_HALF_DOWN=5,q.ROUND_HALF_EVEN=6,q.ROUND_HALF_CEIL=7,q.ROUND_HALF_FLOOR=8,q.clone=V,q.config=q.set=j,N===void 0&&(N={}),N)for(z=["precision","rounding","toExpNeg","toExpPos","LN10"],D=0;D<z.length;)N.hasOwnProperty(B=z[D++])||(N[B]=this[B]);return q.config(N),q}n(V,"clone");function j(N){if(!N||typeof N!="object")throw Error(a+"Object expected");var D,B,z,q=["precision",1,e,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(D=0;D<q.length;D+=3)if((z=N[B=q[D]])!==void 0)if(c(z)===z&&z>=q[D+1]&&z<=q[D+2])this[B]=z;else throw Error(s+B+": "+z);if((z=N[B="LN10"])!==void 0)if(z==Math.LN10)this[B]=new this(z);else throw Error(s+B+": "+z);return this}n(j,"config"),o=V(o),o.default=o.Decimal=o,p=new o(1),typeof define=="function"&&define.amd?define(function(){return o}):typeof o3<"u"&&o3.exports?o3.exports=o:(t||(t=typeof self<"u"&&self&&self.self==self?self:Function("return this")()),t.Decimal=o)})(J1e)});var WCe=Ct((W4o,DK)=>{"use strict";var Irt=Object.prototype.hasOwnProperty,Qi="~";function k2(){}n(k2,"Events");Object.create&&(k2.prototype=Object.create(null),new k2().__proto__||(Qi=!1));function brt(t,e,o){this.fn=t,this.context=e,this.once=o||!1}n(brt,"EE");function qCe(t,e,o,r,a){if(typeof o!="function")throw new TypeError("The listener must be a function");var s=new brt(o,r||t,a),i=Qi?Qi+e:e;return t._events[i]?t._events[i].fn?t._events[i]=[t._events[i],s]:t._events[i].push(s):(t._events[i]=s,t._eventsCount++),t}n(qCe,"addListener");function TB(t,e){--t._eventsCount===0?t._events=new k2:delete t._events[e]}n(TB,"clearEvent");function yi(){this._events=new k2,this._eventsCount=0}n(yi,"EventEmitter");yi.prototype.eventNames=n(function(){var e=[],o,r;if(this._eventsCount===0)return e;for(r in o=this._events)Irt.call(o,r)&&e.push(Qi?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(o)):e},"eventNames");yi.prototype.listeners=n(function(e){var o=Qi?Qi+e:e,r=this._events[o];if(!r)return[];if(r.fn)return[r.fn];for(var a=0,s=r.length,i=new Array(s);a<s;a++)i[a]=r[a].fn;return i},"listeners");yi.prototype.listenerCount=n(function(e){var o=Qi?Qi+e:e,r=this._events[o];return r?r.fn?1:r.length:0},"listenerCount");yi.prototype.emit=n(function(e,o,r,a,s,i){var c=Qi?Qi+e:e;if(!this._events[c])return!1;var d=this._events[c],f=arguments.length,p,m;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),f){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,o),!0;case 3:return d.fn.call(d.context,o,r),!0;case 4:return d.fn.call(d.context,o,r,a),!0;case 5:return d.fn.call(d.context,o,r,a,s),!0;case 6:return d.fn.call(d.context,o,r,a,s,i),!0}for(m=1,p=new Array(f-1);m<f;m++)p[m-1]=arguments[m];d.fn.apply(d.context,p)}else{var h=d.length,v;for(m=0;m<h;m++)switch(d[m].once&&this.removeListener(e,d[m].fn,void 0,!0),f){case 1:d[m].fn.call(d[m].context);break;case 2:d[m].fn.call(d[m].context,o);break;case 3:d[m].fn.call(d[m].context,o,r);break;case 4:d[m].fn.call(d[m].context,o,r,a);break;default:if(!p)for(v=1,p=new Array(f-1);v<f;v++)p[v-1]=arguments[v];d[m].fn.apply(d[m].context,p)}}return!0},"emit");yi.prototype.on=n(function(e,o,r){return qCe(this,e,o,r,!1)},"on");yi.prototype.once=n(function(e,o,r){return qCe(this,e,o,r,!0)},"once");yi.prototype.removeListener=n(function(e,o,r,a){var s=Qi?Qi+e:e;if(!this._events[s])return this;if(!o)return TB(this,s),this;var i=this._events[s];if(i.fn)i.fn===o&&(!a||i.once)&&(!r||i.context===r)&&TB(this,s);else{for(var c=0,d=[],f=i.length;c<f;c++)(i[c].fn!==o||a&&!i[c].once||r&&i[c].context!==r)&&d.push(i[c]);d.length?this._events[s]=d.length===1?d[0]:d:TB(this,s)}return this},"removeListener");yi.prototype.removeAllListeners=n(function(e){var o;return e?(o=Qi?Qi+e:e,this._events[o]&&TB(this,o)):(this._events=new k2,this._eventsCount=0),this},"removeAllListeners");yi.prototype.off=yi.prototype.removeListener;yi.prototype.addListener=yi.prototype.on;yi.prefixed=Qi;yi.EventEmitter=yi;typeof DK<"u"&&(DK.exports=yi)});var WFe=Ct(an=>{"use strict";(function(){"use strict";var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),x=!1,y=!1,b=!1,S=!1,w=!1,C;C=Symbol.for("react.module.reference");function F(ue){return!!(typeof ue=="string"||typeof ue=="function"||ue===o||ue===a||w||ue===r||ue===f||ue===p||S||ue===v||x||y||b||typeof ue=="object"&&ue!==null&&(ue.$$typeof===h||ue.$$typeof===m||ue.$$typeof===s||ue.$$typeof===i||ue.$$typeof===d||ue.$$typeof===C||ue.getModuleId!==void 0))}n(F,"isValidElementType");function T(ue){if(typeof ue=="object"&&ue!==null){var he=ue.$$typeof;switch(he){case t:var Re=ue.type;switch(Re){case o:case a:case r:case f:case p:return Re;default:var Ae=Re&&Re.$$typeof;switch(Ae){case c:case i:case d:case h:case m:case s:return Ae;default:return he}}case e:return he}}}n(T,"typeOf");var E=i,k=s,P=t,_=d,M=o,L=h,U=m,W=e,V=a,j=r,N=f,D=p,B=!1,z=!1;function q(ue){return B||(B=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}n(q,"isAsyncMode");function H(ue){return z||(z=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}n(H,"isConcurrentMode");function Y(ue){return T(ue)===i}n(Y,"isContextConsumer");function Q(ue){return T(ue)===s}n(Q,"isContextProvider");function X(ue){return typeof ue=="object"&&ue!==null&&ue.$$typeof===t}n(X,"isElement");function te(ue){return T(ue)===d}n(te,"isForwardRef");function ae(ue){return T(ue)===o}n(ae,"isFragment");function se(ue){return T(ue)===h}n(se,"isLazy");function J(ue){return T(ue)===m}n(J,"isMemo");function ne(ue){return T(ue)===e}n(ne,"isPortal");function pe(ue){return T(ue)===a}n(pe,"isProfiler");function le(ue){return T(ue)===r}n(le,"isStrictMode");function ie(ue){return T(ue)===f}n(ie,"isSuspense");function de(ue){return T(ue)===p}n(de,"isSuspenseList"),an.ContextConsumer=E,an.ContextProvider=k,an.Element=P,an.ForwardRef=_,an.Fragment=M,an.Lazy=L,an.Memo=U,an.Portal=W,an.Profiler=V,an.StrictMode=j,an.Suspense=N,an.SuspenseList=D,an.isAsyncMode=q,an.isConcurrentMode=H,an.isContextConsumer=Y,an.isContextProvider=Q,an.isElement=X,an.isForwardRef=te,an.isFragment=ae,an.isLazy=se,an.isMemo=J,an.isPortal=ne,an.isProfiler=pe,an.isStrictMode=le,an.isSuspense=ie,an.isSuspenseList=de,an.isValidElementType=F,an.typeOf=T})()});var KFe=Ct((WVo,GFe)=>{"use strict";GFe.exports=WFe()});var OOe=K(lae(),1);var Fw=K(Ro(),1);var fae=n(()=>{let t=null;return{get:n(()=>t,"get"),set:n(e=>{t=e},"set")}},"createInMemoryBookmarkStorage");var pae="_creationTime",xLe=n(t=>{if(typeof t!="object"||t===null)return;let e=t._id;return typeof e=="string"?e:void 0},"rowId"),yLe=n((t,e)=>{let o=e[pae];if(typeof o!="number")return t.length;for(let[r,a]of t.entries()){let s=a[pae];if(typeof s=="number"&&s>o)return r}return t.length},"insertionIndex"),mae=n(t=>{if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.key=="string"&&typeof e.table=="string"&&(e.op==="insert"||e.op==="update"||e.op==="delete")},"isMutationDelta"),hae=n((t,e)=>{if(!Array.isArray(t))return;let o=[];for(let d of t){if(xLe(d)===void 0)return;o.push(d)}let{key:r,op:a,row:s}=e;if(a==="delete"){let d=o.filter(f=>f._id!==r);return d.length===o.length?[...o]:d}if(s===void 0)return;let i=o.findIndex(d=>d._id===r);if(i===-1){let d=[...o];return d.splice(yLe(o,s),0,s),d}let c=[...o];return c[i]=s,c},"applyDelta");var gae=n((t,e,o,r)=>{let a=[],s=n((c,d)=>{for(let f of t.all())if(f.fn.__lunoraRef===c&&f.shardKey===e&&f.argsKey===d)return f},"findState");return{rollbacks:a,store:{getAllQueries:n(c=>{let d=[];for(let f of t.all())f.fn.__lunoraRef===c.__lunoraRef&&f.shardKey===e&&d.push({args:f.args,value:f.lastValue});return d},"getAllQueries"),getQuery:n((c,d)=>s(c.__lunoraRef,r(d??{}))?.lastValue,"getQuery"),setQuery:n((c,d,f)=>{let p=s(c.__lunoraRef,r(d??{}));p&&a.push(o(p,f))},"setQuery")}}},"createLocalStore");var ILe=n((t,e)=>t<e?-1:t>e?1:0,"compareKeys"),VI=n(t=>{if(t===void 0)return"null";if(t===null||typeof t!="object")return JSON.stringify(t);if(Array.isArray(t))return`[${t.map(a=>VI(a)).join(",")}]`;let e=t,o=Object.keys(e).toSorted(ILe),r=[];for(let a of o){let s=e[a];s!==void 0&&r.push(`${JSON.stringify(a)}:${VI(s)}`)}return`{${r.join(",")}}`},"stableStringify"),UI=class t{static{n(this,"SubscriptionRegistry")}static key(e,o,r){return`${e}::${VI(o)}::${r??""}`}byKey=new Map;byId=new Map;get(e){return this.byKey.get(e)}getById(e){return this.byId.get(e)}add(e){this.byKey.set(t.key(e.fn.__lunoraRef,e.args,e.shardKey),e),this.byId.set(e.id,e)}remove(e){this.byKey.delete(t.key(e.fn.__lunoraRef,e.args,e.shardKey)),this.byId.delete(e.id)}all(){return[...this.byKey.values()]}};var vae=0,eM=n(()=>{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();vae+=1;let t=typeof crypto<"u"&&typeof crypto.getRandomValues=="function"?[...crypto.getRandomValues(new Uint8Array(8))].map(e=>e.toString(16).padStart(2,"0")).join(""):Math.random().toString(16).slice(2,12);return`m_${Date.now().toString(36)}_${vae.toString(36)}_${t}`},"nextId"),Zk=n((t,e,o,r)=>{if(t){t({error:o,mutationId:r,operation:e});return}console.warn(`[lunora] offline-queue persistence ${e} failed`,o)},"reportPersistenceError"),Jk=class{static{n(this,"OfflineQueue")}queueBeforeFirstConnect;maxItems;onPersistenceError;persistence;items=[];constructor(e={},o){this.maxItems=e.maxItems??1e3,this.queueBeforeFirstConnect=e.queueBeforeFirstConnect??!1,this.onPersistenceError=e.onPersistenceError,this.persistence=o}get size(){return this.items.length}enqueue(e){let o=e;for(o.id??=eM(),this.items.push(o),this.persistence?.append({args:o.args,functionPath:o.functionPath,id:o.id,identity:o.identity,shardKey:o.shardKey}).catch(r=>{Zk(this.onPersistenceError,"append",r,o.id)});this.items.length>this.maxItems;){let r=this.items.shift();if(r){r.id&&this.persistence?.remove(r.id).catch(s=>{Zk(this.onPersistenceError,"remove",s,r.id)});let a=new Error("offline queue overflow");a.code="OFFLINE_QUEUE_OVERFLOW",r.reject(a)}}}async hydrate(){if(!this.persistence)return[];let e=await this.persistence.load(),o=new Set;for(let r of e)this.items.some(a=>a.id===r.id)||(this.items.push({args:r.args,functionPath:r.functionPath,id:r.id,identity:r.identity,reject:n(()=>{},"reject"),resolve:n(()=>{},"resolve"),shardKey:r.shardKey}),o.add(r.shardKey));return[...o]}drain(e){if(!e){let a=[...this.items];return this.items.length=0,a}let o=[],r=[];for(let a of this.items)(e(a)?o:r).push(a);return this.items.length=0,this.items.push(...r),o}requeue(e){e.length!==0&&this.items.unshift(...e)}clear(){for(let e of this.items){let o=new Error("CLIENT_CLOSED");o.code="CLIENT_CLOSED",e.reject(o)}this.items.length=0}};var Sz=n((t,e,o)=>`${t}::${e}::${o??""}`,"queryCacheKey");var wz=n((t={},e=Math.random)=>{let o=t.initialDelayMs??250,r=t.maxDelayMs??3e4,a=t.jitter??!0,s=0;return{next(){let i=Math.min(r,o*2**s);if(s+=1,!a)return i;let c=i/2;return Math.floor(c+e()*(i-c))},reset(){s=0}}},"createReconnect");var xae=n(t=>{let e=t.maxBuffer??1024,o=[],r=[],a=!1,s,i=!1,c=n(()=>{let m=r.shift();if(!m)return!1;if(s)return m.reject(s),!0;if(o.length>0){let h=o.shift();return m.resolve({done:!1,value:h}),!0}return a?(m.resolve({done:!0,value:void 0}),!0):(r.unshift(m),!1)},"flushOne"),d={complete(){if(!(a||s))for(a=!0;c(););},fail(m){if(!(a||s))for(s=m,o.length=0;c(););},push(m){if(!(a||s||i)){if(o.length>=e){d.fail(Object.assign(new Error(`stream buffer overflow (max=${e.toString()}); the consumer cannot keep up with the producer`),{code:"STREAM_BACKPRESSURE"}));return}o.push(m),c()}}},f=n(()=>{if(!i){i=!0,a=!0,o.length=0;try{t.onCancel()}catch{}for(;c(););}},"cancel");return{handle:d,iterable:{cancel:f,[Symbol.asyncIterator](){return{next(){if(s)return Promise.reject(s);if(o.length>0){let m=o.shift();return Promise.resolve({done:!1,value:m})}return a?Promise.resolve({done:!0,value:void 0}):new Promise((m,h)=>{r.push({reject:h,resolve:m})})},return(){return f(),Promise.resolve({done:!0,value:void 0})}}}}}},"createStream");var bLe="/_lunora/rpc",SLe="/_lunora/ws",Cz=n(t=>t===void 0||t===""?"":`&bucket=${encodeURIComponent(t)}`,"bucketQuery"),Fz=n(t=>{for(let e=t.length-1;e>=0;e-=1)t[e]?.()},"rollbackOptimistic"),wLe=n((t,e)=>{for(let o of e)o.op==="delete"?t.delete(o.key):o.value!==void 0&&t.set(o.key,o.value)},"applyRowOpsToView"),CLe="lunora-ping",FLe=3e4,RLe=1e4,ELe=250,ALe=64,TLe="/_lunora/admin/shard-traffic",kLe="/_lunora/admin/scheduled",MLe="/_lunora/admin/scheduled/status",PLe="/_lunora/admin/scheduled/ws",OLe="/_lunora/admin/scheduled/cancel",NLe="/_lunora/admin/scheduled/dead",DLe="/_lunora/admin/scheduled/dead/retry",_Le="/_lunora/admin/scheduled/dead/cancel",LLe="/_lunora/admin/workflows/instances",BLe="/_lunora/admin/workflows/instance",VLe="/_lunora/admin/workflows/status",tM="/_lunora/admin/storage",ULe="/_lunora/admin/storage/url",zLe="/_lunora/admin/storage/buckets",HLe="/_lunora/admin/functions",$Le="/_lunora/admin/cron-jobs",jLe="/_lunora/admin/cron-jobs/run",qLe="/_lunora/admin/openapi",WLe="/_lunora/admin/openrpc",GLe="/_lunora/admin/global/tables",KLe="/_lunora/admin/global/table",YLe="/_lunora/admin/global/facet",XLe="/_lunora/admin/vector/indexes",QLe="/_lunora/admin/vector/query",ZLe="/_lunora/admin/auth/users",yae="/_lunora/admin/auth/sessions",JLe="/_lunora/admin/auth/users/create",e3e="/_lunora/admin/auth/users/role",t3e="/_lunora/admin/auth/users/ban",o3e="/_lunora/admin/auth/users/unban",r3e="/_lunora/admin/auth/users/password",n3e="/_lunora/admin/auth/users/remove",a3e="/_lunora/admin/auth/users/impersonate",s3e="/_lunora/admin/auth/sessions/revoke",i3e="/_lunora/admin/auth/sessions/revoke-all",l3e="/_lunora/admin/auth/capabilities",c3e="/_lunora/admin/auth/users/update",u3e="/_lunora/admin/auth/accounts",d3e="/_lunora/admin/auth/accounts/unlink",f3e="/_lunora/admin/auth/passkeys",p3e="/_lunora/admin/auth/passkeys/delete",m3e="/_lunora/admin/auth/two-factor/disable",h3e="/_lunora/admin/auth/organizations",g3e="/_lunora/admin/auth/organizations/members",v3e="/_lunora/admin/auth/organizations/invitations",x3e="/_lunora/admin/auth/organizations/members/remove",y3e="/_lunora/admin/auth/organizations/invitations/cancel",I3e="/api/auth",b3e="/get-session",Iae=n(t=>t.startsWith("https://")?`wss://${t.slice(8)}`:t.startsWith("http://")?`ws://${t.slice(7)}`:t,"deriveWsUrl"),tF=n((t,e)=>`${t.endsWith("/")?t.slice(0,-1):t}${e}`,"joinUrl"),zI=n((t,e)=>{let o=new URLSearchParams;for(let[a,s]of Object.entries(e))s!==void 0&&s!==""&&o.set(a,String(s));let r=o.toString();return r===""?t:`${t}?${r}`},"withQuery"),oi=n(t=>t??"","connectionKey"),wae=n((t,e)=>{let o=t.lastValue,r=t.serverVersion;t.lastValue=e;for(let a of t.callbacks)try{a(e)}catch{}return()=>{if(!(t.serverVersion>r)&&t.lastValue===e){t.lastValue=o;for(let a of t.callbacks)try{a(o)}catch{}}}},"writeOptimisticToState"),S3e=n((t,e)=>{let o;try{o=e(t.lastValue)}catch{return}return wae(t,o)},"applyOptimisticToState"),w3e=n(t=>{let e=t.error,o=typeof e?.code=="string"?e.code:void 0,r=typeof e?.message=="string"?e.message:void 0,a=(typeof t.message=="string"?t.message:void 0)??r??"stream error";return Object.assign(new Error(a),o===void 0?void 0:{code:o})},"buildStreamError"),bae=n(t=>{let e=t.error,o=typeof e?.code=="string"?e.code:void 0,r=typeof e?.message=="string"?e.message:void 0;return{message:(typeof t.message=="string"?t.message:void 0)??r??"subscription error",...o===void 0?{}:{code:o}}},"buildSubscriptionError"),Sae=n((t,e)=>{for(let o of t)try{o(e)}catch{}},"fanSubscriptionError"),C3e=new TextDecoder,F3e=n(t=>{if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return C3e.decode(t)},"decodeServerFrame"),Kl=n((t,e)=>{if(!t.socket||t.wsState!=="open")return!1;try{return t.socket.send(JSON.stringify(e)),!0}catch{return!1}},"sendOn"),oF=class t{static{n(this,"LunoraClient")}static MAX_POKE_BUFFERS=256;url;wsUrl;wsToken;authBasePath;fetchImpl;WebSocketImpl;bookmark;reconnectOptions;connectTimeoutMs;heartbeatIntervalMs;offlineQueue;outbox;clientId;clientWatermarks=new Map;outboxMutationCounter=0;onPersistenceError;persistence;queryCache;hydratedQueryCache=new Map;pendingCacheWrites=new Map;cacheFlushTimer;subscriptions=new UI;connections=new Map;defaultConnectionContext;connectionContexts=new Map;connectionContextHolders=new Map;authToken=null;queuedIdentities=new Map;closed=!1;authTokenListeners=new Set;statusListeners=new Set;tokenExpiredListeners=new Set;whisperHandlers=new Map;lastStatus="idle";nextSubId=0;nextStreamId=0;streams=new Map;shapeSubscriptions=new Map;pokeBuffers=new Map;nextShapeId=0;constructor(e){this.url=e.url,this.wsUrl=e.wsUrl??tF(Iae(e.url),SLe),this.wsToken=e.wsToken;let o=e.authBasePath??I3e;this.authBasePath=o.endsWith("/")?o.slice(0,-1):o,this.fetchImpl=e.fetch??(typeof fetch=="function"?fetch.bind(globalThis):void 0),this.WebSocketImpl=e.WebSocket??(typeof WebSocket=="function"?WebSocket:void 0),this.bookmark=e.bookmarkStorage??fae(),this.reconnectOptions=e.reconnect,this.heartbeatIntervalMs=e.heartbeatIntervalMs??FLe,this.connectTimeoutMs=e.connectTimeoutMs??RLe,this.defaultConnectionContext=e.connectionContext,this.persistence=e.persistence,this.queryCache=e.queryCache===!1?void 0:e.queryCache,this.onPersistenceError=e.offlineQueue?.onPersistenceError,this.offlineQueue=new Jk(e.offlineQueue,e.persistence),this.outbox=e.outbox,this.clientId=e.clientId??`client-${eM()}`,this.persistence&&queueMicrotask(()=>{this.hydratePersistedQueue().catch(()=>{})}),this.queryCache&&queueMicrotask(()=>{this.hydrateQueryCache().catch(()=>{})})}setAuthToken(e){if(this.authToken!==e){this.authToken=e,this.rejectQueuedForIdentityChange();for(let o of this.authTokenListeners)try{o(e)}catch{}}}getAuthToken(){return this.authToken}currentIdentity(){return this.identityFingerprint()}clientIdentifier(){return this.clientId}confirmedMutationWatermark(e){return this.clientWatermarks.get(e??"")??0}async callMutator(e,o,r){let a=r?.clientSeq;if(a!==void 0&&(!Number.isInteger(a)||a<=0))throw new Error(`callMutator: clientSeq must be a positive integer, got ${String(a)}`);let s=r?.shardKey??"",i,c=await this.rpc(e,o,r?.shardKey,{captureBookmark:!0,clientId:this.clientId,clientSeq:a,onMutationAck:n(f=>{i=f},"onMutationAck")});return i!==void 0&&i>(this.clientWatermarks.get(s)??0)&&this.clientWatermarks.set(s,i),{applied:i===void 0||i===a,result:c}}onAuthTokenChange(e){return this.authTokenListeners.add(e),()=>{this.authTokenListeners.delete(e)}}async getCurrentUser(){if(this.closed||!this.fetchImpl)return null;let e={};this.authToken&&(e.authorization=`Bearer ${this.authToken}`);try{let o=await this.fetchImpl(tF(this.url,`${this.authBasePath}${b3e}`),{credentials:"include",headers:e,method:"GET"});return o.ok?(await o.json())?.user??null:null}catch{return null}}setWsToken(e){if(this.wsToken!==e){this.wsToken=e;for(let o of this.connections.values())if(o.socket)try{o.socket.close()}catch{}}}setConnectionContext(e,o={}){let r=oi(o.shardKey);e===void 0?this.connectionContexts.delete(r):this.connectionContexts.set(r,e),this.refreshConnectionContext(r)}acquireConnectionContext(e,o={}){let r=oi(o.shardKey),a={context:e},s=this.connectionContextHolders.get(r);s?s.push(a):this.connectionContextHolders.set(r,[a]),this.refreshConnectionContext(r);let i=!1;return()=>{if(i)return;i=!0;let c=this.connectionContextHolders.get(r);if(!c)return;let d=c.indexOf(a);d!==-1&&c.splice(d,1),c.length===0&&this.connectionContextHolders.delete(r),this.refreshConnectionContext(r)}}whisperSubscribe(e,o,r={}){let a=oi(r.shardKey),s=this.whisperHandlers.get(a);s||(s=new Map,this.whisperHandlers.set(a,s));let i=s.get(e),c=i===void 0;if(i||(i=new Set,s.set(e,i)),i.add(o),this.ensureSocket(r.shardKey),c){let d=this.getConnection(r.shardKey);d&&Kl(d,{topic:e,type:"whisper_subscribe"})}return()=>{let d=this.whisperHandlers.get(a),f=d?.get(e);if(!f?.delete(o)||f.size>0)return;d?.delete(e),d?.size===0&&this.whisperHandlers.delete(a);let p=this.getConnection(r.shardKey);p&&Kl(p,{topic:e,type:"whisper_unsubscribe"})}}whisper(e,o,r={}){this.ensureSocket(r.shardKey);let a=this.getConnection(r.shardKey);a&&Kl(a,{data:o,topic:e,type:"whisper"})}onTokenExpired(e){return this.tokenExpiredListeners.add(e),()=>{this.tokenExpiredListeners.delete(e)}}connectionStatus(){return this.computeStatus()}onConnectionStatus(e){return this.statusListeners.add(e),e(this.computeStatus()),()=>{this.statusListeners.delete(e)}}async query(e,o,r={}){if(this.closed)throw new Error("LunoraClient is closed");return await this.rpc(e.__lunoraRef,o,r.shardKey,{attachBookmark:!0})}async mutation(e,o,r={}){if(this.closed)throw new Error("LunoraClient is closed");let a=o,s=r.mutationId??eM(),i=this.applyOptimisticUpdates(e.__lunoraRef,a,r.shardKey,r.optimistic);r.optimisticUpdate&&this.applyOptimisticUpdate(r.optimisticUpdate,o,r.shardKey,i);let c=this.getConnection(r.shardKey),d=c?.wsState??"idle",f=c?.socket!==void 0,p=c?.wasEverConnected??!1,{queueBeforeFirstConnect:m}=this.offlineQueue,h=p||m,v=this.WebSocketImpl!==void 0&&h;if(d!=="open"&&!f&&v||d==="connecting"&&h)return this.enqueueOfflineMutation(e,a,r.shardKey,s,i);try{return await this.rpc(e.__lunoraRef,a,r.shardKey,{captureBookmark:!0,mutationId:s})}catch(y){throw Fz(i),y}}async action(e,o,r={}){if(this.closed)throw new Error("LunoraClient is closed");return await this.rpc(e.__lunoraRef,o,r.shardKey)}async shardTraffic(e){if(this.closed)throw new Error("LunoraClient is closed");let o=await this.adminFetch(TLe,"POST",{table:e});return{failed:o.failed??0,ok:o.ok??0,shards:o.shards??[]}}async listScheduledJobs(){if(this.closed)throw new Error("LunoraClient is closed");return(await this.adminFetch(kLe,"GET")).records??[]}async schedulerStatus(){if(this.closed)throw new Error("LunoraClient is closed");let e=await this.adminFetch(MLe,"GET");return{backlog:e.backlog??0,inFlight:e.inFlight??0,pools:e.pools??[]}}async cancelScheduledJob(e){if(this.closed)throw new Error("LunoraClient is closed");return{cancelled:(await this.adminFetch(OLe,"POST",{id:e})).cancelled===!0}}async listDeadJobs(){if(this.closed)throw new Error("LunoraClient is closed");return(await this.adminFetch(NLe,"GET")).records??[]}async retryDeadJob(e){if(this.closed)throw new Error("LunoraClient is closed");return{retried:(await this.adminFetch(DLe,"POST",{id:e})).retried===!0}}async removeDeadJob(e){if(this.closed)throw new Error("LunoraClient is closed");return{removed:(await this.adminFetch(_Le,"POST",{id:e})).removed===!0}}async listWorkflowInstances(e){if(this.closed)throw new Error("LunoraClient is closed");let o=new URLSearchParams({name:e.name});e.status!==void 0&&o.set("status",e.status),e.page!==void 0&&o.set("page",String(e.page)),e.perPage!==void 0&&o.set("perPage",String(e.perPage));let r=await this.adminFetch(`${LLe}?${o.toString()}`,"GET");return{configured:r.configured,instances:r.instances??[],page:r.page??1,perPage:r.perPage??e.perPage??0,totalCount:r.totalCount}}async getWorkflowInstance(e){if(this.closed)throw new Error("LunoraClient is closed");let o=new URLSearchParams({id:e.id,name:e.name}),r=await this.adminFetch(`${BLe}?${o.toString()}`,"GET");return{createdOn:r.createdOn,endedOn:r.endedOn,error:r.error,id:r.id??e.id,output:r.output,params:r.params,startedOn:r.startedOn,status:r.status??"unknown",steps:r.steps??[]}}async setWorkflowInstanceStatus(e){if(this.closed)throw new Error("LunoraClient is closed");return{status:(await this.adminFetch(VLe,"POST",{action:e.action,id:e.id,name:e.name})).status??"unknown"}}subscribeScheduledJobs(e){if(this.closed)throw new Error("LunoraClient is closed");if(this.WebSocketImpl===void 0)return()=>{};let o=tF(Iae(this.url),PLe),r=wz(this.reconnectOptions),a,s,i=!1,c=n(()=>{if(i||this.WebSocketImpl===void 0)return;let d=this.wsToken===void 0?o:`${o}?token=${encodeURIComponent(this.wsToken)}`;a=new this.WebSocketImpl(d),a.addEventListener("open",()=>{r.reset()}),a.addEventListener("message",f=>{try{let p=JSON.parse(typeof f.data=="string"?f.data:"");p.type==="jobs"&&Array.isArray(p.records)&&e(p.records)}catch{}}),a.addEventListener("close",()=>{a=void 0,i||(s=setTimeout(c,r.next()))}),a.addEventListener("error",()=>{})},"connect");return c(),()=>{i=!0,s!==void 0&&clearTimeout(s),a?.close()}}async listFunctions(){if(this.closed)throw new Error("LunoraClient is closed");return(await this.adminFetch(HLe,"GET")).functions??[]}async getCronJobs(){if(this.closed)throw new Error("LunoraClient is closed");return(await this.adminFetch($Le,"GET")).jobs??[]}async runCronJob(e){if(this.closed)throw new Error("LunoraClient is closed");let o=await this.adminFetch(jLe,"POST",{name:e});return{name:o.name??e,ran:o.ran===!0}}async fetchOpenApi(){if(this.closed)throw new Error("LunoraClient is closed");return await this.adminFetch(qLe,"GET")}async fetchOpenRpc(){if(this.closed)throw new Error("LunoraClient is closed");return await this.adminFetch(WLe,"GET")}async listStorageObjects(e={}){if(this.closed)throw new Error("LunoraClient is closed");let o=new URLSearchParams;e.prefix!==void 0&&e.prefix!==""&&o.set("prefix",e.prefix),e.cursor!==void 0&&e.cursor!==""&&o.set("cursor",e.cursor),e.limit!==void 0&&o.set("limit",String(e.limit)),e.bucket!==void 0&&e.bucket!==""&&o.set("bucket",e.bucket);let r=o.toString(),a=r===""?tM:`${tM}?${r}`,s=await this.adminFetch(a,"GET");return{cursor:s.cursor,objects:s.objects??[]}}async deleteStorageObject(e,o){if(this.closed)throw new Error("LunoraClient is closed");let r=`${tM}?key=${encodeURIComponent(e)}${Cz(o?.bucket)}`,a=await this.adminFetch(r,"DELETE");return{deleted:a.deleted??!0,key:a.key??e}}async listStorageBuckets(){if(this.closed)throw new Error("LunoraClient is closed");return(await this.adminFetch(zLe,"GET")).buckets??[]}async uploadStorageObject(e){if(this.closed)throw new Error("LunoraClient is closed");let o=`${tM}?key=${encodeURIComponent(e.key)}${Cz(e.bucket)}`,r=await this.adminFetch(o,"PUT",e.body,e.contentType);return{etag:r.etag,key:r.key??e.key}}async signedStorageUrl(e,o){if(this.closed)throw new Error("LunoraClient is closed");let r=o?.expiresInSeconds,a=r===void 0?"":`&expiresIn=${encodeURIComponent(r.toString())}`,s=`${ULe}?key=${encodeURIComponent(e)}${a}${Cz(o?.bucket)}`,i=await this.adminFetch(s,"GET");if(typeof i.url!="string")throw new TypeError("LunoraClient: storage URL endpoint returned no `url`");return i.url}async listGlobalTables(){if(this.closed)throw new Error("LunoraClient is closed");return await this.adminFetch(GLe,"GET")}async readGlobalTablePage(e){if(this.closed)throw new Error("LunoraClient is closed");let o=new URLSearchParams({table:e.table});return e.limit!==void 0&&o.set("limit",String(e.limit)),e.offset!==void 0&&o.set("offset",String(e.offset)),e.filters!==void 0&&e.filters.length>0&&o.set("filters",JSON.stringify(e.filters)),await this.adminFetch(`${KLe}?${o.toString()}`,"GET")}async facetGlobalColumn(e){if(this.closed)throw new Error("LunoraClient is closed");let o=new URLSearchParams({column:e.column,table:e.table});return e.limit!==void 0&&o.set("limit",String(e.limit)),e.filters!==void 0&&e.filters.length>0&&o.set("filters",JSON.stringify(e.filters)),await this.adminFetch(`${YLe}?${o.toString()}`,"GET")}async listVectorIndexes(){if(this.closed)throw new Error("LunoraClient is closed");return(await this.adminFetch(XLe,"GET")).indexes??[]}async queryVectorIndex(e){if(this.closed)throw new Error("LunoraClient is closed");return(await this.adminFetch(QLe,"POST",e)).matches??[]}async listAuthUsers(e={}){if(this.closed)throw new Error("LunoraClient is closed");let o=zI(ZLe,{filterField:e.filterField,filterValue:e.filterValue,limit:e.limit,offset:e.offset,search:e.search,searchField:e.searchField,sortBy:e.sortBy,sortDirection:e.sortDirection});return await this.adminFetch(o,"GET")}async createAuthUser(e){return await this.adminFetch(JLe,"POST",e)}async setAuthUserRole(e){return await this.adminFetch(e3e,"POST",e)}async banAuthUser(e){return await this.adminFetch(t3e,"POST",e)}async unbanAuthUser(e){return await this.adminFetch(o3e,"POST",e)}async setAuthUserPassword(e){await this.adminFetch(r3e,"POST",e)}async removeAuthUser(e){await this.adminFetch(n3e,"POST",e)}async impersonateAuthUser(e){return await this.adminFetch(a3e,"POST",e)}async revokeAuthSession(e){await this.adminFetch(s3e,"POST",e)}async revokeAuthUserSessions(e){await this.adminFetch(i3e,"POST",e)}async getAuthCapabilities(){return await this.adminFetch(l3e,"GET")}async updateAuthUser(e){return await this.adminFetch(c3e,"POST",e)}async listAuthAccounts(e){return await this.adminFetch(zI(u3e,{userId:e.userId}),"GET")}async unlinkAuthAccount(e){await this.adminFetch(d3e,"POST",e)}async listAuthPasskeys(e){return await this.adminFetch(zI(f3e,{userId:e.userId}),"GET")}async deleteAuthPasskey(e){await this.adminFetch(p3e,"POST",e)}async disableAuthTwoFactor(e){await this.adminFetch(m3e,"POST",e)}async listAuthOrganizations(e={}){return await this.adminFetch(zI(h3e,{limit:e.limit,offset:e.offset}),"GET")}async listAuthOrgMembers(e){let o=zI(g3e,{limit:e.limit,offset:e.offset,organizationId:e.organizationId});return await this.adminFetch(o,"GET")}async listAuthOrgInvitations(e){let o=zI(v3e,{limit:e.limit,offset:e.offset,organizationId:e.organizationId});return await this.adminFetch(o,"GET")}async removeAuthOrgMember(e){await this.adminFetch(x3e,"POST",e)}async cancelAuthOrgInvitation(e){await this.adminFetch(y3e,"POST",e)}async listAuthSessions(e={}){if(this.closed)throw new Error("LunoraClient is closed");let o=new URLSearchParams;e.userId!==void 0&&e.userId!==""&&o.set("userId",e.userId),e.limit!==void 0&&o.set("limit",String(e.limit)),e.offset!==void 0&&o.set("offset",String(e.offset));let r=o.toString();return await this.adminFetch(r===""?yae:`${yae}?${r}`,"GET")}subscribe(e,o,r,a={}){if(this.closed)throw new Error("LunoraClient is closed");let s=o??{},i=UI.key(e.__lunoraRef,s,a.shardKey),c=this.subscriptions.get(i),d=r,f=a.onError;if(!c){this.nextSubId+=1;let m=`sub_${this.nextSubId.toString()}`,h=VI(s),v=this.takeHydratedCache(e.__lunoraRef,h,a.shardKey);c={acked:!1,args:s,argsKey:h,callbacks:new Set,errorCallbacks:new Set,fn:e,id:m,lastValue:v?.value,serverCursor:v?.serverCursor,serverVersion:0,shardKey:a.shardKey,...v?.serverEpoch===void 0?{}:{serverEpoch:v.serverEpoch}},this.subscriptions.add(c)}if(c.callbacks.add(d),f&&c.errorCallbacks.add(f),c.lastValue!==void 0)try{d(c.lastValue)}catch{}this.ensureSocket(a.shardKey),this.sendSubscribeIfOpen(c);let p=c;return()=>{if(p.callbacks.delete(d),f&&p.errorCallbacks.delete(f),p.callbacks.size===0){let m=this.getConnection(p.shardKey);!(m&&Kl(m,{id:p.id,type:"unsubscribe"}))&&m&&m.pendingUnsubscribes.push({id:p.id,type:"unsubscribe"}),this.subscriptions.remove(p)}}}subscribeShape(e,o,r={}){if(this.closed)throw new Error("LunoraClient is closed");this.nextShapeId+=1;let a=`shape_${this.nextShapeId.toString()}`,s={args:e.args,callbacks:new Set([o]),errorCallbacks:r.onError?new Set([r.onError]):new Set,id:a,name:e.name,onCheckpoint:r.onCheckpoint,rows:new Map,shardKey:r.shardKey};return this.shapeSubscriptions.set(a,s),this.ensureSocket(r.shardKey),this.sendShapeSubscribeIfOpen(s),()=>{this.shapeSubscriptions.delete(a);let i=this.getConnection(s.shardKey);!(i&&Kl(i,{id:a,type:"shape_unsubscribe"}))&&i&&i.pendingUnsubscribes.push({id:a,type:"shape_unsubscribe"})}}stream(e,o,r={}){if(this.closed)throw new Error("LunoraClient is closed");if(this.WebSocketImpl===void 0)throw new Error("LunoraClient: streams require a WebSocket implementation");this.nextStreamId+=1;let a=`stream_${this.nextStreamId.toString()}`,{shardKey:s}=r,i=o??{},{handle:c,iterable:d}=xae({maxBuffer:r.maxBuffer,onCancel:n(()=>{let h=this.getConnection(s);h&&Kl(h,{id:a,type:"unsubscribe"}),this.streams.delete(a)},"onCancel")});this.streams.set(a,{handle:c,shardKey:s}),this.ensureSocket(s);let f=this.getConnection(s),p={id:a,query:{args:i,functionPath:e.__lunoraRef,shardKey:s},type:"stream"};if(!(f?.wsState==="open"&&Kl(f,p))&&f){for(f.pendingStreams=f.pendingStreams??[];f.pendingStreams.length>=ALe;){let v=f.pendingStreams.shift()?.id,x=v?this.streams.get(v):void 0;x&&(x.handle.fail(Object.assign(new Error("stream-start frame evicted while socket was unreachable"),{code:"STREAM_QUEUE_OVERFLOW"})),this.streams.delete(v))}f.pendingStreams.push(p)}return d}close(){this.closed=!0;for(let e of this.streams.values())e.handle.fail(Object.assign(new Error("LunoraClient closed"),{code:"CLIENT_CLOSED"}));this.streams.clear();for(let e of this.connections.values()){if(e.reconnectTimer!==void 0&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=void 0),e.connectTimer!==void 0&&(clearTimeout(e.connectTimer),e.connectTimer=void 0),this.stopHeartbeat(e),e.socket){try{e.socket.close()}catch{}e.socket=void 0}e.wsState="closed"}this.offlineQueue.clear(),this.queuedIdentities.clear(),this.cacheFlushTimer!==void 0&&(clearTimeout(this.cacheFlushTimer),this.cacheFlushTimer=void 0),this.pendingCacheWrites.size>0&&this.flushQueryCacheWrites().catch(()=>{}),this.authTokenListeners.clear(),this.statusListeners.clear(),this.tokenExpiredListeners.clear(),this.whisperHandlers.clear(),this.shapeSubscriptions.clear(),this.pokeBuffers.clear()}async enqueueOfflineMutation(e,o,r,a,s){let i=this.identityFingerprint();if(this.outbox){this.outboxMutationCounter+=1;let c=this.outboxMutationCounter;try{await this.outbox.enqueue({args:o,clientId:this.clientId,functionPath:e.__lunoraRef,idempotencyKey:`${this.clientId}:${String(c)}`,identity:i,mutationId:c,shardKey:r})}catch(d){throw Fz(s),d instanceof Error?d:new Error(String(d))}return}return new Promise((c,d)=>{let f={args:o,functionPath:e.__lunoraRef,id:a,identity:i,reject:n(p=>{this.queuedIdentities.delete(a),Fz(s),d(p instanceof Error?p:new Error(String(p)))},"reject"),resolve:c,shardKey:r};this.offlineQueue.enqueue(f),f.id!==void 0&&this.queuedIdentities.set(f.id,i)})}async hydratePersistedQueue(){try{let e=await this.offlineQueue.hydrate();for(let o of e)this.ensureSocket(o)}catch{}}async hydrateQueryCache(){if(this.queryCache)try{let e=await this.queryCache.load();for(let{key:o,...r}of e)this.hydratedQueryCache.set(o,r)}catch{}}takeHydratedCache(e,o,r){let a=Sz(e,o,r),s=this.hydratedQueryCache.get(a);if(s!==void 0)return this.hydratedQueryCache.delete(a),s.identity===this.identityFingerprint()?s:void 0}persistQueryValue(e){if(!this.queryCache||e.lastValue===void 0)return;let o=Sz(e.fn.__lunoraRef,e.argsKey,e.shardKey);this.pendingCacheWrites.set(o,{identity:this.identityFingerprint(),serverCursor:e.serverCursor,ts:Date.now(),value:e.lastValue,...e.serverEpoch===void 0?{}:{serverEpoch:e.serverEpoch}}),this.cacheFlushTimer??=setTimeout(()=>{this.flushQueryCacheWrites().catch(()=>{})},ELe)}async flushQueryCacheWrites(){this.cacheFlushTimer=void 0;let{queryCache:e}=this;if(!e){this.pendingCacheWrites.clear();return}let o=[...this.pendingCacheWrites.entries()];this.pendingCacheWrites.clear(),await Promise.allSettled(o.map(([r,a])=>e.put(r,a)))}computeStatus(){let e=[...this.connections.values()];return e.length===0?"idle":e.some(o=>o.wsState==="open")?"connected":e.some(o=>o.wsState==="connecting")?"connecting":"offline"}emitConnectionStatus(){let e=this.computeStatus();if(e!==this.lastStatus){this.lastStatus=e;for(let o of this.statusListeners)try{o(e)}catch{}}}applyOptimisticUpdates(e,o,r,a){let s=[];if(!a)return s;let i=UI.key(e,o,r),c=this.subscriptions.get(i);if(c){let d=S3e(c,a);d&&s.push(d)}return s}applyOptimisticUpdate(e,o,r,a){let{rollbacks:s,store:i}=gae(this.subscriptions,r,wae,VI);try{e(i,o)}catch{for(let c=s.length-1;c>=0;c-=1)s[c]?.();return}a.push(...s)}getConnection(e){return this.connections.get(oi(e))}getOrCreateConnection(e){let o=oi(e),r=this.connections.get(o);return r||(r={connectTimer:void 0,heartbeatTimer:void 0,pendingUnsubscribes:[],reconnect:wz(this.reconnectOptions),reconnectTimer:void 0,shardKey:e,socket:void 0,wasEverConnected:!1,wsState:"idle"},this.connections.set(o,r)),r}wsUrlFor(e){let o=[];if(e!==void 0&&o.push(`shard=${encodeURIComponent(e)}`),this.wsToken!==void 0&&o.push(`token=${encodeURIComponent(this.wsToken)}`),o.length===0)return this.wsUrl;let r=this.wsUrl.includes("?")?"&":"?";return`${this.wsUrl}${r}${o.join("&")}`}rpcRequestHeaders(e){let o={"content-type":"application/json"};if(this.authToken&&(o.authorization=`Bearer ${this.authToken}`),e.mutationId&&(o["x-lunora-mutation-id"]=e.mutationId),e.clientId!==void 0&&(o["x-lunora-client-id"]=e.clientId),e.clientSeq!==void 0&&(o["x-lunora-client-seq"]=e.clientSeq.toString()),e.attachBookmark){let r=this.bookmark.get();r&&(o["x-d1-bookmark"]=r)}return o}async rpc(e,o,r,a={}){if(!this.fetchImpl)throw new Error("LunoraClient: no `fetch` implementation available");let s=this.rpcRequestHeaders(a),i=await this.fetchImpl(tF(this.url,bLe),{body:JSON.stringify({args:o,functionPath:e,shardKey:r}),headers:s,method:"POST"});if(a.captureBookmark){let d=i.headers.get("x-d1-bookmark");d&&this.bookmark.set(d)}let c;try{c=await i.json()}catch{let d=i.statusText?` ${i.statusText}`:"";throw new Error(`LunoraClient: response was not JSON (status ${i.status.toString()}${d})`)}if("error"in c){let d=new Error(c.error.message);throw d.code=c.error.code,d}if(!i.ok){let d=i.statusText?` ${i.statusText}`:"";throw new Error(`LunoraClient: request failed (status ${i.status.toString()}${d})`)}return a.onMutationAck?.(c.lastMutationId),c.result}async adminFetch(e,o,r,a){if(!this.fetchImpl)throw new Error("LunoraClient: no `fetch` implementation available");let s={};this.authToken&&(s.authorization=`Bearer ${this.authToken}`);let i=r instanceof ArrayBuffer||r instanceof Blob,c;r===void 0?c=void 0:i?(c=r,a!==void 0&&(s["content-type"]=a)):(c=JSON.stringify(r),s["content-type"]="application/json");let d=await this.fetchImpl(tF(this.url,e),{body:c,headers:s,method:o}),f;try{f=await d.json()}catch{let p=d.statusText?` ${d.statusText}`:"";throw new Error(`LunoraClient: response was not JSON (status ${d.status.toString()}${p})`)}if(typeof f=="object"&&f!==null&&"error"in f){let p=f.error,m=new Error(p.message??"admin request failed");throw m.code=p.code,m}if(!d.ok){let p=d.statusText?` ${d.statusText}`:"";throw new Error(`LunoraClient: admin request failed (status ${d.status.toString()}${p})`)}return f}effectiveConnectionContext(e){let o=this.connectionContextHolders.get(e);return o&&o.length>0?o[o.length-1]?.context:this.connectionContexts.get(e)??this.defaultConnectionContext}refreshConnectionContext(e){let o=this.connections.get(e);o?.wsState==="open"&&this.sendConnectEnvelope(o)}sendConnectEnvelope(e){let o=this.effectiveConnectionContext(oi(e.shardKey));Kl(e,{clientId:this.clientId,id:"connect",type:"connect",...o===void 0?{}:{context:o}})}resendShapeSubscriptions(e){for(let o of this.shapeSubscriptions.values())oi(o.shardKey)===oi(e)&&this.sendShapeSubscribeIfOpen(o)}ensureSocket(e){if(this.closed||this.WebSocketImpl===void 0)return;let o=this.getOrCreateConnection(e);if(o.wsState==="open"||o.wsState==="connecting")return;o.wsState="connecting",this.emitConnectionStatus();let r=new this.WebSocketImpl(this.wsUrlFor(e));o.socket=r,this.connectTimeoutMs>0&&(o.connectTimer=setTimeout(()=>{if(o.connectTimer=void 0,!(o.socket!==r||o.wsState!=="connecting")){try{r.close()}catch{}this.handleDisconnect(o)}},this.connectTimeoutMs)),r.addEventListener("open",()=>{if(o.socket!==r)return;o.connectTimer!==void 0&&(clearTimeout(o.connectTimer),o.connectTimer=void 0),o.wsState="open",o.wasEverConnected=!0,o.reconnect.reset(),this.emitConnectionStatus(),this.sendConnectEnvelope(o),this.markShardPendingAck(e);for(let s of this.subscriptions.all())oi(s.shardKey)===oi(e)&&this.sendSubscribeIfOpen(s);if(this.resendShapeSubscriptions(e),o.pendingUnsubscribes.length>0){let s=o.pendingUnsubscribes;o.pendingUnsubscribes=[];for(let{id:i,type:c}of s)Kl(o,{id:i,type:c})}if(o.pendingStreams&&o.pendingStreams.length>0){let s=o.pendingStreams;o.pendingStreams=[];for(let i of s)Kl(o,i)}let a=this.whisperHandlers.get(oi(e));if(a)for(let s of a.keys())Kl(o,{topic:s,type:"whisper_subscribe"});this.flushOfflineQueue(e).catch(()=>{}),this.startHeartbeat(o)}),r.addEventListener("message",a=>{this.handleServerMessage(a.data,e)}),r.addEventListener("close",a=>{o.socket===r&&(a?.code===4001&&this.notifyTokenExpired(),this.handleDisconnect(o))}),r.addEventListener("error",()=>{o.socket===r&&(o.wsState==="connecting"||o.wsState==="open")&&this.handleDisconnect(o)})}handleDisconnect(e){if(this.closed||e.wsState==="idle"||e.wsState==="closed"||(this.stopHeartbeat(e),e.connectTimer!==void 0&&(clearTimeout(e.connectTimer),e.connectTimer=void 0),e.socket=void 0,e.wsState="idle",this.emitConnectionStatus(),this.markShardPendingAck(e.shardKey),this.WebSocketImpl===void 0))return;let o=e.reconnect.next();e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=void 0,this.ensureSocket(e.shardKey)},o)}startHeartbeat(e){this.stopHeartbeat(e),!(this.heartbeatIntervalMs<=0)&&(e.heartbeatTimer=setInterval(()=>{if(!(e.wsState!=="open"||!e.socket))try{e.socket.send(CLe)}catch{}},this.heartbeatIntervalMs))}stopHeartbeat(e){e.heartbeatTimer!==void 0&&(clearInterval(e.heartbeatTimer),e.heartbeatTimer=void 0)}markShardPendingAck(e){let o=oi(e);for(let r of this.subscriptions.all())oi(r.shardKey)===o&&(r.acked=!1)}sendSubscribeIfOpen(e){let o=this.getConnection(e.shardKey);if(o?.wsState!=="open"||e.acked)return;let r=e.fn.__lunoraTable??e.fn.__lunoraRef;Kl(o,{id:e.id,query:{args:e.args,functionPath:e.fn.__lunoraRef,table:r,...e.serverCursor===void 0?{}:{sinceSeq:e.serverCursor},...e.serverEpoch===void 0?{}:{sinceEpoch:e.serverEpoch}},type:"subscribe"})}sendShapeSubscribeIfOpen(e){let o=this.getConnection(e.shardKey);o?.wsState==="open"&&Kl(o,{id:e.id,shape:{name:e.name,...e.args===void 0?{}:{args:e.args}},type:"shape_subscribe",...e.serverCursor===void 0?{}:{sinceCheckpoint:e.serverCursor},...e.serverEpoch===void 0?{}:{sinceEpoch:e.serverEpoch}})}handleServerMessage(e,o){let r=F3e(e);if(r===void 0)return;let a;try{a=JSON.parse(r)}catch{return}switch(a.type){case"ack":{let s=this.subscriptions.getById(a.id);s&&(s.acked=!0);return}case"chunk":{let{data:s,id:i}=a;this.streams.get(i)?.handle.push(s);return}case"complete":{this.handleCompleteMessage(a.id);return}case"data":case"delta":{this.handleDataMessage(a);return}case"error":{this.handleErrorMessage(a);break}case"pokeEnd":{this.handlePokeEnd(a);break}case"pokePart":{this.handlePokePart(a);break}case"pokeStart":{this.handlePokeStart(a);break}case"resume":{this.handleResumeMessage(a);break}case"whisper":{this.dispatchWhisper(a,o);break}}}handleErrorMessage(e){if(e.error?.code==="TOKEN_EXPIRED"){this.notifyTokenExpired();return}let{id:r}=e,a=r===void 0?void 0:this.streams.get(r);if(a&&r!==void 0){a.handle.fail(w3e(e)),this.streams.delete(r);return}let s=r===void 0?void 0:this.subscriptions.getById(r);if(s){Sae(s.errorCallbacks,bae(e));return}let i=r===void 0?void 0:this.shapeSubscriptions.get(r);i&&Sae(i.errorCallbacks,bae(e))}handlePokeStart(e){if(this.pokeBuffers.size>=t.MAX_POKE_BUFFERS){let o=this.pokeBuffers.keys().next().value;o!==void 0&&this.pokeBuffers.delete(o)}this.pokeBuffers.set(e.pokeId,{baseCheckpoint:e.baseCheckpoint,epoch:e.epoch,lastMutationId:new Map,parts:new Map})}handlePokePart(e){let o=this.pokeBuffers.get(e.pokeId);if(!o)return;let r=o.parts.get(e.shapeId)??[];r.push(...e.rowsPatch),o.parts.set(e.shapeId,r),e.lastMutationId!==void 0&&o.lastMutationId.set(e.shapeId,e.lastMutationId)}handlePokeEnd(e){let o=this.pokeBuffers.get(e.pokeId);if(o){this.pokeBuffers.delete(e.pokeId);for(let[r,a]of o.parts){let s=this.shapeSubscriptions.get(r);if(!s)continue;let i=o.epoch!==void 0&&s.serverEpoch!==void 0&&o.epoch!==s.serverEpoch,c=o.baseCheckpoint!==void 0&&s.serverCursor!==void 0&&s.serverCursor!==o.baseCheckpoint;if(i||c){s.rows.clear(),s.serverCursor=void 0,s.serverEpoch=void 0,this.emitShapeRows(s),this.sendShapeSubscribeIfOpen(s);continue}wLe(s.rows,a),e.checkpoint!==void 0&&(s.serverCursor=e.checkpoint),e.epoch!==void 0&&(s.serverEpoch=e.epoch);let d=o.lastMutationId.get(r);d!==void 0&&(s.lastMutationId=d),this.emitShapeRows(s),s.onCheckpoint?.({checkpoint:s.serverCursor,mutationId:s.lastMutationId})}}}emitShapeRows(e){let o=[...e.rows.values()];for(let r of e.callbacks)try{r(o)}catch{}}handleDataMessage(e){let{id:o}=e,r=o?this.subscriptions.getById(o):void 0;if(!r)return;let a=this.resolveDataPayload(e,r);r.lastValue=a,r.serverVersion+=1,e.cursor!==void 0&&(r.serverCursor=e.cursor),e.epoch!==void 0&&(r.serverEpoch=e.epoch),this.persistQueryValue(r);for(let s of r.callbacks)try{s(a)}catch{}}handleResumeMessage(e){let o=this.subscriptions.getById(e.id);o&&(o.acked=!0,(e.cursor!==void 0&&e.cursor!==o.serverCursor||e.epoch!==void 0&&e.epoch!==o.serverEpoch)&&(e.cursor!==void 0&&(o.serverCursor=e.cursor),e.epoch!==void 0&&(o.serverEpoch=e.epoch),this.persistQueryValue(o)))}resolveDataPayload(e,o){if("data"in e&&e.data!==void 0)return e.data;let{delta:r}=e;if(mae(r)&&o.lastValue!==void 0){let a=hae(o.lastValue,r);if(a!==void 0)return a}return r}dispatchWhisper(e,o){let r=this.whisperHandlers.get(oi(o))?.get(e.topic);if(r)for(let a of r)try{a(e.data,e.from)}catch{}}notifyTokenExpired(){for(let e of this.tokenExpiredListeners)try{e()}catch{}}handleCompleteMessage(e){let o=this.streams.get(e);if(o){o.handle.complete(),this.streams.delete(e);return}let r=this.subscriptions.getById(e);r&&this.subscriptions.remove(r)}unpersist(e){e&&this.persistence?.remove(e).catch(o=>{Zk(this.onPersistenceError,"remove",o,e)})}identityFingerprint(){let e=this.authToken;if(e===null)return null;let o=2166136261;for(let r=0;r<e.length;r+=1)o^=e.charCodeAt(r),o=Math.imul(o,16777619);return`${e.length.toString(36)}:${(o>>>0).toString(36)}`}rejectQueuedForIdentityChange(){let e=this.offlineQueue.drain();for(let o of e){this.queuedIdentities.delete(o.id??""),this.unpersist(o.id);let r=new Error("offline mutation discarded: auth identity changed before replay");r.code="OFFLINE_IDENTITY_CHANGED",o.reject(r)}this.clearQueryCacheForIdentityChange()}clearQueryCacheForIdentityChange(){this.cacheFlushTimer!==void 0&&(clearTimeout(this.cacheFlushTimer),this.cacheFlushTimer=void 0),this.pendingCacheWrites.clear(),this.hydratedQueryCache.clear(),this.queryCache?.clear().catch(()=>{})}async flushOfflineQueue(e){let o=oi(e),r=this.offlineQueue.drain(a=>oi(a.shardKey)===o);for(let a=0;a<r.length;a+=1){let s=r[a];if(!s)continue;let i=this.identityFingerprint(),c=s.id===void 0?void 0:this.queuedIdentities.get(s.id),d=c===void 0?s.identity:c;if(d!==void 0&&d!==i){this.queuedIdentities.delete(s.id??""),this.unpersist(s.id);let f=new Error("offline mutation skipped: auth identity changed before replay");f.code="OFFLINE_IDENTITY_CHANGED",s.reject(f);continue}this.queuedIdentities.delete(s.id??"");try{let f=await this.rpc(s.functionPath,s.args,s.shardKey,{captureBookmark:!0,mutationId:s.id});this.unpersist(s.id),s.resolve(f)}catch(f){if(f.code!==void 0){this.unpersist(s.id),s.reject(f);continue}this.offlineQueue.requeue(r.slice(a));return}}}};var ase=K(Ro(),1);var qd=class{static{n(this,"Subscribable")}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(){}};var R3e=class extends qd{static{n(this,"FocusManager")}#t;#e;#o;constructor(){super(),this.#o=t=>{if(typeof window<"u"&&window.addEventListener){let e=n(()=>t(),"listener");return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#o)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#o=t,this.#e?.(),this.#e=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},HI=new R3e;var E3e={setTimeout:n((t,e)=>setTimeout(t,e),"setTimeout"),clearTimeout:n(t=>clearTimeout(t),"clearTimeout"),setInterval:n((t,e)=>setInterval(t,e),"setInterval"),clearInterval:n(t=>clearInterval(t),"clearInterval")},A3e=class{static{n(this,"TimeoutManager")}#t=E3e;#e=!1;setTimeoutProvider(t){this.#e&&t!==this.#t&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#t,provider:t}),this.#t=t,this.#e=!1}setTimeout(t,e){return this.#e=!0,this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return this.#e=!0,this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}},Wd=new A3e;function Cae(t){setTimeout(t,0)}n(Cae,"systemSetTimeoutZero");var Ez=typeof window>"u"||"Deno"in globalThis;function Ua(){}n(Ua,"noop");function Eae(t,e){return typeof t=="function"?t(e):t}n(Eae,"functionalUpdate");function rF(t){return typeof t=="number"&&t>=0&&t!==1/0}n(rF,"isValidTimeout");function rM(t,e){return Math.max(t+(e||0)-Date.now(),0)}n(rM,"timeUntilStale");function Vu(t,e){return typeof t=="function"?t(e):t}n(Vu,"resolveStaleTime");function Li(t,e){return typeof t=="function"?t(e):t}n(Li,"resolveQueryBoolean");function nM(t,e){let{type:o="all",exact:r,fetchStatus:a,predicate:s,queryKey:i,stale:c}=t;if(i){if(r){if(e.queryHash!==nF(i,e.options))return!1}else if(!yv(e.queryKey,i))return!1}if(o!=="all"){let d=e.isActive();if(o==="active"&&!d||o==="inactive"&&d)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||a&&a!==e.state.fetchStatus||s&&!s(e))}n(nM,"matchQuery");function aM(t,e){let{exact:o,status:r,predicate:a,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(o){if(vv(e.options.mutationKey)!==vv(s))return!1}else if(!yv(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||a&&!a(e))}n(aM,"matchMutation");function nF(t,e){return(e?.queryKeyHashFn||vv)(t)}n(nF,"hashQueryKeyByOptions");function vv(t){return JSON.stringify(t,(e,o)=>Rz(o)?Object.keys(o).sort().reduce((r,a)=>(r[a]=o[a],r),{}):o)}n(vv,"hashKey");function yv(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(o=>yv(t[o],e[o])):!1}n(yv,"partialMatchKey");var T3e=Object.prototype.hasOwnProperty;function oM(t,e,o=0){if(t===e)return t;if(o>500)return e;let r=Fae(t)&&Fae(e);if(!r&&!(Rz(t)&&Rz(e)))return e;let s=(r?t:Object.keys(t)).length,i=r?e:Object.keys(e),c=i.length,d=r?new Array(c):{},f=0;for(let p=0;p<c;p++){let m=r?p:i[p],h=t[m],v=e[m];if(h===v){d[m]=h,(r?p<s:T3e.call(t,m))&&f++;continue}if(h===null||v===null||typeof h!="object"||typeof v!="object"){d[m]=v;continue}let x=oM(h,v,o+1);d[m]=x,x===h&&f++}return s===c&&f===s?t:d}n(oM,"replaceEqualDeep");function sM(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let o in t)if(t[o]!==e[o])return!1;return!0}n(sM,"shallowEqualObjects");function Fae(t){return Array.isArray(t)&&t.length===Object.keys(t).length}n(Fae,"isPlainArray");function Rz(t){if(!Rae(t))return!1;let e=t.constructor;if(e===void 0)return!0;let o=e.prototype;return!(!Rae(o)||!o.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}n(Rz,"isPlainObject");function Rae(t){return Object.prototype.toString.call(t)==="[object Object]"}n(Rae,"hasObjectPrototype");function Aae(t){return new Promise(e=>{Wd.setTimeout(e,t)})}n(Aae,"sleep");function aF(t,e,o){if(typeof o.structuralSharing=="function")return o.structuralSharing(t,e);if(o.structuralSharing!==!1){try{return oM(t,e)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${o.queryHash}]: ${r}`),r}return oM(t,e)}return e}n(aF,"replaceData");function Az(t){return t}n(Az,"keepPreviousData");function Tae(t,e,o=0){let r=[...t,e];return o&&r.length>o?r.slice(1):r}n(Tae,"addToEnd");function kae(t,e,o=0){let r=[e,...t];return o&&r.length>o?r.slice(0,-1):r}n(kae,"addToStart");var xv=Symbol();function iM(t,e){return t.queryFn===xv&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`),!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===xv?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}n(iM,"ensureQueryFn");function lM(t,e){return typeof t=="function"?t(...e):!!t}n(lM,"shouldThrowError");function Mae(t,e,o){let r=!1,a;return Object.defineProperty(t,"signal",{enumerable:!0,get:n(()=>(a??=e(),r||(r=!0,a.aborted?o():a.addEventListener("abort",o,{once:!0})),a),"get")}),t}n(Mae,"addConsumeAwareSignal");var Gd=(()=>{let t=n(()=>Ez,"isServerFn");return{isServer(){return t()},setIsServer(e){t=e}}})();function sF(){let t,e,o=new Promise((a,s)=>{t=a,e=s});o.status="pending",o.catch(()=>{});function r(a){Object.assign(o,a),delete o.resolve,delete o.reject}return n(r,"finalize"),o.resolve=a=>{r({status:"fulfilled",value:a}),t(a)},o.reject=a=>{r({status:"rejected",reason:a}),e(a)},o}n(sF,"pendingThenable");var Pae=Cae;function k3e(){let t=[],e=0,o=n(c=>{c()},"notifyFn"),r=n(c=>{c()},"batchNotifyFn"),a=Pae,s=n(c=>{e?t.push(c):a(()=>{o(c)})},"schedule"),i=n(()=>{let c=t;t=[],c.length&&a(()=>{r(()=>{c.forEach(d=>{o(d)})})})},"flush");return{batch:n(c=>{let d;e++;try{d=c()}finally{e--,e||i()}return d},"batch"),batchCalls:n(c=>(...d)=>{s(()=>{c(...d)})},"batchCalls"),schedule:s,setNotifyFunction:n(c=>{o=c},"setNotifyFunction"),setBatchNotifyFunction:n(c=>{r=c},"setBatchNotifyFunction"),setScheduler:n(c=>{a=c},"setScheduler")}}n(k3e,"createNotifyManager");var _n=k3e();var M3e=class extends qd{static{n(this,"OnlineManager")}#t=!0;#e;#o;constructor(){super(),this.#o=t=>{if(typeof window<"u"&&window.addEventListener){let e=n(()=>t(!0),"onlineListener"),o=n(()=>t(!1),"offlineListener");return window.addEventListener("online",e,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",o)}}}}onSubscribe(){this.#e||this.setEventListener(this.#o)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#o=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(o=>{o(t)}))}isOnline(){return this.#t}},$I=new M3e;function P3e(t){return Math.min(1e3*2**t,3e4)}n(P3e,"defaultRetryDelay");function Tz(t){return(t??"online")==="online"?$I.isOnline():!0}n(Tz,"canFetch");var cM=class extends Error{static{n(this,"CancelledError")}constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function uM(t){let e=!1,o=0,r,a=sF(),s=n(()=>a.status!=="pending","isResolved"),i=n(y=>{if(!s()){let b=new cM(y);h(b),t.onCancel?.(b)}},"cancel"),c=n(()=>{e=!0},"cancelRetry"),d=n(()=>{e=!1},"continueRetry"),f=n(()=>HI.isFocused()&&(t.networkMode==="always"||$I.isOnline())&&t.canRun(),"canContinue"),p=n(()=>Tz(t.networkMode)&&t.canRun(),"canStart"),m=n(y=>{s()||(r?.(),a.resolve(y))},"resolve"),h=n(y=>{s()||(r?.(),a.reject(y))},"reject"),v=n(()=>new Promise(y=>{r=n(b=>{(s()||f())&&y(b)},"continueFn"),t.onPause?.()}).then(()=>{r=void 0,s()||t.onContinue?.()}),"pause"),x=n(()=>{if(s())return;let y,b=o===0?t.initialPromise:void 0;try{y=b??t.fn()}catch(S){y=Promise.reject(S)}Promise.resolve(y).then(m).catch(S=>{if(s())return;let w=t.retry??(Gd.isServer()?0:3),C=t.retryDelay??P3e,F=typeof C=="function"?C(o,S):C,T=w===!0||typeof w=="number"&&o<w||typeof w=="function"&&w(o,S);if(e||!T){h(S);return}o++,t.onFail?.(o,S),Aae(F).then(()=>f()?void 0:v()).then(()=>{e?h(S):x()})})},"run");return{promise:a,status:n(()=>a.status,"status"),cancel:i,continue:n(()=>(r?.(),a),"continue"),cancelRetry:c,continueRetry:d,canStart:p,start:n(()=>(p()?x():v().then(x),a),"start")}}n(uM,"createRetryer");var dM=class{static{n(this,"Removable")}#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rF(this.gcTime)&&(this.#t=Wd.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Gd.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#t!==void 0&&(Wd.clearTimeout(this.#t),this.#t=void 0)}};function Nae(t){return{onFetch:n((e,o)=>{let r=e.options,a=e.fetchOptions?.meta?.fetchMore?.direction,s=e.state.data?.pages||[],i=e.state.data?.pageParams||[],c={pages:[],pageParams:[]},d=0,f=n(async()=>{let p=!1,m=n(x=>{Mae(x,()=>e.signal,()=>p=!0)},"addSignalProperty"),h=iM(e.options,e.fetchOptions),v=n(async(x,y,b)=>{if(p)return Promise.reject(e.signal.reason);if(y==null&&x.pages.length)return Promise.resolve(x);let w=n(()=>{let E={client:e.client,queryKey:e.queryKey,pageParam:y,direction:b?"backward":"forward",meta:e.options.meta};return m(E),E},"createQueryFnContext")(),C=await h(w),{maxPages:F}=e.options,T=b?kae:Tae;return{pages:T(x.pages,C,F),pageParams:T(x.pageParams,y,F)}},"fetchPage");if(a&&s.length){let x=a==="backward",y=x?O3e:Oae,b={pages:s,pageParams:i},S=y(r,b);c=await v(b,S,x)}else{let x=t??s.length;do{let y=d===0?i[0]??r.initialPageParam:Oae(r,c);if(d>0&&y==null)break;c=await v(c,y),d++}while(d<x)}return c},"fetchFn");e.options.persister?e.fetchFn=()=>e.options.persister?.(f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},o):e.fetchFn=f},"onFetch")}}n(Nae,"infiniteQueryBehavior");function Oae(t,{pages:e,pageParams:o}){let r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,o[r],o):void 0}n(Oae,"getNextPageParam");function O3e(t,{pages:e,pageParams:o}){return e.length>0?t.getPreviousPageParam?.(e[0],e,o[0],o):void 0}n(O3e,"getPreviousPageParam");var Lae=class extends dM{static{n(this,"Query")}#t;#e;#o;#r;#a;#n;#i;#s;constructor(t){super(),this.#s=!1,this.#i=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#a=t.client,this.#r=this.#a.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=_ae(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#t}get promise(){return this.#n?.promise}setOptions(t){if(this.options={...this.#i,...t},t?._type&&(this.#t=t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=_ae(this.options);e.data!==void 0&&(this.setState(Dae(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(t,e){let o=aF(this.state.data,t,this.options);return this.#l({data:o,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),o}setState(t){this.#l({type:"setState",state:t})}cancel(t){let e=this.#n?.promise;return this.#n?.cancel(t),e?e.then(Ua).catch(Ua):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Li(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xv||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Vu(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:!rM(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#r.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.#n&&(this.#s||this.#u()?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#u(){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.#n?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(t&&this.setOptions(t),!this.options.queryFn){let d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']");let o=new AbortController,r=n(d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:n(()=>(this.#s=!0,o.signal),"get")})},"addSignalProperty"),a=n(()=>{let d=iM(this.options,e),p=n(()=>{let m={client:this.#a,queryKey:this.queryKey,meta:this.meta};return r(m),m},"createQueryFnContext")();return this.#s=!1,this.options.persister?this.options.persister(d,p,this):d(p)},"fetchFn"),i=n(()=>{let d={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:a};return r(d),d},"createFetchContext")();(this.#t==="infinite"?Nae(this.options.pages):this.options.behavior)?.onFetch(i,this),this.#o=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#l({type:"fetch",meta:i.fetchOptions?.meta}),this.#n=uM({initialPromise:e?.initialPromise,fn:i.fetchFn,onCancel:n(d=>{d instanceof cM&&d.revert&&this.setState({...this.#o,fetchStatus:"idle"}),o.abort()},"onCancel"),onFail:n((d,f)=>{this.#l({type:"failed",failureCount:d,error:f})},"onFail"),onPause:n(()=>{this.#l({type:"pause"})},"onPause"),onContinue:n(()=>{this.#l({type:"continue"})},"onContinue"),retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:n(()=>!0,"canRun")});try{let d=await this.#n.start();if(d===void 0)throw console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(d),this.#r.config.onSuccess?.(d,this),this.#r.config.onSettled?.(d,this.state.error,this),d}catch(d){if(d instanceof cM){if(d.silent)return this.#n.promise;if(d.revert){if(this.state.data===void 0)throw d;return this.state.data}}throw this.#l({type:"error",error:d}),this.#r.config.onError?.(d,this),this.#r.config.onSettled?.(this.state.data,d,this),d}finally{this.scheduleGc()}}#l(t){let e=n(o=>{switch(t.type){case"failed":return{...o,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...kz(o.data,this.options),fetchMeta:t.meta??null};case"success":let r={...o,...Dae(t.data,t.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#o=t.manual?r:void 0,r;case"error":let a=t.error;return{...o,error:a,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...t.state}}},"reducer");this.state=e(this.state),_n.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:t})})}};function kz(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Tz(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}n(kz,"fetchState");function Dae(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}n(Dae,"successState");function _ae(t){let e=typeof t.initialData=="function"?t.initialData():t.initialData,o=e!==void 0,r=o?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:o?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}n(_ae,"getDefaultState");var Pz=class extends qd{static{n(this,"QueryObserver")}constructor(t,e){super(),this.options=e,this.#t=t,this.#s=null,this.#i=sF(),this.bindMethods(),this.setOptions(e)}#t;#e=void 0;#o=void 0;#r=void 0;#a;#n;#i;#s;#u;#l;#m;#d;#f;#c;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Bae(this.#e,this.options)?this.#p():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Mz(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Mz(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#I(),this.#b(),this.#e.removeObserver(this)}setOptions(t){let e=this.options,o=this.#e;if(this.options=this.#t.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Li(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#e.setOptions(this.options),e._defaulted&&!sM(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});let r=this.hasListeners();r&&Vae(this.#e,o,this.options,e)&&this.#p(),this.updateResult(),r&&(this.#e!==o||Li(this.options.enabled,this.#e)!==Li(e.enabled,this.#e)||Vu(this.options.staleTime,this.#e)!==Vu(e.staleTime,this.#e))&&this.#g();let a=this.#v();r&&(this.#e!==o||Li(this.options.enabled,this.#e)!==Li(e.enabled,this.#e)||a!==this.#c)&&this.#x(a)}getOptimisticResult(t){let e=this.#t.getQueryCache().build(this.#t,t),o=this.createResult(e,t);return D3e(this,o)&&(this.#r=o,this.#n=this.options,this.#a=this.#e.state),o}getCurrentResult(){return this.#r}trackResult(t,e){return new Proxy(t,{get:n((o,r)=>(this.trackProp(r),e?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,r)),"get")})}trackProp(t){this.#h.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){let e=this.#t.defaultQueryOptions(t),o=this.#t.getQueryCache().build(this.#t,e);return o.fetch().then(()=>this.createResult(o,e))}fetch(t){return this.#p({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#p(t){this.#S();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Ua)),e}#g(){this.#I();let t=Vu(this.options.staleTime,this.#e);if(Gd.isServer()||this.#r.isStale||!rF(t))return;let o=rM(this.#r.dataUpdatedAt,t)+1;this.#d=Wd.setTimeout(()=>{this.#r.isStale||this.updateResult()},o)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#x(t){this.#b(),this.#c=t,!(Gd.isServer()||Li(this.options.enabled,this.#e)===!1||!rF(this.#c)||this.#c===0)&&(this.#f=Wd.setInterval(()=>{(this.options.refetchIntervalInBackground||HI.isFocused())&&this.#p()},this.#c))}#y(){this.#g(),this.#x(this.#v())}#I(){this.#d!==void 0&&(Wd.clearTimeout(this.#d),this.#d=void 0)}#b(){this.#f!==void 0&&(Wd.clearInterval(this.#f),this.#f=void 0)}createResult(t,e){let o=this.#e,r=this.options,a=this.#r,s=this.#a,i=this.#n,d=t!==o?t.state:this.#o,{state:f}=t,p={...f},m=!1,h;if(e._optimisticResults){let P=this.hasListeners(),_=!P&&Bae(t,e),M=P&&Vae(t,o,e,r);(_||M)&&(p={...p,...kz(f.data,t.options)}),e._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:x,status:y}=p;h=p.data;let b=!1;if(e.placeholderData!==void 0&&h===void 0&&y==="pending"){let P;a?.isPlaceholderData&&e.placeholderData===i?.placeholderData?(P=a.data,b=!0):P=typeof e.placeholderData=="function"?e.placeholderData(this.#m?.state.data,this.#m):e.placeholderData,P!==void 0&&(y="success",h=aF(a?.data,P,e),m=!0)}if(e.select&&h!==void 0&&!b)if(a&&h===s?.data&&e.select===this.#u)h=this.#l;else try{this.#u=e.select,h=e.select(h),h=aF(a?.data,h,e),this.#l=h,this.#s=null}catch(P){this.#s=P}this.#s&&(v=this.#s,h=this.#l,x=Date.now(),y="error");let S=p.fetchStatus==="fetching",w=y==="pending",C=y==="error",F=w&&S,T=h!==void 0,k={status:y,fetchStatus:p.fetchStatus,isPending:w,isSuccess:y==="success",isError:C,isInitialLoading:F,isLoading:F,data:h,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:x,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:S,isRefetching:S&&!w,isLoadingError:C&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:C&&T,isStale:Oz(t,e),refetch:this.refetch,promise:this.#i,isEnabled:Li(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){let P=k.data!==void 0,_=k.status==="error"&&!P,M=n(W=>{_?W.reject(k.error):P&&W.resolve(k.data)},"finalizeThenableIfPossible"),L=n(()=>{let W=this.#i=k.promise=sF();M(W)},"recreateThenable"),U=this.#i;switch(U.status){case"pending":t.queryHash===o.queryHash&&M(U);break;case"fulfilled":(_||k.data!==U.value)&&L();break;case"rejected":(!_||k.error!==U.reason)&&L();break}}return k}updateResult(){let t=this.#r,e=this.createResult(this.#e,this.options);if(this.#a=this.#e.state,this.#n=this.options,this.#a.data!==void 0&&(this.#m=this.#e),sM(e,t))return;this.#r=e;let o=n(()=>{if(!t)return!0;let{notifyOnChangeProps:r}=this.options,a=typeof r=="function"?r():r;if(a==="all"||!a&&!this.#h.size)return!0;let s=new Set(a??this.#h);return this.options.throwOnError&&s.add("error"),Object.keys(this.#r).some(i=>{let c=i;return this.#r[c]!==t[c]&&s.has(c)})},"shouldNotifyListeners");this.#w({listeners:o()})}#S(){let t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;let e=this.#e;this.#e=t,this.#o=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#w(t){_n.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function N3e(t,e){return Li(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Li(e.retryOnMount,t)===!1)}n(N3e,"shouldLoadOnMount");function Bae(t,e){return N3e(t,e)||t.state.data!==void 0&&Mz(t,e,e.refetchOnMount)}n(Bae,"shouldFetchOnMount");function Mz(t,e,o){if(Li(e.enabled,t)!==!1&&Vu(e.staleTime,t)!=="static"){let r=typeof o=="function"?o(t):o;return r==="always"||r!==!1&&Oz(t,e)}return!1}n(Mz,"shouldFetchOn");function Vae(t,e,o,r){return(t!==e||Li(r.enabled,t)===!1)&&(!o.suspense||t.state.status!=="error")&&Oz(t,o)}n(Vae,"shouldFetchOptionally");function Oz(t,e){return Li(e.enabled,t)!==!1&&t.isStaleByTime(Vu(e.staleTime,t))}n(Oz,"isStale");function D3e(t,e){return!sM(t.getCurrentResult(),e)}n(D3e,"shouldAssignObserverCurrentProperties");var Uae=class extends dM{static{n(this,"Mutation")}#t;#e;#o;#r;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#o=t.mutationCache,this.#e=[],this.state=t.state||_3e(),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.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#o.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#o.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){let e=n(()=>{this.#a({type:"continue"})},"onContinue"),o={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=uM({fn:n(()=>this.options.mutationFn?this.options.mutationFn(t,o):Promise.reject(new Error("No mutationFn found")),"fn"),onFail:n((s,i)=>{this.#a({type:"failed",failureCount:s,error:i})},"onFail"),onPause:n(()=>{this.#a({type:"pause"})},"onPause"),onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:n(()=>this.#o.canRun(this),"canRun")});let r=this.state.status==="pending",a=!this.#r.canStart();try{if(r)e();else{this.#a({type:"pending",variables:t,isPaused:a}),this.#o.config.onMutate&&await this.#o.config.onMutate(t,this,o);let i=await this.options.onMutate?.(t,o);i!==this.state.context&&this.#a({type:"pending",context:i,variables:t,isPaused:a})}let s=await this.#r.start();return await this.#o.config.onSuccess?.(s,t,this.state.context,this,o),await this.options.onSuccess?.(s,t,this.state.context,o),await this.#o.config.onSettled?.(s,null,this.state.variables,this.state.context,this,o),await this.options.onSettled?.(s,null,t,this.state.context,o),this.#a({type:"success",data:s}),s}catch(s){try{await this.#o.config.onError?.(s,t,this.state.context,this,o)}catch(i){Promise.reject(i)}try{await this.options.onError?.(s,t,this.state.context,o)}catch(i){Promise.reject(i)}try{await this.#o.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,o)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,s,t,this.state.context,o)}catch(i){Promise.reject(i)}throw this.#a({type:"error",error:s}),s}finally{this.#o.runNext(this)}}#a(t){let e=n(o=>{switch(t.type){case"failed":return{...o,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,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{...o,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:t.error,failureCount:o.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}},"reducer");this.state=e(this.state),_n.batch(()=>{this.#e.forEach(o=>{o.onMutationUpdate(t)}),this.#o.notify({mutation:this,type:"updated",action:t})})}};function _3e(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}n(_3e,"getDefaultState");var zae=class extends qd{static{n(this,"MutationCache")}constructor(t={}){super(),this.config=t,this.#t=new Set,this.#e=new Map,this.#o=0}#t;#e;#o;build(t,e,o){let r=new Uae({client:t,mutationCache:this,mutationId:++this.#o,options:t.defaultMutationOptions(e),state:o});return this.add(r),r}add(t){this.#t.add(t);let e=fM(t);if(typeof e=="string"){let o=this.#e.get(e);o?o.push(t):this.#e.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#t.delete(t)){let e=fM(t);if(typeof e=="string"){let o=this.#e.get(e);if(o)if(o.length>1){let r=o.indexOf(t);r!==-1&&o.splice(r,1)}else o[0]===t&&this.#e.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){let e=fM(t);if(typeof e=="string"){let r=this.#e.get(e)?.find(a=>a.state.status==="pending");return!r||r===t}else return!0}runNext(t){let e=fM(t);return typeof e=="string"?this.#e.get(e)?.find(r=>r!==t&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){_n.batch(()=>{this.#t.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(t){let e={exact:!0,...t};return this.getAll().find(o=>aM(e,o))}findAll(t={}){return this.getAll().filter(e=>aM(t,e))}notify(t){_n.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(e=>e.state.isPaused);return _n.batch(()=>Promise.all(t.map(e=>e.continue().catch(Ua))))}};function fM(t){return t.options.scope?.id}n(fM,"scopeFor");var Hae=class extends qd{static{n(this,"QueryCache")}constructor(t={}){super(),this.config=t,this.#t=new Map}#t;build(t,e,o){let r=e.queryKey,a=e.queryHash??nF(r,e),s=this.get(a);return s||(s=new Lae({client:t,queryKey:r,queryHash:a,options:t.defaultQueryOptions(e),state:o,defaultOptions:t.getQueryDefaults(r)}),this.add(s)),s}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=this.#t.get(t.queryHash);e&&(t.destroy(),e===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){_n.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){let e={exact:!0,...t};return this.getAll().find(o=>nM(e,o))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(o=>nM(t,o)):e}notify(t){_n.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){_n.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){_n.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}};var Nz=class{static{n(this,"QueryClient")}#t;#e;#o;#r;#a;#n;#i;#s;constructor(t={}){this.#t=t.queryCache||new Hae,this.#e=t.mutationCache||new zae,this.#o=t.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#n=0}mount(){this.#n++,this.#n===1&&(this.#i=HI.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=$I.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#n--,this.#n===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=void 0)}isFetching(t){return this.#t.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#e.findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),o=this.#t.build(this,e),r=o.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&o.isStaleByTime(Vu(e.staleTime,o))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#t.findAll(t).map(({queryKey:e,state:o})=>{let r=o.data;return[e,r]})}setQueryData(t,e,o){let r=this.defaultQueryOptions({queryKey:t}),s=this.#t.get(r.queryHash)?.state.data,i=Eae(e,s);if(i!==void 0)return this.#t.build(this,r).setData(i,{...o,manual:!0})}setQueriesData(t,e,o){return _n.batch(()=>this.#t.findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,o)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state}removeQueries(t){let e=this.#t;_n.batch(()=>{e.findAll(t).forEach(o=>{e.remove(o)})})}resetQueries(t,e){let o=this.#t;return _n.batch(()=>(o.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let o={revert:!0,...e},r=_n.batch(()=>this.#t.findAll(t).map(a=>a.cancel(o)));return Promise.all(r).then(Ua).catch(Ua)}invalidateQueries(t,e={}){return _n.batch(()=>(this.#t.findAll(t).forEach(o=>{o.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){let o={...e,cancelRefetch:e.cancelRefetch??!0},r=_n.batch(()=>this.#t.findAll(t).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let s=a.fetch(void 0,o);return o.throwOnError||(s=s.catch(Ua)),a.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ua)}fetchQuery(t){let e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);let o=this.#t.build(this,e);return o.isStaleByTime(Vu(e.staleTime,o))?o.fetch(e):Promise.resolve(o.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ua).catch(Ua)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ua).catch(Ua)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return $I.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#o}setDefaultOptions(t){this.#o=t}setQueryDefaults(t,e){this.#r.set(vv(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#r.values()],o={};return e.forEach(r=>{yv(t,r.queryKey)&&Object.assign(o,r.defaultOptions)}),o}setMutationDefaults(t,e){this.#a.set(vv(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#a.values()],o={};return e.forEach(r=>{yv(t,r.mutationKey)&&Object.assign(o,r.defaultOptions)}),o}defaultQueryOptions(t){if(t._defaulted)return t;let e={...this.#o.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=nF(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===xv&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#o.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}};var jI=K(oe(),1),qae=K(zt(),1);var iF=jI.createContext(void 0),qI=n(t=>{let e=jI.useContext(iF);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},"useQueryClient"),Dz=n(({client:t,children:e})=>(jI.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,qae.jsx)(iF.Provider,{value:t,children:e})),"QueryClientProvider");var mM=K(oe(),1);var Wae=mM.createContext(!1),Gae=n(()=>mM.useContext(Wae),"useIsRestoring"),TCt=Wae.Provider;var lF=K(oe(),1),L3e=K(zt(),1);function B3e(){let t=!1;return{clearReset:n(()=>{t=!1},"clearReset"),reset:n(()=>{t=!0},"reset"),isReset:n(()=>t,"isReset")}}n(B3e,"createValue");var V3e=lF.createContext(B3e()),Kae=n(()=>lF.useContext(V3e),"useQueryErrorResetBoundary");var Yae=K(oe(),1);var Xae=n((t,e,o)=>{let r=o?.state.error&&typeof t.throwOnError=="function"?lM(t.throwOnError,[o.state.error,o]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},"ensurePreventErrorBoundaryRetry"),Qae=n(t=>{Yae.useEffect(()=>{t.clearReset()},[t])},"useClearResetErrorBoundary"),Zae=n(({result:t,errorResetBoundary:e,throwOnError:o,query:r,suspense:a})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(a&&t.data===void 0||lM(o,[t.error,r])),"getHasError");var Jae=n(t=>{if(t.suspense){let o=n(a=>a==="static"?a:Math.max(a??1e3,1e3),"clamp"),r=t.staleTime;t.staleTime=typeof r=="function"?(...a)=>o(r(...a)):o(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},"ensureSuspenseTimers"),ese=n((t,e)=>t.isLoading&&t.isFetching&&!e,"willFetch"),tse=n((t,e)=>t?.suspense&&e.isPending,"shouldSuspend"),_z=n((t,e,o)=>e.fetchOptimistic(t).catch(()=>{o.clearReset()}),"fetchOptimistic");var Fh=K(oe(),1);function ose(t,e,o){if(typeof t!="object"||Array.isArray(t))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');let r=Gae(),a=Kae(),s=qI(o),i=s.defaultQueryOptions(t);s.getDefaultOptions().queries?._experimental_beforeQuery?.(i);let c=s.getQueryCache().get(i.queryHash);i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`);let d=t.subscribed!==!1;i._optimisticResults=r?"isRestoring":d?"optimistic":void 0,Jae(i),Xae(i,a,c),Qae(a);let f=!s.getQueryCache().get(i.queryHash),[p]=Fh.useState(()=>new e(s,i)),m=p.getOptimisticResult(i),h=!r&&d;if(Fh.useSyncExternalStore(Fh.useCallback(v=>{let x=h?p.subscribe(_n.batchCalls(v)):Ua;return p.updateResult(),x},[p,h]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),Fh.useEffect(()=>{p.setOptions(i)},[i,p]),tse(i,m))throw _z(i,p,a);if(Zae({result:m,errorResetBoundary:a,throwOnError:i.throwOnError,query:c,suspense:i.suspense}))throw m.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(i,m),i.experimental_prefetchInRender&&!Gd.isServer()&&ese(m,r)&&(f?_z(i,p,a):c?.promise)?.catch(Ua).finally(()=>{p.updateResult()}),i.notifyOnChangeProps?m:p.trackResult(m)}n(ose,"useBaseQuery");function Lz(t,e){return ose(t,Pz,e)}n(Lz,"useQuery");var Iv=K(oe(),1),Vz=K(po(),1);var sse=(0,Iv.createContext)(null),U3e=n(()=>new Nz({defaultOptions:{mutations:{retry:0},queries:{gcTime:5*6e4,retry:0,staleTime:Number.POSITIVE_INFINITY}}}),"createDefaultQueryClient"),Uz=n(t=>{let e=(0,ase.c)(9),{children:o,client:r,queryClient:a}=t,s=(0,Iv.use)(iF),i;e[0]!==s||e[1]!==a?(i=n(()=>a??s??U3e(),"t1"),e[0]=s,e[1]=a,e[2]=i):i=e[2];let[c]=(0,Iv.useState)(i),d=a??s??c;if(!d)throw new Error("LunoraProvider: failed to resolve a QueryClient");let f;e[3]!==o||e[4]!==r?(f=(0,Vz.jsxDEV)(sse,{value:r,children:o},void 0,!1),e[3]=o,e[4]=r,e[5]=f):f=e[5];let p=f;if(s===d)return p;let m;return e[6]!==p||e[7]!==d?(m=(0,Vz.jsxDEV)(Dz,{client:d,children:p},void 0,!1),e[6]=p,e[7]=d,e[8]=m):m=e[8],m},"LunoraProvider"),Wt=n(()=>{let t=(0,Iv.use)(sse);if(!t)throw new Error("useLunora must be used inside <LunoraProvider />");return t},"useLunora");var ise=K(Ro(),1),lse=K(oe(),1);var zz=n(()=>{let t=(0,ise.c)(4),e=Wt(),o,r,a;return t[0]!==e?(o=n(s=>e.onConnectionStatus(()=>{s()}),"t0"),r=n(()=>e.connectionStatus(),"t1"),a=n(()=>e.connectionStatus(),"t2"),t[0]=e,t[1]=o,t[2]=r,t[3]=a):(o=t[1],r=t[2],a=t[3]),(0,lse.useSyncExternalStore)(o,r,a)},"useConnectionStatus");var Cw=K(oe(),1);var cse=K(oe(),1),Rh=K(po(),1);var z3e={border:"1px solid var(--destructive)",color:"var(--destructive)",padding:12},H3e={overflow:"auto",whiteSpace:"pre-wrap"},WI=class extends cse.Component{static{n(this,"ErrorBoundary")}static getDerivedStateFromError(e){return{error:e}}state={error:null};componentDidCatch(e,o){console.error("[lunora-studio] panel error",e,o.componentStack)}reset=n(()=>{this.setState({error:null})},"reset");render(){let{children:e,fallbackTitle:o,label:r,retryLabel:a}=this.props,{error:s}=this.state;if(s===null)return(0,Rh.jsxDEV)(Rh.Fragment,{children:e},void 0,!1);let i=o??(r===void 0?"Something went wrong":`${r} failed`);return(0,Rh.jsxDEV)("div",{"data-testid":"dash-error-boundary",role:"alert",style:z3e,children:[(0,Rh.jsxDEV)("strong",{children:i},void 0,!1),(0,Rh.jsxDEV)("pre",{"data-testid":"dash-error-message",style:H3e,children:s.message},void 0,!1),(0,Rh.jsxDEV)("button",{"data-testid":"dash-error-retry",onClick:this.reset,type:"button",children:a??"Try again"},void 0,!1)]},void 0,!0)}};var Jt=K(Ro(),1);var Uu=K(oe(),1);var bv=typeof window<"u"?Uu.useLayoutEffect:Uu.useEffect;function hM(t){let e=Uu.useRef({value:t,prev:null}),o=e.current.value;return t!==o&&(e.current={value:t,prev:o}),e.current.prev}n(hM,"usePrevious");function use(t,e,o={},r={}){Uu.useEffect(()=>{if(!t.current||r.disabled||typeof IntersectionObserver!="function")return;let a=new IntersectionObserver(([s])=>{e(s)},o);return a.observe(t.current),()=>{a.disconnect()}},[e,o,r.disabled,t])}n(use,"useIntersectionObserver");function dse(t){let e=Uu.useRef(null);return Uu.useImperativeHandle(t,()=>e.current,[]),e}n(dse,"useForwardedRef");function Eh(t){return t[t.length-1]}n(Eh,"last");function $3e(t){return typeof t=="function"}n($3e,"isFunction");function ul(t,e){return $3e(t)?t(e):t}n(ul,"functionalUpdate");var gse=Object.prototype.hasOwnProperty,fse=Object.prototype.propertyIsEnumerable;function Ah(t){for(let e in t)if(gse.call(t,e))return!0;return!1}n(Ah,"hasKeys");var j3e=n(()=>Object.create(null),"createNull"),Th=n((t,e)=>Kd(t,e,j3e),"nullReplaceEqualDeep");function Kd(t,e,o=()=>({}),r=0){if(!1)return e;if(t===e)return t;if(r>500)return e;let a=e,s=Hz(t)&&Hz(a);if(!s&&!(cF(t)&&cF(a)))return a;let i=s?t:pse(t);if(!i)return a;let c=s?a:pse(a);if(!c)return a;let d=i.length,f=c.length,p=s?new Array(f):o(),m=0;for(let h=0;h<f;h++){let v=s?h:c[h],x=t[v],y=a[v];if(x===y){p[v]=x,(s?h<d:gse.call(t,v))&&m++;continue}if(x===null||y===null||typeof x!="object"||typeof y!="object"){p[v]=y;continue}let b=Kd(x,y,o,r+1);p[v]=b,b===x&&m++}return d===f&&m===d?t:p}n(Kd,"replaceEqualDeep");function pse(t){let e=Object.getOwnPropertyNames(t);for(let a of e)if(!fse.call(t,a))return!1;let o=Object.getOwnPropertySymbols(t);if(o.length===0)return e;let r=e;for(let a of o){if(!fse.call(t,a))return!1;r.push(a)}return r}n(pse,"getEnumerableOwnKeys");function cF(t){if(!mse(t))return!1;let e=t.constructor;if(typeof e>"u")return!0;let o=e.prototype;return!(!mse(o)||!o.hasOwnProperty("isPrototypeOf"))}n(cF,"isPlainObject");function mse(t){return Object.prototype.toString.call(t)==="[object Object]"}n(mse,"hasObjectPrototype");function Hz(t){return Array.isArray(t)&&t.length===Object.keys(t).length}n(Hz,"isPlainArray");function zu(t,e,o){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0,a=t.length;r<a;r++)if(!zu(t[r],e[r],o))return!1;return!0}if(cF(t)&&cF(e)){let r=o?.ignoreUndefined??!0;if(o?.partial){for(let i in e)if((!r||e[i]!==void 0)&&!zu(t[i],e[i],o))return!1;return!0}let a=0;if(!r)a=Object.keys(t).length;else for(let i in t)t[i]!==void 0&&a++;let s=0;for(let i in e)if((!r||e[i]!==void 0)&&(s++,s>a||!zu(t[i],e[i],o)))return!1;return a===s}return!1}n(zu,"deepEqual");function Yd(t){let e,o,r=new Promise((a,s)=>{e=a,o=s});return r.status="pending",r.resolve=a=>{r.status="resolved",r.value=a,e(a),t?.(a)},r.reject=a=>{r.status="rejected",o(a)},r}n(Yd,"createControlledPromise");function kh(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}n(kh,"isPromise");function $z(t,e){for(let o=t.length-1;o>=0;o--){let r=t[o];if(e(r))return r}}n($z,"findLast");function q3e(t){return t.replace(/[\x00-\x1f\x7f]/g,"")}n(q3e,"sanitizePathSegment");function hse(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,o=>{try{return decodeURI(o)}catch{return o}})}return q3e(e)}n(hse,"decodeSegment");var jz=["http:","https:","mailto:","tel:"];function Xd(t,e){if(!t)return!1;try{let o=new URL(t);return!e.has(o.protocol)}catch{return!1}}n(Xd,"isDangerousProtocol");function GI(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};let e=/%25|%5C/gi,o=0,r="",a;for(;(a=e.exec(t))!==null;)r+=hse(t.slice(o,a.index))+a[0],o=e.lastIndex;r=r+hse(o?t.slice(o):t);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}n(GI,"decodePath");function vse(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}n(vse,"encodePathLikeUrl");function xse(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(t[o]!==e[o])return!1;return!0}n(xse,"arraysEqual");function za(){throw new Error("Invariant failed")}n(za,"invariant");function Mh(t){let e=new Map,o,r,a=n(s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,o=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)},"touch");return{get(s){let i=e.get(s);if(i)return a(i),i.value},set(s,i){if(e.size>=t&&o){let d=o;e.delete(d.key),d.next&&(o=d.next,d.next.prev=void 0),d===r&&(r=void 0)}let c=e.get(s);if(c)c.value=i,a(c);else{let d={key:s,value:i,prev:r};r&&(r.next=d),r=d,o||(o=d),e.set(s,d)}},clear(){e.clear(),o=void 0,r=void 0}}}n(Mh,"createLRUCache");var Oh=4,Ise=5;function W3e(t){let e=t.indexOf("{");if(e===-1)return null;let o=t.indexOf("}",e);return o===-1||e+1>=t.length?null:[e,o]}n(W3e,"getOpenAndCloseBraces");function Gz(t,e,o=new Uint16Array(6)){let r=t.indexOf("/",e),a=r===-1?t.length:r,s=t.substring(e,a);if(!s||!s.includes("$"))return o[0]=0,o[1]=e,o[2]=e,o[3]=a,o[4]=a,o[5]=a,o;if(s==="$"){let c=t.length;return o[0]=2,o[1]=e,o[2]=e,o[3]=c,o[4]=c,o[5]=c,o}if(s.charCodeAt(0)===36)return o[0]=1,o[1]=e,o[2]=e+1,o[3]=a,o[4]=a,o[5]=a,o;let i=W3e(s);if(i){let[c,d]=i,f=s.charCodeAt(c+1);if(f===45){if(c+2<s.length&&s.charCodeAt(c+2)===36){let p=c+3,m=d;if(p<m)return o[0]=3,o[1]=e+c,o[2]=e+p,o[3]=e+m,o[4]=e+d+1,o[5]=a,o}}else if(f===36){let p=c+1,m=c+2;return m===d?(o[0]=2,o[1]=e+c,o[2]=e+p,o[3]=e+m,o[4]=e+d+1,o[5]=t.length,o):(o[0]=1,o[1]=e+c,o[2]=e+m,o[3]=e+d,o[4]=e+d+1,o[5]=a,o)}}return o[0]=0,o[1]=e,o[2]=e,o[3]=a,o[4]=a,o[5]=a,o}n(Gz,"parseSegment");function xM(t,e,o,r,a,s,i){i?.(o);let c=r;{let d=o.fullPath??o.from,f=d.length,p=o.options?.caseSensitive??t,m=o.options?.params?.parse??o.options?.parseParams;for(;c<f;){let v=Gz(d,c,e),x,y=c,b=v[5];switch(c=b+1,s++,v[0]){case 0:{let S=d.substring(v[2],v[3]);if(p){let w=a.static?.get(S);if(w)x=w;else{a.static??=new Map;let C=Sv(o.fullPath??o.from);C.parent=a,C.depth=s,x=C,a.static.set(S,C)}}else{let w=S.toLowerCase(),C=a.staticInsensitive?.get(w);if(C)x=C;else{a.staticInsensitive??=new Map;let F=Sv(o.fullPath??o.from);F.parent=a,F.depth=s,x=F,a.staticInsensitive.set(w,F)}}break}case 1:{let S=d.substring(y,v[1]),w=d.substring(v[4],b),C=p&&!!(S||w),F=S?C?S:S.toLowerCase():void 0,T=w?C?w:w.toLowerCase():void 0,E=!m&&a.dynamic?.find(k=>!k.parse&&k.caseSensitive===C&&k.prefix===F&&k.suffix===T);if(E)x=E;else{let k=Wz(1,o.fullPath??o.from,C,F,T);x=k,k.depth=s,k.parent=a,a.dynamic??=[],a.dynamic.push(k)}break}case 3:{let S=d.substring(y,v[1]),w=d.substring(v[4],b),C=p&&!!(S||w),F=S?C?S:S.toLowerCase():void 0,T=w?C?w:w.toLowerCase():void 0,E=!m&&a.optional?.find(k=>!k.parse&&k.caseSensitive===C&&k.prefix===F&&k.suffix===T);if(E)x=E;else{let k=Wz(3,o.fullPath??o.from,C,F,T);x=k,k.parent=a,k.depth=s,a.optional??=[],a.optional.push(k)}break}case 2:{let S=d.substring(y,v[1]),w=d.substring(v[4],b),C=p&&!!(S||w),F=S?C?S:S.toLowerCase():void 0,T=w?C?w:w.toLowerCase():void 0,E=Wz(2,o.fullPath??o.from,C,F,T);x=E,E.parent=a,E.depth=s,a.wildcard??=[],a.wildcard.push(E)}}a=x}if(m&&o.children&&!o.isRoot&&o.id&&o.id.charCodeAt(o.id.lastIndexOf("/")+1)===95){let v=Sv(o.fullPath??o.from);v.kind=Ise,v.parent=a,s++,v.depth=s,a.pathless??=[],a.pathless.push(v),a=v}let h=(o.path||!o.children)&&!o.isRoot;if(h&&d.endsWith("/")){let v=Sv(o.fullPath??o.from);v.kind=Oh,v.parent=a,s++,v.depth=s,a.index=v,a=v}a.parse=m??null,a.priority=o.options?.params?.priority??0,h&&!a.route&&(a.route=o,a.fullPath=o.fullPath??o.from)}if(o.children)for(let d of o.children)xM(t,e,d,c,a,s,i)}n(xM,"parseSegments");function qz(t,e){if(t.parse&&!e.parse)return-1;if(!t.parse&&e.parse)return 1;if(t.parse&&e.parse&&(t.priority||e.priority))return e.priority-t.priority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}n(qz,"sortDynamic");function Ph(t){if(t.pathless)for(let e of t.pathless)Ph(e);if(t.static)for(let e of t.static.values())Ph(e);if(t.staticInsensitive)for(let e of t.staticInsensitive.values())Ph(e);if(t.dynamic?.length){t.dynamic.sort(qz);for(let e of t.dynamic)Ph(e)}if(t.optional?.length){t.optional.sort(qz);for(let e of t.optional)Ph(e)}if(t.wildcard?.length){t.wildcard.sort(qz);for(let e of t.wildcard)Ph(e)}}n(Ph,"sortTreeNodes");function Sv(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0}}n(Sv,"createStaticNode");function Wz(t,e,o,r,a){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0,caseSensitive:o,prefix:r,suffix:a}}n(Wz,"createDynamicNode");function bse(t,e){let o=Sv("/"),r=new Uint16Array(6);for(let a of t)xM(!1,r,a,1,o,0);Ph(o),e.masksTree=o,e.flatCache=Mh(1e3)}n(bse,"processRouteMasks");function Sse(t,e){t||="/";let o=e.flatCache.get(t);if(o)return o;let r=Kz(t,e.masksTree);return e.flatCache.set(t,r),r}n(Sse,"findFlatMatch");function wse(t,e,o,r,a){t||="/",r||="/";let s=e?`case\0${t}`:t,i=a.singleCache.get(s);return i||(i=Sv("/"),xM(e,new Uint16Array(6),{from:t},1,i,0),a.singleCache.set(s,i)),Kz(r,i,o)}n(wse,"findSingleMatch");function Cse(t,e,o=!1){let r=o?t:`nofuzz\0${t}`,a=e.matchCache.get(r);if(a!==void 0)return a;t||="/";let s;try{s=Kz(t,e.segmentTree,o)}catch(i){if(i instanceof URIError)s=null;else throw i}return s&&(s.branch=Yz(s.route)),e.matchCache.set(r,s),s}n(Cse,"findRouteMatch");function G3e(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}n(G3e,"trimPathRight");function Fse(t,e=!1,o){let r=Sv(t.fullPath),a=new Uint16Array(6),s={},i={},c=0;return xM(e,a,t,1,r,0,d=>{if(o?.(d,c),d.id in s)throw new Error(`Invariant failed: Duplicate routes found with id: ${String(d.id)}`);if(s[d.id]=d,c!==0&&d.path){let f=G3e(d.fullPath);(!i[f]||d.fullPath.endsWith("/"))&&(i[f]=d)}c++}),Ph(r),{processedTree:{segmentTree:r,singleCache:Mh(1e3),matchCache:Mh(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:i}}n(Fse,"processRouteTree");function Kz(t,e,o=!1){let r=t.split("/"),a=Y3e(t,r,e,o);if(!a)return null;let[s]=Rse(t,r,a);return{route:a.node.route,rawParams:s}}n(Kz,"findMatch");function Rse(t,e,o){let r=K3e(o.node),a=null,s=Object.create(null),i=o.extract?.part??0,c=o.extract?.node??0,d=o.extract?.path??0,f=o.extract?.segment??0;for(;c<r.length;i++,c++,d++,f++){let p=r[c];if(p.kind===Oh)break;if(p.kind===Ise){f--,i--,d--;continue}let m=e[i],h=d;if(m&&(d+=m.length),p.kind===1){a??=o.node.fullPath.split("/");let v=a[f],x=p.prefix?.length??0;if(v.charCodeAt(x)===123){let y=p.suffix?.length??0,b=v.substring(x+2,v.length-y-1),S=m.substring(x,m.length-y);s[b]=decodeURIComponent(S)}else{let y=v.substring(1);s[y]=decodeURIComponent(m)}}else if(p.kind===3){if(o.skipped&1<<c){i--,d=h-1;continue}a??=o.node.fullPath.split("/");let v=a[f],x=p.prefix?.length??0,y=p.suffix?.length??0,b=v.substring(x+3,v.length-y-1),S=p.suffix||p.prefix?m.substring(x,m.length-y):m;S&&(s[b]=decodeURIComponent(S))}else if(p.kind===2){let v=p,x=t.substring(h+(v.prefix?.length??0),t.length-(v.suffix?.length??0)),y=decodeURIComponent(x);s["*"]=y,s._splat=y;break}}return o.rawParams&&Object.assign(s,o.rawParams),[s,{part:i,node:c,path:d,segment:f}]}n(Rse,"extractParams");function Yz(t){let e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}n(Yz,"buildRouteBranch");function K3e(t){let e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}n(K3e,"buildBranch");function Y3e(t,e,o,r){if(t==="/"&&o.index)return{node:o.index,skipped:0};let a=!Eh(e),s=a&&t!=="/",i=e.length-(a?1:0),c=[{node:o,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],d=null,f=null;for(;c.length;){let p=c.pop(),{node:m,index:h,skipped:v,depth:x,statics:y,dynamics:b,optionals:S}=p,{extract:w,rawParams:C}=p;if(m.kind===2&&m.route&&!vM(f,p))continue;if(m.parse){if(!yse(t,e,p))continue;C=p.rawParams,w=p.extract}r&&m.route&&m.kind!==Oh&&vM(d,p)&&(d=p);let F=h===i;if(F&&(m.route&&(!s||m.kind===Oh||m.kind===2)&&vM(f,p)&&(f=p),!m.optional&&!m.wildcard&&!m.index&&!m.pathless))continue;let T=F?void 0:e[h],E;if(F&&m.index){let k={node:m.index,index:h,skipped:v,depth:x+1,statics:y,dynamics:b,optionals:S,extract:w,rawParams:C},P=!0;if(m.index.parse&&(yse(t,e,k)||(P=!1)),P){if(!b&&!S&&!v&&X3e(y,i))return k;vM(f,k)&&(f=k)}}if(m.wildcard)for(let k=m.wildcard.length-1;k>=0;k--){let P=m.wildcard[k],{prefix:_,suffix:M}=P;if(!(_&&(F||!(P.caseSensitive?T:E??=T.toLowerCase()).startsWith(_)))){if(M){if(F)continue;let L=e.slice(h).join("/").slice(-M.length);if((P.caseSensitive?L:L.toLowerCase())!==M)continue}c.push({node:P,index:i,skipped:v,depth:x+1,statics:y,dynamics:b,optionals:S,extract:w,rawParams:C})}}if(m.optional){let k=v|1<<x,P=x+1;for(let _=m.optional.length-1;_>=0;_--){let M=m.optional[_];c.push({node:M,index:h,skipped:k,depth:P,statics:y,dynamics:b,optionals:S,extract:w,rawParams:C})}if(!F)for(let _=m.optional.length-1;_>=0;_--){let M=m.optional[_],{prefix:L,suffix:U}=M;if(L||U){let W=M.caseSensitive?T:E??=T.toLowerCase();if(L&&!W.startsWith(L)||U&&!W.endsWith(U))continue}c.push({node:M,index:h+1,skipped:v,depth:P,statics:y,dynamics:b,optionals:S+gM(i,h),extract:w,rawParams:C})}}if(!F&&m.dynamic&&T)for(let k=m.dynamic.length-1;k>=0;k--){let P=m.dynamic[k],{prefix:_,suffix:M}=P;if(_||M){let L=P.caseSensitive?T:E??=T.toLowerCase();if(_&&!L.startsWith(_)||M&&!L.endsWith(M))continue}c.push({node:P,index:h+1,skipped:v,depth:x+1,statics:y,dynamics:b+gM(i,h),optionals:S,extract:w,rawParams:C})}if(!F&&m.staticInsensitive){let k=m.staticInsensitive.get(E??=T.toLowerCase());k&&c.push({node:k,index:h+1,skipped:v,depth:x+1,statics:y+gM(i,h),dynamics:b,optionals:S,extract:w,rawParams:C})}if(!F&&m.static){let k=m.static.get(T);k&&c.push({node:k,index:h+1,skipped:v,depth:x+1,statics:y+gM(i,h),dynamics:b,optionals:S,extract:w,rawParams:C})}if(m.pathless){let k=x+1;for(let P=m.pathless.length-1;P>=0;P--){let _=m.pathless[P];c.push({node:_,index:h,skipped:v,depth:k,statics:y,dynamics:b,optionals:S,extract:w,rawParams:C})}}}if(f)return f;if(r&&d){let p=d.index;for(let h=0;h<d.index;h++)p+=e[h].length;let m=p===t.length?"/":t.slice(p);return d.rawParams??=Object.create(null),d.rawParams["**"]=decodeURIComponent(m),d}return null}n(Y3e,"getNodeMatch");function gM(t,e){return 2**(t-e-1)}n(gM,"segmentScore");function X3e(t,e){return t===2**(e-1)-1}n(X3e,"isPerfectStaticMatch");function yse(t,e,o){let r,a;try{[r,a]=Rse(t,e,o)}catch{return null}if(o.rawParams=r,o.extract=a,!o.node.parse)return!0;try{if(o.node.parse(r)===!1)return null}catch{}return!0}n(yse,"validateParseParams");function vM(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===Oh)>(t.node.kind===Oh)||e.node.kind===Oh==(t.node.kind===Oh)&&e.depth>t.depth))):!0}n(vM,"isFrameMoreSpecific");function wv(t){return dF(t.filter(e=>e!==void 0).join("/"))}n(wv,"joinPaths");function dF(t){return t.replace(/\/{2,}/g,"/")}n(dF,"cleanPath");function yM(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}n(yM,"trimPathLeft");function Yl(t){let e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}n(Yl,"trimPathRight");function fF(t){return Yl(yM(t))}n(fF,"trimPath");function Nh(t,e){return t?.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}n(Nh,"removeTrailingSlash");function IM(t,e,o){return Nh(t,o)===Nh(e,o)}n(IM,"exactPathTest");function Xz({base:t,to:e,trailingSlash:o="never",cache:r}){let a=e.startsWith("/"),s=!a&&e===".",i;if(r){i=a?e:s?t:t+"\0"+e;let f=r.get(i);if(f)return f}let c;if(s)c=t.split("/");else if(a)c=e.split("/");else{for(c=t.split("/");c.length>1&&Eh(c)==="";)c.pop();let f=e.split("/");for(let p=0,m=f.length;p<m;p++){let h=f[p];h===""?p?p===m-1&&c.push(h):c=[h]:h===".."?c.pop():h==="."||c.push(h)}}c.length>1&&(Eh(c)===""?o==="never"&&c.pop():o==="always"&&c.push(""));let d=dF(c.join("/"))||"/";return i&&r&&r.set(i,d),d}n(Xz,"resolvePath");function Ase(t){let e=new Map(t.map(a=>[encodeURIComponent(a),a])),o=Array.from(e.keys()).map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(o,"g");return a=>a.replace(r,s=>e.get(s)??s)}n(Ase,"compileDecodeCharMap");function uF(t,e,o){let r=e[t];return typeof r!="string"?r:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(a=>Ese(a,o)).join("/"):Ese(r,o)}n(uF,"encodeParam");function bM({path:t,params:e,decoder:o,...r}){let a=!1,s=Object.create(null);if(!t||t==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:a};if(!t.includes("$"))return{interpolatedPath:t,usedParams:s,isMissingParams:a};if(!1){let p=t.length,m=0,h="";for(;m<p;){for(;m<p&&t.charCodeAt(m)===47;)m++;if(m>=p)break;let v=m,x=t.indexOf("/",m);x===-1&&(x=p),m=x;let y=t.substring(v,x);if(y)if(y.charCodeAt(0)===36)if(y.length===1){let b=e._splat;if(s._splat=b,s["*"]=b,!b){a=!0;continue}let S=uF("_splat",e,o);h+="/"+S}else{let b=y.substring(1);!a&&!(b in e)&&(a=!0),s[b]=e[b];let S=uF(b,e,o)??"undefined";h+="/"+S}else h+="/"+y}return t.endsWith("/")&&(h+="/"),{usedParams:s,interpolatedPath:h||"/",isMissingParams:a}}let i=t.length,c=0,d,f="";for(;c<i;){let p=c;d=Gz(t,p,d);let m=d[5];if(c=m+1,p===m)continue;let h=d[0];if(h===0){f+="/"+t.substring(p,m);continue}if(h===2){let v=e._splat;s._splat=v,s["*"]=v;let x=t.substring(p,d[1]),y=t.substring(d[4],m);if(!v){a=!0,(x||y)&&(f+="/"+x+y);continue}let b=uF("_splat",e,o);f+="/"+x+b+y;continue}if(h===1){let v=t.substring(d[2],d[3]);!a&&!(v in e)&&(a=!0),s[v]=e[v];let x=t.substring(p,d[1]),y=t.substring(d[4],m),b=uF(v,e,o)??"undefined";f+="/"+x+b+y;continue}if(h===3){let v=t.substring(d[2],d[3]),x=e[v];if(x==null)continue;s[v]=x;let y=t.substring(p,d[1]),b=t.substring(d[4],m),S=uF(v,e,o)??"";f+="/"+y+S+b;continue}}return t.endsWith("/")&&(f+="/"),{usedParams:s,interpolatedPath:f||"/",isMissingParams:a}}n(bM,"interpolatePath");function Ese(t,e){let o=encodeURIComponent(t);return e?.(o)??o}n(Ese,"encodePathParam");function $n(t){return t?.isNotFound===!0}n($n,"isNotFound");function Tse(t,e=String){let o=new URLSearchParams;for(let r in t){let a=t[r];a!==void 0&&o.set(r,e(a))}return o.toString()}n(Tse,"encode");function Qz(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}n(Qz,"toValue");function kse(t){let e=new URLSearchParams(t),o=Object.create(null);for(let[r,a]of e.entries()){let s=o[r];s==null?o[r]=Qz(a):Array.isArray(s)?s.push(Qz(a)):o[r]=[s,Qz(a)]}return o}n(kse,"decode");var Mse=Q3e(JSON.parse),Pse=Z3e(JSON.stringify,JSON.parse);function Q3e(t){return e=>{e[0]==="?"&&(e=e.substring(1));let o=kse(e);for(let r in o){let a=o[r];if(typeof a=="string")try{o[r]=t(a)}catch{}}return o}}n(Q3e,"parseSearchWith");function Z3e(t,e){let o=typeof e=="function";function r(a){if(typeof a=="object"&&a!==null)try{return t(a)}catch{}else if(o&&typeof a=="string")try{return e(a),t(a)}catch{}return a}return n(r,"stringifyValue"),a=>{let s=Tse(a,r);return s?`?${s}`:""}}n(Z3e,"stringifySearchWith");var dl="__root__";function KI(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}let e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);let o=new Response(null,{status:t.statusCode,headers:e});if(o.options=t,t.throw)throw o;return o}n(KI,"redirect");function ns(t){return t instanceof Response&&!!t.options}n(ns,"isRedirect");var Zz=n(t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},"triggerOnReady"),J3e=n(t=>t.stores.matchesId.get().some(e=>t.stores.matchStores.get(e)?.get()._forcePending),"hasForcePendingActiveMatch"),CM=n((t,e)=>!!(t.preload&&!t.router.stores.matchStores.has(e)),"resolvePreload"),Cv=n((t,e,o=!0)=>{let r={...t.router.options.context??{}},a=o?e:e-1;for(let s=0;s<=a;s++){let i=t.matches[s];if(!i)continue;let c=t.router.getMatch(i.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},"buildMatchContext"),Ose=n((t,e)=>{if(!t.matches.length)return;let o=e.routeId,r=t.matches.findIndex(i=>i.routeId===t.router.routeTree.id),a=r>=0?r:0,s=o?t.matches.findIndex(i=>i.routeId===o):t.firstBadMatchIndex??t.matches.length-1;s<0&&(s=a);for(let i=s;i>=0;i--){let c=t.matches[i];if(t.router.looseRoutesById[c.routeId].options.notFoundComponent)return i}return o?s:a},"getNotFoundBoundaryIndex"),Dh=n((t,e,o)=>{if(!(!ns(o)&&!$n(o)))throw ns(o)&&o.redirectHandled&&!o.options.reloadDocument||(e&&(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.loaderPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loaderPromise=void 0,e._nonReactive.error=o,t.updateMatch(e.id,r=>({...r,status:ns(o)?"redirected":$n(o)?"notFound":r.status==="pending"?"success":r.status,context:Cv(t,e.index),isFetching:!1,error:o})),$n(o)&&!o.routeId&&(o.routeId=e.routeId),e._nonReactive.loadPromise?.resolve()),ns(o)&&(t.rendered=!0,o.options._fromLocation=t.location,o.redirectHandled=!0,o=t.router.resolveRedirect(o))),o},"handleRedirectAndNotFound"),Lse=n((t,e)=>{let o=t.router.getMatch(e);return!!(!o||!!1&&o._nonReactive.dehydrated||!1)},"shouldSkipLoader"),Nse=n((t,e,o)=>{let r=Cv(t,o);t.updateMatch(e,a=>({...a,context:r}))},"syncMatchContext"),pF=n((t,e,o)=>{let{id:r,routeId:a}=t.matches[e],s=t.router.looseRoutesById[a];if(o instanceof Promise)throw o;t.firstBadMatchIndex??=e,Dh(t,t.router.getMatch(r),o);try{s.options.onError?.(o)}catch(i){o=i,Dh(t,t.router.getMatch(r),o)}t.updateMatch(r,i=>(i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,i._nonReactive.loadPromise?.resolve(),{...i,error:o,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!t.preload&&!ns(o)&&!$n(o)&&(t.serialError??=o)},"handleSerialError"),eBe=n((t,e,o,r)=>{let a=t.router.getMatch(e),s=t.matches[o-1]?.id,i=s?t.router.getMatch(s):void 0;if(t.router.isShell()){a.ssr=r.id===dl;return}if(i?.ssr===!1){a.ssr=!1;return}let c=n(v=>v===!0&&i?.ssr==="data-only"?"data-only":v,"parentOverride"),d=t.router.options.defaultSsr??!0;if(r.options.ssr===void 0){a.ssr=c(d);return}if(typeof r.options.ssr!="function"){a.ssr=c(r.options.ssr);return}let{search:f,params:p}=a,m={search:SM(f,a.searchError),params:SM(p,a.paramsError),location:t.location,matches:t.matches.map(v=>({index:v.index,pathname:v.pathname,fullPath:v.fullPath,staticData:v.staticData,id:v.id,routeId:v.routeId,search:SM(v.search,v.searchError),params:SM(v.params,v.paramsError),ssr:v.ssr}))},h=r.options.ssr(m);if(kh(h))return h.then(v=>{a.ssr=c(v??d)});a.ssr=c(h??d)},"isBeforeLoadSsr"),Bse=n((t,e,o,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let a=o.options.pendingMs??t.router.options.defaultPendingMs;if(t.onReady&&!!1&&!CM(t,e)&&(o.options.loader||o.options.beforeLoad||eH(o))&&typeof a=="number"&&a!==1/0&&(o.options.pendingComponent??t.router.options?.defaultPendingComponent)){let s=setTimeout(()=>{Zz(t)},a);r._nonReactive.pendingTimeout=s}},"setupPendingTimeout"),tBe=n((t,e,o)=>{let r=t.router.getMatch(e);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Bse(t,e,o,r);let a=n(()=>{let s=t.router.getMatch(e);s.preload&&(s.status==="redirected"||s.status==="notFound")&&Dh(t,s,s.error)},"then");return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(a):a()},"preBeforeLoadSetup"),oBe=n((t,e,o,r)=>{let a=t.router.getMatch(e),s=a._nonReactive.loadPromise;a._nonReactive.loadPromise=Yd(()=>{s?.resolve(),s=void 0});let{paramsError:i,searchError:c}=a;i&&pF(t,o,i),c&&pF(t,o,c),Bse(t,e,r,a);let d=new AbortController,f=!1,p=n(()=>{f||(f=!0,t.updateMatch(e,F=>({...F,isFetching:"beforeLoad",fetchCount:F.fetchCount+1,abortController:d})))},"pending"),m=n(()=>{a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,t.updateMatch(e,F=>({...F,isFetching:!1}))},"resolve");if(!r.options.beforeLoad){t.router.batch(()=>{p(),m()});return}a._nonReactive.beforeLoadPromise=Yd();let h={...Cv(t,o,!1),...a.__routeContext},{search:v,params:x,cause:y}=a,b=CM(t,e),S={search:v,abortController:d,params:x,preload:b,context:h,location:t.location,navigate:n(F=>t.router.navigate({...F,_fromLocation:t.location}),"navigate"),buildLocation:t.router.buildLocation,cause:b?"preload":y,matches:t.matches,routeId:r.id,...t.router.options.additionalContext},w=n(F=>{if(F===void 0){t.router.batch(()=>{p(),m()});return}(ns(F)||$n(F))&&(p(),pF(t,o,F)),t.router.batch(()=>{p(),t.updateMatch(e,T=>({...T,__beforeLoadContext:F})),m()})},"updateContext"),C;try{if(C=r.options.beforeLoad(S),kh(C))return p(),C.catch(F=>{pF(t,o,F)}).then(w)}catch(F){p(),pF(t,o,F)}w(C)},"executeBeforeLoad"),rBe=n((t,e)=>{let{id:o,routeId:r}=t.matches[e],a=t.router.looseRoutesById[r],s=n(()=>{if(!1){let d=eBe(t,o,e,a);if(kh(d))return d.then(c)}return c()},"serverSsr"),i=n(()=>oBe(t,o,e,a),"execute"),c=n(()=>{if(Lse(t,o))return;let d=tBe(t,o,a);return kh(d)?d.then(i):i()},"queueExecution");return s()},"handleBeforeLoad"),nBe=n((t,e,o)=>{let r=t.router.getMatch(e);if(!r||!o.options.head&&!o.options.scripts&&!o.options.headers)return;let a={ssr:t.router.options.ssr,matches:t.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([o.options.head?.(a),o.options.scripts?.(a),o.options.headers?.(a)]).then(([s,i,c])=>({meta:s?.meta,links:s?.links,headScripts:s?.scripts,headers:c,scripts:i,styles:s?.styles}))},"executeHead"),Vse=n((t,e,o,r,a)=>{let s=e[r-1],{params:i,loaderDeps:c,abortController:d,cause:f}=t.router.getMatch(o),p=Cv(t,r),m=CM(t,o);return{params:i,deps:c,preload:!!m,parentMatchPromise:s,abortController:d,context:p,location:t.location,navigate:n(h=>t.router.navigate({...h,_fromLocation:t.location}),"navigate"),cause:m?"preload":f,route:a,...t.router.options.additionalContext}},"getLoaderContext"),Dse=n(async(t,e,o,r,a)=>{try{let s=t.router.getMatch(o);try{(!!1||s.ssr===!0)&&YI(a);let i=a.options.loader,c=typeof i=="function"?i:i?.handler,d=c?.(Vse(t,e,o,r,a)),f=!!c&&kh(d);if((f||a._lazyPromise||a._componentsPromise||a.options.head||a.options.scripts||a.options.headers||s._nonReactive.minPendingPromise)&&t.updateMatch(o,m=>({...m,isFetching:"loader"})),c){let m=f?await d:d;Dh(t,t.router.getMatch(o),m),m!==void 0&&t.updateMatch(o,h=>({...h,loaderData:m}))}a._lazyPromise&&await a._lazyPromise;let p=s._nonReactive.minPendingPromise;p&&await p,a._componentsPromise&&await a._componentsPromise,t.updateMatch(o,m=>({...m,error:void 0,context:Cv(t,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(i){let c=i;if(c?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}t.updateMatch(o,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:Cv(t,r)}));return}let d=s._nonReactive.minPendingPromise;d&&await d,$n(i)&&await a.options.notFoundComponent?.preload?.(),Dh(t,t.router.getMatch(o),i);try{a.options.onError?.(i)}catch(f){c=f,Dh(t,t.router.getMatch(o),f)}!ns(c)&&!$n(c)&&await YI(a,["errorComponent"]),t.updateMatch(o,f=>({...f,error:c,context:Cv(t,r),status:"error",isFetching:!1}))}}catch(s){let i=t.router.getMatch(o);i&&(i._nonReactive.loaderPromise=void 0),Dh(t,i,s)}},"runLoader"),aBe=n(async(t,e,o)=>{async function r(v,x,y,b,S){let w=Date.now()-x.updatedAt,C=v?S.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??t.router.options.defaultStaleTime??0,F=S.options.shouldReload,T=typeof F=="function"?F(Vse(t,e,a,o,S)):F,{status:E,invalid:k}=b,P=w>=C&&(!!t.forceStaleReload||b.cause==="enter"||y!==void 0&&y!==b.id);i=E==="success"&&(k||(T??P)),v&&S.options.preload===!1||(i&&!t.sync&&p?(c=!0,(async()=>{try{await Dse(t,e,a,o,S);let _=t.router.getMatch(a);_._nonReactive.loaderPromise?.resolve(),_._nonReactive.loadPromise?.resolve(),_._nonReactive.loaderPromise=void 0,_._nonReactive.loadPromise=void 0}catch(_){ns(_)&&await t.router.navigate(_.options)}})()):E!=="success"||i?await Dse(t,e,a,o,S):Nse(t,a,o))}n(r,"handleLoader");let{id:a,routeId:s}=t.matches[o],i=!1,c=!1,d=t.router.looseRoutesById[s],f=d.options.loader,p=((typeof f=="function"?void 0:f?.staleReloadMode)??t.router.options.defaultStaleReloadMode)!=="blocking";if(Lse(t,a)){if(!t.router.getMatch(a))return t.matches[o];if(Nse(t,a,o),!1)return t.router.getMatch(a)}else{let v=t.router.getMatch(a),x=t.router.stores.matchesId.get()[o],y=(x&&t.router.stores.matchStores.get(x)||null)?.routeId===s?x:t.router.stores.matches.get().find(S=>S.routeId===s)?.id,b=CM(t,a);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!t.sync&&!v.preload&&p)return v;await v._nonReactive.loaderPromise;let S=t.router.getMatch(a),w=S._nonReactive.error||S.error;w&&Dh(t,S,w),S.status==="pending"&&await r(b,v,y,S,d)}else{let S=b&&!t.router.stores.matchStores.has(a),w=t.router.getMatch(a);w._nonReactive.loaderPromise=Yd(),S!==w.preload&&t.updateMatch(a,C=>({...C,preload:S})),await r(b,v,y,w,d)}}let m=t.router.getMatch(a);c||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,c||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;let h=c?m.isFetching:!1;return h!==m.isFetching||m.invalid!==!1?(t.updateMatch(a,v=>({...v,isFetching:h,invalid:!1})),t.router.getMatch(a)):m},"loadRouteMatch");async function Jz(t){let e=t,o=[];!!1&&J3e(e.router)&&Zz(e);let r;for(let h=0;h<e.matches.length;h++){try{let v=rBe(e,h);kh(v)&&await v}catch(v){if(ns(v))throw v;if($n(v))r=v;else if(!e.preload)throw v;break}if(e.serialError||e.firstBadMatchIndex!=null)break}let a=e.firstBadMatchIndex??e.matches.length,s=r&&!e.preload?Ose(e,r):void 0,i=r&&e.preload?0:s!==void 0?Math.min(s+1,a):a,c,d;for(let h=0;h<i;h++)o.push(aBe(e,o,h));try{await Promise.all(o)}catch{let h=await Promise.allSettled(o);for(let v of h){if(v.status!=="rejected")continue;let x=v.reason;if(ns(x))throw x;$n(x)?c??=x:d??=x}if(d!==void 0)throw d}let f=c??(r&&!e.preload?r:void 0),p=e.firstBadMatchIndex!==void 0?e.firstBadMatchIndex:e.matches.length-1;if(!f&&r&&e.preload)return e.matches;if(f){let h=Ose(e,f);if(h===void 0)throw new Error("Invariant failed: Could not find match for notFound boundary");let v=e.matches[h],x=e.router.looseRoutesById[v.routeId],y=e.router.options?.defaultNotFoundComponent;!x.options.notFoundComponent&&y&&(x.options.notFoundComponent=y),f.routeId=v.routeId;let b=v.routeId===e.router.routeTree.id;e.updateMatch(v.id,S=>({...S,...b?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),p=h,await YI(x,["notFoundComponent"])}else if(!e.preload){let h=e.matches[0];h.globalNotFound||e.router.getMatch(h.id)?.globalNotFound&&e.updateMatch(h.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(e.serialError&&e.firstBadMatchIndex!==void 0){let h=e.router.looseRoutesById[e.matches[e.firstBadMatchIndex].routeId];await YI(h,["errorComponent"])}for(let h=0;h<=p;h++){let{id:v,routeId:x}=e.matches[h],y=e.router.looseRoutesById[x];try{let b=nBe(e,v,y);if(b){let S=await b;e.updateMatch(v,w=>({...w,...S}))}}catch(b){console.error(`Error executing head for route ${x}:`,b)}}let m=Zz(e);if(kh(m)&&await m,f)throw f;if(e.serialError&&!e.preload&&!e.onReady)throw e.serialError;return e.matches}n(Jz,"loadMatches");function _se(t,e){let o=e.map(r=>t.options[r]?.preload?.()).filter(Boolean);if(o.length!==0)return Promise.all(o)}n(_se,"preloadRouteComponents");function YI(t,e=wM){!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(r=>{let{id:a,...s}=r.options;Object.assign(t.options,s),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0);let o=n(()=>t._componentsLoaded?void 0:e===wM?(()=>{if(t._componentsPromise===void 0){let r=_se(t,wM);r?t._componentsPromise=r.then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0}):t._componentsLoaded=!0}return t._componentsPromise})():_se(t,e),"runAfterLazy");return t._lazyPromise?t._lazyPromise.then(o):o()}n(YI,"loadRouteChunk");function SM(t,e){return e?{status:"error",error:e}:{status:"success",value:t}}n(SM,"makeMaybe");function eH(t){for(let e of wM)if(t.options[e]?.preload)return!0;return!1}n(eH,"routeNeedsPreload");var wM=["component","errorComponent","pendingComponent","notFoundComponent"];function Use(t){return{input:n(({url:e})=>{for(let o of t)e=FM(o,e);return e},"input"),output:n(({url:e})=>{for(let o=t.length-1;o>=0;o--)e=tH(t[o],e);return e},"output")}}n(Use,"composeRewrites");function zse(t){let e=fF(t.basepath),o=`/${e}`,r=t.caseSensitive?o:o.toLowerCase(),a=`${r}/`;return{input:n(({url:s})=>{let i=t.caseSensitive?s.pathname:s.pathname.toLowerCase();return i===r?s.pathname="/":i.startsWith(a)&&(s.pathname=s.pathname.slice(o.length)),s},"input"),output:n(({url:s})=>(s.pathname=wv(["/",e,s.pathname]),s),"output")}}n(zse,"rewriteBasepath");function FM(t,e){let o=t?.input?.({url:e});if(o){if(typeof o=="string")return new URL(o);if(o instanceof URL)return o}return e}n(FM,"executeRewriteInput");function tH(t,e){let o=t?.output?.({url:e});if(o){if(typeof o=="string")return new URL(o);if(o instanceof URL)return o}return e}n(tH,"executeRewriteOutput");function nH(t){let e=t;return{get(){return e},set(o){e=ul(o,e)}}}n(nH,"createNonReactiveMutableStore");function aH(t){return{get(){return t()}}}n(aH,"createNonReactiveReadonlyStore");function Hse(t,e){let{createMutableStore:o,createReadonlyStore:r,batch:a,init:s}=e,i=new Map,c=new Map,d=new Map,f=o(t.status),p=o(t.loadedAt),m=o(t.isLoading),h=o(t.isTransitioning),v=o(t.location),x=o(t.resolvedLocation),y=o(t.statusCode),b=o(t.redirect),S=o([]),w=o([]),C=o([]),F=r(()=>oH(i,S.get())),T=r(()=>oH(c,w.get())),E=r(()=>oH(d,C.get())),k=r(()=>S.get()[0]),P=r(()=>S.get().some(D=>i.get(D)?.get().status==="pending")),_=r(()=>({locationHref:v.get().href,resolvedLocationHref:x.get()?.href,status:f.get()})),M=r(()=>({status:f.get(),loadedAt:p.get(),isLoading:m.get(),isTransitioning:h.get(),matches:F.get(),location:v.get(),resolvedLocation:x.get(),statusCode:y.get(),redirect:b.get()})),L=Mh(64);function U(D){let B=L.get(D);return B||(B=r(()=>{let z=S.get();for(let q of z){let H=i.get(q);if(H&&H.routeId===D)return H.get()}}),L.set(D,B)),B}n(U,"getRouteMatchStore");let W={status:f,loadedAt:p,isLoading:m,isTransitioning:h,location:v,resolvedLocation:x,statusCode:y,redirect:b,matchesId:S,pendingIds:w,cachedIds:C,matches:F,pendingMatches:T,cachedMatches:E,firstId:k,hasPending:P,matchRouteDeps:_,matchStores:i,pendingMatchStores:c,cachedMatchStores:d,__store:M,getRouteMatchStore:U,setMatches:V,setPending:j,setCached:N};V(t.matches),s?.(W);function V(D){rH(D,i,S,o,a)}n(V,"setMatches");function j(D){rH(D,c,w,o,a)}n(j,"setPending");function N(D){rH(D,d,C,o,a)}return n(N,"setCached"),W}n(Hse,"createRouterStores");function oH(t,e){let o=[];for(let r of e){let a=t.get(r);a&&o.push(a.get())}return o}n(oH,"readPoolMatches");function rH(t,e,o,r,a){let s=t.map(c=>c.id),i=new Set(s);a(()=>{for(let c of e.keys())i.has(c)||e.delete(c);for(let c of t){let d=e.get(c.id);if(!d){let f=r(c);f.routeId=c.routeId,e.set(c.id,f);continue}d.routeId=c.routeId,d.get()!==c&&d.set(c)}xse(o.get(),s)||o.set(s)})}n(rH,"reconcileMatchPool");var _h="__TSR_index",$se="popstate",jse="beforeunload";function iH(t){let e=t.getLocation(),o=new Set,r=n(i=>{e=t.getLocation(),o.forEach(c=>c({location:e,action:i}))},"notify"),a=n(i=>{t.notifyOnIndexChange??!0?r(i):e=t.getLocation()},"handleIndexChange"),s=n(async({task:i,navigateOpts:c,...d})=>{if(c?.ignoreBlocker??!1){i();return}let f=t.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&f.length&&p)for(let m of f){let h=XI(d.path,d.state);if(await m.blockerFn({currentLocation:e,nextLocation:h,action:d.type})){t.onBlocked?.();return}}i()},"tryNavigation");return{get location(){return e},get length(){return t.getLength()},subscribers:o,subscribe:n(i=>(o.add(i),()=>{o.delete(i)}),"subscribe"),push:n((i,c,d)=>{let f=e.state[_h];c=sH(f+1,c),s({task:n(()=>{t.pushState(i,c),r({type:"PUSH"})},"task"),navigateOpts:d,type:"PUSH",path:i,state:c})},"push"),replace:n((i,c,d)=>{let f=e.state[_h];c=sH(f,c),s({task:n(()=>{t.replaceState(i,c),r({type:"REPLACE"})},"task"),navigateOpts:d,type:"REPLACE",path:i,state:c})},"replace"),go:n((i,c)=>{s({task:n(()=>{t.go(i),a({type:"GO",index:i})},"task"),navigateOpts:c,type:"GO"})},"go"),back:n(i=>{s({task:n(()=>{t.back(i?.ignoreBlocker??!1),a({type:"BACK"})},"task"),navigateOpts:i,type:"BACK"})},"back"),forward:n(i=>{s({task:n(()=>{t.forward(i?.ignoreBlocker??!1),a({type:"FORWARD"})},"task"),navigateOpts:i,type:"FORWARD"})},"forward"),canGoBack:n(()=>e.state[_h]!==0,"canGoBack"),createHref:n(i=>t.createHref(i),"createHref"),block:n(i=>{if(!t.setBlockers)return()=>{};let c=t.getBlockers?.()??[];return t.setBlockers([...c,i]),()=>{let d=t.getBlockers?.()??[];t.setBlockers?.(d.filter(f=>f!==i))}},"block"),flush:n(()=>t.flush?.(),"flush"),destroy:n(()=>t.destroy?.(),"destroy"),notify:r}}n(iH,"createHistory");function sH(t,e){e||(e={});let o=cH();return{...e,key:o,__TSR_key:o,[_h]:t}}n(sH,"assignKeyAndIndex");function mF(t){let e=t?.window??(typeof document<"u"?window:void 0),o=e.history.pushState,r=e.history.replaceState,a=[],s=n(()=>a,"_getBlockers"),i=n(P=>a=P,"_setBlockers"),c=t?.createHref??(P=>P),d=t?.parseLocation??(()=>XI(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){let P=cH();e.history.replaceState({[_h]:0,key:P,__TSR_key:P},"")}let f=d(),p,m=!1,h=!1,v=!1,x=!1,y=n(()=>f,"getLocation"),b,S,w=n(()=>{b&&(k._ignoreSubscribers=!0,(b.isPush?e.history.pushState:e.history.replaceState)(b.state,"",b.href),k._ignoreSubscribers=!1,b=void 0,S=void 0,p=void 0)},"flush"),C=n((P,_,M)=>{let L=c(_);S||(p=f),f=XI(_,M),b={href:L,state:M,isPush:b?.isPush||P==="push"},S||(S=Promise.resolve().then(()=>w()))},"queueHistoryAction"),F=n(P=>{f=d(),k.notify({type:P})},"onPushPop"),T=n(async()=>{if(h){h=!1;return}let P=d(),_=P.state[_h]-f.state[_h],M=_===1,L=_===-1,U=!M&&!L||m;m=!1;let W=U?"GO":L?"BACK":"FORWARD",V=U?{type:"GO",index:_}:{type:L?"BACK":"FORWARD"};if(v)v=!1;else{let j=s();if(typeof document<"u"&&j.length){for(let N of j)if(await N.blockerFn({currentLocation:f,nextLocation:P,action:W})){h=!0,e.history.go(1),k.notify(V);return}}}f=d(),k.notify(V)},"onPushPopEvent"),E=n(P=>{if(x){x=!1;return}let _=!1,M=s();if(typeof document<"u"&&M.length)for(let L of M){let U=L.enableBeforeUnload??!0;if(U===!0){_=!0;break}if(typeof U=="function"&&U()===!0){_=!0;break}}if(_)return P.preventDefault(),P.returnValue=""},"onBeforeUnload"),k=iH({getLocation:y,getLength:n(()=>e.history.length,"getLength"),pushState:n((P,_)=>C("push",P,_),"pushState"),replaceState:n((P,_)=>C("replace",P,_),"replaceState"),back:n(P=>(P&&(v=!0),x=!0,e.history.back()),"back"),forward:n(P=>{P&&(v=!0),x=!0,e.history.forward()},"forward"),go:n(P=>{m=!0,e.history.go(P)},"go"),createHref:n(P=>c(P),"createHref"),flush:w,destroy:n(()=>{e.history.pushState=o,e.history.replaceState=r,e.removeEventListener(jse,E,{capture:!0}),e.removeEventListener($se,T)},"destroy"),onBlocked:n(()=>{p&&f!==p&&(f=p)},"onBlocked"),getBlockers:s,setBlockers:i,notifyOnIndexChange:!1});return e.addEventListener(jse,E,{capture:!0}),e.addEventListener($se,T),e.history.pushState=function(...P){let _=o.apply(e.history,P);return k._ignoreSubscribers||F("PUSH"),_},e.history.replaceState=function(...P){let _=r.apply(e.history,P);return k._ignoreSubscribers||F("REPLACE"),_},k}n(mF,"createBrowserHistory");function lH(t={initialEntries:["/"]}){let e=t.initialEntries,o=t.initialIndex?Math.min(Math.max(t.initialIndex,0),e.length-1):e.length-1,r=e.map((d,f)=>sH(f,void 0)),a=n(()=>XI(e[o],r[o]),"getLocation"),s=[];return iH({getLocation:a,getLength:n(()=>e.length,"getLength"),pushState:n((d,f)=>{o<e.length-1&&(e.splice(o+1),r.splice(o+1)),r.push(f),e.push(d),o=Math.max(e.length-1,0)},"pushState"),replaceState:n((d,f)=>{r[o]=f,e[o]=d},"replaceState"),back:n(()=>{o=Math.max(o-1,0)},"back"),forward:n(()=>{o=Math.min(o+1,e.length-1)},"forward"),go:n(d=>{o=Math.min(Math.max(o+d,0),e.length-1)},"go"),createHref:n(d=>d,"createHref"),getBlockers:n(()=>s,"_getBlockers"),setBlockers:n(d=>s=d,"_setBlockers")})}n(lH,"createMemoryHistory");function sBe(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}n(sBe,"sanitizePath");function XI(t,e){let o=sBe(t),r=o.indexOf("#"),a=o.indexOf("?"),s=cH();return{href:o,pathname:o.substring(0,r>0?a>0?Math.min(r,a):r:a>0?a:o.length),hash:r>-1?o.substring(r):"",search:a>-1?o.slice(a,r===-1?void 0:r):"",state:e||{[_h]:0,key:s,__TSR_key:s}}}n(XI,"parseHref");function cH(){return(Math.random()+1).toString(36).substring(7)}n(cH,"createRandomKey");function wp(t,e){let o=e,r=t;return{fromLocation:o,toLocation:r,pathChanged:o?.pathname!==r.pathname,hrefChanged:o?.href!==r.href,hashChanged:o?.hash!==r.hash}}n(wp,"getLocationChangeInfo");var EM=new WeakMap,uH=class{static{n(this,"RouterCore")}constructor(t,e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=o=>o(),this.update=o=>{o.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");let r=this.options,a=this.basepath??r?.basepath??"/",s=this.basepath===void 0,i=r?.rewrite;if(this.options={...r,...o},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Ase(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=mF()),this.origin=this.options.origin,this.origin||(!!1&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let p;!1,this.resolvePathCache=Mh(1e3),p=this.buildRouteTree(),!1,this.setRoutes(p)}if(!this.stores&&this.latestLocation){let p=this.getStoreConfig(this);this.batch=p.batch,this.stores=Hse(Yse(this.latestLocation),p),Qse(this)}let c=!1,d=this.options.basepath??"/",f=this.options.rewrite;if(s||a!==d||i!==f){this.basepath=d;let p=[],m=fF(d);m&&m!=="/"&&p.push(zse({basepath:d})),f&&p.push(f),this.rewrite=p.length===0?void 0:p.length===1?p[0]:Use(p),this.history&&this.updateLatestLocation(),c=!0}c&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let o=Fse(this.routeTree,this.options.caseSensitive,(r,a)=>{r.init({originalIndex:a})});return this.options.routeMasks&&bse(this.options.routeMasks,o.processedTree),o},this.subscribe=(o,r)=>{let a={eventType:o,fn:r};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=o=>{this.subscribers.forEach(r=>{r.eventType===o.type&&r.fn(o)})},this.parseLocation=(o,r)=>{let a=n(({pathname:d,search:f,hash:p,href:m,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){let S=this.options.parseSearch(f),w=this.options.stringifySearch(S);return{href:d+w+p,publicHref:d+w+p,pathname:GI(d).path,external:!1,searchStr:w,search:Th(r?.search,S),hash:GI(p.slice(1)).path,state:Kd(r?.state,h)}}let v=new URL(m,this.origin),x=FM(this.rewrite,v),y=this.options.parseSearch(x.search),b=this.options.stringifySearch(y);return x.search=b,{href:x.href.replace(x.origin,""),publicHref:m,pathname:GI(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:b,search:Th(r?.search,y),hash:GI(x.hash.slice(1)).path,state:Kd(r?.state,h)}},"parse"),s=a(o),{__tempLocation:i,__tempKey:c}=s.state;if(i&&(!c||c===this.tempLocationKey)){let d=a(i);return d.state.key=s.state.key,d.state.__TSR_key=s.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:s}}return s},this.resolvePathWithBase=(o,r)=>Xz({base:o,to:r.includes("//")?dF(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(o,r,a)=>typeof o=="string"?this.matchRoutesInternal({pathname:o,search:r},a):this.matchRoutesInternal(o,r),this.getMatchedRoutes=o=>Xse({pathname:o,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=o=>{let r=this.getMatch(o);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(o=>{this.cancelMatch(o)}),this.stores.matchesId.get().forEach(o=>{if(this.stores.pendingMatchStores.has(o))return;let r=this.stores.matchStores.get(o)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(o)})},this.buildLocation=o=>{let r=n((s={})=>{let i=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutesLightweight(i);if(s.from&&s._isNavigate){let L=this.getMatchedRoutes(s.from).matchedRoutes,U=$z(c.matchedRoutes,V=>Wse(V.fullPath,s.from)),W=$z(L,V=>Wse(V.fullPath,c.fullPath));!U&&!W&&console.warn(`Could not find match for from: ${s.from}`)}let d=s.unsafeRelative==="path"?i.pathname:s.from??c.fullPath,f=s.to?`${s.to}`:void 0,p=c.search,m=Object.assign(Object.create(null),c.params),h=f?.charCodeAt(0)===47?"/":this.resolvePathWithBase(d,"."),v=f?this.resolvePathWithBase(h,f):h,x=s.params===!1||s.params===null?Object.create(null):(s.params??!0)===!0?m:Object.assign(m,ul(s.params,m)),y=this.routesByPath[Yl(v)],b;if(y)b=this.getRouteBranch(y);else if(v.includes("$"))b=[];else{let L=this.getMatchedRoutes(v);b=L.matchedRoutes,this.options.notFoundRoute&&(!L.foundRoute||L.foundRoute.path!=="/"&&L.routeParams["**"])&&(b=[...b,this.options.notFoundRoute])}if(b.length&&Ah(x))for(let L of b){let U=L.options.params?.stringify??L.options.stringifyParams;if(U)try{Object.assign(x,U(x))}catch{}}let S=o.leaveParams?v:GI(bM({path:v,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;if(y&&!o.leaveParams)try{let L=this.getMatchedRoutes(S);L.foundRoute?.id!==y.id&&console.warn(`Generated path "${S}" for route "${y.id}" matched route "${L.foundRoute?.id}" instead. This can happen when multiple route templates resolve to the same URL. Use the route template that matches the intended route, or adjust params.stringify if it changed the target path.`)}catch{}let w=p;if(o._includeValidateSearch&&this.options.search?.strict){let L={};b.forEach(U=>{if(U.options.validateSearch)try{Object.assign(L,RM(U.options.validateSearch,{...L,...w}))}catch{}}),w=L}w=iBe({search:w,dest:s,destRoutes:b,_includeValidateSearch:o._includeValidateSearch}),w=Th(p,w);let C=this.options.stringifySearch(w),F=s.hash===!0?i.hash:s.hash?ul(s.hash,i.hash):void 0,T=F?`#${F}`:"",E=s.state===!0?i.state:s.state?ul(s.state,i.state):{};E=Kd(i.state,E);let k=`${S}${C}${T}`,P,_,M=!1;if(this.rewrite){let L=new URL(k,this.origin),U=tH(this.rewrite,L);P=L.href.replace(L.origin,""),U.origin!==this.origin?(_=U.href,M=!0):_=U.pathname+U.search+U.hash}else P=vse(k),_=P;return{publicHref:_,href:P,pathname:S,search:w,searchStr:C,state:E,hash:F??"",external:M,unmaskOnReload:s.unmaskOnReload}},"build"),a=n((s={},i)=>{let c=r(s),d=i?r(i):void 0;if(!d){let f=Object.create(null);if(this.options.routeMasks){let p=Sse(c.pathname,this.processedTree);if(p){Object.assign(f,p.rawParams);let{from:m,params:h,...v}=p.route,x=h===!1||h===null?Object.create(null):(h??!0)===!0?f:Object.assign(f,ul(h,f));i={from:o.from,...v,params:x},d=r(i)}}}return d&&(c.maskedLocation=d),c},"buildWithMatches");return o.mask?a(o,{from:o.from,...o.mask}):a(o)},this.commitLocation=async({viewTransition:o,ignoreBlocker:r,...a})=>{let s,i=n(()=>{let f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(m=>{a.state[m]=this.latestLocation.state[m]});let p=zu(a.state,this.latestLocation.state);return f.forEach(m=>{delete a.state[m]}),p},"isSameState"),c=Yl(this.latestLocation.href)===Yl(a.href),d=this.commitLocationPromise;if(this.commitLocationPromise=Yd(()=>{d?.resolve(),d=void 0}),c&&i())this.load();else{let{maskedLocation:f,hashScrollIntoView:p,...m}=a;f&&(m={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=o,s=a.replace?"REPLACE":"PUSH",this.history[s==="REPLACE"?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:r})}return this._scroll.next=a.resetScroll??!0,this.history.subscribers.size||this.load(s?{action:{type:s}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:o,resetScroll:r,hashScrollIntoView:a,viewTransition:s,ignoreBlocker:i,href:c,...d}={})=>{if(c){let m=this.history.location.state.__TSR_index,h=XI(c,{__TSR_index:o?m:m+1}),v=new URL(h.pathname,this.origin);d.to=FM(this.rewrite,v).pathname,d.search=this.options.parseSearch(h.search),d.hash=h.hash.slice(1)}let f=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=f;let p=this.commitLocation({...f,viewTransition:s,replace:o,resetScroll:r,hashScrollIntoView:a,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:o,reloadDocument:r,href:a,publicHref:s,...i})=>{let c=!1;if(a)try{new URL(`${a}`),c=!0}catch{}if(c&&!r&&(r=!0),r){if(o!==void 0||!a){let f=this.buildLocation({to:o,...i});a=a??f.publicHref,s=s??f.publicHref}let d=!c&&s?s:a;if(Xd(d,this.protocolAllowlist))return console.warn(`Blocked navigation to dangerous protocol: ${d}`),Promise.resolve();if(!i.ignoreBlocker){let f=this.history.getBlockers?.()??[];for(let p of f)if(p?.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return i.replace?window.location.replace(d):window.location.href=d,Promise.resolve()}return this.buildAndCommitLocation({...i,href:a,to:o,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),!1){let a=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==a.publicHref){let s=this.getParsedLocationHref(a);throw a.external?KI({href:s}):KI({href:s,_builtLocation:a})}}let o=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(a=>!o.some(s=>s.id===a.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(o),this.stores.setCached(r)})},this.load=async o=>{let r=o?.action?.type,a,s,i,c=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad(),r?EM.set(this.latestLocation,r):EM.delete(this.latestLocation);let p=this.latestLocation,m=wp(p,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...m}),this.emit({type:"onBeforeLoad",...m}),await Jz({router:this,sync:o?.sync,forceStaleReload:c.href===p.href,matches:this.stores.pendingMatches.get(),location:p,updateMatch:this.updateMatch,onReady:n(async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let h=null,v=null,x=null,y=null;this.batch(()=>{let b=this.stores.pendingMatches.get(),S=b.length,w=this.stores.matches.get();h=S?w.filter(T=>!this.stores.pendingMatchStores.has(T.id)):null;let C=new Set;for(let T of this.stores.pendingMatchStores.values())T.routeId&&C.add(T.routeId);let F=new Set;for(let T of this.stores.matchStores.values())T.routeId&&F.add(T.routeId);v=S?w.filter(T=>!C.has(T.routeId)):null,x=S?b.filter(T=>!F.has(T.routeId)):null,y=S?b.filter(T=>F.has(T.routeId)):w,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),S&&(this.stores.setMatches(b),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...h.filter(T=>T.status!=="error"&&T.status!=="notFound"&&T.status!=="redirected")]),this.clearExpiredCache())});for(let[b,S]of[[v,"onLeave"],[x,"onEnter"],[y,"onStay"]])if(b)for(let w of b)this.looseRoutesById[w.routeId].options[S]?.(w)})})},"onReady")})}catch(p){ns(p)?(a=p,this.navigate({...a.options,replace:!0,ignoreBlocker:!0})):$n(p)&&(s=p);let m=a?a.status:s?404:this.stores.matches.get().some(h=>h.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(m),this.stores.redirect.set(a)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.stores.matches.get().some(f=>f.status==="error")&&(d=500),d!==void 0&&this.stores.statusCode.set(d)},this.startViewTransition=o=>{let r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&this.isViewTransitionTypesSupported){let s=this.latestLocation,i=this.stores.resolvedLocation.get(),c=typeof r.types=="function"?r.types(wp(s,i)):r.types;if(c===!1){o();return}a={update:o,types:c}}else a=o;document.startViewTransition(a)}else o()},this.updateMatch=(o,r)=>{this.startTransition(()=>{let a=this.stores.pendingMatchStores.get(o);if(a){a.set(r);return}let s=this.stores.matchStores.get(o);if(s){s.set(r);return}let i=this.stores.cachedMatchStores.get(o);if(i){let c=r(i.get());c.status==="redirected"?this.stores.cachedMatchStores.delete(o)&&this.stores.cachedIds.set(d=>d.filter(f=>f!==o)):i.set(c)}})},this.getMatch=o=>this.stores.cachedMatchStores.get(o)?.get()??this.stores.pendingMatchStores.get(o)?.get()??this.stores.matchStores.get(o)?.get(),this.invalidate=o=>{let r=n(a=>o?.filter?.(a)??!0?{...a,invalid:!0,...o?.forcePending||a.status==="error"||a.status==="notFound"?{status:"pending",error:void 0}:void 0}:a,"invalidate");return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:o?.sync})},this.getParsedLocationHref=o=>o.publicHref||"/",this.resolveRedirect=o=>{let r=o.headers.get("Location");if(!o.options.href||o.options._builtLocation){let a=o.options._builtLocation??this.buildLocation(o.options),s=this.getParsedLocationHref(a);o.options.href=s,o.headers.set("Location",s)}else if(r)try{let a=new URL(r);if(this.origin&&a.origin===this.origin){let s=a.pathname+a.search+a.hash;o.options.href=s,o.headers.set("Location",s)}}catch{}if(o.options.href&&!o.options._builtLocation&&Xd(o.options.href,this.protocolAllowlist))throw new Error(`Redirect blocked: unsafe protocol in href "${o.options.href}". Allowed protocols: ${Array.from(this.protocolAllowlist).join(", ")}.`);return o.headers.get("Location")||o.headers.set("Location",o.options.href),o},this.clearCache=o=>{let r=o?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(a=>!r(a))):this.stores.setCached([])},this.clearExpiredCache=()=>{let o=Date.now(),r=n(a=>{let s=this.looseRoutesById[a.routeId];if(!s.options.loader)return!0;let i=(a.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return a.status==="error"?!0:o-a.updatedAt>=i},"filter");this.clearCache({filter:r})},this.loadRouteChunk=YI,this.preloadRoute=async o=>{let r=o._builtLocation??this.buildLocation(o),a=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:o}),s=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...s,...this.stores.cachedIds.get()]),c=a.filter(d=>!i.has(d.id));if(c.length){let d=this.stores.cachedMatches.get();this.stores.setCached([...d,...c])}try{return a=await Jz({router:this,matches:a,location:r,preload:!0,updateMatch:n((d,f)=>{s.has(d)?a=a.map(p=>p.id===d?f(p):p):this.updateMatch(d,f)},"updateMatch")}),a}catch(d){if(ns(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:r});$n(d)||console.error(d);return}},this.matchRoute=(o,r)=>{let a={...o,to:o.to?this.resolvePathWithBase(o.from||"",o.to):void 0,params:o.params||{},leaveParams:!0},s=this.buildLocation(a);if(r?.pending&&this.stores.status.get()!=="pending")return!1;let i=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),c=wse(s.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,i.pathname,this.processedTree);return!c||o.params&&!zu(c.rawParams,o.params,{partial:!0})?!1:r?.includeSearch??!0?zu(i.search,s.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(o=>o.status==="notFound"||o.globalNotFound),this.getStoreConfig=e,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Pse,parseSearch:t.parseSearch??Mse,protocolAllowlist:t.protocolAllowlist??jz}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:t,routesByPath:e,processedTree:o}){this.routesById=t,this.routesByPath=e,this.processedTree=o;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(t){let e=this.routeBranchCache.get(t);return e||(e=Yz(t),this.routeBranchCache.set(t,e)),e}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,e){let o=this.getMatchedRoutes(t.pathname),{foundRoute:r,routeParams:a}=o,{matchedRoutes:s}=o,i=!1;(r?r.path!=="/"&&a["**"]:Yl(t.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:i=!0);let c=i?cBe(this.options.notFoundMode,s):void 0,d=new Array(s.length),f=new Map;for(let p of this.stores.matchStores.values())p.routeId&&f.set(p.routeId,p.get());for(let p=0;p<s.length;p++){let m=s[p],h=d[p-1],v,x,y;{let U=h?.search??t.search,W=h?._strictSearch??void 0;try{let V=RM(m.options.validateSearch,{...U})??void 0;v={...U,...V},x={...W,...V},y=void 0}catch(V){let j=V;if(V instanceof hF||(j=new hF(V.message,{cause:V})),e?.throwOnError)throw j;v=U,x={},y=j}}let b=m.options.loaderDeps?.({search:v})??"",S=b?JSON.stringify(b):"",{interpolatedPath:w,usedParams:C}=bM({path:m.fullPath,params:a,decoder:this.pathParamsDecoder,server:this.isServer}),F=m.id+w+S,T=this.getMatch(F),E=f.get(m.id),k=T?._strictParams??C,P;if(!T)try{Gse(m,k)}catch(U){if($n(U)||ns(U)?P=U:P=new Kse(U.message,{cause:U}),e?.throwOnError)throw P}Object.assign(a,k);let _=E?"stay":"enter",M;if(T)M={...T,cause:_,params:E?.params??a,_strictParams:k,search:E?Th(E.search,v):Th(T.search,v),_strictSearch:x};else{let U=m.options.loader||m.options.beforeLoad||m.lazyFn||eH(m)?"pending":"success";M={id:F,ssr:m.options.ssr,index:p,routeId:m.id,params:E?.params??a,_strictParams:k,pathname:w,updatedAt:Date.now(),search:E?Th(E.search,v):v,_strictSearch:x,searchError:void 0,status:U,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:Yd()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:_,loaderDeps:E?Kd(E.loaderDeps,b):b,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}e?.preload||(M.globalNotFound=c===m.id),M.searchError=y;let L=this.getParentContext(h);M.context={...L,...M.__routeContext,...M.__beforeLoadContext},d[p]=M}for(let p=0;p<d.length;p++){let m=d[p],h=this.looseRoutesById[m.routeId],v=this.getMatch(m.id),x=f.get(m.routeId);if(m.params=x?Th(x.params,a):a,!v){let y=d[p-1],b=this.getParentContext(y);if(h.options.context){let S={deps:m.loaderDeps,params:m.params,context:b??{},location:t,navigate:n(w=>this.navigate({...w,_fromLocation:t}),"navigate"),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d,routeId:h.id};m.__routeContext=h.options.context(S)??void 0}m.context={...b,...m.__routeContext,...m.__beforeLoadContext}}}return d}matchRoutesLightweight(t){let{matchedRoutes:e,routeParams:o}=this.getMatchedRoutes(t.pathname),r=Eh(e),a={...t.search};for(let f of e)try{Object.assign(a,RM(f.options.validateSearch,a))}catch{}let s=Eh(this.stores.matchesId.get()),i=s&&this.stores.matchStores.get(s)?.get(),c=i&&i.routeId===r.id&&i.pathname===t.pathname,d;if(c)d=i.params;else{let f=Object.assign(Object.create(null),o);for(let p of e)try{Gse(p,f)}catch{}d=f}return{matchedRoutes:e,fullPath:r.fullPath,search:a,params:d}}},hF=class extends Error{static{n(this,"SearchParamError")}},Kse=class extends Error{static{n(this,"PathParamError")}},qse=n(t=>t.endsWith("/")&&t.length>1?t.slice(0,-1):t,"normalize");function Wse(t,e){return qse(t)===qse(e)}n(Wse,"comparePaths");function Yse(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],statusCode:200}}n(Yse,"getInitialRouterState");function RM(t,e){if(t==null)return{};if("~standard"in t){let o=t["~standard"].validate(e);if(o instanceof Promise)throw new hF("Async validation not supported");if(o.issues)throw new hF(JSON.stringify(o.issues,void 0,2),{cause:o});return o.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}n(RM,"validateSearch");function Xse({pathname:t,routesById:e,processedTree:o}){let r=Object.create(null),a=Yl(t),s,i=Cse(a,o,!0);return i&&(s=i.route,Object.assign(r,i.rawParams)),{matchedRoutes:i?.branch||[e.__root__],routeParams:r,foundRoute:s}}n(Xse,"getMatchedRoutes");function iBe({search:t,dest:e,destRoutes:o,_includeValidateSearch:r}){return lBe(o)(t,e,r??!1)}n(iBe,"applySearchMiddleware");function lBe(t){let e,o,r=[];for(let s of t){let i=s.options;if("search"in i)i.search?.middlewares&&r.push(...i.search.middlewares);else if(i.preSearchFilters||i.postSearchFilters){let d=n(({search:f,next:p})=>{let m=p(i.preSearchFilters?i.preSearchFilters.reduce((h,v)=>v(h),f):f);return i.postSearchFilters?i.postSearchFilters.reduce((h,v)=>v(h),m):m},"legacyMiddleware");r.push(d)}let c=i.validateSearch;if(c){let d=n(({search:f,next:p,meta:m})=>{let h=p(f);if(o)try{let v=RM(c,h);if(m&&v)for(let x in v)x in h||(m.defaulted||=new Map).set(x,v[x]);return{...h,...v}}catch{}return h},"validate");r.push(d)}}let a=n((s,i,c)=>{if(s>=r.length){if(!e.search)return{};if(e.search===!0)return i;let f=ul(e.search,i);return c&&(c.explicit=f),f}let d=n((f,p)=>{if(p){let m=c||{};return{search:a(s+1,f,m),meta:m}}return a(s+1,f,c)},"next");return r[s]({search:i,next:d,meta:c})},"applyNext");return n(function(i,c,d){return e=c,o=d,a(0,i)},"middleware")}n(lBe,"buildMiddlewareChain");function cBe(t,e){if(t!=="root")for(let o=e.length-1;o>=0;o--){let r=e[o];if(r.children)return r.id}return dl}n(cBe,"findGlobalNotFoundRouteId");function Gse(t,e){let o=t.options.params?.parse??t.options.parseParams;if(o){let r=o(e);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(e,r)}}n(Gse,"extractStrictParams");function uBe(){try{return sessionStorage}catch{return}}n(uBe,"getSafeSessionStorage");var dBe="tsr-scroll-restoration-v1_3",eie=uBe();function fBe(){try{return JSON.parse(eie?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}n(fBe,"createScrollRestorationCache");function pBe(){try{eie?.setItem(dBe,JSON.stringify(QI))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}n(pBe,"persistScrollRestorationCache");var QI=fBe(),Zse="data-scroll-restoration-id",mBe=n(t=>t.state.__TSR_key||t.href,"defaultGetScrollRestorationKey");function hBe(t){let e=t.getAttribute(Zse);if(e)return`[${Zse}="${e}"]`;let o="",r=t,a;for(;a=r.parentNode;){let s=1,i=r;for(;i=i.previousElementSibling;)s++;let c=`${r.localName}:nth-child(${s})`;o=o?`${c} > ${o}`:c,r=a}return o}n(hBe,"getScrollRestorationSelector");var AM=!1,ZI="window";function dH(t){try{return typeof t=="function"?t():document.querySelector(t)}catch{}}n(dH,"getElement");function Jse(t){let e=[];for(let o of t){if(o===ZI)continue;let r=dH(o);r&&e.push(r)}return e}n(Jse,"getScrollToTopElements");function Qse(t,e){let o=e??t.options.scrollRestoration,r=t._scroll;if(o&&(r.restoring=!0),!1)return;let a=t.options.getScrollRestorationKey||mBe,s=new Map,i=n((f,p,m)=>{let h=s.get(f)||{};h.scrollX=p,h.scrollY=m,s.set(f,h)},"setTrackedScrollEntry"),c=n(f=>{if(!(AM||!r.restoring))if(f.target===document)i(ZI,scrollX,scrollY);else{let p=f.target;i(p,p.scrollLeft,p.scrollTop)}},"onScroll"),d=n(f=>{if(!r.restoring)return;let p=QI[f]||={};for(let[m,h]of s)m===ZI?p[ZI]=h:m.isConnected&&(p[hBe(m)]=h)},"snapshotCurrentScrollTargets");o&&!r.restoration&&(r.restoration=!0,AM=!1,history.scrollRestoration="manual",document.addEventListener("scroll",c,!0),t.subscribe("onBeforeLoad",f=>{f.fromLocation&&d(a(f.fromLocation)),s.clear()}),addEventListener("pagehide",()=>{d(a(t.stores.resolvedLocation.get()??t.stores.location.get())),pBe()})),!r.reset&&(r.reset=!0,t.subscribe("onRendered",f=>{let p=t.options.scrollRestorationBehavior,m=t.options.scrollToTopSelectors,h=r.next,v;if(s.clear(),h||(r.next=!0),typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return;let x=a(f.toLocation),y=f.fromLocation&&a(f.fromLocation);if(r.restoring&&y&&y!==x){let b=QI[y];if(b){let S=QI[x];for(let w in b){if(w===ZI){if(h)continue}else{let C=dH(w);if(!C||h&&m&&(v??=Jse(m),v.includes(C)))continue}S||(S=QI[x]={}),S[w]??=b[w]}}}AM=!0;try{let b=f.toLocation.hash,S=f.toLocation.state.__hashScrollIntoViewOptions??!0,w=!1;if(h){let C=EM.get(f.toLocation),F=b&&S&&(C==="PUSH"||C==="REPLACE"),T=r.restoring?QI[x]:void 0;if(T)for(let E in T){let{scrollX:k,scrollY:P}=T[E];if(E===ZI){if(F)continue;scrollTo({top:P,left:k,behavior:p}),w=!0}else{let _=dH(E);_&&(_.scrollLeft=k,_.scrollTop=P)}}if(!w&&!b){let E={top:0,left:0,behavior:p};if(scrollTo(E),m){v??=Jse(m);for(let k of v)k.scrollTo(E)}}}!w&&b&&S&&document.getElementById(b)?.scrollIntoView(S)}finally{AM=!1}}))}n(Qse,"setupScrollRestoration");var fH="Error preloading route! \u261D\uFE0F";var TM=class{static{n(this,"BaseRoute")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=e=>{this.originalIndex=e.originalIndex;let o=this.options,r=!o?.path&&!o?.id;if(this.parentRoute=this.options.getParentRoute?.(),r)this._path=dl;else if(!this.parentRoute)throw new Error("Invariant failed: Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.");let a=r?dl:o?.path;a&&a!=="/"&&(a=yM(a));let s=o?.id||a,i=r?dl:wv([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);a==="__root__"&&(a="/"),i!=="__root__"&&(i=wv(["/",i]));let c=i==="__root__"?"/":wv([this.parentRoute.fullPath,a]);this._path=a,this._id=i,this._fullPath=c,this._to=Yl(c)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>KI({from:this.fullPath,...e}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}};var pH=class extends TM{static{n(this,"BaseRootRoute")}constructor(t){super(t)}};var JI=K(oe(),1),Hu=K(zt(),1);function Fv(t){let e=t.errorComponent??Rv;return(0,Hu.jsx)(xBe,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:n(({error:o,reset:r})=>o?JI.createElement(e,{error:o,reset:r}):t.children,"children")})}n(Fv,"CatchBoundary");var xBe=class extends JI.Component{static{n(this,"CatchBoundaryImpl")}constructor(...t){super(...t),this.state={error:null}}static getDerivedStateFromProps(t,e){let o=t.getResetKey();return e.error&&e.resetKey!==o?{resetKey:o,error:null}:{resetKey:o}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidCatch(t,e){this.props.onCatch&&this.props.onCatch(t,e)}render(){return this.props.children({error:this.state.error,reset:n(()=>{this.reset()},"reset")})}};function Rv({error:t}){let[e,o]=JI.useState(!0);return(0,Hu.jsxs)("div",{style:{padding:".5rem",maxWidth:"100%"},children:[(0,Hu.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[(0,Hu.jsx)("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),(0,Hu.jsx)("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:n(()=>o(r=>!r),"onClick"),children:e?"Hide Error":"Show Error"})]}),(0,Hu.jsx)("div",{style:{height:".25rem"}}),e?(0,Hu.jsx)("div",{children:(0,Hu.jsx)("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?(0,Hu.jsx)("code",{children:t.message}):null})}):null]})}n(Rv,"ErrorComponent");var kM=K(oe(),1),mH=K(zt(),1);function tie({children:t,fallback:e=null}){return hH()?(0,mH.jsx)(kM.default.Fragment,{children:t}):(0,mH.jsx)(kM.default.Fragment,{children:e})}n(tie,"ClientOnly");function hH(){return kM.default.useSyncExternalStore(yBe,()=>!0,()=>!1)}n(hH,"useHydrated");function yBe(){return()=>{}}n(yBe,"subscribe");var oie=K(oe(),1),MM=oie.createContext(null);var rie=K(oe(),1);function vn(t){let e=rie.useContext(MM);return(t?.warn??!0)&&!e&&console.warn("Warning: useRouter must be used inside a <RouterProvider> component!"),e}n(vn,"useRouter");var gH=K(oe(),1),Ev=gH.createContext(void 0),nie=gH.createContext(void 0);var _M=K(oe(),1);var Ln=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(Ln||{});function aie({update:t,notify:e,unwatched:o}){return{link:r,unlink:a,propagate:s,checkDirty:i,shallowPropagate:c};function r(f,p,m){let h=p.depsTail;if(h!==void 0&&h.dep===f)return;let v=h!==void 0?h.nextDep:p.deps;if(v!==void 0&&v.dep===f){v.version=m,p.depsTail=v;return}let x=f.subsTail;if(x!==void 0&&x.version===m&&x.sub===p)return;let y=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:h,nextDep:v,prevSub:x,nextSub:void 0};v!==void 0&&(v.prevDep=y),h!==void 0?h.nextDep=y:p.deps=y,x!==void 0?x.nextSub=y:f.subs=y}function a(f,p=f.sub){let m=f.dep,h=f.prevDep,v=f.nextDep,x=f.nextSub,y=f.prevSub;return v!==void 0?v.prevDep=h:p.depsTail=h,h!==void 0?h.nextDep=v:p.deps=v,x!==void 0?x.prevSub=y:m.subsTail=y,y!==void 0?y.nextSub=x:(m.subs=x)===void 0&&o(m),v}function s(f){let p=f.nextSub,m;e:do{let h=f.sub,v=h.flags;if(v&60?v&12?v&4?!(v&48)&&d(f,h)?(h.flags=v|40,v&=1):v=0:h.flags=v&-9|32:v=0:h.flags=v|32,v&2&&e(h),v&1){let x=h.subs;if(x!==void 0){let y=(f=x).nextSub;y!==void 0&&(m={value:p,prev:m},p=y);continue}}if((f=p)!==void 0){p=f.nextSub;continue}for(;m!==void 0;)if(f=m.value,m=m.prev,f!==void 0){p=f.nextSub;continue e}break}while(!0)}function i(f,p){let m,h=0,v=!1;e:do{let x=f.dep,y=x.flags;if(p.flags&16)v=!0;else if((y&17)===17){if(t(x)){let b=x.subs;b.nextSub!==void 0&&c(b),v=!0}}else if((y&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=x.deps,p=x,++h;continue}if(!v){let b=f.nextDep;if(b!==void 0){f=b;continue}}for(;h--;){let b=p.subs,S=b.nextSub!==void 0;if(S?(f=m.value,m=m.prev):f=b,v){if(t(p)){S&&c(b),p=f.sub;continue}v=!1}else p.flags&=-33;p=f.sub;let w=f.nextDep;if(w!==void 0){f=w;continue e}}return v}while(!0)}function c(f){do{let p=f.sub,m=p.flags;(m&48)===32&&(p.flags=m|16,(m&6)===2&&e(p))}while((f=f.nextSub)!==void 0)}function d(f,p){let m=p.depsTail;for(;m!==void 0;){if(m===f)return!0;m=m.prevDep}return!1}}n(aie,"createReactiveSystem");function lie(t,e,o){let r=typeof t=="object",a=r?t:void 0;return{next:(r?t.next:t)?.bind(a),error:(r?t.error:e)?.bind(a),complete:(r?t.complete:o)?.bind(a)}}n(lie,"toObserver");var vH=[],OM=0,{link:sie,unlink:IBe,propagate:bBe,checkDirty:cie,shallowPropagate:iie}=aie({update(t){return t._update()},notify(t){vH[xH++]=t,t.flags&=~Ln.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=Ln.Mutable|Ln.Dirty,NM(t))}}),PM=0,xH=0,Qd,yH=0;function gF(t){try{++yH,t()}finally{--yH||IH()}}n(gF,"batch");function NM(t){let e=t.depsTail,o=e!==void 0?e.nextDep:t.deps;for(;o!==void 0;)o=IBe(o,t)}n(NM,"purgeDeps");function IH(){if(!(yH>0)){for(;PM<xH;){let t=vH[PM];vH[PM++]=void 0,t.notify()}PM=0,xH=0}}n(IH,"flush");function DM(t,e){let o=typeof t=="function",r=t,a={_snapshot:o?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:o?Ln.None:Ln.Mutable,get(){return Qd!==void 0&&sie(a,Qd,OM),a._snapshot},subscribe(s){let i=lie(s),c={current:!1},d=SBe(()=>{a.get(),c.current?i.next?.(a._snapshot):c.current=!0});return{unsubscribe:n(()=>{d.stop()},"unsubscribe")}},_update(s){let i=Qd,c=e?.compare??Object.is;if(o)Qd=a,++OM,a.depsTail=void 0;else if(s===void 0)return!1;o&&(a.flags=Ln.Mutable|Ln.RecursedCheck);try{let d=a._snapshot,f=typeof s=="function"?s(d):s===void 0&&o?r(d):s;return d===void 0||!c(d,f)?(a._snapshot=f,!0):!1}finally{Qd=i,o&&(a.flags&=~Ln.RecursedCheck),NM(a)}}};return o?(a.flags=Ln.Mutable|Ln.Dirty,a.get=function(){let s=a.flags;if(s&Ln.Dirty||s&Ln.Pending&&cie(a.deps,a)){if(a._update()){let i=a.subs;i!==void 0&&iie(i)}}else s&Ln.Pending&&(a.flags=s&~Ln.Pending);return Qd!==void 0&&sie(a,Qd,OM),a._snapshot}):a.set=function(s){if(a._update(s)){let i=a.subs;i!==void 0&&(bBe(i),iie(i),IH())}},a}n(DM,"createAtom");function SBe(t){let e=n(()=>{let r=Qd;Qd=o,++OM,o.depsTail=void 0,o.flags=Ln.Watching|Ln.RecursedCheck;try{return t()}finally{Qd=r,o.flags&=~Ln.RecursedCheck,NM(o)}},"run"),o={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Ln.Watching|Ln.RecursedCheck,notify(){let r=this.flags;r&Ln.Dirty||r&Ln.Pending&&cie(this.deps,this)?e():this.flags=Ln.Watching},stop(){this.flags=Ln.None,this.depsTail=void 0,NM(this)}};return e(),o}n(SBe,"effect");var SH=K(oe(),1),gie=K(vF(),1);function wBe(t,e){return t===e}n(wBe,"defaultCompare");function Zn(t,e,o=wBe){let r=(0,SH.useCallback)(i=>{if(!t)return()=>{};let{unsubscribe:c}=t.subscribe(i);return c},[t]),a=(0,SH.useCallback)(()=>t?.get(),[t]);return(0,gie.useSyncExternalStoreWithSelector)(r,a,a,e,o)}n(Zn,"useStore");var wH={get(){},subscribe(){return{unsubscribe(){}}}};function CH(t,e){let o=_M.useRef();return r=>{let a=t?.select?t.select(r):r;return t?.structuralSharing??e.options.defaultStructuralSharing?o.current=Kd(o.current,a):a}}n(CH,"useStructuralSharing");function Xl(t){let e=vn(),o=_M.useContext(t.from?nie:Ev),r=t.from?e.stores.getRouteMatchStore(t.from):e.stores.matchStores.get(o);if(!1){let i=r?.get();if(!i){if(t.shouldThrow??!0)throw new Error(`Invariant failed: Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`);return}return t.select?t.select(i):i}let a=CH(t,e),s=Zn(r??wH,i=>i?a(i):wH);if(s!==wH)return s;if(t.shouldThrow??!0)throw new Error(`Invariant failed: Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`)}n(Xl,"useMatch");function FH(t){return Xl({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:n(e=>t.select?t.select(e.loaderData):e.loaderData,"select")})}n(FH,"useLoaderData");function RH(t){let{select:e,...o}=t;return Xl({...o,select:n(r=>e?e(r.loaderDeps):r.loaderDeps,"select")})}n(RH,"useLoaderDeps");function EH(t){return Xl({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:n(e=>{let o=t.strict===!1?e.params:e._strictParams;return t.select?t.select(o):o},"select")})}n(EH,"useParams");function Lh(t){return Xl({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:n(e=>t.select?t.select(e.search):e.search,"select")})}n(Lh,"useSearch");var AH=K(oe(),1);function zs(t){let e=vn();return AH.useCallback(o=>e.navigate({...o,from:o.from??t?.from}),[t?.from,e])}n(zs,"useNavigate");function TH(t){return Xl({...t,select:n(e=>t.select?t.select(e.context):e.context,"select")})}n(TH,"useRouteContext");var Ha=K(oe(),1),CBe=K(zt(),1);var Sie=K(ti(),1);function FBe(t,e){let o=vn(),r=dse(e),a=!1,{activeProps:s,inactiveProps:i,activeOptions:c,to:d,preload:f,preloadDelay:p,preloadIntentProximity:m,hashScrollIntoView:h,replace:v,startTransition:x,resetScroll:y,viewTransition:b,children:S,target:w,disabled:C,style:F,className:T,onClick:E,onBlur:k,onFocus:P,onMouseEnter:_,onMouseLeave:M,onTouchStart:L,ignoreBlocker:U,params:W,search:V,hash:j,state:N,mask:D,reloadDocument:B,unsafeRelative:z,from:q,_fromLocation:H,...Y}=t;if(a){let Le=bie(d);if(typeof d=="string"&&!Le&&d.indexOf(":")>-1)try{return new URL(d),Xd(d,o.protocolAllowlist)?(console.warn(`Blocked Link with dangerous protocol: ${d}`),{...Y,ref:r,href:void 0,...S&&{children:S},...w&&{target:w},...C&&{disabled:C},...F&&{style:F},...T&&{className:T}}):{...Y,ref:r,href:d,...S&&{children:S},...w&&{target:w},...C&&{disabled:C},...F&&{style:F},...T&&{className:T}}}catch{}let Me=o.buildLocation({...t,from:t.from}),je=Iie(Me.maskedLocation?Me.maskedLocation.publicHref:Me.publicHref,Me.maskedLocation?Me.maskedLocation.external:Me.external,o.history,C),mt=(()=>{if(je?.external){if(Xd(je.href,o.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${je.href}`);return}return je.href}if(!Le&&typeof d=="string"&&d.indexOf(":")>-1)try{if(new URL(d),Xd(d,o.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${d}`);return}return d}catch{}})(),ht=(()=>{if(mt)return!1;let Rt=o.stores.location.get(),ee=c?.exact??!1;if(ee){if(!IM(Rt.pathname,Me.pathname,o.basepath))return!1}else{let ce=Nh(Rt.pathname,o.basepath),Ee=Nh(Me.pathname,o.basepath);if(!(ce.startsWith(Ee)&&(ce.length===Ee.length||ce[Ee.length]==="/")))return!1}if((c?.includeSearch??!0)&&Rt.search!==Me.search){let ce=!Rt.search||typeof Rt.search=="object"&&!Ah(Rt.search),Ee=!Me.search||typeof Me.search=="object"&&!Ah(Me.search);if(!(ce&&Ee)&&!zu(Rt.search,Me.search,{partial:!ee,ignoreUndefined:!c?.explicitUndefined}))return!1}return!c?.includeHash})();if(mt)return{...Y,ref:r,href:mt,...S&&{children:S},...w&&{target:w},...C&&{disabled:C},...F&&{style:F},...T&&{className:T}};let yt=ht?ul(s,{})??vie:eb,Ft=ht?eb:ul(i,{})??eb,wt=(()=>{let Rt=F,ee=yt.style,ce=Ft.style;if(!(!Rt&&!ee&&!ce))return Rt&&!ee&&!ce?Rt:!Rt&&ee&&!ce?ee:!Rt&&!ee&&ce?ce:{...Rt,...ee,...ce}})(),jt=(()=>{let Rt=T,ee=yt.className,ce=Ft.className;if(!Rt&&!ee&&!ce)return"";let Ee="";return Rt&&(Ee=Rt),ee&&(Ee=Ee?`${Ee} ${ee}`:ee),ce&&(Ee=Ee?`${Ee} ${ce}`:ce),Ee})();return{...Y,...yt,...Ft,href:je?.href,ref:r,disabled:!!C,target:w,...wt&&{style:wt},...jt&&{className:jt},...C&&xie,...ht&&yie}}let Q=hH(),X=Ha.useMemo(()=>t,[o,t.from,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),te=Zn(o.stores.location,Le=>Le,(Le,Me)=>Le.href===Me.href),ae=Ha.useMemo(()=>{let Le={_fromLocation:te,...X};return o.buildLocation(Le)},[o,te,X]),se=ae.maskedLocation?ae.maskedLocation.publicHref:ae.publicHref,J=ae.maskedLocation?ae.maskedLocation.external:ae.external,ne=Ha.useMemo(()=>Iie(se,J,o.history,C),[C,J,se,o.history]),pe=Ha.useMemo(()=>{if(ne?.external){if(Xd(ne.href,o.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${ne.href}`);return}return ne.href}if(!bie(d)&&!(typeof d!="string"||d.indexOf(":")===-1))try{if(new URL(d),Xd(d,o.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${d}`);return}return d}catch{}},[d,ne,o.protocolAllowlist]),le=Ha.useMemo(()=>{if(pe)return!1;if(c?.exact){if(!IM(te.pathname,ae.pathname,o.basepath))return!1}else{let Le=Nh(te.pathname,o.basepath),Me=Nh(ae.pathname,o.basepath);if(!(Le.startsWith(Me)&&(Le.length===Me.length||Le[Me.length]==="/")))return!1}return(c?.includeSearch??!0)&&!zu(te.search,ae.search,{partial:!c?.exact,ignoreUndefined:!c?.explicitUndefined})?!1:c?.includeHash?Q&&te.hash===ae.hash:!0},[c?.exact,c?.explicitUndefined,c?.includeHash,c?.includeSearch,te,pe,Q,ae.hash,ae.pathname,ae.search,o.basepath]),ie=le?ul(s,{})??vie:eb,de=le?eb:ul(i,{})??eb,ue=[T,ie.className,de.className].filter(Boolean).join(" "),he=(F||ie.style||de.style)&&{...F,...ie.style,...de.style},[Re,Ae]=Ha.useState(!1),ye=Ha.useRef(!1),ge=t.reloadDocument||pe?!1:f??o.options.defaultPreload,Te=p??o.options.defaultPreloadDelay??0,ze=Ha.useCallback(()=>{o.preloadRoute({...X,_builtLocation:ae}).catch(Le=>{console.warn(Le),console.warn(fH)})},[o,X,ae]);use(r,Ha.useCallback(Le=>{Le?.isIntersecting&&ze()},[ze]),EBe,{disabled:!!C||ge!=="viewport"}),Ha.useEffect(()=>{ye.current||!C&&ge==="render"&&(ze(),ye.current=!0)},[C,ze,ge]);let Ze=n(Le=>{let Me=Le.currentTarget.getAttribute("target"),je=w!==void 0?w:Me;if(!C&&!ABe(Le)&&!Le.defaultPrevented&&(!je||je==="_self")&&Le.button===0){Le.preventDefault(),(0,Sie.flushSync)(()=>{Ae(!0)});let mt=o.subscribe("onResolved",()=>{mt(),Ae(!1)});o.navigate({...X,replace:v,resetScroll:y,hashScrollIntoView:h,startTransition:x,viewTransition:b,ignoreBlocker:U})}},"handleClick");if(pe)return{...Y,ref:r,href:pe,...S&&{children:S},...w&&{target:w},...C&&{disabled:C},...F&&{style:F},...T&&{className:T},...E&&{onClick:E},...k&&{onBlur:k},...P&&{onFocus:P},..._&&{onMouseEnter:_},...M&&{onMouseLeave:M},...L&&{onTouchStart:L}};let _e=n(Le=>{if(C||ge!=="intent")return;if(!Te){ze();return}let Me=Le.currentTarget;if(xF.has(Me))return;let je=setTimeout(()=>{xF.delete(Me),ze()},Te);xF.set(Me,je)},"enqueueIntentPreload"),Ie=n(Le=>{C||ge!=="intent"||ze()},"handleTouchStart"),ke=n(Le=>{if(C||!ge||!Te)return;let Me=Le.currentTarget,je=xF.get(Me);je&&(clearTimeout(je),xF.delete(Me))},"handleLeave");return{...Y,...ie,...de,href:ne?.href,ref:r,onClick:tb([E,Ze]),onBlur:tb([k,ke]),onFocus:tb([P,_e]),onMouseEnter:tb([_,_e]),onMouseLeave:tb([M,ke]),onTouchStart:tb([L,Ie]),disabled:!!C,target:w,...he&&{style:he},...ue&&{className:ue},...C&&xie,...le&&yie,...Q&&Re&&RBe}}n(FBe,"useLinkProps");var eb={},vie={className:"active"},xie={role:"link","aria-disabled":!0},yie={"data-status":"active","aria-current":"page"},RBe={"data-transitioning":"transitioning"},xF=new WeakMap,EBe={rootMargin:"100px"},tb=n(t=>e=>{for(let o of t)if(o){if(e.defaultPrevented)return;o(e)}},"composeHandlers");function Iie(t,e,o,r){if(!r)return e?{href:t,external:!0}:{href:o.createHref(t)||"/",external:!1}}n(Iie,"getHrefOption");function bie(t){if(typeof t!="string")return!1;let e=t.charCodeAt(0);return e===47?t.charCodeAt(1)!==47:e===46}n(bie,"isSafeInternal");var kH=Ha.forwardRef((t,e)=>{let{_asChild:o,...r}=t,{type:a,...s}=FBe(r,e),i=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!o){let{disabled:c,...d}=s;return Ha.createElement("a",d,i)}return Ha.createElement(o,s,i)});function ABe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}n(ABe,"isCtrlEvent");var MH=K(oe(),1),PH=K(zt(),1);var wie=class extends TM{static{n(this,"Route")}constructor(t){super(t),this.useMatch=e=>Xl({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>TH({...e,from:this.id}),this.useSearch=e=>Lh({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>EH({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>RH({...e,from:this.id}),this.useLoaderData=e=>FH({...e,from:this.id}),this.useNavigate=()=>zs({from:this.fullPath}),this.Link=MH.default.forwardRef((e,o)=>(0,PH.jsx)(kH,{ref:o,from:this.fullPath,...e}))}};function yF(t){return new wie(t)}n(yF,"createRoute");var Cie=class extends pH{static{n(this,"RootRoute")}constructor(t){super(t),this.useMatch=e=>Xl({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>TH({...e,from:this.id}),this.useSearch=e=>Lh({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>EH({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>RH({...e,from:this.id}),this.useLoaderData=e=>FH({...e,from:this.id}),this.useNavigate=()=>zs({from:this.fullPath}),this.Link=MH.default.forwardRef((e,o)=>(0,PH.jsx)(kH,{ref:o,from:this.fullPath,...e}))}};function OH(t){return new Cie(t)}n(OH,"createRootRoute");var w2t=K(oe(),1),LM=K(zt(),1);function Fie(t){let e=vn();if(!1){let r=`not-found-${e.stores.location.get().pathname}-${e.stores.status.get()}`;return(0,LM.jsx)(Fv,{getResetKey:n(()=>r,"getResetKey"),onCatch:n((a,s)=>{if($n(a))t.onCatch?.(a,s);else throw a},"onCatch"),errorComponent:n(({error:a})=>{if($n(a))return t.fallback?.(a);throw a},"errorComponent"),children:t.children})}let o=`not-found-${Zn(e.stores.location,r=>r.pathname)}-${Zn(e.stores.status,r=>r)}`;return(0,LM.jsx)(Fv,{getResetKey:n(()=>o,"getResetKey"),onCatch:n((r,a)=>{if($n(r))t.onCatch?.(r,a);else throw r},"onCatch"),errorComponent:n(({error:r})=>{if($n(r))return t.fallback?.(r);throw r},"errorComponent"),children:t.children})}n(Fie,"CatchNotFound");function Rie(){return(0,LM.jsx)("p",{children:"Not Found"})}n(Rie,"DefaultGlobalNotFound");var Eie=K(zt(),1);function Aie({children:t}){let e=vn();return null}n(Aie,"ScriptOnce");var k2t=K(oe(),1),BM=K(zt(),1);function Bh(t){return(0,BM.jsx)(BM.Fragment,{children:t.children})}n(Bh,"SafeFragment");var N2t=K(oe(),1),VM=K(zt(),1);function UM(t,e,o){return e.options.notFoundComponent?(0,VM.jsx)(e.options.notFoundComponent,{...o}):t.options.defaultNotFoundComponent?(0,VM.jsx)(t.options.defaultNotFoundComponent,{...o}):(e.options.notFoundComponent||console.warn(`Warning: A notFoundError was encountered on the route with ID "${e.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`),(0,VM.jsx)(Rie,{}))}n(UM,"renderRouteNotFound");var kie=K(zt(),1);function Tie(t){return null}n(Tie,"getScrollRestorationScriptForRouter");function Mie(){let t=Tie(vn());return t?(0,kie.jsx)(Aie,{children:t}):null}n(Mie,"ScrollRestoration");var Hs=K(oe(),1),xn=K(zt(),1);var TBe=n((t,e)=>t.routeId===e.routeId&&t._displayPending===e._displayPending,"matchViewFieldsEqual"),kBe=n((t,e)=>t[0]===e[0]&&t[1]===e[1],"outletMatchSelectionEqual"),zM=Hs.memo(n(function({matchId:e}){let o=vn();if(!1){let i=o.stores.matchStores.get(e)?.get();if(!i)throw new Error(`Invariant failed: Could not find match for matchId "${e}". Please file an issue!`);let c=i.routeId,d=o.routesById[c].parentRoute?.id;return(0,xn.jsx)(Pie,{router:o,matchId:e,resetKey:o.stores.loadedAt.get(),matchState:{routeId:c,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:d}})}let r=o.stores.matchStores.get(e);if(!r)throw new Error(`Invariant failed: Could not find match for matchId "${e}". Please file an issue!`);let a=Zn(o.stores.loadedAt,i=>i),s=Zn(r,i=>i,TBe);return(0,xn.jsx)(Pie,{router:o,matchId:e,resetKey:a,matchState:Hs.useMemo(()=>{let i=s.routeId,c=o.routesById[i].parentRoute?.id;return{routeId:i,ssr:s.ssr,_displayPending:s._displayPending,parentRouteId:c}},[s._displayPending,s.routeId,s.ssr,o.routesById])})},"MatchImpl"));function Pie({router:t,matchId:e,resetKey:o,matchState:r}){let a=t.routesById[r.routeId],s=a.options.pendingComponent??t.options.defaultPendingComponent,i=s?(0,xn.jsx)(s,{}):null,c=a.options.errorComponent??t.options.defaultErrorComponent,d=a.options.onCatch??t.options.defaultOnCatch,f=a.isRoot?a.options.notFoundComponent??t.options.notFoundRoute?.options.component:a.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",m=(!a.isRoot||a.options.wrapInSuspense||p)&&(a.options.wrapInSuspense??s??(a.options.errorComponent?.preload||p))?Hs.Suspense:Bh,h=c?Fv:Bh,v=f?Fie:Bh;return(0,xn.jsxs)(a.isRoot?a.options.shellComponent??Bh:Bh,{children:[(0,xn.jsx)(Ev.Provider,{value:e,children:(0,xn.jsx)(m,{fallback:i,children:(0,xn.jsx)(h,{getResetKey:n(()=>o,"getResetKey"),errorComponent:c||Rv,onCatch:n((x,y)=>{if($n(x))throw x.routeId??=r.routeId,x;console.warn(`Warning: Error in route match: ${e}`),d?.(x,y)},"onCatch"),children:(0,xn.jsx)(v,{fallback:n(x=>{if(x.routeId??=r.routeId,!f||x.routeId&&x.routeId!==r.routeId||!x.routeId&&!a.isRoot)throw x;return Hs.createElement(f,x)},"fallback"),children:p||r._displayPending?(0,xn.jsx)(tie,{fallback:i,children:(0,xn.jsx)(Oie,{matchId:e})}):(0,xn.jsx)(Oie,{matchId:e})})})})}),r.parentRouteId===dl?(0,xn.jsxs)(xn.Fragment,{children:[(0,xn.jsx)(MBe,{}),t.options.scrollRestoration&&!1?(0,xn.jsx)(Mie,{}):null]}):null]})}n(Pie,"MatchView");function MBe(){let t=vn();if(!1)return null;let e=Hs.useRef();return bv(()=>{let o=t.stores.resolvedLocation.get(),r=e.current;o&&(!r||r.href!==o.href)&&t.emit({type:"onRendered",...wp(t.stores.location.get(),r??o)}),e.current=o},[Zn(t.stores.resolvedLocation,o=>o?.state.__TSR_key),t]),null}n(MBe,"OnRendered");var Oie=Hs.memo(n(function({matchId:e}){let o=vn(),r=n((p,m)=>o.getMatch(p.id)?._nonReactive[m]??p._nonReactive[m],"getMatchPromise");if(!1){let p=o.stores.matchStores.get(e)?.get();if(!p)throw new Error(`Invariant failed: Could not find match for matchId "${e}". Please file an issue!`);let m=p.routeId,h=o.routesById[m],v=(o.routesById[m].options.remountDeps??o.options.defaultRemountDeps)?.({routeId:m,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch}),x=v?JSON.stringify(v):void 0,y=h.options.component??o.options.defaultComponent,b=y?(0,xn.jsx)(y,{},x):(0,xn.jsx)(IF,{});if(p._displayPending)throw r(p,"displayPendingPromise");if(p._forcePending)throw r(p,"minPendingPromise");if(p.status==="pending")throw r(p,"loadPromise");if(p.status==="notFound"){if(!$n(p.error))throw new Error("Invariant failed: Expected a notFound error");return UM(o,h,p.error)}if(p.status==="redirected")throw ns(p.error)?r(p,"loadPromise"):new Error("Invariant failed: Expected a redirect error");return p.status==="error"?(0,xn.jsx)((h.options.errorComponent??o.options.defaultErrorComponent)||Rv,{error:p.error,reset:void 0,info:{componentStack:""}}):b}let a=o.stores.matchStores.get(e);if(!a)throw new Error(`Invariant failed: Could not find match for matchId "${e}". Please file an issue!`);let s=Zn(a,p=>p),i=s.routeId,c=o.routesById[i],d=Hs.useMemo(()=>{let p=(o.routesById[i].options.remountDeps??o.options.defaultRemountDeps)?.({routeId:i,loaderDeps:s.loaderDeps,params:s._strictParams,search:s._strictSearch});return p?JSON.stringify(p):void 0},[i,s.loaderDeps,s._strictParams,s._strictSearch,o.options.defaultRemountDeps,o.routesById]),f=Hs.useMemo(()=>{let p=c.options.component??o.options.defaultComponent;return p?(0,xn.jsx)(p,{},d):(0,xn.jsx)(IF,{})},[d,c.options.component,o.options.defaultComponent]);if(s._displayPending)throw r(s,"displayPendingPromise");if(s._forcePending)throw r(s,"minPendingPromise");if(s.status==="pending"){let p=c.options.pendingMinMs??o.options.defaultPendingMinMs;if(p){let m=o.getMatch(s.id);if(m&&!m._nonReactive.minPendingPromise&&!!1){let h=Yd();m._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),m._nonReactive.minPendingPromise=void 0},p)}}throw r(s,"loadPromise")}if(s.status==="notFound"){if(!$n(s.error))throw new Error("Invariant failed: Expected a notFound error");return UM(o,c,s.error)}if(s.status==="redirected")throw ns(s.error)?r(s,"loadPromise"):new Error("Invariant failed: Expected a redirect error");if(s.status==="error"){if(!1)return(0,xn.jsx)((c.options.errorComponent??o.options.defaultErrorComponent)||Rv,{error:s.error,reset:void 0,info:{componentStack:""}});throw s.error}return f},"MatchInnerImpl")),IF=Hs.memo(n(function(){let e=vn(),o=Hs.useContext(Ev),r,a=!1,s;if(!1){let f=e.stores.matches.get(),p=o?f.findIndex(h=>h.id===o):-1,m=p>=0?f[p]:void 0;r=m?.routeId,a=m?.globalNotFound??!1,s=p>=0?f[p+1]?.id:void 0}else{let f=o?e.stores.matchStores.get(o):void 0;[r,a]=Zn(f,p=>[p?.routeId,p?.globalNotFound??!1],kBe),s=Zn(e.stores.matchesId,p=>p[p.findIndex(m=>m===o)+1])}let i=r?e.routesById[r]:void 0,c=e.options.defaultPendingComponent?(0,xn.jsx)(e.options.defaultPendingComponent,{}):null;if(a){if(!i)throw new Error("Invariant failed: Could not resolve route for Outlet render");return UM(e,i,void 0)}if(!s)return null;let d=(0,xn.jsx)(zM,{matchId:s});return r===dl?(0,xn.jsx)(Hs.Suspense,{fallback:c,children:d}):d},"OutletImpl"));var Vh=K(oe(),1);function Nie(){let t=vn(),e=Vh.useRef({router:t,mounted:!1}),[o,r]=Vh.useState(!1),a=Zn(t.stores.isLoading,m=>m),s=Zn(t.stores.hasPending,m=>m),i=hM(a),c=a||o||s,d=hM(c),f=a||s,p=hM(f);return t.startTransition=m=>{r(!0),Vh.startTransition(()=>{m(),r(!1)})},Vh.useEffect(()=>{let m=t.history.subscribe(t.load),h=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Yl(t.latestLocation.publicHref)!==Yl(h.publicHref)&&t.commitLocation({...h,replace:!0}),()=>{m()}},[t,t.history]),bv(()=>{if(typeof window<"u"&&t.ssr||e.current.router===t&&e.current.mounted)return;e.current={router:t,mounted:!0},n(async()=>{try{await t.load()}catch(h){console.error(h)}},"tryLoad")()},[t]),bv(()=>{i&&!a&&t.emit({type:"onLoad",...wp(t.stores.location.get(),t.stores.resolvedLocation.get())})},[i,t,a]),bv(()=>{p&&!f&&t.emit({type:"onBeforeRouteMount",...wp(t.stores.location.get(),t.stores.resolvedLocation.get())})},[f,p,t]),bv(()=>{if(d&&!c){let m=wp(t.stores.location.get(),t.stores.resolvedLocation.get());t.emit({type:"onResolved",...m}),gF(()=>{t.stores.status.set("idle"),t.stores.resolvedLocation.set(t.stores.location.get())})}},[c,d,t]),null}n(Nie,"Transitioner");var HM=K(oe(),1),Zd=K(zt(),1);function Die(){let t=vn(),e=t.routesById[dl].options.pendingComponent??t.options.defaultPendingComponent,o=e?(0,Zd.jsx)(e,{}):null,r=(0,Zd.jsxs)(typeof document<"u"&&t.ssr?Bh:HM.Suspense,{fallback:o,children:[!!1&&(0,Zd.jsx)(Nie,{}),(0,Zd.jsx)(PBe,{})]});return t.options.InnerWrap?(0,Zd.jsx)(t.options.InnerWrap,{children:r}):r}n(Die,"Matches");function PBe(){let t=vn(),e=!1,o=e?t.stores.firstId.get():Zn(t.stores.firstId,s=>s),r=e?t.stores.loadedAt.get():Zn(t.stores.loadedAt,s=>s),a=o?(0,Zd.jsx)(zM,{matchId:o}):null;return(0,Zd.jsx)(Ev.Provider,{value:o,children:t.options.disableGlobalCatchBoundary?a:(0,Zd.jsx)(Fv,{getResetKey:n(()=>r,"getResetKey"),errorComponent:Rv,onCatch:s=>{console.warn("Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!"),console.warn(`Warning: ${s.message||s.toString()}`)},children:a})})}n(PBe,"MatchesInner");var _ie=n(t=>({createMutableStore:DM,createReadonlyStore:DM,batch:gF}),"getStoreFactory");var NH=n(t=>new Lie(t),"createRouter"),Lie=class extends uH{static{n(this,"Router")}constructor(t){super(t,_ie)}};var MAt=K(oe(),1),bF=K(zt(),1);function Bie({router:t,children:e,...o}){Ah(o)&&t.update({...t.options,...o,context:{...t.options.context,...o.context}});let r=(0,bF.jsx)(MM.Provider,{value:t,children:e});return t.options.Wrap?(0,bF.jsx)(t.options.Wrap,{children:r}):r}n(Bie,"RouterContextProvider");function DH({router:t,...e}){return(0,bF.jsx)(Bie,{router:t,...e,children:(0,bF.jsx)(Die,{})})}n(DH,"RouterProvider");function _H(t){let e=vn({warn:t?.router===void 0}),o=t?.router||e;if(!1){let r=o.stores.__store.get();return t?.select?t.select(r):r}return Zn(o.stores.__store,CH(t,o))}n(_H,"useRouterState");var Dm=K(oe(),1),it=K(oe(),1);function Vie(t){var e,o,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(o=Vie(t[e]))&&(r&&(r+=" "),r+=o)}else for(o in t)t[o]&&(r&&(r+=" "),r+=o);return r}n(Vie,"r");function xo(){for(var t,e,o=0,r="",a=arguments.length;o<a;o++)(t=arguments[o])&&(e=Vie(t))&&(r&&(r+=" "),r+=e);return r}n(xo,"clsx");var OBe=n((t,e)=>{let o=new Array(t.length+e.length);for(let r=0;r<t.length;r++)o[r]=t[r];for(let r=0;r<e.length;r++)o[t.length+r]=e[r];return o},"concatArrays"),NBe=n((t,e)=>({classGroupId:t,validator:e}),"createClassValidatorObject"),Wie=n((t=new Map,e=null,o)=>({nextPart:t,validators:e,classGroupId:o}),"createClassPartObject"),qM="-",Uie=[],DBe="arbitrary..",_Be=n(t=>{let e=BBe(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:n(i=>{if(i.startsWith("[")&&i.endsWith("]"))return LBe(i);let c=i.split(qM),d=c[0]===""&&c.length>1?1:0;return Gie(c,d,e)},"getClassGroupId"),getConflictingClassGroupIds:n((i,c)=>{if(c){let d=r[i],f=o[i];return d?f?OBe(f,d):d:f||Uie}return o[i]||Uie},"getConflictingClassGroupIds")}},"createClassGroupUtils"),Gie=n((t,e,o)=>{if(t.length-e===0)return o.classGroupId;let a=t[e],s=o.nextPart.get(a);if(s){let f=Gie(t,e+1,s);if(f)return f}let i=o.validators;if(i===null)return;let c=e===0?t.join(qM):t.slice(e).join(qM),d=i.length;for(let f=0;f<d;f++){let p=i[f];if(p.validator(c))return p.classGroupId}},"getGroupRecursive"),LBe=n(t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let e=t.slice(1,-1),o=e.indexOf(":"),r=e.slice(0,o);return r?DBe+r:void 0})(),"getGroupIdForArbitraryProperty"),BBe=n(t=>{let{theme:e,classGroups:o}=t;return VBe(o,e)},"createClassMap"),VBe=n((t,e)=>{let o=Wie();for(let r in t){let a=t[r];VH(a,o,r,e)}return o},"processClassGroups"),VH=n((t,e,o,r)=>{let a=t.length;for(let s=0;s<a;s++){let i=t[s];UBe(i,e,o,r)}},"processClassesRecursively"),UBe=n((t,e,o,r)=>{if(typeof t=="string"){zBe(t,e,o);return}if(typeof t=="function"){HBe(t,e,o,r);return}$Be(t,e,o,r)},"processClassDefinition"),zBe=n((t,e,o)=>{let r=t===""?e:Kie(e,t);r.classGroupId=o},"processStringDefinition"),HBe=n((t,e,o,r)=>{if(jBe(t)){VH(t(r),e,o,r);return}e.validators===null&&(e.validators=[]),e.validators.push(NBe(o,t))},"processFunctionDefinition"),$Be=n((t,e,o,r)=>{let a=Object.entries(t),s=a.length;for(let i=0;i<s;i++){let[c,d]=a[i];VH(d,Kie(e,c),o,r)}},"processObjectDefinition"),Kie=n((t,e)=>{let o=t,r=e.split(qM),a=r.length;for(let s=0;s<a;s++){let i=r[s],c=o.nextPart.get(i);c||(c=Wie(),o.nextPart.set(i,c)),o=c}return o},"getPart"),jBe=n(t=>"isThemeGetter"in t&&t.isThemeGetter===!0,"isThemeGetter"),qBe=n(t=>{if(t<1)return{get:n(()=>{},"get"),set:n(()=>{},"set")};let e=0,o=Object.create(null),r=Object.create(null),a=n((s,i)=>{o[s]=i,e++,e>t&&(e=0,r=o,o=Object.create(null))},"update");return{get(s){let i=o[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return a(s,i),i},set(s,i){s in o?o[s]=i:a(s,i)}}},"createLruCache"),BH="!",zie=":",WBe=[],Hie=n((t,e,o,r,a)=>({modifiers:t,hasImportantModifier:e,baseClassName:o,maybePostfixModifierPosition:r,isExternal:a}),"createResultObject"),GBe=n(t=>{let{prefix:e,experimentalParseClassName:o}=t,r=n(a=>{let s=[],i=0,c=0,d=0,f,p=a.length;for(let y=0;y<p;y++){let b=a[y];if(i===0&&c===0){if(b===zie){s.push(a.slice(d,y)),d=y+1;continue}if(b==="/"){f=y;continue}}b==="["?i++:b==="]"?i--:b==="("?c++:b===")"&&c--}let m=s.length===0?a:a.slice(d),h=m,v=!1;m.endsWith(BH)?(h=m.slice(0,-1),v=!0):m.startsWith(BH)&&(h=m.slice(1),v=!0);let x=f&&f>d?f-d:void 0;return Hie(s,v,h,x)},"parseClassName");if(e){let a=e+zie,s=r;r=n(i=>i.startsWith(a)?s(i.slice(a.length)):Hie(WBe,!1,i,void 0,!0),"parseClassName")}if(o){let a=r;r=n(s=>o({className:s,parseClassName:a}),"parseClassName")}return r},"createParseClassName"),KBe=n(t=>{let e=new Map;return t.orderSensitiveModifiers.forEach((o,r)=>{e.set(o,1e6+r)}),o=>{let r=[],a=[];for(let s=0;s<o.length;s++){let i=o[s],c=i[0]==="[",d=e.has(i);c||d?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(i)):a.push(i)}return a.length>0&&(a.sort(),r.push(...a)),r}},"createSortModifiers"),YBe=n(t=>({cache:qBe(t.cacheSize),parseClassName:GBe(t),sortModifiers:KBe(t),postfixLookupClassGroupIds:XBe(t),..._Be(t)}),"createConfigUtils"),XBe=n(t=>{let e=Object.create(null),o=t.postfixLookupClassGroups;if(o)for(let r=0;r<o.length;r++)e[o[r]]=!0;return e},"createPostfixLookupClassGroupIds"),QBe=/\s+/,ZBe=n((t,e)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s,postfixLookupClassGroupIds:i}=e,c=[],d=t.trim().split(QBe),f="";for(let p=d.length-1;p>=0;p-=1){let m=d[p],{isExternal:h,modifiers:v,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:b}=o(m);if(h){f=m+(f.length>0?" "+f:f);continue}let S=!!b,w;if(S){let k=y.substring(0,b);w=r(k);let P=w&&i[w]?r(y):void 0;P&&P!==w&&(w=P,S=!1)}else w=r(y);if(!w){if(!S){f=m+(f.length>0?" "+f:f);continue}if(w=r(y),!w){f=m+(f.length>0?" "+f:f);continue}S=!1}let C=v.length===0?"":v.length===1?v[0]:s(v).join(":"),F=x?C+BH:C,T=F+w;if(c.indexOf(T)>-1)continue;c.push(T);let E=a(w,S);for(let k=0;k<E.length;++k){let P=E[k];c.push(F+P)}f=m+(f.length>0?" "+f:f)}return f},"mergeClassList"),JBe=n((...t)=>{let e=0,o,r,a="";for(;e<t.length;)(o=t[e++])&&(r=Yie(o))&&(a&&(a+=" "),a+=r);return a},"twJoin"),Yie=n(t=>{if(typeof t=="string")return t;let e,o="";for(let r=0;r<t.length;r++)t[r]&&(e=Yie(t[r]))&&(o&&(o+=" "),o+=e);return o},"toValue"),e4e=n((t,...e)=>{let o,r,a,s,i=n(d=>{let f=e.reduce((p,m)=>m(p),t());return o=YBe(f),r=o.cache.get,a=o.cache.set,s=c,c(d)},"initTailwindMerge"),c=n(d=>{let f=r(d);if(f)return f;let p=ZBe(d,o);return a(d,p),p},"tailwindMerge");return s=i,(...d)=>s(JBe(...d))},"createTailwindMerge"),t4e=[],as=n(t=>{let e=n(o=>o[t]||t4e,"themeGetter");return e.isThemeGetter=!0,e},"fromTheme"),Xie=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qie=/^\((?:(\w[\w-]*):)?(.+)\)$/i,o4e=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,r4e=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,n4e=/\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$/,a4e=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,s4e=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,i4e=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Uh=n(t=>o4e.test(t),"isFraction"),lr=n(t=>!!t&&!Number.isNaN(Number(t)),"isNumber"),Jd=n(t=>!!t&&Number.isInteger(Number(t)),"isInteger"),LH=n(t=>t.endsWith("%")&&lr(t.slice(0,-1)),"isPercent"),Cp=n(t=>r4e.test(t),"isTshirtSize"),Zie=n(()=>!0,"isAny"),l4e=n(t=>n4e.test(t)&&!a4e.test(t),"isLengthOnly"),UH=n(()=>!1,"isNever"),c4e=n(t=>s4e.test(t),"isShadow"),u4e=n(t=>i4e.test(t),"isImage"),d4e=n(t=>!Gt(t)&&!Kt(t),"isAnyNonArbitrary"),f4e=n(t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),"isNamedContainerQuery"),p4e=n(t=>zh(t,tle,UH),"isArbitrarySize"),Gt=n(t=>Xie.test(t),"isArbitraryValue"),Av=n(t=>zh(t,ole,l4e),"isArbitraryLength"),$ie=n(t=>zh(t,b4e,lr),"isArbitraryNumber"),m4e=n(t=>zh(t,nle,Zie),"isArbitraryWeight"),h4e=n(t=>zh(t,rle,UH),"isArbitraryFamilyName"),jie=n(t=>zh(t,Jie,UH),"isArbitraryPosition"),g4e=n(t=>zh(t,ele,u4e),"isArbitraryImage"),$M=n(t=>zh(t,ale,c4e),"isArbitraryShadow"),Kt=n(t=>Qie.test(t),"isArbitraryVariable"),SF=n(t=>Tv(t,ole),"isArbitraryVariableLength"),v4e=n(t=>Tv(t,rle),"isArbitraryVariableFamilyName"),qie=n(t=>Tv(t,Jie),"isArbitraryVariablePosition"),x4e=n(t=>Tv(t,tle),"isArbitraryVariableSize"),y4e=n(t=>Tv(t,ele),"isArbitraryVariableImage"),jM=n(t=>Tv(t,ale,!0),"isArbitraryVariableShadow"),I4e=n(t=>Tv(t,nle,!0),"isArbitraryVariableWeight"),zh=n((t,e,o)=>{let r=Xie.exec(t);return r?r[1]?e(r[1]):o(r[2]):!1},"getIsArbitraryValue"),Tv=n((t,e,o=!1)=>{let r=Qie.exec(t);return r?r[1]?e(r[1]):o:!1},"getIsArbitraryVariable"),Jie=n(t=>t==="position"||t==="percentage","isLabelPosition"),ele=n(t=>t==="image"||t==="url","isLabelImage"),tle=n(t=>t==="length"||t==="size"||t==="bg-size","isLabelSize"),ole=n(t=>t==="length","isLabelLength"),b4e=n(t=>t==="number","isLabelNumber"),rle=n(t=>t==="family-name","isLabelFamilyName"),nle=n(t=>t==="number"||t==="weight","isLabelWeight"),ale=n(t=>t==="shadow","isLabelShadow");var S4e=n(()=>{let t=as("color"),e=as("font"),o=as("text"),r=as("font-weight"),a=as("tracking"),s=as("leading"),i=as("breakpoint"),c=as("container"),d=as("spacing"),f=as("radius"),p=as("shadow"),m=as("inset-shadow"),h=as("text-shadow"),v=as("drop-shadow"),x=as("blur"),y=as("perspective"),b=as("aspect"),S=as("ease"),w=as("animate"),C=n(()=>["auto","avoid","all","avoid-page","page","left","right","column"],"scaleBreak"),F=n(()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],"scalePosition"),T=n(()=>[...F(),Kt,Gt],"scalePositionWithArbitrary"),E=n(()=>["auto","hidden","clip","visible","scroll"],"scaleOverflow"),k=n(()=>["auto","contain","none"],"scaleOverscroll"),P=n(()=>[Kt,Gt,d],"scaleUnambiguousSpacing"),_=n(()=>[Uh,"full","auto",...P()],"scaleInset"),M=n(()=>[Jd,"none","subgrid",Kt,Gt],"scaleGridTemplateColsRows"),L=n(()=>["auto",{span:["full",Jd,Kt,Gt]},Jd,Kt,Gt],"scaleGridColRowStartAndEnd"),U=n(()=>[Jd,"auto",Kt,Gt],"scaleGridColRowStartOrEnd"),W=n(()=>["auto","min","max","fr",Kt,Gt],"scaleGridAutoColsRows"),V=n(()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],"scaleAlignPrimaryAxis"),j=n(()=>["start","end","center","stretch","center-safe","end-safe"],"scaleAlignSecondaryAxis"),N=n(()=>["auto",...P()],"scaleMargin"),D=n(()=>[Uh,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],"scaleSizing"),B=n(()=>[Uh,"screen","full","dvw","lvw","svw","min","max","fit",...P()],"scaleSizingInline"),z=n(()=>[Uh,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],"scaleSizingBlock"),q=n(()=>[t,Kt,Gt],"scaleColor"),H=n(()=>[...F(),qie,jie,{position:[Kt,Gt]}],"scaleBgPosition"),Y=n(()=>["no-repeat",{repeat:["","x","y","space","round"]}],"scaleBgRepeat"),Q=n(()=>["auto","cover","contain",x4e,p4e,{size:[Kt,Gt]}],"scaleBgSize"),X=n(()=>[LH,SF,Av],"scaleGradientStopPosition"),te=n(()=>["","none","full",f,Kt,Gt],"scaleRadius"),ae=n(()=>["",lr,SF,Av],"scaleBorderWidth"),se=n(()=>["solid","dashed","dotted","double"],"scaleLineStyle"),J=n(()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],"scaleBlendMode"),ne=n(()=>[lr,LH,qie,jie],"scaleMaskImagePosition"),pe=n(()=>["","none",x,Kt,Gt],"scaleBlur"),le=n(()=>["none",lr,Kt,Gt],"scaleRotate"),ie=n(()=>["none",lr,Kt,Gt],"scaleScale"),de=n(()=>[lr,Kt,Gt],"scaleSkew"),ue=n(()=>[Uh,"full",...P()],"scaleTranslate");return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Cp],breakpoint:[Cp],color:[Zie],container:[Cp],"drop-shadow":[Cp],ease:["in","out","in-out"],font:[d4e],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Cp],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Cp],shadow:[Cp],spacing:["px",lr],text:[Cp],"text-shadow":[Cp],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Uh,Gt,Kt,b]}],container:["container"],"container-type":[{"@container":["","normal","size",Kt,Gt]}],"container-named":[f4e],columns:[{columns:[lr,Gt,Kt,c]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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"],sr:["sr-only","not-sr-only"],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()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:_()}],"inset-x":[{"inset-x":_()}],"inset-y":[{"inset-y":_()}],start:[{"inset-s":_(),start:_()}],end:[{"inset-e":_(),end:_()}],"inset-bs":[{"inset-bs":_()}],"inset-be":[{"inset-be":_()}],top:[{top:_()}],right:[{right:_()}],bottom:[{bottom:_()}],left:[{left:_()}],visibility:["visible","invisible","collapse"],z:[{z:[Jd,"auto",Kt,Gt]}],basis:[{basis:[Uh,"full","auto",c,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[lr,Uh,"auto","initial","none",Gt]}],grow:[{grow:["",lr,Kt,Gt]}],shrink:[{shrink:["",lr,Kt,Gt]}],order:[{order:[Jd,"first","last","none",Kt,Gt]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...j(),"normal"]}],"justify-self":[{"justify-self":["auto",...j()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...j(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...j(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...j(),"baseline"]}],"place-self":[{"place-self":["auto",...j()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mbs:[{mbs:N()}],mbe:[{mbe:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...z()]}],"min-block-size":[{"min-block":["auto",...z()]}],"max-block-size":[{"max-block":["none",...z()]}],w:[{w:[c,"screen",...D()]}],"min-w":[{"min-w":[c,"screen","none",...D()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[i]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh",...D()]}],"font-size":[{text:["base",o,SF,Av]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,I4e,m4e]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",LH,Gt]}],"font-family":[{font:[v4e,h4e,e]}],"font-features":[{"font-features":[Gt]}],"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:[a,Kt,Gt]}],"line-clamp":[{"line-clamp":[lr,"none",Kt,$ie]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",Kt,Gt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Kt,Gt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[lr,"from-font","auto",Kt,Av]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[lr,"auto",Kt,Gt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"tab-size":[{tab:[Jd,Kt,Gt]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Kt,Gt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Kt,Gt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:Q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Jd,Kt,Gt],radial:["",Kt,Gt],conic:[Jd,Kt,Gt]},y4e,g4e]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:te()}],"rounded-s":[{"rounded-s":te()}],"rounded-e":[{"rounded-e":te()}],"rounded-t":[{"rounded-t":te()}],"rounded-r":[{"rounded-r":te()}],"rounded-b":[{"rounded-b":te()}],"rounded-l":[{"rounded-l":te()}],"rounded-ss":[{"rounded-ss":te()}],"rounded-se":[{"rounded-se":te()}],"rounded-ee":[{"rounded-ee":te()}],"rounded-es":[{"rounded-es":te()}],"rounded-tl":[{"rounded-tl":te()}],"rounded-tr":[{"rounded-tr":te()}],"rounded-br":[{"rounded-br":te()}],"rounded-bl":[{"rounded-bl":te()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-bs":[{"border-bs":q()}],"border-color-be":[{"border-be":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[lr,Kt,Gt]}],"outline-w":[{outline:["",lr,SF,Av]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","none",p,jM,$M]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",m,jM,$M]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[lr,Av]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",h,jM,$M]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[lr,Kt,Gt]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[lr]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[Kt,Gt]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":F()}],"mask-image-conic-pos":[{"mask-conic":[lr]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:Q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Kt,Gt]}],filter:[{filter:["","none",Kt,Gt]}],blur:[{blur:pe()}],brightness:[{brightness:[lr,Kt,Gt]}],contrast:[{contrast:[lr,Kt,Gt]}],"drop-shadow":[{"drop-shadow":["","none",v,jM,$M]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",lr,Kt,Gt]}],"hue-rotate":[{"hue-rotate":[lr,Kt,Gt]}],invert:[{invert:["",lr,Kt,Gt]}],saturate:[{saturate:[lr,Kt,Gt]}],sepia:[{sepia:["",lr,Kt,Gt]}],"backdrop-filter":[{"backdrop-filter":["","none",Kt,Gt]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[lr,Kt,Gt]}],"backdrop-contrast":[{"backdrop-contrast":[lr,Kt,Gt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",lr,Kt,Gt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lr,Kt,Gt]}],"backdrop-invert":[{"backdrop-invert":["",lr,Kt,Gt]}],"backdrop-opacity":[{"backdrop-opacity":[lr,Kt,Gt]}],"backdrop-saturate":[{"backdrop-saturate":[lr,Kt,Gt]}],"backdrop-sepia":[{"backdrop-sepia":["",lr,Kt,Gt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Kt,Gt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[lr,"initial",Kt,Gt]}],ease:[{ease:["linear","initial",S,Kt,Gt]}],delay:[{delay:[lr,Kt,Gt]}],animate:[{animate:["none",w,Kt,Gt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Kt,Gt]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[Kt,Gt,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],zoom:[{zoom:[Jd,Kt,Gt]}],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",Kt,Gt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":q()}],"scrollbar-track-color":[{"scrollbar-track":q()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",Kt,Gt]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[lr,SF,Av,$ie]}],stroke:[{stroke:["none",...q()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},"getDefaultConfig");var sle=e4e(S4e);function tt(...t){return sle(xo(t))}n(tt,"cn");var O=K(po(),1);var hle=K(fle(),1);var ef=class extends Error{static{n(this,"DateFormatError")}constructor(e,o,r){super(e),this.token=o,this.type=r||"error"}},ple=n(t=>t<4?"short":t===4?"long":"narrow","alpha"),CF=n(t=>t%2===0?"2-digit":"numeric","numeric");function A4e(t,e){switch(t.char){case"y":return{year:CF(t.width)};case"r":return{calendar:"gregory",year:"numeric"};default:return e(`${t.desc} is not supported; falling back to year:numeric`,ef.WARNING),{year:"numeric"}}}n(A4e,"yearOptions");function T4e(t,e){switch(t.width){case 1:return"numeric";case 2:return"2-digit";case 3:return"short";case 4:return"long";case 5:return"narrow";default:e(`${t.desc} is not supported with width ${t.width}`);return}}n(T4e,"monthStyle");function k4e(t,e){let{char:o,desc:r,width:a}=t;if(o==="d")return CF(a);e(`${r} is not supported`)}n(k4e,"dayStyle");function M4e(t,e){let{char:o,desc:r,width:a}=t;if((o==="c"||o==="e")&&a<3){let s=`Numeric value is not supported for ${r}; falling back to weekday:short`;e(s,ef.WARNING)}return ple(a)}n(M4e,"weekdayStyle");function P4e(t){let e=CF(t.width),o;switch(t.char){case"h":o="h12";break;case"H":o="h23";break;case"k":o="h24";break;case"K":o="h11";break}return o?{hour:e,hourCycle:o}:{hour:e}}n(P4e,"hourOptions");function O4e(t,e){let{char:o,desc:r,width:a}=t;switch(o){case"v":case"z":return a===4?"long":"short";case"V":if(a===4)return"long";e(`${r} is not supported with width ${a}`);return;case"X":e(`${r} is not supported`);return}return"short"}n(O4e,"timeZoneNameStyle");function N4e(t,e){switch(t.field){case"era":return{era:ple(t.width)};case"year":return A4e(t,e);case"month":return{month:T4e(t,e)};case"day":return{day:k4e(t,e)};case"weekday":return{weekday:M4e(t,e)};case"period":return;case"hour":return P4e(t);case"min":return{minute:CF(t.width)};case"sec":return{second:CF(t.width)};case"tz":return{timeZoneName:O4e(t,e)};case"quarter":case"week":case"sec-frac":case"ms":e(`${t.desc} is not supported`)}}n(N4e,"compileOptions");function $H(t,e,o=r=>{throw r}){let r={timeZone:e},a=[];for(let s of t){let{error:i,field:c,str:d}=s;if(i){let p=new ef(i.message,s);p.stack=i.stack,o(p)}if(d){let p=`Ignoring string part: ${d}`;o(new ef(p,s,ef.WARNING))}c&&(a.indexOf(c)===-1?a.push(c):o(new ef(`Duplicate ${c} token`,s)));let f=N4e(s,(p,m)=>o(new ef(p,s,m)));f&&Object.assign(r,f)}return r}n($H,"getDateFormatOptions");var D4e={G:{field:"era",desc:"Era"},y:{field:"year",desc:"Year"},Y:{field:"year",desc:'Year of "Week of Year"'},u:{field:"year",desc:"Extended year"},U:{field:"year",desc:"Cyclic year name"},r:{field:"year",desc:"Related Gregorian year"},Q:{field:"quarter",desc:"Quarter"},q:{field:"quarter",desc:"Stand-alone quarter"},M:{field:"month",desc:"Month in year"},L:{field:"month",desc:"Stand-alone month in year"},w:{field:"week",desc:"Week of year"},W:{field:"week",desc:"Week of month"},d:{field:"day",desc:"Day in month"},D:{field:"day",desc:"Day of year"},F:{field:"day",desc:"Day of week in month"},g:{field:"day",desc:"Modified julian day"},E:{field:"weekday",desc:"Day of week"},e:{field:"weekday",desc:"Local day of week"},c:{field:"weekday",desc:"Stand-alone local day of week"},a:{field:"period",desc:"AM/PM marker"},b:{field:"period",desc:"AM/PM/noon/midnight marker"},B:{field:"period",desc:"Flexible day period"},h:{field:"hour",desc:"Hour in AM/PM (1~12)"},H:{field:"hour",desc:"Hour in day (0~23)"},k:{field:"hour",desc:"Hour in day (1~24)"},K:{field:"hour",desc:"Hour in AM/PM (0~11)"},j:{field:"hour",desc:"Hour in preferred cycle"},J:{field:"hour",desc:"Hour in preferred cycle without marker"},C:{field:"hour",desc:"Hour in preferred cycle with flexible marker"},m:{field:"min",desc:"Minute in hour"},s:{field:"sec",desc:"Second in minute"},S:{field:"sec-frac",desc:"Fractional second"},A:{field:"ms",desc:"Milliseconds in day"},z:{field:"tz",desc:"Time Zone: specific non-location"},Z:{field:"tz",desc:"Time Zone"},O:{field:"tz",desc:"Time Zone: localized"},v:{field:"tz",desc:"Time Zone: generic non-location"},V:{field:"tz",desc:"Time Zone: ID"},X:{field:"tz",desc:"Time Zone: ISO8601 with Z"},x:{field:"tz",desc:"Time Zone: ISO8601"}},mle=n(t=>t>="A"&&t<="Z"||t>="a"&&t<="z","isLetter");function _4e(t,e){let o=t[e],r=1;for(;t[++e]===o;)++r;let a=D4e[o];if(!a){let s=`The letter ${o} is not a valid field identifier`;return{char:o,error:new Error(s),width:r}}return{char:o,field:a.field,desc:a.desc,width:r}}n(_4e,"readFieldToken");function L4e(t,e){let o=t[++e],r=2;if(o==="'")return{char:"'",str:o,width:r};for(;;){let a=t[++e];if(++r,a===void 0){let s=`Unterminated quoted literal in pattern: ${o||t}`;return{char:"'",error:new Error(s),str:o,width:r}}else if(a==="'"){if(t[++e]!=="'")return{char:"'",str:o,width:r};++r}o+=a}}n(L4e,"readQuotedToken");function B4e(t,e){let o=t[e];if(!o)return null;if(mle(o))return _4e(t,e);if(o==="'")return L4e(t,e);let r=o,a=1;for(;;){let s=t[++e];if(!s||mle(s)||s==="'")return{char:o,str:r,width:a};r+=s,a+=1}}n(B4e,"readToken");function KM(t){let e=[],o=0;for(;;){let r=B4e(t,o);if(!r)return e;e.push(r),o+=r.width}}n(KM,"parseDateTokens");function gle(t,e){return t.filter(o=>o.type!=="content").length?t.map(o=>{if(o.type==="content")return e(o.value);if(o.type==="octothorpe")return"#";if(o.type==="argument")return[o.arg];if(o.type==="function"){let s=o?.param?.[0];if(o.key==="date"&&s){let i=V4e(s.value.trim(),c=>{throw new Error(`Unable to compile date expression: ${c.message}`)});return[o.arg,o.key,i]}return s?[o.arg,o.key,s.value.trim()]:[o.arg,o.key]}let r=o.pluralOffset,a={};return o.cases.forEach(({key:s,tokens:i})=>{let c=s[0]==="="?s.slice(1):s;a[c]=gle(i,e)}),[o.arg,o.type,{offset:r,...a}]}):t.map(o=>e(o.value))}n(gle,"processTokens");function V4e(t,e){if(/^::/.test(t)){let o=KM(t.substring(2));return $H(o,void 0,e)}return t}n(V4e,"compileDateExpression");function U4e(t,e=o=>o){return gle((0,hle.parse)(t),e)}n(U4e,"compileMessageOrThrow");function YM(t,e=o=>o){try{return U4e(t,e)}catch(o){return console.error(`${o.message}
251
+ `)},E.prototype.clone=function(){return new E(this.states,this.state)},E.prototype.has=function(M){return!0},{compile:w,states:F,error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:T}})});var cle=Ct(Fp=>{"use strict";var w4e=Fp&&Fp.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fp,"__esModule",{value:!0});Fp.lexer=Fp.states=void 0;var C4e=w4e(lle());Fp.states={body:{doubleapos:{match:"''",value:n(()=>"'","value")},quoted:{lineBreaks:!0,match:/'[{}#](?:[^']|'')*'(?!')/u,value:n(t=>t.slice(1,-1).replace(/''/g,"'"),"value")},argument:{lineBreaks:!0,match:/\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,push:"arg",value:n(t=>t.substring(1).trim(),"value")},octothorpe:"#",end:{match:"}",pop:1},content:{lineBreaks:!0,match:/[^][^{}#']*/u}},arg:{select:{lineBreaks:!0,match:/,\s*(?:plural|select|selectordinal)\s*,\s*/u,next:"select",value:n(t=>t.split(",")[1].trim(),"value")},"func-args":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,next:"body",value:n(t=>t.split(",")[1].trim(),"value")},"func-simple":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,value:n(t=>t.substring(1).trim(),"value")},end:{match:"}",pop:1}},select:{offset:{lineBreaks:!0,match:/\s*offset\s*:\s*\d+\s*/u,value:n(t=>t.split(":")[1].trim(),"value")},case:{lineBreaks:!0,match:/\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,push:"body",value:n(t=>t.substring(0,t.indexOf("{")).trim(),"value")},end:{match:/\s*\}/u,pop:1}}};Fp.lexer=C4e.default.states(Fp.states)});var fle=Ct(wF=>{"use strict";Object.defineProperty(wF,"__esModule",{value:!0});wF.ParseError=void 0;wF.parse=E4e;var dle=cle(),GM=n(t=>({offset:t.offset,line:t.line,col:t.col,text:t.text,lineBreaks:t.lineBreaks}),"getContext"),zH=n(t=>t==="plural"||t==="select"||t==="selectordinal","isSelectType");function F4e(t,e){let o="",r="";for(let s of e){let i=s.ctx.text;switch(r+=i,s.type){case"content":o+=s.value;break;case"argument":case"function":case"octothorpe":o+=i;break;default:throw new $a(t,`Unsupported part in strict mode function arg style: ${i}`)}}return[{type:"content",value:o.trim(),ctx:Object.assign({},e[0].ctx,{text:r})}]}n(F4e,"strictArgStyleParam");var R4e=["number","date","time","spellout","ordinal","duration"],ule=["zero","one","two","few","many","other"],$a=class extends Error{static{n(this,"ParseError")}constructor(e,o){super(dle.lexer.formatError(e,o))}};wF.ParseError=$a;var HH=class{static{n(this,"Parser")}constructor(e,o){var r,a,s,i;this.lexer=dle.lexer.reset(e),this.cardinalKeys=(r=o?.cardinal)!==null&&r!==void 0?r:ule,this.ordinalKeys=(a=o?.ordinal)!==null&&a!==void 0?a:ule,this.strict=(s=o?.strict)!==null&&s!==void 0?s:!1,this.strictPluralKeys=(i=o?.strictPluralKeys)!==null&&i!==void 0?i:!0}parse(){return this.parseBody(!1,!0)}checkSelectKey(e,o,r){if(r[0]==="="){if(o==="select")throw new $a(e,`The case ${r} is not valid with select`)}else if(o!=="select"){let a=o==="plural"?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&a.length>0&&!a.includes(r)){let s=`The ${o} case ${r} is not valid in this locale`;throw new $a(e,s)}}}parseSelect({value:e},o,r,a){let s={type:a,arg:e,cases:[],ctx:r};a==="plural"||a==="selectordinal"?o=!0:this.strict&&(o=!1);for(let i of this.lexer)switch(i.type){case"offset":if(a==="select")throw new $a(i,"Unexpected plural offset for select");if(s.cases.length>0)throw new $a(i,"Plural offset must be set before cases");s.pluralOffset=Number(i.value),r.text+=i.text,r.lineBreaks+=i.lineBreaks;break;case"case":{this.checkSelectKey(i,a,i.value),s.cases.push({key:i.value,tokens:this.parseBody(o),ctx:GM(i)});break}case"end":return s;default:throw new $a(i,`Unexpected lexer token: ${i.type}`)}throw new $a(null,"Unexpected message end")}parseArgToken(e,o){let r=GM(e),a=this.lexer.next();if(!a)throw new $a(null,"Unexpected message end");if(r.text+=a.text,r.lineBreaks+=a.lineBreaks,this.strict&&(a.type==="func-simple"||a.type==="func-args")&&!R4e.includes(a.value)){let s=`Invalid strict mode function arg type: ${a.value}`;throw new $a(e,s)}switch(a.type){case"end":return{type:"argument",arg:e.value,ctx:r};case"func-simple":{let s=this.lexer.next();if(!s)throw new $a(null,"Unexpected message end");if(s.type!=="end")throw new $a(s,`Unexpected lexer token: ${s.type}`);if(r.text+=s.text,zH(a.value.toLowerCase()))throw new $a(a,`Invalid type identifier: ${a.value}`);return{type:"function",arg:e.value,key:a.value,ctx:r}}case"func-args":{if(zH(a.value.toLowerCase())){let i=`Invalid type identifier: ${a.value}`;throw new $a(a,i)}let s=this.parseBody(this.strict?!1:o);return this.strict&&s.length>0&&(s=F4e(e,s)),{type:"function",arg:e.value,key:a.value,param:s,ctx:r}}case"select":if(zH(a.value))return this.parseSelect(e,o,r,a.value);throw new $a(a,`Unexpected select type ${a.value}`);default:throw new $a(a,`Unexpected lexer token: ${a.type}`)}}parseBody(e,o){let r=[],a=null;for(let s of this.lexer)if(s.type==="argument")a&&(a=null),r.push(this.parseArgToken(s,e));else if(s.type==="octothorpe"&&e)a&&(a=null),r.push({type:"octothorpe",ctx:GM(s)});else{if(s.type==="end"&&!o)return r;{let i=s.value;if(!e&&s.type==="quoted"&&i[0]==="#"){if(i.includes("{")){let c=`Unsupported escape pattern: ${i}`;throw new $a(s,c)}i=s.text}a?(a.value+=i,a.ctx.text+=s.text,a.ctx.lineBreaks+=s.lineBreaks):(a={type:"content",value:i,ctx:GM(s)},r.push(a))}}if(o)return r;throw new $a(null,"Unexpected message end")}};function E4e(t,e={}){return new HH(t,e).parse()}n(E4e,"parse")});var Wve=Ct(qve=>{function Qqe(t){return t==="__proto__"}n(Qqe,"isUnsafeProperty");qve.isUnsafeProperty=Qqe});var Mq=Ct(Gve=>{function Zqe(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}n(Zqe,"isDeepKey");Gve.isDeepKey=Zqe});var X_=Ct(Kve=>{function Jqe(t){return typeof t=="string"||typeof t=="symbol"?t:Object.is(t?.valueOf?.(),-0)?"-0":String(t)}n(Jqe,"toKey");Kve.toKey=Jqe});var Qve=Ct(Xve=>{function Yve(t){if(t==null)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(Yve).join(",");let e=String(t);return e==="0"&&Object.is(Number(t),-0)?"-0":e}n(Yve,"toString");Xve.toString=Yve});var Q_=Ct(Zve=>{var eWe=X_(),tWe=Qve();function oWe(t){if(Array.isArray(t))return t.map(eWe.toKey);if(typeof t=="symbol")return[t];t=tWe.toString(t);let e=[],o=t.length;if(o===0)return e;let r=0,a="",s="",i=!1;for(t.charCodeAt(0)===46&&(e.push(""),r++);r<o;){let c=t[r];s?c==="\\"&&r+1<o?(r++,a+=t[r]):c===s?s="":a+=c:i?c==='"'||c==="'"?s=c:c==="]"?(i=!1,e.push(a),a=""):a+=c:c==="["?(i=!0,a&&(e.push(a),a="")):c==="."?a&&(e.push(a),a=""):a+=c,r++}return a&&e.push(a),e}n(oWe,"toPath");Zve.toPath=oWe});var Z_=Ct(exe=>{var Pq=Wve(),rWe=Mq(),nWe=X_(),aWe=Q_();function Jve(t,e,o){if(t==null)return o;switch(typeof e){case"string":{if(Pq.isUnsafeProperty(e))return o;let r=t[e];return r===void 0?rWe.isDeepKey(e)?Jve(t,aWe.toPath(e),o):o:r}case"number":case"symbol":{typeof e=="number"&&(e=nWe.toKey(e));let r=t[e];return r===void 0?o:r}default:{if(Array.isArray(e))return sWe(t,e,o);if(Object.is(e?.valueOf(),-0)?e="-0":e=String(e),Pq.isUnsafeProperty(e))return o;let r=t[e];return r===void 0?o:r}}}n(Jve,"get");function sWe(t,e,o){if(e.length===0)return o;let r=t;for(let a=0;a<e.length;a++){if(r==null||Pq.isUnsafeProperty(e[a]))return o;r=r[e[a]]}return r===void 0?o:r}n(sWe,"getWithPath");exe.get=Jve});var kE=Ct((hFo,txe)=>{txe.exports=Z_().get});var sxe=Ct(axe=>{function mWe(t,e){let o=new Map;for(let r=0;r<t.length;r++){let a=t[r],s=e(a,r,t);o.has(s)||o.set(s,a)}return Array.from(o.values())}n(mWe,"uniqBy");axe.uniqBy=mWe});var lxe=Ct(ixe=>{function hWe(t,e){return function(...o){return t.apply(this,o.slice(0,e))}}n(hWe,"ary");ixe.ary=hWe});var Nq=Ct(cxe=>{function gWe(t){return t}n(gWe,"identity");cxe.identity=gWe});var dxe=Ct(uxe=>{var vWe=Z_();function xWe(t){return function(e){return vWe.get(e,t)}}n(xWe,"property");uxe.property=xWe});var Dq=Ct(fxe=>{function yWe(t){return t==null||typeof t!="object"&&typeof t!="function"}n(yWe,"isPrimitive");fxe.isPrimitive=yWe});var mxe=Ct(pxe=>{function IWe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}n(IWe,"isTypedArray");pxe.isTypedArray=IWe});var gxe=Ct(hxe=>{function bWe(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}n(bWe,"getSymbols");hxe.getSymbols=bWe});var tL=Ct(vxe=>{function SWe(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}n(SWe,"getTag");vxe.getTag=SWe});var _q=Ct(In=>{var wWe="[object RegExp]",CWe="[object String]",FWe="[object Number]",RWe="[object Boolean]",EWe="[object Arguments]",AWe="[object Symbol]",TWe="[object Date]",kWe="[object Map]",MWe="[object Set]",PWe="[object Array]",OWe="[object Function]",NWe="[object ArrayBuffer]",DWe="[object Object]",_We="[object Error]",LWe="[object DataView]",BWe="[object Uint8Array]",VWe="[object Uint8ClampedArray]",UWe="[object Uint16Array]",zWe="[object Uint32Array]",HWe="[object BigUint64Array]",$We="[object Int8Array]",jWe="[object Int16Array]",qWe="[object Int32Array]",WWe="[object BigInt64Array]",GWe="[object Float32Array]",KWe="[object Float64Array]";In.argumentsTag=EWe;In.arrayBufferTag=NWe;In.arrayTag=PWe;In.bigInt64ArrayTag=WWe;In.bigUint64ArrayTag=HWe;In.booleanTag=RWe;In.dataViewTag=LWe;In.dateTag=TWe;In.errorTag=_We;In.float32ArrayTag=GWe;In.float64ArrayTag=KWe;In.functionTag=OWe;In.int16ArrayTag=jWe;In.int32ArrayTag=qWe;In.int8ArrayTag=$We;In.mapTag=kWe;In.numberTag=FWe;In.objectTag=DWe;In.regexpTag=wWe;In.setTag=MWe;In.stringTag=CWe;In.symbolTag=AWe;In.uint16ArrayTag=UWe;In.uint32ArrayTag=zWe;In.uint8ArrayTag=BWe;In.uint8ClampedArrayTag=VWe});var yxe=Ct(xxe=>{var YWe=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();xxe.globalThis_=YWe});var Sxe=Ct(bxe=>{var Ixe=yxe();function XWe(t){return typeof Ixe.globalThis_.Buffer<"u"&&Ixe.globalThis_.Buffer.isBuffer(t)}n(XWe,"isBuffer");bxe.isBuffer=XWe});var Lq=Ct(oL=>{var QWe=Dq(),ZWe=mxe(),JWe=gxe(),eGe=tL(),ha=_q(),tGe=Sxe();function oGe(t,e){return Dx(t,void 0,t,new Map,e)}n(oGe,"cloneDeepWith");function Dx(t,e,o,r=new Map,a=void 0){let s=a?.(t,e,o,r);if(s!==void 0)return s;if(QWe.isPrimitive(t))return t;if(r.has(t))return r.get(t);if(Array.isArray(t)){let i=new Array(t.length);r.set(t,i);for(let c=0;c<t.length;c++)i[c]=Dx(t[c],c,o,r,a);return Object.hasOwn(t,"index")&&(i.index=t.index),Object.hasOwn(t,"input")&&(i.input=t.input),i}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){let i=new RegExp(t.source,t.flags);return i.lastIndex=t.lastIndex,i}if(t instanceof Map){let i=new Map;r.set(t,i);for(let[c,d]of t)i.set(c,Dx(d,c,o,r,a));return i}if(t instanceof Set){let i=new Set;r.set(t,i);for(let c of t)i.add(Dx(c,void 0,o,r,a));return i}if(tGe.isBuffer(t))return t.subarray();if(ZWe.isTypedArray(t)){let i=new(Object.getPrototypeOf(t)).constructor(t.length);r.set(t,i);for(let c=0;c<t.length;c++)i[c]=Dx(t[c],c,o,r,a);return i}if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){let i=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return r.set(t,i),am(i,t,o,r,a),i}if(typeof File<"u"&&t instanceof File){let i=new File([t],t.name,{type:t.type});return r.set(t,i),am(i,t,o,r,a),i}if(typeof Blob<"u"&&t instanceof Blob){let i=new Blob([t],{type:t.type});return r.set(t,i),am(i,t,o,r,a),i}if(t instanceof Error){let i=structuredClone(t);return r.set(t,i),i.message=t.message,i.name=t.name,i.stack=t.stack,i.cause=t.cause,i.constructor=t.constructor,am(i,t,o,r,a),i}if(t instanceof Boolean){let i=new Boolean(t.valueOf());return r.set(t,i),am(i,t,o,r,a),i}if(t instanceof Number){let i=new Number(t.valueOf());return r.set(t,i),am(i,t,o,r,a),i}if(t instanceof String){let i=new String(t.valueOf());return r.set(t,i),am(i,t,o,r,a),i}if(typeof t=="object"&&rGe(t)){let i=Object.create(Object.getPrototypeOf(t));return r.set(t,i),am(i,t,o,r,a),i}return t}n(Dx,"cloneDeepWithImpl");function am(t,e,o=t,r,a){let s=[...Object.keys(e),...JWe.getSymbols(e)];for(let i=0;i<s.length;i++){let c=s[i],d=Object.getOwnPropertyDescriptor(t,c);(d==null||d.writable)&&(t[c]=Dx(e[c],c,o,r,a))}}n(am,"copyProperties");function rGe(t){switch(eGe.getTag(t)){case ha.argumentsTag:case ha.arrayTag:case ha.arrayBufferTag:case ha.dataViewTag:case ha.booleanTag:case ha.dateTag:case ha.float32ArrayTag:case ha.float64ArrayTag:case ha.int8ArrayTag:case ha.int16ArrayTag:case ha.int32ArrayTag:case ha.mapTag:case ha.numberTag:case ha.objectTag:case ha.regexpTag:case ha.setTag:case ha.stringTag:case ha.symbolTag:case ha.uint8ArrayTag:case ha.uint8ClampedArrayTag:case ha.uint16ArrayTag:case ha.uint32ArrayTag:return!0;default:return!1}}n(rGe,"isCloneableObject");oL.cloneDeepWith=oGe;oL.cloneDeepWithImpl=Dx;oL.copyProperties=am});var Cxe=Ct(wxe=>{var nGe=Lq();function aGe(t){return nGe.cloneDeepWithImpl(t,void 0,t,new Map,void 0)}n(aGe,"cloneDeep");wxe.cloneDeep=aGe});var rL=Ct(Fxe=>{function sGe(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}n(sGe,"isEqualsSameValueZero");Fxe.isEqualsSameValueZero=sGe});var Bq=Ct(()=>{rL()});var Vq=Ct(Rxe=>{function iGe(t){return t!==null&&(typeof t=="object"||typeof t=="function")}n(iGe,"isObject");Rxe.isObject=iGe});var Pxe=Ct(Mxe=>{var Exe=Dq(),Axe=rL();Bq();var lGe=Vq();function Txe(t,e,o){return typeof o!="function"?Txe(t,e,()=>{}):Uq(t,e,n(function r(a,s,i,c,d,f){let p=o(a,s,i,c,d,f);return p!==void 0?!!p:Uq(a,s,r,f)},"doesMatch"),new Map)}n(Txe,"isMatchWith");function Uq(t,e,o,r){if(e===t)return!0;switch(typeof e){case"object":return cGe(t,e,o,r);case"function":return Object.keys(e).length>0?Uq(t,{...e},o,r):Axe.isEqualsSameValueZero(t,e);default:return lGe.isObject(t)?typeof e=="string"?e==="":!0:Axe.isEqualsSameValueZero(t,e)}}n(Uq,"isMatchWithInternal");function cGe(t,e,o,r){if(e==null)return!0;if(Array.isArray(e))return kxe(t,e,o,r);if(e instanceof Map)return uGe(t,e,o,r);if(e instanceof Set)return dGe(t,e,o,r);let a=Object.keys(e);if(t==null||Exe.isPrimitive(t))return a.length===0;if(a.length===0)return!0;if(r?.has(e))return r.get(e)===t;r?.set(e,t);try{for(let s=0;s<a.length;s++){let i=a[s];if(!Exe.isPrimitive(t)&&!(i in t)||e[i]===void 0&&t[i]!==void 0||e[i]===null&&t[i]!==null||!o(t[i],e[i],i,t,e,r))return!1}return!0}finally{r?.delete(e)}}n(cGe,"isObjectMatch");function uGe(t,e,o,r){if(e.size===0)return!0;if(!(t instanceof Map))return!1;for(let[a,s]of e.entries())if(o(t.get(a),s,a,t,e,r)===!1)return!1;return!0}n(uGe,"isMapMatch");function kxe(t,e,o,r){if(e.length===0)return!0;if(!Array.isArray(t))return!1;let a=new Set;for(let s=0;s<e.length;s++){let i=e[s],c=!1;for(let d=0;d<t.length;d++){if(a.has(d))continue;let f=t[d],p=!1;if(o(f,i,s,t,e,r)&&(p=!0),p){a.add(d),c=!0;break}}if(!c)return!1}return!0}n(kxe,"isArrayMatch");function dGe(t,e,o,r){return e.size===0?!0:t instanceof Set?kxe([...t],[...e],o,r):!1}n(dGe,"isSetMatch");Mxe.isMatchWith=Txe});var zq=Ct(Oxe=>{var fGe=Pxe();function pGe(t,e){return fGe.isMatchWith(t,e,()=>{})}n(pGe,"isMatch");Oxe.isMatch=pGe});var Dxe=Ct(Nxe=>{var mGe=Cxe(),hGe=zq();function gGe(t){return t=mGe.cloneDeep(t),e=>hGe.isMatch(e,t)}n(gGe,"matches");Nxe.matches=gGe});var Lxe=Ct(_xe=>{var vGe=tL(),nL=_q(),aL=Lq();function xGe(t,e){return aL.cloneDeepWith(t,(o,r,a,s)=>{let i=e?.(o,r,a,s);if(i!==void 0)return i;if(typeof t=="object"){if(vGe.getTag(t)==="[object Object]"&&typeof t.constructor!="function"){let c={};return s.set(t,c),aL.copyProperties(c,t,a,s),c}switch(Object.prototype.toString.call(t)){case nL.numberTag:case nL.stringTag:case nL.booleanTag:{let c=new t.constructor(t?.valueOf());return aL.copyProperties(c,t),c}case nL.argumentsTag:{let c={};return aL.copyProperties(c,t),c.length=t.length,c[Symbol.iterator]=t[Symbol.iterator],c}default:return}}})}n(xGe,"cloneDeepWith");_xe.cloneDeepWith=xGe});var Vxe=Ct(Bxe=>{var yGe=Lxe();function IGe(t){return yGe.cloneDeepWith(t)}n(IGe,"cloneDeep");Bxe.cloneDeep=IGe});var Hq=Ct(Uxe=>{var bGe=/^(?:0|[1-9]\d*)$/;function SGe(t,e=Number.MAX_SAFE_INTEGER){switch(typeof t){case"number":return Number.isInteger(t)&&t>=0&&t<e;case"symbol":return!1;case"string":return bGe.test(t)}}n(SGe,"isIndex");Uxe.isIndex=SGe});var Hxe=Ct(zxe=>{var wGe=tL();function CGe(t){return t!==null&&typeof t=="object"&&wGe.getTag(t)==="[object Arguments]"}n(CGe,"isArguments");zxe.isArguments=CGe});var jxe=Ct($xe=>{var FGe=Mq(),RGe=Q_(),EGe=Hq(),AGe=Hxe();function TGe(t,e){let o;if(Array.isArray(e)?o=e:typeof e=="string"&&FGe.isDeepKey(e)&&t?.[e]==null?o=RGe.toPath(e):o=[e],o.length===0)return!1;let r=t;for(let a=0;a<o.length;a++){let s=o[a];if((r==null||!Object.hasOwn(r,s))&&!((Array.isArray(r)||AGe.isArguments(r))&&EGe.isIndex(s)&&s<r.length))return!1;r=r[s]}return!0}n(TGe,"has");$xe.has=TGe});var Wxe=Ct(qxe=>{var kGe=X_(),MGe=Z_(),PGe=zq(),OGe=Vxe(),NGe=jxe();function DGe(t,e){switch(typeof t){case"object":Object.is(t?.valueOf(),-0)&&(t="-0");break;case"number":t=kGe.toKey(t);break}return e=OGe.cloneDeep(e),function(o){let r=MGe.get(o,t);return r===void 0?NGe.has(o,t):e===void 0?r===void 0:PGe.isMatch(r,e)}}n(DGe,"matchesProperty");qxe.matchesProperty=DGe});var Kxe=Ct(Gxe=>{var _Ge=Nq(),LGe=dxe(),BGe=Dxe(),VGe=Wxe();function UGe(t){if(t==null)return _Ge.identity;switch(typeof t){case"function":return t;case"object":return Array.isArray(t)&&t.length===2?VGe.matchesProperty(t[0],t[1]):BGe.matches(t);case"string":case"symbol":case"number":return LGe.property(t)}}n(UGe,"iteratee");Gxe.iteratee=UGe});var Xxe=Ct(Yxe=>{function zGe(t){return Number.isSafeInteger(t)&&t>=0}n(zGe,"isLength");Yxe.isLength=zGe});var $q=Ct(Qxe=>{var HGe=Xxe();function $Ge(t){return t!=null&&typeof t!="function"&&HGe.isLength(t.length)}n($Ge,"isArrayLike");Qxe.isArrayLike=$Ge});var Jxe=Ct(Zxe=>{function jGe(t){return typeof t=="object"&&t!==null}n(jGe,"isObjectLike");Zxe.isObjectLike=jGe});var tye=Ct(eye=>{var qGe=$q(),WGe=Jxe();function GGe(t){return WGe.isObjectLike(t)&&qGe.isArrayLike(t)}n(GGe,"isArrayLikeObject");eye.isArrayLikeObject=GGe});var rye=Ct(oye=>{var KGe=sxe(),YGe=lxe(),XGe=Nq(),QGe=Kxe(),ZGe=tye();function JGe(t,e=XGe.identity){return ZGe.isArrayLikeObject(t)?KGe.uniqBy(Array.from(t),YGe.ary(QGe.iteratee(e),1)):[]}n(JGe,"uniqBy");oye.uniqBy=JGe});var aye=Ct((PRo,nye)=>{nye.exports=rye().uniqBy});var uye=Ct(cye=>{function rKe(t,e=1){let o=[],r=Math.floor(e),a=n((s,i)=>{for(let c=0;c<s.length;c++){let d=s[c];Array.isArray(d)&&i<r?a(d,i+1):o.push(d)}},"recursive");return a(t,0),o}n(rKe,"flatten");cye.flatten=rKe});var qq=Ct(dye=>{var nKe=rL();Bq();var aKe=$q(),sKe=Vq(),iKe=Hq();function lKe(t,e,o){return sKe.isObject(o)&&(typeof e=="number"&&aKe.isArrayLike(o)&&iKe.isIndex(e)&&e<o.length||typeof e=="string"&&e in o)?nKe.isEqualsSameValueZero(o[e],t):!1}n(lKe,"isIterateeCall");dye.isIterateeCall=lKe});var mye=Ct(pye=>{function fye(t){return typeof t=="symbol"?1:t===null?2:t===void 0?3:t!==t?4:0}n(fye,"getPriority");var cKe=n((t,e,o)=>{if(t!==e){let r=fye(t),a=fye(e);if(r===a&&r===0){if(t<e)return o==="desc"?1:-1;if(t>e)return o==="desc"?-1:1}return o==="desc"?a-r:r-a}return 0},"compareValues");pye.compareValues=cKe});var Wq=Ct(hye=>{function uKe(t){return typeof t=="symbol"||t instanceof Symbol}n(uKe,"isSymbol");hye.isSymbol=uKe});var vye=Ct(gye=>{var dKe=Wq(),fKe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pKe=/^\w*$/;function mKe(t,e){return Array.isArray(t)?!1:typeof t=="number"||typeof t=="boolean"||t==null||dKe.isSymbol(t)?!0:typeof t=="string"&&(pKe.test(t)||!fKe.test(t))||e!=null&&Object.hasOwn(e,t)}n(mKe,"isKey");gye.isKey=mKe});var yye=Ct(xye=>{var hKe=Q_(),gKe=mye(),vKe=vye();function xKe(t,e,o,r){if(t==null)return[];o=r?void 0:o,Array.isArray(t)||(t=Object.values(t)),Array.isArray(e)||(e=e==null?[null]:[e]),e.length===0&&(e=[null]),Array.isArray(o)||(o=o==null?[]:[o]),o=o.map(c=>String(c));let a=n((c,d)=>{let f=c;for(let p=0;p<d.length&&f!=null;++p)f=f[d[p]];return f},"getValueByNestedPath"),s=n((c,d)=>d==null||c==null?d:typeof c=="object"&&"key"in c?Object.hasOwn(d,c.key)?d[c.key]:a(d,c.path):typeof c=="function"?c(d):Array.isArray(c)?a(d,c):typeof d=="object"?d[c]:d,"getValueByCriterion"),i=e.map(c=>(Array.isArray(c)&&c.length===1&&(c=c[0]),c==null||typeof c=="function"||Array.isArray(c)||vKe.isKey(c)?c:{key:c,path:hKe.toPath(c)}));return t.map(c=>({original:c,criteria:i.map(d=>s(d,c))})).slice().sort((c,d)=>{for(let f=0;f<i.length;f++){let p=gKe.compareValues(c.criteria[f],d.criteria[f],o[f]);if(p!==0)return p}return 0}).map(c=>c.original)}n(xKe,"orderBy");xye.orderBy=xKe});var Sye=Ct(bye=>{var yKe=uye(),Iye=qq(),IKe=yye();function bKe(t,...e){let o=e.length;return o>1&&Iye.isIterateeCall(t,e[0],e[1])?e=[]:o>2&&Iye.isIterateeCall(e[0],e[1],e[2])&&(e=[e[0]]),IKe.orderBy(t,yKe.flatten(e),["asc"])}n(bKe,"sortBy");bye.sortBy=bKe});var NE=Ct((JRo,wye)=>{wye.exports=Sye().sortBy});var XIe=Ct(YIe=>{function tXe(t,e,{signal:o,edges:r}={}){let a,s=null,i=r!=null&&r.includes("leading"),c=r==null||r.includes("trailing"),d=n(()=>{s!==null&&(t.apply(a,s),a=void 0,s=null)},"invoke"),f=n(()=>{c&&d(),v()},"onTimerEnd"),p=null,m=n(()=>{p!=null&&clearTimeout(p),p=setTimeout(()=>{p=null,f()},e)},"schedule"),h=n(()=>{p!==null&&(clearTimeout(p),p=null)},"cancelTimer"),v=n(()=>{h(),a=void 0,s=null},"cancel"),x=n(()=>{d()},"flush"),y=n(function(...b){if(o?.aborted)return;a=this,s=b;let S=p==null;m(),i&&S&&d()},"debounced");return y.schedule=m,y.cancel=v,y.flush=x,o?.addEventListener("abort",v,{once:!0}),y}n(tXe,"debounce");YIe.debounce=tXe});var ZIe=Ct(QIe=>{var oXe=XIe();function rXe(t,e=0,o={}){typeof o!="object"&&(o={});let{leading:r=!1,trailing:a=!0,maxWait:s}=o,i=Array(2);r&&(i[0]="leading"),a&&(i[1]="trailing");let c,d=null,f=oXe.debounce(function(...h){c=t.apply(this,h),d=null},e,{edges:i}),p=n(function(...h){return s!=null&&(d===null&&(d=Date.now()),Date.now()-d>=s)?(c=t.apply(this,h),d=Date.now(),f.cancel(),f.schedule(),c):(f.apply(this,h),c)},"debounced"),m=n(()=>(f.flush(),c),"flush");return p.cancel=f.cancel,p.flush=m,p}n(rXe,"debounce");QIe.debounce=rXe});var ebe=Ct(JIe=>{var nXe=ZIe();function aXe(t,e=0,o={}){let{leading:r=!0,trailing:a=!0}=o;return nXe.debounce(t,e,{leading:r,maxWait:e,trailing:a})}n(aXe,"throttle");JIe.throttle=aXe});var obe=Ct((u2o,tbe)=>{tbe.exports=ebe().throttle});var Sbe=Ct(bbe=>{"use strict";(function(){function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}n(t,"is"),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=oe(),o=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,a=e.useRef,s=e.useEffect,i=e.useMemo,c=e.useDebugValue;bbe.useSyncExternalStoreWithSelector=function(d,f,p,m,h){var v=a(null);if(v.current===null){var x={hasValue:!1,value:null};v.current=x}else x=v.current;v=i(function(){function b(T){if(!S){if(S=!0,w=T,T=m(T),h!==void 0&&x.hasValue){var E=x.value;if(h(E,T))return C=E}return C=T}if(E=C,o(w,T))return E;var k=m(T);return h!==void 0&&h(E,k)?(w=T,E):(w=T,C=k)}n(b,"memoizedSelector");var S=!1,w,C,F=p===void 0?null:p;return[function(){return b(f())},F===null?void 0:function(){return b(F())}]},[f,p,m,h]);var y=r(d,v[0],v[1]);return s(function(){x.hasValue=!0,x.value=y},[y]),c(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var Cbe=Ct((V2o,wbe)=>{"use strict";wbe.exports=Sbe()});var z1e=Ct(U1e=>{var bZe=Wq();function SZe(t){return bZe.isSymbol(t)?NaN:Number(t)}n(SZe,"toNumber");U1e.toNumber=SZe});var $1e=Ct(H1e=>{var wZe=z1e();function CZe(t){return t?(t=wZe.toNumber(t),t===1/0||t===-1/0?(t<0?-1:1)*Number.MAX_VALUE:t===t?t:0):t===0?t:0}n(CZe,"toFinite");H1e.toFinite=CZe});var q1e=Ct(j1e=>{var OW=$1e(),FZe=qq();function RZe(t,e,o){o&&typeof o!="number"&&FZe.isIterateeCall(t,e,o)&&(e=o=void 0),t=OW.toFinite(t),e===void 0?(e=t,t=0):e=OW.toFinite(e),o=o===void 0?t<e?1:-1:OW.toFinite(o);let r=Math.max(Math.ceil((e-t)/(o||1)),0),a=new Array(r);for(let s=0;s<r;s++)a[s]=t,t+=o;return a}n(RZe,"range");j1e.range=RZe});var G1e=Ct((LTo,W1e)=>{W1e.exports=q1e().range});var _W=Ct((J1e,o3)=>{(function(t){"use strict";var e=1e9,o={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},r=!0,a="[DecimalError] ",s=a+"Invalid argument: ",i=a+"Exponent out of range: ",c=Math.floor,d=Math.pow,f=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,p,m=1e7,h=7,v=9007199254740991,x=c(v/h),y={};y.absoluteValue=y.abs=function(){var N=new this.constructor(this);return N.s&&(N.s=1),N},y.comparedTo=y.cmp=function(N){var D,B,z,q,H=this;if(N=new H.constructor(N),H.s!==N.s)return H.s||-N.s;if(H.e!==N.e)return H.e>N.e^H.s<0?1:-1;for(z=H.d.length,q=N.d.length,D=0,B=z<q?z:q;D<B;++D)if(H.d[D]!==N.d[D])return H.d[D]>N.d[D]^H.s<0?1:-1;return z===q?0:z>q^H.s<0?1:-1},y.decimalPlaces=y.dp=function(){var N=this,D=N.d.length-1,B=(D-N.e)*h;if(D=N.d[D],D)for(;D%10==0;D/=10)B--;return B<0?0:B},y.dividedBy=y.div=function(N){return C(this,new this.constructor(N))},y.dividedToIntegerBy=y.idiv=function(N){var D=this,B=D.constructor;return M(C(D,new B(N),0,1),B.precision)},y.equals=y.eq=function(N){return!this.cmp(N)},y.exponent=function(){return T(this)},y.greaterThan=y.gt=function(N){return this.cmp(N)>0},y.greaterThanOrEqualTo=y.gte=function(N){return this.cmp(N)>=0},y.isInteger=y.isint=function(){return this.e>this.d.length-2},y.isNegative=y.isneg=function(){return this.s<0},y.isPositive=y.ispos=function(){return this.s>0},y.isZero=function(){return this.s===0},y.lessThan=y.lt=function(N){return this.cmp(N)<0},y.lessThanOrEqualTo=y.lte=function(N){return this.cmp(N)<1},y.logarithm=y.log=function(N){var D,B=this,z=B.constructor,q=z.precision,H=q+5;if(N===void 0)N=new z(10);else if(N=new z(N),N.s<1||N.eq(p))throw Error(a+"NaN");if(B.s<1)throw Error(a+(B.s?"NaN":"-Infinity"));return B.eq(p)?new z(0):(r=!1,D=C(P(B,H),P(N,H),H),r=!0,M(D,q))},y.minus=y.sub=function(N){var D=this;return N=new D.constructor(N),D.s==N.s?L(D,N):b(D,(N.s=-N.s,N))},y.modulo=y.mod=function(N){var D,B=this,z=B.constructor,q=z.precision;if(N=new z(N),!N.s)throw Error(a+"NaN");return B.s?(r=!1,D=C(B,N,0,1).times(N),r=!0,B.minus(D)):M(new z(B),q)},y.naturalExponential=y.exp=function(){return F(this)},y.naturalLogarithm=y.ln=function(){return P(this)},y.negated=y.neg=function(){var N=new this.constructor(this);return N.s=-N.s||0,N},y.plus=y.add=function(N){var D=this;return N=new D.constructor(N),D.s==N.s?b(D,N):L(D,(N.s=-N.s,N))},y.precision=y.sd=function(N){var D,B,z,q=this;if(N!==void 0&&N!==!!N&&N!==1&&N!==0)throw Error(s+N);if(D=T(q)+1,z=q.d.length-1,B=z*h+1,z=q.d[z],z){for(;z%10==0;z/=10)B--;for(z=q.d[0];z>=10;z/=10)B++}return N&&D>B?D:B},y.squareRoot=y.sqrt=function(){var N,D,B,z,q,H,Y,Q=this,X=Q.constructor;if(Q.s<1){if(!Q.s)return new X(0);throw Error(a+"NaN")}for(N=T(Q),r=!1,q=Math.sqrt(+Q),q==0||q==1/0?(D=w(Q.d),(D.length+N)%2==0&&(D+="0"),q=Math.sqrt(D),N=c((N+1)/2)-(N<0||N%2),q==1/0?D="5e"+N:(D=q.toExponential(),D=D.slice(0,D.indexOf("e")+1)+N),z=new X(D)):z=new X(q.toString()),B=X.precision,q=Y=B+3;;)if(H=z,z=H.plus(C(Q,H,Y+2)).times(.5),w(H.d).slice(0,Y)===(D=w(z.d)).slice(0,Y)){if(D=D.slice(Y-3,Y+1),q==Y&&D=="4999"){if(M(H,B+1,0),H.times(H).eq(Q)){z=H;break}}else if(D!="9999")break;Y+=4}return r=!0,M(z,B)},y.times=y.mul=function(N){var D,B,z,q,H,Y,Q,X,te,ae=this,se=ae.constructor,J=ae.d,ne=(N=new se(N)).d;if(!ae.s||!N.s)return new se(0);for(N.s*=ae.s,B=ae.e+N.e,X=J.length,te=ne.length,X<te&&(H=J,J=ne,ne=H,Y=X,X=te,te=Y),H=[],Y=X+te,z=Y;z--;)H.push(0);for(z=te;--z>=0;){for(D=0,q=X+z;q>z;)Q=H[q]+ne[z]*J[q-z-1]+D,H[q--]=Q%m|0,D=Q/m|0;H[q]=(H[q]+D)%m|0}for(;!H[--Y];)H.pop();return D?++B:H.shift(),N.d=H,N.e=B,r?M(N,se.precision):N},y.toDecimalPlaces=y.todp=function(N,D){var B=this,z=B.constructor;return B=new z(B),N===void 0?B:(S(N,0,e),D===void 0?D=z.rounding:S(D,0,8),M(B,N+T(B)+1,D))},y.toExponential=function(N,D){var B,z=this,q=z.constructor;return N===void 0?B=U(z,!0):(S(N,0,e),D===void 0?D=q.rounding:S(D,0,8),z=M(new q(z),N+1,D),B=U(z,!0,N+1)),B},y.toFixed=function(N,D){var B,z,q=this,H=q.constructor;return N===void 0?U(q):(S(N,0,e),D===void 0?D=H.rounding:S(D,0,8),z=M(new H(q),N+T(q)+1,D),B=U(z.abs(),!1,N+T(z)+1),q.isneg()&&!q.isZero()?"-"+B:B)},y.toInteger=y.toint=function(){var N=this,D=N.constructor;return M(new D(N),T(N)+1,D.rounding)},y.toNumber=function(){return+this},y.toPower=y.pow=function(N){var D,B,z,q,H,Y,Q=this,X=Q.constructor,te=12,ae=+(N=new X(N));if(!N.s)return new X(p);if(Q=new X(Q),!Q.s){if(N.s<1)throw Error(a+"Infinity");return Q}if(Q.eq(p))return Q;if(z=X.precision,N.eq(p))return M(Q,z);if(D=N.e,B=N.d.length-1,Y=D>=B,H=Q.s,Y){if((B=ae<0?-ae:ae)<=v){for(q=new X(p),D=Math.ceil(z/h+4),r=!1;B%2&&(q=q.times(Q),W(q.d,D)),B=c(B/2),B!==0;)Q=Q.times(Q),W(Q.d,D);return r=!0,N.s<0?new X(p).div(q):M(q,z)}}else if(H<0)throw Error(a+"NaN");return H=H<0&&N.d[Math.max(D,B)]&1?-1:1,Q.s=1,r=!1,q=N.times(P(Q,z+te)),r=!0,q=F(q),q.s=H,q},y.toPrecision=function(N,D){var B,z,q=this,H=q.constructor;return N===void 0?(B=T(q),z=U(q,B<=H.toExpNeg||B>=H.toExpPos)):(S(N,1,e),D===void 0?D=H.rounding:S(D,0,8),q=M(new H(q),N,D),B=T(q),z=U(q,N<=B||B<=H.toExpNeg,N)),z},y.toSignificantDigits=y.tosd=function(N,D){var B=this,z=B.constructor;return N===void 0?(N=z.precision,D=z.rounding):(S(N,1,e),D===void 0?D=z.rounding:S(D,0,8)),M(new z(B),N,D)},y.toString=y.valueOf=y.val=y.toJSON=function(){var N=this,D=T(N),B=N.constructor;return U(N,D<=B.toExpNeg||D>=B.toExpPos)};function b(N,D){var B,z,q,H,Y,Q,X,te,ae=N.constructor,se=ae.precision;if(!N.s||!D.s)return D.s||(D=new ae(N)),r?M(D,se):D;if(X=N.d,te=D.d,Y=N.e,q=D.e,X=X.slice(),H=Y-q,H){for(H<0?(z=X,H=-H,Q=te.length):(z=te,q=Y,Q=X.length),Y=Math.ceil(se/h),Q=Y>Q?Y+1:Q+1,H>Q&&(H=Q,z.length=1),z.reverse();H--;)z.push(0);z.reverse()}for(Q=X.length,H=te.length,Q-H<0&&(H=Q,z=te,te=X,X=z),B=0;H;)B=(X[--H]=X[H]+te[H]+B)/m|0,X[H]%=m;for(B&&(X.unshift(B),++q),Q=X.length;X[--Q]==0;)X.pop();return D.d=X,D.e=q,r?M(D,se):D}n(b,"add");function S(N,D,B){if(N!==~~N||N<D||N>B)throw Error(s+N)}n(S,"checkInt32");function w(N){var D,B,z,q=N.length-1,H="",Y=N[0];if(q>0){for(H+=Y,D=1;D<q;D++)z=N[D]+"",B=h-z.length,B&&(H+=k(B)),H+=z;Y=N[D],z=Y+"",B=h-z.length,B&&(H+=k(B))}else if(Y===0)return"0";for(;Y%10===0;)Y/=10;return H+Y}n(w,"digitsToString");var C=(function(){function N(z,q){var H,Y=0,Q=z.length;for(z=z.slice();Q--;)H=z[Q]*q+Y,z[Q]=H%m|0,Y=H/m|0;return Y&&z.unshift(Y),z}n(N,"multiplyInteger");function D(z,q,H,Y){var Q,X;if(H!=Y)X=H>Y?1:-1;else for(Q=X=0;Q<H;Q++)if(z[Q]!=q[Q]){X=z[Q]>q[Q]?1:-1;break}return X}n(D,"compare");function B(z,q,H){for(var Y=0;H--;)z[H]-=Y,Y=z[H]<q[H]?1:0,z[H]=Y*m+z[H]-q[H];for(;!z[0]&&z.length>1;)z.shift()}return n(B,"subtract"),function(z,q,H,Y){var Q,X,te,ae,se,J,ne,pe,le,ie,de,ue,he,Re,Ae,ye,ge,Te,ze=z.constructor,Ze=z.s==q.s?1:-1,_e=z.d,Ie=q.d;if(!z.s)return new ze(z);if(!q.s)throw Error(a+"Division by zero");for(X=z.e-q.e,ge=Ie.length,Ae=_e.length,ne=new ze(Ze),pe=ne.d=[],te=0;Ie[te]==(_e[te]||0);)++te;if(Ie[te]>(_e[te]||0)&&--X,H==null?ue=H=ze.precision:Y?ue=H+(T(z)-T(q))+1:ue=H,ue<0)return new ze(0);if(ue=ue/h+2|0,te=0,ge==1)for(ae=0,Ie=Ie[0],ue++;(te<Ae||ae)&&ue--;te++)he=ae*m+(_e[te]||0),pe[te]=he/Ie|0,ae=he%Ie|0;else{for(ae=m/(Ie[0]+1)|0,ae>1&&(Ie=N(Ie,ae),_e=N(_e,ae),ge=Ie.length,Ae=_e.length),Re=ge,le=_e.slice(0,ge),ie=le.length;ie<ge;)le[ie++]=0;Te=Ie.slice(),Te.unshift(0),ye=Ie[0],Ie[1]>=m/2&&++ye;do ae=0,Q=D(Ie,le,ge,ie),Q<0?(de=le[0],ge!=ie&&(de=de*m+(le[1]||0)),ae=de/ye|0,ae>1?(ae>=m&&(ae=m-1),se=N(Ie,ae),J=se.length,ie=le.length,Q=D(se,le,J,ie),Q==1&&(ae--,B(se,ge<J?Te:Ie,J))):(ae==0&&(Q=ae=1),se=Ie.slice()),J=se.length,J<ie&&se.unshift(0),B(le,se,ie),Q==-1&&(ie=le.length,Q=D(Ie,le,ge,ie),Q<1&&(ae++,B(le,ge<ie?Te:Ie,ie))),ie=le.length):Q===0&&(ae++,le=[0]),pe[te++]=ae,Q&&le[0]?le[ie++]=_e[Re]||0:(le=[_e[Re]],ie=1);while((Re++<Ae||le[0]!==void 0)&&ue--)}return pe[0]||pe.shift(),ne.e=X,M(ne,Y?H+T(ne)+1:H)}})();function F(N,D){var B,z,q,H,Y,Q,X=0,te=0,ae=N.constructor,se=ae.precision;if(T(N)>16)throw Error(i+T(N));if(!N.s)return new ae(p);for(D==null?(r=!1,Q=se):Q=D,Y=new ae(.03125);N.abs().gte(.1);)N=N.times(Y),te+=5;for(z=Math.log(d(2,te))/Math.LN10*2+5|0,Q+=z,B=q=H=new ae(p),ae.precision=Q;;){if(q=M(q.times(N),Q),B=B.times(++X),Y=H.plus(C(q,B,Q)),w(Y.d).slice(0,Q)===w(H.d).slice(0,Q)){for(;te--;)H=M(H.times(H),Q);return ae.precision=se,D==null?(r=!0,M(H,se)):H}H=Y}}n(F,"exp");function T(N){for(var D=N.e*h,B=N.d[0];B>=10;B/=10)D++;return D}n(T,"getBase10Exponent");function E(N,D,B){if(D>N.LN10.sd())throw r=!0,B&&(N.precision=B),Error(a+"LN10 precision limit exceeded");return M(new N(N.LN10),D)}n(E,"getLn10");function k(N){for(var D="";N--;)D+="0";return D}n(k,"getZeroString");function P(N,D){var B,z,q,H,Y,Q,X,te,ae,se=1,J=10,ne=N,pe=ne.d,le=ne.constructor,ie=le.precision;if(ne.s<1)throw Error(a+(ne.s?"NaN":"-Infinity"));if(ne.eq(p))return new le(0);if(D==null?(r=!1,te=ie):te=D,ne.eq(10))return D==null&&(r=!0),E(le,te);if(te+=J,le.precision=te,B=w(pe),z=B.charAt(0),H=T(ne),Math.abs(H)<15e14){for(;z<7&&z!=1||z==1&&B.charAt(1)>3;)ne=ne.times(N),B=w(ne.d),z=B.charAt(0),se++;H=T(ne),z>1?(ne=new le("0."+B),H++):ne=new le(z+"."+B.slice(1))}else return X=E(le,te+2,ie).times(H+""),ne=P(new le(z+"."+B.slice(1)),te-J).plus(X),le.precision=ie,D==null?(r=!0,M(ne,ie)):ne;for(Q=Y=ne=C(ne.minus(p),ne.plus(p),te),ae=M(ne.times(ne),te),q=3;;){if(Y=M(Y.times(ae),te),X=Q.plus(C(Y,new le(q),te)),w(X.d).slice(0,te)===w(Q.d).slice(0,te))return Q=Q.times(2),H!==0&&(Q=Q.plus(E(le,te+2,ie).times(H+""))),Q=C(Q,new le(se),te),le.precision=ie,D==null?(r=!0,M(Q,ie)):Q;Q=X,q+=2}}n(P,"ln");function _(N,D){var B,z,q;for((B=D.indexOf("."))>-1&&(D=D.replace(".","")),(z=D.search(/e/i))>0?(B<0&&(B=z),B+=+D.slice(z+1),D=D.substring(0,z)):B<0&&(B=D.length),z=0;D.charCodeAt(z)===48;)++z;for(q=D.length;D.charCodeAt(q-1)===48;)--q;if(D=D.slice(z,q),D){if(q-=z,B=B-z-1,N.e=c(B/h),N.d=[],z=(B+1)%h,B<0&&(z+=h),z<q){for(z&&N.d.push(+D.slice(0,z)),q-=h;z<q;)N.d.push(+D.slice(z,z+=h));D=D.slice(z),z=h-D.length}else z-=q;for(;z--;)D+="0";if(N.d.push(+D),r&&(N.e>x||N.e<-x))throw Error(i+B)}else N.s=0,N.e=0,N.d=[0];return N}n(_,"parseDecimal");function M(N,D,B){var z,q,H,Y,Q,X,te,ae,se=N.d;for(Y=1,H=se[0];H>=10;H/=10)Y++;if(z=D-Y,z<0)z+=h,q=D,te=se[ae=0];else{if(ae=Math.ceil((z+1)/h),H=se.length,ae>=H)return N;for(te=H=se[ae],Y=1;H>=10;H/=10)Y++;z%=h,q=z-h+Y}if(B!==void 0&&(H=d(10,Y-q-1),Q=te/H%10|0,X=D<0||se[ae+1]!==void 0||te%H,X=B<4?(Q||X)&&(B==0||B==(N.s<0?3:2)):Q>5||Q==5&&(B==4||X||B==6&&(z>0?q>0?te/d(10,Y-q):0:se[ae-1])%10&1||B==(N.s<0?8:7))),D<1||!se[0])return X?(H=T(N),se.length=1,D=D-H-1,se[0]=d(10,(h-D%h)%h),N.e=c(-D/h)||0):(se.length=1,se[0]=N.e=N.s=0),N;if(z==0?(se.length=ae,H=1,ae--):(se.length=ae+1,H=d(10,h-z),se[ae]=q>0?(te/d(10,Y-q)%d(10,q)|0)*H:0),X)for(;;)if(ae==0){(se[0]+=H)==m&&(se[0]=1,++N.e);break}else{if(se[ae]+=H,se[ae]!=m)break;se[ae--]=0,H=1}for(z=se.length;se[--z]===0;)se.pop();if(r&&(N.e>x||N.e<-x))throw Error(i+T(N));return N}n(M,"round");function L(N,D){var B,z,q,H,Y,Q,X,te,ae,se,J=N.constructor,ne=J.precision;if(!N.s||!D.s)return D.s?D.s=-D.s:D=new J(N),r?M(D,ne):D;if(X=N.d,se=D.d,z=D.e,te=N.e,X=X.slice(),Y=te-z,Y){for(ae=Y<0,ae?(B=X,Y=-Y,Q=se.length):(B=se,z=te,Q=X.length),q=Math.max(Math.ceil(ne/h),Q)+2,Y>q&&(Y=q,B.length=1),B.reverse(),q=Y;q--;)B.push(0);B.reverse()}else{for(q=X.length,Q=se.length,ae=q<Q,ae&&(Q=q),q=0;q<Q;q++)if(X[q]!=se[q]){ae=X[q]<se[q];break}Y=0}for(ae&&(B=X,X=se,se=B,D.s=-D.s),Q=X.length,q=se.length-Q;q>0;--q)X[Q++]=0;for(q=se.length;q>Y;){if(X[--q]<se[q]){for(H=q;H&&X[--H]===0;)X[H]=m-1;--X[H],X[q]+=m}X[q]-=se[q]}for(;X[--Q]===0;)X.pop();for(;X[0]===0;X.shift())--z;return X[0]?(D.d=X,D.e=z,r?M(D,ne):D):new J(0)}n(L,"subtract");function U(N,D,B){var z,q=T(N),H=w(N.d),Y=H.length;return D?(B&&(z=B-Y)>0?H=H.charAt(0)+"."+H.slice(1)+k(z):Y>1&&(H=H.charAt(0)+"."+H.slice(1)),H=H+(q<0?"e":"e+")+q):q<0?(H="0."+k(-q-1)+H,B&&(z=B-Y)>0&&(H+=k(z))):q>=Y?(H+=k(q+1-Y),B&&(z=B-q-1)>0&&(H=H+"."+k(z))):((z=q+1)<Y&&(H=H.slice(0,z)+"."+H.slice(z)),B&&(z=B-Y)>0&&(q+1===Y&&(H+="."),H+=k(z))),N.s<0?"-"+H:H}n(U,"toString");function W(N,D){if(N.length>D)return N.length=D,!0}n(W,"truncate");function V(N){var D,B,z;function q(H){var Y=this;if(!(Y instanceof q))return new q(H);if(Y.constructor=q,H instanceof q){Y.s=H.s,Y.e=H.e,Y.d=(H=H.d)?H.slice():H;return}if(typeof H=="number"){if(H*0!==0)throw Error(s+H);if(H>0)Y.s=1;else if(H<0)H=-H,Y.s=-1;else{Y.s=0,Y.e=0,Y.d=[0];return}if(H===~~H&&H<1e7){Y.e=0,Y.d=[H];return}return _(Y,H.toString())}else if(typeof H!="string")throw Error(s+H);if(H.charCodeAt(0)===45?(H=H.slice(1),Y.s=-1):Y.s=1,f.test(H))_(Y,H);else throw Error(s+H)}if(n(q,"Decimal"),q.prototype=y,q.ROUND_UP=0,q.ROUND_DOWN=1,q.ROUND_CEIL=2,q.ROUND_FLOOR=3,q.ROUND_HALF_UP=4,q.ROUND_HALF_DOWN=5,q.ROUND_HALF_EVEN=6,q.ROUND_HALF_CEIL=7,q.ROUND_HALF_FLOOR=8,q.clone=V,q.config=q.set=j,N===void 0&&(N={}),N)for(z=["precision","rounding","toExpNeg","toExpPos","LN10"],D=0;D<z.length;)N.hasOwnProperty(B=z[D++])||(N[B]=this[B]);return q.config(N),q}n(V,"clone");function j(N){if(!N||typeof N!="object")throw Error(a+"Object expected");var D,B,z,q=["precision",1,e,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(D=0;D<q.length;D+=3)if((z=N[B=q[D]])!==void 0)if(c(z)===z&&z>=q[D+1]&&z<=q[D+2])this[B]=z;else throw Error(s+B+": "+z);if((z=N[B="LN10"])!==void 0)if(z==Math.LN10)this[B]=new this(z);else throw Error(s+B+": "+z);return this}n(j,"config"),o=V(o),o.default=o.Decimal=o,p=new o(1),typeof define=="function"&&define.amd?define(function(){return o}):typeof o3<"u"&&o3.exports?o3.exports=o:(t||(t=typeof self<"u"&&self&&self.self==self?self:Function("return this")()),t.Decimal=o)})(J1e)});var WCe=Ct((W4o,DK)=>{"use strict";var Irt=Object.prototype.hasOwnProperty,Qi="~";function k2(){}n(k2,"Events");Object.create&&(k2.prototype=Object.create(null),new k2().__proto__||(Qi=!1));function brt(t,e,o){this.fn=t,this.context=e,this.once=o||!1}n(brt,"EE");function qCe(t,e,o,r,a){if(typeof o!="function")throw new TypeError("The listener must be a function");var s=new brt(o,r||t,a),i=Qi?Qi+e:e;return t._events[i]?t._events[i].fn?t._events[i]=[t._events[i],s]:t._events[i].push(s):(t._events[i]=s,t._eventsCount++),t}n(qCe,"addListener");function TB(t,e){--t._eventsCount===0?t._events=new k2:delete t._events[e]}n(TB,"clearEvent");function yi(){this._events=new k2,this._eventsCount=0}n(yi,"EventEmitter");yi.prototype.eventNames=n(function(){var e=[],o,r;if(this._eventsCount===0)return e;for(r in o=this._events)Irt.call(o,r)&&e.push(Qi?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(o)):e},"eventNames");yi.prototype.listeners=n(function(e){var o=Qi?Qi+e:e,r=this._events[o];if(!r)return[];if(r.fn)return[r.fn];for(var a=0,s=r.length,i=new Array(s);a<s;a++)i[a]=r[a].fn;return i},"listeners");yi.prototype.listenerCount=n(function(e){var o=Qi?Qi+e:e,r=this._events[o];return r?r.fn?1:r.length:0},"listenerCount");yi.prototype.emit=n(function(e,o,r,a,s,i){var c=Qi?Qi+e:e;if(!this._events[c])return!1;var d=this._events[c],f=arguments.length,p,m;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),f){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,o),!0;case 3:return d.fn.call(d.context,o,r),!0;case 4:return d.fn.call(d.context,o,r,a),!0;case 5:return d.fn.call(d.context,o,r,a,s),!0;case 6:return d.fn.call(d.context,o,r,a,s,i),!0}for(m=1,p=new Array(f-1);m<f;m++)p[m-1]=arguments[m];d.fn.apply(d.context,p)}else{var h=d.length,v;for(m=0;m<h;m++)switch(d[m].once&&this.removeListener(e,d[m].fn,void 0,!0),f){case 1:d[m].fn.call(d[m].context);break;case 2:d[m].fn.call(d[m].context,o);break;case 3:d[m].fn.call(d[m].context,o,r);break;case 4:d[m].fn.call(d[m].context,o,r,a);break;default:if(!p)for(v=1,p=new Array(f-1);v<f;v++)p[v-1]=arguments[v];d[m].fn.apply(d[m].context,p)}}return!0},"emit");yi.prototype.on=n(function(e,o,r){return qCe(this,e,o,r,!1)},"on");yi.prototype.once=n(function(e,o,r){return qCe(this,e,o,r,!0)},"once");yi.prototype.removeListener=n(function(e,o,r,a){var s=Qi?Qi+e:e;if(!this._events[s])return this;if(!o)return TB(this,s),this;var i=this._events[s];if(i.fn)i.fn===o&&(!a||i.once)&&(!r||i.context===r)&&TB(this,s);else{for(var c=0,d=[],f=i.length;c<f;c++)(i[c].fn!==o||a&&!i[c].once||r&&i[c].context!==r)&&d.push(i[c]);d.length?this._events[s]=d.length===1?d[0]:d:TB(this,s)}return this},"removeListener");yi.prototype.removeAllListeners=n(function(e){var o;return e?(o=Qi?Qi+e:e,this._events[o]&&TB(this,o)):(this._events=new k2,this._eventsCount=0),this},"removeAllListeners");yi.prototype.off=yi.prototype.removeListener;yi.prototype.addListener=yi.prototype.on;yi.prefixed=Qi;yi.EventEmitter=yi;typeof DK<"u"&&(DK.exports=yi)});var WFe=Ct(an=>{"use strict";(function(){"use strict";var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),x=!1,y=!1,b=!1,S=!1,w=!1,C;C=Symbol.for("react.module.reference");function F(ue){return!!(typeof ue=="string"||typeof ue=="function"||ue===o||ue===a||w||ue===r||ue===f||ue===p||S||ue===v||x||y||b||typeof ue=="object"&&ue!==null&&(ue.$$typeof===h||ue.$$typeof===m||ue.$$typeof===s||ue.$$typeof===i||ue.$$typeof===d||ue.$$typeof===C||ue.getModuleId!==void 0))}n(F,"isValidElementType");function T(ue){if(typeof ue=="object"&&ue!==null){var he=ue.$$typeof;switch(he){case t:var Re=ue.type;switch(Re){case o:case a:case r:case f:case p:return Re;default:var Ae=Re&&Re.$$typeof;switch(Ae){case c:case i:case d:case h:case m:case s:return Ae;default:return he}}case e:return he}}}n(T,"typeOf");var E=i,k=s,P=t,_=d,M=o,L=h,U=m,W=e,V=a,j=r,N=f,D=p,B=!1,z=!1;function q(ue){return B||(B=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}n(q,"isAsyncMode");function H(ue){return z||(z=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}n(H,"isConcurrentMode");function Y(ue){return T(ue)===i}n(Y,"isContextConsumer");function Q(ue){return T(ue)===s}n(Q,"isContextProvider");function X(ue){return typeof ue=="object"&&ue!==null&&ue.$$typeof===t}n(X,"isElement");function te(ue){return T(ue)===d}n(te,"isForwardRef");function ae(ue){return T(ue)===o}n(ae,"isFragment");function se(ue){return T(ue)===h}n(se,"isLazy");function J(ue){return T(ue)===m}n(J,"isMemo");function ne(ue){return T(ue)===e}n(ne,"isPortal");function pe(ue){return T(ue)===a}n(pe,"isProfiler");function le(ue){return T(ue)===r}n(le,"isStrictMode");function ie(ue){return T(ue)===f}n(ie,"isSuspense");function de(ue){return T(ue)===p}n(de,"isSuspenseList"),an.ContextConsumer=E,an.ContextProvider=k,an.Element=P,an.ForwardRef=_,an.Fragment=M,an.Lazy=L,an.Memo=U,an.Portal=W,an.Profiler=V,an.StrictMode=j,an.Suspense=N,an.SuspenseList=D,an.isAsyncMode=q,an.isConcurrentMode=H,an.isContextConsumer=Y,an.isContextProvider=Q,an.isElement=X,an.isForwardRef=te,an.isFragment=ae,an.isLazy=se,an.isMemo=J,an.isPortal=ne,an.isProfiler=pe,an.isStrictMode=le,an.isSuspense=ie,an.isSuspenseList=de,an.isValidElementType=F,an.typeOf=T})()});var KFe=Ct((WVo,GFe)=>{"use strict";GFe.exports=WFe()});var OOe=K(lae(),1);var Fw=K(Ro(),1);var fae=n(()=>{let t=null;return{get:n(()=>t,"get"),set:n(e=>{t=e},"set")}},"createInMemoryBookmarkStorage");var pae="_creationTime",xLe=n(t=>{if(typeof t!="object"||t===null)return;let e=t._id;return typeof e=="string"?e:void 0},"rowId"),yLe=n((t,e)=>{let o=e[pae];if(typeof o!="number")return t.length;for(let[r,a]of t.entries()){let s=a[pae];if(typeof s=="number"&&s>o)return r}return t.length},"insertionIndex"),mae=n(t=>{if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.key=="string"&&typeof e.table=="string"&&(e.op==="insert"||e.op==="update"||e.op==="delete")},"isMutationDelta"),hae=n((t,e)=>{if(!Array.isArray(t))return;let o=[];for(let d of t){if(xLe(d)===void 0)return;o.push(d)}let{key:r,op:a,row:s}=e;if(a==="delete"){let d=o.filter(f=>f._id!==r);return d.length===o.length?[...o]:d}if(s===void 0)return;let i=o.findIndex(d=>d._id===r);if(i===-1){let d=[...o];return d.splice(yLe(o,s),0,s),d}let c=[...o];return c[i]=s,c},"applyDelta");var gae=n((t,e,o,r)=>{let a=[],s=n((c,d)=>{for(let f of t.all())if(f.fn.__lunoraRef===c&&f.shardKey===e&&f.argsKey===d)return f},"findState");return{rollbacks:a,store:{getAllQueries:n(c=>{let d=[];for(let f of t.all())f.fn.__lunoraRef===c.__lunoraRef&&f.shardKey===e&&d.push({args:f.args,value:f.lastValue});return d},"getAllQueries"),getQuery:n((c,d)=>s(c.__lunoraRef,r(d??{}))?.lastValue,"getQuery"),setQuery:n((c,d,f)=>{let p=s(c.__lunoraRef,r(d??{}));p&&a.push(o(p,f))},"setQuery")}}},"createLocalStore");var ILe=n((t,e)=>t<e?-1:t>e?1:0,"compareKeys"),VI=n(t=>{if(t===void 0)return"null";if(t===null||typeof t!="object")return JSON.stringify(t);if(Array.isArray(t))return`[${t.map(a=>VI(a)).join(",")}]`;let e=t,o=Object.keys(e).toSorted(ILe),r=[];for(let a of o){let s=e[a];s!==void 0&&r.push(`${JSON.stringify(a)}:${VI(s)}`)}return`{${r.join(",")}}`},"stableStringify"),UI=class t{static{n(this,"SubscriptionRegistry")}static key(e,o,r){return`${e}::${VI(o)}::${r??""}`}byKey=new Map;byId=new Map;get(e){return this.byKey.get(e)}getById(e){return this.byId.get(e)}add(e){this.byKey.set(t.key(e.fn.__lunoraRef,e.args,e.shardKey),e),this.byId.set(e.id,e)}remove(e){this.byKey.delete(t.key(e.fn.__lunoraRef,e.args,e.shardKey)),this.byId.delete(e.id)}all(){return[...this.byKey.values()]}};var vae=0,eM=n(()=>{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();vae+=1;let t=typeof crypto<"u"&&typeof crypto.getRandomValues=="function"?[...crypto.getRandomValues(new Uint8Array(8))].map(e=>e.toString(16).padStart(2,"0")).join(""):Math.random().toString(16).slice(2,12);return`m_${Date.now().toString(36)}_${vae.toString(36)}_${t}`},"nextId"),Zk=n((t,e,o,r)=>{if(t){t({error:o,mutationId:r,operation:e});return}console.warn(`[lunora] offline-queue persistence ${e} failed`,o)},"reportPersistenceError"),Jk=class{static{n(this,"OfflineQueue")}queueBeforeFirstConnect;maxItems;onPersistenceError;persistence;items=[];constructor(e={},o){this.maxItems=e.maxItems??1e3,this.queueBeforeFirstConnect=e.queueBeforeFirstConnect??!1,this.onPersistenceError=e.onPersistenceError,this.persistence=o}get size(){return this.items.length}enqueue(e){let o=e;for(o.id??=eM(),this.items.push(o),this.persistence?.append({args:o.args,functionPath:o.functionPath,id:o.id,identity:o.identity,shardKey:o.shardKey}).catch(r=>{Zk(this.onPersistenceError,"append",r,o.id)});this.items.length>this.maxItems;){let r=this.items.shift();if(r){r.id&&this.persistence?.remove(r.id).catch(s=>{Zk(this.onPersistenceError,"remove",s,r.id)});let a=new Error("offline queue overflow");a.code="OFFLINE_QUEUE_OVERFLOW",r.reject(a)}}}async hydrate(){if(!this.persistence)return[];let e=await this.persistence.load(),o=new Set;for(let r of e)this.items.some(a=>a.id===r.id)||(this.items.push({args:r.args,functionPath:r.functionPath,id:r.id,identity:r.identity,reject:n(()=>{},"reject"),resolve:n(()=>{},"resolve"),shardKey:r.shardKey}),o.add(r.shardKey));return[...o]}drain(e){if(!e){let a=[...this.items];return this.items.length=0,a}let o=[],r=[];for(let a of this.items)(e(a)?o:r).push(a);return this.items.length=0,this.items.push(...r),o}requeue(e){e.length!==0&&this.items.unshift(...e)}clear(){for(let e of this.items){let o=new Error("CLIENT_CLOSED");o.code="CLIENT_CLOSED",e.reject(o)}this.items.length=0}};var Sz=n((t,e,o)=>`${t}::${e}::${o??""}`,"queryCacheKey");var wz=n((t={},e=Math.random)=>{let o=t.initialDelayMs??250,r=t.maxDelayMs??3e4,a=t.jitter??!0,s=0;return{next(){let i=Math.min(r,o*2**s);if(s+=1,!a)return i;let c=i/2;return Math.floor(c+e()*(i-c))},reset(){s=0}}},"createReconnect");var xae=n(t=>{let e=t.maxBuffer??1024,o=[],r=[],a=!1,s,i=!1,c=n(()=>{let m=r.shift();if(!m)return!1;if(s)return m.reject(s),!0;if(o.length>0){let h=o.shift();return m.resolve({done:!1,value:h}),!0}return a?(m.resolve({done:!0,value:void 0}),!0):(r.unshift(m),!1)},"flushOne"),d={complete(){if(!(a||s))for(a=!0;c(););},fail(m){if(!(a||s))for(s=m,o.length=0;c(););},push(m){if(!(a||s||i)){if(o.length>=e){d.fail(Object.assign(new Error(`stream buffer overflow (max=${e.toString()}); the consumer cannot keep up with the producer`),{code:"STREAM_BACKPRESSURE"}));return}o.push(m),c()}}},f=n(()=>{if(!i){i=!0,a=!0,o.length=0;try{t.onCancel()}catch{}for(;c(););}},"cancel");return{handle:d,iterable:{cancel:f,[Symbol.asyncIterator](){return{next(){if(s)return Promise.reject(s);if(o.length>0){let m=o.shift();return Promise.resolve({done:!1,value:m})}return a?Promise.resolve({done:!0,value:void 0}):new Promise((m,h)=>{r.push({reject:h,resolve:m})})},return(){return f(),Promise.resolve({done:!0,value:void 0})}}}}}},"createStream");var bLe="/_lunora/rpc",SLe="/_lunora/ws",Cz=n(t=>t===void 0||t===""?"":`&bucket=${encodeURIComponent(t)}`,"bucketQuery"),Fz=n(t=>{for(let e=t.length-1;e>=0;e-=1)t[e]?.()},"rollbackOptimistic"),wLe=n((t,e)=>{for(let o of e)o.op==="delete"?t.delete(o.key):o.value!==void 0&&t.set(o.key,o.value)},"applyRowOpsToView"),CLe="lunora-ping",FLe=3e4,RLe=1e4,ELe=250,ALe=64,TLe="/_lunora/admin/shard-traffic",kLe="/_lunora/admin/scheduled",MLe="/_lunora/admin/scheduled/status",PLe="/_lunora/admin/scheduled/ws",OLe="/_lunora/admin/scheduled/cancel",NLe="/_lunora/admin/scheduled/dead",DLe="/_lunora/admin/scheduled/dead/retry",_Le="/_lunora/admin/scheduled/dead/cancel",LLe="/_lunora/admin/workflows/instances",BLe="/_lunora/admin/workflows/instance",VLe="/_lunora/admin/workflows/status",tM="/_lunora/admin/storage",ULe="/_lunora/admin/storage/url",zLe="/_lunora/admin/storage/buckets",HLe="/_lunora/admin/functions",$Le="/_lunora/admin/cron-jobs",jLe="/_lunora/admin/cron-jobs/run",qLe="/_lunora/admin/openapi",WLe="/_lunora/admin/openrpc",GLe="/_lunora/admin/global/tables",KLe="/_lunora/admin/global/table",YLe="/_lunora/admin/global/facet",XLe="/_lunora/admin/vector/indexes",QLe="/_lunora/admin/vector/query",ZLe="/_lunora/admin/auth/users",yae="/_lunora/admin/auth/sessions",JLe="/_lunora/admin/auth/users/create",e3e="/_lunora/admin/auth/users/role",t3e="/_lunora/admin/auth/users/ban",o3e="/_lunora/admin/auth/users/unban",r3e="/_lunora/admin/auth/users/password",n3e="/_lunora/admin/auth/users/remove",a3e="/_lunora/admin/auth/users/impersonate",s3e="/_lunora/admin/auth/sessions/revoke",i3e="/_lunora/admin/auth/sessions/revoke-all",l3e="/_lunora/admin/auth/capabilities",c3e="/_lunora/admin/auth/users/update",u3e="/_lunora/admin/auth/accounts",d3e="/_lunora/admin/auth/accounts/unlink",f3e="/_lunora/admin/auth/passkeys",p3e="/_lunora/admin/auth/passkeys/delete",m3e="/_lunora/admin/auth/two-factor/disable",h3e="/_lunora/admin/auth/organizations",g3e="/_lunora/admin/auth/organizations/members",v3e="/_lunora/admin/auth/organizations/invitations",x3e="/_lunora/admin/auth/organizations/members/remove",y3e="/_lunora/admin/auth/organizations/invitations/cancel",I3e="/api/auth",b3e="/get-session",Iae=n(t=>t.startsWith("https://")?`wss://${t.slice(8)}`:t.startsWith("http://")?`ws://${t.slice(7)}`:t,"deriveWsUrl"),tF=n((t,e)=>`${t.endsWith("/")?t.slice(0,-1):t}${e}`,"joinUrl"),zI=n((t,e)=>{let o=new URLSearchParams;for(let[a,s]of Object.entries(e))s!==void 0&&s!==""&&o.set(a,String(s));let r=o.toString();return r===""?t:`${t}?${r}`},"withQuery"),oi=n(t=>t??"","connectionKey"),wae=n((t,e)=>{let o=t.lastValue,r=t.serverVersion;t.lastValue=e;for(let a of t.callbacks)try{a(e)}catch{}return()=>{if(!(t.serverVersion>r)&&t.lastValue===e){t.lastValue=o;for(let a of t.callbacks)try{a(o)}catch{}}}},"writeOptimisticToState"),S3e=n((t,e)=>{let o;try{o=e(t.lastValue)}catch{return}return wae(t,o)},"applyOptimisticToState"),w3e=n(t=>{let e=t.error,o=typeof e?.code=="string"?e.code:void 0,r=typeof e?.message=="string"?e.message:void 0,a=(typeof t.message=="string"?t.message:void 0)??r??"stream error";return Object.assign(new Error(a),o===void 0?void 0:{code:o})},"buildStreamError"),bae=n(t=>{let e=t.error,o=typeof e?.code=="string"?e.code:void 0,r=typeof e?.message=="string"?e.message:void 0;return{message:(typeof t.message=="string"?t.message:void 0)??r??"subscription error",...o===void 0?{}:{code:o}}},"buildSubscriptionError"),Sae=n((t,e)=>{for(let o of t)try{o(e)}catch{}},"fanSubscriptionError"),C3e=new TextDecoder,F3e=n(t=>{if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return C3e.decode(t)},"decodeServerFrame"),Kl=n((t,e)=>{if(!t.socket||t.wsState!=="open")return!1;try{return t.socket.send(JSON.stringify(e)),!0}catch{return!1}},"sendOn"),oF=class t{static{n(this,"LunoraClient")}static MAX_POKE_BUFFERS=256;url;wsUrl;wsToken;authBasePath;fetchImpl;WebSocketImpl;bookmark;reconnectOptions;connectTimeoutMs;heartbeatIntervalMs;offlineQueue;outbox;clientId;clientWatermarks=new Map;outboxMutationCounter=0;onPersistenceError;persistence;queryCache;hydratedQueryCache=new Map;pendingCacheWrites=new Map;cacheFlushTimer;subscriptions=new UI;connections=new Map;defaultConnectionContext;connectionContexts=new Map;connectionContextHolders=new Map;authToken=null;queuedIdentities=new Map;closed=!1;authTokenListeners=new Set;statusListeners=new Set;tokenExpiredListeners=new Set;whisperHandlers=new Map;lastStatus="idle";nextSubId=0;nextStreamId=0;streams=new Map;shapeSubscriptions=new Map;pokeBuffers=new Map;nextShapeId=0;constructor(e){this.url=e.url,this.wsUrl=e.wsUrl??tF(Iae(e.url),SLe),this.wsToken=e.wsToken;let o=e.authBasePath??I3e;this.authBasePath=o.endsWith("/")?o.slice(0,-1):o,this.fetchImpl=e.fetch??(typeof fetch=="function"?fetch.bind(globalThis):void 0),this.WebSocketImpl=e.WebSocket??(typeof WebSocket=="function"?WebSocket:void 0),this.bookmark=e.bookmarkStorage??fae(),this.reconnectOptions=e.reconnect,this.heartbeatIntervalMs=e.heartbeatIntervalMs??FLe,this.connectTimeoutMs=e.connectTimeoutMs??RLe,this.defaultConnectionContext=e.connectionContext,this.persistence=e.persistence,this.queryCache=e.queryCache===!1?void 0:e.queryCache,this.onPersistenceError=e.offlineQueue?.onPersistenceError,this.offlineQueue=new Jk(e.offlineQueue,e.persistence),this.outbox=e.outbox,this.clientId=e.clientId??`client-${eM()}`,this.persistence&&queueMicrotask(()=>{this.hydratePersistedQueue().catch(()=>{})}),this.queryCache&&queueMicrotask(()=>{this.hydrateQueryCache().catch(()=>{})})}setAuthToken(e){if(this.authToken!==e){this.authToken=e,this.rejectQueuedForIdentityChange();for(let o of this.authTokenListeners)try{o(e)}catch{}}}getAuthToken(){return this.authToken}currentIdentity(){return this.identityFingerprint()}clientIdentifier(){return this.clientId}confirmedMutationWatermark(e){return this.clientWatermarks.get(e??"")??0}async callMutator(e,o,r){let a=r?.clientSeq;if(a!==void 0&&(!Number.isInteger(a)||a<=0))throw new Error(`callMutator: clientSeq must be a positive integer, got ${String(a)}`);let s=r?.shardKey??"",i,c=await this.rpc(e,o,r?.shardKey,{captureBookmark:!0,clientId:this.clientId,clientSeq:a,onMutationAck:n(f=>{i=f},"onMutationAck")});return i!==void 0&&i>(this.clientWatermarks.get(s)??0)&&this.clientWatermarks.set(s,i),{applied:i===void 0||i===a,result:c}}onAuthTokenChange(e){return this.authTokenListeners.add(e),()=>{this.authTokenListeners.delete(e)}}async getCurrentUser(){if(this.closed||!this.fetchImpl)return null;let e={};this.authToken&&(e.authorization=`Bearer ${this.authToken}`);try{let o=await this.fetchImpl(tF(this.url,`${this.authBasePath}${b3e}`),{credentials:"include",headers:e,method:"GET"});return o.ok?(await o.json())?.user??null:null}catch{return null}}setWsToken(e){if(this.wsToken!==e){this.wsToken=e;for(let o of this.connections.values())if(o.socket)try{o.socket.close()}catch{}}}setConnectionContext(e,o={}){let r=oi(o.shardKey);e===void 0?this.connectionContexts.delete(r):this.connectionContexts.set(r,e),this.refreshConnectionContext(r)}acquireConnectionContext(e,o={}){let r=oi(o.shardKey),a={context:e},s=this.connectionContextHolders.get(r);s?s.push(a):this.connectionContextHolders.set(r,[a]),this.refreshConnectionContext(r);let i=!1;return()=>{if(i)return;i=!0;let c=this.connectionContextHolders.get(r);if(!c)return;let d=c.indexOf(a);d!==-1&&c.splice(d,1),c.length===0&&this.connectionContextHolders.delete(r),this.refreshConnectionContext(r)}}whisperSubscribe(e,o,r={}){let a=oi(r.shardKey),s=this.whisperHandlers.get(a);s||(s=new Map,this.whisperHandlers.set(a,s));let i=s.get(e),c=i===void 0;if(i||(i=new Set,s.set(e,i)),i.add(o),this.ensureSocket(r.shardKey),c){let d=this.getConnection(r.shardKey);d&&Kl(d,{topic:e,type:"whisper_subscribe"})}return()=>{let d=this.whisperHandlers.get(a),f=d?.get(e);if(!f?.delete(o)||f.size>0)return;d?.delete(e),d?.size===0&&this.whisperHandlers.delete(a);let p=this.getConnection(r.shardKey);p&&Kl(p,{topic:e,type:"whisper_unsubscribe"})}}whisper(e,o,r={}){this.ensureSocket(r.shardKey);let a=this.getConnection(r.shardKey);a&&Kl(a,{data:o,topic:e,type:"whisper"})}onTokenExpired(e){return this.tokenExpiredListeners.add(e),()=>{this.tokenExpiredListeners.delete(e)}}connectionStatus(){return this.computeStatus()}onConnectionStatus(e){return this.statusListeners.add(e),e(this.computeStatus()),()=>{this.statusListeners.delete(e)}}async query(e,o,r={}){if(this.closed)throw new Error("LunoraClient is closed");return await this.rpc(e.__lunoraRef,o,r.shardKey,{attachBookmark:!0})}async mutation(e,o,r={}){if(this.closed)throw new Error("LunoraClient is closed");let a=o,s=r.mutationId??eM(),i=this.applyOptimisticUpdates(e.__lunoraRef,a,r.shardKey,r.optimistic);r.optimisticUpdate&&this.applyOptimisticUpdate(r.optimisticUpdate,o,r.shardKey,i);let c=this.getConnection(r.shardKey),d=c?.wsState??"idle",f=c?.socket!==void 0,p=c?.wasEverConnected??!1,{queueBeforeFirstConnect:m}=this.offlineQueue,h=p||m,v=this.WebSocketImpl!==void 0&&h;if(d!=="open"&&!f&&v||d==="connecting"&&h)return this.enqueueOfflineMutation(e,a,r.shardKey,s,i);try{return await this.rpc(e.__lunoraRef,a,r.shardKey,{captureBookmark:!0,mutationId:s})}catch(y){throw Fz(i),y}}async action(e,o,r={}){if(this.closed)throw new Error("LunoraClient is closed");return await this.rpc(e.__lunoraRef,o,r.shardKey)}async shardTraffic(e){if(this.closed)throw new Error("LunoraClient is closed");let o=await this.adminFetch(TLe,"POST",{table:e});return{failed:o.failed??0,ok:o.ok??0,shards:o.shards??[]}}async listScheduledJobs(){if(this.closed)throw new Error("LunoraClient is closed");return(await this.adminFetch(kLe,"GET")).records??[]}async schedulerStatus(){if(this.closed)throw new Error("LunoraClient is closed");let e=await this.adminFetch(MLe,"GET");return{backlog:e.backlog??0,inFlight:e.inFlight??0,pools:e.pools??[]}}async cancelScheduledJob(e){if(this.closed)throw new Error("LunoraClient is closed");return{cancelled:(await this.adminFetch(OLe,"POST",{id:e})).cancelled===!0}}async listDeadJobs(){if(this.closed)throw new Error("LunoraClient is closed");return(await this.adminFetch(NLe,"GET")).records??[]}async retryDeadJob(e){if(this.closed)throw new Error("LunoraClient is closed");return{retried:(await this.adminFetch(DLe,"POST",{id:e})).retried===!0}}async removeDeadJob(e){if(this.closed)throw new Error("LunoraClient is closed");return{removed:(await this.adminFetch(_Le,"POST",{id:e})).removed===!0}}async listWorkflowInstances(e){if(this.closed)throw new Error("LunoraClient is closed");let o=new URLSearchParams({name:e.name});e.status!==void 0&&o.set("status",e.status),e.page!==void 0&&o.set("page",String(e.page)),e.perPage!==void 0&&o.set("perPage",String(e.perPage));let r=await this.adminFetch(`${LLe}?${o.toString()}`,"GET");return{configured:r.configured,instances:r.instances??[],page:r.page??1,perPage:r.perPage??e.perPage??0,totalCount:r.totalCount}}async getWorkflowInstance(e){if(this.closed)throw new Error("LunoraClient is closed");let o=new URLSearchParams({id:e.id,name:e.name}),r=await this.adminFetch(`${BLe}?${o.toString()}`,"GET");return{createdOn:r.createdOn,endedOn:r.endedOn,error:r.error,id:r.id??e.id,output:r.output,params:r.params,startedOn:r.startedOn,status:r.status??"unknown",steps:r.steps??[]}}async setWorkflowInstanceStatus(e){if(this.closed)throw new Error("LunoraClient is closed");return{status:(await this.adminFetch(VLe,"POST",{action:e.action,id:e.id,name:e.name})).status??"unknown"}}subscribeScheduledJobs(e){if(this.closed)throw new Error("LunoraClient is closed");if(this.WebSocketImpl===void 0)return()=>{};let o=tF(Iae(this.url),PLe),r=wz(this.reconnectOptions),a,s,i=!1,c=n(()=>{if(i||this.WebSocketImpl===void 0)return;let d=this.wsToken===void 0?o:`${o}?token=${encodeURIComponent(this.wsToken)}`;a=new this.WebSocketImpl(d),a.addEventListener("open",()=>{r.reset()}),a.addEventListener("message",f=>{try{let p=JSON.parse(typeof f.data=="string"?f.data:"");p.type==="jobs"&&Array.isArray(p.records)&&e(p.records)}catch{}}),a.addEventListener("close",()=>{a=void 0,i||(s=setTimeout(c,r.next()))}),a.addEventListener("error",()=>{})},"connect");return c(),()=>{i=!0,s!==void 0&&clearTimeout(s),a?.close()}}async listFunctions(){if(this.closed)throw new Error("LunoraClient is closed");return(await this.adminFetch(HLe,"GET")).functions??[]}async getCronJobs(){if(this.closed)throw new Error("LunoraClient is closed");return(await this.adminFetch($Le,"GET")).jobs??[]}async runCronJob(e){if(this.closed)throw new Error("LunoraClient is closed");let o=await this.adminFetch(jLe,"POST",{name:e});return{name:o.name??e,ran:o.ran===!0}}async fetchOpenApi(){if(this.closed)throw new Error("LunoraClient is closed");return await this.adminFetch(qLe,"GET")}async fetchOpenRpc(){if(this.closed)throw new Error("LunoraClient is closed");return await this.adminFetch(WLe,"GET")}async listStorageObjects(e={}){if(this.closed)throw new Error("LunoraClient is closed");let o=new URLSearchParams;e.prefix!==void 0&&e.prefix!==""&&o.set("prefix",e.prefix),e.cursor!==void 0&&e.cursor!==""&&o.set("cursor",e.cursor),e.limit!==void 0&&o.set("limit",String(e.limit)),e.bucket!==void 0&&e.bucket!==""&&o.set("bucket",e.bucket);let r=o.toString(),a=r===""?tM:`${tM}?${r}`,s=await this.adminFetch(a,"GET");return{cursor:s.cursor,objects:s.objects??[]}}async deleteStorageObject(e,o){if(this.closed)throw new Error("LunoraClient is closed");let r=`${tM}?key=${encodeURIComponent(e)}${Cz(o?.bucket)}`,a=await this.adminFetch(r,"DELETE");return{deleted:a.deleted??!0,key:a.key??e}}async listStorageBuckets(){if(this.closed)throw new Error("LunoraClient is closed");return(await this.adminFetch(zLe,"GET")).buckets??[]}async uploadStorageObject(e){if(this.closed)throw new Error("LunoraClient is closed");let o=`${tM}?key=${encodeURIComponent(e.key)}${Cz(e.bucket)}`,r=await this.adminFetch(o,"PUT",e.body,e.contentType);return{etag:r.etag,key:r.key??e.key}}async signedStorageUrl(e,o){if(this.closed)throw new Error("LunoraClient is closed");let r=o?.expiresInSeconds,a=r===void 0?"":`&expiresIn=${encodeURIComponent(r.toString())}`,s=`${ULe}?key=${encodeURIComponent(e)}${a}${Cz(o?.bucket)}`,i=await this.adminFetch(s,"GET");if(typeof i.url!="string")throw new TypeError("LunoraClient: storage URL endpoint returned no `url`");return i.url}async listGlobalTables(){if(this.closed)throw new Error("LunoraClient is closed");return await this.adminFetch(GLe,"GET")}async readGlobalTablePage(e){if(this.closed)throw new Error("LunoraClient is closed");let o=new URLSearchParams({table:e.table});return e.limit!==void 0&&o.set("limit",String(e.limit)),e.offset!==void 0&&o.set("offset",String(e.offset)),e.filters!==void 0&&e.filters.length>0&&o.set("filters",JSON.stringify(e.filters)),await this.adminFetch(`${KLe}?${o.toString()}`,"GET")}async facetGlobalColumn(e){if(this.closed)throw new Error("LunoraClient is closed");let o=new URLSearchParams({column:e.column,table:e.table});return e.limit!==void 0&&o.set("limit",String(e.limit)),e.filters!==void 0&&e.filters.length>0&&o.set("filters",JSON.stringify(e.filters)),await this.adminFetch(`${YLe}?${o.toString()}`,"GET")}async listVectorIndexes(){if(this.closed)throw new Error("LunoraClient is closed");return(await this.adminFetch(XLe,"GET")).indexes??[]}async queryVectorIndex(e){if(this.closed)throw new Error("LunoraClient is closed");return(await this.adminFetch(QLe,"POST",e)).matches??[]}async listAuthUsers(e={}){if(this.closed)throw new Error("LunoraClient is closed");let o=zI(ZLe,{filterField:e.filterField,filterValue:e.filterValue,limit:e.limit,offset:e.offset,search:e.search,searchField:e.searchField,sortBy:e.sortBy,sortDirection:e.sortDirection});return await this.adminFetch(o,"GET")}async createAuthUser(e){return await this.adminFetch(JLe,"POST",e)}async setAuthUserRole(e){return await this.adminFetch(e3e,"POST",e)}async banAuthUser(e){return await this.adminFetch(t3e,"POST",e)}async unbanAuthUser(e){return await this.adminFetch(o3e,"POST",e)}async setAuthUserPassword(e){await this.adminFetch(r3e,"POST",e)}async removeAuthUser(e){await this.adminFetch(n3e,"POST",e)}async impersonateAuthUser(e){return await this.adminFetch(a3e,"POST",e)}async revokeAuthSession(e){await this.adminFetch(s3e,"POST",e)}async revokeAuthUserSessions(e){await this.adminFetch(i3e,"POST",e)}async getAuthCapabilities(){return await this.adminFetch(l3e,"GET")}async updateAuthUser(e){return await this.adminFetch(c3e,"POST",e)}async listAuthAccounts(e){return await this.adminFetch(zI(u3e,{userId:e.userId}),"GET")}async unlinkAuthAccount(e){await this.adminFetch(d3e,"POST",e)}async listAuthPasskeys(e){return await this.adminFetch(zI(f3e,{userId:e.userId}),"GET")}async deleteAuthPasskey(e){await this.adminFetch(p3e,"POST",e)}async disableAuthTwoFactor(e){await this.adminFetch(m3e,"POST",e)}async listAuthOrganizations(e={}){return await this.adminFetch(zI(h3e,{limit:e.limit,offset:e.offset}),"GET")}async listAuthOrgMembers(e){let o=zI(g3e,{limit:e.limit,offset:e.offset,organizationId:e.organizationId});return await this.adminFetch(o,"GET")}async listAuthOrgInvitations(e){let o=zI(v3e,{limit:e.limit,offset:e.offset,organizationId:e.organizationId});return await this.adminFetch(o,"GET")}async removeAuthOrgMember(e){await this.adminFetch(x3e,"POST",e)}async cancelAuthOrgInvitation(e){await this.adminFetch(y3e,"POST",e)}async listAuthSessions(e={}){if(this.closed)throw new Error("LunoraClient is closed");let o=new URLSearchParams;e.userId!==void 0&&e.userId!==""&&o.set("userId",e.userId),e.limit!==void 0&&o.set("limit",String(e.limit)),e.offset!==void 0&&o.set("offset",String(e.offset));let r=o.toString();return await this.adminFetch(r===""?yae:`${yae}?${r}`,"GET")}subscribe(e,o,r,a={}){if(this.closed)throw new Error("LunoraClient is closed");let s=o??{},i=UI.key(e.__lunoraRef,s,a.shardKey),c=this.subscriptions.get(i),d=r,f=a.onError;if(!c){this.nextSubId+=1;let m=`sub_${this.nextSubId.toString()}`,h=VI(s),v=this.takeHydratedCache(e.__lunoraRef,h,a.shardKey);c={acked:!1,args:s,argsKey:h,callbacks:new Set,checkpointCallbacks:new Set,errorCallbacks:new Set,fn:e,id:m,lastValue:v?.value,serverCursor:v?.serverCursor,serverVersion:0,shardKey:a.shardKey,...v?.serverEpoch===void 0?{}:{serverEpoch:v.serverEpoch}},this.subscriptions.add(c)}if(c.callbacks.add(d),f&&c.errorCallbacks.add(f),a.onCheckpoint&&c.checkpointCallbacks.add(a.onCheckpoint),c.lastValue!==void 0)try{d(c.lastValue)}catch{}this.ensureSocket(a.shardKey),this.sendSubscribeIfOpen(c);let p=c;return()=>{if(p.callbacks.delete(d),f&&p.errorCallbacks.delete(f),a.onCheckpoint&&p.checkpointCallbacks.delete(a.onCheckpoint),p.callbacks.size===0){let m=this.getConnection(p.shardKey);!(m&&Kl(m,{id:p.id,type:"unsubscribe"}))&&m&&m.pendingUnsubscribes.push({id:p.id,type:"unsubscribe"}),this.subscriptions.remove(p)}}}subscribeShape(e,o,r={}){if(this.closed)throw new Error("LunoraClient is closed");this.nextShapeId+=1;let a=`shape_${this.nextShapeId.toString()}`,s={args:e.args,callbacks:new Set([o]),errorCallbacks:r.onError?new Set([r.onError]):new Set,id:a,name:e.name,onCheckpoint:r.onCheckpoint,rows:new Map,shardKey:r.shardKey};return this.shapeSubscriptions.set(a,s),this.ensureSocket(r.shardKey),this.sendShapeSubscribeIfOpen(s),()=>{this.shapeSubscriptions.delete(a);let i=this.getConnection(s.shardKey);!(i&&Kl(i,{id:a,type:"shape_unsubscribe"}))&&i&&i.pendingUnsubscribes.push({id:a,type:"shape_unsubscribe"})}}stream(e,o,r={}){if(this.closed)throw new Error("LunoraClient is closed");if(this.WebSocketImpl===void 0)throw new Error("LunoraClient: streams require a WebSocket implementation");this.nextStreamId+=1;let a=`stream_${this.nextStreamId.toString()}`,{shardKey:s}=r,i=o??{},{handle:c,iterable:d}=xae({maxBuffer:r.maxBuffer,onCancel:n(()=>{let h=this.getConnection(s);h&&Kl(h,{id:a,type:"unsubscribe"}),this.streams.delete(a)},"onCancel")});this.streams.set(a,{handle:c,shardKey:s}),this.ensureSocket(s);let f=this.getConnection(s),p={id:a,query:{args:i,functionPath:e.__lunoraRef,shardKey:s},type:"stream"};if(!(f?.wsState==="open"&&Kl(f,p))&&f){for(f.pendingStreams=f.pendingStreams??[];f.pendingStreams.length>=ALe;){let v=f.pendingStreams.shift()?.id,x=v?this.streams.get(v):void 0;x&&(x.handle.fail(Object.assign(new Error("stream-start frame evicted while socket was unreachable"),{code:"STREAM_QUEUE_OVERFLOW"})),this.streams.delete(v))}f.pendingStreams.push(p)}return d}close(){this.closed=!0;for(let e of this.streams.values())e.handle.fail(Object.assign(new Error("LunoraClient closed"),{code:"CLIENT_CLOSED"}));this.streams.clear();for(let e of this.connections.values()){if(e.reconnectTimer!==void 0&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=void 0),e.connectTimer!==void 0&&(clearTimeout(e.connectTimer),e.connectTimer=void 0),this.stopHeartbeat(e),e.socket){try{e.socket.close()}catch{}e.socket=void 0}e.wsState="closed"}this.offlineQueue.clear(),this.queuedIdentities.clear(),this.cacheFlushTimer!==void 0&&(clearTimeout(this.cacheFlushTimer),this.cacheFlushTimer=void 0),this.pendingCacheWrites.size>0&&this.flushQueryCacheWrites().catch(()=>{}),this.authTokenListeners.clear(),this.statusListeners.clear(),this.tokenExpiredListeners.clear(),this.whisperHandlers.clear(),this.shapeSubscriptions.clear(),this.pokeBuffers.clear()}async enqueueOfflineMutation(e,o,r,a,s){let i=this.identityFingerprint();if(this.outbox){this.outboxMutationCounter+=1;let c=this.outboxMutationCounter;try{await this.outbox.enqueue({args:o,clientId:this.clientId,functionPath:e.__lunoraRef,idempotencyKey:`${this.clientId}:${String(c)}`,identity:i,mutationId:c,shardKey:r})}catch(d){throw Fz(s),d instanceof Error?d:new Error(String(d))}return}return new Promise((c,d)=>{let f={args:o,functionPath:e.__lunoraRef,id:a,identity:i,reject:n(p=>{this.queuedIdentities.delete(a),Fz(s),d(p instanceof Error?p:new Error(String(p)))},"reject"),resolve:c,shardKey:r};this.offlineQueue.enqueue(f),f.id!==void 0&&this.queuedIdentities.set(f.id,i)})}async hydratePersistedQueue(){try{let e=await this.offlineQueue.hydrate();for(let o of e)this.ensureSocket(o)}catch{}}async hydrateQueryCache(){if(this.queryCache)try{let e=await this.queryCache.load();for(let{key:o,...r}of e)this.hydratedQueryCache.set(o,r)}catch{}}takeHydratedCache(e,o,r){let a=Sz(e,o,r),s=this.hydratedQueryCache.get(a);if(s!==void 0)return this.hydratedQueryCache.delete(a),s.identity===this.identityFingerprint()?s:void 0}persistQueryValue(e){if(!this.queryCache||e.lastValue===void 0)return;let o=Sz(e.fn.__lunoraRef,e.argsKey,e.shardKey);this.pendingCacheWrites.set(o,{identity:this.identityFingerprint(),serverCursor:e.serverCursor,ts:Date.now(),value:e.lastValue,...e.serverEpoch===void 0?{}:{serverEpoch:e.serverEpoch}}),this.cacheFlushTimer??=setTimeout(()=>{this.flushQueryCacheWrites().catch(()=>{})},ELe)}async flushQueryCacheWrites(){this.cacheFlushTimer=void 0;let{queryCache:e}=this;if(!e){this.pendingCacheWrites.clear();return}let o=[...this.pendingCacheWrites.entries()];this.pendingCacheWrites.clear(),await Promise.allSettled(o.map(([r,a])=>e.put(r,a)))}computeStatus(){let e=[...this.connections.values()];return e.length===0?"idle":e.some(o=>o.wsState==="open")?"connected":e.some(o=>o.wsState==="connecting")?"connecting":"offline"}emitConnectionStatus(){let e=this.computeStatus();if(e!==this.lastStatus){this.lastStatus=e;for(let o of this.statusListeners)try{o(e)}catch{}}}applyOptimisticUpdates(e,o,r,a){let s=[];if(!a)return s;let i=UI.key(e,o,r),c=this.subscriptions.get(i);if(c){let d=S3e(c,a);d&&s.push(d)}return s}applyOptimisticUpdate(e,o,r,a){let{rollbacks:s,store:i}=gae(this.subscriptions,r,wae,VI);try{e(i,o)}catch{for(let c=s.length-1;c>=0;c-=1)s[c]?.();return}a.push(...s)}getConnection(e){return this.connections.get(oi(e))}getOrCreateConnection(e){let o=oi(e),r=this.connections.get(o);return r||(r={connectTimer:void 0,heartbeatTimer:void 0,pendingUnsubscribes:[],reconnect:wz(this.reconnectOptions),reconnectTimer:void 0,shardKey:e,socket:void 0,wasEverConnected:!1,wsState:"idle"},this.connections.set(o,r)),r}wsUrlFor(e){let o=[];if(e!==void 0&&o.push(`shard=${encodeURIComponent(e)}`),this.wsToken!==void 0&&o.push(`token=${encodeURIComponent(this.wsToken)}`),o.length===0)return this.wsUrl;let r=this.wsUrl.includes("?")?"&":"?";return`${this.wsUrl}${r}${o.join("&")}`}rpcRequestHeaders(e){let o={"content-type":"application/json"};if(this.authToken&&(o.authorization=`Bearer ${this.authToken}`),e.mutationId&&(o["x-lunora-mutation-id"]=e.mutationId),e.clientId!==void 0&&(o["x-lunora-client-id"]=e.clientId),e.clientSeq!==void 0&&(o["x-lunora-client-seq"]=e.clientSeq.toString()),e.attachBookmark){let r=this.bookmark.get();r&&(o["x-d1-bookmark"]=r)}return o}async rpc(e,o,r,a={}){if(!this.fetchImpl)throw new Error("LunoraClient: no `fetch` implementation available");let s=this.rpcRequestHeaders(a),i=await this.fetchImpl(tF(this.url,bLe),{body:JSON.stringify({args:o,functionPath:e,shardKey:r}),headers:s,method:"POST"});if(a.captureBookmark){let d=i.headers.get("x-d1-bookmark");d&&this.bookmark.set(d)}let c;try{c=await i.json()}catch{let d=i.statusText?` ${i.statusText}`:"";throw new Error(`LunoraClient: response was not JSON (status ${i.status.toString()}${d})`)}if("error"in c){let d=new Error(c.error.message);throw d.code=c.error.code,d}if(!i.ok){let d=i.statusText?` ${i.statusText}`:"";throw new Error(`LunoraClient: request failed (status ${i.status.toString()}${d})`)}return a.onMutationAck?.(c.lastMutationId),c.result}async adminFetch(e,o,r,a){if(!this.fetchImpl)throw new Error("LunoraClient: no `fetch` implementation available");let s={};this.authToken&&(s.authorization=`Bearer ${this.authToken}`);let i=r instanceof ArrayBuffer||r instanceof Blob,c;r===void 0?c=void 0:i?(c=r,a!==void 0&&(s["content-type"]=a)):(c=JSON.stringify(r),s["content-type"]="application/json");let d=await this.fetchImpl(tF(this.url,e),{body:c,headers:s,method:o}),f;try{f=await d.json()}catch{let p=d.statusText?` ${d.statusText}`:"";throw new Error(`LunoraClient: response was not JSON (status ${d.status.toString()}${p})`)}if(typeof f=="object"&&f!==null&&"error"in f){let p=f.error,m=new Error(p.message??"admin request failed");throw m.code=p.code,m}if(!d.ok){let p=d.statusText?` ${d.statusText}`:"";throw new Error(`LunoraClient: admin request failed (status ${d.status.toString()}${p})`)}return f}effectiveConnectionContext(e){let o=this.connectionContextHolders.get(e);return o&&o.length>0?o[o.length-1]?.context:this.connectionContexts.get(e)??this.defaultConnectionContext}refreshConnectionContext(e){let o=this.connections.get(e);o?.wsState==="open"&&this.sendConnectEnvelope(o)}sendConnectEnvelope(e){let o=this.effectiveConnectionContext(oi(e.shardKey));Kl(e,{clientId:this.clientId,id:"connect",type:"connect",...o===void 0?{}:{context:o}})}resendShapeSubscriptions(e){for(let o of this.shapeSubscriptions.values())oi(o.shardKey)===oi(e)&&this.sendShapeSubscribeIfOpen(o)}ensureSocket(e){if(this.closed||this.WebSocketImpl===void 0)return;let o=this.getOrCreateConnection(e);if(o.wsState==="open"||o.wsState==="connecting")return;o.wsState="connecting",this.emitConnectionStatus();let r=new this.WebSocketImpl(this.wsUrlFor(e));o.socket=r,this.connectTimeoutMs>0&&(o.connectTimer=setTimeout(()=>{if(o.connectTimer=void 0,!(o.socket!==r||o.wsState!=="connecting")){try{r.close()}catch{}this.handleDisconnect(o)}},this.connectTimeoutMs)),r.addEventListener("open",()=>{if(o.socket!==r)return;o.connectTimer!==void 0&&(clearTimeout(o.connectTimer),o.connectTimer=void 0),o.wsState="open",o.wasEverConnected=!0,o.reconnect.reset(),this.emitConnectionStatus(),this.sendConnectEnvelope(o),this.markShardPendingAck(e);for(let s of this.subscriptions.all())oi(s.shardKey)===oi(e)&&this.sendSubscribeIfOpen(s);if(this.resendShapeSubscriptions(e),o.pendingUnsubscribes.length>0){let s=o.pendingUnsubscribes;o.pendingUnsubscribes=[];for(let{id:i,type:c}of s)Kl(o,{id:i,type:c})}if(o.pendingStreams&&o.pendingStreams.length>0){let s=o.pendingStreams;o.pendingStreams=[];for(let i of s)Kl(o,i)}let a=this.whisperHandlers.get(oi(e));if(a)for(let s of a.keys())Kl(o,{topic:s,type:"whisper_subscribe"});this.flushOfflineQueue(e).catch(()=>{}),this.startHeartbeat(o)}),r.addEventListener("message",a=>{this.handleServerMessage(a.data,e)}),r.addEventListener("close",a=>{o.socket===r&&(a?.code===4001&&this.notifyTokenExpired(),this.handleDisconnect(o))}),r.addEventListener("error",()=>{o.socket===r&&(o.wsState==="connecting"||o.wsState==="open")&&this.handleDisconnect(o)})}handleDisconnect(e){if(this.closed||e.wsState==="idle"||e.wsState==="closed"||(this.stopHeartbeat(e),e.connectTimer!==void 0&&(clearTimeout(e.connectTimer),e.connectTimer=void 0),e.socket=void 0,e.wsState="idle",this.emitConnectionStatus(),this.markShardPendingAck(e.shardKey),this.WebSocketImpl===void 0))return;let o=e.reconnect.next();e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=void 0,this.ensureSocket(e.shardKey)},o)}startHeartbeat(e){this.stopHeartbeat(e),!(this.heartbeatIntervalMs<=0)&&(e.heartbeatTimer=setInterval(()=>{if(!(e.wsState!=="open"||!e.socket))try{e.socket.send(CLe)}catch{}},this.heartbeatIntervalMs))}stopHeartbeat(e){e.heartbeatTimer!==void 0&&(clearInterval(e.heartbeatTimer),e.heartbeatTimer=void 0)}markShardPendingAck(e){let o=oi(e);for(let r of this.subscriptions.all())oi(r.shardKey)===o&&(r.acked=!1)}sendSubscribeIfOpen(e){let o=this.getConnection(e.shardKey);if(o?.wsState!=="open"||e.acked)return;let r=e.fn.__lunoraTable??e.fn.__lunoraRef;Kl(o,{id:e.id,query:{args:e.args,functionPath:e.fn.__lunoraRef,table:r,...e.serverCursor===void 0?{}:{sinceSeq:e.serverCursor},...e.serverEpoch===void 0?{}:{sinceEpoch:e.serverEpoch}},type:"subscribe"})}sendShapeSubscribeIfOpen(e){let o=this.getConnection(e.shardKey);o?.wsState==="open"&&Kl(o,{id:e.id,shape:{name:e.name,...e.args===void 0?{}:{args:e.args}},type:"shape_subscribe",...e.serverCursor===void 0?{}:{sinceCheckpoint:e.serverCursor},...e.serverEpoch===void 0?{}:{sinceEpoch:e.serverEpoch}})}handleServerMessage(e,o){let r=F3e(e);if(r===void 0)return;let a;try{a=JSON.parse(r)}catch{return}switch(a.type){case"ack":{let s=this.subscriptions.getById(a.id);s&&(s.acked=!0);return}case"chunk":{let{data:s,id:i}=a;this.streams.get(i)?.handle.push(s);return}case"complete":{this.handleCompleteMessage(a.id);return}case"data":case"delta":{this.handleDataMessage(a);return}case"error":{this.handleErrorMessage(a);break}case"pokeEnd":{this.handlePokeEnd(a);break}case"pokePart":{this.handlePokePart(a);break}case"pokeStart":{this.handlePokeStart(a);break}case"resume":{this.handleResumeMessage(a);break}case"settled":{this.handleSettledMessage(a);break}case"whisper":{this.dispatchWhisper(a,o);break}}}handleErrorMessage(e){if(e.error?.code==="TOKEN_EXPIRED"){this.notifyTokenExpired();return}let{id:r}=e,a=r===void 0?void 0:this.streams.get(r);if(a&&r!==void 0){a.handle.fail(w3e(e)),this.streams.delete(r);return}let s=r===void 0?void 0:this.subscriptions.getById(r);if(s){Sae(s.errorCallbacks,bae(e));return}let i=r===void 0?void 0:this.shapeSubscriptions.get(r);i&&Sae(i.errorCallbacks,bae(e))}handlePokeStart(e){if(this.pokeBuffers.size>=t.MAX_POKE_BUFFERS){let o=this.pokeBuffers.keys().next().value;o!==void 0&&this.pokeBuffers.delete(o)}this.pokeBuffers.set(e.pokeId,{baseCheckpoint:e.baseCheckpoint,epoch:e.epoch,lastMutationId:new Map,parts:new Map})}handlePokePart(e){let o=this.pokeBuffers.get(e.pokeId);if(!o)return;let r=o.parts.get(e.shapeId)??[];r.push(...e.rowsPatch),o.parts.set(e.shapeId,r),e.lastMutationId!==void 0&&o.lastMutationId.set(e.shapeId,e.lastMutationId)}handlePokeEnd(e){let o=this.pokeBuffers.get(e.pokeId);if(o){this.pokeBuffers.delete(e.pokeId);for(let[r,a]of o.parts){let s=this.shapeSubscriptions.get(r);if(!s)continue;let i=o.epoch!==void 0&&s.serverEpoch!==void 0&&o.epoch!==s.serverEpoch,c=o.baseCheckpoint!==void 0&&s.serverCursor!==void 0&&s.serverCursor!==o.baseCheckpoint;if(i||c){s.rows.clear(),s.serverCursor=void 0,s.serverEpoch=void 0,this.emitShapeRows(s),this.sendShapeSubscribeIfOpen(s);continue}wLe(s.rows,a),e.checkpoint!==void 0&&(s.serverCursor=e.checkpoint),e.epoch!==void 0&&(s.serverEpoch=e.epoch);let d=o.lastMutationId.get(r);d!==void 0&&(s.lastMutationId=d),this.emitShapeRows(s),s.onCheckpoint?.({checkpoint:s.serverCursor,mutationId:s.lastMutationId})}}}emitShapeRows(e){let o=[...e.rows.values()];for(let r of e.callbacks)try{r(o)}catch{}}handleDataMessage(e){let{id:o}=e,r=o?this.subscriptions.getById(o):void 0;if(!r)return;let a=this.resolveDataPayload(e,r);r.lastValue=a,r.serverVersion+=1,e.cursor!==void 0&&(r.serverCursor=e.cursor),e.epoch!==void 0&&(r.serverEpoch=e.epoch),this.persistQueryValue(r);for(let s of r.callbacks)try{s(a)}catch{}}handleResumeMessage(e){let o=this.subscriptions.getById(e.id);o&&this.ackAndAdvanceCursor(o,e.cursor,e.epoch)}handleSettledMessage(e){let o=this.subscriptions.getById(e.id);if(o){this.ackAndAdvanceCursor(o,e.cursor,e.epoch),e.lastMutationId!==void 0&&(o.lastMutationId=e.lastMutationId);for(let r of o.checkpointCallbacks)r({checkpoint:o.serverCursor,mutationId:o.lastMutationId})}}ackAndAdvanceCursor(e,o,r){e.acked=!0,(o!==void 0&&o!==e.serverCursor||r!==void 0&&r!==e.serverEpoch)&&(o!==void 0&&(e.serverCursor=o),r!==void 0&&(e.serverEpoch=r),this.persistQueryValue(e))}resolveDataPayload(e,o){if("data"in e&&e.data!==void 0)return e.data;let{delta:r}=e;if(mae(r)&&o.lastValue!==void 0){let a=hae(o.lastValue,r);if(a!==void 0)return a}return r}dispatchWhisper(e,o){let r=this.whisperHandlers.get(oi(o))?.get(e.topic);if(r)for(let a of r)try{a(e.data,e.from)}catch{}}notifyTokenExpired(){for(let e of this.tokenExpiredListeners)try{e()}catch{}}handleCompleteMessage(e){let o=this.streams.get(e);if(o){o.handle.complete(),this.streams.delete(e);return}let r=this.subscriptions.getById(e);r&&this.subscriptions.remove(r)}unpersist(e){e&&this.persistence?.remove(e).catch(o=>{Zk(this.onPersistenceError,"remove",o,e)})}identityFingerprint(){let e=this.authToken;if(e===null)return null;let o=2166136261;for(let r=0;r<e.length;r+=1)o^=e.charCodeAt(r),o=Math.imul(o,16777619);return`${e.length.toString(36)}:${(o>>>0).toString(36)}`}rejectQueuedForIdentityChange(){let e=this.offlineQueue.drain();for(let o of e){this.queuedIdentities.delete(o.id??""),this.unpersist(o.id);let r=new Error("offline mutation discarded: auth identity changed before replay");r.code="OFFLINE_IDENTITY_CHANGED",o.reject(r)}this.clearQueryCacheForIdentityChange()}clearQueryCacheForIdentityChange(){this.cacheFlushTimer!==void 0&&(clearTimeout(this.cacheFlushTimer),this.cacheFlushTimer=void 0),this.pendingCacheWrites.clear(),this.hydratedQueryCache.clear(),this.queryCache?.clear().catch(()=>{})}async flushOfflineQueue(e){let o=oi(e),r=this.offlineQueue.drain(a=>oi(a.shardKey)===o);for(let a=0;a<r.length;a+=1){let s=r[a];if(!s)continue;let i=this.identityFingerprint(),c=s.id===void 0?void 0:this.queuedIdentities.get(s.id),d=c===void 0?s.identity:c;if(d!==void 0&&d!==i){this.queuedIdentities.delete(s.id??""),this.unpersist(s.id);let f=new Error("offline mutation skipped: auth identity changed before replay");f.code="OFFLINE_IDENTITY_CHANGED",s.reject(f);continue}this.queuedIdentities.delete(s.id??"");try{let f=await this.rpc(s.functionPath,s.args,s.shardKey,{captureBookmark:!0,mutationId:s.id});this.unpersist(s.id),s.resolve(f)}catch(f){if(f.code!==void 0){this.unpersist(s.id),s.reject(f);continue}this.offlineQueue.requeue(r.slice(a));return}}}};var ase=K(Ro(),1);var qd=class{static{n(this,"Subscribable")}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(){}};var R3e=class extends qd{static{n(this,"FocusManager")}#t;#e;#o;constructor(){super(),this.#o=t=>{if(typeof window<"u"&&window.addEventListener){let e=n(()=>t(),"listener");return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#o)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#o=t,this.#e?.(),this.#e=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},HI=new R3e;var E3e={setTimeout:n((t,e)=>setTimeout(t,e),"setTimeout"),clearTimeout:n(t=>clearTimeout(t),"clearTimeout"),setInterval:n((t,e)=>setInterval(t,e),"setInterval"),clearInterval:n(t=>clearInterval(t),"clearInterval")},A3e=class{static{n(this,"TimeoutManager")}#t=E3e;#e=!1;setTimeoutProvider(t){this.#e&&t!==this.#t&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#t,provider:t}),this.#t=t,this.#e=!1}setTimeout(t,e){return this.#e=!0,this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return this.#e=!0,this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}},Wd=new A3e;function Cae(t){setTimeout(t,0)}n(Cae,"systemSetTimeoutZero");var Ez=typeof window>"u"||"Deno"in globalThis;function Ua(){}n(Ua,"noop");function Eae(t,e){return typeof t=="function"?t(e):t}n(Eae,"functionalUpdate");function rF(t){return typeof t=="number"&&t>=0&&t!==1/0}n(rF,"isValidTimeout");function rM(t,e){return Math.max(t+(e||0)-Date.now(),0)}n(rM,"timeUntilStale");function Vu(t,e){return typeof t=="function"?t(e):t}n(Vu,"resolveStaleTime");function Li(t,e){return typeof t=="function"?t(e):t}n(Li,"resolveQueryBoolean");function nM(t,e){let{type:o="all",exact:r,fetchStatus:a,predicate:s,queryKey:i,stale:c}=t;if(i){if(r){if(e.queryHash!==nF(i,e.options))return!1}else if(!yv(e.queryKey,i))return!1}if(o!=="all"){let d=e.isActive();if(o==="active"&&!d||o==="inactive"&&d)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||a&&a!==e.state.fetchStatus||s&&!s(e))}n(nM,"matchQuery");function aM(t,e){let{exact:o,status:r,predicate:a,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(o){if(vv(e.options.mutationKey)!==vv(s))return!1}else if(!yv(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||a&&!a(e))}n(aM,"matchMutation");function nF(t,e){return(e?.queryKeyHashFn||vv)(t)}n(nF,"hashQueryKeyByOptions");function vv(t){return JSON.stringify(t,(e,o)=>Rz(o)?Object.keys(o).sort().reduce((r,a)=>(r[a]=o[a],r),{}):o)}n(vv,"hashKey");function yv(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(o=>yv(t[o],e[o])):!1}n(yv,"partialMatchKey");var T3e=Object.prototype.hasOwnProperty;function oM(t,e,o=0){if(t===e)return t;if(o>500)return e;let r=Fae(t)&&Fae(e);if(!r&&!(Rz(t)&&Rz(e)))return e;let s=(r?t:Object.keys(t)).length,i=r?e:Object.keys(e),c=i.length,d=r?new Array(c):{},f=0;for(let p=0;p<c;p++){let m=r?p:i[p],h=t[m],v=e[m];if(h===v){d[m]=h,(r?p<s:T3e.call(t,m))&&f++;continue}if(h===null||v===null||typeof h!="object"||typeof v!="object"){d[m]=v;continue}let x=oM(h,v,o+1);d[m]=x,x===h&&f++}return s===c&&f===s?t:d}n(oM,"replaceEqualDeep");function sM(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let o in t)if(t[o]!==e[o])return!1;return!0}n(sM,"shallowEqualObjects");function Fae(t){return Array.isArray(t)&&t.length===Object.keys(t).length}n(Fae,"isPlainArray");function Rz(t){if(!Rae(t))return!1;let e=t.constructor;if(e===void 0)return!0;let o=e.prototype;return!(!Rae(o)||!o.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}n(Rz,"isPlainObject");function Rae(t){return Object.prototype.toString.call(t)==="[object Object]"}n(Rae,"hasObjectPrototype");function Aae(t){return new Promise(e=>{Wd.setTimeout(e,t)})}n(Aae,"sleep");function aF(t,e,o){if(typeof o.structuralSharing=="function")return o.structuralSharing(t,e);if(o.structuralSharing!==!1){try{return oM(t,e)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${o.queryHash}]: ${r}`),r}return oM(t,e)}return e}n(aF,"replaceData");function Az(t){return t}n(Az,"keepPreviousData");function Tae(t,e,o=0){let r=[...t,e];return o&&r.length>o?r.slice(1):r}n(Tae,"addToEnd");function kae(t,e,o=0){let r=[e,...t];return o&&r.length>o?r.slice(0,-1):r}n(kae,"addToStart");var xv=Symbol();function iM(t,e){return t.queryFn===xv&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`),!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===xv?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}n(iM,"ensureQueryFn");function lM(t,e){return typeof t=="function"?t(...e):!!t}n(lM,"shouldThrowError");function Mae(t,e,o){let r=!1,a;return Object.defineProperty(t,"signal",{enumerable:!0,get:n(()=>(a??=e(),r||(r=!0,a.aborted?o():a.addEventListener("abort",o,{once:!0})),a),"get")}),t}n(Mae,"addConsumeAwareSignal");var Gd=(()=>{let t=n(()=>Ez,"isServerFn");return{isServer(){return t()},setIsServer(e){t=e}}})();function sF(){let t,e,o=new Promise((a,s)=>{t=a,e=s});o.status="pending",o.catch(()=>{});function r(a){Object.assign(o,a),delete o.resolve,delete o.reject}return n(r,"finalize"),o.resolve=a=>{r({status:"fulfilled",value:a}),t(a)},o.reject=a=>{r({status:"rejected",reason:a}),e(a)},o}n(sF,"pendingThenable");var Pae=Cae;function k3e(){let t=[],e=0,o=n(c=>{c()},"notifyFn"),r=n(c=>{c()},"batchNotifyFn"),a=Pae,s=n(c=>{e?t.push(c):a(()=>{o(c)})},"schedule"),i=n(()=>{let c=t;t=[],c.length&&a(()=>{r(()=>{c.forEach(d=>{o(d)})})})},"flush");return{batch:n(c=>{let d;e++;try{d=c()}finally{e--,e||i()}return d},"batch"),batchCalls:n(c=>(...d)=>{s(()=>{c(...d)})},"batchCalls"),schedule:s,setNotifyFunction:n(c=>{o=c},"setNotifyFunction"),setBatchNotifyFunction:n(c=>{r=c},"setBatchNotifyFunction"),setScheduler:n(c=>{a=c},"setScheduler")}}n(k3e,"createNotifyManager");var _n=k3e();var M3e=class extends qd{static{n(this,"OnlineManager")}#t=!0;#e;#o;constructor(){super(),this.#o=t=>{if(typeof window<"u"&&window.addEventListener){let e=n(()=>t(!0),"onlineListener"),o=n(()=>t(!1),"offlineListener");return window.addEventListener("online",e,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",o)}}}}onSubscribe(){this.#e||this.setEventListener(this.#o)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#o=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(o=>{o(t)}))}isOnline(){return this.#t}},$I=new M3e;function P3e(t){return Math.min(1e3*2**t,3e4)}n(P3e,"defaultRetryDelay");function Tz(t){return(t??"online")==="online"?$I.isOnline():!0}n(Tz,"canFetch");var cM=class extends Error{static{n(this,"CancelledError")}constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function uM(t){let e=!1,o=0,r,a=sF(),s=n(()=>a.status!=="pending","isResolved"),i=n(y=>{if(!s()){let b=new cM(y);h(b),t.onCancel?.(b)}},"cancel"),c=n(()=>{e=!0},"cancelRetry"),d=n(()=>{e=!1},"continueRetry"),f=n(()=>HI.isFocused()&&(t.networkMode==="always"||$I.isOnline())&&t.canRun(),"canContinue"),p=n(()=>Tz(t.networkMode)&&t.canRun(),"canStart"),m=n(y=>{s()||(r?.(),a.resolve(y))},"resolve"),h=n(y=>{s()||(r?.(),a.reject(y))},"reject"),v=n(()=>new Promise(y=>{r=n(b=>{(s()||f())&&y(b)},"continueFn"),t.onPause?.()}).then(()=>{r=void 0,s()||t.onContinue?.()}),"pause"),x=n(()=>{if(s())return;let y,b=o===0?t.initialPromise:void 0;try{y=b??t.fn()}catch(S){y=Promise.reject(S)}Promise.resolve(y).then(m).catch(S=>{if(s())return;let w=t.retry??(Gd.isServer()?0:3),C=t.retryDelay??P3e,F=typeof C=="function"?C(o,S):C,T=w===!0||typeof w=="number"&&o<w||typeof w=="function"&&w(o,S);if(e||!T){h(S);return}o++,t.onFail?.(o,S),Aae(F).then(()=>f()?void 0:v()).then(()=>{e?h(S):x()})})},"run");return{promise:a,status:n(()=>a.status,"status"),cancel:i,continue:n(()=>(r?.(),a),"continue"),cancelRetry:c,continueRetry:d,canStart:p,start:n(()=>(p()?x():v().then(x),a),"start")}}n(uM,"createRetryer");var dM=class{static{n(this,"Removable")}#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rF(this.gcTime)&&(this.#t=Wd.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Gd.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#t!==void 0&&(Wd.clearTimeout(this.#t),this.#t=void 0)}};function Nae(t){return{onFetch:n((e,o)=>{let r=e.options,a=e.fetchOptions?.meta?.fetchMore?.direction,s=e.state.data?.pages||[],i=e.state.data?.pageParams||[],c={pages:[],pageParams:[]},d=0,f=n(async()=>{let p=!1,m=n(x=>{Mae(x,()=>e.signal,()=>p=!0)},"addSignalProperty"),h=iM(e.options,e.fetchOptions),v=n(async(x,y,b)=>{if(p)return Promise.reject(e.signal.reason);if(y==null&&x.pages.length)return Promise.resolve(x);let w=n(()=>{let E={client:e.client,queryKey:e.queryKey,pageParam:y,direction:b?"backward":"forward",meta:e.options.meta};return m(E),E},"createQueryFnContext")(),C=await h(w),{maxPages:F}=e.options,T=b?kae:Tae;return{pages:T(x.pages,C,F),pageParams:T(x.pageParams,y,F)}},"fetchPage");if(a&&s.length){let x=a==="backward",y=x?O3e:Oae,b={pages:s,pageParams:i},S=y(r,b);c=await v(b,S,x)}else{let x=t??s.length;do{let y=d===0?i[0]??r.initialPageParam:Oae(r,c);if(d>0&&y==null)break;c=await v(c,y),d++}while(d<x)}return c},"fetchFn");e.options.persister?e.fetchFn=()=>e.options.persister?.(f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},o):e.fetchFn=f},"onFetch")}}n(Nae,"infiniteQueryBehavior");function Oae(t,{pages:e,pageParams:o}){let r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,o[r],o):void 0}n(Oae,"getNextPageParam");function O3e(t,{pages:e,pageParams:o}){return e.length>0?t.getPreviousPageParam?.(e[0],e,o[0],o):void 0}n(O3e,"getPreviousPageParam");var Lae=class extends dM{static{n(this,"Query")}#t;#e;#o;#r;#a;#n;#i;#s;constructor(t){super(),this.#s=!1,this.#i=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#a=t.client,this.#r=this.#a.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=_ae(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#t}get promise(){return this.#n?.promise}setOptions(t){if(this.options={...this.#i,...t},t?._type&&(this.#t=t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=_ae(this.options);e.data!==void 0&&(this.setState(Dae(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(t,e){let o=aF(this.state.data,t,this.options);return this.#l({data:o,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),o}setState(t){this.#l({type:"setState",state:t})}cancel(t){let e=this.#n?.promise;return this.#n?.cancel(t),e?e.then(Ua).catch(Ua):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Li(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xv||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Vu(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:!rM(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#r.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.#n&&(this.#s||this.#u()?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#u(){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.#n?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(t&&this.setOptions(t),!this.options.queryFn){let d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']");let o=new AbortController,r=n(d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:n(()=>(this.#s=!0,o.signal),"get")})},"addSignalProperty"),a=n(()=>{let d=iM(this.options,e),p=n(()=>{let m={client:this.#a,queryKey:this.queryKey,meta:this.meta};return r(m),m},"createQueryFnContext")();return this.#s=!1,this.options.persister?this.options.persister(d,p,this):d(p)},"fetchFn"),i=n(()=>{let d={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:a};return r(d),d},"createFetchContext")();(this.#t==="infinite"?Nae(this.options.pages):this.options.behavior)?.onFetch(i,this),this.#o=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#l({type:"fetch",meta:i.fetchOptions?.meta}),this.#n=uM({initialPromise:e?.initialPromise,fn:i.fetchFn,onCancel:n(d=>{d instanceof cM&&d.revert&&this.setState({...this.#o,fetchStatus:"idle"}),o.abort()},"onCancel"),onFail:n((d,f)=>{this.#l({type:"failed",failureCount:d,error:f})},"onFail"),onPause:n(()=>{this.#l({type:"pause"})},"onPause"),onContinue:n(()=>{this.#l({type:"continue"})},"onContinue"),retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:n(()=>!0,"canRun")});try{let d=await this.#n.start();if(d===void 0)throw console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(d),this.#r.config.onSuccess?.(d,this),this.#r.config.onSettled?.(d,this.state.error,this),d}catch(d){if(d instanceof cM){if(d.silent)return this.#n.promise;if(d.revert){if(this.state.data===void 0)throw d;return this.state.data}}throw this.#l({type:"error",error:d}),this.#r.config.onError?.(d,this),this.#r.config.onSettled?.(this.state.data,d,this),d}finally{this.scheduleGc()}}#l(t){let e=n(o=>{switch(t.type){case"failed":return{...o,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...kz(o.data,this.options),fetchMeta:t.meta??null};case"success":let r={...o,...Dae(t.data,t.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#o=t.manual?r:void 0,r;case"error":let a=t.error;return{...o,error:a,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...t.state}}},"reducer");this.state=e(this.state),_n.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:t})})}};function kz(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Tz(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}n(kz,"fetchState");function Dae(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}n(Dae,"successState");function _ae(t){let e=typeof t.initialData=="function"?t.initialData():t.initialData,o=e!==void 0,r=o?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:o?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}n(_ae,"getDefaultState");var Pz=class extends qd{static{n(this,"QueryObserver")}constructor(t,e){super(),this.options=e,this.#t=t,this.#s=null,this.#i=sF(),this.bindMethods(),this.setOptions(e)}#t;#e=void 0;#o=void 0;#r=void 0;#a;#n;#i;#s;#u;#l;#m;#d;#f;#c;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Bae(this.#e,this.options)?this.#p():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Mz(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Mz(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#I(),this.#b(),this.#e.removeObserver(this)}setOptions(t){let e=this.options,o=this.#e;if(this.options=this.#t.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Li(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#e.setOptions(this.options),e._defaulted&&!sM(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});let r=this.hasListeners();r&&Vae(this.#e,o,this.options,e)&&this.#p(),this.updateResult(),r&&(this.#e!==o||Li(this.options.enabled,this.#e)!==Li(e.enabled,this.#e)||Vu(this.options.staleTime,this.#e)!==Vu(e.staleTime,this.#e))&&this.#g();let a=this.#v();r&&(this.#e!==o||Li(this.options.enabled,this.#e)!==Li(e.enabled,this.#e)||a!==this.#c)&&this.#x(a)}getOptimisticResult(t){let e=this.#t.getQueryCache().build(this.#t,t),o=this.createResult(e,t);return D3e(this,o)&&(this.#r=o,this.#n=this.options,this.#a=this.#e.state),o}getCurrentResult(){return this.#r}trackResult(t,e){return new Proxy(t,{get:n((o,r)=>(this.trackProp(r),e?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,r)),"get")})}trackProp(t){this.#h.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){let e=this.#t.defaultQueryOptions(t),o=this.#t.getQueryCache().build(this.#t,e);return o.fetch().then(()=>this.createResult(o,e))}fetch(t){return this.#p({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#p(t){this.#S();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Ua)),e}#g(){this.#I();let t=Vu(this.options.staleTime,this.#e);if(Gd.isServer()||this.#r.isStale||!rF(t))return;let o=rM(this.#r.dataUpdatedAt,t)+1;this.#d=Wd.setTimeout(()=>{this.#r.isStale||this.updateResult()},o)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#x(t){this.#b(),this.#c=t,!(Gd.isServer()||Li(this.options.enabled,this.#e)===!1||!rF(this.#c)||this.#c===0)&&(this.#f=Wd.setInterval(()=>{(this.options.refetchIntervalInBackground||HI.isFocused())&&this.#p()},this.#c))}#y(){this.#g(),this.#x(this.#v())}#I(){this.#d!==void 0&&(Wd.clearTimeout(this.#d),this.#d=void 0)}#b(){this.#f!==void 0&&(Wd.clearInterval(this.#f),this.#f=void 0)}createResult(t,e){let o=this.#e,r=this.options,a=this.#r,s=this.#a,i=this.#n,d=t!==o?t.state:this.#o,{state:f}=t,p={...f},m=!1,h;if(e._optimisticResults){let P=this.hasListeners(),_=!P&&Bae(t,e),M=P&&Vae(t,o,e,r);(_||M)&&(p={...p,...kz(f.data,t.options)}),e._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:x,status:y}=p;h=p.data;let b=!1;if(e.placeholderData!==void 0&&h===void 0&&y==="pending"){let P;a?.isPlaceholderData&&e.placeholderData===i?.placeholderData?(P=a.data,b=!0):P=typeof e.placeholderData=="function"?e.placeholderData(this.#m?.state.data,this.#m):e.placeholderData,P!==void 0&&(y="success",h=aF(a?.data,P,e),m=!0)}if(e.select&&h!==void 0&&!b)if(a&&h===s?.data&&e.select===this.#u)h=this.#l;else try{this.#u=e.select,h=e.select(h),h=aF(a?.data,h,e),this.#l=h,this.#s=null}catch(P){this.#s=P}this.#s&&(v=this.#s,h=this.#l,x=Date.now(),y="error");let S=p.fetchStatus==="fetching",w=y==="pending",C=y==="error",F=w&&S,T=h!==void 0,k={status:y,fetchStatus:p.fetchStatus,isPending:w,isSuccess:y==="success",isError:C,isInitialLoading:F,isLoading:F,data:h,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:x,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:S,isRefetching:S&&!w,isLoadingError:C&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:C&&T,isStale:Oz(t,e),refetch:this.refetch,promise:this.#i,isEnabled:Li(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){let P=k.data!==void 0,_=k.status==="error"&&!P,M=n(W=>{_?W.reject(k.error):P&&W.resolve(k.data)},"finalizeThenableIfPossible"),L=n(()=>{let W=this.#i=k.promise=sF();M(W)},"recreateThenable"),U=this.#i;switch(U.status){case"pending":t.queryHash===o.queryHash&&M(U);break;case"fulfilled":(_||k.data!==U.value)&&L();break;case"rejected":(!_||k.error!==U.reason)&&L();break}}return k}updateResult(){let t=this.#r,e=this.createResult(this.#e,this.options);if(this.#a=this.#e.state,this.#n=this.options,this.#a.data!==void 0&&(this.#m=this.#e),sM(e,t))return;this.#r=e;let o=n(()=>{if(!t)return!0;let{notifyOnChangeProps:r}=this.options,a=typeof r=="function"?r():r;if(a==="all"||!a&&!this.#h.size)return!0;let s=new Set(a??this.#h);return this.options.throwOnError&&s.add("error"),Object.keys(this.#r).some(i=>{let c=i;return this.#r[c]!==t[c]&&s.has(c)})},"shouldNotifyListeners");this.#w({listeners:o()})}#S(){let t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;let e=this.#e;this.#e=t,this.#o=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#w(t){_n.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function N3e(t,e){return Li(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Li(e.retryOnMount,t)===!1)}n(N3e,"shouldLoadOnMount");function Bae(t,e){return N3e(t,e)||t.state.data!==void 0&&Mz(t,e,e.refetchOnMount)}n(Bae,"shouldFetchOnMount");function Mz(t,e,o){if(Li(e.enabled,t)!==!1&&Vu(e.staleTime,t)!=="static"){let r=typeof o=="function"?o(t):o;return r==="always"||r!==!1&&Oz(t,e)}return!1}n(Mz,"shouldFetchOn");function Vae(t,e,o,r){return(t!==e||Li(r.enabled,t)===!1)&&(!o.suspense||t.state.status!=="error")&&Oz(t,o)}n(Vae,"shouldFetchOptionally");function Oz(t,e){return Li(e.enabled,t)!==!1&&t.isStaleByTime(Vu(e.staleTime,t))}n(Oz,"isStale");function D3e(t,e){return!sM(t.getCurrentResult(),e)}n(D3e,"shouldAssignObserverCurrentProperties");var Uae=class extends dM{static{n(this,"Mutation")}#t;#e;#o;#r;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#o=t.mutationCache,this.#e=[],this.state=t.state||_3e(),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.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#o.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#o.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){let e=n(()=>{this.#a({type:"continue"})},"onContinue"),o={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=uM({fn:n(()=>this.options.mutationFn?this.options.mutationFn(t,o):Promise.reject(new Error("No mutationFn found")),"fn"),onFail:n((s,i)=>{this.#a({type:"failed",failureCount:s,error:i})},"onFail"),onPause:n(()=>{this.#a({type:"pause"})},"onPause"),onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:n(()=>this.#o.canRun(this),"canRun")});let r=this.state.status==="pending",a=!this.#r.canStart();try{if(r)e();else{this.#a({type:"pending",variables:t,isPaused:a}),this.#o.config.onMutate&&await this.#o.config.onMutate(t,this,o);let i=await this.options.onMutate?.(t,o);i!==this.state.context&&this.#a({type:"pending",context:i,variables:t,isPaused:a})}let s=await this.#r.start();return await this.#o.config.onSuccess?.(s,t,this.state.context,this,o),await this.options.onSuccess?.(s,t,this.state.context,o),await this.#o.config.onSettled?.(s,null,this.state.variables,this.state.context,this,o),await this.options.onSettled?.(s,null,t,this.state.context,o),this.#a({type:"success",data:s}),s}catch(s){try{await this.#o.config.onError?.(s,t,this.state.context,this,o)}catch(i){Promise.reject(i)}try{await this.options.onError?.(s,t,this.state.context,o)}catch(i){Promise.reject(i)}try{await this.#o.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,o)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,s,t,this.state.context,o)}catch(i){Promise.reject(i)}throw this.#a({type:"error",error:s}),s}finally{this.#o.runNext(this)}}#a(t){let e=n(o=>{switch(t.type){case"failed":return{...o,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,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{...o,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:t.error,failureCount:o.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}},"reducer");this.state=e(this.state),_n.batch(()=>{this.#e.forEach(o=>{o.onMutationUpdate(t)}),this.#o.notify({mutation:this,type:"updated",action:t})})}};function _3e(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}n(_3e,"getDefaultState");var zae=class extends qd{static{n(this,"MutationCache")}constructor(t={}){super(),this.config=t,this.#t=new Set,this.#e=new Map,this.#o=0}#t;#e;#o;build(t,e,o){let r=new Uae({client:t,mutationCache:this,mutationId:++this.#o,options:t.defaultMutationOptions(e),state:o});return this.add(r),r}add(t){this.#t.add(t);let e=fM(t);if(typeof e=="string"){let o=this.#e.get(e);o?o.push(t):this.#e.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#t.delete(t)){let e=fM(t);if(typeof e=="string"){let o=this.#e.get(e);if(o)if(o.length>1){let r=o.indexOf(t);r!==-1&&o.splice(r,1)}else o[0]===t&&this.#e.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){let e=fM(t);if(typeof e=="string"){let r=this.#e.get(e)?.find(a=>a.state.status==="pending");return!r||r===t}else return!0}runNext(t){let e=fM(t);return typeof e=="string"?this.#e.get(e)?.find(r=>r!==t&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){_n.batch(()=>{this.#t.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(t){let e={exact:!0,...t};return this.getAll().find(o=>aM(e,o))}findAll(t={}){return this.getAll().filter(e=>aM(t,e))}notify(t){_n.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(e=>e.state.isPaused);return _n.batch(()=>Promise.all(t.map(e=>e.continue().catch(Ua))))}};function fM(t){return t.options.scope?.id}n(fM,"scopeFor");var Hae=class extends qd{static{n(this,"QueryCache")}constructor(t={}){super(),this.config=t,this.#t=new Map}#t;build(t,e,o){let r=e.queryKey,a=e.queryHash??nF(r,e),s=this.get(a);return s||(s=new Lae({client:t,queryKey:r,queryHash:a,options:t.defaultQueryOptions(e),state:o,defaultOptions:t.getQueryDefaults(r)}),this.add(s)),s}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=this.#t.get(t.queryHash);e&&(t.destroy(),e===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){_n.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){let e={exact:!0,...t};return this.getAll().find(o=>nM(e,o))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(o=>nM(t,o)):e}notify(t){_n.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){_n.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){_n.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}};var Nz=class{static{n(this,"QueryClient")}#t;#e;#o;#r;#a;#n;#i;#s;constructor(t={}){this.#t=t.queryCache||new Hae,this.#e=t.mutationCache||new zae,this.#o=t.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#n=0}mount(){this.#n++,this.#n===1&&(this.#i=HI.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=$I.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#n--,this.#n===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=void 0)}isFetching(t){return this.#t.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#e.findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),o=this.#t.build(this,e),r=o.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&o.isStaleByTime(Vu(e.staleTime,o))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#t.findAll(t).map(({queryKey:e,state:o})=>{let r=o.data;return[e,r]})}setQueryData(t,e,o){let r=this.defaultQueryOptions({queryKey:t}),s=this.#t.get(r.queryHash)?.state.data,i=Eae(e,s);if(i!==void 0)return this.#t.build(this,r).setData(i,{...o,manual:!0})}setQueriesData(t,e,o){return _n.batch(()=>this.#t.findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,o)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state}removeQueries(t){let e=this.#t;_n.batch(()=>{e.findAll(t).forEach(o=>{e.remove(o)})})}resetQueries(t,e){let o=this.#t;return _n.batch(()=>(o.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let o={revert:!0,...e},r=_n.batch(()=>this.#t.findAll(t).map(a=>a.cancel(o)));return Promise.all(r).then(Ua).catch(Ua)}invalidateQueries(t,e={}){return _n.batch(()=>(this.#t.findAll(t).forEach(o=>{o.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){let o={...e,cancelRefetch:e.cancelRefetch??!0},r=_n.batch(()=>this.#t.findAll(t).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let s=a.fetch(void 0,o);return o.throwOnError||(s=s.catch(Ua)),a.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ua)}fetchQuery(t){let e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);let o=this.#t.build(this,e);return o.isStaleByTime(Vu(e.staleTime,o))?o.fetch(e):Promise.resolve(o.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ua).catch(Ua)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ua).catch(Ua)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return $I.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#o}setDefaultOptions(t){this.#o=t}setQueryDefaults(t,e){this.#r.set(vv(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#r.values()],o={};return e.forEach(r=>{yv(t,r.queryKey)&&Object.assign(o,r.defaultOptions)}),o}setMutationDefaults(t,e){this.#a.set(vv(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#a.values()],o={};return e.forEach(r=>{yv(t,r.mutationKey)&&Object.assign(o,r.defaultOptions)}),o}defaultQueryOptions(t){if(t._defaulted)return t;let e={...this.#o.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=nF(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===xv&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#o.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}};var jI=K(oe(),1),qae=K(zt(),1);var iF=jI.createContext(void 0),qI=n(t=>{let e=jI.useContext(iF);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},"useQueryClient"),Dz=n(({client:t,children:e})=>(jI.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,qae.jsx)(iF.Provider,{value:t,children:e})),"QueryClientProvider");var mM=K(oe(),1);var Wae=mM.createContext(!1),Gae=n(()=>mM.useContext(Wae),"useIsRestoring"),TCt=Wae.Provider;var lF=K(oe(),1),L3e=K(zt(),1);function B3e(){let t=!1;return{clearReset:n(()=>{t=!1},"clearReset"),reset:n(()=>{t=!0},"reset"),isReset:n(()=>t,"isReset")}}n(B3e,"createValue");var V3e=lF.createContext(B3e()),Kae=n(()=>lF.useContext(V3e),"useQueryErrorResetBoundary");var Yae=K(oe(),1);var Xae=n((t,e,o)=>{let r=o?.state.error&&typeof t.throwOnError=="function"?lM(t.throwOnError,[o.state.error,o]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},"ensurePreventErrorBoundaryRetry"),Qae=n(t=>{Yae.useEffect(()=>{t.clearReset()},[t])},"useClearResetErrorBoundary"),Zae=n(({result:t,errorResetBoundary:e,throwOnError:o,query:r,suspense:a})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(a&&t.data===void 0||lM(o,[t.error,r])),"getHasError");var Jae=n(t=>{if(t.suspense){let o=n(a=>a==="static"?a:Math.max(a??1e3,1e3),"clamp"),r=t.staleTime;t.staleTime=typeof r=="function"?(...a)=>o(r(...a)):o(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},"ensureSuspenseTimers"),ese=n((t,e)=>t.isLoading&&t.isFetching&&!e,"willFetch"),tse=n((t,e)=>t?.suspense&&e.isPending,"shouldSuspend"),_z=n((t,e,o)=>e.fetchOptimistic(t).catch(()=>{o.clearReset()}),"fetchOptimistic");var Fh=K(oe(),1);function ose(t,e,o){if(typeof t!="object"||Array.isArray(t))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');let r=Gae(),a=Kae(),s=qI(o),i=s.defaultQueryOptions(t);s.getDefaultOptions().queries?._experimental_beforeQuery?.(i);let c=s.getQueryCache().get(i.queryHash);i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`);let d=t.subscribed!==!1;i._optimisticResults=r?"isRestoring":d?"optimistic":void 0,Jae(i),Xae(i,a,c),Qae(a);let f=!s.getQueryCache().get(i.queryHash),[p]=Fh.useState(()=>new e(s,i)),m=p.getOptimisticResult(i),h=!r&&d;if(Fh.useSyncExternalStore(Fh.useCallback(v=>{let x=h?p.subscribe(_n.batchCalls(v)):Ua;return p.updateResult(),x},[p,h]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),Fh.useEffect(()=>{p.setOptions(i)},[i,p]),tse(i,m))throw _z(i,p,a);if(Zae({result:m,errorResetBoundary:a,throwOnError:i.throwOnError,query:c,suspense:i.suspense}))throw m.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(i,m),i.experimental_prefetchInRender&&!Gd.isServer()&&ese(m,r)&&(f?_z(i,p,a):c?.promise)?.catch(Ua).finally(()=>{p.updateResult()}),i.notifyOnChangeProps?m:p.trackResult(m)}n(ose,"useBaseQuery");function Lz(t,e){return ose(t,Pz,e)}n(Lz,"useQuery");var Iv=K(oe(),1),Vz=K(po(),1);var sse=(0,Iv.createContext)(null),U3e=n(()=>new Nz({defaultOptions:{mutations:{retry:0},queries:{gcTime:5*6e4,retry:0,staleTime:Number.POSITIVE_INFINITY}}}),"createDefaultQueryClient"),Uz=n(t=>{let e=(0,ase.c)(9),{children:o,client:r,queryClient:a}=t,s=(0,Iv.use)(iF),i;e[0]!==s||e[1]!==a?(i=n(()=>a??s??U3e(),"t1"),e[0]=s,e[1]=a,e[2]=i):i=e[2];let[c]=(0,Iv.useState)(i),d=a??s??c;if(!d)throw new Error("LunoraProvider: failed to resolve a QueryClient");let f;e[3]!==o||e[4]!==r?(f=(0,Vz.jsxDEV)(sse,{value:r,children:o},void 0,!1),e[3]=o,e[4]=r,e[5]=f):f=e[5];let p=f;if(s===d)return p;let m;return e[6]!==p||e[7]!==d?(m=(0,Vz.jsxDEV)(Dz,{client:d,children:p},void 0,!1),e[6]=p,e[7]=d,e[8]=m):m=e[8],m},"LunoraProvider"),Wt=n(()=>{let t=(0,Iv.use)(sse);if(!t)throw new Error("useLunora must be used inside <LunoraProvider />");return t},"useLunora");var ise=K(Ro(),1),lse=K(oe(),1);var zz=n(()=>{let t=(0,ise.c)(4),e=Wt(),o,r,a;return t[0]!==e?(o=n(s=>e.onConnectionStatus(()=>{s()}),"t0"),r=n(()=>e.connectionStatus(),"t1"),a=n(()=>e.connectionStatus(),"t2"),t[0]=e,t[1]=o,t[2]=r,t[3]=a):(o=t[1],r=t[2],a=t[3]),(0,lse.useSyncExternalStore)(o,r,a)},"useConnectionStatus");var Cw=K(oe(),1);var cse=K(oe(),1),Rh=K(po(),1);var z3e={border:"1px solid var(--destructive)",color:"var(--destructive)",padding:12},H3e={overflow:"auto",whiteSpace:"pre-wrap"},WI=class extends cse.Component{static{n(this,"ErrorBoundary")}static getDerivedStateFromError(e){return{error:e}}state={error:null};componentDidCatch(e,o){console.error("[lunora-studio] panel error",e,o.componentStack)}reset=n(()=>{this.setState({error:null})},"reset");render(){let{children:e,fallbackTitle:o,label:r,retryLabel:a}=this.props,{error:s}=this.state;if(s===null)return(0,Rh.jsxDEV)(Rh.Fragment,{children:e},void 0,!1);let i=o??(r===void 0?"Something went wrong":`${r} failed`);return(0,Rh.jsxDEV)("div",{"data-testid":"dash-error-boundary",role:"alert",style:z3e,children:[(0,Rh.jsxDEV)("strong",{children:i},void 0,!1),(0,Rh.jsxDEV)("pre",{"data-testid":"dash-error-message",style:H3e,children:s.message},void 0,!1),(0,Rh.jsxDEV)("button",{"data-testid":"dash-error-retry",onClick:this.reset,type:"button",children:a??"Try again"},void 0,!1)]},void 0,!0)}};var Jt=K(Ro(),1);var Uu=K(oe(),1);var bv=typeof window<"u"?Uu.useLayoutEffect:Uu.useEffect;function hM(t){let e=Uu.useRef({value:t,prev:null}),o=e.current.value;return t!==o&&(e.current={value:t,prev:o}),e.current.prev}n(hM,"usePrevious");function use(t,e,o={},r={}){Uu.useEffect(()=>{if(!t.current||r.disabled||typeof IntersectionObserver!="function")return;let a=new IntersectionObserver(([s])=>{e(s)},o);return a.observe(t.current),()=>{a.disconnect()}},[e,o,r.disabled,t])}n(use,"useIntersectionObserver");function dse(t){let e=Uu.useRef(null);return Uu.useImperativeHandle(t,()=>e.current,[]),e}n(dse,"useForwardedRef");function Eh(t){return t[t.length-1]}n(Eh,"last");function $3e(t){return typeof t=="function"}n($3e,"isFunction");function ul(t,e){return $3e(t)?t(e):t}n(ul,"functionalUpdate");var gse=Object.prototype.hasOwnProperty,fse=Object.prototype.propertyIsEnumerable;function Ah(t){for(let e in t)if(gse.call(t,e))return!0;return!1}n(Ah,"hasKeys");var j3e=n(()=>Object.create(null),"createNull"),Th=n((t,e)=>Kd(t,e,j3e),"nullReplaceEqualDeep");function Kd(t,e,o=()=>({}),r=0){if(!1)return e;if(t===e)return t;if(r>500)return e;let a=e,s=Hz(t)&&Hz(a);if(!s&&!(cF(t)&&cF(a)))return a;let i=s?t:pse(t);if(!i)return a;let c=s?a:pse(a);if(!c)return a;let d=i.length,f=c.length,p=s?new Array(f):o(),m=0;for(let h=0;h<f;h++){let v=s?h:c[h],x=t[v],y=a[v];if(x===y){p[v]=x,(s?h<d:gse.call(t,v))&&m++;continue}if(x===null||y===null||typeof x!="object"||typeof y!="object"){p[v]=y;continue}let b=Kd(x,y,o,r+1);p[v]=b,b===x&&m++}return d===f&&m===d?t:p}n(Kd,"replaceEqualDeep");function pse(t){let e=Object.getOwnPropertyNames(t);for(let a of e)if(!fse.call(t,a))return!1;let o=Object.getOwnPropertySymbols(t);if(o.length===0)return e;let r=e;for(let a of o){if(!fse.call(t,a))return!1;r.push(a)}return r}n(pse,"getEnumerableOwnKeys");function cF(t){if(!mse(t))return!1;let e=t.constructor;if(typeof e>"u")return!0;let o=e.prototype;return!(!mse(o)||!o.hasOwnProperty("isPrototypeOf"))}n(cF,"isPlainObject");function mse(t){return Object.prototype.toString.call(t)==="[object Object]"}n(mse,"hasObjectPrototype");function Hz(t){return Array.isArray(t)&&t.length===Object.keys(t).length}n(Hz,"isPlainArray");function zu(t,e,o){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0,a=t.length;r<a;r++)if(!zu(t[r],e[r],o))return!1;return!0}if(cF(t)&&cF(e)){let r=o?.ignoreUndefined??!0;if(o?.partial){for(let i in e)if((!r||e[i]!==void 0)&&!zu(t[i],e[i],o))return!1;return!0}let a=0;if(!r)a=Object.keys(t).length;else for(let i in t)t[i]!==void 0&&a++;let s=0;for(let i in e)if((!r||e[i]!==void 0)&&(s++,s>a||!zu(t[i],e[i],o)))return!1;return a===s}return!1}n(zu,"deepEqual");function Yd(t){let e,o,r=new Promise((a,s)=>{e=a,o=s});return r.status="pending",r.resolve=a=>{r.status="resolved",r.value=a,e(a),t?.(a)},r.reject=a=>{r.status="rejected",o(a)},r}n(Yd,"createControlledPromise");function kh(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}n(kh,"isPromise");function $z(t,e){for(let o=t.length-1;o>=0;o--){let r=t[o];if(e(r))return r}}n($z,"findLast");function q3e(t){return t.replace(/[\x00-\x1f\x7f]/g,"")}n(q3e,"sanitizePathSegment");function hse(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,o=>{try{return decodeURI(o)}catch{return o}})}return q3e(e)}n(hse,"decodeSegment");var jz=["http:","https:","mailto:","tel:"];function Xd(t,e){if(!t)return!1;try{let o=new URL(t);return!e.has(o.protocol)}catch{return!1}}n(Xd,"isDangerousProtocol");function GI(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};let e=/%25|%5C/gi,o=0,r="",a;for(;(a=e.exec(t))!==null;)r+=hse(t.slice(o,a.index))+a[0],o=e.lastIndex;r=r+hse(o?t.slice(o):t);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}n(GI,"decodePath");function vse(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}n(vse,"encodePathLikeUrl");function xse(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(t[o]!==e[o])return!1;return!0}n(xse,"arraysEqual");function za(){throw new Error("Invariant failed")}n(za,"invariant");function Mh(t){let e=new Map,o,r,a=n(s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,o=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)},"touch");return{get(s){let i=e.get(s);if(i)return a(i),i.value},set(s,i){if(e.size>=t&&o){let d=o;e.delete(d.key),d.next&&(o=d.next,d.next.prev=void 0),d===r&&(r=void 0)}let c=e.get(s);if(c)c.value=i,a(c);else{let d={key:s,value:i,prev:r};r&&(r.next=d),r=d,o||(o=d),e.set(s,d)}},clear(){e.clear(),o=void 0,r=void 0}}}n(Mh,"createLRUCache");var Oh=4,Ise=5;function W3e(t){let e=t.indexOf("{");if(e===-1)return null;let o=t.indexOf("}",e);return o===-1||e+1>=t.length?null:[e,o]}n(W3e,"getOpenAndCloseBraces");function Gz(t,e,o=new Uint16Array(6)){let r=t.indexOf("/",e),a=r===-1?t.length:r,s=t.substring(e,a);if(!s||!s.includes("$"))return o[0]=0,o[1]=e,o[2]=e,o[3]=a,o[4]=a,o[5]=a,o;if(s==="$"){let c=t.length;return o[0]=2,o[1]=e,o[2]=e,o[3]=c,o[4]=c,o[5]=c,o}if(s.charCodeAt(0)===36)return o[0]=1,o[1]=e,o[2]=e+1,o[3]=a,o[4]=a,o[5]=a,o;let i=W3e(s);if(i){let[c,d]=i,f=s.charCodeAt(c+1);if(f===45){if(c+2<s.length&&s.charCodeAt(c+2)===36){let p=c+3,m=d;if(p<m)return o[0]=3,o[1]=e+c,o[2]=e+p,o[3]=e+m,o[4]=e+d+1,o[5]=a,o}}else if(f===36){let p=c+1,m=c+2;return m===d?(o[0]=2,o[1]=e+c,o[2]=e+p,o[3]=e+m,o[4]=e+d+1,o[5]=t.length,o):(o[0]=1,o[1]=e+c,o[2]=e+m,o[3]=e+d,o[4]=e+d+1,o[5]=a,o)}}return o[0]=0,o[1]=e,o[2]=e,o[3]=a,o[4]=a,o[5]=a,o}n(Gz,"parseSegment");function xM(t,e,o,r,a,s,i){i?.(o);let c=r;{let d=o.fullPath??o.from,f=d.length,p=o.options?.caseSensitive??t,m=o.options?.params?.parse??o.options?.parseParams;for(;c<f;){let v=Gz(d,c,e),x,y=c,b=v[5];switch(c=b+1,s++,v[0]){case 0:{let S=d.substring(v[2],v[3]);if(p){let w=a.static?.get(S);if(w)x=w;else{a.static??=new Map;let C=Sv(o.fullPath??o.from);C.parent=a,C.depth=s,x=C,a.static.set(S,C)}}else{let w=S.toLowerCase(),C=a.staticInsensitive?.get(w);if(C)x=C;else{a.staticInsensitive??=new Map;let F=Sv(o.fullPath??o.from);F.parent=a,F.depth=s,x=F,a.staticInsensitive.set(w,F)}}break}case 1:{let S=d.substring(y,v[1]),w=d.substring(v[4],b),C=p&&!!(S||w),F=S?C?S:S.toLowerCase():void 0,T=w?C?w:w.toLowerCase():void 0,E=!m&&a.dynamic?.find(k=>!k.parse&&k.caseSensitive===C&&k.prefix===F&&k.suffix===T);if(E)x=E;else{let k=Wz(1,o.fullPath??o.from,C,F,T);x=k,k.depth=s,k.parent=a,a.dynamic??=[],a.dynamic.push(k)}break}case 3:{let S=d.substring(y,v[1]),w=d.substring(v[4],b),C=p&&!!(S||w),F=S?C?S:S.toLowerCase():void 0,T=w?C?w:w.toLowerCase():void 0,E=!m&&a.optional?.find(k=>!k.parse&&k.caseSensitive===C&&k.prefix===F&&k.suffix===T);if(E)x=E;else{let k=Wz(3,o.fullPath??o.from,C,F,T);x=k,k.parent=a,k.depth=s,a.optional??=[],a.optional.push(k)}break}case 2:{let S=d.substring(y,v[1]),w=d.substring(v[4],b),C=p&&!!(S||w),F=S?C?S:S.toLowerCase():void 0,T=w?C?w:w.toLowerCase():void 0,E=Wz(2,o.fullPath??o.from,C,F,T);x=E,E.parent=a,E.depth=s,a.wildcard??=[],a.wildcard.push(E)}}a=x}if(m&&o.children&&!o.isRoot&&o.id&&o.id.charCodeAt(o.id.lastIndexOf("/")+1)===95){let v=Sv(o.fullPath??o.from);v.kind=Ise,v.parent=a,s++,v.depth=s,a.pathless??=[],a.pathless.push(v),a=v}let h=(o.path||!o.children)&&!o.isRoot;if(h&&d.endsWith("/")){let v=Sv(o.fullPath??o.from);v.kind=Oh,v.parent=a,s++,v.depth=s,a.index=v,a=v}a.parse=m??null,a.priority=o.options?.params?.priority??0,h&&!a.route&&(a.route=o,a.fullPath=o.fullPath??o.from)}if(o.children)for(let d of o.children)xM(t,e,d,c,a,s,i)}n(xM,"parseSegments");function qz(t,e){if(t.parse&&!e.parse)return-1;if(!t.parse&&e.parse)return 1;if(t.parse&&e.parse&&(t.priority||e.priority))return e.priority-t.priority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}n(qz,"sortDynamic");function Ph(t){if(t.pathless)for(let e of t.pathless)Ph(e);if(t.static)for(let e of t.static.values())Ph(e);if(t.staticInsensitive)for(let e of t.staticInsensitive.values())Ph(e);if(t.dynamic?.length){t.dynamic.sort(qz);for(let e of t.dynamic)Ph(e)}if(t.optional?.length){t.optional.sort(qz);for(let e of t.optional)Ph(e)}if(t.wildcard?.length){t.wildcard.sort(qz);for(let e of t.wildcard)Ph(e)}}n(Ph,"sortTreeNodes");function Sv(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0}}n(Sv,"createStaticNode");function Wz(t,e,o,r,a){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0,caseSensitive:o,prefix:r,suffix:a}}n(Wz,"createDynamicNode");function bse(t,e){let o=Sv("/"),r=new Uint16Array(6);for(let a of t)xM(!1,r,a,1,o,0);Ph(o),e.masksTree=o,e.flatCache=Mh(1e3)}n(bse,"processRouteMasks");function Sse(t,e){t||="/";let o=e.flatCache.get(t);if(o)return o;let r=Kz(t,e.masksTree);return e.flatCache.set(t,r),r}n(Sse,"findFlatMatch");function wse(t,e,o,r,a){t||="/",r||="/";let s=e?`case\0${t}`:t,i=a.singleCache.get(s);return i||(i=Sv("/"),xM(e,new Uint16Array(6),{from:t},1,i,0),a.singleCache.set(s,i)),Kz(r,i,o)}n(wse,"findSingleMatch");function Cse(t,e,o=!1){let r=o?t:`nofuzz\0${t}`,a=e.matchCache.get(r);if(a!==void 0)return a;t||="/";let s;try{s=Kz(t,e.segmentTree,o)}catch(i){if(i instanceof URIError)s=null;else throw i}return s&&(s.branch=Yz(s.route)),e.matchCache.set(r,s),s}n(Cse,"findRouteMatch");function G3e(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}n(G3e,"trimPathRight");function Fse(t,e=!1,o){let r=Sv(t.fullPath),a=new Uint16Array(6),s={},i={},c=0;return xM(e,a,t,1,r,0,d=>{if(o?.(d,c),d.id in s)throw new Error(`Invariant failed: Duplicate routes found with id: ${String(d.id)}`);if(s[d.id]=d,c!==0&&d.path){let f=G3e(d.fullPath);(!i[f]||d.fullPath.endsWith("/"))&&(i[f]=d)}c++}),Ph(r),{processedTree:{segmentTree:r,singleCache:Mh(1e3),matchCache:Mh(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:i}}n(Fse,"processRouteTree");function Kz(t,e,o=!1){let r=t.split("/"),a=Y3e(t,r,e,o);if(!a)return null;let[s]=Rse(t,r,a);return{route:a.node.route,rawParams:s}}n(Kz,"findMatch");function Rse(t,e,o){let r=K3e(o.node),a=null,s=Object.create(null),i=o.extract?.part??0,c=o.extract?.node??0,d=o.extract?.path??0,f=o.extract?.segment??0;for(;c<r.length;i++,c++,d++,f++){let p=r[c];if(p.kind===Oh)break;if(p.kind===Ise){f--,i--,d--;continue}let m=e[i],h=d;if(m&&(d+=m.length),p.kind===1){a??=o.node.fullPath.split("/");let v=a[f],x=p.prefix?.length??0;if(v.charCodeAt(x)===123){let y=p.suffix?.length??0,b=v.substring(x+2,v.length-y-1),S=m.substring(x,m.length-y);s[b]=decodeURIComponent(S)}else{let y=v.substring(1);s[y]=decodeURIComponent(m)}}else if(p.kind===3){if(o.skipped&1<<c){i--,d=h-1;continue}a??=o.node.fullPath.split("/");let v=a[f],x=p.prefix?.length??0,y=p.suffix?.length??0,b=v.substring(x+3,v.length-y-1),S=p.suffix||p.prefix?m.substring(x,m.length-y):m;S&&(s[b]=decodeURIComponent(S))}else if(p.kind===2){let v=p,x=t.substring(h+(v.prefix?.length??0),t.length-(v.suffix?.length??0)),y=decodeURIComponent(x);s["*"]=y,s._splat=y;break}}return o.rawParams&&Object.assign(s,o.rawParams),[s,{part:i,node:c,path:d,segment:f}]}n(Rse,"extractParams");function Yz(t){let e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}n(Yz,"buildRouteBranch");function K3e(t){let e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}n(K3e,"buildBranch");function Y3e(t,e,o,r){if(t==="/"&&o.index)return{node:o.index,skipped:0};let a=!Eh(e),s=a&&t!=="/",i=e.length-(a?1:0),c=[{node:o,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],d=null,f=null;for(;c.length;){let p=c.pop(),{node:m,index:h,skipped:v,depth:x,statics:y,dynamics:b,optionals:S}=p,{extract:w,rawParams:C}=p;if(m.kind===2&&m.route&&!vM(f,p))continue;if(m.parse){if(!yse(t,e,p))continue;C=p.rawParams,w=p.extract}r&&m.route&&m.kind!==Oh&&vM(d,p)&&(d=p);let F=h===i;if(F&&(m.route&&(!s||m.kind===Oh||m.kind===2)&&vM(f,p)&&(f=p),!m.optional&&!m.wildcard&&!m.index&&!m.pathless))continue;let T=F?void 0:e[h],E;if(F&&m.index){let k={node:m.index,index:h,skipped:v,depth:x+1,statics:y,dynamics:b,optionals:S,extract:w,rawParams:C},P=!0;if(m.index.parse&&(yse(t,e,k)||(P=!1)),P){if(!b&&!S&&!v&&X3e(y,i))return k;vM(f,k)&&(f=k)}}if(m.wildcard)for(let k=m.wildcard.length-1;k>=0;k--){let P=m.wildcard[k],{prefix:_,suffix:M}=P;if(!(_&&(F||!(P.caseSensitive?T:E??=T.toLowerCase()).startsWith(_)))){if(M){if(F)continue;let L=e.slice(h).join("/").slice(-M.length);if((P.caseSensitive?L:L.toLowerCase())!==M)continue}c.push({node:P,index:i,skipped:v,depth:x+1,statics:y,dynamics:b,optionals:S,extract:w,rawParams:C})}}if(m.optional){let k=v|1<<x,P=x+1;for(let _=m.optional.length-1;_>=0;_--){let M=m.optional[_];c.push({node:M,index:h,skipped:k,depth:P,statics:y,dynamics:b,optionals:S,extract:w,rawParams:C})}if(!F)for(let _=m.optional.length-1;_>=0;_--){let M=m.optional[_],{prefix:L,suffix:U}=M;if(L||U){let W=M.caseSensitive?T:E??=T.toLowerCase();if(L&&!W.startsWith(L)||U&&!W.endsWith(U))continue}c.push({node:M,index:h+1,skipped:v,depth:P,statics:y,dynamics:b,optionals:S+gM(i,h),extract:w,rawParams:C})}}if(!F&&m.dynamic&&T)for(let k=m.dynamic.length-1;k>=0;k--){let P=m.dynamic[k],{prefix:_,suffix:M}=P;if(_||M){let L=P.caseSensitive?T:E??=T.toLowerCase();if(_&&!L.startsWith(_)||M&&!L.endsWith(M))continue}c.push({node:P,index:h+1,skipped:v,depth:x+1,statics:y,dynamics:b+gM(i,h),optionals:S,extract:w,rawParams:C})}if(!F&&m.staticInsensitive){let k=m.staticInsensitive.get(E??=T.toLowerCase());k&&c.push({node:k,index:h+1,skipped:v,depth:x+1,statics:y+gM(i,h),dynamics:b,optionals:S,extract:w,rawParams:C})}if(!F&&m.static){let k=m.static.get(T);k&&c.push({node:k,index:h+1,skipped:v,depth:x+1,statics:y+gM(i,h),dynamics:b,optionals:S,extract:w,rawParams:C})}if(m.pathless){let k=x+1;for(let P=m.pathless.length-1;P>=0;P--){let _=m.pathless[P];c.push({node:_,index:h,skipped:v,depth:k,statics:y,dynamics:b,optionals:S,extract:w,rawParams:C})}}}if(f)return f;if(r&&d){let p=d.index;for(let h=0;h<d.index;h++)p+=e[h].length;let m=p===t.length?"/":t.slice(p);return d.rawParams??=Object.create(null),d.rawParams["**"]=decodeURIComponent(m),d}return null}n(Y3e,"getNodeMatch");function gM(t,e){return 2**(t-e-1)}n(gM,"segmentScore");function X3e(t,e){return t===2**(e-1)-1}n(X3e,"isPerfectStaticMatch");function yse(t,e,o){let r,a;try{[r,a]=Rse(t,e,o)}catch{return null}if(o.rawParams=r,o.extract=a,!o.node.parse)return!0;try{if(o.node.parse(r)===!1)return null}catch{}return!0}n(yse,"validateParseParams");function vM(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===Oh)>(t.node.kind===Oh)||e.node.kind===Oh==(t.node.kind===Oh)&&e.depth>t.depth))):!0}n(vM,"isFrameMoreSpecific");function wv(t){return dF(t.filter(e=>e!==void 0).join("/"))}n(wv,"joinPaths");function dF(t){return t.replace(/\/{2,}/g,"/")}n(dF,"cleanPath");function yM(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}n(yM,"trimPathLeft");function Yl(t){let e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}n(Yl,"trimPathRight");function fF(t){return Yl(yM(t))}n(fF,"trimPath");function Nh(t,e){return t?.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}n(Nh,"removeTrailingSlash");function IM(t,e,o){return Nh(t,o)===Nh(e,o)}n(IM,"exactPathTest");function Xz({base:t,to:e,trailingSlash:o="never",cache:r}){let a=e.startsWith("/"),s=!a&&e===".",i;if(r){i=a?e:s?t:t+"\0"+e;let f=r.get(i);if(f)return f}let c;if(s)c=t.split("/");else if(a)c=e.split("/");else{for(c=t.split("/");c.length>1&&Eh(c)==="";)c.pop();let f=e.split("/");for(let p=0,m=f.length;p<m;p++){let h=f[p];h===""?p?p===m-1&&c.push(h):c=[h]:h===".."?c.pop():h==="."||c.push(h)}}c.length>1&&(Eh(c)===""?o==="never"&&c.pop():o==="always"&&c.push(""));let d=dF(c.join("/"))||"/";return i&&r&&r.set(i,d),d}n(Xz,"resolvePath");function Ase(t){let e=new Map(t.map(a=>[encodeURIComponent(a),a])),o=Array.from(e.keys()).map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(o,"g");return a=>a.replace(r,s=>e.get(s)??s)}n(Ase,"compileDecodeCharMap");function uF(t,e,o){let r=e[t];return typeof r!="string"?r:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(a=>Ese(a,o)).join("/"):Ese(r,o)}n(uF,"encodeParam");function bM({path:t,params:e,decoder:o,...r}){let a=!1,s=Object.create(null);if(!t||t==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:a};if(!t.includes("$"))return{interpolatedPath:t,usedParams:s,isMissingParams:a};if(!1){let p=t.length,m=0,h="";for(;m<p;){for(;m<p&&t.charCodeAt(m)===47;)m++;if(m>=p)break;let v=m,x=t.indexOf("/",m);x===-1&&(x=p),m=x;let y=t.substring(v,x);if(y)if(y.charCodeAt(0)===36)if(y.length===1){let b=e._splat;if(s._splat=b,s["*"]=b,!b){a=!0;continue}let S=uF("_splat",e,o);h+="/"+S}else{let b=y.substring(1);!a&&!(b in e)&&(a=!0),s[b]=e[b];let S=uF(b,e,o)??"undefined";h+="/"+S}else h+="/"+y}return t.endsWith("/")&&(h+="/"),{usedParams:s,interpolatedPath:h||"/",isMissingParams:a}}let i=t.length,c=0,d,f="";for(;c<i;){let p=c;d=Gz(t,p,d);let m=d[5];if(c=m+1,p===m)continue;let h=d[0];if(h===0){f+="/"+t.substring(p,m);continue}if(h===2){let v=e._splat;s._splat=v,s["*"]=v;let x=t.substring(p,d[1]),y=t.substring(d[4],m);if(!v){a=!0,(x||y)&&(f+="/"+x+y);continue}let b=uF("_splat",e,o);f+="/"+x+b+y;continue}if(h===1){let v=t.substring(d[2],d[3]);!a&&!(v in e)&&(a=!0),s[v]=e[v];let x=t.substring(p,d[1]),y=t.substring(d[4],m),b=uF(v,e,o)??"undefined";f+="/"+x+b+y;continue}if(h===3){let v=t.substring(d[2],d[3]),x=e[v];if(x==null)continue;s[v]=x;let y=t.substring(p,d[1]),b=t.substring(d[4],m),S=uF(v,e,o)??"";f+="/"+y+S+b;continue}}return t.endsWith("/")&&(f+="/"),{usedParams:s,interpolatedPath:f||"/",isMissingParams:a}}n(bM,"interpolatePath");function Ese(t,e){let o=encodeURIComponent(t);return e?.(o)??o}n(Ese,"encodePathParam");function $n(t){return t?.isNotFound===!0}n($n,"isNotFound");function Tse(t,e=String){let o=new URLSearchParams;for(let r in t){let a=t[r];a!==void 0&&o.set(r,e(a))}return o.toString()}n(Tse,"encode");function Qz(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}n(Qz,"toValue");function kse(t){let e=new URLSearchParams(t),o=Object.create(null);for(let[r,a]of e.entries()){let s=o[r];s==null?o[r]=Qz(a):Array.isArray(s)?s.push(Qz(a)):o[r]=[s,Qz(a)]}return o}n(kse,"decode");var Mse=Q3e(JSON.parse),Pse=Z3e(JSON.stringify,JSON.parse);function Q3e(t){return e=>{e[0]==="?"&&(e=e.substring(1));let o=kse(e);for(let r in o){let a=o[r];if(typeof a=="string")try{o[r]=t(a)}catch{}}return o}}n(Q3e,"parseSearchWith");function Z3e(t,e){let o=typeof e=="function";function r(a){if(typeof a=="object"&&a!==null)try{return t(a)}catch{}else if(o&&typeof a=="string")try{return e(a),t(a)}catch{}return a}return n(r,"stringifyValue"),a=>{let s=Tse(a,r);return s?`?${s}`:""}}n(Z3e,"stringifySearchWith");var dl="__root__";function KI(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}let e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);let o=new Response(null,{status:t.statusCode,headers:e});if(o.options=t,t.throw)throw o;return o}n(KI,"redirect");function ns(t){return t instanceof Response&&!!t.options}n(ns,"isRedirect");var Zz=n(t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},"triggerOnReady"),J3e=n(t=>t.stores.matchesId.get().some(e=>t.stores.matchStores.get(e)?.get()._forcePending),"hasForcePendingActiveMatch"),CM=n((t,e)=>!!(t.preload&&!t.router.stores.matchStores.has(e)),"resolvePreload"),Cv=n((t,e,o=!0)=>{let r={...t.router.options.context??{}},a=o?e:e-1;for(let s=0;s<=a;s++){let i=t.matches[s];if(!i)continue;let c=t.router.getMatch(i.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},"buildMatchContext"),Ose=n((t,e)=>{if(!t.matches.length)return;let o=e.routeId,r=t.matches.findIndex(i=>i.routeId===t.router.routeTree.id),a=r>=0?r:0,s=o?t.matches.findIndex(i=>i.routeId===o):t.firstBadMatchIndex??t.matches.length-1;s<0&&(s=a);for(let i=s;i>=0;i--){let c=t.matches[i];if(t.router.looseRoutesById[c.routeId].options.notFoundComponent)return i}return o?s:a},"getNotFoundBoundaryIndex"),Dh=n((t,e,o)=>{if(!(!ns(o)&&!$n(o)))throw ns(o)&&o.redirectHandled&&!o.options.reloadDocument||(e&&(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.loaderPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loaderPromise=void 0,e._nonReactive.error=o,t.updateMatch(e.id,r=>({...r,status:ns(o)?"redirected":$n(o)?"notFound":r.status==="pending"?"success":r.status,context:Cv(t,e.index),isFetching:!1,error:o})),$n(o)&&!o.routeId&&(o.routeId=e.routeId),e._nonReactive.loadPromise?.resolve()),ns(o)&&(t.rendered=!0,o.options._fromLocation=t.location,o.redirectHandled=!0,o=t.router.resolveRedirect(o))),o},"handleRedirectAndNotFound"),Lse=n((t,e)=>{let o=t.router.getMatch(e);return!!(!o||!!1&&o._nonReactive.dehydrated||!1)},"shouldSkipLoader"),Nse=n((t,e,o)=>{let r=Cv(t,o);t.updateMatch(e,a=>({...a,context:r}))},"syncMatchContext"),pF=n((t,e,o)=>{let{id:r,routeId:a}=t.matches[e],s=t.router.looseRoutesById[a];if(o instanceof Promise)throw o;t.firstBadMatchIndex??=e,Dh(t,t.router.getMatch(r),o);try{s.options.onError?.(o)}catch(i){o=i,Dh(t,t.router.getMatch(r),o)}t.updateMatch(r,i=>(i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,i._nonReactive.loadPromise?.resolve(),{...i,error:o,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!t.preload&&!ns(o)&&!$n(o)&&(t.serialError??=o)},"handleSerialError"),eBe=n((t,e,o,r)=>{let a=t.router.getMatch(e),s=t.matches[o-1]?.id,i=s?t.router.getMatch(s):void 0;if(t.router.isShell()){a.ssr=r.id===dl;return}if(i?.ssr===!1){a.ssr=!1;return}let c=n(v=>v===!0&&i?.ssr==="data-only"?"data-only":v,"parentOverride"),d=t.router.options.defaultSsr??!0;if(r.options.ssr===void 0){a.ssr=c(d);return}if(typeof r.options.ssr!="function"){a.ssr=c(r.options.ssr);return}let{search:f,params:p}=a,m={search:SM(f,a.searchError),params:SM(p,a.paramsError),location:t.location,matches:t.matches.map(v=>({index:v.index,pathname:v.pathname,fullPath:v.fullPath,staticData:v.staticData,id:v.id,routeId:v.routeId,search:SM(v.search,v.searchError),params:SM(v.params,v.paramsError),ssr:v.ssr}))},h=r.options.ssr(m);if(kh(h))return h.then(v=>{a.ssr=c(v??d)});a.ssr=c(h??d)},"isBeforeLoadSsr"),Bse=n((t,e,o,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let a=o.options.pendingMs??t.router.options.defaultPendingMs;if(t.onReady&&!!1&&!CM(t,e)&&(o.options.loader||o.options.beforeLoad||eH(o))&&typeof a=="number"&&a!==1/0&&(o.options.pendingComponent??t.router.options?.defaultPendingComponent)){let s=setTimeout(()=>{Zz(t)},a);r._nonReactive.pendingTimeout=s}},"setupPendingTimeout"),tBe=n((t,e,o)=>{let r=t.router.getMatch(e);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Bse(t,e,o,r);let a=n(()=>{let s=t.router.getMatch(e);s.preload&&(s.status==="redirected"||s.status==="notFound")&&Dh(t,s,s.error)},"then");return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(a):a()},"preBeforeLoadSetup"),oBe=n((t,e,o,r)=>{let a=t.router.getMatch(e),s=a._nonReactive.loadPromise;a._nonReactive.loadPromise=Yd(()=>{s?.resolve(),s=void 0});let{paramsError:i,searchError:c}=a;i&&pF(t,o,i),c&&pF(t,o,c),Bse(t,e,r,a);let d=new AbortController,f=!1,p=n(()=>{f||(f=!0,t.updateMatch(e,F=>({...F,isFetching:"beforeLoad",fetchCount:F.fetchCount+1,abortController:d})))},"pending"),m=n(()=>{a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,t.updateMatch(e,F=>({...F,isFetching:!1}))},"resolve");if(!r.options.beforeLoad){t.router.batch(()=>{p(),m()});return}a._nonReactive.beforeLoadPromise=Yd();let h={...Cv(t,o,!1),...a.__routeContext},{search:v,params:x,cause:y}=a,b=CM(t,e),S={search:v,abortController:d,params:x,preload:b,context:h,location:t.location,navigate:n(F=>t.router.navigate({...F,_fromLocation:t.location}),"navigate"),buildLocation:t.router.buildLocation,cause:b?"preload":y,matches:t.matches,routeId:r.id,...t.router.options.additionalContext},w=n(F=>{if(F===void 0){t.router.batch(()=>{p(),m()});return}(ns(F)||$n(F))&&(p(),pF(t,o,F)),t.router.batch(()=>{p(),t.updateMatch(e,T=>({...T,__beforeLoadContext:F})),m()})},"updateContext"),C;try{if(C=r.options.beforeLoad(S),kh(C))return p(),C.catch(F=>{pF(t,o,F)}).then(w)}catch(F){p(),pF(t,o,F)}w(C)},"executeBeforeLoad"),rBe=n((t,e)=>{let{id:o,routeId:r}=t.matches[e],a=t.router.looseRoutesById[r],s=n(()=>{if(!1){let d=eBe(t,o,e,a);if(kh(d))return d.then(c)}return c()},"serverSsr"),i=n(()=>oBe(t,o,e,a),"execute"),c=n(()=>{if(Lse(t,o))return;let d=tBe(t,o,a);return kh(d)?d.then(i):i()},"queueExecution");return s()},"handleBeforeLoad"),nBe=n((t,e,o)=>{let r=t.router.getMatch(e);if(!r||!o.options.head&&!o.options.scripts&&!o.options.headers)return;let a={ssr:t.router.options.ssr,matches:t.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([o.options.head?.(a),o.options.scripts?.(a),o.options.headers?.(a)]).then(([s,i,c])=>({meta:s?.meta,links:s?.links,headScripts:s?.scripts,headers:c,scripts:i,styles:s?.styles}))},"executeHead"),Vse=n((t,e,o,r,a)=>{let s=e[r-1],{params:i,loaderDeps:c,abortController:d,cause:f}=t.router.getMatch(o),p=Cv(t,r),m=CM(t,o);return{params:i,deps:c,preload:!!m,parentMatchPromise:s,abortController:d,context:p,location:t.location,navigate:n(h=>t.router.navigate({...h,_fromLocation:t.location}),"navigate"),cause:m?"preload":f,route:a,...t.router.options.additionalContext}},"getLoaderContext"),Dse=n(async(t,e,o,r,a)=>{try{let s=t.router.getMatch(o);try{(!!1||s.ssr===!0)&&YI(a);let i=a.options.loader,c=typeof i=="function"?i:i?.handler,d=c?.(Vse(t,e,o,r,a)),f=!!c&&kh(d);if((f||a._lazyPromise||a._componentsPromise||a.options.head||a.options.scripts||a.options.headers||s._nonReactive.minPendingPromise)&&t.updateMatch(o,m=>({...m,isFetching:"loader"})),c){let m=f?await d:d;Dh(t,t.router.getMatch(o),m),m!==void 0&&t.updateMatch(o,h=>({...h,loaderData:m}))}a._lazyPromise&&await a._lazyPromise;let p=s._nonReactive.minPendingPromise;p&&await p,a._componentsPromise&&await a._componentsPromise,t.updateMatch(o,m=>({...m,error:void 0,context:Cv(t,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(i){let c=i;if(c?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}t.updateMatch(o,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:Cv(t,r)}));return}let d=s._nonReactive.minPendingPromise;d&&await d,$n(i)&&await a.options.notFoundComponent?.preload?.(),Dh(t,t.router.getMatch(o),i);try{a.options.onError?.(i)}catch(f){c=f,Dh(t,t.router.getMatch(o),f)}!ns(c)&&!$n(c)&&await YI(a,["errorComponent"]),t.updateMatch(o,f=>({...f,error:c,context:Cv(t,r),status:"error",isFetching:!1}))}}catch(s){let i=t.router.getMatch(o);i&&(i._nonReactive.loaderPromise=void 0),Dh(t,i,s)}},"runLoader"),aBe=n(async(t,e,o)=>{async function r(v,x,y,b,S){let w=Date.now()-x.updatedAt,C=v?S.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??t.router.options.defaultStaleTime??0,F=S.options.shouldReload,T=typeof F=="function"?F(Vse(t,e,a,o,S)):F,{status:E,invalid:k}=b,P=w>=C&&(!!t.forceStaleReload||b.cause==="enter"||y!==void 0&&y!==b.id);i=E==="success"&&(k||(T??P)),v&&S.options.preload===!1||(i&&!t.sync&&p?(c=!0,(async()=>{try{await Dse(t,e,a,o,S);let _=t.router.getMatch(a);_._nonReactive.loaderPromise?.resolve(),_._nonReactive.loadPromise?.resolve(),_._nonReactive.loaderPromise=void 0,_._nonReactive.loadPromise=void 0}catch(_){ns(_)&&await t.router.navigate(_.options)}})()):E!=="success"||i?await Dse(t,e,a,o,S):Nse(t,a,o))}n(r,"handleLoader");let{id:a,routeId:s}=t.matches[o],i=!1,c=!1,d=t.router.looseRoutesById[s],f=d.options.loader,p=((typeof f=="function"?void 0:f?.staleReloadMode)??t.router.options.defaultStaleReloadMode)!=="blocking";if(Lse(t,a)){if(!t.router.getMatch(a))return t.matches[o];if(Nse(t,a,o),!1)return t.router.getMatch(a)}else{let v=t.router.getMatch(a),x=t.router.stores.matchesId.get()[o],y=(x&&t.router.stores.matchStores.get(x)||null)?.routeId===s?x:t.router.stores.matches.get().find(S=>S.routeId===s)?.id,b=CM(t,a);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!t.sync&&!v.preload&&p)return v;await v._nonReactive.loaderPromise;let S=t.router.getMatch(a),w=S._nonReactive.error||S.error;w&&Dh(t,S,w),S.status==="pending"&&await r(b,v,y,S,d)}else{let S=b&&!t.router.stores.matchStores.has(a),w=t.router.getMatch(a);w._nonReactive.loaderPromise=Yd(),S!==w.preload&&t.updateMatch(a,C=>({...C,preload:S})),await r(b,v,y,w,d)}}let m=t.router.getMatch(a);c||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,c||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;let h=c?m.isFetching:!1;return h!==m.isFetching||m.invalid!==!1?(t.updateMatch(a,v=>({...v,isFetching:h,invalid:!1})),t.router.getMatch(a)):m},"loadRouteMatch");async function Jz(t){let e=t,o=[];!!1&&J3e(e.router)&&Zz(e);let r;for(let h=0;h<e.matches.length;h++){try{let v=rBe(e,h);kh(v)&&await v}catch(v){if(ns(v))throw v;if($n(v))r=v;else if(!e.preload)throw v;break}if(e.serialError||e.firstBadMatchIndex!=null)break}let a=e.firstBadMatchIndex??e.matches.length,s=r&&!e.preload?Ose(e,r):void 0,i=r&&e.preload?0:s!==void 0?Math.min(s+1,a):a,c,d;for(let h=0;h<i;h++)o.push(aBe(e,o,h));try{await Promise.all(o)}catch{let h=await Promise.allSettled(o);for(let v of h){if(v.status!=="rejected")continue;let x=v.reason;if(ns(x))throw x;$n(x)?c??=x:d??=x}if(d!==void 0)throw d}let f=c??(r&&!e.preload?r:void 0),p=e.firstBadMatchIndex!==void 0?e.firstBadMatchIndex:e.matches.length-1;if(!f&&r&&e.preload)return e.matches;if(f){let h=Ose(e,f);if(h===void 0)throw new Error("Invariant failed: Could not find match for notFound boundary");let v=e.matches[h],x=e.router.looseRoutesById[v.routeId],y=e.router.options?.defaultNotFoundComponent;!x.options.notFoundComponent&&y&&(x.options.notFoundComponent=y),f.routeId=v.routeId;let b=v.routeId===e.router.routeTree.id;e.updateMatch(v.id,S=>({...S,...b?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),p=h,await YI(x,["notFoundComponent"])}else if(!e.preload){let h=e.matches[0];h.globalNotFound||e.router.getMatch(h.id)?.globalNotFound&&e.updateMatch(h.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(e.serialError&&e.firstBadMatchIndex!==void 0){let h=e.router.looseRoutesById[e.matches[e.firstBadMatchIndex].routeId];await YI(h,["errorComponent"])}for(let h=0;h<=p;h++){let{id:v,routeId:x}=e.matches[h],y=e.router.looseRoutesById[x];try{let b=nBe(e,v,y);if(b){let S=await b;e.updateMatch(v,w=>({...w,...S}))}}catch(b){console.error(`Error executing head for route ${x}:`,b)}}let m=Zz(e);if(kh(m)&&await m,f)throw f;if(e.serialError&&!e.preload&&!e.onReady)throw e.serialError;return e.matches}n(Jz,"loadMatches");function _se(t,e){let o=e.map(r=>t.options[r]?.preload?.()).filter(Boolean);if(o.length!==0)return Promise.all(o)}n(_se,"preloadRouteComponents");function YI(t,e=wM){!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(r=>{let{id:a,...s}=r.options;Object.assign(t.options,s),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0);let o=n(()=>t._componentsLoaded?void 0:e===wM?(()=>{if(t._componentsPromise===void 0){let r=_se(t,wM);r?t._componentsPromise=r.then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0}):t._componentsLoaded=!0}return t._componentsPromise})():_se(t,e),"runAfterLazy");return t._lazyPromise?t._lazyPromise.then(o):o()}n(YI,"loadRouteChunk");function SM(t,e){return e?{status:"error",error:e}:{status:"success",value:t}}n(SM,"makeMaybe");function eH(t){for(let e of wM)if(t.options[e]?.preload)return!0;return!1}n(eH,"routeNeedsPreload");var wM=["component","errorComponent","pendingComponent","notFoundComponent"];function Use(t){return{input:n(({url:e})=>{for(let o of t)e=FM(o,e);return e},"input"),output:n(({url:e})=>{for(let o=t.length-1;o>=0;o--)e=tH(t[o],e);return e},"output")}}n(Use,"composeRewrites");function zse(t){let e=fF(t.basepath),o=`/${e}`,r=t.caseSensitive?o:o.toLowerCase(),a=`${r}/`;return{input:n(({url:s})=>{let i=t.caseSensitive?s.pathname:s.pathname.toLowerCase();return i===r?s.pathname="/":i.startsWith(a)&&(s.pathname=s.pathname.slice(o.length)),s},"input"),output:n(({url:s})=>(s.pathname=wv(["/",e,s.pathname]),s),"output")}}n(zse,"rewriteBasepath");function FM(t,e){let o=t?.input?.({url:e});if(o){if(typeof o=="string")return new URL(o);if(o instanceof URL)return o}return e}n(FM,"executeRewriteInput");function tH(t,e){let o=t?.output?.({url:e});if(o){if(typeof o=="string")return new URL(o);if(o instanceof URL)return o}return e}n(tH,"executeRewriteOutput");function nH(t){let e=t;return{get(){return e},set(o){e=ul(o,e)}}}n(nH,"createNonReactiveMutableStore");function aH(t){return{get(){return t()}}}n(aH,"createNonReactiveReadonlyStore");function Hse(t,e){let{createMutableStore:o,createReadonlyStore:r,batch:a,init:s}=e,i=new Map,c=new Map,d=new Map,f=o(t.status),p=o(t.loadedAt),m=o(t.isLoading),h=o(t.isTransitioning),v=o(t.location),x=o(t.resolvedLocation),y=o(t.statusCode),b=o(t.redirect),S=o([]),w=o([]),C=o([]),F=r(()=>oH(i,S.get())),T=r(()=>oH(c,w.get())),E=r(()=>oH(d,C.get())),k=r(()=>S.get()[0]),P=r(()=>S.get().some(D=>i.get(D)?.get().status==="pending")),_=r(()=>({locationHref:v.get().href,resolvedLocationHref:x.get()?.href,status:f.get()})),M=r(()=>({status:f.get(),loadedAt:p.get(),isLoading:m.get(),isTransitioning:h.get(),matches:F.get(),location:v.get(),resolvedLocation:x.get(),statusCode:y.get(),redirect:b.get()})),L=Mh(64);function U(D){let B=L.get(D);return B||(B=r(()=>{let z=S.get();for(let q of z){let H=i.get(q);if(H&&H.routeId===D)return H.get()}}),L.set(D,B)),B}n(U,"getRouteMatchStore");let W={status:f,loadedAt:p,isLoading:m,isTransitioning:h,location:v,resolvedLocation:x,statusCode:y,redirect:b,matchesId:S,pendingIds:w,cachedIds:C,matches:F,pendingMatches:T,cachedMatches:E,firstId:k,hasPending:P,matchRouteDeps:_,matchStores:i,pendingMatchStores:c,cachedMatchStores:d,__store:M,getRouteMatchStore:U,setMatches:V,setPending:j,setCached:N};V(t.matches),s?.(W);function V(D){rH(D,i,S,o,a)}n(V,"setMatches");function j(D){rH(D,c,w,o,a)}n(j,"setPending");function N(D){rH(D,d,C,o,a)}return n(N,"setCached"),W}n(Hse,"createRouterStores");function oH(t,e){let o=[];for(let r of e){let a=t.get(r);a&&o.push(a.get())}return o}n(oH,"readPoolMatches");function rH(t,e,o,r,a){let s=t.map(c=>c.id),i=new Set(s);a(()=>{for(let c of e.keys())i.has(c)||e.delete(c);for(let c of t){let d=e.get(c.id);if(!d){let f=r(c);f.routeId=c.routeId,e.set(c.id,f);continue}d.routeId=c.routeId,d.get()!==c&&d.set(c)}xse(o.get(),s)||o.set(s)})}n(rH,"reconcileMatchPool");var _h="__TSR_index",$se="popstate",jse="beforeunload";function iH(t){let e=t.getLocation(),o=new Set,r=n(i=>{e=t.getLocation(),o.forEach(c=>c({location:e,action:i}))},"notify"),a=n(i=>{t.notifyOnIndexChange??!0?r(i):e=t.getLocation()},"handleIndexChange"),s=n(async({task:i,navigateOpts:c,...d})=>{if(c?.ignoreBlocker??!1){i();return}let f=t.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&f.length&&p)for(let m of f){let h=XI(d.path,d.state);if(await m.blockerFn({currentLocation:e,nextLocation:h,action:d.type})){t.onBlocked?.();return}}i()},"tryNavigation");return{get location(){return e},get length(){return t.getLength()},subscribers:o,subscribe:n(i=>(o.add(i),()=>{o.delete(i)}),"subscribe"),push:n((i,c,d)=>{let f=e.state[_h];c=sH(f+1,c),s({task:n(()=>{t.pushState(i,c),r({type:"PUSH"})},"task"),navigateOpts:d,type:"PUSH",path:i,state:c})},"push"),replace:n((i,c,d)=>{let f=e.state[_h];c=sH(f,c),s({task:n(()=>{t.replaceState(i,c),r({type:"REPLACE"})},"task"),navigateOpts:d,type:"REPLACE",path:i,state:c})},"replace"),go:n((i,c)=>{s({task:n(()=>{t.go(i),a({type:"GO",index:i})},"task"),navigateOpts:c,type:"GO"})},"go"),back:n(i=>{s({task:n(()=>{t.back(i?.ignoreBlocker??!1),a({type:"BACK"})},"task"),navigateOpts:i,type:"BACK"})},"back"),forward:n(i=>{s({task:n(()=>{t.forward(i?.ignoreBlocker??!1),a({type:"FORWARD"})},"task"),navigateOpts:i,type:"FORWARD"})},"forward"),canGoBack:n(()=>e.state[_h]!==0,"canGoBack"),createHref:n(i=>t.createHref(i),"createHref"),block:n(i=>{if(!t.setBlockers)return()=>{};let c=t.getBlockers?.()??[];return t.setBlockers([...c,i]),()=>{let d=t.getBlockers?.()??[];t.setBlockers?.(d.filter(f=>f!==i))}},"block"),flush:n(()=>t.flush?.(),"flush"),destroy:n(()=>t.destroy?.(),"destroy"),notify:r}}n(iH,"createHistory");function sH(t,e){e||(e={});let o=cH();return{...e,key:o,__TSR_key:o,[_h]:t}}n(sH,"assignKeyAndIndex");function mF(t){let e=t?.window??(typeof document<"u"?window:void 0),o=e.history.pushState,r=e.history.replaceState,a=[],s=n(()=>a,"_getBlockers"),i=n(P=>a=P,"_setBlockers"),c=t?.createHref??(P=>P),d=t?.parseLocation??(()=>XI(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){let P=cH();e.history.replaceState({[_h]:0,key:P,__TSR_key:P},"")}let f=d(),p,m=!1,h=!1,v=!1,x=!1,y=n(()=>f,"getLocation"),b,S,w=n(()=>{b&&(k._ignoreSubscribers=!0,(b.isPush?e.history.pushState:e.history.replaceState)(b.state,"",b.href),k._ignoreSubscribers=!1,b=void 0,S=void 0,p=void 0)},"flush"),C=n((P,_,M)=>{let L=c(_);S||(p=f),f=XI(_,M),b={href:L,state:M,isPush:b?.isPush||P==="push"},S||(S=Promise.resolve().then(()=>w()))},"queueHistoryAction"),F=n(P=>{f=d(),k.notify({type:P})},"onPushPop"),T=n(async()=>{if(h){h=!1;return}let P=d(),_=P.state[_h]-f.state[_h],M=_===1,L=_===-1,U=!M&&!L||m;m=!1;let W=U?"GO":L?"BACK":"FORWARD",V=U?{type:"GO",index:_}:{type:L?"BACK":"FORWARD"};if(v)v=!1;else{let j=s();if(typeof document<"u"&&j.length){for(let N of j)if(await N.blockerFn({currentLocation:f,nextLocation:P,action:W})){h=!0,e.history.go(1),k.notify(V);return}}}f=d(),k.notify(V)},"onPushPopEvent"),E=n(P=>{if(x){x=!1;return}let _=!1,M=s();if(typeof document<"u"&&M.length)for(let L of M){let U=L.enableBeforeUnload??!0;if(U===!0){_=!0;break}if(typeof U=="function"&&U()===!0){_=!0;break}}if(_)return P.preventDefault(),P.returnValue=""},"onBeforeUnload"),k=iH({getLocation:y,getLength:n(()=>e.history.length,"getLength"),pushState:n((P,_)=>C("push",P,_),"pushState"),replaceState:n((P,_)=>C("replace",P,_),"replaceState"),back:n(P=>(P&&(v=!0),x=!0,e.history.back()),"back"),forward:n(P=>{P&&(v=!0),x=!0,e.history.forward()},"forward"),go:n(P=>{m=!0,e.history.go(P)},"go"),createHref:n(P=>c(P),"createHref"),flush:w,destroy:n(()=>{e.history.pushState=o,e.history.replaceState=r,e.removeEventListener(jse,E,{capture:!0}),e.removeEventListener($se,T)},"destroy"),onBlocked:n(()=>{p&&f!==p&&(f=p)},"onBlocked"),getBlockers:s,setBlockers:i,notifyOnIndexChange:!1});return e.addEventListener(jse,E,{capture:!0}),e.addEventListener($se,T),e.history.pushState=function(...P){let _=o.apply(e.history,P);return k._ignoreSubscribers||F("PUSH"),_},e.history.replaceState=function(...P){let _=r.apply(e.history,P);return k._ignoreSubscribers||F("REPLACE"),_},k}n(mF,"createBrowserHistory");function lH(t={initialEntries:["/"]}){let e=t.initialEntries,o=t.initialIndex?Math.min(Math.max(t.initialIndex,0),e.length-1):e.length-1,r=e.map((d,f)=>sH(f,void 0)),a=n(()=>XI(e[o],r[o]),"getLocation"),s=[];return iH({getLocation:a,getLength:n(()=>e.length,"getLength"),pushState:n((d,f)=>{o<e.length-1&&(e.splice(o+1),r.splice(o+1)),r.push(f),e.push(d),o=Math.max(e.length-1,0)},"pushState"),replaceState:n((d,f)=>{r[o]=f,e[o]=d},"replaceState"),back:n(()=>{o=Math.max(o-1,0)},"back"),forward:n(()=>{o=Math.min(o+1,e.length-1)},"forward"),go:n(d=>{o=Math.min(Math.max(o+d,0),e.length-1)},"go"),createHref:n(d=>d,"createHref"),getBlockers:n(()=>s,"_getBlockers"),setBlockers:n(d=>s=d,"_setBlockers")})}n(lH,"createMemoryHistory");function sBe(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}n(sBe,"sanitizePath");function XI(t,e){let o=sBe(t),r=o.indexOf("#"),a=o.indexOf("?"),s=cH();return{href:o,pathname:o.substring(0,r>0?a>0?Math.min(r,a):r:a>0?a:o.length),hash:r>-1?o.substring(r):"",search:a>-1?o.slice(a,r===-1?void 0:r):"",state:e||{[_h]:0,key:s,__TSR_key:s}}}n(XI,"parseHref");function cH(){return(Math.random()+1).toString(36).substring(7)}n(cH,"createRandomKey");function wp(t,e){let o=e,r=t;return{fromLocation:o,toLocation:r,pathChanged:o?.pathname!==r.pathname,hrefChanged:o?.href!==r.href,hashChanged:o?.hash!==r.hash}}n(wp,"getLocationChangeInfo");var EM=new WeakMap,uH=class{static{n(this,"RouterCore")}constructor(t,e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=o=>o(),this.update=o=>{o.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");let r=this.options,a=this.basepath??r?.basepath??"/",s=this.basepath===void 0,i=r?.rewrite;if(this.options={...r,...o},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Ase(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=mF()),this.origin=this.options.origin,this.origin||(!!1&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let p;!1,this.resolvePathCache=Mh(1e3),p=this.buildRouteTree(),!1,this.setRoutes(p)}if(!this.stores&&this.latestLocation){let p=this.getStoreConfig(this);this.batch=p.batch,this.stores=Hse(Yse(this.latestLocation),p),Qse(this)}let c=!1,d=this.options.basepath??"/",f=this.options.rewrite;if(s||a!==d||i!==f){this.basepath=d;let p=[],m=fF(d);m&&m!=="/"&&p.push(zse({basepath:d})),f&&p.push(f),this.rewrite=p.length===0?void 0:p.length===1?p[0]:Use(p),this.history&&this.updateLatestLocation(),c=!0}c&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let o=Fse(this.routeTree,this.options.caseSensitive,(r,a)=>{r.init({originalIndex:a})});return this.options.routeMasks&&bse(this.options.routeMasks,o.processedTree),o},this.subscribe=(o,r)=>{let a={eventType:o,fn:r};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=o=>{this.subscribers.forEach(r=>{r.eventType===o.type&&r.fn(o)})},this.parseLocation=(o,r)=>{let a=n(({pathname:d,search:f,hash:p,href:m,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){let S=this.options.parseSearch(f),w=this.options.stringifySearch(S);return{href:d+w+p,publicHref:d+w+p,pathname:GI(d).path,external:!1,searchStr:w,search:Th(r?.search,S),hash:GI(p.slice(1)).path,state:Kd(r?.state,h)}}let v=new URL(m,this.origin),x=FM(this.rewrite,v),y=this.options.parseSearch(x.search),b=this.options.stringifySearch(y);return x.search=b,{href:x.href.replace(x.origin,""),publicHref:m,pathname:GI(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:b,search:Th(r?.search,y),hash:GI(x.hash.slice(1)).path,state:Kd(r?.state,h)}},"parse"),s=a(o),{__tempLocation:i,__tempKey:c}=s.state;if(i&&(!c||c===this.tempLocationKey)){let d=a(i);return d.state.key=s.state.key,d.state.__TSR_key=s.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:s}}return s},this.resolvePathWithBase=(o,r)=>Xz({base:o,to:r.includes("//")?dF(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(o,r,a)=>typeof o=="string"?this.matchRoutesInternal({pathname:o,search:r},a):this.matchRoutesInternal(o,r),this.getMatchedRoutes=o=>Xse({pathname:o,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=o=>{let r=this.getMatch(o);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(o=>{this.cancelMatch(o)}),this.stores.matchesId.get().forEach(o=>{if(this.stores.pendingMatchStores.has(o))return;let r=this.stores.matchStores.get(o)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(o)})},this.buildLocation=o=>{let r=n((s={})=>{let i=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutesLightweight(i);if(s.from&&s._isNavigate){let L=this.getMatchedRoutes(s.from).matchedRoutes,U=$z(c.matchedRoutes,V=>Wse(V.fullPath,s.from)),W=$z(L,V=>Wse(V.fullPath,c.fullPath));!U&&!W&&console.warn(`Could not find match for from: ${s.from}`)}let d=s.unsafeRelative==="path"?i.pathname:s.from??c.fullPath,f=s.to?`${s.to}`:void 0,p=c.search,m=Object.assign(Object.create(null),c.params),h=f?.charCodeAt(0)===47?"/":this.resolvePathWithBase(d,"."),v=f?this.resolvePathWithBase(h,f):h,x=s.params===!1||s.params===null?Object.create(null):(s.params??!0)===!0?m:Object.assign(m,ul(s.params,m)),y=this.routesByPath[Yl(v)],b;if(y)b=this.getRouteBranch(y);else if(v.includes("$"))b=[];else{let L=this.getMatchedRoutes(v);b=L.matchedRoutes,this.options.notFoundRoute&&(!L.foundRoute||L.foundRoute.path!=="/"&&L.routeParams["**"])&&(b=[...b,this.options.notFoundRoute])}if(b.length&&Ah(x))for(let L of b){let U=L.options.params?.stringify??L.options.stringifyParams;if(U)try{Object.assign(x,U(x))}catch{}}let S=o.leaveParams?v:GI(bM({path:v,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;if(y&&!o.leaveParams)try{let L=this.getMatchedRoutes(S);L.foundRoute?.id!==y.id&&console.warn(`Generated path "${S}" for route "${y.id}" matched route "${L.foundRoute?.id}" instead. This can happen when multiple route templates resolve to the same URL. Use the route template that matches the intended route, or adjust params.stringify if it changed the target path.`)}catch{}let w=p;if(o._includeValidateSearch&&this.options.search?.strict){let L={};b.forEach(U=>{if(U.options.validateSearch)try{Object.assign(L,RM(U.options.validateSearch,{...L,...w}))}catch{}}),w=L}w=iBe({search:w,dest:s,destRoutes:b,_includeValidateSearch:o._includeValidateSearch}),w=Th(p,w);let C=this.options.stringifySearch(w),F=s.hash===!0?i.hash:s.hash?ul(s.hash,i.hash):void 0,T=F?`#${F}`:"",E=s.state===!0?i.state:s.state?ul(s.state,i.state):{};E=Kd(i.state,E);let k=`${S}${C}${T}`,P,_,M=!1;if(this.rewrite){let L=new URL(k,this.origin),U=tH(this.rewrite,L);P=L.href.replace(L.origin,""),U.origin!==this.origin?(_=U.href,M=!0):_=U.pathname+U.search+U.hash}else P=vse(k),_=P;return{publicHref:_,href:P,pathname:S,search:w,searchStr:C,state:E,hash:F??"",external:M,unmaskOnReload:s.unmaskOnReload}},"build"),a=n((s={},i)=>{let c=r(s),d=i?r(i):void 0;if(!d){let f=Object.create(null);if(this.options.routeMasks){let p=Sse(c.pathname,this.processedTree);if(p){Object.assign(f,p.rawParams);let{from:m,params:h,...v}=p.route,x=h===!1||h===null?Object.create(null):(h??!0)===!0?f:Object.assign(f,ul(h,f));i={from:o.from,...v,params:x},d=r(i)}}}return d&&(c.maskedLocation=d),c},"buildWithMatches");return o.mask?a(o,{from:o.from,...o.mask}):a(o)},this.commitLocation=async({viewTransition:o,ignoreBlocker:r,...a})=>{let s,i=n(()=>{let f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(m=>{a.state[m]=this.latestLocation.state[m]});let p=zu(a.state,this.latestLocation.state);return f.forEach(m=>{delete a.state[m]}),p},"isSameState"),c=Yl(this.latestLocation.href)===Yl(a.href),d=this.commitLocationPromise;if(this.commitLocationPromise=Yd(()=>{d?.resolve(),d=void 0}),c&&i())this.load();else{let{maskedLocation:f,hashScrollIntoView:p,...m}=a;f&&(m={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=o,s=a.replace?"REPLACE":"PUSH",this.history[s==="REPLACE"?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:r})}return this._scroll.next=a.resetScroll??!0,this.history.subscribers.size||this.load(s?{action:{type:s}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:o,resetScroll:r,hashScrollIntoView:a,viewTransition:s,ignoreBlocker:i,href:c,...d}={})=>{if(c){let m=this.history.location.state.__TSR_index,h=XI(c,{__TSR_index:o?m:m+1}),v=new URL(h.pathname,this.origin);d.to=FM(this.rewrite,v).pathname,d.search=this.options.parseSearch(h.search),d.hash=h.hash.slice(1)}let f=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=f;let p=this.commitLocation({...f,viewTransition:s,replace:o,resetScroll:r,hashScrollIntoView:a,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:o,reloadDocument:r,href:a,publicHref:s,...i})=>{let c=!1;if(a)try{new URL(`${a}`),c=!0}catch{}if(c&&!r&&(r=!0),r){if(o!==void 0||!a){let f=this.buildLocation({to:o,...i});a=a??f.publicHref,s=s??f.publicHref}let d=!c&&s?s:a;if(Xd(d,this.protocolAllowlist))return console.warn(`Blocked navigation to dangerous protocol: ${d}`),Promise.resolve();if(!i.ignoreBlocker){let f=this.history.getBlockers?.()??[];for(let p of f)if(p?.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return i.replace?window.location.replace(d):window.location.href=d,Promise.resolve()}return this.buildAndCommitLocation({...i,href:a,to:o,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),!1){let a=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==a.publicHref){let s=this.getParsedLocationHref(a);throw a.external?KI({href:s}):KI({href:s,_builtLocation:a})}}let o=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(a=>!o.some(s=>s.id===a.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(o),this.stores.setCached(r)})},this.load=async o=>{let r=o?.action?.type,a,s,i,c=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad(),r?EM.set(this.latestLocation,r):EM.delete(this.latestLocation);let p=this.latestLocation,m=wp(p,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...m}),this.emit({type:"onBeforeLoad",...m}),await Jz({router:this,sync:o?.sync,forceStaleReload:c.href===p.href,matches:this.stores.pendingMatches.get(),location:p,updateMatch:this.updateMatch,onReady:n(async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let h=null,v=null,x=null,y=null;this.batch(()=>{let b=this.stores.pendingMatches.get(),S=b.length,w=this.stores.matches.get();h=S?w.filter(T=>!this.stores.pendingMatchStores.has(T.id)):null;let C=new Set;for(let T of this.stores.pendingMatchStores.values())T.routeId&&C.add(T.routeId);let F=new Set;for(let T of this.stores.matchStores.values())T.routeId&&F.add(T.routeId);v=S?w.filter(T=>!C.has(T.routeId)):null,x=S?b.filter(T=>!F.has(T.routeId)):null,y=S?b.filter(T=>F.has(T.routeId)):w,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),S&&(this.stores.setMatches(b),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...h.filter(T=>T.status!=="error"&&T.status!=="notFound"&&T.status!=="redirected")]),this.clearExpiredCache())});for(let[b,S]of[[v,"onLeave"],[x,"onEnter"],[y,"onStay"]])if(b)for(let w of b)this.looseRoutesById[w.routeId].options[S]?.(w)})})},"onReady")})}catch(p){ns(p)?(a=p,this.navigate({...a.options,replace:!0,ignoreBlocker:!0})):$n(p)&&(s=p);let m=a?a.status:s?404:this.stores.matches.get().some(h=>h.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(m),this.stores.redirect.set(a)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.stores.matches.get().some(f=>f.status==="error")&&(d=500),d!==void 0&&this.stores.statusCode.set(d)},this.startViewTransition=o=>{let r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&this.isViewTransitionTypesSupported){let s=this.latestLocation,i=this.stores.resolvedLocation.get(),c=typeof r.types=="function"?r.types(wp(s,i)):r.types;if(c===!1){o();return}a={update:o,types:c}}else a=o;document.startViewTransition(a)}else o()},this.updateMatch=(o,r)=>{this.startTransition(()=>{let a=this.stores.pendingMatchStores.get(o);if(a){a.set(r);return}let s=this.stores.matchStores.get(o);if(s){s.set(r);return}let i=this.stores.cachedMatchStores.get(o);if(i){let c=r(i.get());c.status==="redirected"?this.stores.cachedMatchStores.delete(o)&&this.stores.cachedIds.set(d=>d.filter(f=>f!==o)):i.set(c)}})},this.getMatch=o=>this.stores.cachedMatchStores.get(o)?.get()??this.stores.pendingMatchStores.get(o)?.get()??this.stores.matchStores.get(o)?.get(),this.invalidate=o=>{let r=n(a=>o?.filter?.(a)??!0?{...a,invalid:!0,...o?.forcePending||a.status==="error"||a.status==="notFound"?{status:"pending",error:void 0}:void 0}:a,"invalidate");return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:o?.sync})},this.getParsedLocationHref=o=>o.publicHref||"/",this.resolveRedirect=o=>{let r=o.headers.get("Location");if(!o.options.href||o.options._builtLocation){let a=o.options._builtLocation??this.buildLocation(o.options),s=this.getParsedLocationHref(a);o.options.href=s,o.headers.set("Location",s)}else if(r)try{let a=new URL(r);if(this.origin&&a.origin===this.origin){let s=a.pathname+a.search+a.hash;o.options.href=s,o.headers.set("Location",s)}}catch{}if(o.options.href&&!o.options._builtLocation&&Xd(o.options.href,this.protocolAllowlist))throw new Error(`Redirect blocked: unsafe protocol in href "${o.options.href}". Allowed protocols: ${Array.from(this.protocolAllowlist).join(", ")}.`);return o.headers.get("Location")||o.headers.set("Location",o.options.href),o},this.clearCache=o=>{let r=o?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(a=>!r(a))):this.stores.setCached([])},this.clearExpiredCache=()=>{let o=Date.now(),r=n(a=>{let s=this.looseRoutesById[a.routeId];if(!s.options.loader)return!0;let i=(a.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return a.status==="error"?!0:o-a.updatedAt>=i},"filter");this.clearCache({filter:r})},this.loadRouteChunk=YI,this.preloadRoute=async o=>{let r=o._builtLocation??this.buildLocation(o),a=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:o}),s=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...s,...this.stores.cachedIds.get()]),c=a.filter(d=>!i.has(d.id));if(c.length){let d=this.stores.cachedMatches.get();this.stores.setCached([...d,...c])}try{return a=await Jz({router:this,matches:a,location:r,preload:!0,updateMatch:n((d,f)=>{s.has(d)?a=a.map(p=>p.id===d?f(p):p):this.updateMatch(d,f)},"updateMatch")}),a}catch(d){if(ns(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:r});$n(d)||console.error(d);return}},this.matchRoute=(o,r)=>{let a={...o,to:o.to?this.resolvePathWithBase(o.from||"",o.to):void 0,params:o.params||{},leaveParams:!0},s=this.buildLocation(a);if(r?.pending&&this.stores.status.get()!=="pending")return!1;let i=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),c=wse(s.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,i.pathname,this.processedTree);return!c||o.params&&!zu(c.rawParams,o.params,{partial:!0})?!1:r?.includeSearch??!0?zu(i.search,s.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(o=>o.status==="notFound"||o.globalNotFound),this.getStoreConfig=e,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Pse,parseSearch:t.parseSearch??Mse,protocolAllowlist:t.protocolAllowlist??jz}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:t,routesByPath:e,processedTree:o}){this.routesById=t,this.routesByPath=e,this.processedTree=o;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(t){let e=this.routeBranchCache.get(t);return e||(e=Yz(t),this.routeBranchCache.set(t,e)),e}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,e){let o=this.getMatchedRoutes(t.pathname),{foundRoute:r,routeParams:a}=o,{matchedRoutes:s}=o,i=!1;(r?r.path!=="/"&&a["**"]:Yl(t.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:i=!0);let c=i?cBe(this.options.notFoundMode,s):void 0,d=new Array(s.length),f=new Map;for(let p of this.stores.matchStores.values())p.routeId&&f.set(p.routeId,p.get());for(let p=0;p<s.length;p++){let m=s[p],h=d[p-1],v,x,y;{let U=h?.search??t.search,W=h?._strictSearch??void 0;try{let V=RM(m.options.validateSearch,{...U})??void 0;v={...U,...V},x={...W,...V},y=void 0}catch(V){let j=V;if(V instanceof hF||(j=new hF(V.message,{cause:V})),e?.throwOnError)throw j;v=U,x={},y=j}}let b=m.options.loaderDeps?.({search:v})??"",S=b?JSON.stringify(b):"",{interpolatedPath:w,usedParams:C}=bM({path:m.fullPath,params:a,decoder:this.pathParamsDecoder,server:this.isServer}),F=m.id+w+S,T=this.getMatch(F),E=f.get(m.id),k=T?._strictParams??C,P;if(!T)try{Gse(m,k)}catch(U){if($n(U)||ns(U)?P=U:P=new Kse(U.message,{cause:U}),e?.throwOnError)throw P}Object.assign(a,k);let _=E?"stay":"enter",M;if(T)M={...T,cause:_,params:E?.params??a,_strictParams:k,search:E?Th(E.search,v):Th(T.search,v),_strictSearch:x};else{let U=m.options.loader||m.options.beforeLoad||m.lazyFn||eH(m)?"pending":"success";M={id:F,ssr:m.options.ssr,index:p,routeId:m.id,params:E?.params??a,_strictParams:k,pathname:w,updatedAt:Date.now(),search:E?Th(E.search,v):v,_strictSearch:x,searchError:void 0,status:U,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:Yd()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:_,loaderDeps:E?Kd(E.loaderDeps,b):b,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}e?.preload||(M.globalNotFound=c===m.id),M.searchError=y;let L=this.getParentContext(h);M.context={...L,...M.__routeContext,...M.__beforeLoadContext},d[p]=M}for(let p=0;p<d.length;p++){let m=d[p],h=this.looseRoutesById[m.routeId],v=this.getMatch(m.id),x=f.get(m.routeId);if(m.params=x?Th(x.params,a):a,!v){let y=d[p-1],b=this.getParentContext(y);if(h.options.context){let S={deps:m.loaderDeps,params:m.params,context:b??{},location:t,navigate:n(w=>this.navigate({...w,_fromLocation:t}),"navigate"),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d,routeId:h.id};m.__routeContext=h.options.context(S)??void 0}m.context={...b,...m.__routeContext,...m.__beforeLoadContext}}}return d}matchRoutesLightweight(t){let{matchedRoutes:e,routeParams:o}=this.getMatchedRoutes(t.pathname),r=Eh(e),a={...t.search};for(let f of e)try{Object.assign(a,RM(f.options.validateSearch,a))}catch{}let s=Eh(this.stores.matchesId.get()),i=s&&this.stores.matchStores.get(s)?.get(),c=i&&i.routeId===r.id&&i.pathname===t.pathname,d;if(c)d=i.params;else{let f=Object.assign(Object.create(null),o);for(let p of e)try{Gse(p,f)}catch{}d=f}return{matchedRoutes:e,fullPath:r.fullPath,search:a,params:d}}},hF=class extends Error{static{n(this,"SearchParamError")}},Kse=class extends Error{static{n(this,"PathParamError")}},qse=n(t=>t.endsWith("/")&&t.length>1?t.slice(0,-1):t,"normalize");function Wse(t,e){return qse(t)===qse(e)}n(Wse,"comparePaths");function Yse(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],statusCode:200}}n(Yse,"getInitialRouterState");function RM(t,e){if(t==null)return{};if("~standard"in t){let o=t["~standard"].validate(e);if(o instanceof Promise)throw new hF("Async validation not supported");if(o.issues)throw new hF(JSON.stringify(o.issues,void 0,2),{cause:o});return o.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}n(RM,"validateSearch");function Xse({pathname:t,routesById:e,processedTree:o}){let r=Object.create(null),a=Yl(t),s,i=Cse(a,o,!0);return i&&(s=i.route,Object.assign(r,i.rawParams)),{matchedRoutes:i?.branch||[e.__root__],routeParams:r,foundRoute:s}}n(Xse,"getMatchedRoutes");function iBe({search:t,dest:e,destRoutes:o,_includeValidateSearch:r}){return lBe(o)(t,e,r??!1)}n(iBe,"applySearchMiddleware");function lBe(t){let e,o,r=[];for(let s of t){let i=s.options;if("search"in i)i.search?.middlewares&&r.push(...i.search.middlewares);else if(i.preSearchFilters||i.postSearchFilters){let d=n(({search:f,next:p})=>{let m=p(i.preSearchFilters?i.preSearchFilters.reduce((h,v)=>v(h),f):f);return i.postSearchFilters?i.postSearchFilters.reduce((h,v)=>v(h),m):m},"legacyMiddleware");r.push(d)}let c=i.validateSearch;if(c){let d=n(({search:f,next:p,meta:m})=>{let h=p(f);if(o)try{let v=RM(c,h);if(m&&v)for(let x in v)x in h||(m.defaulted||=new Map).set(x,v[x]);return{...h,...v}}catch{}return h},"validate");r.push(d)}}let a=n((s,i,c)=>{if(s>=r.length){if(!e.search)return{};if(e.search===!0)return i;let f=ul(e.search,i);return c&&(c.explicit=f),f}let d=n((f,p)=>{if(p){let m=c||{};return{search:a(s+1,f,m),meta:m}}return a(s+1,f,c)},"next");return r[s]({search:i,next:d,meta:c})},"applyNext");return n(function(i,c,d){return e=c,o=d,a(0,i)},"middleware")}n(lBe,"buildMiddlewareChain");function cBe(t,e){if(t!=="root")for(let o=e.length-1;o>=0;o--){let r=e[o];if(r.children)return r.id}return dl}n(cBe,"findGlobalNotFoundRouteId");function Gse(t,e){let o=t.options.params?.parse??t.options.parseParams;if(o){let r=o(e);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(e,r)}}n(Gse,"extractStrictParams");function uBe(){try{return sessionStorage}catch{return}}n(uBe,"getSafeSessionStorage");var dBe="tsr-scroll-restoration-v1_3",eie=uBe();function fBe(){try{return JSON.parse(eie?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}n(fBe,"createScrollRestorationCache");function pBe(){try{eie?.setItem(dBe,JSON.stringify(QI))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}n(pBe,"persistScrollRestorationCache");var QI=fBe(),Zse="data-scroll-restoration-id",mBe=n(t=>t.state.__TSR_key||t.href,"defaultGetScrollRestorationKey");function hBe(t){let e=t.getAttribute(Zse);if(e)return`[${Zse}="${e}"]`;let o="",r=t,a;for(;a=r.parentNode;){let s=1,i=r;for(;i=i.previousElementSibling;)s++;let c=`${r.localName}:nth-child(${s})`;o=o?`${c} > ${o}`:c,r=a}return o}n(hBe,"getScrollRestorationSelector");var AM=!1,ZI="window";function dH(t){try{return typeof t=="function"?t():document.querySelector(t)}catch{}}n(dH,"getElement");function Jse(t){let e=[];for(let o of t){if(o===ZI)continue;let r=dH(o);r&&e.push(r)}return e}n(Jse,"getScrollToTopElements");function Qse(t,e){let o=e??t.options.scrollRestoration,r=t._scroll;if(o&&(r.restoring=!0),!1)return;let a=t.options.getScrollRestorationKey||mBe,s=new Map,i=n((f,p,m)=>{let h=s.get(f)||{};h.scrollX=p,h.scrollY=m,s.set(f,h)},"setTrackedScrollEntry"),c=n(f=>{if(!(AM||!r.restoring))if(f.target===document)i(ZI,scrollX,scrollY);else{let p=f.target;i(p,p.scrollLeft,p.scrollTop)}},"onScroll"),d=n(f=>{if(!r.restoring)return;let p=QI[f]||={};for(let[m,h]of s)m===ZI?p[ZI]=h:m.isConnected&&(p[hBe(m)]=h)},"snapshotCurrentScrollTargets");o&&!r.restoration&&(r.restoration=!0,AM=!1,history.scrollRestoration="manual",document.addEventListener("scroll",c,!0),t.subscribe("onBeforeLoad",f=>{f.fromLocation&&d(a(f.fromLocation)),s.clear()}),addEventListener("pagehide",()=>{d(a(t.stores.resolvedLocation.get()??t.stores.location.get())),pBe()})),!r.reset&&(r.reset=!0,t.subscribe("onRendered",f=>{let p=t.options.scrollRestorationBehavior,m=t.options.scrollToTopSelectors,h=r.next,v;if(s.clear(),h||(r.next=!0),typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return;let x=a(f.toLocation),y=f.fromLocation&&a(f.fromLocation);if(r.restoring&&y&&y!==x){let b=QI[y];if(b){let S=QI[x];for(let w in b){if(w===ZI){if(h)continue}else{let C=dH(w);if(!C||h&&m&&(v??=Jse(m),v.includes(C)))continue}S||(S=QI[x]={}),S[w]??=b[w]}}}AM=!0;try{let b=f.toLocation.hash,S=f.toLocation.state.__hashScrollIntoViewOptions??!0,w=!1;if(h){let C=EM.get(f.toLocation),F=b&&S&&(C==="PUSH"||C==="REPLACE"),T=r.restoring?QI[x]:void 0;if(T)for(let E in T){let{scrollX:k,scrollY:P}=T[E];if(E===ZI){if(F)continue;scrollTo({top:P,left:k,behavior:p}),w=!0}else{let _=dH(E);_&&(_.scrollLeft=k,_.scrollTop=P)}}if(!w&&!b){let E={top:0,left:0,behavior:p};if(scrollTo(E),m){v??=Jse(m);for(let k of v)k.scrollTo(E)}}}!w&&b&&S&&document.getElementById(b)?.scrollIntoView(S)}finally{AM=!1}}))}n(Qse,"setupScrollRestoration");var fH="Error preloading route! \u261D\uFE0F";var TM=class{static{n(this,"BaseRoute")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=e=>{this.originalIndex=e.originalIndex;let o=this.options,r=!o?.path&&!o?.id;if(this.parentRoute=this.options.getParentRoute?.(),r)this._path=dl;else if(!this.parentRoute)throw new Error("Invariant failed: Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.");let a=r?dl:o?.path;a&&a!=="/"&&(a=yM(a));let s=o?.id||a,i=r?dl:wv([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);a==="__root__"&&(a="/"),i!=="__root__"&&(i=wv(["/",i]));let c=i==="__root__"?"/":wv([this.parentRoute.fullPath,a]);this._path=a,this._id=i,this._fullPath=c,this._to=Yl(c)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>KI({from:this.fullPath,...e}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}};var pH=class extends TM{static{n(this,"BaseRootRoute")}constructor(t){super(t)}};var JI=K(oe(),1),Hu=K(zt(),1);function Fv(t){let e=t.errorComponent??Rv;return(0,Hu.jsx)(xBe,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:n(({error:o,reset:r})=>o?JI.createElement(e,{error:o,reset:r}):t.children,"children")})}n(Fv,"CatchBoundary");var xBe=class extends JI.Component{static{n(this,"CatchBoundaryImpl")}constructor(...t){super(...t),this.state={error:null}}static getDerivedStateFromProps(t,e){let o=t.getResetKey();return e.error&&e.resetKey!==o?{resetKey:o,error:null}:{resetKey:o}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidCatch(t,e){this.props.onCatch&&this.props.onCatch(t,e)}render(){return this.props.children({error:this.state.error,reset:n(()=>{this.reset()},"reset")})}};function Rv({error:t}){let[e,o]=JI.useState(!0);return(0,Hu.jsxs)("div",{style:{padding:".5rem",maxWidth:"100%"},children:[(0,Hu.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[(0,Hu.jsx)("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),(0,Hu.jsx)("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:n(()=>o(r=>!r),"onClick"),children:e?"Hide Error":"Show Error"})]}),(0,Hu.jsx)("div",{style:{height:".25rem"}}),e?(0,Hu.jsx)("div",{children:(0,Hu.jsx)("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?(0,Hu.jsx)("code",{children:t.message}):null})}):null]})}n(Rv,"ErrorComponent");var kM=K(oe(),1),mH=K(zt(),1);function tie({children:t,fallback:e=null}){return hH()?(0,mH.jsx)(kM.default.Fragment,{children:t}):(0,mH.jsx)(kM.default.Fragment,{children:e})}n(tie,"ClientOnly");function hH(){return kM.default.useSyncExternalStore(yBe,()=>!0,()=>!1)}n(hH,"useHydrated");function yBe(){return()=>{}}n(yBe,"subscribe");var oie=K(oe(),1),MM=oie.createContext(null);var rie=K(oe(),1);function vn(t){let e=rie.useContext(MM);return(t?.warn??!0)&&!e&&console.warn("Warning: useRouter must be used inside a <RouterProvider> component!"),e}n(vn,"useRouter");var gH=K(oe(),1),Ev=gH.createContext(void 0),nie=gH.createContext(void 0);var _M=K(oe(),1);var Ln=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(Ln||{});function aie({update:t,notify:e,unwatched:o}){return{link:r,unlink:a,propagate:s,checkDirty:i,shallowPropagate:c};function r(f,p,m){let h=p.depsTail;if(h!==void 0&&h.dep===f)return;let v=h!==void 0?h.nextDep:p.deps;if(v!==void 0&&v.dep===f){v.version=m,p.depsTail=v;return}let x=f.subsTail;if(x!==void 0&&x.version===m&&x.sub===p)return;let y=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:h,nextDep:v,prevSub:x,nextSub:void 0};v!==void 0&&(v.prevDep=y),h!==void 0?h.nextDep=y:p.deps=y,x!==void 0?x.nextSub=y:f.subs=y}function a(f,p=f.sub){let m=f.dep,h=f.prevDep,v=f.nextDep,x=f.nextSub,y=f.prevSub;return v!==void 0?v.prevDep=h:p.depsTail=h,h!==void 0?h.nextDep=v:p.deps=v,x!==void 0?x.prevSub=y:m.subsTail=y,y!==void 0?y.nextSub=x:(m.subs=x)===void 0&&o(m),v}function s(f){let p=f.nextSub,m;e:do{let h=f.sub,v=h.flags;if(v&60?v&12?v&4?!(v&48)&&d(f,h)?(h.flags=v|40,v&=1):v=0:h.flags=v&-9|32:v=0:h.flags=v|32,v&2&&e(h),v&1){let x=h.subs;if(x!==void 0){let y=(f=x).nextSub;y!==void 0&&(m={value:p,prev:m},p=y);continue}}if((f=p)!==void 0){p=f.nextSub;continue}for(;m!==void 0;)if(f=m.value,m=m.prev,f!==void 0){p=f.nextSub;continue e}break}while(!0)}function i(f,p){let m,h=0,v=!1;e:do{let x=f.dep,y=x.flags;if(p.flags&16)v=!0;else if((y&17)===17){if(t(x)){let b=x.subs;b.nextSub!==void 0&&c(b),v=!0}}else if((y&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=x.deps,p=x,++h;continue}if(!v){let b=f.nextDep;if(b!==void 0){f=b;continue}}for(;h--;){let b=p.subs,S=b.nextSub!==void 0;if(S?(f=m.value,m=m.prev):f=b,v){if(t(p)){S&&c(b),p=f.sub;continue}v=!1}else p.flags&=-33;p=f.sub;let w=f.nextDep;if(w!==void 0){f=w;continue e}}return v}while(!0)}function c(f){do{let p=f.sub,m=p.flags;(m&48)===32&&(p.flags=m|16,(m&6)===2&&e(p))}while((f=f.nextSub)!==void 0)}function d(f,p){let m=p.depsTail;for(;m!==void 0;){if(m===f)return!0;m=m.prevDep}return!1}}n(aie,"createReactiveSystem");function lie(t,e,o){let r=typeof t=="object",a=r?t:void 0;return{next:(r?t.next:t)?.bind(a),error:(r?t.error:e)?.bind(a),complete:(r?t.complete:o)?.bind(a)}}n(lie,"toObserver");var vH=[],OM=0,{link:sie,unlink:IBe,propagate:bBe,checkDirty:cie,shallowPropagate:iie}=aie({update(t){return t._update()},notify(t){vH[xH++]=t,t.flags&=~Ln.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=Ln.Mutable|Ln.Dirty,NM(t))}}),PM=0,xH=0,Qd,yH=0;function gF(t){try{++yH,t()}finally{--yH||IH()}}n(gF,"batch");function NM(t){let e=t.depsTail,o=e!==void 0?e.nextDep:t.deps;for(;o!==void 0;)o=IBe(o,t)}n(NM,"purgeDeps");function IH(){if(!(yH>0)){for(;PM<xH;){let t=vH[PM];vH[PM++]=void 0,t.notify()}PM=0,xH=0}}n(IH,"flush");function DM(t,e){let o=typeof t=="function",r=t,a={_snapshot:o?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:o?Ln.None:Ln.Mutable,get(){return Qd!==void 0&&sie(a,Qd,OM),a._snapshot},subscribe(s){let i=lie(s),c={current:!1},d=SBe(()=>{a.get(),c.current?i.next?.(a._snapshot):c.current=!0});return{unsubscribe:n(()=>{d.stop()},"unsubscribe")}},_update(s){let i=Qd,c=e?.compare??Object.is;if(o)Qd=a,++OM,a.depsTail=void 0;else if(s===void 0)return!1;o&&(a.flags=Ln.Mutable|Ln.RecursedCheck);try{let d=a._snapshot,f=typeof s=="function"?s(d):s===void 0&&o?r(d):s;return d===void 0||!c(d,f)?(a._snapshot=f,!0):!1}finally{Qd=i,o&&(a.flags&=~Ln.RecursedCheck),NM(a)}}};return o?(a.flags=Ln.Mutable|Ln.Dirty,a.get=function(){let s=a.flags;if(s&Ln.Dirty||s&Ln.Pending&&cie(a.deps,a)){if(a._update()){let i=a.subs;i!==void 0&&iie(i)}}else s&Ln.Pending&&(a.flags=s&~Ln.Pending);return Qd!==void 0&&sie(a,Qd,OM),a._snapshot}):a.set=function(s){if(a._update(s)){let i=a.subs;i!==void 0&&(bBe(i),iie(i),IH())}},a}n(DM,"createAtom");function SBe(t){let e=n(()=>{let r=Qd;Qd=o,++OM,o.depsTail=void 0,o.flags=Ln.Watching|Ln.RecursedCheck;try{return t()}finally{Qd=r,o.flags&=~Ln.RecursedCheck,NM(o)}},"run"),o={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Ln.Watching|Ln.RecursedCheck,notify(){let r=this.flags;r&Ln.Dirty||r&Ln.Pending&&cie(this.deps,this)?e():this.flags=Ln.Watching},stop(){this.flags=Ln.None,this.depsTail=void 0,NM(this)}};return e(),o}n(SBe,"effect");var SH=K(oe(),1),gie=K(vF(),1);function wBe(t,e){return t===e}n(wBe,"defaultCompare");function Zn(t,e,o=wBe){let r=(0,SH.useCallback)(i=>{if(!t)return()=>{};let{unsubscribe:c}=t.subscribe(i);return c},[t]),a=(0,SH.useCallback)(()=>t?.get(),[t]);return(0,gie.useSyncExternalStoreWithSelector)(r,a,a,e,o)}n(Zn,"useStore");var wH={get(){},subscribe(){return{unsubscribe(){}}}};function CH(t,e){let o=_M.useRef();return r=>{let a=t?.select?t.select(r):r;return t?.structuralSharing??e.options.defaultStructuralSharing?o.current=Kd(o.current,a):a}}n(CH,"useStructuralSharing");function Xl(t){let e=vn(),o=_M.useContext(t.from?nie:Ev),r=t.from?e.stores.getRouteMatchStore(t.from):e.stores.matchStores.get(o);if(!1){let i=r?.get();if(!i){if(t.shouldThrow??!0)throw new Error(`Invariant failed: Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`);return}return t.select?t.select(i):i}let a=CH(t,e),s=Zn(r??wH,i=>i?a(i):wH);if(s!==wH)return s;if(t.shouldThrow??!0)throw new Error(`Invariant failed: Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`)}n(Xl,"useMatch");function FH(t){return Xl({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:n(e=>t.select?t.select(e.loaderData):e.loaderData,"select")})}n(FH,"useLoaderData");function RH(t){let{select:e,...o}=t;return Xl({...o,select:n(r=>e?e(r.loaderDeps):r.loaderDeps,"select")})}n(RH,"useLoaderDeps");function EH(t){return Xl({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:n(e=>{let o=t.strict===!1?e.params:e._strictParams;return t.select?t.select(o):o},"select")})}n(EH,"useParams");function Lh(t){return Xl({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:n(e=>t.select?t.select(e.search):e.search,"select")})}n(Lh,"useSearch");var AH=K(oe(),1);function zs(t){let e=vn();return AH.useCallback(o=>e.navigate({...o,from:o.from??t?.from}),[t?.from,e])}n(zs,"useNavigate");function TH(t){return Xl({...t,select:n(e=>t.select?t.select(e.context):e.context,"select")})}n(TH,"useRouteContext");var Ha=K(oe(),1),CBe=K(zt(),1);var Sie=K(ti(),1);function FBe(t,e){let o=vn(),r=dse(e),a=!1,{activeProps:s,inactiveProps:i,activeOptions:c,to:d,preload:f,preloadDelay:p,preloadIntentProximity:m,hashScrollIntoView:h,replace:v,startTransition:x,resetScroll:y,viewTransition:b,children:S,target:w,disabled:C,style:F,className:T,onClick:E,onBlur:k,onFocus:P,onMouseEnter:_,onMouseLeave:M,onTouchStart:L,ignoreBlocker:U,params:W,search:V,hash:j,state:N,mask:D,reloadDocument:B,unsafeRelative:z,from:q,_fromLocation:H,...Y}=t;if(a){let Le=bie(d);if(typeof d=="string"&&!Le&&d.indexOf(":")>-1)try{return new URL(d),Xd(d,o.protocolAllowlist)?(console.warn(`Blocked Link with dangerous protocol: ${d}`),{...Y,ref:r,href:void 0,...S&&{children:S},...w&&{target:w},...C&&{disabled:C},...F&&{style:F},...T&&{className:T}}):{...Y,ref:r,href:d,...S&&{children:S},...w&&{target:w},...C&&{disabled:C},...F&&{style:F},...T&&{className:T}}}catch{}let Me=o.buildLocation({...t,from:t.from}),je=Iie(Me.maskedLocation?Me.maskedLocation.publicHref:Me.publicHref,Me.maskedLocation?Me.maskedLocation.external:Me.external,o.history,C),mt=(()=>{if(je?.external){if(Xd(je.href,o.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${je.href}`);return}return je.href}if(!Le&&typeof d=="string"&&d.indexOf(":")>-1)try{if(new URL(d),Xd(d,o.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${d}`);return}return d}catch{}})(),ht=(()=>{if(mt)return!1;let Rt=o.stores.location.get(),ee=c?.exact??!1;if(ee){if(!IM(Rt.pathname,Me.pathname,o.basepath))return!1}else{let ce=Nh(Rt.pathname,o.basepath),Ee=Nh(Me.pathname,o.basepath);if(!(ce.startsWith(Ee)&&(ce.length===Ee.length||ce[Ee.length]==="/")))return!1}if((c?.includeSearch??!0)&&Rt.search!==Me.search){let ce=!Rt.search||typeof Rt.search=="object"&&!Ah(Rt.search),Ee=!Me.search||typeof Me.search=="object"&&!Ah(Me.search);if(!(ce&&Ee)&&!zu(Rt.search,Me.search,{partial:!ee,ignoreUndefined:!c?.explicitUndefined}))return!1}return!c?.includeHash})();if(mt)return{...Y,ref:r,href:mt,...S&&{children:S},...w&&{target:w},...C&&{disabled:C},...F&&{style:F},...T&&{className:T}};let yt=ht?ul(s,{})??vie:eb,Ft=ht?eb:ul(i,{})??eb,wt=(()=>{let Rt=F,ee=yt.style,ce=Ft.style;if(!(!Rt&&!ee&&!ce))return Rt&&!ee&&!ce?Rt:!Rt&&ee&&!ce?ee:!Rt&&!ee&&ce?ce:{...Rt,...ee,...ce}})(),jt=(()=>{let Rt=T,ee=yt.className,ce=Ft.className;if(!Rt&&!ee&&!ce)return"";let Ee="";return Rt&&(Ee=Rt),ee&&(Ee=Ee?`${Ee} ${ee}`:ee),ce&&(Ee=Ee?`${Ee} ${ce}`:ce),Ee})();return{...Y,...yt,...Ft,href:je?.href,ref:r,disabled:!!C,target:w,...wt&&{style:wt},...jt&&{className:jt},...C&&xie,...ht&&yie}}let Q=hH(),X=Ha.useMemo(()=>t,[o,t.from,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),te=Zn(o.stores.location,Le=>Le,(Le,Me)=>Le.href===Me.href),ae=Ha.useMemo(()=>{let Le={_fromLocation:te,...X};return o.buildLocation(Le)},[o,te,X]),se=ae.maskedLocation?ae.maskedLocation.publicHref:ae.publicHref,J=ae.maskedLocation?ae.maskedLocation.external:ae.external,ne=Ha.useMemo(()=>Iie(se,J,o.history,C),[C,J,se,o.history]),pe=Ha.useMemo(()=>{if(ne?.external){if(Xd(ne.href,o.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${ne.href}`);return}return ne.href}if(!bie(d)&&!(typeof d!="string"||d.indexOf(":")===-1))try{if(new URL(d),Xd(d,o.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${d}`);return}return d}catch{}},[d,ne,o.protocolAllowlist]),le=Ha.useMemo(()=>{if(pe)return!1;if(c?.exact){if(!IM(te.pathname,ae.pathname,o.basepath))return!1}else{let Le=Nh(te.pathname,o.basepath),Me=Nh(ae.pathname,o.basepath);if(!(Le.startsWith(Me)&&(Le.length===Me.length||Le[Me.length]==="/")))return!1}return(c?.includeSearch??!0)&&!zu(te.search,ae.search,{partial:!c?.exact,ignoreUndefined:!c?.explicitUndefined})?!1:c?.includeHash?Q&&te.hash===ae.hash:!0},[c?.exact,c?.explicitUndefined,c?.includeHash,c?.includeSearch,te,pe,Q,ae.hash,ae.pathname,ae.search,o.basepath]),ie=le?ul(s,{})??vie:eb,de=le?eb:ul(i,{})??eb,ue=[T,ie.className,de.className].filter(Boolean).join(" "),he=(F||ie.style||de.style)&&{...F,...ie.style,...de.style},[Re,Ae]=Ha.useState(!1),ye=Ha.useRef(!1),ge=t.reloadDocument||pe?!1:f??o.options.defaultPreload,Te=p??o.options.defaultPreloadDelay??0,ze=Ha.useCallback(()=>{o.preloadRoute({...X,_builtLocation:ae}).catch(Le=>{console.warn(Le),console.warn(fH)})},[o,X,ae]);use(r,Ha.useCallback(Le=>{Le?.isIntersecting&&ze()},[ze]),EBe,{disabled:!!C||ge!=="viewport"}),Ha.useEffect(()=>{ye.current||!C&&ge==="render"&&(ze(),ye.current=!0)},[C,ze,ge]);let Ze=n(Le=>{let Me=Le.currentTarget.getAttribute("target"),je=w!==void 0?w:Me;if(!C&&!ABe(Le)&&!Le.defaultPrevented&&(!je||je==="_self")&&Le.button===0){Le.preventDefault(),(0,Sie.flushSync)(()=>{Ae(!0)});let mt=o.subscribe("onResolved",()=>{mt(),Ae(!1)});o.navigate({...X,replace:v,resetScroll:y,hashScrollIntoView:h,startTransition:x,viewTransition:b,ignoreBlocker:U})}},"handleClick");if(pe)return{...Y,ref:r,href:pe,...S&&{children:S},...w&&{target:w},...C&&{disabled:C},...F&&{style:F},...T&&{className:T},...E&&{onClick:E},...k&&{onBlur:k},...P&&{onFocus:P},..._&&{onMouseEnter:_},...M&&{onMouseLeave:M},...L&&{onTouchStart:L}};let _e=n(Le=>{if(C||ge!=="intent")return;if(!Te){ze();return}let Me=Le.currentTarget;if(xF.has(Me))return;let je=setTimeout(()=>{xF.delete(Me),ze()},Te);xF.set(Me,je)},"enqueueIntentPreload"),Ie=n(Le=>{C||ge!=="intent"||ze()},"handleTouchStart"),ke=n(Le=>{if(C||!ge||!Te)return;let Me=Le.currentTarget,je=xF.get(Me);je&&(clearTimeout(je),xF.delete(Me))},"handleLeave");return{...Y,...ie,...de,href:ne?.href,ref:r,onClick:tb([E,Ze]),onBlur:tb([k,ke]),onFocus:tb([P,_e]),onMouseEnter:tb([_,_e]),onMouseLeave:tb([M,ke]),onTouchStart:tb([L,Ie]),disabled:!!C,target:w,...he&&{style:he},...ue&&{className:ue},...C&&xie,...le&&yie,...Q&&Re&&RBe}}n(FBe,"useLinkProps");var eb={},vie={className:"active"},xie={role:"link","aria-disabled":!0},yie={"data-status":"active","aria-current":"page"},RBe={"data-transitioning":"transitioning"},xF=new WeakMap,EBe={rootMargin:"100px"},tb=n(t=>e=>{for(let o of t)if(o){if(e.defaultPrevented)return;o(e)}},"composeHandlers");function Iie(t,e,o,r){if(!r)return e?{href:t,external:!0}:{href:o.createHref(t)||"/",external:!1}}n(Iie,"getHrefOption");function bie(t){if(typeof t!="string")return!1;let e=t.charCodeAt(0);return e===47?t.charCodeAt(1)!==47:e===46}n(bie,"isSafeInternal");var kH=Ha.forwardRef((t,e)=>{let{_asChild:o,...r}=t,{type:a,...s}=FBe(r,e),i=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!o){let{disabled:c,...d}=s;return Ha.createElement("a",d,i)}return Ha.createElement(o,s,i)});function ABe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}n(ABe,"isCtrlEvent");var MH=K(oe(),1),PH=K(zt(),1);var wie=class extends TM{static{n(this,"Route")}constructor(t){super(t),this.useMatch=e=>Xl({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>TH({...e,from:this.id}),this.useSearch=e=>Lh({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>EH({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>RH({...e,from:this.id}),this.useLoaderData=e=>FH({...e,from:this.id}),this.useNavigate=()=>zs({from:this.fullPath}),this.Link=MH.default.forwardRef((e,o)=>(0,PH.jsx)(kH,{ref:o,from:this.fullPath,...e}))}};function yF(t){return new wie(t)}n(yF,"createRoute");var Cie=class extends pH{static{n(this,"RootRoute")}constructor(t){super(t),this.useMatch=e=>Xl({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>TH({...e,from:this.id}),this.useSearch=e=>Lh({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>EH({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>RH({...e,from:this.id}),this.useLoaderData=e=>FH({...e,from:this.id}),this.useNavigate=()=>zs({from:this.fullPath}),this.Link=MH.default.forwardRef((e,o)=>(0,PH.jsx)(kH,{ref:o,from:this.fullPath,...e}))}};function OH(t){return new Cie(t)}n(OH,"createRootRoute");var w2t=K(oe(),1),LM=K(zt(),1);function Fie(t){let e=vn();if(!1){let r=`not-found-${e.stores.location.get().pathname}-${e.stores.status.get()}`;return(0,LM.jsx)(Fv,{getResetKey:n(()=>r,"getResetKey"),onCatch:n((a,s)=>{if($n(a))t.onCatch?.(a,s);else throw a},"onCatch"),errorComponent:n(({error:a})=>{if($n(a))return t.fallback?.(a);throw a},"errorComponent"),children:t.children})}let o=`not-found-${Zn(e.stores.location,r=>r.pathname)}-${Zn(e.stores.status,r=>r)}`;return(0,LM.jsx)(Fv,{getResetKey:n(()=>o,"getResetKey"),onCatch:n((r,a)=>{if($n(r))t.onCatch?.(r,a);else throw r},"onCatch"),errorComponent:n(({error:r})=>{if($n(r))return t.fallback?.(r);throw r},"errorComponent"),children:t.children})}n(Fie,"CatchNotFound");function Rie(){return(0,LM.jsx)("p",{children:"Not Found"})}n(Rie,"DefaultGlobalNotFound");var Eie=K(zt(),1);function Aie({children:t}){let e=vn();return null}n(Aie,"ScriptOnce");var k2t=K(oe(),1),BM=K(zt(),1);function Bh(t){return(0,BM.jsx)(BM.Fragment,{children:t.children})}n(Bh,"SafeFragment");var N2t=K(oe(),1),VM=K(zt(),1);function UM(t,e,o){return e.options.notFoundComponent?(0,VM.jsx)(e.options.notFoundComponent,{...o}):t.options.defaultNotFoundComponent?(0,VM.jsx)(t.options.defaultNotFoundComponent,{...o}):(e.options.notFoundComponent||console.warn(`Warning: A notFoundError was encountered on the route with ID "${e.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`),(0,VM.jsx)(Rie,{}))}n(UM,"renderRouteNotFound");var kie=K(zt(),1);function Tie(t){return null}n(Tie,"getScrollRestorationScriptForRouter");function Mie(){let t=Tie(vn());return t?(0,kie.jsx)(Aie,{children:t}):null}n(Mie,"ScrollRestoration");var Hs=K(oe(),1),xn=K(zt(),1);var TBe=n((t,e)=>t.routeId===e.routeId&&t._displayPending===e._displayPending,"matchViewFieldsEqual"),kBe=n((t,e)=>t[0]===e[0]&&t[1]===e[1],"outletMatchSelectionEqual"),zM=Hs.memo(n(function({matchId:e}){let o=vn();if(!1){let i=o.stores.matchStores.get(e)?.get();if(!i)throw new Error(`Invariant failed: Could not find match for matchId "${e}". Please file an issue!`);let c=i.routeId,d=o.routesById[c].parentRoute?.id;return(0,xn.jsx)(Pie,{router:o,matchId:e,resetKey:o.stores.loadedAt.get(),matchState:{routeId:c,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:d}})}let r=o.stores.matchStores.get(e);if(!r)throw new Error(`Invariant failed: Could not find match for matchId "${e}". Please file an issue!`);let a=Zn(o.stores.loadedAt,i=>i),s=Zn(r,i=>i,TBe);return(0,xn.jsx)(Pie,{router:o,matchId:e,resetKey:a,matchState:Hs.useMemo(()=>{let i=s.routeId,c=o.routesById[i].parentRoute?.id;return{routeId:i,ssr:s.ssr,_displayPending:s._displayPending,parentRouteId:c}},[s._displayPending,s.routeId,s.ssr,o.routesById])})},"MatchImpl"));function Pie({router:t,matchId:e,resetKey:o,matchState:r}){let a=t.routesById[r.routeId],s=a.options.pendingComponent??t.options.defaultPendingComponent,i=s?(0,xn.jsx)(s,{}):null,c=a.options.errorComponent??t.options.defaultErrorComponent,d=a.options.onCatch??t.options.defaultOnCatch,f=a.isRoot?a.options.notFoundComponent??t.options.notFoundRoute?.options.component:a.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",m=(!a.isRoot||a.options.wrapInSuspense||p)&&(a.options.wrapInSuspense??s??(a.options.errorComponent?.preload||p))?Hs.Suspense:Bh,h=c?Fv:Bh,v=f?Fie:Bh;return(0,xn.jsxs)(a.isRoot?a.options.shellComponent??Bh:Bh,{children:[(0,xn.jsx)(Ev.Provider,{value:e,children:(0,xn.jsx)(m,{fallback:i,children:(0,xn.jsx)(h,{getResetKey:n(()=>o,"getResetKey"),errorComponent:c||Rv,onCatch:n((x,y)=>{if($n(x))throw x.routeId??=r.routeId,x;console.warn(`Warning: Error in route match: ${e}`),d?.(x,y)},"onCatch"),children:(0,xn.jsx)(v,{fallback:n(x=>{if(x.routeId??=r.routeId,!f||x.routeId&&x.routeId!==r.routeId||!x.routeId&&!a.isRoot)throw x;return Hs.createElement(f,x)},"fallback"),children:p||r._displayPending?(0,xn.jsx)(tie,{fallback:i,children:(0,xn.jsx)(Oie,{matchId:e})}):(0,xn.jsx)(Oie,{matchId:e})})})})}),r.parentRouteId===dl?(0,xn.jsxs)(xn.Fragment,{children:[(0,xn.jsx)(MBe,{}),t.options.scrollRestoration&&!1?(0,xn.jsx)(Mie,{}):null]}):null]})}n(Pie,"MatchView");function MBe(){let t=vn();if(!1)return null;let e=Hs.useRef();return bv(()=>{let o=t.stores.resolvedLocation.get(),r=e.current;o&&(!r||r.href!==o.href)&&t.emit({type:"onRendered",...wp(t.stores.location.get(),r??o)}),e.current=o},[Zn(t.stores.resolvedLocation,o=>o?.state.__TSR_key),t]),null}n(MBe,"OnRendered");var Oie=Hs.memo(n(function({matchId:e}){let o=vn(),r=n((p,m)=>o.getMatch(p.id)?._nonReactive[m]??p._nonReactive[m],"getMatchPromise");if(!1){let p=o.stores.matchStores.get(e)?.get();if(!p)throw new Error(`Invariant failed: Could not find match for matchId "${e}". Please file an issue!`);let m=p.routeId,h=o.routesById[m],v=(o.routesById[m].options.remountDeps??o.options.defaultRemountDeps)?.({routeId:m,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch}),x=v?JSON.stringify(v):void 0,y=h.options.component??o.options.defaultComponent,b=y?(0,xn.jsx)(y,{},x):(0,xn.jsx)(IF,{});if(p._displayPending)throw r(p,"displayPendingPromise");if(p._forcePending)throw r(p,"minPendingPromise");if(p.status==="pending")throw r(p,"loadPromise");if(p.status==="notFound"){if(!$n(p.error))throw new Error("Invariant failed: Expected a notFound error");return UM(o,h,p.error)}if(p.status==="redirected")throw ns(p.error)?r(p,"loadPromise"):new Error("Invariant failed: Expected a redirect error");return p.status==="error"?(0,xn.jsx)((h.options.errorComponent??o.options.defaultErrorComponent)||Rv,{error:p.error,reset:void 0,info:{componentStack:""}}):b}let a=o.stores.matchStores.get(e);if(!a)throw new Error(`Invariant failed: Could not find match for matchId "${e}". Please file an issue!`);let s=Zn(a,p=>p),i=s.routeId,c=o.routesById[i],d=Hs.useMemo(()=>{let p=(o.routesById[i].options.remountDeps??o.options.defaultRemountDeps)?.({routeId:i,loaderDeps:s.loaderDeps,params:s._strictParams,search:s._strictSearch});return p?JSON.stringify(p):void 0},[i,s.loaderDeps,s._strictParams,s._strictSearch,o.options.defaultRemountDeps,o.routesById]),f=Hs.useMemo(()=>{let p=c.options.component??o.options.defaultComponent;return p?(0,xn.jsx)(p,{},d):(0,xn.jsx)(IF,{})},[d,c.options.component,o.options.defaultComponent]);if(s._displayPending)throw r(s,"displayPendingPromise");if(s._forcePending)throw r(s,"minPendingPromise");if(s.status==="pending"){let p=c.options.pendingMinMs??o.options.defaultPendingMinMs;if(p){let m=o.getMatch(s.id);if(m&&!m._nonReactive.minPendingPromise&&!!1){let h=Yd();m._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),m._nonReactive.minPendingPromise=void 0},p)}}throw r(s,"loadPromise")}if(s.status==="notFound"){if(!$n(s.error))throw new Error("Invariant failed: Expected a notFound error");return UM(o,c,s.error)}if(s.status==="redirected")throw ns(s.error)?r(s,"loadPromise"):new Error("Invariant failed: Expected a redirect error");if(s.status==="error"){if(!1)return(0,xn.jsx)((c.options.errorComponent??o.options.defaultErrorComponent)||Rv,{error:s.error,reset:void 0,info:{componentStack:""}});throw s.error}return f},"MatchInnerImpl")),IF=Hs.memo(n(function(){let e=vn(),o=Hs.useContext(Ev),r,a=!1,s;if(!1){let f=e.stores.matches.get(),p=o?f.findIndex(h=>h.id===o):-1,m=p>=0?f[p]:void 0;r=m?.routeId,a=m?.globalNotFound??!1,s=p>=0?f[p+1]?.id:void 0}else{let f=o?e.stores.matchStores.get(o):void 0;[r,a]=Zn(f,p=>[p?.routeId,p?.globalNotFound??!1],kBe),s=Zn(e.stores.matchesId,p=>p[p.findIndex(m=>m===o)+1])}let i=r?e.routesById[r]:void 0,c=e.options.defaultPendingComponent?(0,xn.jsx)(e.options.defaultPendingComponent,{}):null;if(a){if(!i)throw new Error("Invariant failed: Could not resolve route for Outlet render");return UM(e,i,void 0)}if(!s)return null;let d=(0,xn.jsx)(zM,{matchId:s});return r===dl?(0,xn.jsx)(Hs.Suspense,{fallback:c,children:d}):d},"OutletImpl"));var Vh=K(oe(),1);function Nie(){let t=vn(),e=Vh.useRef({router:t,mounted:!1}),[o,r]=Vh.useState(!1),a=Zn(t.stores.isLoading,m=>m),s=Zn(t.stores.hasPending,m=>m),i=hM(a),c=a||o||s,d=hM(c),f=a||s,p=hM(f);return t.startTransition=m=>{r(!0),Vh.startTransition(()=>{m(),r(!1)})},Vh.useEffect(()=>{let m=t.history.subscribe(t.load),h=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Yl(t.latestLocation.publicHref)!==Yl(h.publicHref)&&t.commitLocation({...h,replace:!0}),()=>{m()}},[t,t.history]),bv(()=>{if(typeof window<"u"&&t.ssr||e.current.router===t&&e.current.mounted)return;e.current={router:t,mounted:!0},n(async()=>{try{await t.load()}catch(h){console.error(h)}},"tryLoad")()},[t]),bv(()=>{i&&!a&&t.emit({type:"onLoad",...wp(t.stores.location.get(),t.stores.resolvedLocation.get())})},[i,t,a]),bv(()=>{p&&!f&&t.emit({type:"onBeforeRouteMount",...wp(t.stores.location.get(),t.stores.resolvedLocation.get())})},[f,p,t]),bv(()=>{if(d&&!c){let m=wp(t.stores.location.get(),t.stores.resolvedLocation.get());t.emit({type:"onResolved",...m}),gF(()=>{t.stores.status.set("idle"),t.stores.resolvedLocation.set(t.stores.location.get())})}},[c,d,t]),null}n(Nie,"Transitioner");var HM=K(oe(),1),Zd=K(zt(),1);function Die(){let t=vn(),e=t.routesById[dl].options.pendingComponent??t.options.defaultPendingComponent,o=e?(0,Zd.jsx)(e,{}):null,r=(0,Zd.jsxs)(typeof document<"u"&&t.ssr?Bh:HM.Suspense,{fallback:o,children:[!!1&&(0,Zd.jsx)(Nie,{}),(0,Zd.jsx)(PBe,{})]});return t.options.InnerWrap?(0,Zd.jsx)(t.options.InnerWrap,{children:r}):r}n(Die,"Matches");function PBe(){let t=vn(),e=!1,o=e?t.stores.firstId.get():Zn(t.stores.firstId,s=>s),r=e?t.stores.loadedAt.get():Zn(t.stores.loadedAt,s=>s),a=o?(0,Zd.jsx)(zM,{matchId:o}):null;return(0,Zd.jsx)(Ev.Provider,{value:o,children:t.options.disableGlobalCatchBoundary?a:(0,Zd.jsx)(Fv,{getResetKey:n(()=>r,"getResetKey"),errorComponent:Rv,onCatch:s=>{console.warn("Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!"),console.warn(`Warning: ${s.message||s.toString()}`)},children:a})})}n(PBe,"MatchesInner");var _ie=n(t=>({createMutableStore:DM,createReadonlyStore:DM,batch:gF}),"getStoreFactory");var NH=n(t=>new Lie(t),"createRouter"),Lie=class extends uH{static{n(this,"Router")}constructor(t){super(t,_ie)}};var MAt=K(oe(),1),bF=K(zt(),1);function Bie({router:t,children:e,...o}){Ah(o)&&t.update({...t.options,...o,context:{...t.options.context,...o.context}});let r=(0,bF.jsx)(MM.Provider,{value:t,children:e});return t.options.Wrap?(0,bF.jsx)(t.options.Wrap,{children:r}):r}n(Bie,"RouterContextProvider");function DH({router:t,...e}){return(0,bF.jsx)(Bie,{router:t,...e,children:(0,bF.jsx)(Die,{})})}n(DH,"RouterProvider");function _H(t){let e=vn({warn:t?.router===void 0}),o=t?.router||e;if(!1){let r=o.stores.__store.get();return t?.select?t.select(r):r}return Zn(o.stores.__store,CH(t,o))}n(_H,"useRouterState");var Dm=K(oe(),1),it=K(oe(),1);function Vie(t){var e,o,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(o=Vie(t[e]))&&(r&&(r+=" "),r+=o)}else for(o in t)t[o]&&(r&&(r+=" "),r+=o);return r}n(Vie,"r");function xo(){for(var t,e,o=0,r="",a=arguments.length;o<a;o++)(t=arguments[o])&&(e=Vie(t))&&(r&&(r+=" "),r+=e);return r}n(xo,"clsx");var OBe=n((t,e)=>{let o=new Array(t.length+e.length);for(let r=0;r<t.length;r++)o[r]=t[r];for(let r=0;r<e.length;r++)o[t.length+r]=e[r];return o},"concatArrays"),NBe=n((t,e)=>({classGroupId:t,validator:e}),"createClassValidatorObject"),Wie=n((t=new Map,e=null,o)=>({nextPart:t,validators:e,classGroupId:o}),"createClassPartObject"),qM="-",Uie=[],DBe="arbitrary..",_Be=n(t=>{let e=BBe(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:n(i=>{if(i.startsWith("[")&&i.endsWith("]"))return LBe(i);let c=i.split(qM),d=c[0]===""&&c.length>1?1:0;return Gie(c,d,e)},"getClassGroupId"),getConflictingClassGroupIds:n((i,c)=>{if(c){let d=r[i],f=o[i];return d?f?OBe(f,d):d:f||Uie}return o[i]||Uie},"getConflictingClassGroupIds")}},"createClassGroupUtils"),Gie=n((t,e,o)=>{if(t.length-e===0)return o.classGroupId;let a=t[e],s=o.nextPart.get(a);if(s){let f=Gie(t,e+1,s);if(f)return f}let i=o.validators;if(i===null)return;let c=e===0?t.join(qM):t.slice(e).join(qM),d=i.length;for(let f=0;f<d;f++){let p=i[f];if(p.validator(c))return p.classGroupId}},"getGroupRecursive"),LBe=n(t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let e=t.slice(1,-1),o=e.indexOf(":"),r=e.slice(0,o);return r?DBe+r:void 0})(),"getGroupIdForArbitraryProperty"),BBe=n(t=>{let{theme:e,classGroups:o}=t;return VBe(o,e)},"createClassMap"),VBe=n((t,e)=>{let o=Wie();for(let r in t){let a=t[r];VH(a,o,r,e)}return o},"processClassGroups"),VH=n((t,e,o,r)=>{let a=t.length;for(let s=0;s<a;s++){let i=t[s];UBe(i,e,o,r)}},"processClassesRecursively"),UBe=n((t,e,o,r)=>{if(typeof t=="string"){zBe(t,e,o);return}if(typeof t=="function"){HBe(t,e,o,r);return}$Be(t,e,o,r)},"processClassDefinition"),zBe=n((t,e,o)=>{let r=t===""?e:Kie(e,t);r.classGroupId=o},"processStringDefinition"),HBe=n((t,e,o,r)=>{if(jBe(t)){VH(t(r),e,o,r);return}e.validators===null&&(e.validators=[]),e.validators.push(NBe(o,t))},"processFunctionDefinition"),$Be=n((t,e,o,r)=>{let a=Object.entries(t),s=a.length;for(let i=0;i<s;i++){let[c,d]=a[i];VH(d,Kie(e,c),o,r)}},"processObjectDefinition"),Kie=n((t,e)=>{let o=t,r=e.split(qM),a=r.length;for(let s=0;s<a;s++){let i=r[s],c=o.nextPart.get(i);c||(c=Wie(),o.nextPart.set(i,c)),o=c}return o},"getPart"),jBe=n(t=>"isThemeGetter"in t&&t.isThemeGetter===!0,"isThemeGetter"),qBe=n(t=>{if(t<1)return{get:n(()=>{},"get"),set:n(()=>{},"set")};let e=0,o=Object.create(null),r=Object.create(null),a=n((s,i)=>{o[s]=i,e++,e>t&&(e=0,r=o,o=Object.create(null))},"update");return{get(s){let i=o[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return a(s,i),i},set(s,i){s in o?o[s]=i:a(s,i)}}},"createLruCache"),BH="!",zie=":",WBe=[],Hie=n((t,e,o,r,a)=>({modifiers:t,hasImportantModifier:e,baseClassName:o,maybePostfixModifierPosition:r,isExternal:a}),"createResultObject"),GBe=n(t=>{let{prefix:e,experimentalParseClassName:o}=t,r=n(a=>{let s=[],i=0,c=0,d=0,f,p=a.length;for(let y=0;y<p;y++){let b=a[y];if(i===0&&c===0){if(b===zie){s.push(a.slice(d,y)),d=y+1;continue}if(b==="/"){f=y;continue}}b==="["?i++:b==="]"?i--:b==="("?c++:b===")"&&c--}let m=s.length===0?a:a.slice(d),h=m,v=!1;m.endsWith(BH)?(h=m.slice(0,-1),v=!0):m.startsWith(BH)&&(h=m.slice(1),v=!0);let x=f&&f>d?f-d:void 0;return Hie(s,v,h,x)},"parseClassName");if(e){let a=e+zie,s=r;r=n(i=>i.startsWith(a)?s(i.slice(a.length)):Hie(WBe,!1,i,void 0,!0),"parseClassName")}if(o){let a=r;r=n(s=>o({className:s,parseClassName:a}),"parseClassName")}return r},"createParseClassName"),KBe=n(t=>{let e=new Map;return t.orderSensitiveModifiers.forEach((o,r)=>{e.set(o,1e6+r)}),o=>{let r=[],a=[];for(let s=0;s<o.length;s++){let i=o[s],c=i[0]==="[",d=e.has(i);c||d?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(i)):a.push(i)}return a.length>0&&(a.sort(),r.push(...a)),r}},"createSortModifiers"),YBe=n(t=>({cache:qBe(t.cacheSize),parseClassName:GBe(t),sortModifiers:KBe(t),postfixLookupClassGroupIds:XBe(t),..._Be(t)}),"createConfigUtils"),XBe=n(t=>{let e=Object.create(null),o=t.postfixLookupClassGroups;if(o)for(let r=0;r<o.length;r++)e[o[r]]=!0;return e},"createPostfixLookupClassGroupIds"),QBe=/\s+/,ZBe=n((t,e)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s,postfixLookupClassGroupIds:i}=e,c=[],d=t.trim().split(QBe),f="";for(let p=d.length-1;p>=0;p-=1){let m=d[p],{isExternal:h,modifiers:v,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:b}=o(m);if(h){f=m+(f.length>0?" "+f:f);continue}let S=!!b,w;if(S){let k=y.substring(0,b);w=r(k);let P=w&&i[w]?r(y):void 0;P&&P!==w&&(w=P,S=!1)}else w=r(y);if(!w){if(!S){f=m+(f.length>0?" "+f:f);continue}if(w=r(y),!w){f=m+(f.length>0?" "+f:f);continue}S=!1}let C=v.length===0?"":v.length===1?v[0]:s(v).join(":"),F=x?C+BH:C,T=F+w;if(c.indexOf(T)>-1)continue;c.push(T);let E=a(w,S);for(let k=0;k<E.length;++k){let P=E[k];c.push(F+P)}f=m+(f.length>0?" "+f:f)}return f},"mergeClassList"),JBe=n((...t)=>{let e=0,o,r,a="";for(;e<t.length;)(o=t[e++])&&(r=Yie(o))&&(a&&(a+=" "),a+=r);return a},"twJoin"),Yie=n(t=>{if(typeof t=="string")return t;let e,o="";for(let r=0;r<t.length;r++)t[r]&&(e=Yie(t[r]))&&(o&&(o+=" "),o+=e);return o},"toValue"),e4e=n((t,...e)=>{let o,r,a,s,i=n(d=>{let f=e.reduce((p,m)=>m(p),t());return o=YBe(f),r=o.cache.get,a=o.cache.set,s=c,c(d)},"initTailwindMerge"),c=n(d=>{let f=r(d);if(f)return f;let p=ZBe(d,o);return a(d,p),p},"tailwindMerge");return s=i,(...d)=>s(JBe(...d))},"createTailwindMerge"),t4e=[],as=n(t=>{let e=n(o=>o[t]||t4e,"themeGetter");return e.isThemeGetter=!0,e},"fromTheme"),Xie=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qie=/^\((?:(\w[\w-]*):)?(.+)\)$/i,o4e=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,r4e=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,n4e=/\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$/,a4e=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,s4e=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,i4e=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Uh=n(t=>o4e.test(t),"isFraction"),lr=n(t=>!!t&&!Number.isNaN(Number(t)),"isNumber"),Jd=n(t=>!!t&&Number.isInteger(Number(t)),"isInteger"),LH=n(t=>t.endsWith("%")&&lr(t.slice(0,-1)),"isPercent"),Cp=n(t=>r4e.test(t),"isTshirtSize"),Zie=n(()=>!0,"isAny"),l4e=n(t=>n4e.test(t)&&!a4e.test(t),"isLengthOnly"),UH=n(()=>!1,"isNever"),c4e=n(t=>s4e.test(t),"isShadow"),u4e=n(t=>i4e.test(t),"isImage"),d4e=n(t=>!Gt(t)&&!Kt(t),"isAnyNonArbitrary"),f4e=n(t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),"isNamedContainerQuery"),p4e=n(t=>zh(t,tle,UH),"isArbitrarySize"),Gt=n(t=>Xie.test(t),"isArbitraryValue"),Av=n(t=>zh(t,ole,l4e),"isArbitraryLength"),$ie=n(t=>zh(t,b4e,lr),"isArbitraryNumber"),m4e=n(t=>zh(t,nle,Zie),"isArbitraryWeight"),h4e=n(t=>zh(t,rle,UH),"isArbitraryFamilyName"),jie=n(t=>zh(t,Jie,UH),"isArbitraryPosition"),g4e=n(t=>zh(t,ele,u4e),"isArbitraryImage"),$M=n(t=>zh(t,ale,c4e),"isArbitraryShadow"),Kt=n(t=>Qie.test(t),"isArbitraryVariable"),SF=n(t=>Tv(t,ole),"isArbitraryVariableLength"),v4e=n(t=>Tv(t,rle),"isArbitraryVariableFamilyName"),qie=n(t=>Tv(t,Jie),"isArbitraryVariablePosition"),x4e=n(t=>Tv(t,tle),"isArbitraryVariableSize"),y4e=n(t=>Tv(t,ele),"isArbitraryVariableImage"),jM=n(t=>Tv(t,ale,!0),"isArbitraryVariableShadow"),I4e=n(t=>Tv(t,nle,!0),"isArbitraryVariableWeight"),zh=n((t,e,o)=>{let r=Xie.exec(t);return r?r[1]?e(r[1]):o(r[2]):!1},"getIsArbitraryValue"),Tv=n((t,e,o=!1)=>{let r=Qie.exec(t);return r?r[1]?e(r[1]):o:!1},"getIsArbitraryVariable"),Jie=n(t=>t==="position"||t==="percentage","isLabelPosition"),ele=n(t=>t==="image"||t==="url","isLabelImage"),tle=n(t=>t==="length"||t==="size"||t==="bg-size","isLabelSize"),ole=n(t=>t==="length","isLabelLength"),b4e=n(t=>t==="number","isLabelNumber"),rle=n(t=>t==="family-name","isLabelFamilyName"),nle=n(t=>t==="number"||t==="weight","isLabelWeight"),ale=n(t=>t==="shadow","isLabelShadow");var S4e=n(()=>{let t=as("color"),e=as("font"),o=as("text"),r=as("font-weight"),a=as("tracking"),s=as("leading"),i=as("breakpoint"),c=as("container"),d=as("spacing"),f=as("radius"),p=as("shadow"),m=as("inset-shadow"),h=as("text-shadow"),v=as("drop-shadow"),x=as("blur"),y=as("perspective"),b=as("aspect"),S=as("ease"),w=as("animate"),C=n(()=>["auto","avoid","all","avoid-page","page","left","right","column"],"scaleBreak"),F=n(()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],"scalePosition"),T=n(()=>[...F(),Kt,Gt],"scalePositionWithArbitrary"),E=n(()=>["auto","hidden","clip","visible","scroll"],"scaleOverflow"),k=n(()=>["auto","contain","none"],"scaleOverscroll"),P=n(()=>[Kt,Gt,d],"scaleUnambiguousSpacing"),_=n(()=>[Uh,"full","auto",...P()],"scaleInset"),M=n(()=>[Jd,"none","subgrid",Kt,Gt],"scaleGridTemplateColsRows"),L=n(()=>["auto",{span:["full",Jd,Kt,Gt]},Jd,Kt,Gt],"scaleGridColRowStartAndEnd"),U=n(()=>[Jd,"auto",Kt,Gt],"scaleGridColRowStartOrEnd"),W=n(()=>["auto","min","max","fr",Kt,Gt],"scaleGridAutoColsRows"),V=n(()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],"scaleAlignPrimaryAxis"),j=n(()=>["start","end","center","stretch","center-safe","end-safe"],"scaleAlignSecondaryAxis"),N=n(()=>["auto",...P()],"scaleMargin"),D=n(()=>[Uh,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],"scaleSizing"),B=n(()=>[Uh,"screen","full","dvw","lvw","svw","min","max","fit",...P()],"scaleSizingInline"),z=n(()=>[Uh,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],"scaleSizingBlock"),q=n(()=>[t,Kt,Gt],"scaleColor"),H=n(()=>[...F(),qie,jie,{position:[Kt,Gt]}],"scaleBgPosition"),Y=n(()=>["no-repeat",{repeat:["","x","y","space","round"]}],"scaleBgRepeat"),Q=n(()=>["auto","cover","contain",x4e,p4e,{size:[Kt,Gt]}],"scaleBgSize"),X=n(()=>[LH,SF,Av],"scaleGradientStopPosition"),te=n(()=>["","none","full",f,Kt,Gt],"scaleRadius"),ae=n(()=>["",lr,SF,Av],"scaleBorderWidth"),se=n(()=>["solid","dashed","dotted","double"],"scaleLineStyle"),J=n(()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],"scaleBlendMode"),ne=n(()=>[lr,LH,qie,jie],"scaleMaskImagePosition"),pe=n(()=>["","none",x,Kt,Gt],"scaleBlur"),le=n(()=>["none",lr,Kt,Gt],"scaleRotate"),ie=n(()=>["none",lr,Kt,Gt],"scaleScale"),de=n(()=>[lr,Kt,Gt],"scaleSkew"),ue=n(()=>[Uh,"full",...P()],"scaleTranslate");return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Cp],breakpoint:[Cp],color:[Zie],container:[Cp],"drop-shadow":[Cp],ease:["in","out","in-out"],font:[d4e],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Cp],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Cp],shadow:[Cp],spacing:["px",lr],text:[Cp],"text-shadow":[Cp],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Uh,Gt,Kt,b]}],container:["container"],"container-type":[{"@container":["","normal","size",Kt,Gt]}],"container-named":[f4e],columns:[{columns:[lr,Gt,Kt,c]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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"],sr:["sr-only","not-sr-only"],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()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:_()}],"inset-x":[{"inset-x":_()}],"inset-y":[{"inset-y":_()}],start:[{"inset-s":_(),start:_()}],end:[{"inset-e":_(),end:_()}],"inset-bs":[{"inset-bs":_()}],"inset-be":[{"inset-be":_()}],top:[{top:_()}],right:[{right:_()}],bottom:[{bottom:_()}],left:[{left:_()}],visibility:["visible","invisible","collapse"],z:[{z:[Jd,"auto",Kt,Gt]}],basis:[{basis:[Uh,"full","auto",c,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[lr,Uh,"auto","initial","none",Gt]}],grow:[{grow:["",lr,Kt,Gt]}],shrink:[{shrink:["",lr,Kt,Gt]}],order:[{order:[Jd,"first","last","none",Kt,Gt]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...j(),"normal"]}],"justify-self":[{"justify-self":["auto",...j()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...j(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...j(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...j(),"baseline"]}],"place-self":[{"place-self":["auto",...j()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mbs:[{mbs:N()}],mbe:[{mbe:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...z()]}],"min-block-size":[{"min-block":["auto",...z()]}],"max-block-size":[{"max-block":["none",...z()]}],w:[{w:[c,"screen",...D()]}],"min-w":[{"min-w":[c,"screen","none",...D()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[i]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh",...D()]}],"font-size":[{text:["base",o,SF,Av]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,I4e,m4e]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",LH,Gt]}],"font-family":[{font:[v4e,h4e,e]}],"font-features":[{"font-features":[Gt]}],"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:[a,Kt,Gt]}],"line-clamp":[{"line-clamp":[lr,"none",Kt,$ie]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",Kt,Gt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Kt,Gt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[lr,"from-font","auto",Kt,Av]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[lr,"auto",Kt,Gt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"tab-size":[{tab:[Jd,Kt,Gt]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Kt,Gt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Kt,Gt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:Q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Jd,Kt,Gt],radial:["",Kt,Gt],conic:[Jd,Kt,Gt]},y4e,g4e]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:te()}],"rounded-s":[{"rounded-s":te()}],"rounded-e":[{"rounded-e":te()}],"rounded-t":[{"rounded-t":te()}],"rounded-r":[{"rounded-r":te()}],"rounded-b":[{"rounded-b":te()}],"rounded-l":[{"rounded-l":te()}],"rounded-ss":[{"rounded-ss":te()}],"rounded-se":[{"rounded-se":te()}],"rounded-ee":[{"rounded-ee":te()}],"rounded-es":[{"rounded-es":te()}],"rounded-tl":[{"rounded-tl":te()}],"rounded-tr":[{"rounded-tr":te()}],"rounded-br":[{"rounded-br":te()}],"rounded-bl":[{"rounded-bl":te()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-bs":[{"border-bs":q()}],"border-color-be":[{"border-be":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[lr,Kt,Gt]}],"outline-w":[{outline:["",lr,SF,Av]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","none",p,jM,$M]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",m,jM,$M]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[lr,Av]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",h,jM,$M]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[lr,Kt,Gt]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[lr]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[Kt,Gt]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":F()}],"mask-image-conic-pos":[{"mask-conic":[lr]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:Q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Kt,Gt]}],filter:[{filter:["","none",Kt,Gt]}],blur:[{blur:pe()}],brightness:[{brightness:[lr,Kt,Gt]}],contrast:[{contrast:[lr,Kt,Gt]}],"drop-shadow":[{"drop-shadow":["","none",v,jM,$M]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",lr,Kt,Gt]}],"hue-rotate":[{"hue-rotate":[lr,Kt,Gt]}],invert:[{invert:["",lr,Kt,Gt]}],saturate:[{saturate:[lr,Kt,Gt]}],sepia:[{sepia:["",lr,Kt,Gt]}],"backdrop-filter":[{"backdrop-filter":["","none",Kt,Gt]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[lr,Kt,Gt]}],"backdrop-contrast":[{"backdrop-contrast":[lr,Kt,Gt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",lr,Kt,Gt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lr,Kt,Gt]}],"backdrop-invert":[{"backdrop-invert":["",lr,Kt,Gt]}],"backdrop-opacity":[{"backdrop-opacity":[lr,Kt,Gt]}],"backdrop-saturate":[{"backdrop-saturate":[lr,Kt,Gt]}],"backdrop-sepia":[{"backdrop-sepia":["",lr,Kt,Gt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Kt,Gt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[lr,"initial",Kt,Gt]}],ease:[{ease:["linear","initial",S,Kt,Gt]}],delay:[{delay:[lr,Kt,Gt]}],animate:[{animate:["none",w,Kt,Gt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Kt,Gt]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[Kt,Gt,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],zoom:[{zoom:[Jd,Kt,Gt]}],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",Kt,Gt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":q()}],"scrollbar-track-color":[{"scrollbar-track":q()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",Kt,Gt]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[lr,SF,Av,$ie]}],stroke:[{stroke:["none",...q()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},"getDefaultConfig");var sle=e4e(S4e);function tt(...t){return sle(xo(t))}n(tt,"cn");var O=K(po(),1);var hle=K(fle(),1);var ef=class extends Error{static{n(this,"DateFormatError")}constructor(e,o,r){super(e),this.token=o,this.type=r||"error"}},ple=n(t=>t<4?"short":t===4?"long":"narrow","alpha"),CF=n(t=>t%2===0?"2-digit":"numeric","numeric");function A4e(t,e){switch(t.char){case"y":return{year:CF(t.width)};case"r":return{calendar:"gregory",year:"numeric"};default:return e(`${t.desc} is not supported; falling back to year:numeric`,ef.WARNING),{year:"numeric"}}}n(A4e,"yearOptions");function T4e(t,e){switch(t.width){case 1:return"numeric";case 2:return"2-digit";case 3:return"short";case 4:return"long";case 5:return"narrow";default:e(`${t.desc} is not supported with width ${t.width}`);return}}n(T4e,"monthStyle");function k4e(t,e){let{char:o,desc:r,width:a}=t;if(o==="d")return CF(a);e(`${r} is not supported`)}n(k4e,"dayStyle");function M4e(t,e){let{char:o,desc:r,width:a}=t;if((o==="c"||o==="e")&&a<3){let s=`Numeric value is not supported for ${r}; falling back to weekday:short`;e(s,ef.WARNING)}return ple(a)}n(M4e,"weekdayStyle");function P4e(t){let e=CF(t.width),o;switch(t.char){case"h":o="h12";break;case"H":o="h23";break;case"k":o="h24";break;case"K":o="h11";break}return o?{hour:e,hourCycle:o}:{hour:e}}n(P4e,"hourOptions");function O4e(t,e){let{char:o,desc:r,width:a}=t;switch(o){case"v":case"z":return a===4?"long":"short";case"V":if(a===4)return"long";e(`${r} is not supported with width ${a}`);return;case"X":e(`${r} is not supported`);return}return"short"}n(O4e,"timeZoneNameStyle");function N4e(t,e){switch(t.field){case"era":return{era:ple(t.width)};case"year":return A4e(t,e);case"month":return{month:T4e(t,e)};case"day":return{day:k4e(t,e)};case"weekday":return{weekday:M4e(t,e)};case"period":return;case"hour":return P4e(t);case"min":return{minute:CF(t.width)};case"sec":return{second:CF(t.width)};case"tz":return{timeZoneName:O4e(t,e)};case"quarter":case"week":case"sec-frac":case"ms":e(`${t.desc} is not supported`)}}n(N4e,"compileOptions");function $H(t,e,o=r=>{throw r}){let r={timeZone:e},a=[];for(let s of t){let{error:i,field:c,str:d}=s;if(i){let p=new ef(i.message,s);p.stack=i.stack,o(p)}if(d){let p=`Ignoring string part: ${d}`;o(new ef(p,s,ef.WARNING))}c&&(a.indexOf(c)===-1?a.push(c):o(new ef(`Duplicate ${c} token`,s)));let f=N4e(s,(p,m)=>o(new ef(p,s,m)));f&&Object.assign(r,f)}return r}n($H,"getDateFormatOptions");var D4e={G:{field:"era",desc:"Era"},y:{field:"year",desc:"Year"},Y:{field:"year",desc:'Year of "Week of Year"'},u:{field:"year",desc:"Extended year"},U:{field:"year",desc:"Cyclic year name"},r:{field:"year",desc:"Related Gregorian year"},Q:{field:"quarter",desc:"Quarter"},q:{field:"quarter",desc:"Stand-alone quarter"},M:{field:"month",desc:"Month in year"},L:{field:"month",desc:"Stand-alone month in year"},w:{field:"week",desc:"Week of year"},W:{field:"week",desc:"Week of month"},d:{field:"day",desc:"Day in month"},D:{field:"day",desc:"Day of year"},F:{field:"day",desc:"Day of week in month"},g:{field:"day",desc:"Modified julian day"},E:{field:"weekday",desc:"Day of week"},e:{field:"weekday",desc:"Local day of week"},c:{field:"weekday",desc:"Stand-alone local day of week"},a:{field:"period",desc:"AM/PM marker"},b:{field:"period",desc:"AM/PM/noon/midnight marker"},B:{field:"period",desc:"Flexible day period"},h:{field:"hour",desc:"Hour in AM/PM (1~12)"},H:{field:"hour",desc:"Hour in day (0~23)"},k:{field:"hour",desc:"Hour in day (1~24)"},K:{field:"hour",desc:"Hour in AM/PM (0~11)"},j:{field:"hour",desc:"Hour in preferred cycle"},J:{field:"hour",desc:"Hour in preferred cycle without marker"},C:{field:"hour",desc:"Hour in preferred cycle with flexible marker"},m:{field:"min",desc:"Minute in hour"},s:{field:"sec",desc:"Second in minute"},S:{field:"sec-frac",desc:"Fractional second"},A:{field:"ms",desc:"Milliseconds in day"},z:{field:"tz",desc:"Time Zone: specific non-location"},Z:{field:"tz",desc:"Time Zone"},O:{field:"tz",desc:"Time Zone: localized"},v:{field:"tz",desc:"Time Zone: generic non-location"},V:{field:"tz",desc:"Time Zone: ID"},X:{field:"tz",desc:"Time Zone: ISO8601 with Z"},x:{field:"tz",desc:"Time Zone: ISO8601"}},mle=n(t=>t>="A"&&t<="Z"||t>="a"&&t<="z","isLetter");function _4e(t,e){let o=t[e],r=1;for(;t[++e]===o;)++r;let a=D4e[o];if(!a){let s=`The letter ${o} is not a valid field identifier`;return{char:o,error:new Error(s),width:r}}return{char:o,field:a.field,desc:a.desc,width:r}}n(_4e,"readFieldToken");function L4e(t,e){let o=t[++e],r=2;if(o==="'")return{char:"'",str:o,width:r};for(;;){let a=t[++e];if(++r,a===void 0){let s=`Unterminated quoted literal in pattern: ${o||t}`;return{char:"'",error:new Error(s),str:o,width:r}}else if(a==="'"){if(t[++e]!=="'")return{char:"'",str:o,width:r};++r}o+=a}}n(L4e,"readQuotedToken");function B4e(t,e){let o=t[e];if(!o)return null;if(mle(o))return _4e(t,e);if(o==="'")return L4e(t,e);let r=o,a=1;for(;;){let s=t[++e];if(!s||mle(s)||s==="'")return{char:o,str:r,width:a};r+=s,a+=1}}n(B4e,"readToken");function KM(t){let e=[],o=0;for(;;){let r=B4e(t,o);if(!r)return e;e.push(r),o+=r.width}}n(KM,"parseDateTokens");function gle(t,e){return t.filter(o=>o.type!=="content").length?t.map(o=>{if(o.type==="content")return e(o.value);if(o.type==="octothorpe")return"#";if(o.type==="argument")return[o.arg];if(o.type==="function"){let s=o?.param?.[0];if(o.key==="date"&&s){let i=V4e(s.value.trim(),c=>{throw new Error(`Unable to compile date expression: ${c.message}`)});return[o.arg,o.key,i]}return s?[o.arg,o.key,s.value.trim()]:[o.arg,o.key]}let r=o.pluralOffset,a={};return o.cases.forEach(({key:s,tokens:i})=>{let c=s[0]==="="?s.slice(1):s;a[c]=gle(i,e)}),[o.arg,o.type,{offset:r,...a}]}):t.map(o=>e(o.value))}n(gle,"processTokens");function V4e(t,e){if(/^::/.test(t)){let o=KM(t.substring(2));return $H(o,void 0,e)}return t}n(V4e,"compileDateExpression");function U4e(t,e=o=>o){return gle((0,hle.parse)(t),e)}n(U4e,"compileMessageOrThrow");function YM(t,e=o=>o){try{return U4e(t,e)}catch(o){return console.error(`${o.message}
252
252
 
253
253
  Message: ${t}`),[t]}}n(YM,"compileMessage");var Hh=n(t=>typeof t=="string","isString"),z4e=n(t=>typeof t=="function","isFunction"),vle=new Map,yle="en";function GH(t){return[...Array.isArray(t)?t:[t],yle]}n(GH,"normalizeLocales");function KH(t,e,o){let r=GH(t);o||(o="default");let a;if(typeof o=="string")switch(a={day:"numeric",month:"short",year:"numeric"},o){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=o;return XM(()=>QM("date",r,o),()=>new Intl.DateTimeFormat(r,a)).format(Hh(e)?new Date(e):e)}n(KH,"date");function H4e(t,e,o){let r;if(o||(o="default"),typeof o=="string")switch(r={second:"numeric",minute:"numeric",hour:"numeric"},o){case"full":case"long":r.timeZoneName="short";break;case"short":delete r.second}else r=o;return KH(t,e,r)}n(H4e,"time");function jH(t,e,o){let r=GH(t);return XM(()=>QM("number",r,o),()=>new Intl.NumberFormat(r,o)).format(e)}n(jH,"number");function xle(t,e,o,{offset:r=0,...a}){let s=GH(t),i=e?XM(()=>QM("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):XM(()=>QM("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return a[o]??a[i.select(o-r)]??a.other}n(xle,"plural");function XM(t,e){let o=t(),r=vle.get(o);return r||(r=e(),vle.set(o,r)),r}n(XM,"getMemoized");function QM(t,e,o){let r=e.join("-");return`${t}-${r}-${JSON.stringify(o)}`}n(QM,"cacheKey");var Ile=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,ble=n(t=>t.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,o,r)=>{if(o){let a=parseInt(o,16);return String.fromCharCode(a)}else{let a=parseInt(r,16);return String.fromCharCode(a)}}),"decodeEscapeSequences"),Sle="%__lingui_octothorpe__%",$4e=n((t,e,o={})=>{let r=e||t,a=n(i=>typeof i=="object"?i:o[i],"style"),s=n((i,c)=>{let d=Object.keys(o).length?a("number"):void 0,f=jH(r,i,d);return c.replace(new RegExp(Sle,"g"),f)},"replaceOctothorpe");return{plural:n((i,c)=>{let{offset:d=0}=c,f=xle(r,!1,i,c);return s(i-d,f)},"plural"),selectordinal:n((i,c)=>{let{offset:d=0}=c,f=xle(r,!0,i,c);return s(i-d,f)},"selectordinal"),select:j4e,number:n((i,c)=>jH(r,i,a(c)||{style:c}),"number"),date:n((i,c)=>KH(r,i,a(c)||c),"date"),time:n((i,c)=>H4e(r,i,a(c)||c),"time")}},"getDefaultFormats"),j4e=n((t,e)=>e[t]??e.other,"selectFormatter");function q4e(t,e,o){return(r={},a)=>{let s=$4e(e,o,a),i=n((d,f=!1)=>Array.isArray(d)?d.reduce((p,m)=>{if(m==="#"&&f)return p+Sle;if(Hh(m))return p+m;let[h,v,x]=m,y={};v==="plural"||v==="selectordinal"||v==="select"?Object.entries(x).forEach(([S,w])=>{y[S]=i(w,v==="plural"||v==="selectordinal")}):y=x;let b;if(v){let S=s[v];b=S(r[h],y)}else b=r[h];return b==null?p:p+b},""):d,"formatMessage"),c=i(t);return Hh(c)&&Ile.test(c)?ble(c):Hh(c)?c:c?String(c):""}}n(q4e,"interpolate");var qH=class{static{n(this,"EventEmitter")}_events={};on(e,o){return this._events[e]??=new Set,this._events[e].add(o),()=>this.removeListener(e,o)}removeListener(e,o){let r=this._events[e];r?.delete(o),r?.size===0&&delete this._events[e]}emit(e,...o){let r=this._events[e];if(r)for(let a of[...r])a.apply(this,o)}},WH=class extends qH{static{n(this,"I18n")}_locale="";_locales;_messages={};_missing;_messageCompiler;constructor(e){super(),this.setMessagesCompiler(YM),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),(typeof e.locale=="string"||e.locales)&&this.activate(e.locale??yle,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}setMessagesCompiler(e){return this._messageCompiler=e,this}_load(e,o){let r=this._messages[e];r?Object.assign(r,o):this._messages[e]=o}load(e,o){typeof e=="string"&&typeof o=="object"?this._load(e,o):Object.entries(e).forEach(([r,a])=>this._load(r,a)),this.emit("change")}loadAndActivate({locale:e,locales:o,messages:r}){this._locale=e,this._locales=o||void 0,this._messages[this._locale]=r,this.emit("change")}activate(e,o){this._messages[e]||console.warn(`Messages for locale "${e}" not loaded.`),this._locale=e,this._locales=o,this.emit("change")}_(e,o,r){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=r?.message;e||(e=""),Hh(e)||(o=e.values||o,a=e.message,e=e.id);let s=this.messages[e],i=s===void 0,c=this._missing;if(c&&i)return z4e(c)?c(this._locale,e):c;i&&this.emit("missing",{id:e,locale:this._locale});let d=s||a||e;return Hh(d)&&(this._messageCompiler?d=this._messageCompiler(d):console.warn(`Uncompiled message detected! Message:
254
254