@plumix/admin 0.2.0 → 0.3.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/README.md +11 -11
- package/dist/assets/-constants-D2aYlJ-p.js +1 -0
- package/dist/assets/-constants-GNK7OFwu.js +1 -0
- package/dist/assets/-errors-Cm7HAP35.js +1 -0
- package/dist/assets/-locale-param-DNqvygi2.js +1 -0
- package/dist/assets/-schemas-CIUBpPg7.js +1 -0
- package/dist/assets/Match-Dr0Ejexl.js +1 -0
- package/dist/assets/_-CdARd5HU.js +1 -0
- package/dist/assets/_-TJmg5kBm.js +2 -0
- package/dist/assets/_auth-CySOqEGr.js +1 -0
- package/dist/assets/_authenticated-BXBqWQO4.js +1 -0
- package/dist/assets/_authenticated-BXN54ZIX.js +2 -0
- package/dist/assets/_authenticated-CjQ1ovXR.js +1 -0
- package/dist/assets/_editor-DRd0V5nT.js +1 -0
- package/dist/assets/_name--PFunjJs.js +2 -0
- package/dist/assets/_name-BdQXCH-s.js +1 -0
- package/dist/assets/_page-BSBKYWFe.js +1 -0
- package/dist/assets/_page-BuOOftjn.js +2 -0
- package/dist/assets/_page-Cd2qh5Hj.js +1 -0
- package/dist/assets/_page-Rj3wR-yR.js +1 -0
- package/dist/assets/_slug-CPq3MyRU.js +2 -0
- package/dist/assets/_slug-D5T6BGMn.js +1 -0
- package/dist/assets/_token-BV3V8P_y.js +1 -0
- package/dist/assets/_token-DnOWzW7K.js +2 -0
- package/dist/assets/allowed-domains-CQYTKIje.js +1 -0
- package/dist/assets/bootstrap-B4UY7ClG.js +1 -0
- package/dist/assets/bootstrap-BpS0ha2M.js +2 -0
- package/dist/assets/breadcrumb-x0qfIbU9.js +1 -0
- package/dist/assets/button-DG1Ca1S5.js +1 -0
- package/dist/assets/caps-SYhabp1B.js +1 -0
- package/dist/assets/create-D2nZy-Hm.js +1 -0
- package/dist/assets/create-D7WMBpH9.js +1 -0
- package/dist/assets/create-DWhdHiGH.js +2 -0
- package/dist/assets/create-DgEbjT-H.js +1 -0
- package/dist/assets/create-Qrx2pnjH.js +2 -0
- package/dist/assets/device-Ae_X8x7B.js +2 -0
- package/dist/assets/device-COTq1gdI.js +1 -0
- package/dist/assets/dist-BP9v0gZx.js +1 -0
- package/dist/assets/dist-BaNJ6JYm.js +1 -0
- package/dist/assets/dist-BbwCNMFC.js +1 -0
- package/dist/assets/dist-BreUs1Gf.js +1 -0
- package/dist/assets/dist-C4yHjFuP.js +1 -0
- package/dist/assets/dist-CFgtqwWs.js +1 -0
- package/dist/assets/dist-Cz1zPiFe.js +1 -0
- package/dist/assets/dist-DKhWWf1L.js +11 -0
- package/dist/assets/dist-DWZq3eNY.js +1 -0
- package/dist/assets/dist-Dgy1ZZMQ.js +1 -0
- package/dist/assets/dist-RxmsRBXP.js +1 -0
- package/dist/assets/dist-hUh7dFZi.js +1 -0
- package/dist/assets/dist-vYFq1OyT.js +1 -0
- package/dist/assets/edit-2tkUFGA0.js +1 -0
- package/dist/assets/edit-B-2O5ofQ.js +2 -0
- package/dist/assets/edit-BLG323-R.js +1 -0
- package/dist/assets/edit-C8EfqoCF.js +1 -0
- package/dist/assets/edit-C8cjxuy9.js +1 -0
- package/dist/assets/edit-CJqG1MnB.js +1 -0
- package/dist/assets/edit-CLCmZdBG.js +2 -0
- package/dist/assets/edit-D0M8e03b.js +10 -0
- package/dist/assets/edit-D64WXGYa.js +2 -0
- package/dist/assets/edit-DE8yiDG7.js +1 -0
- package/dist/assets/edit-DmKuaq6h.js +1 -0
- package/dist/assets/edit-skeleton-oIsvepSM.js +1 -0
- package/dist/assets/empty-p3QKoEqD.js +1 -0
- package/dist/assets/error-placeholder-ULkA-k6_.js +1 -0
- package/dist/assets/errors-BDz8PxwA.js +1 -0
- package/dist/assets/es2015-Di0DqwZ-.js +41 -0
- package/dist/assets/form-B_PPIck3.js +1 -0
- package/dist/assets/headings-B7oI9nfr.js +1 -0
- package/dist/assets/image-CYG4gQQy.js +1 -0
- package/dist/assets/index-DOeYD9Kh.js +7 -0
- package/dist/assets/lazyRouteComponent-CQbKoKTD.js +1 -0
- package/dist/assets/link-CI3qhqYu.js +1 -0
- package/dist/assets/login-D-k0G5e9.js +1 -0
- package/dist/assets/login-D91-q-s1.js +2 -0
- package/dist/assets/mailer-DeygotUf.js +2 -0
- package/dist/assets/mailer-DoyD5gWW.js +1 -0
- package/dist/assets/manifest-CKNOp_Vu.js +1 -0
- package/dist/assets/matchContext-DKtpdvCQ.js +1 -0
- package/dist/assets/{meta-box-Dd1vNvwM.js → meta-box-9XmyLLTE.js} +1 -1
- package/dist/assets/meta-box-field-CK-LNUI9.js +1 -0
- package/dist/assets/{meta-box-grid-BfWeRDWA.js → meta-box-grid-CoW6o7O7.js} +1 -1
- package/dist/assets/orpc-CmtRGLtZ.js +15 -0
- package/dist/assets/palette-commands-UkUQOwz_.js +2 -0
- package/dist/assets/{passkey-C_CqNV1S.js → passkey-DN4QfROE.js} +1 -1
- package/dist/assets/plugin-error-boundary-FjZbsCsp.js +1 -0
- package/dist/assets/plugin-registry-nSDhEMki.js +1 -0
- package/dist/assets/popover-BoiNmQB7.js +1 -0
- package/dist/assets/register-core-blocks-BlT-RgVA.js +7 -0
- package/dist/assets/rich-text-field-CS-OOttw.js +123 -0
- package/dist/assets/search-input-BG9KotQw.js +4 -0
- package/dist/assets/select-D3kIVy0H.js +1 -0
- package/dist/assets/{separator-u9O31sRo.js → separator-DzRLZTkg.js} +1 -1
- package/dist/assets/session-Y-9LAiv-.js +1 -0
- package/dist/assets/settings-B9srnZ7u.js +2 -0
- package/dist/assets/settings-DL7pou9m.js +1 -0
- package/dist/assets/sonner-1kBVu4ZN.js +1 -0
- package/dist/assets/textarea-iIsBg5jH.js +1 -0
- package/dist/assets/toast-CWtRg47-.js +1 -0
- package/dist/assets/{toggle-BfrQLxbv.js → toggle-M64NT8hi.js} +1 -1
- package/dist/assets/tooltip-Bf2rZUeB.js +1 -0
- package/dist/assets/triangle-alert-BpzHmkii.js +1 -0
- package/dist/assets/underline-CbWPdoFR.js +1 -0
- package/dist/assets/use-formatters-DLJOFcWE.js +1 -0
- package/dist/assets/useMutation-vgMtqBOX.js +1 -0
- package/dist/assets/useQuery-QAYxQfCx.js +1 -0
- package/dist/assets/useStore-Vo4KhxPy.js +1 -0
- package/dist/assets/useSuspenseQuery-9GLTSYHf.js +1 -0
- package/dist/assets/user-role-labels-NFC7DRSs.js +1 -0
- package/dist/assets/users-CMJAWmSV.js +2 -0
- package/dist/assets/users-DzXByAic.js +1 -0
- package/dist/assets/utils-kFAy0YTP.js +5 -0
- package/dist/assets/{valibot-DKJGiWCI.js → valibot-DO4fmSyX.js} +1 -1
- package/dist/assets/validation-G0OebWge.js +1 -0
- package/dist/assets/vmessage-CRX68a8a.js +1 -0
- package/dist/index.html +66 -7
- package/package.json +10 -10
- package/dist/assets/-errors-DymGkXzf.js +0 -1
- package/dist/assets/-locale-param-BBOzOc5c.js +0 -1
- package/dist/assets/_-DbGPlcLC.js +0 -1
- package/dist/assets/_auth-DwSMg4I8.js +0 -1
- package/dist/assets/_authenticated-CxUnTydB.js +0 -1
- package/dist/assets/_authenticated-DbZWnirz.js +0 -1
- package/dist/assets/_editor-DTQYo5H1.js +0 -1
- package/dist/assets/_name-BWrqcSjK.js +0 -1
- package/dist/assets/_page-BMWM_crl.js +0 -1
- package/dist/assets/_page-ClAHWpJA.js +0 -1
- package/dist/assets/_slug-BGJ2I-cS.js +0 -1
- package/dist/assets/_token-BDyoqyFe.js +0 -1
- package/dist/assets/allowed-domains-DIQ_LoVq.js +0 -1
- package/dist/assets/bootstrap-D1ITzrPN.js +0 -1
- package/dist/assets/breadcrumb-B-sB8a4_.js +0 -1
- package/dist/assets/create-BFQqxGF6.js +0 -1
- package/dist/assets/create-BrPyaUMW.js +0 -1
- package/dist/assets/create-DwlFRgkL.js +0 -1
- package/dist/assets/device-DedwLhBj.js +0 -1
- package/dist/assets/dist-9yav4OBD.js +0 -46
- package/dist/assets/edit-Ba0VjKvg.js +0 -1
- package/dist/assets/edit-BdagVECm.js +0 -1
- package/dist/assets/edit-BgcIFZzf.js +0 -1
- package/dist/assets/edit-CLa1IU8I.js +0 -1
- package/dist/assets/edit-CteELL-K.js +0 -2
- package/dist/assets/edit-DiaJf7-W.js +0 -1
- package/dist/assets/esm-DfD3iRfG.js +0 -1
- package/dist/assets/form-C94uy6_t.js +0 -1
- package/dist/assets/index-Ctqj4aiM.js +0 -26
- package/dist/assets/login-epTUDW_0.js +0 -1
- package/dist/assets/mailer-HpDxW8FX.js +0 -1
- package/dist/assets/meta-box-field-C4Orbu3m.js +0 -1
- package/dist/assets/orpc-DURDArDu.js +0 -15
- package/dist/assets/plugin-error-boundary-DSHOAgQB.js +0 -1
- package/dist/assets/rich-text-field-KC3ZBBIm.js +0 -130
- package/dist/assets/search-input-J0-6kfsf.js +0 -4
- package/dist/assets/settings-CkVoTIwd.js +0 -1
- package/dist/assets/textarea-BsZaGkV-.js +0 -1
- package/dist/assets/toast-p1K24g-U.js +0 -1
- package/dist/assets/tooltip-Dm_CbtVl.js +0 -1
- package/dist/assets/underline-CoVrqZEk.js +0 -1
- package/dist/assets/use-formatters-Bq4u-MkS.js +0 -1
- package/dist/assets/users-S1uN00sD.js +0 -1
- package/dist/assets/utils-ByiwTMhM.js +0 -5
- package/dist/assets/validation-CwFumc7a.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t,t as n}from"./jsx-runtime-DUAcabCT.js";import{t as r}from"./react-DbyrFoBd.js";import{t as i}from"./react-dom-i-Mcm3wj.js";import{t as a}from"./with-selector-Bf4HMdmS.js";var o=e(r(),1),s=o.use,c=typeof window<`u`?o.useLayoutEffect:o.useEffect;function l(e){let t=o.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function u(e,t,n={},r={}){o.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function d(e){let t=o.useRef(null);return o.useImperativeHandle(e,()=>t.current,[]),t}function f(e){return e[e.length-1]}function p(e){return typeof e==`function`}function m(e,t){return p(e)?e(t):e}var h=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable;function _(e){for(let t in e)if(h.call(e,t))return!0;return!1}var v=()=>Object.create(null),y=(e,t)=>b(e,t,v);function b(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=w(e)&&w(i);if(!a&&!(S(e)&&S(i)))return i;let o=a?e:x(e);if(!o)return i;let s=a?i:x(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:h.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=b(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function x(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!g.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!g.call(e,t))return!1;r.push(t)}return r}function S(e){if(!C(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!C(n)||!n.hasOwnProperty(`isPrototypeOf`))}function C(e){return Object.prototype.toString.call(e)===`[object Object]`}function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function E(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!E(e[r],t[r],n))return!1;return!0}if(S(e)&&S(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!E(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!E(e[o],t[o],n)))return!1;return i===a}return!1}function D(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function O(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function k(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}var ee=/[\x00-\x1f\x7f"<>`{}]/g;function te(e){return e.replace(ee,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function ne(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return te(t)}var re=[`http:`,`https:`,`mailto:`,`tel:`];function ie(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}var ae={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},oe=/[&><\u2028\u2029]/g;function se(e){return e.replace(oe,e=>ae[e])}function ce(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=ne(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=ne(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function le(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ue(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function A(){throw Error(`Invariant failed`)}function de(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 j=4,fe=5;function pe(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 me(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=pe(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 M(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?.parseParams;for(;s<o;){let e=me(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=F(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=F(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.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=I(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.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=I(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=I(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=F(n.fullPath??n.from);e.kind=fe,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=F(n.fullPath??n.from);e.kind=j,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)M(e,t,r,s,i,a,o)}function N(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;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 P(e){if(e.pathless)for(let t of e.pathless)P(t);if(e.static)for(let t of e.static.values())P(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())P(t);if(e.dynamic?.length){e.dynamic.sort(N);for(let t of e.dynamic)P(t)}if(e.optional?.length){e.optional.sort(N);for(let t of e.optional)P(t)}if(e.wildcard?.length){e.wildcard.sort(N);for(let t of e.wildcard)P(t)}}function F(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,priority:0}}function I(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,priority:0,caseSensitive:n,prefix:r,suffix:i}}function he(e,t){let n=F(`/`),r=new Uint16Array(6);for(let t of e)M(!1,r,t,1,n,0);P(n),t.masksTree=n,t.flatCache=de(1e3)}function ge(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=xe(e,t.masksTree);return t.flatCache.set(e,r),r}function _e(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=F(`/`),M(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),xe(r,o,n)}function ve(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=xe(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Ce(a.route)),t.matchCache.set(r,a),a}function ye(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function be(e,t=!1,n){let r=F(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return M(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&A(),a[e.id]=e,s!==0&&e.path){let t=ye(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),P(r),{processedTree:{segmentTree:r,singleCache:de(1e3),matchCache:de(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function xe(e,t,n=!1){let r=e.split(`/`),i=we(e,r,t,n);if(!i)return null;let[a]=Se(e,r,i);return{route:i.node.route,rawParams:a}}function Se(e,t,n){let r=L(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===j)break;if(u.kind===fe){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 Ce(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function L(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function we(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:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!De(l,n))continue;if(i.parse){if(!Ee(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==j&&De(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===j||i.kind===2)&&De(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[u],b;if(v&&i.index){let n={node:i.index,index:u,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(Ee(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&Te(p,o))return n;De(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)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?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+R(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)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?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+R(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+R(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+R(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function R(e,t){return 2**(e-t-1)}function Te(e,t){return e===2**(t-1)-1}function Ee(e,t,n){let r,i;try{[r,i]=Se(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function De(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===j)>(e.node.kind===j)||t.node.kind===j==(e.node.kind===j)&&t.depth>e.depth))):!0}function z(e){return Oe(e.filter(e=>e!==void 0).join(`/`))}function Oe(e){return e.replace(/\/{2,}/g,`/`)}function ke(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function B(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Ae(e){return B(ke(e))}function je(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Me(e,t,n){return je(e,n)===je(t,n)}function Ne({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=Oe(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function Pe(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 Fe(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Le(e,n)).join(`/`):Le(r,n):r}function Ie({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=me(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=Fe(`_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=Fe(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=Fe(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Le(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Re(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function V(e){return e?.isNotFound===!0}function ze(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 Be(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Ve(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]=Be(r):Array.isArray(t)?t.push(Be(r)):n[e]=[t,Be(r)]}return n}var He=We(JSON.parse),Ue=Ge(JSON.stringify,JSON.parse);function We(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Ve(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Ge(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=ze(e,r);return t?`?${t}`:``}}var Ke=`__root__`;function qe(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 H(e){return e instanceof Response&&!!e.options}var Je=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ye=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Xe=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Ze=(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},Qe=(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},U=(e,t,n)=>{if(!(!H(n)&&!V(n)))throw H(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:H(n)?`redirected`:V(n)?`notFound`:r.status===`pending`?`success`:r.status,context:Ze(e,t.index),isFetching:!1,error:n})),V(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),H(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},$e=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},et=(e,t,n)=>{let r=Ze(e,n);e.updateMatch(t,e=>({...e,context:r}))},tt=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,U(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,U(e,e.router.getMatch(r),n)}e.updateMatch(r,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&&!H(n)&&!V(n)&&(e.serialError??=n)},nt=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Xe(e,t)&&(n.options.loader||n.options.beforeLoad||pt(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Je(e)},i);r._nonReactive.pendingTimeout=t}},rt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;nt(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&U(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},it=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=D(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&tt(e,n,o),s&&tt(e,n,s),nt(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=D();let f={...Ze(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=Xe(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}(H(r)||V(r))&&(u(),tt(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),k(y))return u(),y.catch(t=>{tt(e,n,t)}).then(v)}catch(t){u(),tt(e,n,t)}v(y)},at=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>it(e,n,t,i),s=()=>{if($e(e,n))return;let t=rt(e,n,i);return k(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}))},st=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=Ze(e,r),d=Xe(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}},ct=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{ft(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(st(e,t,n,r,i)),l=!!s&&k(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;U(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:Ze(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:Ze(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,V(t)&&await i.options.notFoundComponent?.preload?.(),U(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,U(e,e.router.getMatch(n),t)}!H(o)&&!V(o)&&await ft(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:Ze(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),U(e,r,t)}},lt=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(st(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 ct(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){H(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await ct(e,t,i,n,d):et(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($e(e,i)){if(!e.router.getMatch(i))return e.matches[n];et(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=Xe(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&&U(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=D(),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 ut(e){let t=e,n=[];Ye(t.router)&&Je(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=at(t,e);k(n)&&await n}catch(e){if(H(e))throw e;if(V(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?Qe(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(lt(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(H(e))throw e;V(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=Qe(t,l);e===void 0&&A();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 ft(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 ft(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=Je(t);if(k(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function dt(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function ft(e,t=mt){!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===mt?(()=>{if(e._componentsPromise===void 0){let t=dt(e,mt);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():dt(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function pt(e){for(let t of mt)if(e.options[t]?.preload)return!0;return!1}var mt=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function ht(e){return{input:({url:t})=>{for(let n of e)t=_t(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=vt(e[n],t);return t}}}function gt(e){let t=Ae(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=z([`/`,t,e.pathname]),e)}}function _t(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 vt(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 yt(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(()=>bt(o,_.get())),x=r(()=>bt(s,v.get())),S=r(()=>bt(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),E=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),D=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()})),O=de(64);function k(e){let t=O.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()}}),O.set(e,t)),t}let ee={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:E,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:D,getRouteMatchStore:k,setMatches:te,setPending:ne,setCached:re};te(e.matches),a?.(ee);function te(e){xt(e,o,_,n,i)}function ne(e){xt(e,s,v,n,i)}function re(e){xt(e,c,y,n,i)}return ee}function bt(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function xt(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)}ue(n.get(),a)||n.set(a)})}var W=`__TSR_index`,St=`popstate`,Ct=`beforeunload`;function wt(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=At(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[W];i=Tt(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[W];i=Tt(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[W]!==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 Tt(e,t){t||={};let n=jt();return{...t,key:n,__TSR_key:n,[W]:e}}function Et(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??(()=>At(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=jt();t.history.replaceState({[W]: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=At(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[W]-l.state[W],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=wt({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(Ct,S,{capture:!0}),t.removeEventListener(St,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Ct,S,{capture:!0}),t.addEventListener(St,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 Dt(e){let t=e?.window??(typeof document<`u`?window:void 0);return Et({window:t,parseLocation:()=>{let e=t.location.hash.split(`#`).slice(1),n=e[0]??`/`,r=t.location.search,i=e.slice(1);return At(`${n}${r}${i.length===0?``:`#${i.join(`#`)}`}`,t.history.state)},createHref:e=>`${t.location.pathname}${t.location.search}#${e}`})}function Ot(e={initialEntries:[`/`]}){let t=e.initialEntries,n=e.initialIndex?Math.min(Math.max(e.initialIndex,0),t.length-1):t.length-1,r=t.map((e,t)=>Tt(t,void 0)),i=()=>At(t[n],r[n]),a=[];return wt({getLocation:i,getLength:()=>t.length,pushState:(e,i)=>{n<t.length-1&&(t.splice(n+1),r.splice(n+1)),r.push(i),t.push(e),n=Math.max(t.length-1,0)},replaceState:(e,i)=>{r[n]=i,t[n]=e},back:()=>{n=Math.max(n-1,0)},forward:()=>{n=Math.min(n+1,t.length-1)},go:e=>{n=Math.min(Math.max(n+e,0),t.length-1)},createHref:e=>e,getBlockers:()=>a,setBlockers:e=>a=e})}function kt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function At(e,t){let n=kt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=jt();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||{[W]:0,key:a,__TSR_key:a}}}function jt(){return(Math.random()+1).toString(36).substring(7)}function Mt(e){return e instanceof Error?{name:e.name,message:e.message}:{data:e}}function Nt(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 Pt=new WeakMap,Ft=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,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=Pe(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Et()),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=de(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=yt(zt(this.latestLocation),e),sn(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=Ae(o);t&&t!==`/`&&e.push(gt({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:ht(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=be(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&he(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:ce(e).path,external:!1,searchStr:o,search:y(t?.search,i),hash:ce(r.slice(1)).path,state:b(t?.state,a)}}let o=new URL(i,this.origin),s=_t(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:ce(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:y(t?.search,c),hash:ce(s.hash.slice(1)).path,state:b(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)=>Ne({base:e,to:t.includes(`//`)?Oe(t):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=>Vt({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=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,m(t.params,s)),d=this.routesByPath[B(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&_(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:ce(Ie({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,h=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Bt(t.options.validateSearch,{...e,...h}))}catch{}}),h=e}h=Ht({search:h,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),h=y(o,h);let g=this.options.stringifySearch(h),v=t.hash===!0?n.hash:t.hash?m(t.hash,n.hash):void 0,x=v?`#${v}`:``,S=t.state===!0?n.state:t.state?m(t.state,n.state):{};S=b(n.state,S);let C=`${p}${g}${x}`,w,E,D=!1;if(this.rewrite){let e=new URL(C,this.origin),t=vt(this.rewrite,e);w=e.href.replace(e.origin,``),t.origin===this.origin?E=t.pathname+t.search+t.hash:(E=t.href,D=!0)}else w=le(C),E=w;return{publicHref:E,href:w,pathname:p,search:h,searchStr:g,state:S,hash:v??``,external:D,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=ge(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,m(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,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=E(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=B(this.latestLocation.href)===B(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=D(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),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=At(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=_t(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 queueMicrotask(()=>{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(ie(t,this.protocolAllowlist))return;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}i.replace?window.location.replace(t):window.location.href=t;return}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=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t?Pt.set(this.latestLocation,t):Pt.delete(this.latestLocation);let n=this.latestLocation,r=Nt(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await ut({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,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){H(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):V(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},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(Nt(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&&ie(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=ft,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 ut({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(H(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});V(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=_e(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!E(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?E(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??Ue,parseSearch:e.parseSearch??He,protocolAllowlist:e.protocolAllowlist??re}),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)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Ce(e),this.routeBranchCache.set(e,t)),t}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}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:B(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Wt(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=c[n-1],u,d,f;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=Bt(r.options.validateSearch,{...n})??void 0;u={...n,...e},d={...i,...e},f=void 0}catch(e){let r=e;if(e instanceof It||(r=new It(e.message,{cause:e})),t?.throwOnError)throw r;u=n,d={},f=r}}let p=r.options.loaderDeps?.({search:u})??``,m=p?JSON.stringify(p):``,{interpolatedPath:h,usedParams:g}=Ie({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),_=r.id+h+m,v=this.getMatch(_),x=l.get(r.id),S=v?._strictParams??g,C;if(!v)try{Gt(r,S)}catch(e){if(C=V(e)||H(e)?e:new Lt(e.message,{cause:e}),t?.throwOnError)throw C}Object.assign(i,S);let w=x?`stay`:`enter`,E;if(v)E={...v,cause:w,params:x?.params??i,_strictParams:S,search:y(x?x.search:v.search,u),_strictSearch:d};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||pt(r)?`pending`:`success`;E={id:_,ssr:r.options.ssr,index:n,routeId:r.id,params:x?.params??i,_strictParams:S,pathname:h,updatedAt:Date.now(),search:x?y(x.search,u):u,_strictSearch:d,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:C,__routeContext:void 0,_nonReactive:{loadPromise:D()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:w,loaderDeps:x?b(x.loaderDeps,p):p,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||(E.globalNotFound=s===r.id),E.searchError=f;let O=this.getParentContext(o);E.context={...O,...E.__routeContext,...E.__beforeLoadContext},c[n]=E}for(let t=0;t<c.length;t++){let n=c[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=l.get(n.routeId);if(n.params=o?y(o.params,i):i,!a){let i=c[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:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let t=f(this.stores.matchesId.get()),n=this.lightweightCache.get(e);if(n&&n[0]===t)return n[1];let{matchedRoutes:r,routeParams:i}=this.getMatchedRoutes(e.pathname),a=f(r),o={...e.search};for(let e of r)try{Object.assign(o,Bt(e.options.validateSearch,o))}catch{}let s=t&&this.stores.matchStores.get(t)?.get(),c=s&&s.routeId===a.id&&s.pathname===e.pathname,l;if(c)l=s.params;else{let e=Object.assign(Object.create(null),i);for(let t of r)try{Gt(t,e)}catch{}l=e}let u={matchedRoutes:r,fullPath:a.fullPath,search:o,params:l};return this.lightweightCache.set(e,[t,u]),u}},It=class extends Error{},Lt=class extends Error{};function Rt(e,t){return async(...n)=>(await e())[t||`default`](...n)}function zt(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Bt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new It(`Async validation not supported`);if(n.issues)throw new It(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 Vt({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=B(e),a,o=ve(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function Ht({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Ut(n)(e,t,r??!1)}function Ut(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=Bt(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=m(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function Wt(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 Ke}function Gt(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}function Kt(){try{return sessionStorage}catch{return}}var qt=`tsr-scroll-restoration-v1_3`,Jt=Kt();function Yt(){try{return JSON.parse(Jt?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Xt(){try{Jt?.setItem(qt,JSON.stringify(Zt))}catch{}}var Zt=Yt(),Qt=`data-scroll-restoration-id`,$t=e=>e.state.__TSR_key||e.href;function en(e){let t=e.getAttribute(Qt);if(t)return`[${Qt}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}function tn(e,t){let n=Zt[(t.getKey||$t)(e.latestLocation)];if(!n)return;if(t.id)return n[`[${Qt}="${t.id}"]`];let r=t.getElement?.();if(r)return n[r===window?rn:en(r)]}var nn=!1,rn=`window`;function an(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function on(e){let t=[];for(let n of e){if(n===rn)continue;let e=an(n);e&&t.push(e)}return t}function sn(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||$t,a=new Map,o=(e,t,n)=>{let r=a.get(e)||{};r.scrollX=t,r.scrollY=n,a.set(e,r)},s=e=>{if(!(nn||!r.restoring))if(e.target===document)o(rn,scrollX,scrollY);else{let t=e.target;o(t,t.scrollLeft,t.scrollTop)}},c=e=>{if(!r.restoring)return;let t=Zt[e]||={};for(let[e,n]of a)e===rn?t[rn]=n:e.isConnected&&(t[en(e)]=n)};n&&!r.restoration&&(r.restoration=!0,nn=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,s,!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&c(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{c(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Xt()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c;if(a.clear(),s||(r.next=!0),typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let l=i(t.toLocation),u=t.fromLocation&&i(t.fromLocation);if(r.restoring&&u&&u!==l){let e=Zt[u];if(e){let t=Zt[l];for(let n in e){if(n===rn){if(s)continue}else{let e=an(n);if(!e||s&&o&&(c??=on(o),c.includes(e)))continue}t||=Zt[l]={},t[n]??=e[n]}}}nn=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){let s=Pt.get(t.toLocation),u=e&&i&&(s===`PUSH`||s===`REPLACE`),d=r.restoring?Zt[l]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:r}=d[e];if(e===rn){if(u)continue;scrollTo({top:r,left:t,behavior:n}),a=!0}else{let n=an(e);n&&(n.scrollLeft=t,n.scrollTop=r)}}if(!a&&!e){let e={top:0,left:0,behavior:n};if(scrollTo(e),o){c??=on(o);for(let t of c)t.scrollTo(e)}}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{nn=!1}}))}var G=Symbol.for(`TSR_DEFERRED_PROMISE`);function cn(e,t){let n=e;return n[G]?n:(n[G]={status:`pending`},n.then(e=>{n[G].status=`success`,n[G].data=e}).catch(e=>{n[G].status=`error`,n[G].error={data:(t?.serializeError??Mt)(e),__isServerError:!0}}),n)}var ln=`Error preloading route! ☝️`;function un(e,t){if(e)return typeof e==`string`?e:e[t]}function dn(e){return e?.scriptFormat??`module`}function fn(e,t,n){let r=pn(t),i=un(n,`script`)??r.crossOrigin;return{...dn(e)===`iife`?{rel:`preload`,as:`script`}:{rel:`modulepreload`},href:r.href,...i?{crossOrigin:i}:{}}}function pn(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}function mn(e,t){if(t.length===0)return;if(t.length===1){e.push(t[0]);return}let n=new Set;for(let r of t){let t=JSON.stringify(r);n.has(t)||(n.add(t),e.push(r))}}function hn(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}var gn=(e,t)=>{let n=t.split(`.`),r,i=0,a=e;for(;(r=n[i++])!=null&&a!=null;)a=a[r];return a!=null},_n=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=Ke:this.parentRoute||A();let r=n?Ke:t?.path;r&&r!==`/`&&(r=ke(r));let i=t?.id||r,a=n?Ke:z([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=z([`/`,a]));let o=a===`__root__`?`/`:z([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=B(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=>qe({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.`)}},vn=class{constructor({id:e}){this.notFound=e=>Re({routeId:this.id,...e}),this.redirect=e=>qe({from:this.id,...e}),this.id=e}},yn=class extends _n{constructor(e){super(e)}},bn=e=>({serializationAdapters:e.serializationAdapters,defaultSsr:e.defaultSsr});function xn(e){return({search:t,next:n})=>{let{search:r,meta:i}=n(t,!0);if(e===!0){let e={...t,...r},n=i.removed,a=i.explicit;for(let r of n?.keys()||[])(a&&h.call(a,r)||E(t[r],n.get(r)))&&delete e[r];for(let t of i.removedAny||[])delete e[t];for(let n of i.defaulted?.keys()||[])n in t&&!i.removedAny?.has(n)&&!(i.removed?.has(n)&&(a&&h.call(a,n)||E(t[n],i.removed.get(n))))&&(e[n]=t[n]);return e}let a={...r},o=i.explicit;for(let n of e){let e=n;!(i.removedAny?.has(e)||i.removed?.has(e)&&(o&&h.call(o,e)||E(t[n],i.removed.get(e))))&&(!(n in a)||n in t&&i.defaulted?.has(e)&&E(a[n],i.defaulted.get(e)))&&(a[n]=t[n])}return a}}function Sn(e){return(({search:t,next:n,meta:r})=>{if(e===!0)return Object.keys(t).forEach(e=>{r&&(r.removedAny||=new Set).add(e)}),{};let i={...n(t)};return Array.isArray(e)?e.forEach(e=>{delete i[e],r&&(r.removedAny||=new Set).add(e)}):Object.entries(e).forEach(([e,t])=>{E(i[e],t)&&(delete i[e],r&&(r.removed||=new Map).set(e,t))}),i})}var Cn=(e=>(e[e.AggregateError=1]=`AggregateError`,e[e.ArrowFunction=2]=`ArrowFunction`,e[e.ErrorPrototypeStack=4]=`ErrorPrototypeStack`,e[e.ObjectAssign=8]=`ObjectAssign`,e[e.BigIntTypedArray=16]=`BigIntTypedArray`,e[e.RegExp=32]=`RegExp`,e))(Cn||{}),K=void 0;function wn(e,t,n,r,i,a,o,s,c,l,u,d){return{t:e,i:t,s:n,c:r,m:i,p:a,e:o,a:s,f:c,b:l,o:u,l:d}}function q(e){return wn(2,K,e,K,K,K,K,K,K,K,K,K)}q(2),q(3),q(1),q(0),q(4),q(5),q(6),q(7);var Tn=`__SEROVAL_REFS__`,En=new Map;typeof globalThis<`u`?Object.defineProperty(globalThis,Tn,{value:En,configurable:!0,writable:!1,enumerable:!1}):typeof window<`u`?Object.defineProperty(window,Tn,{value:En,configurable:!0,writable:!1,enumerable:!1}):typeof self<`u`?Object.defineProperty(self,Tn,{value:En,configurable:!0,writable:!1,enumerable:!1}):typeof global<`u`&&Object.defineProperty(global,Tn,{value:En,configurable:!0,writable:!1,enumerable:!1});var{toString:Dn}=Object.prototype;(()=>{let e={p:0,s:0,f:0};return e.p=new Promise((t,n)=>{e.s=t,e.f=n}),e}).toString(),((e,t)=>{e.s(t),e.p.s=1,e.p.v=t}).toString(),((e,t)=>{e.f(t),e.p.s=2,e.p.v=t}).toString(),(()=>{let e=[],t=[],n=!0,r=!1,i=0,a=(e,n,r)=>{for(r=0;r<i;r++)t[r]&&t[r][n](e)},o=(t,i,a,o)=>{for(i=0,a=e.length;i<a;i++)o=e[i],!n&&i===a-1?t[r?`return`:`throw`](o):t.next(o)},s=(e,r)=>(n&&(r=i++,t[r]=e),o(e),()=>{n&&(t[r]=t[i],t[i--]=void 0)});return{__SEROVAL_STREAM__:!0,on:e=>s(e),next:t=>{n&&(e.push(t),a(t,`next`))},throw:i=>{n&&(e.push(i),a(i,`throw`),n=!1,r=!1,t.length=0)},return:i=>{n&&(e.push(i),a(i,`return`),n=!1,r=!0,t.length=0)}}}).toString(),(e=>t=>()=>{let n=0,r={[e]:()=>r,next:()=>{if(n>t.d)return{done:!0,value:void 0};let e=n++,r=t.v[e];if(e===t.t)throw r;return{done:e===t.d,value:r}}};return r}).toString(),((e,t)=>n=>()=>{let r=0,i=-1,a=!1,o=[],s=[],c=(e=0,t=s.length)=>{for(;e<t;e++)s[e].s({done:!0,value:void 0})};n.on({next:e=>{let t=s.shift();t&&t.s({done:!1,value:e}),o.push(e)},throw:e=>{let t=s.shift();t&&t.f(e),c(),i=o.length,a=!0,o.push(e)},return:e=>{let t=s.shift();t&&t.s({done:!0,value:e}),c(),i=o.length,o.push(e)}});let l={[e]:()=>l,next:()=>{if(i===-1){let e=r++;if(e>=o.length){let e=t();return s.push(e),e.p}return{done:!1,value:o[e]}}if(r>i)return{done:!0,value:void 0};let e=r++,n=o[e];if(e!==i)return{done:!1,value:n};if(a)throw n;return{done:!0,value:n}}};return l}).toString(),(e=>{let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r.buffer}).toString();var On=(e=>(e[e.Vanilla=1]=`Vanilla`,e[e.Cross=2]=`Cross`,e))(On||{}),kn=(()=>T).toString();/=>/.test(kn);function An(e){return e}var J=e(n(),1);function jn({promise:e}){if(s)return s(e);let t=cn(e);if(t[G].status===`pending`)throw t;if(t[G].status===`error`)throw t[G].error;return t[G].data}function Mn(e){let t=(0,J.jsx)(Nn,{...e});return e.fallback?(0,J.jsx)(o.Suspense,{fallback:e.fallback,children:t}):t}function Nn(e){let t=jn(e);return e.children(t)}function Pn(e){let t=e.errorComponent??In;return(0,J.jsx)(Fn,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?o.createElement(t,{error:n,reset:r}):e.children})}var Fn=class extends o.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 In({error:e}){let[t,n]=o.useState(!1);return(0,J.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,J.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,J.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,J.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,J.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,J.jsx)(`div`,{children:(0,J.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,J.jsx)(`code`,{children:e.message}):null})}):null]})}function Ln({children:e,fallback:t=null}){return Rn()?(0,J.jsx)(o.Fragment,{children:e}):(0,J.jsx)(o.Fragment,{children:t})}function Rn(){return o.useSyncExternalStore(zn,()=>!0,()=>!1)}function zn(){return()=>{}}var Bn=o.createContext(null);function Y(e){return o.useContext(Bn)}var Vn=o.createContext(void 0),Hn=o.createContext(void 0),X=(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))(X||{});function Un({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 Wn(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 Gn=[],Kn=0,{link:qn,unlink:Jn,propagate:Yn,checkDirty:Xn,shallowPropagate:Zn}=Un({update(e){return e._update()},notify(e){Gn[$n++]=e,e.flags&=~X.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=X.Mutable|X.Dirty,nr(e))}}),Qn=0,$n=0,Z,er=0;function tr(e){try{++er,e()}finally{--er||rr()}}function nr(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Jn(n,e)}function rr(){if(!(er>0)){for(;Qn<$n;){let e=Gn[Qn];Gn[Qn++]=void 0,e.notify()}Qn=0,$n=0}}function ir(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?X.None:X.Mutable,get(){return Z!==void 0&&qn(i,Z,Kn),i._snapshot},subscribe(e){let t=Wn(e),n={current:!1},r=ar(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Z,o=t?.compare??Object.is;if(n)Z=i,++Kn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=X.Mutable|X.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{Z=a,n&&(i.flags&=~X.RecursedCheck),nr(i)}}};return n?(i.flags=X.Mutable|X.Dirty,i.get=function(){let e=i.flags;if(e&X.Dirty||e&X.Pending&&Xn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Zn(e)}}else e&X.Pending&&(i.flags=e&~X.Pending);return Z!==void 0&&qn(i,Z,Kn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Yn(e),Zn(e),rr())}},i}function ar(e){let t=()=>{let t=Z;Z=n,++Kn,n.depsTail=void 0,n.flags=X.Watching|X.RecursedCheck;try{return e()}finally{Z=t,n.flags&=~X.RecursedCheck,nr(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:X.Watching|X.RecursedCheck,notify(){let e=this.flags;e&X.Dirty||e&X.Pending&&Xn(this.deps,this)?t():this.flags=X.Watching},stop(){this.flags=X.None,this.depsTail=void 0,nr(this)}};return t(),n}var or=a();function sr(e,t){return e===t}function Q(e,t,n=sr){let r=(0,o.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,o.useCallback)(()=>e?.get(),[e]);return(0,or.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var cr={get(){},subscribe(){return{unsubscribe(){}}}};function lr(e,t){let n=o.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=b(n.current,i):i}}function $(e){let t=Y(),n=o.useContext(e.from?Hn:Vn),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=lr(e,t),a=Q(r??cr,e=>e?i(e):cr);if(a!==cr)return a;(e.shouldThrow??!0)&&A()}function ur(e){return $({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function dr(e){let{select:t,...n}=e;return $({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function fr(e){return $({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function pr(e){return $({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function mr(e){let t=Y();return o.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function hr(e){let t=Y(),n=mr(),r=o.useRef(null);return c(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function gr(e){return $({...e,select:t=>e.select?e.select(t.context):t.context})}var _r=e(i(),1);function vr(e,t){let n=Y(),r=d(t),{activeProps:i,inactiveProps:a,activeOptions:s,to:c,preload:l,preloadDelay:f,preloadIntentProximity:p,hashScrollIntoView:h,replace:g,startTransition:_,resetScroll:v,viewTransition:y,children:b,target:x,disabled:S,style:C,className:w,onClick:D,onBlur:O,onFocus:k,onMouseEnter:ee,onMouseLeave:te,onTouchStart:ne,ignoreBlocker:re,params:ae,search:oe,hash:se,state:ce,mask:le,reloadDocument:ue,unsafeRelative:A,from:de,_fromLocation:j,...fe}=e,pe=Rn(),me=o.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),M=Q(n.stores.location,e=>e,(e,t)=>e.href===t.href),N=o.useMemo(()=>{let e={_fromLocation:M,...me};return n.buildLocation(e)},[n,M,me]),P=N.maskedLocation?N.maskedLocation.publicHref:N.publicHref,F=N.maskedLocation?N.maskedLocation.external:N.external,I=o.useMemo(()=>Dr(P,F,n.history,S),[S,F,P,n.history]),he=o.useMemo(()=>{if(I?.external)return ie(I.href,n.protocolAllowlist)?void 0:I.href;if(!Or(c)&&!(typeof c!=`string`||c.indexOf(`:`)===-1))try{return new URL(c),ie(c,n.protocolAllowlist)?void 0:c}catch{}},[c,I,n.protocolAllowlist]),ge=o.useMemo(()=>{if(he)return!1;if(s?.exact){if(!Me(M.pathname,N.pathname,n.basepath))return!1}else{let e=je(M.pathname,n.basepath),t=je(N.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(s?.includeSearch??!0)&&!E(M.search,N.search,{partial:!s?.exact,ignoreUndefined:!s?.explicitUndefined})?!1:s?.includeHash?pe&&M.hash===N.hash:!0},[s?.exact,s?.explicitUndefined,s?.includeHash,s?.includeSearch,M,he,pe,N.hash,N.pathname,N.search,n.basepath]),_e=ge?m(i,{})??br:yr,ve=ge?yr:m(a,{})??yr,ye=[w,_e.className,ve.className].filter(Boolean).join(` `),be=(C||_e.style||ve.style)&&{...C,..._e.style,...ve.style},[xe,Se]=o.useState(!1),Ce=o.useRef(!1),L=e.reloadDocument||he?!1:l??n.options.defaultPreload,we=f??n.options.defaultPreloadDelay??0,R=o.useCallback(()=>{n.preloadRoute({...me,_builtLocation:N}).catch(e=>{console.warn(e),console.warn(ln)})},[n,me,N]);u(r,o.useCallback(e=>{e?.isIntersecting&&R()},[R]),Tr,{disabled:!!S||L!==`viewport`}),o.useEffect(()=>{Ce.current||!S&&L===`render`&&(R(),Ce.current=!0)},[S,R,L]);let Te=e=>{let t=e.currentTarget.getAttribute(`target`),r=x===void 0?t:x;if(!S&&!jr(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,_r.flushSync)(()=>{Se(!0)});let t=n.subscribe(`onResolved`,()=>{t(),Se(!1)});n.navigate({...me,replace:g,resetScroll:v,hashScrollIntoView:h,startTransition:_,viewTransition:y,ignoreBlocker:re})}};if(he)return{...fe,ref:r,href:he,...b&&{children:b},...x&&{target:x},...S&&{disabled:S},...C&&{style:C},...w&&{className:w},...D&&{onClick:D},...O&&{onBlur:O},...k&&{onFocus:k},...ee&&{onMouseEnter:ee},...te&&{onMouseLeave:te},...ne&&{onTouchStart:ne}};let Ee=e=>{if(S||L!==`intent`)return;if(!we){R();return}let t=e.currentTarget;if(wr.has(t))return;let n=setTimeout(()=>{wr.delete(t),R()},we);wr.set(t,n)},De=e=>{S||L!==`intent`||R()},z=e=>{if(S||!L||!we)return;let t=e.currentTarget,n=wr.get(t);n&&(clearTimeout(n),wr.delete(t))};return{...fe,..._e,...ve,href:I?.href,ref:r,onClick:Er([D,Te]),onBlur:Er([O,z]),onFocus:Er([k,Ee]),onMouseEnter:Er([ee,Ee]),onMouseLeave:Er([te,z]),onTouchStart:Er([ne,De]),disabled:!!S,target:x,...be&&{style:be},...ye&&{className:ye},...S&&xr,...ge&&Sr,...pe&&xe&&Cr}}var yr={},br={className:`active`},xr={role:`link`,"aria-disabled":!0},Sr={"data-status":`active`,"aria-current":`page`},Cr={"data-transitioning":`transitioning`},wr=new WeakMap,Tr={rootMargin:`100px`},Er=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Dr(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Or(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}function kr(e){return o.forwardRef(function(t,n){return(0,J.jsx)(Ar,{...t,_asChild:e,ref:n})})}var Ar=o.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=vr(r,t),s=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return o.createElement(`a`,t,s)}return o.createElement(n,a,s)});function jr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Mr=e=>e;function Nr(e){return new Pr({id:e})}var Pr=class extends vn{constructor({id:e}){super({id:e}),this.useMatch=e=>$({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>gr({...e,from:this.id}),this.useSearch=e=>pr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>fr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>dr({...e,from:this.id,strict:!1}),this.useLoaderData=e=>ur({...e,from:this.id,strict:!1}),this.useNavigate=()=>mr({from:Y().routesById[this.id].fullPath}),this.notFound=e=>Re({routeId:this.id,...e}),this.Link=o.forwardRef((e,t)=>{let n=Y().routesById[this.id].fullPath;return(0,J.jsx)(Ar,{ref:t,from:n,...e})})}},Fr=class extends _n{constructor(e){super(e),this.useMatch=e=>$({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>gr({...e,from:this.id}),this.useSearch=e=>pr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>fr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>dr({...e,from:this.id}),this.useLoaderData=e=>ur({...e,from:this.id}),this.useNavigate=()=>mr({from:this.fullPath}),this.Link=o.forwardRef((e,t)=>(0,J.jsx)(Ar,{ref:t,from:this.fullPath,...e}))}};function Ir(e){return new Fr(e)}function Lr(){return e=>Br(e)}var Rr=Lr,zr=class extends yn{constructor(e){super(e),this.useMatch=e=>$({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>gr({...e,from:this.id}),this.useSearch=e=>pr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>fr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>dr({...e,from:this.id}),this.useLoaderData=e=>ur({...e,from:this.id}),this.useNavigate=()=>mr({from:this.fullPath}),this.Link=o.forwardRef((e,t)=>(0,J.jsx)(Ar,{ref:t,from:this.fullPath,...e}))}};function Br(e){return new zr(e)}function Vr(e){return e}var Hr=class extends Fr{constructor(e){super({...e,id:`404`})}};function Ur(e){return new Wr(e,{silent:!0}).createRoute}var Wr=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=Ir(e);return t.isRoot=!1,t},this.silent=t?.silent}};function Gr(e){return e=>e}var Kr=class{constructor(e){this.useMatch=e=>$({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>gr({...e,from:this.options.id}),this.useSearch=e=>pr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>fr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>dr({...e,from:this.options.id}),this.useLoaderData=e=>ur({...e,from:this.options.id}),this.useNavigate=()=>mr({from:Y().routesById[this.options.id].fullPath}),this.options=e}};function qr(e){return t=>new Kr({id:e,...t})}function Jr(e){return typeof e==`object`?new Kr(e):t=>new Kr({id:e,...t})}function Yr(e,t){let n,r,i,a,c=()=>(n||=e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{if(i=e,O(i)&&i instanceof Error&&typeof window<`u`&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(e)||(sessionStorage.setItem(e,`1`),a=!0)}}),n),l=function(e){if(a)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)if(s)s(c());else throw c();return o.createElement(r,e)};return l.preload=c,l}function Xr(e){let t=Y(),n=`not-found-${Q(t.stores.location,e=>e.pathname)}-${Q(t.stores.status,e=>e)}`;return(0,J.jsx)(Pn,{getResetKey:()=>n,onCatch:(t,n)=>{if(V(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(V(t))return e.fallback?.(t);throw t},children:e.children})}function Zr(){return(0,J.jsx)(`p`,{children:`Not Found`})}function Qr({children:e}){return Y(),null}function $r(e){return(0,J.jsx)(J.Fragment,{children:e.children})}function ei(e,t,n){return t.options.notFoundComponent?(0,J.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,J.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,J.jsx)(Zr,{})}var ti=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,ni=(e,t)=>e[0]===t[0]&&e[1]===t[1],ri=o.memo(function({matchId:e}){let t=Y(),n=t.stores.matchStores.get(e);n||A();let r=Q(t.stores.loadedAt,e=>e),i=Q(n,e=>e,ti);return(0,J.jsx)(ii,{router:t,matchId:e,resetKey:r,matchState:o.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 ii({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,s=a?(0,J.jsx)(a,{}):null,c=i.options.errorComponent??e.options.defaultErrorComponent,l=i.options.onCatch??e.options.defaultOnCatch,u=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,d=r.ssr===!1||r.ssr===`data-only`,f=(!i.isRoot||i.options.wrapInSuspense||d)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||d))?o.Suspense:$r,p=c?Pn:$r,m=u?Xr:$r;return(0,J.jsxs)(i.isRoot?i.options.shellComponent??$r:$r,{children:[(0,J.jsx)(Vn.Provider,{value:t,children:(0,J.jsx)(f,{fallback:s,children:(0,J.jsx)(p,{getResetKey:()=>n,errorComponent:c||In,onCatch:(e,t)=>{if(V(e))throw e.routeId??=r.routeId,e;l?.(e,t)},children:(0,J.jsx)(m,{fallback:e=>{if(e.routeId??=r.routeId,!u||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return o.createElement(u,e)},children:d||r._displayPending?(0,J.jsx)(Ln,{fallback:s,children:(0,J.jsx)(oi,{matchId:t})}):(0,J.jsx)(oi,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ai,{}),(e.options.scrollRestoration,null)]}):null]})}function ai(){let e=Y(),t=o.useRef();return c(()=>{let n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:`onRendered`,...Nt(e.stores.location.get(),r??n)}),t.current=n},[Q(e.stores.resolvedLocation,e=>e?.state.__TSR_key),e]),null}var oi=o.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||A();let i=Q(r,e=>e),a=i.routeId,s=t.routesById[a],c=o.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]),l=o.useMemo(()=>{let e=s.options.component??t.options.defaultComponent;return e?(0,J.jsx)(e,{},c):(0,J.jsx)(si,{})},[c,s.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=s.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=D();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return V(i.error)||A(),ei(t,s,i.error);if(i.status===`redirected`)throw H(i.error)||A(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return l}),si=o.memo(function(){let e=Y(),t=o.useContext(Vn),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=Q(a,e=>[e?.routeId,e?.globalNotFound??!1],ni),i=Q(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,s=e.options.defaultPendingComponent?(0,J.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||A(),ei(e,a,void 0);if(!i)return null;let c=(0,J.jsx)(ri,{matchId:i});return n===`__root__`?(0,J.jsx)(o.Suspense,{fallback:s,children:c}):c});function ci(){let e=Y(),t=o.useRef({router:e,mounted:!1}),[n,r]=o.useState(!1),i=Q(e.stores.isLoading,e=>e),a=Q(e.stores.hasPending,e=>e),s=l(i),u=i||n||a,d=l(u),f=i||a,p=l(f);return e.startTransition=e=>{r(!0),o.startTransition(()=>{e(),r(!1)})},o.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 B(e.latestLocation.publicHref)!==B(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),c(()=>{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]),c(()=>{s&&!i&&e.emit({type:`onLoad`,...Nt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[s,e,i]),c(()=>{p&&!f&&e.emit({type:`onBeforeRouteMount`,...Nt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[f,p,e]),c(()=>{if(d&&!u){let t=Nt(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),tr(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())})}},[u,d,e]),null}function li(){let e=Y(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,J.jsx)(t,{}):null,r=(0,J.jsxs)(typeof document<`u`&&e.ssr?$r:o.Suspense,{fallback:n,children:[(0,J.jsx)(ci,{}),(0,J.jsx)(ui,{})]});return e.options.InnerWrap?(0,J.jsx)(e.options.InnerWrap,{children:r}):r}function ui(){let e=Y(),t=Q(e.stores.firstId,e=>e),n=Q(e.stores.loadedAt,e=>e),r=t?(0,J.jsx)(ri,{matchId:t}):null;return(0,J.jsx)(Vn.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,J.jsx)(Pn,{getResetKey:()=>n,errorComponent:In,onCatch:void 0,children:r})})}function di(){let e=Y();return Q(e.stores.matchRouteDeps,e=>e),o.useCallback(t=>{let{pending:n,caseSensitive:r,fuzzy:i,includeSearch:a,...o}=t;return e.matchRoute(o,{pending:n,caseSensitive:r,fuzzy:i,includeSearch:a})},[e])}function fi(e){let t=di()(e);return typeof e.children==`function`?e.children(t):t?e.children:null}function pi(e){let t=Y();return Q(t.stores.matches,lr(e,t))}function mi(e){let t=o.useContext(Vn);return pi({select:n=>(n=n.slice(0,n.findIndex(e=>e.id===t)),e?.select?e.select(n):n),structuralSharing:e?.structuralSharing})}function hi(e){let t=o.useContext(Vn);return pi({select:n=>(n=n.slice(n.findIndex(e=>e.id===t)+1),e?.select?e.select(n):n),structuralSharing:e?.structuralSharing})}var gi=e=>({createMutableStore:ir,createReadonlyStore:ir,batch:tr}),_i=e=>new vi(e),vi=class extends Ft{constructor(e){super(e,gi)}};function yi({router:e,children:t,...n}){_(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,J.jsx)(Bn.Provider,{value:e,children:t});return e.options.Wrap?(0,J.jsx)(e.options.Wrap,{children:r}):r}function bi({router:e,...t}){return(0,J.jsx)(yi,{router:e,...t,children:(0,J.jsx)(li,{})})}function xi(){sn(Y(),!0)}function Si(e){return xi(),null}function Ci(e){return xi(),tn(Y(),e)}function wi(e,t){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if(`shouldBlockFn`in e)return e;if(typeof e==`function`){let n=!!(t??!0);return{shouldBlockFn:async()=>n?await e():!1,enableBeforeUnload:n,withResolver:!1}}let n=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>n&&r!==void 0?await r():n,enableBeforeUnload:n,withResolver:r===void 0}}function Ti(e,t){let{shouldBlockFn:n,enableBeforeUnload:r=!0,disabled:i=!1,withResolver:a=!1}=wi(e,t),s=Y(),{history:c}=s,[l,u]=o.useState({status:`idle`,current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return o.useEffect(()=>i?void 0:c.block({blockerFn:async e=>{function t(e){let t=s.parseLocation(e),n=s.getMatchedRoutes(t.pathname);return n.foundRoute===void 0?{routeId:`__notFound__`,fullPath:t.pathname,pathname:t.pathname,params:n.routeParams,search:s.options.parseSearch(e.search)}:{routeId:n.foundRoute.id,fullPath:n.foundRoute.fullPath,pathname:t.pathname,params:n.routeParams,search:s.options.parseSearch(e.search)}}let r=t(e.currentLocation),i=t(e.nextLocation);if(r.routeId===`__notFound__`&&i.routeId!==`__notFound__`)return!1;let o=await n({action:e.action,current:r,next:i});if(!a)return o;if(!o)return!1;let c=await new Promise(t=>{u({status:`blocked`,current:r,next:i,action:e.action,proceed:()=>t(!1),reset:()=>t(!0)})});return u({status:`idle`,current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),c},enableBeforeUnload:r}),[n,r,i,a,c,s]),l}var Ei=e=>{if(`shouldBlockFn`in e)return{...e};let t=!!(e.condition??!0),n=e.blockerFn;return{shouldBlockFn:async()=>t&&n!==void 0?await n():t,enableBeforeUnload:t,withResolver:n===void 0}};function Di(e){let{children:t,...n}=e,r=Ti(Ei(n));return t?typeof t==`function`?t(r):t:null}function Oi(e){let t=Y({warn:e?.router===void 0}),n=e?.router||t;return Q(n.stores.__store,lr(e,n))}function ki(e){let t=Y();return Q(t.stores.location,lr(e,t))}function Ai(){return Q(Y().stores.location,e=>e.state.__TSR_index!==0)}function ji(e,t){if(t)for(let[n,r]of Object.entries(t))n!==`suppressHydrationWarning`&&r!==void 0&&r!==!1&&e.setAttribute(n,typeof r==`boolean`?``:String(r))}function Mi(e){let{attrs:t,children:n,nonce:r,preventScriptHoist:i}=e;switch(e.tag){case`title`:return(0,J.jsx)(`title`,{...t,suppressHydrationWarning:!0,children:n});case`meta`:return(0,J.jsx)(`meta`,{...t,suppressHydrationWarning:!0});case`link`:return(0,J.jsx)(`link`,{...t,precedence:t?.precedence??(t?.rel===`stylesheet`?`default`:void 0),nonce:r,suppressHydrationWarning:!0});case`style`:return e.inlineCss,(0,J.jsx)(`style`,{...t,dangerouslySetInnerHTML:{__html:n},nonce:r});case`script`:return(0,J.jsx)(Ni,{attrs:t,preventScriptHoist:i,children:n});default:return null}}function Ni({attrs:e,children:t,preventScriptHoist:n}){Y();let r=Rn(),i=typeof e?.type==`string`&&e.type!==``&&e.type!==`text/javascript`&&e.type!==`module`;if(o.useEffect(()=>{if(!i){if(e?.src){let t=(()=>{try{let t=document.baseURI||window.location.href;return new URL(e.src,t).href}catch{return e.src}})();for(let e of document.querySelectorAll(`script[src]`))if(e.src===t)return;let n=document.createElement(`script`);return ji(n,e),document.head.appendChild(n),()=>n.remove()}if(typeof t==`string`){let n=typeof e?.type==`string`?e.type:`text/javascript`,r=typeof e?.nonce==`string`?e.nonce:void 0;for(let e of document.querySelectorAll(`script:not([src])`)){if(!(e instanceof HTMLScriptElement))continue;let i=e.getAttribute(`type`)??`text/javascript`,a=e.getAttribute(`nonce`)??void 0;if(e.textContent===t&&i===n&&a===r)return}let i=document.createElement(`script`);return i.textContent=t,ji(i,e),document.head.appendChild(i),()=>i.remove()}}},[e,t,i]),i&&typeof t==`string`)return(0,J.jsx)(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:t}});if(!r){if(e?.src)return(0,J.jsx)(`script`,{...e,suppressHydrationWarning:!0});if(typeof t==`string`)return(0,J.jsx)(`script`,{...e,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0})}return null}var Pi=e=>{let t=Y(),n=t.options.ssr?.nonce,r=Q(t.stores.matches,e=>e.map(e=>e.meta).filter(e=>e!==void 0),E),i=o.useMemo(()=>{let e=[],t={},i;for(let a=r.length-1;a>=0;a--){let o=r[a];for(let r=o.length-1;r>=0;r--){let a=o[r];if(a)if(a.title)i||={tag:`title`,children:a.title};else if(`script:ld+json`in a)try{let t=JSON.stringify(a[`script:ld+json`]);e.push({tag:`script`,attrs:{type:`application/ld+json`},children:se(t)})}catch{}else{let r=a.name??a.property;if(r){if(t[r])continue;t[r]=!0}e.push({tag:`meta`,attrs:{...a,nonce:n}})}}}return i&&e.push(i),n&&e.push({tag:`meta`,attrs:{property:`csp-nonce`,content:n}}),e.reverse(),e},[r,n]),a=Q(t.stores.matches,e=>e.flatMap(e=>e.links??[]).filter(e=>e!==void 0).map(e=>({tag:`link`,attrs:{...e,nonce:n}})),E),s=Q(t.stores.matches,r=>{let i=t.ssr?.manifest,a=[];return i?(r.forEach(t=>{i.routes[t.routeId]?.css?.forEach(t=>{let r=hn(t);a.push({tag:`link`,attrs:{rel:`stylesheet`,...r,crossOrigin:un(e,`stylesheet`)??r.crossOrigin,suppressHydrationWarning:!0,nonce:n}})})}),i.inlineStyle&&a.push({tag:`style`,attrs:{...i.inlineStyle.attrs,nonce:n},children:i.inlineStyle.children,inlineCss:!0}),a):a},E),c=Q(t.stores.matches,r=>{let i=[],a=t.ssr?.manifest;return a&&r.forEach(t=>{a.routes[t.routeId]?.preloads?.forEach(t=>{i.push({tag:`link`,attrs:{...fn(a,t,e),nonce:n}})})}),i},E),l=Q(t.stores.matches,e=>e.flatMap(e=>e.styles??[]).filter(e=>e!==void 0).map(({children:e,...t})=>({tag:`style`,attrs:{...t,nonce:n},children:e})),E),u=Q(t.stores.matches,e=>e.flatMap(e=>e.headScripts??[]).filter(e=>e!==void 0).map(({children:e,...t})=>({tag:`script`,attrs:{...t,nonce:n},children:e})),E),d=[];return mn(d,i),d.push(...c),mn(d,a),d.push(...s),mn(d,l),mn(d,u),d};function Fi(e){let t=Pi(e.assetCrossOrigin),n=Y().options.ssr?.nonce;return(0,J.jsx)(J.Fragment,{children:t.map(e=>(0,o.createElement)(Mi,{...e,key:`tsr-meta-${JSON.stringify(e)}`,nonce:n}))})}var Ii=()=>{let e=Y(),t=e.options.ssr?.nonce,n=n=>{let r=[],i=e.ssr?.manifest;if(!i)return[];for(let e of n){let n=i.routes[e.routeId]?.scripts;if(n)for(let e of n)r.push({tag:`script`,attrs:{...e.attrs,nonce:t},children:e.children,...typeof e.attrs?.src==`string`?{preventScriptHoist:!0}:{}})}return r},r=e=>e.map(e=>e.scripts).flat(1).filter(Boolean).map(({children:e,...n})=>({tag:`script`,attrs:{...n,suppressHydrationWarning:!0,nonce:t},children:e})),i=Q(e.stores.matches,n,E);return Li(e,Q(e.stores.matches,r,E),i)};function Li(e,t,n){let r=[...t,...n];return(0,J.jsx)(J.Fragment,{children:r.map((e,t)=>(0,o.createElement)(Mi,{...e,key:`tsr-scripts-${e.tag}-${t}`}))})}var Ri=t({Asset:()=>Mi,Await:()=>Mn,Block:()=>Di,CatchBoundary:()=>Pn,CatchNotFound:()=>Xr,ClientOnly:()=>Ln,DEFAULT_PROTOCOL_ALLOWLIST:()=>re,DefaultGlobalNotFound:()=>Zr,ErrorComponent:()=>In,FileRoute:()=>Wr,FileRouteLoader:()=>Gr,HeadContent:()=>Fi,LazyRoute:()=>Kr,Link:()=>Ar,Match:()=>ri,MatchRoute:()=>fi,Matches:()=>li,Navigate:()=>hr,NotFoundRoute:()=>Hr,Outlet:()=>si,RootRoute:()=>zr,Route:()=>Fr,RouteApi:()=>Pr,Router:()=>vi,RouterContextProvider:()=>yi,RouterProvider:()=>bi,ScriptOnce:()=>Qr,Scripts:()=>Ii,ScrollRestoration:()=>Si,SearchParamError:()=>It,cleanPath:()=>Oe,composeRewrites:()=>ht,createBrowserHistory:()=>Et,createControlledPromise:()=>D,createFileRoute:()=>Ur,createHashHistory:()=>Dt,createHistory:()=>wt,createLazyFileRoute:()=>Jr,createLazyRoute:()=>qr,createLink:()=>kr,createMemoryHistory:()=>Ot,createRootRoute:()=>Br,createRootRouteWithContext:()=>Lr,createRoute:()=>Ir,createRouteMask:()=>Vr,createRouter:()=>_i,createRouterConfig:()=>bn,createSerializationAdapter:()=>An,deepEqual:()=>E,defaultParseSearch:()=>He,defaultStringifySearch:()=>Ue,defer:()=>cn,functionalUpdate:()=>m,getRouteApi:()=>Nr,interpolatePath:()=>Ie,isMatch:()=>gn,isNotFound:()=>V,isPlainArray:()=>w,isPlainObject:()=>S,isRedirect:()=>H,joinPaths:()=>z,lazyFn:()=>Rt,lazyRouteComponent:()=>Yr,linkOptions:()=>Mr,notFound:()=>Re,parseSearchWith:()=>We,reactUse:()=>s,redirect:()=>qe,replaceEqualDeep:()=>b,resolvePath:()=>Ne,retainSearchParams:()=>xn,rootRouteId:()=>Ke,rootRouteWithContext:()=>Rr,stringifySearchWith:()=>Ge,stripSearchParams:()=>Sn,trimPath:()=>Ae,trimPathLeft:()=>ke,trimPathRight:()=>B,useAwaited:()=>jn,useBlocker:()=>Ti,useCanGoBack:()=>Ai,useChildMatches:()=>hi,useElementScrollRestoration:()=>Ci,useHydrated:()=>Rn,useLayoutEffect:()=>c,useLinkProps:()=>vr,useLoaderData:()=>ur,useLoaderDeps:()=>dr,useLocation:()=>ki,useMatch:()=>$,useMatchRoute:()=>di,useMatches:()=>pi,useNavigate:()=>mr,useParams:()=>fr,useParentMatches:()=>mi,useRouteContext:()=>gr,useRouter:()=>Y,useRouterState:()=>Oi,useSearch:()=>pr,useTags:()=>Pi});export{si as a,Lr as c,Y as d,qe as f,_i as i,Ar as l,Oi as n,Yr as o,Re as p,bi as r,Ur as s,Ri as t,mr as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-DbyrFoBd.js";import{Pt as r}from"./dist-9yav4OBD.js";import{t as i}from"./utils-DKOQrNEG.js";var a=e(t(),1),o=e(n(),1),s=e=>e.type===`checkbox`,c=e=>e instanceof Date,l=e=>e==null,u=e=>typeof e==`object`,d=e=>!l(e)&&!Array.isArray(e)&&u(e)&&!c(e),f=e=>d(e)&&e.target?s(e.target)?e.target.checked:e.target.value:e,p=(e,t)=>t.split(`.`).some((t,n,r)=>!isNaN(Number(t))&&e.has(r.slice(0,n).join(`.`))),m=e=>{let t=e.constructor&&e.constructor.prototype;return d(t)&&t.hasOwnProperty(`isPrototypeOf`)},h=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function g(e){if(e instanceof Date)return new Date(e);let t=typeof FileList<`u`&&e instanceof FileList;if(h&&(e instanceof Blob||t))return e;let n=Array.isArray(e);if(!n&&!(d(e)&&m(e)))return e;let r=n?[]:Object.create(Object.getPrototypeOf(e));for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=g(e[t]));return r}var _={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`,SUBMIT:`submit`,TRIGGER:`trigger`,VALID:`valid`},v={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},y={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},b=`root`,x=[`__proto__`,`constructor`,`prototype`],S=/^\w*$/,C=e=>S.test(e),w=e=>e===void 0,T=/[.[\]'"]/,E=e=>e.split(T).filter(Boolean),D=(e,t,n)=>{if(!t||!d(e))return n;let r=C(t)?[t]:E(t);if(r.some(e=>x.includes(e)))return n;let i=r.reduce((e,t)=>l(e)?void 0:e[t],e);return w(i)||i===e?w(e[t])?n:e[t]:i},O=e=>typeof e==`boolean`,k=e=>typeof e==`function`,A=(e,t,n)=>{let r=-1,i=C(t)?[t]:E(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=d(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(x.includes(t))return;e[t]=a,e=e[t]}},j=o.createContext(null);j.displayName=`HookFormControlContext`;var M=()=>o.useContext(j),N=(e,t,n,r=!0)=>{let i={};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==v.all&&(t._proxyFormState[i]=!r||v.all),n&&(n[i]=!0),e[i]}});return i},P=h?o.useLayoutEffect:o.useEffect;function F(e){let t=M(),{control:n=t,disabled:r,name:i,exact:a}=e||{},[s,c]=o.useState(()=>({...n._formState,defaultValues:n._defaultValues})),l=o.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return P(()=>n._subscribe({name:i,formState:l.current,exact:a,callback:e=>{!r&&c({...n._formState,...e,defaultValues:n._defaultValues})}}),[i,r,a]),o.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),o.useMemo(()=>N(s,n,l.current,!1),[s,n])}var I=e=>typeof e==`string`,ee=(e,t,n,r,i)=>I(e)?(r&&t.watch.add(e),D(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),D(n,e))):(r&&(t.watchAll=!0),n),L=e=>l(e)||!u(e),te=(e,t)=>t.length===0&&!Array.isArray(e)&&!m(e);function R(e,t,n=new WeakMap){if(e===t)return!0;if(L(e)||L(t))return Object.is(e,t);if(c(e)&&c(t))return Object.is(e.getTime(),t.getTime());let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(te(e,r)||te(t,i))return Object.is(e,t);if(!r.length&&Array.isArray(e)!==Array.isArray(t))return!1;let a=n.get(e);if(a&&a.has(t))return!0;if(a)a.add(t);else{let r=new WeakSet;r.add(t),n.set(e,r)}for(let i of r){let r=e[i];if(!(i in t))return!1;if(i!==`ref`){let e=t[i];if(c(r)&&c(e)||(d(r)||Array.isArray(r))&&(d(e)||Array.isArray(e))?!R(r,e,n):!Object.is(r,e))return!1}}return!0}function z(e){let t=M(),{control:n=t,name:r,defaultValue:i,disabled:a,exact:s,compute:c}=e||{},l=o.useRef(i),u=o.useRef(c),d=o.useRef(void 0),f=o.useRef(n),p=o.useRef(r);u.current=c;let[m,h]=o.useState(()=>{let e=n._getWatch(r,l.current);return u.current?u.current(e):e}),g=o.useCallback(e=>{let t=ee(r,n._names,e||n._formValues,!1,l.current);return u.current?u.current(t):t},[n._formValues,n._names,r]),_=o.useCallback(e=>{if(!a){let t=ee(r,n._names,e||n._formValues,!1,l.current);if(u.current){let e=u.current(t);R(e,d.current)||(h(e),d.current=e)}else h(t)}},[n._formValues,n._names,a,r]);P(()=>((f.current!==n||!R(p.current,r))&&(f.current=n,p.current=r,_()),n._subscribe({name:r,formState:{values:!0},exact:s,callback:e=>{_(e.values)}})),[n,s,r,_]),o.useEffect(()=>n._removeUnmounted());let v=f.current!==n,y=p.current,b=o.useMemo(()=>{if(a)return null;let e=!v&&!R(y,r);return v||e?g():null},[a,v,r,y,g]);return b===null?m:b}function B(e){let t=M(),{name:n,disabled:r,control:i=t,shouldUnregister:a,defaultValue:s,exact:c=!0}=e,l=p(i._names.array,n),u=z({control:i,name:n,defaultValue:o.useMemo(()=>D(i._formValues,n,D(i._defaultValues,n,s)),[i,n,s]),exact:c}),d=F({control:i,name:n,exact:c}),m=o.useRef(e),h=o.useRef(null),v=o.useRef(i.register(n,{...e.rules,value:u,...O(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;let y=o.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!D(d.errors,n)},isDirty:{enumerable:!0,get:()=>!!D(d.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!D(d.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!D(d.validatingFields,n)},error:{enumerable:!0,get:()=>D(d.errors,n)}}),[d,n]),b=o.useCallback(e=>{let t=f(e);return D(i._fields,n)||(v.current=i.register(n,{...m.current.rules,value:t})),v.current.onChange({target:{value:f(e),name:n},type:_.CHANGE})},[n,i]),x=o.useCallback(()=>v.current.onBlur({target:{value:D(i._formValues,n),name:n},type:_.BLUR}),[n,i._formValues]),S=o.useCallback(e=>{e&&(h.current={focus:()=>k(e.focus)&&e.focus(),select:()=>k(e.select)&&e.select(),setCustomValidity:t=>k(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>k(e.reportValidity)&&e.reportValidity()});let t=D(i._fields,n);t&&t._f&&e&&(t._f.ref=h.current)},[i._fields,n]),C=o.useMemo(()=>({name:n,value:u,...O(r)||d.disabled?{disabled:d.disabled||r}:{},onChange:b,onBlur:x,ref:S}),[n,r,d.disabled,b,x,S,u]);return o.useEffect(()=>{let e=i._options.shouldUnregister||a;i.register(n,{...m.current.rules,...O(m.current.disabled)?{disabled:m.current.disabled}:{}});let t=(e,t)=>{let n=D(i._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){let e=g(D(a?i._defaultValues:i._options.values||i._defaultValues,n,D(i._options.defaultValues,n,m.current.defaultValue)));A(i._defaultValues,n,e),w(D(i._formValues,n))&&A(i._formValues,n,e)}if(!l&&i.register(n),h.current){let e=D(i._fields,n);e&&e._f&&(e._f.ref=h.current)}return()=>{(l?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,l,a]),o.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),o.useMemo(()=>({field:C,formState:d,fieldState:y}),[C,d,y])}var ne=e=>e.render(B(e)),re=e=>{let t={};for(let n of Object.keys(e))if(u(e[n])&&e[n]!==null&&!c(e[n])){let r=re(e[n]);for(let e of Object.keys(r))t[`${n}.${e}`]=r[e]}else t[n]=e[n];return t},ie=o.createContext(null);ie.displayName=`HookFormContext`;var ae=()=>o.useContext(ie),oe=({children:e,watch:t,getValues:n,getFieldState:r,setError:i,clearErrors:a,setValue:s,setValues:c,trigger:l,formState:u,resetField:d,reset:f,handleSubmit:p,unregister:m,control:h,register:g,setFocus:_,subscribe:v})=>{let y=o.useMemo(()=>({watch:t,getValues:n,getFieldState:r,setError:i,clearErrors:a,setValue:s,setValues:c,trigger:l,formState:u,resetField:d,reset:f,handleSubmit:p,unregister:m,control:h,register:g,setFocus:_,subscribe:v}),[a,h,u,r,n,p,g,f,d,i,_,s,c,v,l,m,t]);return o.createElement(ie.Provider,{value:y},o.createElement(j.Provider,{value:y.control},e))},se=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},ce=e=>Array.isArray(e)?e.filter(Boolean):[],le=e=>Array.isArray(e)?e:[e],ue=()=>{let e=[];return{get observers(){return e},next:t=>{for(let n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function de(e,t){let n={};for(let r in e)if(e.hasOwnProperty(r)){let i=e[r],a=t[r];if(i&&d(i)&&a){let e=de(i,a);d(e)&&(n[r]=e)}else e[r]&&(n[r]=a)}return n}var V=e=>d(e)&&!Object.keys(e).length,fe=e=>e.type===`file`,pe=e=>{if(!h)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},me=e=>e.type===`select-multiple`,H=e=>e.type===`radio`,he=e=>H(e)||s(e),ge=e=>pe(e)&&e.isConnected;function _e(e,t){let n=t.slice(0,-1).length,r=0;for(;r<n;){if(l(e)){e=void 0;break}e=e[t[r]],r++}return e}function ve(e){for(let t in e)if(e.hasOwnProperty(t)&&!w(e[t]))return!1;return!0}function U(e,t){if(I(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let n=Array.isArray(t)?t:C(t)?[t]:E(t);if(n.some(e=>x.includes(String(e))))return e;let r=n.length===1?e:_e(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(d(r)&&V(r)||Array.isArray(r)&&ve(r))&&U(e,n.slice(0,-1)),e}var W=e=>{for(let t in e)if(k(e[t]))return!0;return!1};function ye(e){return Array.isArray(e)||d(e)&&!W(e)}function be(e,t={}){for(let n in e){let r=e[n];ye(r)?(t[n]=Array.isArray(r)?[]:{},be(r,t[n])):w(r)||(t[n]=!0)}return t}function G(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){let t=e.map(e=>G(e));return t.some(e=>e!==void 0)?t:void 0}if(d(e)){let t={};for(let n in e){let r=G(e[n]);w(r)||(t[n]=r)}return Object.keys(t).length?t:void 0}}}function K(e,t,n){n||=be(t);for(let r in e){let i=e[r];if(ye(i))w(t)||L(n[r])?n[r]=be(i,Array.isArray(i)?[]:{}):K(i,l(t)?{}:t[r],n[r]);else{let e=t[r];n[r]=!R(i,e)}}return G(n)||{}}var xe={value:!1,isValid:!1},q={value:!0,isValid:!0},Se=e=>{if(Array.isArray(e)){if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!w(e[0].attributes.value)?w(e[0].value)||e[0].value===``?q:{value:e[0].value,isValid:!0}:q:xe}return xe},Ce=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>w(e)?e:t?e===``?NaN:e&&+e:n&&I(e)?new Date(e):r?r(e):e,we={isValid:!1,value:null},Te=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,we):we;function Ee(e){let t=e.ref;return fe(t)?t.files:H(t)?Te(e.refs).value:me(t)?[...t.selectedOptions].map(({value:e})=>e):s(t)?Se(e.refs).value:Ce(w(t.value)?e.ref.value:t.value,e)}var De=(e,t,n,r)=>{let i={};for(let n of e){let e=D(t,n);e&&A(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},J=e=>e instanceof RegExp,Oe=e=>w(e)?e:J(e)?e.source:d(e)?J(e.value)?e.value.source:e.value:e,ke=e=>({isOnSubmit:!e||e===v.onSubmit,isOnBlur:e===v.onBlur,isOnChange:e===v.onChange,isOnAll:e===v.all,isOnTouch:e===v.onTouched}),Ae=`AsyncFunction`,je=e=>{if(!e||!e.validate)return!1;if(k(e.validate))return e.validate.constructor.name===Ae;if(d(e.validate)){for(let t in e.validate)if(e.validate[t].constructor.name===Ae)return!0}return!1},Me=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Ne=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(let n of t.watch)if(e.startsWith(n)&&e.charAt(n.length)===`.`)return!0;return!1},Y=(e,t,n,r)=>{for(let i of n||Object.keys(e)){let n=D(e,i);if(n){let{_f:e,...a}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r||e.ref&&t(e.ref,e.name)&&!r)return!0;if(Y(a,t))break}else if(d(a)&&Y(a,t))break}}};function Pe(e,t,n){let r=D(e,n);if(r||C(n))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=D(t,r),o=D(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};if(o&&o.root&&o.root.type)return{name:`${r}.root`,error:o.root};i.pop()}return{name:n}}var Fe=(e,t,n,r)=>{n(e);let{name:i,...a}=e,o=Object.keys(a);return!o.length||r&&o.length>=Object.keys(t).length||o.find(e=>t[e]===(!r||v.all))},Ie=(e,t,n)=>!e||!t||e===t||le(e).some(e=>e&&(n?e===t||e.startsWith(t+`.`):e.startsWith(t)||t.startsWith(e))),Le=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,Re=(e,t)=>!ce(D(e,t)).length&&U(e,t),ze=(e,t,n)=>{let r=D(e,n),i=Array.isArray(r)?r:[];return A(i,b,t[n]),A(e,n,i),e};function X(e,t,n=`validate`){if(I(e)||Array.isArray(e)&&e.every(I)||O(e)&&!e)return{type:n,message:I(e)?e:``,ref:t}}var Z=e=>d(e)&&!J(e)?e:{value:e,message:``},Be=async(e,t,n,r,i,a)=>{let{ref:o,refs:c,required:u,maxLength:f,minLength:p,min:m,max:h,pattern:g,validate:_,name:v,valueAsNumber:b,mount:x}=e._f,S=D(n,v);if(!x||t.has(v))return{};let C=c?c[0]:o,T=e=>{if(i&&C.reportValidity){let t=O(e)?``:e||``;c?c.forEach(e=>e.setCustomValidity(t)):C.setCustomValidity(t),C.reportValidity()}},E={},A=H(o),j=s(o),M=A||j,N=(b||fe(o))&&w(o.value)&&w(S)||pe(o)&&o.value===``||S===``||Array.isArray(S)&&!S.length,P=se.bind(null,v,r,E),F=(e,t,n,r=y.maxLength,i=y.minLength)=>{let a=e?t:n;E[v]={type:e?r:i,message:a,ref:o,...P(e?r:i,a)}};if(a?!Array.isArray(S)||!S.length:u&&(!M&&(N||l(S))||O(S)&&!S||j&&!Se(c).isValid||A&&!Te(c).isValid)){let{value:e,message:t}=I(u)?{value:!!u,message:u}:Z(u);if(e&&(E[v]={type:y.required,message:t,ref:C,...P(y.required,t)},!r))return T(t),E}if(!N&&(!l(m)||!l(h))){let e,t,n=Z(h),i=Z(m);if(!l(S)&&!isNaN(S)){let r=o.valueAsNumber||S&&+S;l(n.value)||(e=r>n.value),l(i.value)||(t=r<i.value)}else{let r=o.valueAsDate||new Date(S),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;I(n.value)&&S&&(e=s?a(S)>a(n.value):c?S>n.value:r>new Date(n.value)),I(i.value)&&S&&(t=s?a(S)<a(i.value):c?S<i.value:r<new Date(i.value))}if((e||t)&&(F(!!e,n.message,i.message,y.max,y.min),!r))return T(E[v].message),E}if((f||p)&&!N&&(I(S)||a&&Array.isArray(S))){let e=Z(f),t=Z(p),n=!l(e.value)&&S.length>+e.value,i=!l(t.value)&&S.length<+t.value;if((n||i)&&(F(n,e.message,t.message),!r))return T(E[v].message),E}if(g&&!N&&I(S)){let{value:e,message:t}=Z(g);if(J(e)&&!S.match(e)&&(E[v]={type:y.pattern,message:t,ref:o,...P(y.pattern,t)},!r))return T(t),E}if(_){if(k(_)){let e=X(await _(S,n),C);if(e&&(E[v]={...e,...P(y.validate,e.message)},!r))return T(e.message),E}else if(d(_)){let e={};for(let t in _){if(!V(e)&&!r)break;let i=X(await _[t](S,n),C,t);i&&(e={...i,...P(t,i.message)},T(i.message),r&&(E[v]=e))}if(!V(e)&&(E[v]={ref:C,...e},!r))return E}}return T(!0),E},Ve={mode:v.onSubmit,reValidateMode:v.onChange,shouldFocusError:!0},He=`form`,Ue={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function We(e={}){let t={...Ve,...e},n={...g(Ue),isLoading:k(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},i=(d(t.defaultValues)||d(t.values))&&g(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:g(i),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},m,x=0,S=0,T=ke(t.mode),j=ke(t.reValidateMode),M={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},N={...M},P={...N},F={array:ue(),state:ue()},L=t.criteriaMode===v.all,te=e=>t=>{clearTimeout(x),x=setTimeout(e,t)},z=async e=>{if(!o.keepIsValid&&!t.disabled&&(N.isValid||P.isValid||e)){let e;t.resolver?(e=V((await W()).errors),B()):e=await G({fields:r,onlyCheckValid:!0,eventType:_.VALID}),e!==n.isValid&&F.state.next({isValid:e})}},B=(e,r)=>{!t.disabled&&(N.isValidating||N.validatingFields||P.isValidating||P.validatingFields)&&((e||Array.from(u.mount)).forEach(e=>{e&&(r?A(n.validatingFields,e,r):U(n.validatingFields,e))}),F.state.next({validatingFields:n.validatingFields,isValidating:!V(n.validatingFields)}))},ne=()=>{n.dirtyFields=K(i,a)},ie=(e,i=[],s,c,l=!0,u=!0)=>{if(c&&s&&!t.disabled){if(o.action=!0,u&&Array.isArray(D(r,e))){let t=s(D(r,e),c.argA,c.argB);l&&A(r,e,t)}if(u&&Array.isArray(D(n.errors,e))){let t=s(D(n.errors,e),c.argA,c.argB);l&&A(n.errors,e,t),Re(n.errors,e)}if((N.touchedFields||P.touchedFields)&&u&&Array.isArray(D(n.touchedFields,e))){let t=s(D(n.touchedFields,e),c.argA,c.argB);l&&A(n.touchedFields,e,t)}(N.dirtyFields||P.dirtyFields)&&ne(),F.state.next({name:e,isDirty:q(e,i),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else A(a,e,i)},ae=(e,t)=>{A(n.errors,e,t),n.errors={...n.errors},F.state.next({errors:n.errors})},oe=e=>{n.errors=e,F.state.next({errors:n.errors,isValid:!1})},se=e=>{let t=C(e)?[e]:E(e),n=a,r=i;for(let e=0;e<t.length-1;e++){let i=t[e];if(n=l(n)?n:n[i],r=l(r)?r:r[i],n===null&&r!==null)return!0}return!1},H=(t,s,c,l)=>{let d=D(r,t);if(d){if(se(t))return;let r=w(D(a,t)),f=D(a,t,w(c)?D(i,t):c);w(f)||l&&l.defaultChecked||s?A(a,t,s?f:Ee(d._f)):Te(t,f),o.mount&&!o.action&&(z(),r&&n.isDirty&&(N.isDirty||P.isDirty)&&(q()||(n.isDirty=!1,F.state.next({...n}))),e.shouldUnregister&&r&&!w(D(a,t))&&Ne(t,u)&&(o.watch=!0))}},_e=(e,r,o,s,c)=>{let l=!1,u=!1,d={name:e};if(!t.disabled){if(!o||s){let t=R(D(i,e),r);(N.isDirty||P.isDirty)&&(u=n.isDirty,n.isDirty=d.isDirty=!t||q(),l=u!==d.isDirty),u=!!D(n.dirtyFields,e),t===n.isDirty?t?U(n.dirtyFields,e):A(n.dirtyFields,e,!0):n.dirtyFields=K(i,a),d.dirtyFields=n.dirtyFields,l||=(N.dirtyFields||P.dirtyFields)&&u!==!t}if(o){let t=D(n.touchedFields,e);t||(A(n.touchedFields,e,o),d.touchedFields=n.touchedFields,l||=(N.touchedFields||P.touchedFields)&&t!==o)}l&&c&&F.state.next(d)}return l?d:{}},ve=(e,r,i,a)=>{let o=D(n.errors,e),s=(N.isValid||P.isValid)&&O(r)&&n.isValid!==r;if(t.delayError&&i?(m=te(()=>ae(e,i)),m(t.delayError)):(clearTimeout(x),m=null,i?A(n.errors,e,i):U(n.errors,e),n.errors={...n.errors}),(i?!R(o,i):o)||!V(a)||s){let t={...a,...s&&O(r)?{isValid:r}:{},errors:n.errors,name:e};n={...n,...t},F.state.next(t)}},W=async e=>(B(e,!0),await t.resolver(a,t.context,De(e||u.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),ye=async e=>{let{errors:t}=await W(e);if(B(e),e){for(let r of e){let e=D(t,r);e?u.array.has(r)&&d(e)&&!Object.keys(e).some(e=>!Number.isNaN(Number(e)))?ze(n.errors,{[r]:e},r):A(n.errors,r,e):U(n.errors,r)}n.errors={...n.errors}}else n.errors=t;return t},be=async({name:t,eventType:r})=>{if(e.validate){let i=await e.validate({formValues:a,formState:n,name:t,eventType:r});if(d(i))for(let e in i){let t=i[e];t&&$(`${He}.${e}`,{message:I(t.message)?t.message:``,type:t.type||y.validate})}else I(i)||!i?$(He,{message:i||``,type:y.validate}):Je(He);return i}return!0},G=async({fields:r,onlyCheckValid:i,name:o,eventType:s,context:c={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(c.runRootValidation=!0,!await be({name:o,eventType:s})&&(c.valid=!1,i)))return c.valid;for(let o in r){let l=r[o];if(l){let{_f:r,...d}=l;if(r){let o=u.array.has(r.name),s=l._f&&je(l._f),d=N.validatingFields||N.isValidating||P.validatingFields||P.isValidating;s&&d&&B([r.name],!0);let f=await Be(l,u.disabled,a,L,t.shouldUseNativeValidation&&!i,o);if(s&&d&&B([r.name]),f[r.name]&&(c.valid=!1,i)||(!i&&(D(f,r.name)?o?ze(n.errors,f,r.name):A(n.errors,r.name,f[r.name]):U(n.errors,r.name)),e.shouldUseNativeValidation&&f[r.name]))break}!V(d)&&await G({context:c,onlyCheckValid:i,fields:d,name:o,eventType:s})}}return c.valid},xe=()=>{for(let e of u.unMount){let t=D(r,e);t&&(t._f.refs?t._f.refs.every(e=>!ge(e)):!ge(t._f.ref))&&Qe(e)}u.unMount=new Set},q=(e,n)=>!t.disabled&&(e&&n&&A(a,e,n),!R(o.mount?a:i,i)),Se=(e,t,n)=>ee(e,u,{...o.mount?a:w(t)?i:I(e)?{[e]:t}:t},n,t),we=e=>ce(D(o.mount?a:i,e,t.shouldUnregister?D(i,e,[]):[])),Te=(e,t,n={},i=!1,o=!1)=>{let c=D(r,e),u=t;if(c){let n=c._f;n&&(!n.disabled&&A(a,e,Ce(t,n)),u=pe(n.ref)&&l(t)?``:t,me(n.ref)?[...n.ref.options].forEach(e=>e.selected=u.includes(e.value)):n.refs?s(n.ref)?n.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(Array.isArray(u)?e.checked=!!u.find(t=>t===e.value):e.checked=u===e.value||!!u)}):n.refs.forEach(e=>e.checked=e.value===u):fe(n.ref)?n.ref.value=``:(n.ref.value=u,!n.ref.type&&!o&&F.state.next({name:e,values:i?a:g(a)})))}(n.shouldDirty||n.shouldTouch)&&_e(e,u,n.shouldTouch,n.shouldDirty,!o),n.shouldValidate&&Q(e)},J=(e,t,n,i=!1,a=!1)=>{for(let o in t){if(!t.hasOwnProperty(o))return;let s=t[o],l=e+`.`+o,f=D(r,l);(u.array.has(e)||d(s)||f&&!f._f)&&!c(s)?J(l,s,n,i,a):Te(l,s,n,i,a)}},Ae=(e,t,i,s,c=!1)=>{let d=D(r,e),f=u.array.has(e),p=s?t:g(t),m=R(D(a,e),p);if(m||A(a,e,p),f)F.array.next({name:e,values:s?a:g(a)}),(N.isDirty||N.dirtyFields||P.isDirty||P.dirtyFields)&&i.shouldDirty&&(ne(),c||F.state.next({name:e,dirtyFields:n.dirtyFields,isDirty:q(e,p)}));else{let t=Array.isArray(p)&&!p.length||V(p);!d||d._f||l(p)||t?Te(e,p,i,s,c):J(e,p,i,s,c)}if(!m&&!c){let t=Ne(e,u),r=s?a:g(a);F.state.next({...t&&n,name:o.mount||t?e:void 0,values:r})}},X=(e,t,n={})=>Ae(e,t,n,!1),Z=(e,t={})=>{let r=k(e)?e(a):e;if(!R(a,r)){a={...a,...r};let e=re(r);for(let n of u.mount)n in e&&Ae(n,e[n],t,!0,!0);F.state.next({...n,name:void 0,type:void 0,...S?{values:a}:{}}),t.shouldValidate&&z()}},We=async i=>{o.mount=!0;let s=i.target,l=s.name,d=!0,p=D(r,l),h=e=>{d=Number.isNaN(e)||c(e)&&isNaN(e.getTime())||R(e,D(a,l,e))};if(p){let o,c,v=s.type?Ee(p._f):f(i),y=i.type===_.BLUR||i.type===_.FOCUS_OUT,b=!Me(p._f)&&!e.validate&&!t.resolver&&!D(n.errors,l)&&!p._f.deps,x=b||Le(y,D(n.touchedFields,l),n.isSubmitted,j,T),C=Ne(l,u,y);A(a,l,v),y?(!s||!s.readOnly)&&(p._f.onBlur&&p._f.onBlur(i),m&&m(0)):p._f.onChange&&p._f.onChange(i);let w=_e(l,v,y),E=!V(w)||C;if(!y&&F.state.next({name:l,type:i.type,...S?{values:g(a)}:{}}),x)return(!b||!n.isValid)&&(N.isValid||P.isValid)&&(t.mode===`onBlur`?y&&z():y||z()),E&&F.state.next({name:l,...C?{}:w});if(!t.resolver&&e.validate&&await be({name:l,eventType:i.type}),!y&&C&&F.state.next({...n}),t.resolver){let{errors:e}=await W([l]);if(B([l]),h(v),!d){!V(w)&&F.state.next(w);return}let t=Pe(n.errors,r,l),i=Pe(e,r,t.name||l);o=i.error,l=i.name,c=V(e)}else B([l],!0),o=(await Be(p,u.disabled,a,L,t.shouldUseNativeValidation))[l],B([l]),h(v),d&&(o?c=!1:(N.isValid||P.isValid)&&(c=await G({fields:r,onlyCheckValid:!0,name:l,eventType:i.type})));d&&(p._f.deps&&(!Array.isArray(p._f.deps)||p._f.deps.length>0)&&Q(p._f.deps),ve(l,c,o,w))}},Ge=(e,t)=>{if(D(n.errors,t)&&e.focus)return e.focus(),1},Q=async(e,i={})=>{let a,o,s=le(e);if(t.resolver){let t=await ye(w(e)?e:s);a=V(t),o=e?!s.some(e=>D(t,e)):a}else e?(o=(await Promise.all(s.map(async e=>{let t=D(r,e);return await G({fields:t&&t._f?{[e]:t}:t,eventType:_.TRIGGER})}))).every(Boolean),!(!o&&!n.isValid)&&z()):o=a=await G({fields:r,name:e,eventType:_.TRIGGER});return F.state.next({...!I(e)||(N.isValid||P.isValid)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},errors:n.errors}),i.shouldFocus&&!o&&Y(r,Ge,e?s:u.mount),o},Ke=(e,t)=>{let r={...o.mount?a:i};return t&&(r=de(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),w(e)?r:I(e)?D(r,e):e.map(e=>D(r,e))},qe=(e,t)=>({invalid:!!D((t||n).errors,e),isDirty:!!D((t||n).dirtyFields,e),error:D((t||n).errors,e),isValidating:!!D(n.validatingFields,e),isTouched:!!D((t||n).touchedFields,e)}),Je=e=>{let t=e?le(e):void 0;t?.forEach(e=>U(n.errors,e)),t?t.forEach(e=>{F.state.next({name:e,errors:n.errors})}):F.state.next({errors:{}})},$=(e,t,i)=>{let a=(D(r,e,{_f:{}})._f||{}).ref,{ref:o,message:s,type:c,...l}=D(n.errors,e)||{};A(n.errors,e,{...l,...t,ref:a}),F.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&a&&a.focus&&a.focus()},Ye=(e,t)=>{if(k(e)){S++;let{unsubscribe:n}=F.state.subscribe({next:n=>`values`in n&&e(n.values||Se(void 0,t),n)}),r=!1;return{unsubscribe:()=>{r||(r=!0,S--,n())}}}return Se(e,t,!0)},Xe=e=>{let t=!!e.formState?.values;t&&S++;let{unsubscribe:r}=F.state.subscribe({next:t=>{if(Ie(e.name,t.name,e.exact)&&Fe(t,e.formState||N,ct,e.reRenderRoot)){let r={...a};e.callback({values:r,...n,...t,defaultValues:i})}}});if(!t)return r;let o=!1;return()=>{o||(o=!0,S--,r())}},Ze=e=>(o.mount=!0,P={...P,...e.formState},Xe({...e,formState:{...M,...e.formState}})),Qe=(e,o={})=>{for(let s of e?le(e):u.mount)u.mount.delete(s),u.array.delete(s),o.keepValue||(U(r,s),U(a,s)),!o.keepError&&U(n.errors,s),!o.keepDirty&&U(n.dirtyFields,s),!o.keepTouched&&U(n.touchedFields,s),!o.keepIsValidating&&U(n.validatingFields,s),!t.shouldUnregister&&!o.keepDefaultValue&&U(i,s);F.state.next({values:g(a)}),F.state.next({...n,...o.keepDirty?{isDirty:q()}:{}}),!o.keepIsValid&&z()},$e=({disabled:e,name:t})=>{if(O(e)&&o.mount||e||u.disabled.has(t)){let n=u.disabled.has(t)!==!!e;e?u.disabled.add(t):u.disabled.delete(t),n&&o.mount&&!o.action&&z()}},et=(e,n={})=>{let a=D(r,e),s=O(n.disabled)||O(t.disabled),c=!u.registerName.has(e)&&a&&a._f&&!a._f.mount;return A(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),u.mount.add(e),a&&!c?$e({disabled:O(n.disabled)?n.disabled:t.disabled,name:e}):H(e,!0,n.value),{...s?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!n.required,min:Oe(n.min),max:Oe(n.max),minLength:Oe(n.minLength),maxLength:Oe(n.maxLength),pattern:Oe(n.pattern)}:{},name:e,onChange:We,onBlur:We,ref:s=>{if(s){u.registerName.add(e),et(e,n),u.registerName.delete(e),a=D(r,e);let t=w(s.value)&&s.querySelectorAll&&s.querySelectorAll(`input,select,textarea`)[0]||s,o=he(t),c=a._f.refs||[];if(o?c.find(e=>e===t):t===a._f.ref)return;A(r,e,{_f:{...a._f,...o?{refs:[...c.filter(ge),t,...Array.isArray(D(i,e))?[{}]:[]],ref:{type:t.type,name:e}}:{ref:t}}}),H(e,!1,void 0,t)}else a=D(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(p(u.array,e)&&o.action)&&u.unMount.add(e)}}},tt=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Y(r,Ge,u.mount),nt=e=>{O(e)&&(F.state.next({disabled:e}),Y(r,(t,n)=>{let i=D(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0,!1))},rt=(e,i)=>async o=>{let s;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let c=g(a);if(F.state.next({isSubmitting:!0}),t.resolver){let{errors:e,values:t}=await W();B(),n.errors=e,c=g(t)}else await G({fields:r,eventType:_.SUBMIT});if(u.disabled.size)for(let e of u.disabled)U(c,e);if(U(n.errors,b),V(n.errors)){F.state.next({errors:{}});try{await e(c,o)}catch(e){s=e}}else i&&await i({...n.errors},o),tt(),setTimeout(tt);if(F.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:V(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},it=(e,t={})=>{D(r,e)&&(w(t.defaultValue)?X(e,g(D(i,e))):(X(e,t.defaultValue),A(i,e,g(t.defaultValue))),t.keepTouched||U(n.touchedFields,e),t.keepDirty||(U(n.dirtyFields,e),n.isDirty=t.defaultValue?q(e,g(D(i,e))):q()),t.keepError||(U(n.errors,e),N.isValid&&z()),F.state.next({...n}))},at=(e,s={})=>{let c=e?g(e):i,l=g(c),d=V(e),f=l;if(s.keepDefaultValues||(i=c),!s.keepValues){if(s.keepDirtyValues){let e=new Set([...u.mount,...Object.keys(K(i,a))]);for(let t of Array.from(e)){let e=D(n.dirtyFields,t),r=D(a,t),i=D(f,t);e&&!w(r)?A(f,t,r):!e&&!w(i)&&X(t,i)}}else{if(h&&w(e))for(let e of u.mount){let t=D(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(pe(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(s.keepFieldsRef)for(let e of u.mount)X(e,D(f,e));else r={}}if(t.shouldUnregister){if(a=s.keepDefaultValues?g(i):{},s.keepFieldsRef)for(let e of u.mount)A(a,e,D(f,e))}else a=g(f);F.array.next({values:{...f}}),F.state.next({name:void 0,type:void 0,values:{...f}})}u={mount:s.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!N.isValid||!!s.keepIsValid||!!s.keepDirtyValues||!t.shouldUnregister&&!V(f),o.watch=!!t.shouldUnregister,o.keepIsValid=!!s.keepIsValid,o.action=!1,s.keepErrors||(n.errors={}),F.state.next({submitCount:s.keepSubmitCount?n.submitCount:0,isDirty:d?!1:s.keepDirty?n.isDirty:s.keepValues?q():!!(s.keepDefaultValues&&!R(e,i)),isSubmitted:s.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:d?{}:s.keepDirtyValues?s.keepDefaultValues&&a?K(i,a):n.dirtyFields:s.keepDefaultValues&&e?K(i,e):s.keepDirty?n.dirtyFields:{},touchedFields:s.keepTouched?n.touchedFields:{},errors:s.keepErrors?n.errors:{},isSubmitSuccessful:s.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},ot=(e,n)=>at(k(e)?e(a):e,{...t.resetOptions,...n}),st=(e,t={})=>{let n=D(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&k(e.select)&&e.select()})}},ct=e=>{let{name:t,type:r,values:i,...a}=e;n={...n,...a}},lt={control:{register:et,unregister:Qe,getFieldState:qe,handleSubmit:rt,setError:$,_subscribe:Xe,_runSchema:W,_updateIsValidating:B,_focusError:tt,_getWatch:Se,_getDirty:q,_setValid:z,_setFieldArray:ie,_setDisabledField:$e,_setErrors:oe,_getFieldArray:we,_reset:at,_resetDefaultValues:()=>k(t.defaultValues)&&t.defaultValues().then(e=>{ot(e,t.resetOptions),F.state.next({isLoading:!1})}),_removeUnmounted:xe,_disableForm:nt,_subjects:F,_proxyFormState:N,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return u},set _names(e){u=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e},T=ke(t.mode),j=ke(t.reValidateMode)}},subscribe:Ze,trigger:Q,register:et,handleSubmit:rt,watch:Ye,setValue:X,setValues:Z,getValues:Ke,reset:ot,resetField:it,resetDefaultValues:(e,t={})=>{if(i=g(e),!t.keepDirty){let e=K(i,a);n.dirtyFields=e,n.isDirty=!V(e)}t.keepIsValid||z(),F.state.next({...n,defaultValues:i})},clearErrors:Je,unregister:Qe,setError:$,setFocus:st,getFieldState:qe};return{...lt,formControl:lt}}function Ge(e={}){let t=o.useRef(void 0),n=o.useRef(void 0),r=o.useRef(e.formControl),[i,a]=o.useState(()=>({...g(Ue),isLoading:k(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:k(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl)if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!k(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...r}=We(e);t.current={...r,formState:i}}let s=t.current.control;return s._options=e,P(()=>{let e=s._subscribe({formState:s._proxyFormState,callback:()=>a({...s._formState,defaultValues:s._defaultValues}),reRenderRoot:!0});return a(e=>({...e,isReady:!0})),s._formState.isReady=!0,e},[s]),o.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),o.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),o.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),o.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),o.useEffect(()=>{if(s._proxyFormState.isDirty){let e=s._getDirty();e!==i.isDirty&&s._subjects.state.next({isDirty:e})}},[s,i.isDirty]),o.useEffect(()=>{e.values&&!R(e.values,n.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),s._options.resetOptions?.keepIsValid||s._setValid(),n.current=e.values,a(e=>({...e}))):s._resetDefaultValues()},[s,e.values]),o.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=o.useMemo(()=>N(i,s),[s,i]),t.current}function Q({className:e,...t}){return(0,a.jsx)(`label`,{"data-slot":`label`,className:i(`text-sm leading-none font-medium select-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var Ke=oe,qe=o.createContext({}),Je=({...e})=>(0,a.jsx)(qe.Provider,{value:{name:e.name},children:(0,a.jsx)(ne,{...e})}),$=()=>{let e=o.useContext(qe),t=o.useContext(Ye),{getFieldState:n}=ae(),r=F({name:e.name}),i=n(e.name,r);if(!e)throw Error(`useFormField should be used within <FormField>`);let{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...i}},Ye=o.createContext({});function Xe({className:e,...t}){let n=o.useId();return(0,a.jsx)(Ye.Provider,{value:{id:n},children:(0,a.jsx)(`div`,{"data-slot":`form-item`,className:i(`grid gap-2`,e),...t})})}function Ze({className:e,...t}){let{error:n,formItemId:r}=$();return(0,a.jsx)(Q,{"data-slot":`form-label`,"data-error":!!n,className:i(`data-[error=true]:text-destructive`,e),htmlFor:r,...t})}function Qe({...e}){let{error:t,formItemId:n,formDescriptionId:i,formMessageId:o}=$();return(0,a.jsx)(r,{"data-slot":`form-control`,id:n,"aria-describedby":t?`${i} ${o}`:`${i}`,"aria-invalid":!!t,...e})}function $e({className:e,...t}){let{formDescriptionId:n}=$();return(0,a.jsx)(`p`,{"data-slot":`form-description`,id:n,className:i(`text-muted-foreground text-sm`,e),...t})}function et({className:e,...t}){let{error:n,formMessageId:r}=$(),o=n?String(n?.message??``):t.children;return o?(0,a.jsx)(`p`,{"data-slot":`form-message`,id:r,className:i(`text-destructive text-sm`,e),...t,children:o}):null}export{Xe as a,Q as c,A as d,Ge as f,Je as i,se as l,Qe as n,Ze as o,z as p,$e as r,et as s,Ke as t,D as u};
|