@kizenapps/cli 0.12.0 → 0.14.0
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.
- package/LICENSE.md +674 -0
- package/README.md +42 -0
- package/dist/index.js +89 -1986
- package/dist/index.js.map +1 -1
- package/dist/viewer/assets/AppDetailPage-D4r3W5v5.js +1 -0
- package/dist/viewer/assets/BootstrapContext-D5ZnMrOp.js +1 -0
- package/dist/viewer/assets/Card-BpDJPrPZ.js +1 -0
- package/dist/viewer/assets/CodeStepsPage-BzaaN9Kb.js +1 -0
- package/dist/viewer/assets/CodeViewer-Ce2qKSWi.js +4 -0
- package/dist/viewer/assets/ConfigurationPage-DyGQQTe-.js +1 -0
- package/dist/viewer/assets/DevSidebar-h9gYdctz.js +1 -0
- package/dist/viewer/assets/IconReferencePage-BLciUKH9.js +1 -0
- package/dist/viewer/assets/SandboxPage-IYn-KIbv.js +1 -0
- package/dist/viewer/assets/SidebarContext-Cn8QRb77.js +1 -0
- package/dist/viewer/assets/SourceBrowserPage-BOlm36Dg.js +1 -0
- package/dist/viewer/assets/Tooltip-tpqNw0op.js +1 -0
- package/dist/viewer/assets/VersionsPage-C02dpN3Y.js +1 -0
- package/dist/viewer/assets/WhenBadge-GxhTQKsq.js +1 -0
- package/dist/viewer/assets/api-C5Iu-4AS.js +1 -0
- package/dist/viewer/assets/bundleQuery-CjbA01rb.js +1 -0
- package/dist/viewer/assets/configStorage-BnMh081m.js +10 -0
- package/dist/viewer/assets/{fa-core-wsCxaNB7.js → fa-core-BoBqCOD3.js} +1 -1
- package/dist/viewer/assets/index-CjU7OUke.js +5 -0
- package/dist/viewer/assets/index-dW-Omils.css +2 -0
- package/dist/viewer/assets/{react-CkuOm_dq.js → react-csXWLXSE.js} +1 -1
- package/dist/viewer/assets/{recordDetail.worker-BIHPFt8Y.js → recordDetail.worker-C0-mQTaj.js} +1 -1
- package/dist/viewer/assets/storageKeys-ClzdCxlg.js +1 -0
- package/dist/viewer/assets/useCriticalExceptionDialog-DK8ufamu.js +5 -0
- package/dist/viewer/assets/{useLocalStorage-BWwvt0nG.js → useLocalStorage-B73GyZbK.js} +1 -1
- package/dist/viewer/assets/{useNavigate-9J1ZzN1J.js → useNavigate-BblEmQ3O.js} +1 -1
- package/dist/viewer/assets/useQuery-5OkVbV1s.js +1 -0
- package/dist/viewer/assets/{validIcons-UmfwFGTT.js → validIcons-BzGQ4tWD.js} +1 -1
- package/dist/viewer/index.html +12 -10
- package/package.json +5 -7
- package/dist/chunk-4Z6S6LWP.js +0 -6134
- package/dist/chunk-4Z6S6LWP.js.map +0 -1
- package/dist/chunk-HJPLDI45.js +0 -6134
- package/dist/chunk-HJPLDI45.js.map +0 -1
- package/dist/chunk-LSHHXCC6.js +0 -3639
- package/dist/chunk-LSHHXCC6.js.map +0 -1
- package/dist/chunk-SEGVTWSK.js +0 -44
- package/dist/chunk-SEGVTWSK.js.map +0 -1
- package/dist/chunk-ZWE3DS7E.js +0 -39
- package/dist/chunk-ZWE3DS7E.js.map +0 -1
- package/dist/devtools-LZRAH4XS.js +0 -90
- package/dist/devtools-LZRAH4XS.js.map +0 -1
- package/dist/dist-C3F6UOWF.js +0 -8472
- package/dist/dist-C3F6UOWF.js.map +0 -1
- package/dist/dist-NUJOSN7W.js +0 -8472
- package/dist/dist-NUJOSN7W.js.map +0 -1
- package/dist/dist-QHDMIBVE.js +0 -135
- package/dist/dist-QHDMIBVE.js.map +0 -1
- package/dist/dist-ZIZQOSY3.js +0 -135
- package/dist/dist-ZIZQOSY3.js.map +0 -1
- package/dist/gzip-size-K37OQCQ2.js +0 -137
- package/dist/gzip-size-K37OQCQ2.js.map +0 -1
- package/dist/gzip-size-QRGIYYEQ.js +0 -137
- package/dist/gzip-size-QRGIYYEQ.js.map +0 -1
- package/dist/viewer/assets/AppDetailPage-BPvWscWJ.js +0 -1
- package/dist/viewer/assets/AppDetailPage-DIuYKCTQ.js +0 -1
- package/dist/viewer/assets/AppDetailPage-r3jzO9Kf.js +0 -1
- package/dist/viewer/assets/BootstrapContext-CExPp3R2.js +0 -1
- package/dist/viewer/assets/BootstrapContext-CTQMWXf-.js +0 -1
- package/dist/viewer/assets/BootstrapContext-DbnbWmQT.js +0 -1
- package/dist/viewer/assets/Card-Bmn1HMWl.js +0 -1
- package/dist/viewer/assets/Card-DMz6T3VL.js +0 -1
- package/dist/viewer/assets/Card-DsqKctyM.js +0 -1
- package/dist/viewer/assets/CodeStepsPage-BHqLfCdV.js +0 -4
- package/dist/viewer/assets/CodeStepsPage-BymhEfzO.js +0 -4
- package/dist/viewer/assets/CodeStepsPage-CD_MhDwY.js +0 -4
- package/dist/viewer/assets/CodeStepsPage-CgI-LqEx.js +0 -4
- package/dist/viewer/assets/CodeStepsPage-Dak3saZE.js +0 -5
- package/dist/viewer/assets/CodeStepsPage-Zj6DscGd.js +0 -4
- package/dist/viewer/assets/ConfigurationPage-Cjy9TH3N.js +0 -1
- package/dist/viewer/assets/ConfigurationPage-DmX-6MM-.js +0 -1
- package/dist/viewer/assets/ConfigurationPage-J56kCD_e.js +0 -1
- package/dist/viewer/assets/CredentialsContext-Xbse1T0q.js +0 -1
- package/dist/viewer/assets/CredentialsContext-zl2e9kpM.js +0 -1
- package/dist/viewer/assets/DevSidebar-B30mgxSn.js +0 -1
- package/dist/viewer/assets/DevSidebar-BhTD2bBO.js +0 -1
- package/dist/viewer/assets/DevSidebar-CsEdCTej.js +0 -1
- package/dist/viewer/assets/IconReferencePage-B6j9wlte.js +0 -1
- package/dist/viewer/assets/IconReferencePage-CJa9yg9Z.js +0 -1
- package/dist/viewer/assets/IconReferencePage-Q5I-lMFQ.js +0 -1
- package/dist/viewer/assets/SandboxPage-C0h7GUkw.js +0 -1
- package/dist/viewer/assets/SandboxPage-GDcydJnJ.js +0 -1
- package/dist/viewer/assets/SandboxPage-JREBQ4id.js +0 -1
- package/dist/viewer/assets/SidebarContext-BPkYyxET.js +0 -1
- package/dist/viewer/assets/SidebarContext-DVDXFWJI.js +0 -1
- package/dist/viewer/assets/SidebarContext-HucmR353.js +0 -1
- package/dist/viewer/assets/VersionsPage-B76eugMm.js +0 -1
- package/dist/viewer/assets/VersionsPage-BIpB0iBz.js +0 -1
- package/dist/viewer/assets/VersionsPage-D0qenxK5.js +0 -1
- package/dist/viewer/assets/api-BOqcXygX.js +0 -1
- package/dist/viewer/assets/api-DqAiw0w9.js +0 -1
- package/dist/viewer/assets/bundleQuery-206rQR6g.js +0 -1
- package/dist/viewer/assets/bundleQuery-L4H4wq5q.js +0 -1
- package/dist/viewer/assets/fa-core-DaD7O-yO.js +0 -558
- package/dist/viewer/assets/fa-pro-icons-Dzkwxnip.js +0 -1
- package/dist/viewer/assets/index-BPiwld5D.js +0 -5
- package/dist/viewer/assets/index-BiyeMU_r.css +0 -2
- package/dist/viewer/assets/index-BlJv_543.js +0 -5
- package/dist/viewer/assets/index-CAYNux5J.js +0 -5
- package/dist/viewer/assets/index-D4AnoAXz.js +0 -5
- package/dist/viewer/assets/index-D8Koqlb-.js +0 -5
- package/dist/viewer/assets/index-DKrC0qkC.js +0 -5
- package/dist/viewer/assets/react-CyWK9rg5.js +0 -9
- package/dist/viewer/assets/useLocalStorage-BlZWItfY.js +0 -1
- package/dist/viewer/assets/useLocalStorage-CQO0VGQ6.js +0 -1
- package/dist/viewer/assets/useNavigate-V8wjv5GQ.js +0 -1
- package/dist/viewer/assets/useObjectLookups-BAqe9wvu.js +0 -14
- package/dist/viewer/assets/useObjectLookups-C65zm-bM.js +0 -14
- package/dist/viewer/assets/useObjectLookups-CslM2vSA.js +0 -14
- package/dist/viewer/assets/validIcons-Dqgxgpv-.js +0 -1
- /package/dist/viewer/assets/{CodeStepsPage-DdKuH37F.css → CodeViewer-DdKuH37F.css} +0 -0
- /package/dist/viewer/assets/{fa-pro-icons-CiTC899m.js → fa-pro-icons-j8-_MCQ7.js} +0 -0
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DevSidebar-CsEdCTej.js","assets/rolldown-runtime-DF2fYuay.js","assets/fa-core-wsCxaNB7.js","assets/CredentialsContext-zl2e9kpM.js","assets/AppDetailPage-r3jzO9Kf.js","assets/bundleQuery-L4H4wq5q.js","assets/Card-Bmn1HMWl.js","assets/validIcons-Dqgxgpv-.js","assets/fa-pro-icons-CiTC899m.js","assets/SandboxPage-C0h7GUkw.js","assets/useObjectLookups-C65zm-bM.js","assets/BootstrapContext-CTQMWXf-.js","assets/react-CyWK9rg5.js","assets/api-BOqcXygX.js","assets/SidebarContext-HucmR353.js","assets/useLocalStorage-BWwvt0nG.js","assets/ConfigurationPage-DmX-6MM-.js","assets/VersionsPage-B76eugMm.js","assets/IconReferencePage-CJa9yg9Z.js","assets/CodeStepsPage-Zj6DscGd.js","assets/useNavigate-9J1ZzN1J.js","assets/CodeStepsPage-DdKuH37F.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{b as t,c as n,g as r,m as i,p as a,t as o,x as s,y as c}from"./fa-core-wsCxaNB7.js";import{n as l,t as u}from"./react-CyWK9rg5.js";import{a as d,i as f,n as p,r as m,t as h}from"./useNavigate-9J1ZzN1J.js";import{$ as g,B as _,G as v,H as y,J as b,K as x,L as S,N as C,P as w,Q as T,R as E,T as D,U as ee,V as O,W as k,X as te,Y as A,Z as j,et as M,f as N,k as ne,n as re,nt as ie,p as ae,q as oe,rt as P,t as se,tt as F,y as ce,z as I}from"./bundleQuery-L4H4wq5q.js";import{i as le,r as L,t as R}from"./BootstrapContext-CTQMWXf-.js";import{t as ue}from"./CredentialsContext-zl2e9kpM.js";import{n as de,t as fe}from"./api-BOqcXygX.js";import{t as pe}from"./SidebarContext-HucmR353.js";import{t as me}from"./Card-Bmn1HMWl.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function z(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var B=4,he=5;function ge(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function _e(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=ge(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function ve(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;s<o;){let e=_e(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=H(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=H(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=U(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=U(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=U(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=H(n.fullPath??n.from);e.kind=he,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=H(n.fullPath??n.from);e.kind=B,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=n.options?.params?.parse??null,i.skipOnParamError=l,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)ve(e,t,r,s,i,a,o)}function ye(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function V(e){if(e.pathless)for(let t of e.pathless)V(t);if(e.static)for(let t of e.static.values())V(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())V(t);if(e.dynamic?.length){e.dynamic.sort(ye);for(let t of e.dynamic)V(t)}if(e.optional?.length){e.optional.sort(ye);for(let t of e.optional)V(t)}if(e.wildcard?.length){e.wildcard.sort(ye);for(let t of e.wildcard)V(t)}}function H(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function U(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function be(e,t){let n=H(`/`),r=new Uint16Array(6);for(let t of e)ve(!1,r,t,1,n,0);V(n),t.masksTree=n,t.flatCache=z(1e3)}function xe(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Ee(e,t.masksTree);return t.flatCache.set(e,r),r}function Se(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=H(`/`),ve(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Ee(r,o,n)}function Ce(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Ee(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Oe(a.route)),t.matchCache.set(r,a),a}function we(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Te(e,t=!1,n){let r=H(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return ve(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&k(),a[e.id]=e,s!==0&&e.path){let t=we(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),V(r),{processedTree:{segmentTree:r,singleCache:z(1e3),matchCache:z(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Ee(e,t,n=!1){let r=e.split(`/`),i=Ae(e,r,t,n);if(!i)return null;let[a]=De(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function De(e,t,n){let r=ke(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===B)break;if(u.kind===he){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Oe(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function ke(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Ae(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!F(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:d,skipped:f,depth:p,statics:m,dynamics:h,optionals:g}=n,{extract:_,rawParams:v,parsedParams:y}=n;if(i.skipOnParamError){if(!je(e,t,n))continue;v=n.rawParams,_=n.extract,y=n.parsedParams}r&&i.route&&i.kind!==B&&Me(l,n)&&(l=n);let b=d===o;if(b&&(i.route&&!a&&Me(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let x=b?void 0:t[d],S;if(b&&i.index){let n={node:i.index,index:d,skipped:f,depth:p+1,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y},r=!0;if(i.index.skipOnParamError&&(je(e,t,n)||(r=!1)),r){if(m===o&&!h&&!g&&!f)return n;Me(u,n)&&(u=n)}}if(i.wildcard&&Me(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r&&(b||!(n.caseSensitive?x:S??=x.toLowerCase()).startsWith(r)))continue;if(i){if(b)continue;let e=t.slice(d).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:f,depth:p,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(!(n.skipOnParamError&&!je(e,t,a))){c=a;break}}if(i.optional){let e=f|1<<p,t=p+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:d,skipped:e,depth:t,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?x:S??=x.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:d+1,skipped:f,depth:t,statics:m,dynamics:h,optionals:g+1,extract:_,rawParams:v,parsedParams:y})}}if(!b&&i.dynamic&&x)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?x:S??=x.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:d+1,skipped:f,depth:p+1,statics:m,dynamics:h+1,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.staticInsensitive){let e=i.staticInsensitive.get(S??=x.toLowerCase());e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.static){let e=i.static.get(x);e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(i.pathless){let e=p+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:d,skipped:f,depth:e,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}}}if(u&&c)return Me(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function je(e,t,n){try{let[r,i]=De(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function Me(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===B)>(e.node.kind===B)||t.node.kind===B==(e.node.kind===B)&&t.depth>e.depth))):!0}function Ne(e){return Pe(e.filter(e=>e!==void 0).join(`/`))}function Pe(e){return e.replace(/\/{2,}/g,`/`)}function Fe(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function W(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Ie(e){return W(Fe(e))}function Le(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Re(e,t,n){return Le(e,n)===Le(t,n)}function ze({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&F(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(F(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=_e(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=Pe(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function Be(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Ve(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ue(e,n)).join(`/`):Ue(r,n):r}function He({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=_e(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Ve(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ve(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ve(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Ue(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function G(e){return e?.isNotFound===!0}function We(){try{return typeof window<`u`&&typeof window.sessionStorage==`object`?window.sessionStorage:void 0}catch{return}}var Ge=`tsr-scroll-restoration-v1_3`;function Ke(){let e=We();if(!e)return null;let t={};try{let n=JSON.parse(e.getItem(`tsr-scroll-restoration-v1_3`)||`{}`);g(n)&&(t=n)}catch{}return{get state(){return t},set:e=>{t=j(e,t)||t},persist:()=>{try{e.setItem(Ge,JSON.stringify(t))}catch{}}}}var qe=Ke(),Je=e=>e.state.__TSR_key||e.href;function Ye(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var Xe=!1,Ze=`window`,Qe=`data-scroll-restoration-id`;function $e(e,t){if(!qe)return;let n=qe;if((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,Xe=!1;let r=e.options.getScrollRestorationKey||Je,i=new Map;window.history.scrollRestoration=`manual`;let a=t=>{if(!(Xe||!e.isScrollRestoring))if(t.target===document||t.target===window)i.set(Ze,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{let e=t.target;i.set(e,{scrollX:e.scrollLeft||0,scrollY:e.scrollTop||0})}},o=t=>{if(!e.isScrollRestoring||!t||i.size===0||!n)return;let r=n.state[t]||={};for(let[e,t]of i){let n;if(e===Ze)n=Ze;else if(e.isConnected){let t=e.getAttribute(Qe);n=t?`[${Qe}="${t}"]`:Ye(e)}n&&(r[n]=t)}};document.addEventListener(`scroll`,a,!0),e.subscribe(`onBeforeLoad`,e=>{o(e.fromLocation?r(e.fromLocation):void 0),i.clear()}),window.addEventListener(`pagehide`,()=>{o(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe(`onRendered`,t=>{let a=r(t.toLocation),o=e.options.scrollRestorationBehavior,s=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))){Xe=!0;try{let t=e.isScrollRestoring?n.state[a]:void 0,r=!1;if(t)for(let e in t){let n=t[e];if(!g(n))continue;let{scrollX:i,scrollY:a}=n;if(!(!Number.isFinite(i)||!Number.isFinite(a))){if(e===Ze)window.scrollTo({top:a,left:i,behavior:o}),r=!0;else if(e){let t;try{t=document.querySelector(e)}catch{continue}t&&(t.scrollLeft=i,t.scrollTop=a,r=!0)}}}if(!r){let t=e.history.location.hash.slice(1);if(t){let e=window.history.state?.__hashScrollIntoViewOptions??!0;if(e){let n=document.getElementById(t);n&&n.scrollIntoView(e)}}else{let e={top:0,left:0,behavior:o};if(window.scrollTo(e),s)for(let t of s){if(t===Ze)continue;let n=typeof t==`function`?t():document.querySelector(t);n&&n.scrollTo(e)}}}}finally{Xe=!1}e.isScrollRestoring&&n.set(e=>(e[a]||={},e))}})}function et(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function tt(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function nt(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=tt(r):Array.isArray(t)?t.push(tt(r)):n[e]=[t,tt(r)]}return n}var rt=at(JSON.parse),it=ot(JSON.stringify,JSON.parse);function at(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=nt(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function ot(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=et(e,r);return t?`?${t}`:``}}var st=`__root__`;function ct(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function K(e){return e instanceof Response&&!!e.options}function lt(e){return{input:({url:t})=>{for(let n of e)t=dt(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=ft(e[n],t);return t}}}function ut(e){let t=Ie(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Ne([`/`,t,e.pathname]),e)}}function dt(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function ft(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function pt(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>mt(o,_.get())),x=r(()=>mt(s,v.get())),S=r(()=>mt(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=z(64);function ee(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let O={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:ee,setMatches:k,setPending:te,setCached:A};k(e.matches),a?.(O);function k(e){ht(e,o,_,n,i)}function te(e){ht(e,s,v,n,i)}function A(e){ht(e,c,y,n,i)}return O}function mt(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function ht(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}x(n.get(),a)||n.set(a)})}var gt=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},_t=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),vt=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),yt=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},bt=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},q=(e,t,n)=>{if(!(!K(n)&&!G(n)))throw K(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:K(n)?`redirected`:G(n)?`notFound`:r.status===`pending`?`success`:r.status,context:yt(e,t.index),isFetching:!1,error:n})),G(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),K(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},xt=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},St=(e,t,n)=>{let r=yt(e,n);e.updateMatch(t,e=>({...e,context:r}))},Ct=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,q(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,q(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!K(n)&&!G(n)&&(e.serialError??=n)},wt=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!vt(e,t)&&(n.options.loader||n.options.beforeLoad||Ft(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{gt(e)},i);r._nonReactive.pendingTimeout=t}},Tt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;wt(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&q(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},Et=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=oe(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Ct(e,n,o,`PARSE_PARAMS`),s&&Ct(e,n,s,`VALIDATE_SEARCH`),wt(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=oe();let f={...yt(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=vt(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(K(r)||G(r))&&(u(),Ct(e,n,r,`BEFORE_LOAD`)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),M(y))return u(),y.catch(t=>{Ct(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),Ct(e,n,t,`BEFORE_LOAD`)}v(y)},Dt=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>Et(e,n,t,i),s=()=>{if(xt(e,n))return;let t=Tt(e,n,i);return M(t)?t.then(o):o()};return a()},Ot=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},kt=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=yt(e,r),d=vt(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},At=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{Pt(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(kt(e,t,n,r,i)),l=!!s&&M(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;q(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:yt(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:yt(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,G(t)&&await i.options.notFoundComponent?.preload?.(),q(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,q(e,e.router.getMatch(n),t)}!K(o)&&!G(o)&&await Pt(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:yt(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),q(e,r,t)}},jt=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(kt(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await At(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){K(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await At(e,t,i,n,d):St(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(xt(e,i)){if(!e.router.getMatch(i))return e.matches[n];St(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=vt(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&q(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=oe(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function Mt(e){let t=e,n=[];_t(t.router)&>(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=Dt(t,e);M(n)&&await n}catch(e){if(K(e))throw e;if(G(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?bt(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(jt(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(K(e))throw e;G(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=bt(t,l);e===void 0&&k();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await Pt(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Pt(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Ot(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=gt(t);if(M(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Nt(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Pt(e,t=It){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===It?(()=>{if(e._componentsPromise===void 0){let t=Nt(e,It);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Nt(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Ft(e){for(let t of It)if(e.options[t]?.preload)return!0;return!1}var It=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],J=`__TSR_index`,Lt=`popstate`,Rt=`beforeunload`;function zt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Ut(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[J];i=Bt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[J];i=Bt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[J]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Bt(e,t){t||={};let n=Wt();return{...t,key:n,__TSR_key:n,[J]:e}}function Vt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Ut(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Wt();t.history.replaceState({[J]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Ut(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[J]-l.state[J],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=zt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Rt,S,{capture:!0}),t.removeEventListener(Lt,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Rt,S,{capture:!0}),t.addEventListener(Lt,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Ht(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Ut(e,t){let n=Ht(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Wt();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[J]:0,key:a,__TSR_key:a}}}function Wt(){return(Math.random()+1).toString(36).substring(7)}function Gt(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Kt=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Be(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Vt()),this.origin=this.options.origin,this.origin||(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 e;this.resolvePathCache=z(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=pt(Yt(this.latestLocation),e),$e(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=Ie(o);t&&t!==`/`&&e.push(ut({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:lt(e),this.history&&this.updateLatestLocation(),a=!0}a&&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 e=Te(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&be(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:b(e).path,external:!1,searchStr:o,search:ie(t?.search,i),hash:b(r.slice(1)).path,state:P(t?.state,a)}}let o=new URL(i,this.origin),s=dt(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:b(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:ie(t?.search,c),hash:b(s.hash.slice(1)).path,state:P(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>ze({base:e,to:Pe(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Zt({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,s=Object.assign(Object.create(null),r.params),c=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),l=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,j(t.params,s)),u=this.getMatchedRoutes(c),d=u.matchedRoutes;if((!u.foundRoute||u.foundRoute.path!==`/`&&u.routeParams[`**`])&&this.options.notFoundRoute&&(d=[...d,this.options.notFoundRoute]),Object.keys(l).length>0)for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(l,t(l))}catch{}}let f=e.leaveParams?c:b(He({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,p=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Xt(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=Qt({search:p,dest:t,destRoutes:d,_includeValidateSearch:e._includeValidateSearch}),p=ie(o,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?j(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?j(t.state,n.state):{};_=P(n.state,_);let v=`${f}${m}${g}`,y,x,S=!1;if(this.rewrite){let e=new URL(v,this.origin),t=ft(this.rewrite,e);y=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else y=te(v),x=y;return{publicHref:x,href:y,pathname:f,search:p,searchStr:m,state:_,hash:h??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=xe(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,j(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=A(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=W(this.latestLocation.href)===W(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=oe(()=>{a?.resolve(),a=void 0}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Ut(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=dt(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(T(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.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(e),this.stores.setCached(t)})},this.load=async e=>{let t,n,r,i=this.stores.resolvedLocation.get()??this.stores.location.get();for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=Gt(t,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...n}),this.emit({type:`onBeforeLoad`,...n}),await Mt({router:this,sync:e?.sync,forceStaleReload:i.href===t.href,matches:this.stores.pendingMatches.get(),location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){K(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):G(e)&&(n=e);let r=t?t.status:n?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(r),this.stores.redirect.set(t)})}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(e=>e.status===`error`)&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Gt(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&T(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=Pt,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await Mt({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(K(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});G(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=Se(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!A(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?A(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??it,parseSearch:e.parseSearch??rt,protocolAllowlist:e.protocolAllowlist??v}),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:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:W(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?en(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map;for(let e of this.stores.matchStores.values())e.routeId&&u.set(e.routeId,e.get());for(let n=0;n<o.length;n++){let r=o[n],s=l[n-1],d,f,p;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=Xt(r.options.validateSearch,{...n})??void 0;d={...n,...e},f={...i,...e},p=void 0}catch(e){let r=e;if(e instanceof qt||(r=new qt(e.message,{cause:e})),t?.throwOnError)throw r;d=n,f={},p=r}}let m=r.options.loaderDeps?.({search:d})??``,h=m?JSON.stringify(m):``,{interpolatedPath:g,usedParams:_}=He({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),v=r.id+g+h,y=this.getMatch(v),b=u.get(r.id),x=y?._strictParams??_,S;if(!y)try{tn(r,_,a,x)}catch(e){if(S=G(e)||K(e)?e:new Jt(e.message,{cause:e}),t?.throwOnError)throw S}Object.assign(i,x);let C=b?`stay`:`enter`,w;if(y)w={...y,cause:C,params:b?.params??i,_strictParams:x,search:ie(b?b.search:y.search,d),_strictSearch:f};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Ft(r)?`pending`:`success`;w={id:v,ssr:r.options.ssr,index:n,routeId:r.id,params:b?.params??i,_strictParams:x,pathname:g,updatedAt:Date.now(),search:b?ie(b.search,d):d,_strictSearch:f,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:S,__routeContext:void 0,_nonReactive:{loadPromise:oe()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:b?P(b.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(w.globalNotFound=c===r.id),w.searchError=p;let T=this.getParentContext(s);w.context={...T,...w.__routeContext,...w.__beforeLoadContext},l[n]=w}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?ie(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=F(t),a={...e.search};for(let e of t)try{Object.assign(a,Xt(e.options.validateSearch,a))}catch{}let o=F(this.stores.matchesId.get()),s=o&&this.stores.matchStores.get(o)?.get(),c=s&&s.routeId===i.id&&s.pathname===e.pathname,l;if(c)l=s.params;else{let e=Object.assign(Object.create(null),n);for(let i of t)try{tn(i,n,r??{},e)}catch{}l=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:l}}},qt=class extends Error{},Jt=class extends Error{};function Yt(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Xt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new qt(`Async validation not supported`);if(n.issues)throw new qt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Zt({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=W(e),a,o,s=Ce(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign(Object.create(null),s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function Qt({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return $t(n)(e,t,r??!1)}function $t(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...Xt(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:j(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function en(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return st}function tn(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}var nn=`Error preloading route! ☝️`,rn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=st:this.parentRoute||k();let r=n?st:t?.path;r&&r!==`/`&&(r=Fe(r));let i=t?.id||r,a=n?st:Ne([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Ne([`/`,a]));let o=a===`__root__`?`/`:Ne([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=W(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(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=>ct({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},an=class extends rn{constructor(e){super(e)}};function on(e){if(typeof document<`u`&&document.querySelector){let t=e.stores.location.get(),n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==``){let e=document.getElementById(t.hash);e&&e.scrollIntoView(n)}}}var Y=e(s(),1),X=t();function sn(e){let t=e.errorComponent??ln;return(0,X.jsx)(cn,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?Y.createElement(t,{error:n,reset:r}):e.children})}var cn=class extends Y.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function ln({error:e}){let[t,n]=Y.useState(!1);return(0,X.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,X.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,X.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,X.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,X.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,X.jsx)(`div`,{children:(0,X.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,X.jsx)(`code`,{children:e.message}):null})}):null]})}function un({children:e,fallback:t=null}){return dn()?(0,X.jsx)(Y.Fragment,{children:e}):(0,X.jsx)(Y.Fragment,{children:t})}function dn(){return Y.useSyncExternalStore(fn,()=>!0,()=>!1)}function fn(){return()=>{}}var Z=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(Z||{});function pn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function mn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var hn=[],gn=0,{link:_n,unlink:vn,propagate:yn,checkDirty:bn,shallowPropagate:xn}=pn({update(e){return e._update()},notify(e){hn[Cn++]=e,e.flags&=~Z.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Z.Mutable|Z.Dirty,En(e))}}),Sn=0,Cn=0,Q,wn=0;function Tn(e){try{++wn,e()}finally{--wn||Dn()}}function En(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=vn(n,e)}function Dn(){if(!(wn>0)){for(;Sn<Cn;){let e=hn[Sn];hn[Sn++]=void 0,e.notify()}Sn=0,Cn=0}}function On(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Z.None:Z.Mutable,get(){return Q!==void 0&&_n(i,Q,gn),i._snapshot},subscribe(e){let t=mn(e),n={current:!1},r=kn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Q,o=t?.compare??Object.is;if(n)Q=i,++gn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=Z.Mutable|Z.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Q=a,n&&(i.flags&=~Z.RecursedCheck),En(i)}}};return n?(i.flags=Z.Mutable|Z.Dirty,i.get=function(){let e=i.flags;if(e&Z.Dirty||e&Z.Pending&&bn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&xn(e)}}else e&Z.Pending&&(i.flags=e&~Z.Pending);return Q!==void 0&&_n(i,Q,gn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(yn(e),xn(e),Dn())}},i}function kn(e){let t=()=>{let t=Q;Q=n,++gn,n.depsTail=void 0,n.flags=Z.Watching|Z.RecursedCheck;try{return e()}finally{Q=t,n.flags&=~Z.RecursedCheck,En(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Z.Watching|Z.RecursedCheck,notify(){let e=this.flags;e&Z.Dirty||e&Z.Pending&&bn(this.deps,this)?t():this.flags=Z.Watching},stop(){this.flags=Z.None,this.depsTail=void 0,En(this)}};return t(),n}function An(e){return I({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function jn(e){let{select:t,...n}=e;return I({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Mn(e){return I({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Nn(e){return I({...e,select:t=>e.select?e.select(t.context):t.context})}var Pn=l();function Fn(e,t){let n=y(),r=p(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:h,resetScroll:g,viewTransition:v,children:b,target:x,disabled:S,style:C,className:w,onClick:E,onBlur:D,onFocus:ee,onMouseEnter:O,onMouseLeave:k,onTouchStart:te,ignoreBlocker:M,params:N,search:ne,hash:re,state:ie,mask:ae,reloadDocument:oe,unsafeRelative:P,from:se,_fromLocation:F,...ce}=e,I=dn(),le=Y.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),L=_(n.stores.location,e=>e,(e,t)=>e.href===t.href),R=Y.useMemo(()=>{let e={_fromLocation:L,...le};return n.buildLocation(e)},[n,L,le]),ue=R.maskedLocation?R.maskedLocation.publicHref:R.publicHref,de=R.maskedLocation?R.maskedLocation.external:R.external,fe=Y.useMemo(()=>Wn(ue,de,n.history,S),[S,de,ue,n.history]),pe=Y.useMemo(()=>{if(fe?.external)return T(fe.href,n.protocolAllowlist)?void 0:fe.href;if(!Gn(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),T(s,n.protocolAllowlist)?void 0:s}catch{}},[s,fe,n.protocolAllowlist]),me=Y.useMemo(()=>{if(pe)return!1;if(o?.exact){if(!Re(L.pathname,R.pathname,n.basepath))return!1}else{let e=Le(L.pathname,n.basepath),t=Le(R.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!A(L.search,R.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?I&&L.hash===R.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,L,pe,I,R.hash,R.pathname,R.search,n.basepath]),z=me?j(i,{})??Ln:In,B=me?In:j(a,{})??In,he=[w,z.className,B.className].filter(Boolean).join(` `),ge=(C||z.style||B.style)&&{...C,...z.style,...B.style},[_e,ve]=Y.useState(!1),ye=Y.useRef(!1),V=e.reloadDocument||pe?!1:c??n.options.defaultPreload,H=l??n.options.defaultPreloadDelay??0,U=Y.useCallback(()=>{n.preloadRoute({...le,_builtLocation:R}).catch(e=>{console.warn(e),console.warn(nn)})},[n,le,R]);m(r,Y.useCallback(e=>{e?.isIntersecting&&U()},[U]),Hn,{disabled:!!S||V!==`viewport`}),Y.useEffect(()=>{ye.current||!S&&V===`render`&&(U(),ye.current=!0)},[S,U,V]);let be=e=>{let t=e.currentTarget.getAttribute(`target`),r=x===void 0?t:x;if(!S&&!qn(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Pn.flushSync)(()=>{ve(!0)});let t=n.subscribe(`onResolved`,()=>{t(),ve(!1)});n.navigate({...le,replace:f,resetScroll:g,hashScrollIntoView:d,startTransition:h,viewTransition:v,ignoreBlocker:M})}};if(pe)return{...ce,ref:r,href:pe,...b&&{children:b},...x&&{target:x},...S&&{disabled:S},...C&&{style:C},...w&&{className:w},...E&&{onClick:E},...D&&{onBlur:D},...ee&&{onFocus:ee},...O&&{onMouseEnter:O},...k&&{onMouseLeave:k},...te&&{onTouchStart:te}};let xe=e=>{if(S||V!==`intent`)return;if(!H){U();return}let t=e.currentTarget;if(Vn.has(t))return;let n=setTimeout(()=>{Vn.delete(t),U()},H);Vn.set(t,n)},Se=e=>{S||V!==`intent`||U()},Ce=e=>{if(S||!V||!H)return;let t=e.currentTarget,n=Vn.get(t);n&&(clearTimeout(n),Vn.delete(t))};return{...ce,...z,...B,href:fe?.href,ref:r,onClick:Un([E,be]),onBlur:Un([D,Ce]),onFocus:Un([ee,xe]),onMouseEnter:Un([O,xe]),onMouseLeave:Un([k,Ce]),onTouchStart:Un([te,Se]),disabled:!!S,target:x,...ge&&{style:ge},...he&&{className:he},...S&&Rn,...me&&zn,...I&&_e&&Bn}}var In={},Ln={className:`active`},Rn={role:`link`,"aria-disabled":!0},zn={"data-status":`active`,"aria-current":`page`},Bn={"data-transitioning":`transitioning`},Vn=new WeakMap,Hn={rootMargin:`100px`},Un=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Wn(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Gn(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Kn=Y.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Fn(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return Y.createElement(`a`,t,o)}return Y.createElement(n,a,o)});function qn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Jn=class extends rn{constructor(e){super(e),this.useMatch=e=>I({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Nn({...e,from:this.id}),this.useSearch=e=>Mn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>E({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>jn({...e,from:this.id}),this.useLoaderData=e=>An({...e,from:this.id}),this.useNavigate=()=>h({from:this.fullPath}),this.Link=Y.forwardRef((e,t)=>(0,X.jsx)(Kn,{ref:t,from:this.fullPath,...e}))}};function Yn(e){return new Jn(e)}var Xn=class extends an{constructor(e){super(e),this.useMatch=e=>I({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Nn({...e,from:this.id}),this.useSearch=e=>Mn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>E({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>jn({...e,from:this.id}),this.useLoaderData=e=>An({...e,from:this.id}),this.useNavigate=()=>h({from:this.fullPath}),this.Link=Y.forwardRef((e,t)=>(0,X.jsx)(Kn,{ref:t,from:this.fullPath,...e}))}};function Zn(e){return new Xn(e)}function Qn(e){let t=y(),n=`not-found-${_(t.stores.location,e=>e.pathname)}-${_(t.stores.status,e=>e)}`;return(0,X.jsx)(sn,{getResetKey:()=>n,onCatch:(t,n)=>{if(G(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(G(t))return e.fallback?.(t);throw t},children:e.children})}function $n(){return(0,X.jsx)(`p`,{children:`Not Found`})}function er(e){return(0,X.jsx)(X.Fragment,{children:e.children})}function tr(e,t,n){return t.options.notFoundComponent?(0,X.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,X.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,X.jsx)($n,{})}var nr=Y.memo(function({matchId:e}){let t=y(),n=t.stores.matchStores.get(e);n||k();let r=_(t.stores.loadedAt,e=>e),i=_(n,e=>e);return(0,X.jsx)(rr,{router:t,matchId:e,resetKey:r,matchState:Y.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function rr({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,X.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?Y.Suspense:er,f=s?sn:er,p=l?Qn:er;return(0,X.jsxs)(i.isRoot?i.options.shellComponent??er:er,{children:[(0,X.jsx)(O.Provider,{value:t,children:(0,X.jsx)(d,{fallback:o,children:(0,X.jsx)(f,{getResetKey:()=>n,errorComponent:s||ln,onCatch:(e,t)=>{if(G(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,X.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return Y.createElement(l,e)},children:u||r._displayPending?(0,X.jsx)(un,{fallback:o,children:(0,X.jsx)(ar,{matchId:t})}):(0,X.jsx)(ar,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ir,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function ir({resetKey:e}){let t=y(),n=Y.useRef(void 0);return f(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...Gt(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var ar=Y.memo(function({matchId:e}){let t=y(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||k();let i=_(r,e=>e),a=i.routeId,o=t.routesById[a],s=Y.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=Y.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,X.jsx)(e,{},s):(0,X.jsx)(or,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=oe();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return G(i.error)||k(),tr(t,o,i.error);if(i.status===`redirected`)throw K(i.error)||k(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),or=Y.memo(function(){let e=y(),t=Y.useContext(O),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=_(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=_(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,X.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||k(),tr(e,a,void 0);if(!i)return null;let s=(0,X.jsx)(nr,{matchId:i});return n===`__root__`?(0,X.jsx)(Y.Suspense,{fallback:o,children:s}):s});function sr(){let e=y(),t=Y.useRef({router:e,mounted:!1}),[n,r]=Y.useState(!1),i=_(e.stores.isLoading,e=>e),a=_(e.stores.hasPending,e=>e),o=d(i),s=i||n||a,c=d(s),l=i||a,u=d(l);return e.startTransition=e=>{r(!0),Y.startTransition(()=>{e(),r(!1)})},Y.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return W(e.latestLocation.publicHref)!==W(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),f(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),f(()=>{o&&!i&&e.emit({type:`onLoad`,...Gt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),f(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...Gt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),f(()=>{if(c&&!s){let t=Gt(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),Tn(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())}),t.hrefChanged&&on(e)}},[s,c,e]),null}function cr(){let e=y(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,X.jsx)(t,{}):null,r=(0,X.jsxs)(typeof document<`u`&&e.ssr?er:Y.Suspense,{fallback:n,children:[(0,X.jsx)(sr,{}),(0,X.jsx)(lr,{})]});return e.options.InnerWrap?(0,X.jsx)(e.options.InnerWrap,{children:r}):r}function lr(){let e=y(),t=_(e.stores.firstId,e=>e),n=_(e.stores.loadedAt,e=>e),r=t?(0,X.jsx)(nr,{matchId:t}):null;return(0,X.jsx)(O.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,X.jsx)(sn,{getResetKey:()=>n,errorComponent:ln,onCatch:void 0,children:r})})}var ur=e=>({createMutableStore:On,createReadonlyStore:On,batch:Tn}),dr=e=>new fr(e),fr=class extends Kt{constructor(e){super(e,ur)}};function pr({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,X.jsx)(ee.Provider,{value:e,children:t});return e.options.Wrap?(0,X.jsx)(e.options.Wrap,{children:r}):r}function mr({router:e,...t}){return(0,X.jsx)(pr,{router:e,...t,children:(0,X.jsx)(cr,{})})}function hr(e){let t=y({warn:e?.router===void 0}),n=e?.router||t,r=(0,Y.useRef)(void 0);return _(n.stores.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=P(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var gr=class extends S{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),C(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&D(t.mutationKey)!==D(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??le();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ce.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function _r(e,t){let n=ae(t),[r]=Y.useState(()=>new gr(n,e));Y.useEffect(()=>{r.setOptions(e)},[r,e]);let i=Y.useSyncExternalStore(Y.useCallback(e=>r.subscribe(ce.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=Y.useCallback((e,t)=>{r.mutate(e,t).catch(ne)},[r]);if(i.error&&w(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var vr=u();function yr(e){let{apiKey:t,userId:n,businessId:r,environment:i}=e;return{queryKey:[`bootstrap`,i,t,n,r],enabled:!!(t&&n&&r),queryFn:async()=>{let e=await fetch(`/api/proxy/auth/bootstrap`,{headers:{"x-proxy-target":de[i],"X-API-KEY":t,"X-USER-ID":n,"X-BUSINESS-ID":r}});if(!e.ok)throw Error(`Bootstrap failed: ${String(e.status)} ${e.statusText}`);return e.json()},retry:!1}}function br(e){let{apiKey:t,userId:n,businessId:r,environment:i}=e;return{queryKey:[`businessPluginApps`,i,t,n,r],enabled:!!(t&&n&&r),queryFn:async()=>{let e=await fetch(`/api/proxy/external-integrations/business-plugin-apps`,{headers:{"x-proxy-target":de[i],"X-API-KEY":t,"X-USER-ID":n,"X-BUSINESS-ID":r}});if(!e.ok)throw Error(`businessPluginApps failed: ${String(e.status)} ${e.statusText}`);return e.json()},retry:!1}}function xr(){let e=ae(),[t,n]=(0,Y.useState)([]),[r,i]=(0,Y.useState)([]),[a,o]=(0,Y.useState)([]),[s,c]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{let t=window.location.protocol===`https:`?`wss:`:`ws:`,r=new WebSocket(`${t}//${window.location.host}`);return r.addEventListener(`message`,t=>{let r;try{r=JSON.parse(t.data)}catch{return}if(r.type===`rebuild`)e.invalidateQueries({queryKey:[`bundle`]});else if(r.type===`log`)n(e=>[...e,r.message]);else if(r.type===`proxy-log`){let e=r.entry??{kind:`info`,message:r.message??``};i(t=>[...t,e])}else if(r.type===`console-message`){let e=[`log`,`warn`,`error`,`info`].includes(r.level)?r.level:`log`;o(t=>[...t,{level:e,args:r.args}])}else c(r.credentials)}),()=>{r.close()}},[e]),{buildLogs:t,proxyLogs:r,consoleLogs:a,clearConsoleLogs:()=>{o([])},serverCredentials:s}}var Sr=`modulepreload`,Cr=function(e){return`/`+e},wr={},Tr=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Cr(t,n),t in wr)return;wr[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Sr,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Er=(0,Y.lazy)(()=>Tr(()=>import(`./DevSidebar-CsEdCTej.js`).then(e=>({default:e.DevSidebar})),__vite__mapDeps([0,1,2,3]))),Dr=window.open.bind(window),Or=416,kr=280,Ar=800,jr={apiKey:``,userId:``,businessId:``,environment:`go`},Mr=()=>{let{buildLogs:e,proxyLogs:t,consoleLogs:s,clearConsoleLogs:l,serverCredentials:u}=xr(),[d,f]=(0,Y.useState)(()=>localStorage.getItem(`devtools-sidebar-open`)===`true`),[p,m]=(0,Y.useState)(()=>localStorage.getItem(`kizen-flag-script-runner-logging`)===`true`),[g,_]=(0,Y.useState)(()=>{let e=parseInt(localStorage.getItem(`devtools-sidebar-width`)??``,10);return isNaN(e)?Or:Math.min(Ar,Math.max(kr,e))}),v=()=>{f(e=>{let t=!e;return localStorage.setItem(`devtools-sidebar-open`,String(t)),t})},y=()=>{m(e=>{let t=!e;return localStorage.setItem(`kizen-flag-script-runner-logging`,String(t)),t})},b=(0,Y.useCallback)(e=>{_(e),localStorage.setItem(`devtools-sidebar-width`,String(e))},[]),[x,S]=(0,Y.useState)(()=>{try{return{...jr,...JSON.parse(localStorage.getItem(`devtools-credentials`)??`{}`)}}catch{return jr}});(0,Y.useEffect)(()=>{fetch(`/api/credentials`).then(e=>e.json()).then(e=>{if(e.apiKey){let t={...jr,...e};S(t),localStorage.setItem(`devtools-credentials`,JSON.stringify(t))}}).catch(()=>{})},[]),(0,Y.useEffect)(()=>{if(!u)return;let e={...jr,...u};S(e),localStorage.setItem(`devtools-credentials`,JSON.stringify(e))},[u]);let C=e=>{S(e),localStorage.setItem(`devtools-credentials`,JSON.stringify(e))},{data:w,isLoading:T,isError:E}=re(se),{data:D,isError:ee,isLoading:O}=re(yr(x)),{data:k}=re(br(x)),te=ae(),A=_r({mutationFn:async({apiName:e,hasExistingEntry:t,nextDisabled:n})=>{let r={"x-proxy-target":de[x.environment],"X-API-KEY":x.apiKey,"X-USER-ID":x.userId,"X-BUSINESS-ID":x.businessId,"Content-Type":`application/json`},i=t?await fetch(`/api/proxy/external-integrations/business-plugin-apps/${e}`,{method:`PATCH`,headers:r,body:JSON.stringify({disabled:n})}):await fetch(`/api/proxy/external-integrations/business-plugin-apps`,{method:`POST`,headers:r,body:JSON.stringify({plugin_app_api_name:e,disabled:!1,config:{}})});if(!i.ok){let e=await i.text().catch(()=>``);throw Error(`${n?`uninstall`:`install`} failed: ${String(i.status)} ${i.statusText} ${e}`)}},onSuccess:async()=>{await fetch(`/api/proxy-cache/clear`).catch(()=>{}),await Promise.all([te.invalidateQueries({queryKey:[`bootstrap`]}),te.invalidateQueries({queryKey:[`businessPluginApps`]})])}}),j=h(),{location:M}=hr(),N=/^\/([^/]+)\/.+/.exec(M.pathname)?.[1],ne=/^\/[^/]+\/([^/]+)/.exec(M.pathname)?.[1];(0,Y.useEffect)(()=>{M.pathname!==`/`&&fetch(`/api/last-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:M.pathname})})},[M.pathname]);let ie=((N?w?.find(e=>e.api_name===N):void 0)?.artifacts.automation_action_configs.length??0)>0,oe=!!N&&!!w?.some(e=>e.api_name===N),P=N?k?.find(e=>e.plugin_app.api_name===N):void 0,F=!!P&&!P.disabled,ce=!!D&&!!k&&oe,I=A.isPending?F?`uninstalling…`:`installing…`:F?`Uninstall Plugin`:`Install Plugin`,le=A.isPending?`cursor-wait opacity-50`:``,L=T?`loading`:E?`error`:w?`loaded`:`empty`,me=O?`authenticating`:ee?`auth error`:D?`authenticated`:`no auth`,z=T?`bg-neutral-100 text-neutral-400`:E?`bg-red-100 text-red-700`:w?`bg-green-100 text-green-700`:`bg-yellow-100 text-yellow-700`,B=O?`bg-neutral-100 text-neutral-400`:ee?`bg-red-100 text-red-700`:D?`bg-green-100 text-green-700`:`bg-yellow-100 text-yellow-700`;return(0,X.jsx)(ue.Provider,{value:x,children:(0,X.jsx)(pe.Provider,{value:d?g:0,children:(0,X.jsx)(R.Provider,{value:D,children:(0,X.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden font-mono`,children:[(0,X.jsxs)(`div`,{className:`sticky top-0 z-10 flex items-center gap-3 border-b border-black/10 bg-white/85 px-5 py-3 backdrop-blur-sm`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`img`,{src:`/mark.svg`,alt:`Kizen`,className:`h-5 w-5`}),(0,X.jsx)(`span`,{className:`text-[13px] font-bold tracking-tight text-neutral-900 pl-2`,children:`Kizen App Development Toolkit`})]}),w&&w.length>0&&(0,X.jsx)(`select`,{value:N??``,onChange:e=>void j({to:`/$apiName/summary`,params:{apiName:e.target.value}}),className:`rounded border border-black/10 bg-transparent px-2 py-0.5 text-[13px] font-mono text-neutral-700 focus:outline-none`,children:w.map(e=>{let t=e.api_name;return(0,X.jsx)(`option`,{value:t,children:e.name??t},t)})}),ne&&N&&(0,X.jsxs)(`select`,{value:ne,onChange:e=>void j({to:`/${N}/${e.target.value}`}),className:`rounded border border-black/10 bg-transparent px-2 py-0.5 text-[13px] font-mono text-neutral-700 focus:outline-none`,children:[(0,X.jsx)(`option`,{value:`summary`,children:`Summary`}),(0,X.jsx)(`option`,{value:`sandbox`,children:`Sandbox`}),(0,X.jsx)(`option`,{value:`configuration`,children:`Configuration`}),ie&&(0,X.jsx)(`option`,{value:`code-steps`,children:`Code Steps`}),(0,X.jsx)(`option`,{value:`versions`,children:`Versions`}),(0,X.jsx)(`option`,{value:`icons`,children:`Icon Reference`})]}),(0,X.jsx)(`div`,{className:`flex-1`}),(0,X.jsxs)(`button`,{onClick:()=>{window.location.reload()},className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Refresh page`,children:[(0,X.jsx)(c,{icon:i}),(0,X.jsx)(`span`,{children:`Refresh`})]}),(0,X.jsxs)(`button`,{onClick:()=>{Dr(fe[x.environment],`_blank`,`noopener,height=900`)},className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Open Kizen`,children:[(0,X.jsx)(c,{icon:n}),(0,X.jsx)(`span`,{children:`Open Kizen`})]}),(0,X.jsxs)(`button`,{onClick:y,className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Toggle script runner debug logging`,children:[(0,X.jsx)(c,{icon:o}),(0,X.jsx)(`span`,{children:`Script Runner Logging`}),(0,X.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${p?`bg-green-500`:`bg-neutral-300`}`})]}),(0,X.jsxs)(`button`,{onClick:v,className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Toggle dev tools`,children:[(0,X.jsx)(c,{icon:r}),(0,X.jsx)(`span`,{children:`DevTools`}),(0,X.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${d?`bg-green-500`:`bg-neutral-300`}`})]}),ce&&N&&(0,X.jsxs)(`button`,{type:`button`,disabled:A.isPending,onClick:()=>{A.mutate({apiName:N,hasExistingEntry:!!P,nextDisabled:F})},className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 transition-colors hover:border-black/20 hover:text-neutral-800 ${le}`,"aria-label":I,children:[(0,X.jsx)(c,{icon:a}),(0,X.jsx)(`span`,{children:I}),(0,X.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${F?`bg-green-500`:`bg-neutral-300`}`})]}),(0,X.jsx)(`span`,{className:`rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide ${z}`,children:L}),(0,X.jsx)(`span`,{className:`rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide ${B}`,children:me})]}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,X.jsx)(`div`,{className:`flex-1 overflow-y-auto p-6`,style:{backgroundImage:`
|
|
3
|
-
linear-gradient(rgba(0,0,0,0.025) 1px, transparent 1px),
|
|
4
|
-
linear-gradient(90deg, rgba(0,0,0,0.025) 1px, transparent 1px)
|
|
5
|
-
`,backgroundSize:`24px 24px`},children:(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(or,{})})}),d&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Er,{onClose:v,buildLogs:e,proxyLogs:t,consoleLogs:s,onClearConsole:()=>{l()},credentials:x,onCredentialsChange:C,width:g,onWidthChange:b})})]})]})})})})},Nr=()=>{let{data:e,isLoading:t,isError:n}=re(se),r=h();return(0,Y.useEffect)(()=>{e&&e.length>0&&r({to:`/$apiName/summary`,params:{apiName:e[0]?.api_name}})},[e,r]),t?(0,X.jsx)(me,{children:(0,X.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-400`,children:`Fetching bundle.json…`})}):n?(0,X.jsx)(me,{children:(0,X.jsx)(`p`,{className:`m-0 text-[13px] text-red-700`,children:`Could not load bundle.json. Make sure the dev server is running from a plugin directory.`})}):!e||e.length===0?(0,X.jsx)(me,{children:(0,X.jsxs)(`p`,{className:`m-0 text-[13px] text-yellow-700`,children:[`bundle.json is empty. Run`,` `,(0,X.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 py-0.5`,children:`appbuilder build`}),` to generate it.`]})}):null},Pr=(0,Y.lazy)(()=>Tr(()=>import(`./AppDetailPage-r3jzO9Kf.js`).then(e=>({default:e.AppDetailPage})),__vite__mapDeps([4,2,1,5,6,7,8]))),Fr=(0,Y.lazy)(()=>Tr(()=>import(`./SandboxPage-C0h7GUkw.js`).then(e=>({default:e.SandboxPage})),__vite__mapDeps([9,1,2,10,5,11,12,13,3,14,6,15,7,8]))),Ir=(0,Y.lazy)(()=>Tr(()=>import(`./ConfigurationPage-DmX-6MM-.js`).then(e=>({default:e.ConfigurationPage})),__vite__mapDeps([16,1,2,10,5,11,12,13,3,6]))),Lr=(0,Y.lazy)(()=>Tr(()=>import(`./VersionsPage-B76eugMm.js`).then(e=>({default:e.VersionsPage})),__vite__mapDeps([17,1,2,5,6]))),Rr=(0,Y.lazy)(()=>Tr(()=>import(`./IconReferencePage-CJa9yg9Z.js`).then(e=>({default:e.IconReferencePage})),__vite__mapDeps([18,2,1,6,7,8]))),zr=(0,Y.lazy)(()=>Tr(()=>import(`./CodeStepsPage-Zj6DscGd.js`).then(e=>({default:e.CodeStepsPage})),__vite__mapDeps([19,1,2,5,20,3,13,6,15,21]))),$=Zn({component:Mr}),Br=Yn({getParentRoute:()=>$,path:`/`,component:Nr}),Vr=Yn({getParentRoute:()=>$,path:`/$apiName/summary`,component:Pr}),Hr=Yn({getParentRoute:()=>$,path:`/$apiName/sandbox`,component:Fr}),Ur=Yn({getParentRoute:()=>$,path:`/$apiName/configuration`,component:Ir}),Wr=Yn({getParentRoute:()=>$,path:`/$apiName/versions`,component:Lr}),Gr=Yn({getParentRoute:()=>$,path:`/$apiName/icons`,component:Rr}),Kr=Yn({getParentRoute:()=>$,path:`/$apiName/code-steps`,component:zr}),qr=Yn({getParentRoute:()=>$,path:`/$apiName/code-steps/$stepApiName`,component:zr}),Jr=dr({routeTree:$.addChildren([Br,Vr,Hr,Ur,Wr,Gr,Kr,qr])}),Yr=document.getElementById(`root`),Xr=new L;if(Yr===null)throw Error(`Root element not found`);(0,vr.createRoot)(Yr).render((0,X.jsx)(Y.StrictMode,{children:(0,X.jsx)(N,{client:Xr,children:(0,X.jsx)(mr,{router:Jr})})}));
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DevSidebar-BhTD2bBO.js","assets/rolldown-runtime-DF2fYuay.js","assets/fa-core-wsCxaNB7.js","assets/CredentialsContext-zl2e9kpM.js","assets/AppDetailPage-DIuYKCTQ.js","assets/bundleQuery-L4H4wq5q.js","assets/Card-DMz6T3VL.js","assets/validIcons-UmfwFGTT.js","assets/fa-pro-icons-Dzkwxnip.js","assets/SandboxPage-GDcydJnJ.js","assets/useObjectLookups-CslM2vSA.js","assets/BootstrapContext-DbnbWmQT.js","assets/react-CyWK9rg5.js","assets/SidebarContext-DVDXFWJI.js","assets/useLocalStorage-BlZWItfY.js","assets/ConfigurationPage-Cjy9TH3N.js","assets/VersionsPage-D0qenxK5.js","assets/IconReferencePage-B6j9wlte.js","assets/CodeStepsPage-CD_MhDwY.js","assets/useNavigate-9J1ZzN1J.js","assets/CodeStepsPage-DdKuH37F.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{b as t,c as n,g as r,m as i,p as a,t as o,x as s,y as c}from"./fa-core-wsCxaNB7.js";import{n as l,t as u}from"./react-CyWK9rg5.js";import{a as d,i as f,n as p,r as m,t as h}from"./useNavigate-9J1ZzN1J.js";import{$ as g,B as _,G as v,H as y,J as b,K as x,L as S,N as C,P as w,Q as T,R as E,T as D,U as ee,V as O,W as k,X as te,Y as A,Z as j,et as M,f as N,k as ne,n as re,nt as ie,p as ae,q as oe,rt as se,t as ce,tt as P,y as le,z as F}from"./bundleQuery-L4H4wq5q.js";import{i as I,o as L,r as R,s as ue,t as de}from"./BootstrapContext-DbnbWmQT.js";import{t as fe}from"./CredentialsContext-zl2e9kpM.js";import{t as pe}from"./SidebarContext-DVDXFWJI.js";import{t as me}from"./Card-DMz6T3VL.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function z(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var B=4,he=5;function ge(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function _e(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=ge(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function ve(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;s<o;){let e=_e(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=H(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=H(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=U(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=U(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=U(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=H(n.fullPath??n.from);e.kind=he,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=H(n.fullPath??n.from);e.kind=B,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=n.options?.params?.parse??null,i.skipOnParamError=l,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)ve(e,t,r,s,i,a,o)}function ye(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function V(e){if(e.pathless)for(let t of e.pathless)V(t);if(e.static)for(let t of e.static.values())V(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())V(t);if(e.dynamic?.length){e.dynamic.sort(ye);for(let t of e.dynamic)V(t)}if(e.optional?.length){e.optional.sort(ye);for(let t of e.optional)V(t)}if(e.wildcard?.length){e.wildcard.sort(ye);for(let t of e.wildcard)V(t)}}function H(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function U(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function be(e,t){let n=H(`/`),r=new Uint16Array(6);for(let t of e)ve(!1,r,t,1,n,0);V(n),t.masksTree=n,t.flatCache=z(1e3)}function xe(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Ee(e,t.masksTree);return t.flatCache.set(e,r),r}function Se(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=H(`/`),ve(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Ee(r,o,n)}function Ce(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Ee(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Oe(a.route)),t.matchCache.set(r,a),a}function we(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Te(e,t=!1,n){let r=H(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return ve(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&k(),a[e.id]=e,s!==0&&e.path){let t=we(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),V(r),{processedTree:{segmentTree:r,singleCache:z(1e3),matchCache:z(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Ee(e,t,n=!1){let r=e.split(`/`),i=Ae(e,r,t,n);if(!i)return null;let[a]=De(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function De(e,t,n){let r=ke(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===B)break;if(u.kind===he){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Oe(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function ke(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Ae(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!P(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:d,skipped:f,depth:p,statics:m,dynamics:h,optionals:g}=n,{extract:_,rawParams:v,parsedParams:y}=n;if(i.skipOnParamError){if(!je(e,t,n))continue;v=n.rawParams,_=n.extract,y=n.parsedParams}r&&i.route&&i.kind!==B&&Me(l,n)&&(l=n);let b=d===o;if(b&&(i.route&&!a&&Me(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let x=b?void 0:t[d],S;if(b&&i.index){let n={node:i.index,index:d,skipped:f,depth:p+1,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y},r=!0;if(i.index.skipOnParamError&&(je(e,t,n)||(r=!1)),r){if(m===o&&!h&&!g&&!f)return n;Me(u,n)&&(u=n)}}if(i.wildcard&&Me(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r&&(b||!(n.caseSensitive?x:S??=x.toLowerCase()).startsWith(r)))continue;if(i){if(b)continue;let e=t.slice(d).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:f,depth:p,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(!(n.skipOnParamError&&!je(e,t,a))){c=a;break}}if(i.optional){let e=f|1<<p,t=p+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:d,skipped:e,depth:t,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?x:S??=x.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:d+1,skipped:f,depth:t,statics:m,dynamics:h,optionals:g+1,extract:_,rawParams:v,parsedParams:y})}}if(!b&&i.dynamic&&x)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?x:S??=x.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:d+1,skipped:f,depth:p+1,statics:m,dynamics:h+1,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.staticInsensitive){let e=i.staticInsensitive.get(S??=x.toLowerCase());e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.static){let e=i.static.get(x);e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(i.pathless){let e=p+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:d,skipped:f,depth:e,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}}}if(u&&c)return Me(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function je(e,t,n){try{let[r,i]=De(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function Me(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===B)>(e.node.kind===B)||t.node.kind===B==(e.node.kind===B)&&t.depth>e.depth))):!0}function Ne(e){return Pe(e.filter(e=>e!==void 0).join(`/`))}function Pe(e){return e.replace(/\/{2,}/g,`/`)}function Fe(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function W(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Ie(e){return W(Fe(e))}function Le(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Re(e,t,n){return Le(e,n)===Le(t,n)}function ze({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&P(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(P(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=_e(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=Pe(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function Be(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Ve(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ue(e,n)).join(`/`):Ue(r,n):r}function He({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=_e(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Ve(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ve(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ve(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Ue(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function G(e){return e?.isNotFound===!0}function We(){try{return typeof window<`u`&&typeof window.sessionStorage==`object`?window.sessionStorage:void 0}catch{return}}var Ge=`tsr-scroll-restoration-v1_3`;function Ke(){let e=We();if(!e)return null;let t={};try{let n=JSON.parse(e.getItem(`tsr-scroll-restoration-v1_3`)||`{}`);g(n)&&(t=n)}catch{}return{get state(){return t},set:e=>{t=j(e,t)||t},persist:()=>{try{e.setItem(Ge,JSON.stringify(t))}catch{}}}}var qe=Ke(),Je=e=>e.state.__TSR_key||e.href;function Ye(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var Xe=!1,Ze=`window`,Qe=`data-scroll-restoration-id`;function $e(e,t){if(!qe)return;let n=qe;if((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,Xe=!1;let r=e.options.getScrollRestorationKey||Je,i=new Map;window.history.scrollRestoration=`manual`;let a=t=>{if(!(Xe||!e.isScrollRestoring))if(t.target===document||t.target===window)i.set(Ze,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{let e=t.target;i.set(e,{scrollX:e.scrollLeft||0,scrollY:e.scrollTop||0})}},o=t=>{if(!e.isScrollRestoring||!t||i.size===0||!n)return;let r=n.state[t]||={};for(let[e,t]of i){let n;if(e===Ze)n=Ze;else if(e.isConnected){let t=e.getAttribute(Qe);n=t?`[${Qe}="${t}"]`:Ye(e)}n&&(r[n]=t)}};document.addEventListener(`scroll`,a,!0),e.subscribe(`onBeforeLoad`,e=>{o(e.fromLocation?r(e.fromLocation):void 0),i.clear()}),window.addEventListener(`pagehide`,()=>{o(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe(`onRendered`,t=>{let a=r(t.toLocation),o=e.options.scrollRestorationBehavior,s=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))){Xe=!0;try{let t=e.isScrollRestoring?n.state[a]:void 0,r=!1;if(t)for(let e in t){let n=t[e];if(!g(n))continue;let{scrollX:i,scrollY:a}=n;if(!(!Number.isFinite(i)||!Number.isFinite(a))){if(e===Ze)window.scrollTo({top:a,left:i,behavior:o}),r=!0;else if(e){let t;try{t=document.querySelector(e)}catch{continue}t&&(t.scrollLeft=i,t.scrollTop=a,r=!0)}}}if(!r){let t=e.history.location.hash.slice(1);if(t){let e=window.history.state?.__hashScrollIntoViewOptions??!0;if(e){let n=document.getElementById(t);n&&n.scrollIntoView(e)}}else{let e={top:0,left:0,behavior:o};if(window.scrollTo(e),s)for(let t of s){if(t===Ze)continue;let n=typeof t==`function`?t():document.querySelector(t);n&&n.scrollTo(e)}}}}finally{Xe=!1}e.isScrollRestoring&&n.set(e=>(e[a]||={},e))}})}function et(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function tt(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function nt(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=tt(r):Array.isArray(t)?t.push(tt(r)):n[e]=[t,tt(r)]}return n}var rt=at(JSON.parse),it=ot(JSON.stringify,JSON.parse);function at(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=nt(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function ot(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=et(e,r);return t?`?${t}`:``}}var st=`__root__`;function ct(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function K(e){return e instanceof Response&&!!e.options}function lt(e){return{input:({url:t})=>{for(let n of e)t=dt(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=ft(e[n],t);return t}}}function ut(e){let t=Ie(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Ne([`/`,t,e.pathname]),e)}}function dt(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function ft(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function pt(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>mt(o,_.get())),x=r(()=>mt(s,v.get())),S=r(()=>mt(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=z(64);function ee(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let O={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:ee,setMatches:k,setPending:te,setCached:A};k(e.matches),a?.(O);function k(e){ht(e,o,_,n,i)}function te(e){ht(e,s,v,n,i)}function A(e){ht(e,c,y,n,i)}return O}function mt(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function ht(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}x(n.get(),a)||n.set(a)})}var gt=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},_t=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),vt=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),yt=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},bt=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},q=(e,t,n)=>{if(!(!K(n)&&!G(n)))throw K(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:K(n)?`redirected`:G(n)?`notFound`:r.status===`pending`?`success`:r.status,context:yt(e,t.index),isFetching:!1,error:n})),G(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),K(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},xt=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},St=(e,t,n)=>{let r=yt(e,n);e.updateMatch(t,e=>({...e,context:r}))},Ct=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,q(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,q(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!K(n)&&!G(n)&&(e.serialError??=n)},wt=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!vt(e,t)&&(n.options.loader||n.options.beforeLoad||Ft(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{gt(e)},i);r._nonReactive.pendingTimeout=t}},Tt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;wt(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&q(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},Et=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=oe(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Ct(e,n,o,`PARSE_PARAMS`),s&&Ct(e,n,s,`VALIDATE_SEARCH`),wt(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=oe();let f={...yt(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=vt(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(K(r)||G(r))&&(u(),Ct(e,n,r,`BEFORE_LOAD`)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),M(y))return u(),y.catch(t=>{Ct(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),Ct(e,n,t,`BEFORE_LOAD`)}v(y)},Dt=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>Et(e,n,t,i),s=()=>{if(xt(e,n))return;let t=Tt(e,n,i);return M(t)?t.then(o):o()};return a()},Ot=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},kt=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=yt(e,r),d=vt(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},At=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{Pt(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(kt(e,t,n,r,i)),l=!!s&&M(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;q(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:yt(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:yt(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,G(t)&&await i.options.notFoundComponent?.preload?.(),q(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,q(e,e.router.getMatch(n),t)}!K(o)&&!G(o)&&await Pt(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:yt(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),q(e,r,t)}},jt=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(kt(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await At(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){K(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await At(e,t,i,n,d):St(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(xt(e,i)){if(!e.router.getMatch(i))return e.matches[n];St(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=vt(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&q(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=oe(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function Mt(e){let t=e,n=[];_t(t.router)&>(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=Dt(t,e);M(n)&&await n}catch(e){if(K(e))throw e;if(G(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?bt(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(jt(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(K(e))throw e;G(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=bt(t,l);e===void 0&&k();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await Pt(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Pt(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Ot(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=gt(t);if(M(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Nt(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Pt(e,t=It){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===It?(()=>{if(e._componentsPromise===void 0){let t=Nt(e,It);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Nt(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Ft(e){for(let t of It)if(e.options[t]?.preload)return!0;return!1}var It=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],J=`__TSR_index`,Lt=`popstate`,Rt=`beforeunload`;function zt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Ut(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[J];i=Bt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[J];i=Bt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[J]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Bt(e,t){t||={};let n=Wt();return{...t,key:n,__TSR_key:n,[J]:e}}function Vt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Ut(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Wt();t.history.replaceState({[J]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Ut(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[J]-l.state[J],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=zt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Rt,S,{capture:!0}),t.removeEventListener(Lt,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Rt,S,{capture:!0}),t.addEventListener(Lt,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Ht(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Ut(e,t){let n=Ht(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Wt();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[J]:0,key:a,__TSR_key:a}}}function Wt(){return(Math.random()+1).toString(36).substring(7)}function Gt(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Kt=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Be(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Vt()),this.origin=this.options.origin,this.origin||(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 e;this.resolvePathCache=z(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=pt(Yt(this.latestLocation),e),$e(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=Ie(o);t&&t!==`/`&&e.push(ut({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:lt(e),this.history&&this.updateLatestLocation(),a=!0}a&&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 e=Te(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&be(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:b(e).path,external:!1,searchStr:o,search:ie(t?.search,i),hash:b(r.slice(1)).path,state:se(t?.state,a)}}let o=new URL(i,this.origin),s=dt(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:b(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:ie(t?.search,c),hash:b(s.hash.slice(1)).path,state:se(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>ze({base:e,to:Pe(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Zt({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,s=Object.assign(Object.create(null),r.params),c=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),l=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,j(t.params,s)),u=this.getMatchedRoutes(c),d=u.matchedRoutes;if((!u.foundRoute||u.foundRoute.path!==`/`&&u.routeParams[`**`])&&this.options.notFoundRoute&&(d=[...d,this.options.notFoundRoute]),Object.keys(l).length>0)for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(l,t(l))}catch{}}let f=e.leaveParams?c:b(He({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,p=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Xt(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=Qt({search:p,dest:t,destRoutes:d,_includeValidateSearch:e._includeValidateSearch}),p=ie(o,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?j(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?j(t.state,n.state):{};_=se(n.state,_);let v=`${f}${m}${g}`,y,x,S=!1;if(this.rewrite){let e=new URL(v,this.origin),t=ft(this.rewrite,e);y=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else y=te(v),x=y;return{publicHref:x,href:y,pathname:f,search:p,searchStr:m,state:_,hash:h??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=xe(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,j(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=A(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=W(this.latestLocation.href)===W(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=oe(()=>{a?.resolve(),a=void 0}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Ut(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=dt(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(T(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.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(e),this.stores.setCached(t)})},this.load=async e=>{let t,n,r,i=this.stores.resolvedLocation.get()??this.stores.location.get();for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=Gt(t,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...n}),this.emit({type:`onBeforeLoad`,...n}),await Mt({router:this,sync:e?.sync,forceStaleReload:i.href===t.href,matches:this.stores.pendingMatches.get(),location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){K(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):G(e)&&(n=e);let r=t?t.status:n?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(r),this.stores.redirect.set(t)})}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(e=>e.status===`error`)&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Gt(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&T(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=Pt,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await Mt({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(K(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});G(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=Se(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!A(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?A(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??it,parseSearch:e.parseSearch??rt,protocolAllowlist:e.protocolAllowlist??v}),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:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:W(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?en(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map;for(let e of this.stores.matchStores.values())e.routeId&&u.set(e.routeId,e.get());for(let n=0;n<o.length;n++){let r=o[n],s=l[n-1],d,f,p;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=Xt(r.options.validateSearch,{...n})??void 0;d={...n,...e},f={...i,...e},p=void 0}catch(e){let r=e;if(e instanceof qt||(r=new qt(e.message,{cause:e})),t?.throwOnError)throw r;d=n,f={},p=r}}let m=r.options.loaderDeps?.({search:d})??``,h=m?JSON.stringify(m):``,{interpolatedPath:g,usedParams:_}=He({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),v=r.id+g+h,y=this.getMatch(v),b=u.get(r.id),x=y?._strictParams??_,S;if(!y)try{tn(r,_,a,x)}catch(e){if(S=G(e)||K(e)?e:new Jt(e.message,{cause:e}),t?.throwOnError)throw S}Object.assign(i,x);let C=b?`stay`:`enter`,w;if(y)w={...y,cause:C,params:b?.params??i,_strictParams:x,search:ie(b?b.search:y.search,d),_strictSearch:f};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Ft(r)?`pending`:`success`;w={id:v,ssr:r.options.ssr,index:n,routeId:r.id,params:b?.params??i,_strictParams:x,pathname:g,updatedAt:Date.now(),search:b?ie(b.search,d):d,_strictSearch:f,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:S,__routeContext:void 0,_nonReactive:{loadPromise:oe()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:b?se(b.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(w.globalNotFound=c===r.id),w.searchError=p;let T=this.getParentContext(s);w.context={...T,...w.__routeContext,...w.__beforeLoadContext},l[n]=w}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?ie(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=P(t),a={...e.search};for(let e of t)try{Object.assign(a,Xt(e.options.validateSearch,a))}catch{}let o=P(this.stores.matchesId.get()),s=o&&this.stores.matchStores.get(o)?.get(),c=s&&s.routeId===i.id&&s.pathname===e.pathname,l;if(c)l=s.params;else{let e=Object.assign(Object.create(null),n);for(let i of t)try{tn(i,n,r??{},e)}catch{}l=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:l}}},qt=class extends Error{},Jt=class extends Error{};function Yt(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Xt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new qt(`Async validation not supported`);if(n.issues)throw new qt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Zt({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=W(e),a,o,s=Ce(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign(Object.create(null),s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function Qt({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return $t(n)(e,t,r??!1)}function $t(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...Xt(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:j(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function en(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return st}function tn(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}var nn=`Error preloading route! ☝️`,rn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=st:this.parentRoute||k();let r=n?st:t?.path;r&&r!==`/`&&(r=Fe(r));let i=t?.id||r,a=n?st:Ne([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Ne([`/`,a]));let o=a===`__root__`?`/`:Ne([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=W(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(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=>ct({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},an=class extends rn{constructor(e){super(e)}};function on(e){if(typeof document<`u`&&document.querySelector){let t=e.stores.location.get(),n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==``){let e=document.getElementById(t.hash);e&&e.scrollIntoView(n)}}}var Y=e(s(),1),X=t();function sn(e){let t=e.errorComponent??ln;return(0,X.jsx)(cn,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?Y.createElement(t,{error:n,reset:r}):e.children})}var cn=class extends Y.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function ln({error:e}){let[t,n]=Y.useState(!1);return(0,X.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,X.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,X.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,X.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,X.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,X.jsx)(`div`,{children:(0,X.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,X.jsx)(`code`,{children:e.message}):null})}):null]})}function un({children:e,fallback:t=null}){return dn()?(0,X.jsx)(Y.Fragment,{children:e}):(0,X.jsx)(Y.Fragment,{children:t})}function dn(){return Y.useSyncExternalStore(fn,()=>!0,()=>!1)}function fn(){return()=>{}}var Z=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(Z||{});function pn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function mn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var hn=[],gn=0,{link:_n,unlink:vn,propagate:yn,checkDirty:bn,shallowPropagate:xn}=pn({update(e){return e._update()},notify(e){hn[Cn++]=e,e.flags&=~Z.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Z.Mutable|Z.Dirty,En(e))}}),Sn=0,Cn=0,Q,wn=0;function Tn(e){try{++wn,e()}finally{--wn||Dn()}}function En(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=vn(n,e)}function Dn(){if(!(wn>0)){for(;Sn<Cn;){let e=hn[Sn];hn[Sn++]=void 0,e.notify()}Sn=0,Cn=0}}function On(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Z.None:Z.Mutable,get(){return Q!==void 0&&_n(i,Q,gn),i._snapshot},subscribe(e){let t=mn(e),n={current:!1},r=kn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Q,o=t?.compare??Object.is;if(n)Q=i,++gn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=Z.Mutable|Z.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Q=a,n&&(i.flags&=~Z.RecursedCheck),En(i)}}};return n?(i.flags=Z.Mutable|Z.Dirty,i.get=function(){let e=i.flags;if(e&Z.Dirty||e&Z.Pending&&bn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&xn(e)}}else e&Z.Pending&&(i.flags=e&~Z.Pending);return Q!==void 0&&_n(i,Q,gn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(yn(e),xn(e),Dn())}},i}function kn(e){let t=()=>{let t=Q;Q=n,++gn,n.depsTail=void 0,n.flags=Z.Watching|Z.RecursedCheck;try{return e()}finally{Q=t,n.flags&=~Z.RecursedCheck,En(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Z.Watching|Z.RecursedCheck,notify(){let e=this.flags;e&Z.Dirty||e&Z.Pending&&bn(this.deps,this)?t():this.flags=Z.Watching},stop(){this.flags=Z.None,this.depsTail=void 0,En(this)}};return t(),n}function An(e){return F({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function jn(e){let{select:t,...n}=e;return F({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Mn(e){return F({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Nn(e){return F({...e,select:t=>e.select?e.select(t.context):t.context})}var Pn=l();function Fn(e,t){let n=y(),r=p(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:h,resetScroll:g,viewTransition:v,children:b,target:x,disabled:S,style:C,className:w,onClick:E,onBlur:D,onFocus:ee,onMouseEnter:O,onMouseLeave:k,onTouchStart:te,ignoreBlocker:M,params:N,search:ne,hash:re,state:ie,mask:ae,reloadDocument:oe,unsafeRelative:se,from:ce,_fromLocation:P,...le}=e,F=dn(),I=Y.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),L=_(n.stores.location,e=>e,(e,t)=>e.href===t.href),R=Y.useMemo(()=>{let e={_fromLocation:L,...I};return n.buildLocation(e)},[n,L,I]),ue=R.maskedLocation?R.maskedLocation.publicHref:R.publicHref,de=R.maskedLocation?R.maskedLocation.external:R.external,fe=Y.useMemo(()=>Wn(ue,de,n.history,S),[S,de,ue,n.history]),pe=Y.useMemo(()=>{if(fe?.external)return T(fe.href,n.protocolAllowlist)?void 0:fe.href;if(!Gn(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),T(s,n.protocolAllowlist)?void 0:s}catch{}},[s,fe,n.protocolAllowlist]),me=Y.useMemo(()=>{if(pe)return!1;if(o?.exact){if(!Re(L.pathname,R.pathname,n.basepath))return!1}else{let e=Le(L.pathname,n.basepath),t=Le(R.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!A(L.search,R.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?F&&L.hash===R.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,L,pe,F,R.hash,R.pathname,R.search,n.basepath]),z=me?j(i,{})??Ln:In,B=me?In:j(a,{})??In,he=[w,z.className,B.className].filter(Boolean).join(` `),ge=(C||z.style||B.style)&&{...C,...z.style,...B.style},[_e,ve]=Y.useState(!1),ye=Y.useRef(!1),V=e.reloadDocument||pe?!1:c??n.options.defaultPreload,H=l??n.options.defaultPreloadDelay??0,U=Y.useCallback(()=>{n.preloadRoute({...I,_builtLocation:R}).catch(e=>{console.warn(e),console.warn(nn)})},[n,I,R]);m(r,Y.useCallback(e=>{e?.isIntersecting&&U()},[U]),Hn,{disabled:!!S||V!==`viewport`}),Y.useEffect(()=>{ye.current||!S&&V===`render`&&(U(),ye.current=!0)},[S,U,V]);let be=e=>{let t=e.currentTarget.getAttribute(`target`),r=x===void 0?t:x;if(!S&&!qn(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Pn.flushSync)(()=>{ve(!0)});let t=n.subscribe(`onResolved`,()=>{t(),ve(!1)});n.navigate({...I,replace:f,resetScroll:g,hashScrollIntoView:d,startTransition:h,viewTransition:v,ignoreBlocker:M})}};if(pe)return{...le,ref:r,href:pe,...b&&{children:b},...x&&{target:x},...S&&{disabled:S},...C&&{style:C},...w&&{className:w},...E&&{onClick:E},...D&&{onBlur:D},...ee&&{onFocus:ee},...O&&{onMouseEnter:O},...k&&{onMouseLeave:k},...te&&{onTouchStart:te}};let xe=e=>{if(S||V!==`intent`)return;if(!H){U();return}let t=e.currentTarget;if(Vn.has(t))return;let n=setTimeout(()=>{Vn.delete(t),U()},H);Vn.set(t,n)},Se=e=>{S||V!==`intent`||U()},Ce=e=>{if(S||!V||!H)return;let t=e.currentTarget,n=Vn.get(t);n&&(clearTimeout(n),Vn.delete(t))};return{...le,...z,...B,href:fe?.href,ref:r,onClick:Un([E,be]),onBlur:Un([D,Ce]),onFocus:Un([ee,xe]),onMouseEnter:Un([O,xe]),onMouseLeave:Un([k,Ce]),onTouchStart:Un([te,Se]),disabled:!!S,target:x,...ge&&{style:ge},...he&&{className:he},...S&&Rn,...me&&zn,...F&&_e&&Bn}}var In={},Ln={className:`active`},Rn={role:`link`,"aria-disabled":!0},zn={"data-status":`active`,"aria-current":`page`},Bn={"data-transitioning":`transitioning`},Vn=new WeakMap,Hn={rootMargin:`100px`},Un=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Wn(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Gn(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Kn=Y.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Fn(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return Y.createElement(`a`,t,o)}return Y.createElement(n,a,o)});function qn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Jn=class extends rn{constructor(e){super(e),this.useMatch=e=>F({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Nn({...e,from:this.id}),this.useSearch=e=>Mn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>E({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>jn({...e,from:this.id}),this.useLoaderData=e=>An({...e,from:this.id}),this.useNavigate=()=>h({from:this.fullPath}),this.Link=Y.forwardRef((e,t)=>(0,X.jsx)(Kn,{ref:t,from:this.fullPath,...e}))}};function Yn(e){return new Jn(e)}var Xn=class extends an{constructor(e){super(e),this.useMatch=e=>F({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Nn({...e,from:this.id}),this.useSearch=e=>Mn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>E({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>jn({...e,from:this.id}),this.useLoaderData=e=>An({...e,from:this.id}),this.useNavigate=()=>h({from:this.fullPath}),this.Link=Y.forwardRef((e,t)=>(0,X.jsx)(Kn,{ref:t,from:this.fullPath,...e}))}};function Zn(e){return new Xn(e)}function Qn(e){let t=y(),n=`not-found-${_(t.stores.location,e=>e.pathname)}-${_(t.stores.status,e=>e)}`;return(0,X.jsx)(sn,{getResetKey:()=>n,onCatch:(t,n)=>{if(G(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(G(t))return e.fallback?.(t);throw t},children:e.children})}function $n(){return(0,X.jsx)(`p`,{children:`Not Found`})}function er(e){return(0,X.jsx)(X.Fragment,{children:e.children})}function tr(e,t,n){return t.options.notFoundComponent?(0,X.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,X.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,X.jsx)($n,{})}var nr=Y.memo(function({matchId:e}){let t=y(),n=t.stores.matchStores.get(e);n||k();let r=_(t.stores.loadedAt,e=>e),i=_(n,e=>e);return(0,X.jsx)(rr,{router:t,matchId:e,resetKey:r,matchState:Y.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function rr({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,X.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?Y.Suspense:er,f=s?sn:er,p=l?Qn:er;return(0,X.jsxs)(i.isRoot?i.options.shellComponent??er:er,{children:[(0,X.jsx)(O.Provider,{value:t,children:(0,X.jsx)(d,{fallback:o,children:(0,X.jsx)(f,{getResetKey:()=>n,errorComponent:s||ln,onCatch:(e,t)=>{if(G(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,X.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return Y.createElement(l,e)},children:u||r._displayPending?(0,X.jsx)(un,{fallback:o,children:(0,X.jsx)(ar,{matchId:t})}):(0,X.jsx)(ar,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ir,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function ir({resetKey:e}){let t=y(),n=Y.useRef(void 0);return f(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...Gt(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var ar=Y.memo(function({matchId:e}){let t=y(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||k();let i=_(r,e=>e),a=i.routeId,o=t.routesById[a],s=Y.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=Y.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,X.jsx)(e,{},s):(0,X.jsx)(or,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=oe();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return G(i.error)||k(),tr(t,o,i.error);if(i.status===`redirected`)throw K(i.error)||k(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),or=Y.memo(function(){let e=y(),t=Y.useContext(O),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=_(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=_(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,X.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||k(),tr(e,a,void 0);if(!i)return null;let s=(0,X.jsx)(nr,{matchId:i});return n===`__root__`?(0,X.jsx)(Y.Suspense,{fallback:o,children:s}):s});function sr(){let e=y(),t=Y.useRef({router:e,mounted:!1}),[n,r]=Y.useState(!1),i=_(e.stores.isLoading,e=>e),a=_(e.stores.hasPending,e=>e),o=d(i),s=i||n||a,c=d(s),l=i||a,u=d(l);return e.startTransition=e=>{r(!0),Y.startTransition(()=>{e(),r(!1)})},Y.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return W(e.latestLocation.publicHref)!==W(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),f(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),f(()=>{o&&!i&&e.emit({type:`onLoad`,...Gt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),f(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...Gt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),f(()=>{if(c&&!s){let t=Gt(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),Tn(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())}),t.hrefChanged&&on(e)}},[s,c,e]),null}function cr(){let e=y(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,X.jsx)(t,{}):null,r=(0,X.jsxs)(typeof document<`u`&&e.ssr?er:Y.Suspense,{fallback:n,children:[(0,X.jsx)(sr,{}),(0,X.jsx)(lr,{})]});return e.options.InnerWrap?(0,X.jsx)(e.options.InnerWrap,{children:r}):r}function lr(){let e=y(),t=_(e.stores.firstId,e=>e),n=_(e.stores.loadedAt,e=>e),r=t?(0,X.jsx)(nr,{matchId:t}):null;return(0,X.jsx)(O.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,X.jsx)(sn,{getResetKey:()=>n,errorComponent:ln,onCatch:void 0,children:r})})}var ur=e=>({createMutableStore:On,createReadonlyStore:On,batch:Tn}),dr=e=>new fr(e),fr=class extends Kt{constructor(e){super(e,ur)}};function pr({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,X.jsx)(ee.Provider,{value:e,children:t});return e.options.Wrap?(0,X.jsx)(e.options.Wrap,{children:r}):r}function mr({router:e,...t}){return(0,X.jsx)(pr,{router:e,...t,children:(0,X.jsx)(cr,{})})}function hr(e){let t=y({warn:e?.router===void 0}),n=e?.router||t,r=(0,Y.useRef)(void 0);return _(n.stores.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=se(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var gr=class extends S{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),C(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&D(t.mutationKey)!==D(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??ue();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){le.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function _r(e,t){let n=ae(t),[r]=Y.useState(()=>new gr(n,e));Y.useEffect(()=>{r.setOptions(e)},[r,e]);let i=Y.useSyncExternalStore(Y.useCallback(e=>r.subscribe(le.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=Y.useCallback((e,t)=>{r.mutate(e,t).catch(ne)},[r]);if(i.error&&w(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var vr=u();function yr(e){let{apiKey:t,userId:n,businessId:r,environment:i}=e;return{queryKey:[`bootstrap`,i,t,n,r],enabled:!!(t&&n&&r),queryFn:async()=>{let e=await fetch(`/api/proxy/auth/bootstrap`,{headers:{"x-proxy-target":I[i],"X-API-KEY":t,"X-USER-ID":n,"X-BUSINESS-ID":r}});if(!e.ok)throw Error(`Bootstrap failed: ${String(e.status)} ${e.statusText}`);return e.json()},retry:!1}}function br(e){let{apiKey:t,userId:n,businessId:r,environment:i}=e;return{queryKey:[`businessPluginApps`,i,t,n,r],enabled:!!(t&&n&&r),queryFn:async()=>{let e=await fetch(`/api/proxy/external-integrations/business-plugin-apps`,{headers:{"x-proxy-target":I[i],"X-API-KEY":t,"X-USER-ID":n,"X-BUSINESS-ID":r}});if(!e.ok)throw Error(`businessPluginApps failed: ${String(e.status)} ${e.statusText}`);return e.json()},retry:!1}}function xr(){let e=ae(),[t,n]=(0,Y.useState)([]),[r,i]=(0,Y.useState)([]),[a,o]=(0,Y.useState)([]),[s,c]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{let t=window.location.protocol===`https:`?`wss:`:`ws:`,r=new WebSocket(`${t}//${window.location.host}`);return r.addEventListener(`message`,t=>{let r;try{r=JSON.parse(t.data)}catch{return}if(r.type===`rebuild`)e.invalidateQueries({queryKey:[`bundle`]});else if(r.type===`log`)n(e=>[...e,r.message]);else if(r.type===`proxy-log`){let e=r.entry??{kind:`info`,message:r.message??``};i(t=>[...t,e])}else if(r.type===`console-message`){let e=[`log`,`warn`,`error`,`info`].includes(r.level)?r.level:`log`;o(t=>[...t,{level:e,args:r.args}])}else c(r.credentials)}),()=>{r.close()}},[e]),{buildLogs:t,proxyLogs:r,consoleLogs:a,clearConsoleLogs:()=>{o([])},serverCredentials:s}}var Sr=`modulepreload`,Cr=function(e){return`/`+e},wr={},Tr=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Cr(t,n),t in wr)return;wr[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Sr,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Er=(0,Y.lazy)(()=>Tr(()=>import(`./DevSidebar-BhTD2bBO.js`).then(e=>({default:e.DevSidebar})),__vite__mapDeps([0,1,2,3]))),Dr=window.open.bind(window),Or=416,kr=280,Ar=800,jr={apiKey:``,userId:``,businessId:``,environment:`go`},Mr=()=>{let{buildLogs:e,proxyLogs:t,consoleLogs:s,clearConsoleLogs:l,serverCredentials:u}=xr(),[d,f]=(0,Y.useState)(()=>localStorage.getItem(`devtools-sidebar-open`)===`true`),[p,m]=(0,Y.useState)(()=>localStorage.getItem(`kizen-flag-script-runner-logging`)===`true`),[g,_]=(0,Y.useState)(()=>{let e=parseInt(localStorage.getItem(`devtools-sidebar-width`)??``,10);return isNaN(e)?Or:Math.min(Ar,Math.max(kr,e))}),v=()=>{f(e=>{let t=!e;return localStorage.setItem(`devtools-sidebar-open`,String(t)),t})},y=()=>{m(e=>{let t=!e;return localStorage.setItem(`kizen-flag-script-runner-logging`,String(t)),t})},b=(0,Y.useCallback)(e=>{_(e),localStorage.setItem(`devtools-sidebar-width`,String(e))},[]),[x,S]=(0,Y.useState)(()=>{try{return{...jr,...JSON.parse(localStorage.getItem(`devtools-credentials`)??`{}`)}}catch{return jr}});(0,Y.useEffect)(()=>{fetch(`/api/credentials`).then(e=>e.json()).then(e=>{if(e.apiKey){let t={...jr,...e};S(t),localStorage.setItem(`devtools-credentials`,JSON.stringify(t))}}).catch(()=>{})},[]),(0,Y.useEffect)(()=>{if(!u)return;let e={...jr,...u};S(e),localStorage.setItem(`devtools-credentials`,JSON.stringify(e))},[u]);let C=e=>{S(e),localStorage.setItem(`devtools-credentials`,JSON.stringify(e))},{data:w,isLoading:T,isError:E}=re(ce),{data:D,isError:ee,isLoading:O}=re(yr(x)),{data:k}=re(br(x)),te=ae(),A=_r({mutationFn:async({apiName:e,hasExistingEntry:t,nextDisabled:n})=>{let r={"x-proxy-target":I[x.environment],"X-API-KEY":x.apiKey,"X-USER-ID":x.userId,"X-BUSINESS-ID":x.businessId,"Content-Type":`application/json`},i=t?await fetch(`/api/proxy/external-integrations/business-plugin-apps/${e}`,{method:`PATCH`,headers:r,body:JSON.stringify({disabled:n})}):await fetch(`/api/proxy/external-integrations/business-plugin-apps`,{method:`POST`,headers:r,body:JSON.stringify({plugin_app_api_name:e,disabled:!1,config:{}})});if(!i.ok){let e=await i.text().catch(()=>``);throw Error(`${n?`uninstall`:`install`} failed: ${String(i.status)} ${i.statusText} ${e}`)}},onSuccess:async()=>{await fetch(`/api/proxy-cache/clear`).catch(()=>{}),await Promise.all([te.invalidateQueries({queryKey:[`bootstrap`]}),te.invalidateQueries({queryKey:[`businessPluginApps`]})])}}),j=h(),{location:M}=hr(),N=/^\/([^/]+)\/.+/.exec(M.pathname)?.[1],ne=/^\/[^/]+\/([^/]+)/.exec(M.pathname)?.[1];(0,Y.useEffect)(()=>{M.pathname!==`/`&&fetch(`/api/last-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:M.pathname})})},[M.pathname]);let ie=((N?w?.find(e=>e.api_name===N):void 0)?.artifacts.automation_action_configs.length??0)>0,oe=!!N&&!!w?.some(e=>e.api_name===N),se=N?k?.find(e=>e.plugin_app.api_name===N):void 0,P=!!se&&!se.disabled,le=!!D&&!!k&&oe,F=A.isPending?P?`uninstalling…`:`installing…`:P?`Uninstall Plugin`:`Install Plugin`,L=A.isPending?`cursor-wait opacity-50`:``,ue=T?`loading`:E?`error`:w?`loaded`:`empty`,me=O?`authenticating`:ee?`auth error`:D?`authenticated`:`no auth`,z=T?`bg-neutral-100 text-neutral-400`:E?`bg-red-100 text-red-700`:w?`bg-green-100 text-green-700`:`bg-yellow-100 text-yellow-700`,B=O?`bg-neutral-100 text-neutral-400`:ee?`bg-red-100 text-red-700`:D?`bg-green-100 text-green-700`:`bg-yellow-100 text-yellow-700`;return(0,X.jsx)(fe.Provider,{value:x,children:(0,X.jsx)(pe.Provider,{value:d?g:0,children:(0,X.jsx)(de.Provider,{value:D,children:(0,X.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden font-mono`,children:[(0,X.jsxs)(`div`,{className:`sticky top-0 z-10 flex items-center gap-3 border-b border-black/10 bg-white/85 px-5 py-3 backdrop-blur-sm`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`img`,{src:`/mark.svg`,alt:`Kizen`,className:`h-5 w-5`}),(0,X.jsx)(`span`,{className:`text-[13px] font-bold tracking-tight text-neutral-900 pl-2`,children:`Kizen App Development Toolkit`})]}),w&&w.length>0&&(0,X.jsx)(`select`,{value:N??``,onChange:e=>void j({to:`/$apiName/summary`,params:{apiName:e.target.value}}),className:`rounded border border-black/10 bg-transparent px-2 py-0.5 text-[13px] font-mono text-neutral-700 focus:outline-none`,children:w.map(e=>{let t=e.api_name;return(0,X.jsx)(`option`,{value:t,children:e.name??t},t)})}),ne&&N&&(0,X.jsxs)(`select`,{value:ne,onChange:e=>void j({to:`/${N}/${e.target.value}`}),className:`rounded border border-black/10 bg-transparent px-2 py-0.5 text-[13px] font-mono text-neutral-700 focus:outline-none`,children:[(0,X.jsx)(`option`,{value:`summary`,children:`Summary`}),(0,X.jsx)(`option`,{value:`sandbox`,children:`Sandbox`}),(0,X.jsx)(`option`,{value:`configuration`,children:`Configuration`}),ie&&(0,X.jsx)(`option`,{value:`code-steps`,children:`Code Steps`}),(0,X.jsx)(`option`,{value:`versions`,children:`Versions`}),(0,X.jsx)(`option`,{value:`icons`,children:`Icon Reference`})]}),(0,X.jsx)(`div`,{className:`flex-1`}),(0,X.jsxs)(`button`,{onClick:()=>{window.location.reload()},className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Refresh page`,children:[(0,X.jsx)(c,{icon:i}),(0,X.jsx)(`span`,{children:`Refresh`})]}),(0,X.jsxs)(`button`,{onClick:()=>{Dr(R[x.environment],`_blank`,`noopener,height=900`)},className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Open Kizen`,children:[(0,X.jsx)(c,{icon:n}),(0,X.jsx)(`span`,{children:`Open Kizen`})]}),(0,X.jsxs)(`button`,{onClick:y,className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Toggle script runner debug logging`,children:[(0,X.jsx)(c,{icon:o}),(0,X.jsx)(`span`,{children:`Script Runner Logging`}),(0,X.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${p?`bg-green-500`:`bg-neutral-300`}`})]}),(0,X.jsxs)(`button`,{onClick:v,className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Toggle dev tools`,children:[(0,X.jsx)(c,{icon:r}),(0,X.jsx)(`span`,{children:`DevTools`}),(0,X.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${d?`bg-green-500`:`bg-neutral-300`}`})]}),le&&N&&(0,X.jsxs)(`button`,{type:`button`,disabled:A.isPending,onClick:()=>{A.mutate({apiName:N,hasExistingEntry:!!se,nextDisabled:P})},className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 transition-colors hover:border-black/20 hover:text-neutral-800 ${L}`,"aria-label":F,children:[(0,X.jsx)(c,{icon:a}),(0,X.jsx)(`span`,{children:F}),(0,X.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${P?`bg-green-500`:`bg-neutral-300`}`})]}),(0,X.jsx)(`span`,{className:`rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide ${z}`,children:ue}),(0,X.jsx)(`span`,{className:`rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide ${B}`,children:me})]}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,X.jsx)(`div`,{className:`flex-1 overflow-y-auto p-6`,style:{backgroundImage:`
|
|
3
|
-
linear-gradient(rgba(0,0,0,0.025) 1px, transparent 1px),
|
|
4
|
-
linear-gradient(90deg, rgba(0,0,0,0.025) 1px, transparent 1px)
|
|
5
|
-
`,backgroundSize:`24px 24px`},children:(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(or,{})})}),d&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Er,{onClose:v,buildLogs:e,proxyLogs:t,consoleLogs:s,onClearConsole:()=>{l()},credentials:x,onCredentialsChange:C,width:g,onWidthChange:b})})]})]})})})})},Nr=()=>{let{data:e,isLoading:t,isError:n}=re(ce),r=h();return(0,Y.useEffect)(()=>{e&&e.length>0&&r({to:`/$apiName/summary`,params:{apiName:e[0]?.api_name}})},[e,r]),t?(0,X.jsx)(me,{children:(0,X.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-400`,children:`Fetching bundle.json…`})}):n?(0,X.jsx)(me,{children:(0,X.jsx)(`p`,{className:`m-0 text-[13px] text-red-700`,children:`Could not load bundle.json. Make sure the dev server is running from a plugin directory.`})}):!e||e.length===0?(0,X.jsx)(me,{children:(0,X.jsxs)(`p`,{className:`m-0 text-[13px] text-yellow-700`,children:[`bundle.json is empty. Run`,` `,(0,X.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 py-0.5`,children:`appbuilder build`}),` to generate it.`]})}):null},Pr=(0,Y.lazy)(()=>Tr(()=>import(`./AppDetailPage-DIuYKCTQ.js`).then(e=>({default:e.AppDetailPage})),__vite__mapDeps([4,2,1,5,6,7,8]))),Fr=(0,Y.lazy)(()=>Tr(()=>import(`./SandboxPage-GDcydJnJ.js`).then(e=>({default:e.SandboxPage})),__vite__mapDeps([9,1,2,10,5,11,3,12,13,6,14,7,8]))),Ir=(0,Y.lazy)(()=>Tr(()=>import(`./ConfigurationPage-Cjy9TH3N.js`).then(e=>({default:e.ConfigurationPage})),__vite__mapDeps([15,1,2,10,5,11,3,12,6]))),Lr=(0,Y.lazy)(()=>Tr(()=>import(`./VersionsPage-D0qenxK5.js`).then(e=>({default:e.VersionsPage})),__vite__mapDeps([16,1,2,5,6]))),Rr=(0,Y.lazy)(()=>Tr(()=>import(`./IconReferencePage-B6j9wlte.js`).then(e=>({default:e.IconReferencePage})),__vite__mapDeps([17,2,1,6,7,8]))),zr=(0,Y.lazy)(()=>Tr(()=>import(`./CodeStepsPage-CD_MhDwY.js`).then(e=>({default:e.CodeStepsPage})),__vite__mapDeps([18,1,2,5,19,6,14,20]))),$=Zn({component:Mr}),Br=Yn({getParentRoute:()=>$,path:`/`,component:Nr}),Vr=Yn({getParentRoute:()=>$,path:`/$apiName/summary`,component:Pr}),Hr=Yn({getParentRoute:()=>$,path:`/$apiName/sandbox`,component:Fr}),Ur=Yn({getParentRoute:()=>$,path:`/$apiName/configuration`,component:Ir}),Wr=Yn({getParentRoute:()=>$,path:`/$apiName/versions`,component:Lr}),Gr=Yn({getParentRoute:()=>$,path:`/$apiName/icons`,component:Rr}),Kr=Yn({getParentRoute:()=>$,path:`/$apiName/code-steps`,component:zr}),qr=Yn({getParentRoute:()=>$,path:`/$apiName/code-steps/$stepApiName`,component:zr}),Jr=dr({routeTree:$.addChildren([Br,Vr,Hr,Ur,Wr,Gr,Kr,qr])}),Yr=document.getElementById(`root`),Xr=new L;if(Yr===null)throw Error(`Root element not found`);(0,vr.createRoot)(Yr).render((0,X.jsx)(Y.StrictMode,{children:(0,X.jsx)(N,{client:Xr,children:(0,X.jsx)(mr,{router:Jr})})}));
|