@tanstack/react-router 0.0.1-beta.45 → 0.0.1-beta.48

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.
@@ -18,5 +18,5 @@
18
18
  * LICENSE.md file in the root directory of this source tree.
19
19
  *
20
20
  * @license MIT
21
- */function K(t){return t[t.length-1]}function W(t,e){if(t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch{}}return!0}function V(t,e){return"function"==typeof t?t(e):t}function q(t,e){return e.reduce(((e,r)=>(e[r]=t[r],e)),{})}function J(t){return X(t.filter(Boolean).join("/"))}function X(t){return t.replace(/\/{2,}/g,"/")}function Q(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function Y(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function Z(t){return Y(Q(t))}function tt(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let n=et(e);const o=et(r);o.forEach(((t,e)=>{if("/"===t.value)e?e===o.length-1&&n.push(t):n=[t];else if(".."===t.value){var r;n.length>1&&"/"===(null==(r=K(n))?void 0:r.value)&&n.pop(),n.pop()}else{if("."===t.value)return;n.push(t)}}));return X(J([t,...n.map((t=>t.value))]))}function et(t){if(!t)return[];const e=[];if("/"===(t=X(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const r=t.split("/").filter(Boolean);return e.push(...r.map((t=>t.startsWith("*")?{type:"wildcard",value:t}:"$"===t.charAt(0)?{type:"param",value:t}:{type:"pathname",value:t}))),"/"===t.slice(-1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}function rt(t,e,r){return J(et(t).map((t=>"*"!==t.value||r?"param"===t.type?e[t.value.substring(1)]??"":t.value:"")))}function nt(t,e,r){const n=ot(t,e,r);if(!r.to||n)return n??{}}function ot(t,e,r){if(!e.startsWith(t))return;const n=et(e="/"!=t?e.substring(t.length):e),o=et(`${r.to??"*"}`),a={};return(()=>{for(let t=0;t<Math.max(n.length,o.length);t++){const e=n[t],s=o[t],i=t===o.length-1,c=t===n.length-1;if(s){if("wildcard"===s.type)return!(null==e||!e.value)&&(a["*"]=J(n.slice(t).map((t=>t.value))),!0);if("pathname"===s.type){if("/"===s.value&&(null==e||!e.value))return!0;if(e)if(r.caseSensitive){if(s.value!==e.value)return!1}else if(s.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===s.type){if("/"===(null==e?void 0:e.value))return!1;"$"!==e.value.charAt(0)&&(a[s.value.substring(1)]=e.value)}}if(i&&!c)return!!r.fuzzy}return!0})()?a:void 0}function at(t,e){var r,n,o,a="";for(r in t)if(void 0!==(o=t[r]))if(Array.isArray(o))for(n=0;n<o.length;n++)a&&(a+="&"),a+=encodeURIComponent(r)+"="+encodeURIComponent(o[n]);else a&&(a+="&"),a+=encodeURIComponent(r)+"="+encodeURIComponent(o);return(e||"")+a}function st(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function it(t){for(var e,r,n={},o=t.split("&");e=o.shift();)void 0!==n[r=(e=e.split("=")).shift()]?n[r]=[].concat(n[r],st(e.shift())):n[r]=st(e.shift());return n}function ct(t,e,r,n,o){const{id:a,routeId:s,path:i,fullPath:c}=t;let l={routeInfo:void 0,routeId:a,routeRouteId:s,originalIndex:r,routePath:i,fullPath:c,options:e,router:o,childRoutes:void 0,parentRoute:n,get action(){let t=o.store.actions[a]||(o.setStore((e=>{e.actions[a]={submissions:[],submit:async(e,r)=>{if(!l)return;const n=(null==r?void 0:r.invalidate)??!0,[s,i]=C({submittedAt:Date.now(),status:"pending",submission:e,isMulti:!(null==r||!r.multi)});o.setStore((e=>{null!=r&&r.multi||(e.actions[a].submissions=t.submissions.filter((t=>t.isMulti))),e.actions[a].current=s,e.actions[a].latest=s,e.actions[a].submissions.push(s)}));try{const t=await(null==l.options.action?void 0:l.options.action(e));return i((e=>{e.data=t})),n&&(o.invalidateRoute({to:".",fromCurrent:!0}),await o.reload()),i((t=>{t.status="success"})),t}catch(t){console.error(t),i((e=>{e.error=t,e.status="error"}))}}}})),o.store.actions[a]);return t},get loader(){return o.store.loaders[a]||(o.setStore((t=>{t.loaders[a]={pending:[],fetch:async t=>{if(!l)return;const e={loadedAt:Date.now(),loaderContext:t};o.setStore((t=>{t.loaders[a].current=e,t.loaders[a].latest=e,t.loaders[a].pending.push(e)}));try{return await(null==l.options.loader?void 0:l.options.loader(t))}finally{o.setStore((t=>{t.loaders[a].pending=t.loaders[a].pending.filter((t=>t!==e))}))}}}})),o.store.loaders[a])}};return null==o.options.createRoute||o.options.createRoute({router:o,route:l}),l}const lt="__root__",ut=function(t,e,r,n,o){void 0===t&&(t={}),void 0===r&&(r=!0),r&&(t.path=lt),n===lt&&(n="");let a=r?lt:t.path;a&&"/"!==a&&(a=Z(a));const s=a||t.id;let i=J([n,s]);a===lt&&(a="/"),i!==lt&&(i=J(["/",i]));const c=i===lt?"/":Y(J([o,a]));return{id:i,routeId:s,path:a,fullPath:c,options:t,children:e,addChildren:e=>ut(t,e,!1,n,o),createRoute:t=>ut(t,void 0,!1,i,c),generate:()=>{G(!1)}}};function ht(t,e,r){const n=new Map;return function t(e,r){if(e===r)return e;if(n.has(r))return n.get(r);const o=Array.isArray(e),a=Array.isArray(r),s=dt(e),i=dt(r),c=o&&a;if(c||s&&i){const o=c?e.length:Object.keys(e).length,a=c?r:Object.keys(r),s=a.length,i=c?[]:{};let l=0;for(let t=0;t<s;t++){const r=c?t:a[t];i[r]===e[r]&&l++}if(o===s&&l===o)return n.set(r,e),e;n.set(r,i);for(let n=0;n<s;n++){const o=c?n:a[n];"function"==typeof a[n]?i[o]=e[o]:i[o]=t(e[o],r[o]),i[o]===e[o]&&l++}return i}if(a){const e=[];n.set(r,e);for(let n=0;n<r.length;n++)e[n]=t(void 0,r[n]);return e}if(i){const e={};n.set(r,e);const o=Object.keys(r);for(let n=0;n<o.length;n++){const a=o[n];e[a]=t(void 0,r[a])}return e}return r}(t,e)}function dt(t){if(!ft(t))return!1;const e=t.constructor;if(void 0===e)return!0;const r=e.prototype;return!!ft(r)&&!!r.hasOwnProperty("isPrototypeOf")}function ft(t){return"[object Object]"===Object.prototype.toString.call(t)}const pt=["component","errorComponent","pendingComponent"];function mt(t,e,r){let n,o,a="",s=()=>{};function i(){l((t=>{var e;t.loaderData=ht(t.loaderData,{...null==(e=c.parentMatch)?void 0:e.store.loaderData,...t.routeLoaderData})}))}const[c,l]=C({routeSearch:{},search:{},status:"idle",routeLoaderData:{},loaderData:{},isFetching:!1,invalid:!1,invalidAt:1/0,get isInvalid(){const t=Date.now();return this.invalid||this.invalidAt<t}}),u={...e,...r,store:c,router:t,childMatches:[],__:{setParentMatch:t=>{m((()=>{l((e=>{e.parentMatch=t})),i()}))},abortController:new AbortController,validate:()=>{var e;const r=(null==(e=c.parentMatch)?void 0:e.store.search)??t.store.currentLocation.search;try{const t=c.routeSearch,e="object"==typeof u.options.validateSearch?u.options.validateSearch.parse:u.options.validateSearch;let n=ht(t,(null==e?void 0:e(r))??{});m((()=>{t!==n&&l((t=>t.invalid=!0)),l((t=>{t.routeSearch=n,t.search=ht(r,{...r,...n})}))})),pt.map((async t=>{const e=u.options[t];"function"!=typeof u.__[t]&&(u.__[t]=e)}))}catch(t){console.error(t);const e=new Error("Invalid search params found",{cause:t});return e.code="INVALID_SEARCH_PARAMS",void l((t=>{t.status="error",t.error=e}))}}},cancel:()=>{var t;null==(t=u.__.abortController)||t.abort()},invalidate:()=>{l((t=>t.invalid=!0))},hasLoaders:()=>!(!e.options.loader&&!pt.some((t=>{var r;return null==(r=e.options[t])?void 0:r.preload}))),load:async e=>{const r=Date.now(),n=null!=e&&e.preload?Math.max(null==e?void 0:e.maxAge,null==e?void 0:e.gcMaxAge):0;if(null!=e&&e.preload&&n>0){if(t.store.currentMatches.find((t=>t.matchId===u.matchId)))return;t.store.matchCache[u.matchId]={gc:r+e.gcMaxAge,match:u}}if("success"===c.status&&c.isInvalid||"error"===c.status||"idle"===c.status){const t=null!=e&&e.preload?null==e?void 0:e.maxAge:void 0;await u.fetch({maxAge:t})}},fetch:async e=>{const r=""+Date.now()+Math.random();a=r;const h=async()=>{if(r!==a)return new Promise((()=>{}))};m((()=>{"idle"===c.status&&l((t=>t.status="loading")),l((t=>t.invalid=!1))})),u.__.loadPromise=new Promise((async r=>{l((t=>t.isFetching=!0)),s=r,n=(async()=>{await Promise.all(pt.map((async e=>{var r;const n=u.options[e];null!=(r=u.__[e])&&r.preload&&(u.__[e]=await t.options.loadComponent(n))})))})(),o=Promise.resolve().then((async()=>{try{if(u.options.loader){const e=await t.loadMatchData(u);await h(),r=e,m((()=>{l((t=>{t.routeLoaderData=ht(t.routeLoaderData,r)})),i()}))}return l((r=>{r.error=void 0,r.status="success",r.updatedAt=Date.now(),r.invalidAt=r.updatedAt+((null==e?void 0:e.maxAge)??u.options.loaderMaxAge??t.options.defaultLoaderMaxAge??0)})),c.routeLoaderData}catch(t){throw await h(),l((e=>{e.error=t,e.status="error",e.updatedAt=Date.now()})),t}var r}));const a=async()=>{await h(),l((t=>t.isFetching=!1)),delete u.__.loadPromise,s()};try{await Promise.all([n,o.catch((()=>{}))]),a()}catch{a()}})),await u.__.loadPromise,await h()}};return u.hasLoaders()||l((t=>t.status="success")),u}const vt=yt(JSON.parse),gt=bt(JSON.stringify);function yt(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let r=it(e);for(let e in r){const n=r[e];if("string"==typeof n)try{r[e]=t(n)}catch(t){}}return r}}function bt(t){return e=>{(e={...e})&&Object.keys(e).forEach((r=>{const n=e[r];if(void 0===n||void 0===n)delete e[r];else if(n&&"object"==typeof n&&null!==n)try{e[r]=t(n)}catch(t){}}));const r=at(e).toString();return r?`?${r}`:""}}var wt;const Pt="undefined"==typeof window||!(null!=(wt=window.document)&&wt.createElement);function Et(){return{status:"idle",latestLocation:null,currentLocation:null,currentMatches:[],actions:{},loaders:{},lastUpdated:Date.now(),matchCache:{},get isFetching(){return"loading"===this.status||this.currentMatches.some((t=>t.store.isFetching))},get isPreloading(){return Object.values(this.matchCache).some((t=>t.match.store.isFetching&&!this.currentMatches.find((e=>e.matchId===t.match.matchId))))}}}function _t(t){const e={defaultLoaderGcMaxAge:3e5,defaultLoaderMaxAge:0,defaultPreloadMaxAge:2e3,defaultPreloadDelay:50,context:void 0,...t,stringifySearch:(null==t?void 0:t.stringifySearch)??gt,parseSearch:(null==t?void 0:t.parseSearch)??vt},[r,n]=C(Et());let o,a=Date.now(),s=()=>{};function i(){h.load()}function c(t,e){const r=h.options.parseSearch(t.search);return{pathname:t.pathname,searchStr:t.search,search:ht(null==e?void 0:e.search,r),hash:t.hash.split("#").reverse()[0]??"",href:`${t.pathname}${t.search}${t.hash}`,state:t.state,key:t.key}}function l(t){return function(t,e){const r=""+Date.now()+Math.random();let n="replace";e||(n="push");c(h.history.location).href!==t.href||t.key||(n="replace");return h.history[n]({pathname:t.pathname,hash:t.hash,search:t.searchStr},{id:r,...t.state}),o=new Promise((t=>{const e=s;s=()=>{e(),t()}}))}(h.buildNext(t),t.replace)}function u(t){var e,n,o,a;void 0===t&&(t={});const s=t.fromCurrent?r.latestLocation.pathname:t.from??r.latestLocation.pathname;let i=tt(h.basepath??"/",s,`${t.to??"."}`);const c=h.matchRoutes(r.latestLocation.pathname,{strictParseParams:!0}),l=h.matchRoutes(i),u={...null==(e=K(c))?void 0:e.params};let d=!0===(t.params??!0)?u:V(t.params,u);d&&l.map((t=>t.options.stringifyParams)).filter(Boolean).forEach((t=>{Object.assign({},d,t(d))})),i=rt(i,d??{});const f=null!=(n=t.__preSearchFilters)&&n.length?t.__preSearchFilters.reduce(((t,e)=>e(t)),r.latestLocation.search):r.latestLocation.search,p=!0===t.search?f:t.search?V(t.search,f)??{}:null!=(o=t.__preSearchFilters)&&o.length?f:{},m=null!=(a=t.__postSearchFilters)&&a.length?t.__postSearchFilters.reduce(((t,e)=>e(t)),p):p,v=ht(r.latestLocation.search,m),g=h.options.stringifySearch(v);let y=!0===t.hash?r.latestLocation.hash:V(t.hash,r.latestLocation.hash);return y=y?`#${y}`:"",{pathname:i,search:v,searchStr:g,state:r.latestLocation.state,hash:y,href:`${i}${g}${y}`,key:t.key}}const h={types:void 0,history:(null==t?void 0:t.history)||(Pt?N():F()),store:r,setStore:n,options:e,basepath:"",routeTree:void 0,routesById:{},reset:()=>{n((t=>Object.assign(t,Et())))},getRoute:t=>h.routesById[t],dehydrate:()=>({store:{...q(r,["latestLocation","currentLocation","status","lastUpdated"]),currentMatches:r.currentMatches.map((t=>({matchId:t.matchId,store:q(t.store,["status","routeLoaderData","isInvalid","invalidAt"])})))},context:h.options.context}),hydrate:t=>{n((e=>{h.options.context=t.context;const r=h.matchRoutes(t.store.latestLocation.pathname,{strictParseParams:!0});r.forEach(((e,r)=>{const n=t.store.currentMatches[r];G(n&&n.matchId===e.matchId),Object.assign(e,n)})),r.forEach((t=>t.__.validate())),Object.assign(e,{...t.store,currentMatches:r})}))},mount:()=>{if(!Pt){r.currentMatches.length||h.load();const t=h.history.listen((t=>{h.load(c(t.location,r.latestLocation))}));return window.addEventListener&&(window.addEventListener("visibilitychange",i,!1),window.addEventListener("focus",i,!1)),()=>{t(),window.removeEventListener&&(window.removeEventListener("visibilitychange",i),window.removeEventListener("focus",i))}}return()=>{}},update:t=>{const e=(null==t?void 0:t.history)!==h.history;r.latestLocation&&!e||(null!=t&&t.history&&(h.history=t.history),n((t=>{t.latestLocation=c(h.history.location),t.currentLocation=t.latestLocation}))),Object.assign(h.options,t);const{basepath:o,routeConfig:a}=h.options;return h.basepath=`/${Z(o??"")??""}`,a&&(h.routesById={},h.routeTree=function(t){const e=(t,r)=>t.map(((t,n)=>{const o=ct(t,t.options,n,r,h);if(h.routesById[o.routeId])throw new Error;h.routesById[o.routeId]=o;const a=t.children;return o.childRoutes=null!=a&&a.length?e(a,o):void 0,o}));return e([t])[0]}(a)),h},cancelMatches:()=>{[...r.currentMatches,...r.pendingMatches||[]].forEach((t=>{t.cancel()}))},load:async t=>{let e=Date.now();const i=e;let c;a=i,h.cancelMatches(),m((()=>{t&&n((e=>{e.latestLocation=t})),c=h.matchRoutes(r.latestLocation.pathname,{strictParseParams:!0}),console.log("set loading",c),n((t=>{t.status="loading",t.pendingMatches=c,t.pendingLocation=r.latestLocation}))}));try{await h.loadMatches(c)}catch(t){console.log(t),G(!1)}if(a!==i)return o;const l=r.currentMatches,u=[],d=[];l.forEach((t=>{c.find((e=>e.matchId===t.matchId))?d.push(t):u.push(t)}));const f=c.filter((t=>!l.find((e=>e.matchId===t.matchId))));e=Date.now(),u.forEach((t=>{null==t.__.onExit||t.__.onExit({params:t.params,search:t.store.routeSearch}),"error"!==t.store.status||t.store.isFetching||(t.store.status="idle",t.store.error=void 0);const n=Math.max(t.options.loaderGcMaxAge??h.options.defaultLoaderGcMaxAge??0,t.options.loaderMaxAge??h.options.defaultLoaderMaxAge??0);n>0&&(r.matchCache[t.matchId]={gc:n==1/0?Number.MAX_SAFE_INTEGER:e+n,match:t})})),d.forEach((t=>{null==t.options.onTransition||t.options.onTransition({params:t.params,search:t.store.routeSearch})})),f.forEach((t=>{t.__.onExit=null==t.options.onLoaded?void 0:t.options.onLoaded({params:t.params,search:t.store.search}),delete r.matchCache[t.matchId]})),a===i&&(c.forEach((t=>{t.action&&(t.action.current=void 0,t.action.submissions=[])})),n((t=>{console.log("set",c),Object.assign(t,{status:"idle",currentLocation:r.latestLocation,currentMatches:c,pendingLocation:void 0,pendingMatches:void 0})})),s())},cleanMatchCache:()=>{const t=Date.now();n((e=>{Object.keys(e.matchCache).forEach((r=>{const n=e.matchCache[r];"loading"!==n.match.store.status&&(n.gc>0&&n.gc>t||delete e.matchCache[r])}))}))},loadRoute:async function(t){void 0===t&&(t=r.latestLocation);const e=h.buildNext(t),n=h.matchRoutes(e.pathname,{strictParseParams:!0});return await h.loadMatches(n),n},preloadRoute:async function(t,e){void 0===t&&(t=r.latestLocation);const n=h.buildNext(t),o=h.matchRoutes(n.pathname,{strictParseParams:!0});return await h.loadMatches(o,{preload:!0,maxAge:e.maxAge??h.options.defaultPreloadMaxAge??h.options.defaultLoaderMaxAge??0,gcMaxAge:e.gcMaxAge??h.options.defaultPreloadGcMaxAge??h.options.defaultLoaderGcMaxAge??0}),o},matchRoutes:(t,e)=>{h.cleanMatchCache();const n=[];if(!h.routeTree)return n;const o=[...r.currentMatches,...r.pendingMatches??[]],a=async s=>{var i;const c=K(n);let l=(null==c?void 0:c.params)??{};const u=(null==h.options.filterRoutes?void 0:h.options.filterRoutes(s))??s;let d=[];const f=(r,n)=>(n.some((n=>{var o,a;if(!n.routePath&&null!=(o=n.childRoutes)&&o.length)return f([...d,n],n.childRoutes);const s=!!("/"!==n.routePath||null!=(a=n.childRoutes)&&a.length),i=nt(h.basepath,t,{to:n.fullPath,fuzzy:s,caseSensitive:n.options.caseSensitive??h.options.caseSensitive});if(i){let t;try{t=(null==n.options.parseParams?void 0:n.options.parseParams(i))??i}catch(t){if(null!=e&&e.strictParseParams)throw t}l={...l,...t}}return i&&(d=[...r,n]),!!d.length})),!!d.length);if(f([],u),!d.length)return;d.forEach((t=>{var e;const a=rt(t.routePath,l),s=rt(t.routeId,l,!0),i=o.find((t=>t.matchId===s))||(null==(e=r.matchCache[s])?void 0:e.match)||mt(h,t,{parentMatch:c,matchId:s,params:l,pathname:J([h.basepath,a])});n.push(i)}));const p=K(d);null!=(i=p.childRoutes)&&i.length&&a(p.childRoutes)};return a([h.routeTree]),function(t){t.forEach(((e,r)=>{const n=t[r-1];n?e.__.setParentMatch(n):e.__.setParentMatch(void 0)}))}(n),n},loadMatches:async(t,e)=>{t.forEach((async t=>{t.__.validate()})),await Promise.all(t.map((async t=>{try{await(null==t.options.beforeLoad?void 0:t.options.beforeLoad({router:h,match:t}))}catch(r){throw null!=e&&e.preload||null==t.options.onLoadError||t.options.onLoadError(r),r}})));const r=t.map((async t=>{var r;const n=t.store.search;null!=(r=n.__data)&&r.matchId&&n.__data.matchId!==t.matchId||(t.load(e),"success"!==t.store.status&&t.__.loadPromise&&await t.__.loadPromise)}));await Promise.all(r)},loadMatchData:async t=>{if(Pt||!h.options.useServerData)return await(null==t.options.loader?void 0:t.options.loader({params:t.params,search:t.store.routeSearch,signal:t.__.abortController.signal}))||{};{const e=h.buildNext({to:".",search:e=>({...e??{},__data:{matchId:t.matchId}})}),r=await fetch(e.href,{method:"GET"});if(r.ok)return r.json();throw new Error("Failed to fetch match data")}},invalidateRoute:t=>{const e=h.buildNext(t),n=h.matchRoutes(e.pathname).map((t=>t.matchId));[...r.currentMatches,...r.pendingMatches??[]].forEach((t=>{n.includes(t.matchId)&&t.invalidate()}))},reload:()=>l({fromCurrent:!0,replace:!0,search:!0}),resolvePath:(t,e)=>tt(h.basepath,t,X(e)),matchRoute:(t,e)=>{t={...t,to:t.to?h.resolvePath(t.from??"",t.to):void 0};const n=h.buildNext(t);return null!=e&&e.pending?!!r.pendingLocation&&!!nt(h.basepath,r.pendingLocation.pathname,{...e,to:n.pathname}):nt(h.basepath,r.currentLocation.pathname,{...e,to:n.pathname})},navigate:async t=>{let{from:e,to:r=".",search:n,hash:o,replace:a,params:s}=t;const i=String(r),c=String(e);let u;try{new URL(`${i}`),u=!0}catch(t){}return G(!u),l({from:c,to:i,search:n,hash:o,replace:a,params:s})},buildLink:t=>{let{from:e,to:n=".",search:o,params:a,hash:s,target:i,replace:c,activeOptions:u,preload:d,preloadMaxAge:f,preloadGcMaxAge:p,preloadDelay:m,disabled:v}=t;try{return new URL(`${n}`),{type:"external",href:n}}catch(t){}const g={from:e,to:n,search:o,params:a,hash:s,replace:c},y=h.buildNext(g);d=d??h.options.defaultPreload;const b=m??h.options.defaultPreloadDelay??0,w=r.currentLocation.pathname===y.pathname,P=r.currentLocation.pathname.split("/"),E=y.pathname.split("/").every(((t,e)=>t===P[e])),_=r.currentLocation.hash===y.hash,M=null!=u&&u.exact?w:E,L=null==u||!u.includeHash||_;return{type:"internal",next:y,handleFocus:t=>{d&&h.preloadRoute(g,{maxAge:f,gcMaxAge:p}).catch((t=>{console.log(t),console.warn("Error preloading route! ☝️")}))},handleClick:t=>{v||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||i&&"_self"!==i||0!==t.button||(t.preventDefault(),!w||o||s||h.invalidateRoute(g),l(g))},handleEnter:t=>{const e=t.target||{};if(d){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,h.preloadRoute(g,{maxAge:f,gcMaxAge:p}).catch((t=>{console.log(t),console.warn("Error preloading route! ☝️")}))}),b)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},isActive:M&&L,disabled:v}},buildNext:t=>{const e=u(t),r=h.matchRoutes(e.pathname),n=r.map((t=>t.options.preSearchFilters??[])).flat().filter(Boolean),o=r.map((t=>t.options.postSearchFilters??[])).flat().filter(Boolean);return u({...t,__preSearchFilters:n,__postSearchFilters:o})}};return h.update(t),null==h.options.createRouter||h.options.createRouter(h),h}function Mt(t){const e=Ct(),{type:r,children:n,target:a,activeProps:s=(()=>({className:"active"})),inactiveProps:i=(()=>({})),activeOptions:c,disabled:l,hash:u,search:h,params:d,to:f,preload:p,preloadDelay:m,preloadMaxAge:v,replace:g,style:y,className:b,onClick:w,onFocus:P,onMouseEnter:E,onMouseLeave:_,onTouchStart:M,onTouchEnd:L,...S}=t,x=e.buildLink(t);if("external"===x.type){const{href:t}=x;return{href:t}}const{handleClick:R,handleFocus:A,handleEnter:I,handleLeave:O,isActive:C,next:k}=x,j=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},D=C?V(s,{})??{}:{},F=C?{}:V(i,{})??{};return{...D,...F,...S,href:l?void 0:k.href,onClick:j([w,t=>{o.startTransition?o.startTransition((()=>{R(t)})):R(t)}]),onFocus:j([P,A]),onMouseEnter:j([E,I]),onMouseLeave:j([_,O]),target:a,style:{...y,...D.style,...F.style},className:[b,D.className,F.className].filter(Boolean).join(" ")||void 0,...l?{role:"link","aria-disabled":!0}:void 0,"data-status":C?"active":void 0}}const Lt=o.forwardRef(((t,e)=>{const r=Mt(t);return o.createElement("a",a({ref:e},r,{children:"function"==typeof t.children?t.children({isActive:"active"===r["data-status"]}):t.children}))})),St=o.createContext(null),xt=o.createContext(null),Rt={},At=(t,e)=>{const n=o.useRef(Rt),a=()=>e?e(v((()=>t()))):t();n.current===Rt&&(n.current=ht(void 0,a()));const s=o.useCallback((()=>n.current),[]),i=o.useCallback((t=>p((()=>{f((()=>{n.current=_(ht(n.current,a())),t()}))}))),[]);return r.useSyncExternalStore(i,s,s)},[It,Ot]=C({foo:"foo",bar:{baz:"baz"}});function Ct(){const t=o.useContext(xt);return W(!t,"useRouter must be used inside a <Router> component!"),t.router}function kt(){return o.useContext(St)}function jt(t){const e=Ct(),r=kt()[0],n=null!=t&&t.from?e.store.currentMatches.find((e=>e.routeId===(null==t?void 0:t.from))):r;return G(n,null!=t&&t.from&&t.from),((null==t?void 0:t.strict)??1)&&G(r.routeId==(null==n?void 0:n.routeId),(null==n||n.routeId,r.routeId,null==n||n.routeId,null==n||n.routeId)),At((()=>n.store)),n}function Dt(t){const e=Ct().getRoute(t);return G(e),e}function Ft(){const t=Ct();return e=>{const{pending:r,caseSensitive:n,...o}=e;return t.matchRoute(o,{pending:r,caseSensitive:n})}}function Nt(){const t=Ct(),e=kt().slice(1),r=e[0],n=o.useCallback((()=>null),[]);At((()=>null==r?void 0:r.store));const a=o.useCallback((e=>{if("error"===e.match.store.status)throw e.match.store.error;if("success"===e.match.store.status)return o.createElement(e.match.__.component??t.options.defaultComponent??Nt);if("loading"===e.match.store.status)throw e.match.__.loadPromise;G(!1)}),[]);if(!r)return null;const s=r.__.pendingComponent??t.options.defaultPendingComponent??n,i=r.__.errorComponent??t.options.defaultErrorComponent;return o.createElement(St.Provider,{value:e},o.createElement(o.Suspense,{fallback:o.createElement(s,null)},o.createElement(Tt,{key:r.routeId,errorComponent:i,match:r},o.createElement(a,{match:r}))))}p((()=>{let t;f((()=>{console.log("effect");const e=ht(t,It);console.log(e),t=v((()=>e))}))})),Ot((t=>{t.foo="1"})),Ot((t=>{t.bar.baz="2"}));class Tt extends o.Component{state={error:!1,info:void 0};componentDidCatch(t,e){console.error(`Error in route match: ${this.props.match.matchId}`),console.error(t),this.setState({error:t,info:e})}render(){return o.createElement($t,a({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function $t(t){const[e,r]=o.useState(t.errorState),n=Ct(),a=t.errorComponent??Ut;return o.useEffect((()=>{if(e){let t=n.store.currentLocation.key;return p((()=>f((()=>{n.store.currentLocation.key!==t&&(t=n.store.currentLocation.key,r({}))}))))}}),[e]),o.useEffect((()=>{t.errorState.error&&r(t.errorState),t.reset()}),[t.errorState.error]),t.errorState.error?o.createElement(a,e):t.children}function Ut(t){let{error:e}=t;return o.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},o.createElement("strong",{style:{fontSize:"1.2rem"}},"Something went wrong!"),o.createElement("div",{style:{height:".5rem"}}),o.createElement("div",null,o.createElement("pre",null,e.message?o.createElement("code",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".5rem",color:"red"}},e.message):null)))}function Bt(t,e){const r=Ct();o.useEffect((()=>{if(!e)return;let n=r.history.block((e=>{window.confirm(t)?(n(),e.retry()):r.store.currentLocation.pathname=window.location.pathname}));return n}),[e,t])}t.DefaultErrorBoundary=Ut,t.Link=Lt,t.MatchRoute=function(t){const e=Ft()(t);return e?o.createElement("function"==typeof t.children?t.children(e):t.children,t):null},t.Outlet=Nt,t.Prompt=function(t){let{message:e,when:r,children:n}=t;return Bt(e,r??!0),n??null},t.RouterProvider=function(t){let{router:e,...r}=t;e.update(r);const[,,n]=At((()=>e.store),(t=>[t.status,t.pendingMatches,t.currentMatches]));return o.useEffect(e.mount,[e]),console.log("current",n),o.createElement(o.Fragment,null,o.createElement(xt.Provider,{value:{router:e}},o.createElement(St.Provider,{value:[void 0,...n]},o.createElement(Nt,null))))},t.__useStoreValue=At,t.batch=m,t.cleanPath=X,t.createBrowserHistory=F,t.createEffect=f,t.createHashHistory=function(t){void 0===t&&(t={});var e=t.window,r=void 0===e?document.defaultView:e,n=r.history;function o(){var t=H(r.location.hash.substr(1)),e=t.pathname,o=void 0===e?"/":e,a=t.search,s=void 0===a?"":a,i=t.hash,c=void 0===i?"":i,l=n.state||{};return[l.idx,{pathname:o,search:s,hash:c,state:l.usr||null,key:l.key||"default"}]}var a=null;function s(){if(a)d.call(a),a=null;else{var t=R.Pop,e=o(),r=e[0],n=e[1];if(d.length){if(null!=r){var s=l-r;s&&(a={action:t,location:n,retry:function(){y(-1*s)}},y(s))}}else g(t)}}r.addEventListener(D,s),r.addEventListener("hashchange",(function(){z(o()[1])!==z(u)&&s()}));var i=R.Pop,c=o(),l=c[0],u=c[1],h=U(),d=U();function f(t){return function(){var t=document.querySelector("base"),e="";if(t&&t.getAttribute("href")){var n=r.location.href,o=n.indexOf("#");e=-1===o?n:n.slice(0,o)}return e}()+"#"+("string"==typeof t?t:z(t))}function p(t,e){return void 0===e&&(e=null),k({pathname:u.pathname,hash:"",search:""},"string"==typeof t?H(t):t,{state:e,key:B()})}function m(t,e){return[{usr:t.state,key:t.key,idx:e},f(t)]}function v(t,e,r){return!d.length||(d.call({action:t,location:e,retry:r}),!1)}function g(t){i=t;var e=o();l=e[0],u=e[1],h.call({action:i,location:u})}function y(t){n.go(t)}null==l&&(l=0,n.replaceState(k({},n.state,{idx:l}),""));var b={get action(){return i},get location(){return u},createHref:f,push:function t(e,o){var a=R.Push,s=p(e,o);if(v(a,s,(function(){t(e,o)}))){var i=m(s,l+1),c=i[0],u=i[1];try{n.pushState(c,"",u)}catch(t){r.location.assign(u)}g(a)}},replace:function t(e,r){var o=R.Replace,a=p(e,r);if(v(o,a,(function(){t(e,r)}))){var s=m(a,l),i=s[0],c=s[1];n.replaceState(i,"",c),g(o)}},go:y,back:function(){y(-1)},forward:function(){y(1)},listen:function(t){return h.push(t)},block:function(t){var e=d.push(t);return 1===d.length&&r.addEventListener(j,$),function(){e(),d.length||r.removeEventListener(j,$)}}};return b},t.createMemo=function(t){const e=new h(t,1);return e.get.bind(e)},t.createMemoryHistory=N,t.createReactRouter=function(t){return _t({...t,loadComponent:async t=>(t.preload&&await t.preload(),t)})},t.createRoot=p,t.createRoute=ct,t.createRouteConfig=ut,t.createRouteMatch=mt,t.createRouter=_t,t.createSignal=function(t,e){const r=new h(t,0);return void 0!==e?.equals&&(r.alwaysUpdate=!0),[r.get.bind(r),r.set.bind(r)]},t.createStore=C,t.decode=it,t.defaultParseSearch=vt,t.defaultStringifySearch=gt,t.encode=at,t.functionalUpdate=V,t.interpolatePath=rt,t.invariant=G,t.isWrappable=E,t.joinPaths=J,t.last=K,t.lazy=function(t){const e=o.lazy(t);return e.preload=async()=>{await t()},e},t.matchByPath=ot,t.matchPathname=nt,t.matchesContext=St,t.onCleanup=function(t){i?i.cleanups?i.cleanups.push(t):i.cleanups=[t]:console.error("onCleanup must be called from within a memo or effect")},t.parsePathname=et,t.parseSearchWith=yt,t.pick=q,t.resolvePath=tt,t.rootRouteId=lt,t.routerContext=xt,t.sharedClone=ht,t.stringifySearchWith=bt,t.trimPath=Z,t.trimPathLeft=Q,t.trimPathRight=Y,t.untrack=v,t.unwrap=_,t.useAction=function(t){const e=Dt(t.from).action;return At((()=>e)),e},t.useLinkProps=Mt,t.useLoaderData=function(t){const e=jt(t);return At((()=>null==e?void 0:e.store.loaderData),null==t?void 0:t.select)},t.useMatch=jt,t.useMatchRoute=Ft,t.useMatches=kt,t.useNavigate=function(t){return e=>Ct().navigate({...t,...e})},t.useParams=function(t){const e=Ct();return At((()=>{var t;return null==(t=K(e.store.currentMatches))?void 0:t.params}),null==t?void 0:t.select)},t.usePrompt=Bt,t.useRoute=Dt,t.useRouter=Ct,t.useRouterStore=function(t){const e=Ct();return At((()=>e.store),t)},t.useSearch=function(t){const e=jt(t);return At((()=>null==e?void 0:e.store.search),null==t?void 0:t.select)},t.warning=W,Object.defineProperty(t,"__esModule",{value:!0})}));
21
+ */function K(t){return t[t.length-1]}function W(t,e){if(t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch{}}return!0}function V(t,e){return"function"==typeof t?t(e):t}function q(t,e){return e.reduce(((e,r)=>(e[r]=t[r],e)),{})}function J(t){return X(t.filter(Boolean).join("/"))}function X(t){return t.replace(/\/{2,}/g,"/")}function Q(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function Y(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function Z(t){return Y(Q(t))}function tt(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let n=et(e);const o=et(r);o.forEach(((t,e)=>{if("/"===t.value)e?e===o.length-1&&n.push(t):n=[t];else if(".."===t.value){var r;n.length>1&&"/"===(null==(r=K(n))?void 0:r.value)&&n.pop(),n.pop()}else{if("."===t.value)return;n.push(t)}}));return X(J([t,...n.map((t=>t.value))]))}function et(t){if(!t)return[];const e=[];if("/"===(t=X(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const r=t.split("/").filter(Boolean);return e.push(...r.map((t=>t.startsWith("*")?{type:"wildcard",value:t}:"$"===t.charAt(0)?{type:"param",value:t}:{type:"pathname",value:t}))),"/"===t.slice(-1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}function rt(t,e,r){return J(et(t).map((t=>"*"!==t.value||r?"param"===t.type?e[t.value.substring(1)]??"":t.value:"")))}function nt(t,e,r){const n=ot(t,e,r);if(!r.to||n)return n??{}}function ot(t,e,r){if(!e.startsWith(t))return;const n=et(e="/"!=t?e.substring(t.length):e),o=et(`${r.to??"*"}`),a={};return(()=>{for(let t=0;t<Math.max(n.length,o.length);t++){const e=n[t],s=o[t],i=t===o.length-1,c=t===n.length-1;if(s){if("wildcard"===s.type)return!(null==e||!e.value)&&(a["*"]=J(n.slice(t).map((t=>t.value))),!0);if("pathname"===s.type){if("/"===s.value&&(null==e||!e.value))return!0;if(e)if(r.caseSensitive){if(s.value!==e.value)return!1}else if(s.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===s.type){if("/"===(null==e?void 0:e.value))return!1;"$"!==e.value.charAt(0)&&(a[s.value.substring(1)]=e.value)}}if(i&&!c)return!!r.fuzzy}return!0})()?a:void 0}function at(t,e){var r,n,o,a="";for(r in t)if(void 0!==(o=t[r]))if(Array.isArray(o))for(n=0;n<o.length;n++)a&&(a+="&"),a+=encodeURIComponent(r)+"="+encodeURIComponent(o[n]);else a&&(a+="&"),a+=encodeURIComponent(r)+"="+encodeURIComponent(o);return(e||"")+a}function st(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function it(t){for(var e,r,n={},o=t.split("&");e=o.shift();)void 0!==n[r=(e=e.split("=")).shift()]?n[r]=[].concat(n[r],st(e.shift())):n[r]=st(e.shift());return n}function ct(t,e,r,n,o){const{id:a,routeId:s,path:i,fullPath:c}=t;let l={routeInfo:void 0,routeId:a,routeRouteId:s,originalIndex:r,routePath:i,fullPath:c,options:e,router:o,childRoutes:void 0,parentRoute:n,get action(){let t=o.store.actions[a]||(o.setStore((e=>{e.actions[a]={submissions:[],submit:async(e,r)=>{if(!l)return;const n=(null==r?void 0:r.invalidate)??!0,[s,i]=C({submittedAt:Date.now(),status:"pending",submission:e,isMulti:!(null==r||!r.multi)});o.setStore((e=>{null!=r&&r.multi||(e.actions[a].submissions=t.submissions.filter((t=>t.isMulti))),e.actions[a].current=s,e.actions[a].latest=s,e.actions[a].submissions.push(s)}));try{const t=await(null==l.options.action?void 0:l.options.action(e));return i((e=>{e.data=t})),n&&(o.invalidateRoute({to:".",fromCurrent:!0}),await o.reload()),i((t=>{t.status="success"})),t}catch(t){console.error(t),i((e=>{e.error=t,e.status="error"}))}}}})),o.store.actions[a]);return t},get loader(){return o.store.loaders[a]||(o.setStore((t=>{t.loaders[a]={pending:[],fetch:async t=>{if(!l)return;const e={loadedAt:Date.now(),loaderContext:t};o.setStore((t=>{t.loaders[a].current=e,t.loaders[a].latest=e,t.loaders[a].pending.push(e)}));try{return await(null==l.options.loader?void 0:l.options.loader(t))}finally{o.setStore((t=>{t.loaders[a].pending=t.loaders[a].pending.filter((t=>t!==e))}))}}}})),o.store.loaders[a])}};return null==o.options.createRoute||o.options.createRoute({router:o,route:l}),l}const lt="__root__",ut=function(t,e,r,n,o){void 0===t&&(t={}),void 0===r&&(r=!0),r&&(t.path=lt),n===lt&&(n="");let a=r?lt:t.path;a&&"/"!==a&&(a=Z(a));const s=a||t.id;let i=J([n,s]);a===lt&&(a="/"),i!==lt&&(i=J(["/",i]));const c=i===lt?"/":Y(J([o,a]));return{id:i,routeId:s,path:a,fullPath:c,options:t,children:e,addChildren:e=>ut(t,e,!1,n,o),createRoute:t=>ut(t,void 0,!1,i,c),generate:()=>{G(!1)}}};function ht(t,e,r){const n=new Map;return function t(e,r){if(e===r)return e;if(n.has(r))return n.get(r);const o=Array.isArray(e),a=Array.isArray(r),s=dt(e),i=dt(r),c=o&&a;if(c||s&&i){const o=c?e.length:Object.keys(e).length,a=c?r:Object.keys(r),s=a.length,i=c?[]:{};let l=0;for(let t=0;t<s;t++){const r=c?t:a[t];i[r]===e[r]&&l++}if(o===s&&l===o)return n.set(r,e),e;n.set(r,i);for(let n=0;n<s;n++){const o=c?n:a[n];"function"==typeof a[n]?i[o]=e[o]:i[o]=t(e[o],r[o]),i[o]===e[o]&&l++}return i}if(a){const e=[];n.set(r,e);for(let n=0;n<r.length;n++)e[n]=t(void 0,r[n]);return e}if(i){const e={};n.set(r,e);const o=Object.keys(r);for(let n=0;n<o.length;n++){const a=o[n];e[a]=t(void 0,r[a])}return e}return r}(t,e)}function dt(t){if(!ft(t))return!1;const e=t.constructor;if(void 0===e)return!0;const r=e.prototype;return!!ft(r)&&!!r.hasOwnProperty("isPrototypeOf")}function ft(t){return"[object Object]"===Object.prototype.toString.call(t)}const pt=["component","errorComponent","pendingComponent"];function mt(t,e,r){let n,o,a="",s=()=>{};function i(){l((t=>{var e;t.loaderData=ht(t.loaderData,{...null==(e=c.parentMatch)?void 0:e.store.loaderData,...t.routeLoaderData})}))}const[c,l]=C({routeSearch:{},search:{},status:"idle",routeLoaderData:{},loaderData:{},isFetching:!1,invalid:!1,invalidAt:1/0,get isInvalid(){const t=Date.now();return this.invalid||this.invalidAt<t}}),u={...e,...r,store:c,router:t,childMatches:[],__:{setParentMatch:t=>{m((()=>{l((e=>{e.parentMatch=t})),i()}))},abortController:new AbortController,validate:()=>{var e;const r=(null==(e=c.parentMatch)?void 0:e.store.search)??t.store.currentLocation.search;try{const t=c.routeSearch,e="object"==typeof u.options.validateSearch?u.options.validateSearch.parse:u.options.validateSearch;let n=ht(t,(null==e?void 0:e(r))??{});m((()=>{t!==n&&l((t=>t.invalid=!0)),l((t=>{t.routeSearch=n,t.search=ht(r,{...r,...n})}))})),pt.map((async t=>{const e=u.options[t];"function"!=typeof u.__[t]&&(u.__[t]=e)}))}catch(t){console.error(t);const e=new Error("Invalid search params found",{cause:t});return e.code="INVALID_SEARCH_PARAMS",void l((t=>{t.status="error",t.error=e}))}}},cancel:()=>{var t;null==(t=u.__.abortController)||t.abort()},invalidate:()=>{l((t=>t.invalid=!0))},hasLoaders:()=>!(!e.options.loader&&!pt.some((t=>{var r;return null==(r=e.options[t])?void 0:r.preload}))),load:async e=>{const r=Date.now(),n=null!=e&&e.preload?Math.max(null==e?void 0:e.maxAge,null==e?void 0:e.gcMaxAge):0;if(null!=e&&e.preload&&n>0){if(t.store.currentMatches.find((t=>t.matchId===u.matchId)))return;t.store.matchCache[u.matchId]={gc:r+e.gcMaxAge,match:u}}if("success"===c.status&&c.isInvalid||"error"===c.status||"idle"===c.status){const t=null!=e&&e.preload?null==e?void 0:e.maxAge:void 0;await u.fetch({maxAge:t})}},fetch:async e=>{const r=""+Date.now()+Math.random();a=r;const h=async()=>{if(r!==a)return new Promise((()=>{}))};m((()=>{"idle"===c.status&&l((t=>t.status="loading")),l((t=>t.invalid=!1))})),u.__.loadPromise=new Promise((async r=>{l((t=>t.isFetching=!0)),s=r,n=(async()=>{await Promise.all(pt.map((async e=>{var r;const n=u.options[e];null!=(r=u.__[e])&&r.preload&&(u.__[e]=await t.options.loadComponent(n))})))})(),o=Promise.resolve().then((async()=>{try{if(u.options.loader){const e=await t.loadMatchData(u);await h(),r=e,m((()=>{l((t=>{t.routeLoaderData=ht(t.routeLoaderData,r)})),i()}))}return l((r=>{r.error=void 0,r.status="success",r.updatedAt=Date.now(),r.invalidAt=r.updatedAt+((null==e?void 0:e.maxAge)??u.options.loaderMaxAge??t.options.defaultLoaderMaxAge??0)})),c.routeLoaderData}catch(t){throw await h(),l((e=>{e.error=t,e.status="error",e.updatedAt=Date.now()})),t}var r}));const a=async()=>{await h(),l((t=>t.isFetching=!1)),delete u.__.loadPromise,s()};try{await Promise.all([n,o.catch((()=>{}))]),a()}catch{a()}})),await u.__.loadPromise,await h()}};return u.hasLoaders()||l((t=>t.status="success")),u}const vt=yt(JSON.parse),gt=bt(JSON.stringify);function yt(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let r=it(e);for(let e in r){const n=r[e];if("string"==typeof n)try{r[e]=t(n)}catch(t){}}return r}}function bt(t){return e=>{(e={...e})&&Object.keys(e).forEach((r=>{const n=e[r];if(void 0===n||void 0===n)delete e[r];else if(n&&"object"==typeof n&&null!==n)try{e[r]=t(n)}catch(t){}}));const r=at(e).toString();return r?`?${r}`:""}}var wt;const Pt="undefined"==typeof window||!(null!=(wt=window.document)&&wt.createElement);function Et(){return{status:"idle",latestLocation:null,currentLocation:null,currentMatches:[],actions:{},loaders:{},lastUpdated:Date.now(),matchCache:{},get isFetching(){return"loading"===this.status||this.currentMatches.some((t=>t.store.isFetching))},get isPreloading(){return Object.values(this.matchCache).some((t=>t.match.store.isFetching&&!this.currentMatches.find((e=>e.matchId===t.match.matchId))))}}}function _t(t){const e={defaultLoaderGcMaxAge:3e5,defaultLoaderMaxAge:0,defaultPreloadMaxAge:2e3,defaultPreloadDelay:50,context:void 0,...t,stringifySearch:(null==t?void 0:t.stringifySearch)??gt,parseSearch:(null==t?void 0:t.parseSearch)??vt},[r,n]=C(Et());let o,a=Date.now(),s=()=>{};function i(){h.load()}function c(t,e){const r=h.options.parseSearch(t.search);return{pathname:t.pathname,searchStr:t.search,search:ht(null==e?void 0:e.search,r),hash:t.hash.split("#").reverse()[0]??"",href:`${t.pathname}${t.search}${t.hash}`,state:t.state,key:t.key}}function l(t){return function(t,e){const r=""+Date.now()+Math.random();let n="replace";e||(n="push");c(h.history.location).href!==t.href||t.key||(n="replace");return h.history[n]({pathname:t.pathname,hash:t.hash,search:t.searchStr},{id:r,...t.state}),o=new Promise((t=>{const e=s;s=()=>{e(),t()}}))}(h.buildNext(t),t.replace)}function u(t){var e,n,o,a;void 0===t&&(t={});const s=t.fromCurrent?r.latestLocation.pathname:t.from??r.latestLocation.pathname;let i=tt(h.basepath??"/",s,`${t.to??"."}`);const c=h.matchRoutes(r.latestLocation.pathname,{strictParseParams:!0}),l=h.matchRoutes(i),u={...null==(e=K(c))?void 0:e.params};let d=!0===(t.params??!0)?u:V(t.params,u);d&&l.map((t=>t.options.stringifyParams)).filter(Boolean).forEach((t=>{Object.assign({},d,t(d))})),i=rt(i,d??{});const f=null!=(n=t.__preSearchFilters)&&n.length?t.__preSearchFilters.reduce(((t,e)=>e(t)),r.latestLocation.search):r.latestLocation.search,p=!0===t.search?f:t.search?V(t.search,f)??{}:null!=(o=t.__preSearchFilters)&&o.length?f:{},m=null!=(a=t.__postSearchFilters)&&a.length?t.__postSearchFilters.reduce(((t,e)=>e(t)),p):p,v=ht(r.latestLocation.search,m),g=h.options.stringifySearch(v);let y=!0===t.hash?r.latestLocation.hash:V(t.hash,r.latestLocation.hash);return y=y?`#${y}`:"",{pathname:i,search:v,searchStr:g,state:r.latestLocation.state,hash:y,href:`${i}${g}${y}`,key:t.key}}const h={types:void 0,history:(null==t?void 0:t.history)||(Pt?N():F()),store:r,setStore:n,options:e,basepath:"",routeTree:void 0,routesById:{},reset:()=>{n((t=>Object.assign(t,Et())))},getRoute:t=>h.routesById[t],dehydrate:()=>({store:{...q(r,["latestLocation","currentLocation","status","lastUpdated"]),currentMatches:r.currentMatches.map((t=>({matchId:t.matchId,store:q(t.store,["status","routeLoaderData","isInvalid","invalidAt"])})))},context:h.options.context}),hydrate:t=>{n((e=>{h.options.context=t.context;const r=h.matchRoutes(t.store.latestLocation.pathname,{strictParseParams:!0});r.forEach(((e,r)=>{const n=t.store.currentMatches[r];G(n&&n.matchId===e.matchId),Object.assign(e,n)})),r.forEach((t=>t.__.validate())),Object.assign(e,{...t.store,currentMatches:r})}))},mount:()=>{if(!Pt){r.currentMatches.length||h.load();const t=h.history.listen((t=>{h.load(c(t.location,r.latestLocation))}));return window.addEventListener&&(window.addEventListener("visibilitychange",i,!1),window.addEventListener("focus",i,!1)),()=>{t(),window.removeEventListener&&(window.removeEventListener("visibilitychange",i),window.removeEventListener("focus",i))}}return()=>{}},update:t=>{const e=(null==t?void 0:t.history)!==h.history;r.latestLocation&&!e||(null!=t&&t.history&&(h.history=t.history),n((t=>{t.latestLocation=c(h.history.location),t.currentLocation=t.latestLocation}))),Object.assign(h.options,t);const{basepath:o,routeConfig:a}=h.options;return h.basepath=`/${Z(o??"")??""}`,a&&(h.routesById={},h.routeTree=function(t){const e=(t,r)=>t.map(((t,n)=>{const o=ct(t,t.options,n,r,h);if(h.routesById[o.routeId])throw new Error;h.routesById[o.routeId]=o;const a=t.children;return o.childRoutes=null!=a&&a.length?e(a,o):void 0,o}));return e([t])[0]}(a)),h},cancelMatches:()=>{[...r.currentMatches,...r.pendingMatches||[]].forEach((t=>{t.cancel()}))},load:async t=>{let e=Date.now();const i=e;let c;a=i,h.cancelMatches(),m((()=>{t&&n((e=>{e.latestLocation=t})),c=h.matchRoutes(r.latestLocation.pathname,{strictParseParams:!0}),console.log("set loading",c),n((t=>{t.status="loading",t.pendingMatches=c,t.pendingLocation=r.latestLocation}))}));try{await h.loadMatches(c)}catch(t){console.log(t),G(!1)}if(a!==i)return o;const l=r.currentMatches,u=[],d=[];l.forEach((t=>{c.find((e=>e.matchId===t.matchId))?d.push(t):u.push(t)}));const f=c.filter((t=>!l.find((e=>e.matchId===t.matchId))));e=Date.now(),u.forEach((t=>{null==t.__.onExit||t.__.onExit({params:t.params,search:t.store.routeSearch}),"error"!==t.store.status||t.store.isFetching||(t.store.status="idle",t.store.error=void 0);const n=Math.max(t.options.loaderGcMaxAge??h.options.defaultLoaderGcMaxAge??0,t.options.loaderMaxAge??h.options.defaultLoaderMaxAge??0);n>0&&(r.matchCache[t.matchId]={gc:n==1/0?Number.MAX_SAFE_INTEGER:e+n,match:t})})),d.forEach((t=>{null==t.options.onTransition||t.options.onTransition({params:t.params,search:t.store.routeSearch})})),f.forEach((t=>{t.__.onExit=null==t.options.onLoaded?void 0:t.options.onLoaded({params:t.params,search:t.store.search}),delete r.matchCache[t.matchId]})),a===i&&(c.forEach((t=>{t.action&&(t.action.current=void 0,t.action.submissions=[])})),n((t=>{console.log("set",c),Object.assign(t,{status:"idle",currentLocation:r.latestLocation,currentMatches:c,pendingLocation:void 0,pendingMatches:void 0})})),s())},cleanMatchCache:()=>{const t=Date.now();n((e=>{Object.keys(e.matchCache).forEach((r=>{const n=e.matchCache[r];"loading"!==n.match.store.status&&(n.gc>0&&n.gc>t||delete e.matchCache[r])}))}))},loadRoute:async function(t){void 0===t&&(t=r.latestLocation);const e=h.buildNext(t),n=h.matchRoutes(e.pathname,{strictParseParams:!0});return await h.loadMatches(n),n},preloadRoute:async function(t,e){void 0===t&&(t=r.latestLocation);const n=h.buildNext(t),o=h.matchRoutes(n.pathname,{strictParseParams:!0});return await h.loadMatches(o,{preload:!0,maxAge:e.maxAge??h.options.defaultPreloadMaxAge??h.options.defaultLoaderMaxAge??0,gcMaxAge:e.gcMaxAge??h.options.defaultPreloadGcMaxAge??h.options.defaultLoaderGcMaxAge??0}),o},matchRoutes:(t,e)=>{h.cleanMatchCache();const n=[];if(!h.routeTree)return n;const o=[...r.currentMatches,...r.pendingMatches??[]],a=async s=>{var i;const c=K(n);let l=(null==c?void 0:c.params)??{};const u=(null==h.options.filterRoutes?void 0:h.options.filterRoutes(s))??s;let d=[];const f=(r,n)=>(n.some((n=>{var o,a;if(!n.routePath&&null!=(o=n.childRoutes)&&o.length)return f([...d,n],n.childRoutes);const s=!!("/"!==n.routePath||null!=(a=n.childRoutes)&&a.length),i=nt(h.basepath,t,{to:n.fullPath,fuzzy:s,caseSensitive:n.options.caseSensitive??h.options.caseSensitive});if(i){let t;try{t=(null==n.options.parseParams?void 0:n.options.parseParams(i))??i}catch(t){if(null!=e&&e.strictParseParams)throw t}l={...l,...t}}return i&&(d=[...r,n]),!!d.length})),!!d.length);if(f([],u),!d.length)return;d.forEach((t=>{var e;const a=rt(t.routePath,l),s=rt(t.routeId,l,!0),i=o.find((t=>t.matchId===s))||(null==(e=r.matchCache[s])?void 0:e.match)||mt(h,t,{parentMatch:c,matchId:s,params:l,pathname:J([h.basepath,a])});n.push(i)}));const p=K(d);null!=(i=p.childRoutes)&&i.length&&a(p.childRoutes)};return a([h.routeTree]),function(t){t.forEach(((e,r)=>{const n=t[r-1];n?e.__.setParentMatch(n):e.__.setParentMatch(void 0)}))}(n),n},loadMatches:async(t,e)=>{t.forEach((async t=>{t.__.validate()})),await Promise.all(t.map((async t=>{try{await(null==t.options.beforeLoad?void 0:t.options.beforeLoad({router:h,match:t}))}catch(r){throw null!=e&&e.preload||null==t.options.onLoadError||t.options.onLoadError(r),r}})));const r=t.map((async t=>{var r;const n=t.store.search;null!=(r=n.__data)&&r.matchId&&n.__data.matchId!==t.matchId||(t.load(e),"success"!==t.store.status&&t.__.loadPromise&&await t.__.loadPromise)}));await Promise.all(r)},loadMatchData:async t=>{if(Pt||!h.options.useServerData)return await(null==t.options.loader?void 0:t.options.loader({params:t.params,search:t.store.routeSearch,signal:t.__.abortController.signal}))||{};{const e=h.buildNext({to:".",search:e=>({...e??{},__data:{matchId:t.matchId}})}),r=await fetch(e.href,{method:"GET"});if(r.ok)return r.json();throw new Error("Failed to fetch match data")}},invalidateRoute:t=>{const e=h.buildNext(t),n=h.matchRoutes(e.pathname).map((t=>t.matchId));[...r.currentMatches,...r.pendingMatches??[]].forEach((t=>{n.includes(t.matchId)&&t.invalidate()}))},reload:()=>l({fromCurrent:!0,replace:!0,search:!0}),resolvePath:(t,e)=>tt(h.basepath,t,X(e)),matchRoute:(t,e)=>{t={...t,to:t.to?h.resolvePath(t.from??"",t.to):void 0};const n=h.buildNext(t);return null!=e&&e.pending?!!r.pendingLocation&&!!nt(h.basepath,r.pendingLocation.pathname,{...e,to:n.pathname}):nt(h.basepath,r.currentLocation.pathname,{...e,to:n.pathname})},navigate:async t=>{let{from:e,to:r=".",search:n,hash:o,replace:a,params:s}=t;const i=String(r),c=String(e);let u;try{new URL(`${i}`),u=!0}catch(t){}return G(!u),l({from:c,to:i,search:n,hash:o,replace:a,params:s})},buildLink:t=>{let{from:e,to:n=".",search:o,params:a,hash:s,target:i,replace:c,activeOptions:u,preload:d,preloadMaxAge:f,preloadGcMaxAge:p,preloadDelay:m,disabled:v}=t;try{return new URL(`${n}`),{type:"external",href:n}}catch(t){}const g={from:e,to:n,search:o,params:a,hash:s,replace:c},y=h.buildNext(g);d=d??h.options.defaultPreload;const b=m??h.options.defaultPreloadDelay??0,w=r.currentLocation.pathname===y.pathname,P=r.currentLocation.pathname.split("/"),E=y.pathname.split("/").every(((t,e)=>t===P[e])),_=r.currentLocation.hash===y.hash,M=null!=u&&u.exact?w:E,L=null==u||!u.includeHash||_;return{type:"internal",next:y,handleFocus:t=>{d&&h.preloadRoute(g,{maxAge:f,gcMaxAge:p}).catch((t=>{console.log(t),console.warn("Error preloading route! ☝️")}))},handleClick:t=>{v||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||i&&"_self"!==i||0!==t.button||(t.preventDefault(),!w||o||s||h.invalidateRoute(g),l(g))},handleEnter:t=>{const e=t.target||{};if(d){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,h.preloadRoute(g,{maxAge:f,gcMaxAge:p}).catch((t=>{console.log(t),console.warn("Error preloading route! ☝️")}))}),b)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},isActive:M&&L,disabled:v}},buildNext:t=>{const e=u(t),r=h.matchRoutes(e.pathname),n=r.map((t=>t.options.preSearchFilters??[])).flat().filter(Boolean),o=r.map((t=>t.options.postSearchFilters??[])).flat().filter(Boolean);return u({...t,__preSearchFilters:n,__postSearchFilters:o})}};return h.update(t),null==h.options.createRouter||h.options.createRouter(h),h}function Mt(t){const e=Ct(),{type:r,children:n,target:a,activeProps:s=(()=>({className:"active"})),inactiveProps:i=(()=>({})),activeOptions:c,disabled:l,hash:u,search:h,params:d,to:f,preload:p,preloadDelay:m,preloadMaxAge:v,replace:g,style:y,className:b,onClick:w,onFocus:P,onMouseEnter:E,onMouseLeave:_,onTouchStart:M,onTouchEnd:L,...S}=t,x=e.buildLink(t);if("external"===x.type){const{href:t}=x;return{href:t}}const{handleClick:R,handleFocus:A,handleEnter:I,handleLeave:O,isActive:C,next:k}=x,j=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},D=C?V(s,{})??{}:{},F=C?{}:V(i,{})??{};return{...D,...F,...S,href:l?void 0:k.href,onClick:j([w,t=>{o.startTransition?o.startTransition((()=>{R(t)})):R(t)}]),onFocus:j([P,A]),onMouseEnter:j([E,I]),onMouseLeave:j([_,O]),target:a,style:{...y,...D.style,...F.style},className:[b,D.className,F.className].filter(Boolean).join(" ")||void 0,...l?{role:"link","aria-disabled":!0}:void 0,"data-status":C?"active":void 0}}const Lt=o.forwardRef(((t,e)=>{const r=Mt(t);return o.createElement("a",a({ref:e},r,{children:"function"==typeof t.children?t.children({isActive:"active"===r["data-status"]}):t.children}))})),St=o.createContext(null),xt=o.createContext(null),Rt={},At=(t,e)=>{const n=o.useRef(Rt),a=()=>e?e(v((()=>t()))):t();n.current===Rt&&(n.current=ht(void 0,a()));const s=o.useCallback((()=>n.current),[]),i=o.useCallback((t=>p((()=>{f((()=>{n.current=_(ht(n.current,a())),t()}))}))),[]);return r.useSyncExternalStore(i,s,s)},[It,Ot]=C({foo:"foo",bar:{baz:"baz"}});function Ct(){const t=o.useContext(xt);return W(!t,"useRouter must be used inside a <Router> component!"),t.router}function kt(){return o.useContext(St)}function jt(t){const e=Ct(),r=kt()[0],n=null!=t&&t.from?e.store.currentMatches.find((e=>e.routeId===(null==t?void 0:t.from))):r;return G(n,null!=t&&t.from&&t.from),((null==t?void 0:t.strict)??1)&&G(r.routeId==(null==n?void 0:n.routeId),(null==n||n.routeId,r.routeId,null==n||n.routeId,null==n||n.routeId)),At((()=>n.store)),n}function Dt(t){const e=Ct().getRoute(t);return G(e),e}function Ft(){const t=Ct();return e=>{const{pending:r,caseSensitive:n,...o}=e;return t.matchRoute(o,{pending:r,caseSensitive:n})}}function Nt(){const t=Ct(),e=kt().slice(1),r=e[0],n=o.useCallback((()=>null),[]);At((()=>null==r?void 0:r.store));const a=o.useCallback((e=>{if("error"===e.match.store.status)throw e.match.store.error;if("success"===e.match.store.status)return o.createElement(e.match.__.component??t.options.defaultComponent??Nt);if("loading"===e.match.store.status)throw e.match.__.loadPromise;G(!1)}),[]);if(!r)return null;const s=r.__.pendingComponent??t.options.defaultPendingComponent??n,i=r.__.errorComponent??t.options.defaultErrorComponent;return o.createElement(St.Provider,{value:e},o.createElement(o.Suspense,{fallback:o.createElement(s,null)},o.createElement(Tt,{key:r.routeId,errorComponent:i,match:r},o.createElement(a,{match:r}))))}p((()=>{let t;f((()=>{console.log("effect");const e=ht(t,It);console.log(e),t=v((()=>e))}))})),Ot((t=>{t.foo="1"})),Ot((t=>{t.bar.baz="2"}));class Tt extends o.Component{state={error:!1,info:void 0};componentDidCatch(t,e){console.error(`Error in route match: ${this.props.match.matchId}`),console.error(t),this.setState({error:t,info:e})}render(){return o.createElement($t,a({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function $t(t){const[e,r]=o.useState(t.errorState),n=Ct(),a=t.errorComponent??Ut;return o.useEffect((()=>{if(e){let t=n.store.currentLocation.key;return p((()=>f((()=>{n.store.currentLocation.key!==t&&(t=n.store.currentLocation.key,r({}))}))))}}),[e]),o.useEffect((()=>{t.errorState.error&&r(t.errorState),t.reset()}),[t.errorState.error]),t.errorState.error?o.createElement(a,e):t.children}function Ut(t){let{error:e}=t;return o.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},o.createElement("strong",{style:{fontSize:"1.2rem"}},"Something went wrong!"),o.createElement("div",{style:{height:".5rem"}}),o.createElement("div",null,o.createElement("pre",null,e.message?o.createElement("code",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".5rem",color:"red"}},e.message):null)))}function Bt(t,e){const r=Ct();o.useEffect((()=>{if(!e)return;let n=r.history.block((e=>{window.confirm(t)?(n(),e.retry()):r.store.currentLocation.pathname=window.location.pathname}));return n}),[e,t])}t.DefaultErrorBoundary=Ut,t.Link=Lt,t.MatchRoute=function(t){const e=Ft()(t);return e?o.createElement("function"==typeof t.children?t.children(e):t.children,t):null},t.Outlet=Nt,t.Prompt=function(t){let{message:e,when:r,children:n}=t;return Bt(e,r??!0),n??null},t.RouterProvider=function(t){let{router:e,...r}=t;e.update(r);const[,,n]=At((()=>e.store),(t=>[t.status,t.pendingMatches,t.currentMatches]));return o.useEffect(e.mount,[e]),console.log("current",n),o.createElement(o.Fragment,null,o.createElement(xt.Provider,{value:{router:e}},o.createElement(St.Provider,{value:[void 0,...n]},o.createElement(Nt,null))))},t.__useStoreValue=At,t.batch=m,t.cleanPath=X,t.createBrowserHistory=F,t.createEffect=f,t.createHashHistory=function(t){void 0===t&&(t={});var e=t.window,r=void 0===e?document.defaultView:e,n=r.history;function o(){var t=H(r.location.hash.substr(1)),e=t.pathname,o=void 0===e?"/":e,a=t.search,s=void 0===a?"":a,i=t.hash,c=void 0===i?"":i,l=n.state||{};return[l.idx,{pathname:o,search:s,hash:c,state:l.usr||null,key:l.key||"default"}]}var a=null;function s(){if(a)d.call(a),a=null;else{var t=R.Pop,e=o(),r=e[0],n=e[1];if(d.length){if(null!=r){var s=l-r;s&&(a={action:t,location:n,retry:function(){y(-1*s)}},y(s))}}else g(t)}}r.addEventListener(D,s),r.addEventListener("hashchange",(function(){z(o()[1])!==z(u)&&s()}));var i=R.Pop,c=o(),l=c[0],u=c[1],h=U(),d=U();function f(t){return function(){var t=document.querySelector("base"),e="";if(t&&t.getAttribute("href")){var n=r.location.href,o=n.indexOf("#");e=-1===o?n:n.slice(0,o)}return e}()+"#"+("string"==typeof t?t:z(t))}function p(t,e){return void 0===e&&(e=null),k({pathname:u.pathname,hash:"",search:""},"string"==typeof t?H(t):t,{state:e,key:B()})}function m(t,e){return[{usr:t.state,key:t.key,idx:e},f(t)]}function v(t,e,r){return!d.length||(d.call({action:t,location:e,retry:r}),!1)}function g(t){i=t;var e=o();l=e[0],u=e[1],h.call({action:i,location:u})}function y(t){n.go(t)}null==l&&(l=0,n.replaceState(k({},n.state,{idx:l}),""));var b={get action(){return i},get location(){return u},createHref:f,push:function t(e,o){var a=R.Push,s=p(e,o);if(v(a,s,(function(){t(e,o)}))){var i=m(s,l+1),c=i[0],u=i[1];try{n.pushState(c,"",u)}catch(t){r.location.assign(u)}g(a)}},replace:function t(e,r){var o=R.Replace,a=p(e,r);if(v(o,a,(function(){t(e,r)}))){var s=m(a,l),i=s[0],c=s[1];n.replaceState(i,"",c),g(o)}},go:y,back:function(){y(-1)},forward:function(){y(1)},listen:function(t){return h.push(t)},block:function(t){var e=d.push(t);return 1===d.length&&r.addEventListener(j,$),function(){e(),d.length||r.removeEventListener(j,$)}}};return b},t.createMemo=function(t){const e=new h(t,1);return e.get.bind(e)},t.createMemoryHistory=N,t.createReactRouter=function(t){return _t({...t,loadComponent:async t=>(t.preload&&await t.preload(),t)})},t.createRoot=p,t.createRoute=ct,t.createRouteConfig=ut,t.createRouteMatch=mt,t.createRouter=_t,t.createSignal=function(t,e){const r=new h(t,0);return void 0!==e?.equals&&(r.alwaysUpdate=!0),[r.get.bind(r),r.set.bind(r)]},t.createStore=C,t.decode=it,t.defaultParseSearch=vt,t.defaultStringifySearch=gt,t.encode=at,t.functionalUpdate=V,t.interpolatePath=rt,t.invariant=G,t.isWrappable=E,t.joinPaths=J,t.last=K,t.lazy=function(t){const e=o.lazy(t);return e.preload=async()=>{await t()},e},t.matchByPath=ot,t.matchPathname=nt,t.matchesContext=St,t.onCleanup=function(t){i?i.cleanups?i.cleanups.push(t):i.cleanups=[t]:console.error("onCleanup must be called from within a memo or effect")},t.parsePathname=et,t.parseSearchWith=yt,t.pick=q,t.resolvePath=tt,t.rootRouteId=lt,t.routerContext=xt,t.sharedClone=ht,t.stringifySearchWith=bt,t.trimPath=Z,t.trimPathLeft=Q,t.trimPathRight=Y,t.untrack=v,t.unwrap=_,t.useAction=function(t){const e=Dt(t.from).action;return At((()=>e)),e},t.useLinkProps=Mt,t.useLoaderData=function(t){const e=jt(t);return At((()=>null==e?void 0:e.store.loaderData),null==t?void 0:t.select)},t.useMatch=jt,t.useMatchRoute=Ft,t.useMatches=kt,t.useNavigate=function(t){const e=Ct();return r=>e.navigate({...t,...r})},t.useParams=function(t){const e=Ct();return At((()=>{var t;return null==(t=K(e.store.currentMatches))?void 0:t.params}),null==t?void 0:t.select)},t.usePrompt=Bt,t.useRoute=Dt,t.useRouter=Ct,t.useRouterStore=function(t){const e=Ct();return At((()=>e.store),t)},t.useSearch=function(t){const e=jt(t);return At((()=>null==e?void 0:e.store.search),null==t?void 0:t.select)},t.warning=W,Object.defineProperty(t,"__esModule",{value:!0})}));
22
22
  //# sourceMappingURL=index.production.js.map