@hamsterbase/evidra 0.9.3 → 0.9.5
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/dist/service/cli.js +13 -6
- package/dist/web/assets/ProjectFileEditor-CTVQS834.css +1 -0
- package/dist/web/assets/{ProjectFileEditor-Cvj7CY89.js → ProjectFileEditor-Hfm-25K6.js} +4 -4
- package/dist/web/assets/{cssMode-CTtxQe_H.js → cssMode-n1M7aBp_.js} +1 -1
- package/dist/web/assets/{editor.api-DbueYBpJ.js → editor.api-Cf23vh6d.js} +1 -1
- package/dist/web/assets/{freemarker2-B_RP2mBl.js → freemarker2-6_zltceq.js} +1 -1
- package/dist/web/assets/{handlebars-Hz0h_0ZE.js → handlebars-WRHgw3NS.js} +1 -1
- package/dist/web/assets/{html-MsYis9Cj.js → html-Cg6UKfWf.js} +1 -1
- package/dist/web/assets/{htmlMode-Qf9QxGpi.js → htmlMode-Dizhkn_4.js} +1 -1
- package/dist/web/assets/{index-BShYpQzA.js → index-DXsLZBrh.js} +2 -2
- package/dist/web/assets/{javascript-BvAccjqb.js → javascript-DT1XD7ZK.js} +1 -1
- package/dist/web/assets/{jsonMode-BUGkR3Gl.js → jsonMode-DWMwbllM.js} +1 -1
- package/dist/web/assets/{liquid-CN2uFItr.js → liquid-D-ZZ_jWN.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-CI_8opt3.js → lspLanguageFeatures-D8w196Ps.js} +1 -1
- package/dist/web/assets/{main-CvYPjM14.js → main-CV9Hz9PX.js} +2 -2
- package/dist/web/assets/{main-B3dHaxwJ.js → main-DOiyzSbN.js} +5 -5
- package/dist/web/assets/{mdx-D8RkMdxf.js → mdx-aRs8nGpG.js} +1 -1
- package/dist/web/assets/{monaco-BIg-2np-.js → monaco-CTOp7rv3.js} +4 -4
- package/dist/web/assets/{python-CmKFcpYI.js → python-tQvfqVkh.js} +1 -1
- package/dist/web/assets/{razor-D0oItoxm.js → razor-B26kAnDL.js} +1 -1
- package/dist/web/assets/{tsMode-5WrTYXyf.js → tsMode-gDKokppP.js} +1 -1
- package/dist/web/assets/{typescript-BvBpgcZL.js → typescript-nCeOp5r1.js} +1 -1
- package/dist/web/assets/{workers-DFvt3dCi.js → workers-M9cDUh1V.js} +1 -1
- package/dist/web/assets/{xml-Dxottn9D.js → xml-BHblsskw.js} +1 -1
- package/dist/web/assets/{yaml-B8OI7mBu.js → yaml-C9h4gF6L.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/skills/evidra-share/scripts/share.sh +5 -1
- package/dist/web/assets/ProjectFileEditor-BzdTjbeh.css +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-
|
|
2
|
-
import{t as e}from"./index-BShYpQzA.js";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),c=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ee(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ee(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),ee(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=ee(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=ee(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ee(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return ee(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var F=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},te={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=te,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),f=s(((e,t)=>{t.exports=d()})),p=u(f(),1),m=e=>{throw TypeError(e)},h=(e,t,n)=>t.has(e)||m(`Cannot `+n),g=(e,t,n)=>(h(e,t,`read from private field`),n?n.call(e):t.get(e)),_=(e,t,n)=>t.has(e)?m(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),v=(e,t,n,r)=>(h(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),y=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,b=/^[\\/]{2}/;function x(e,t){return t+e.replace(/\\/g,`/`)}var S=`popstate`;function C(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function w(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return k(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:A(t)}return M(t,n,null,e)}function T(e,t){if(e===!1||e==null)throw Error(t)}function E(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function D(){return Math.random().toString(36).substring(2,10)}function O(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function k(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?j(t):t,state:n,key:t&&t.key||r||D(),mask:i}}function A({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function j(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function M(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=C(e)?e:k(h.location,e,t);n&&n(r,e),l=u()+1;let d=O(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=C(e)?e:k(h.location,e,t);n&&n(r,e),l=u();let i=O(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ee(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(S,d),c=e,()=>{i.removeEventListener(S,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ee(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),T(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:A(t);return i=i.replace(/ $/,`%20`),!n&&b.test(i)&&(i=r+i),new URL(i,r)}var N,P=class{constructor(e){if(_(this,N,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(g(this,N).has(e))return g(this,N).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){g(this,N).set(e,t)}};N=new WeakMap;var F=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function te(e){return F.has(e)}var ne=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function re(e){return ne.has(e)}function ie(e){return e.index===!0}function I(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(T(e.index!==!0||!e.children,`Cannot specify children on an index route`),T(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),ie(e)){let n={...e,id:s};return r[s]=L(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=L(n,t(n)),e.children&&(n.children=I(e.children,t,o,r,i)),n}})}function L(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ae(e,t,n=`/`){return oe(e,t,n,!1)}function oe(e,t,n,r,i){let a=Ee((typeof t==`string`?j(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ce(e),s=null,c=Te(a);for(let e=0;s==null&&e<o.length;++e)s=xe(o[e],c,r);return s}function se(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ce(e){let t=le(e);return de(t),t}function le(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;T(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Ie([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(T(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),le(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:ye(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=we(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ue(e.path))a(e,t,!0,n)}),t}function ue(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ue(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function de(e){e.sort((e,t)=>e.score===t.score?be(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var fe=/^:[\w-]+$/,pe=3,me=2,he=1,ge=10,_e=-2,ve=e=>e===`*`;function ye(e,t){let n=e.split(`/`),r=n.length;return n.some(ve)&&(r+=_e),t&&(r+=me),n.filter(e=>!ve(e)).reduce((e,t)=>e+(fe.test(t)?pe:t===``?he:ge),r)}function be(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function xe(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Ce(u,l,s.matcher,s.compiledParams):Se(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Se({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Ie([a,d.pathname]),pathnameBase:Re(Ie([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Ie([a,d.pathnameBase]))}return o}function Se(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=we(e.path,e.caseSensitive,e.end);return Ce(e,t,n,r)}function Ce(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Le(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Le(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function we(e,t=!1,n=!0){E(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Te(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return E(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ee(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function De({basename:e,pathname:t}){return t===`/`?e:Ie([e,t])}var Oe=e=>y.test(e);function ke(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?j(e):e,a;return n?(n=Fe(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Ae(n.substring(1),`/`):Ae(n,t)):a=t,{pathname:a,search:ze(r),hash:Be(i)}}function Ae(e,t){let n=Le(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function je(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Me(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ne(e){let t=Me(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Pe(e,t,n,r=!1){let i;typeof e==`string`?i=j(e):(i={...e},T(!i.pathname||!i.pathname.includes(`?`),je(`?`,`pathname`,`search`,i)),T(!i.pathname||!i.pathname.includes(`#`),je(`#`,`pathname`,`hash`,i)),T(!i.search||!i.search.includes(`#`),je(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=ke(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Fe=e=>e.replace(/[\\/]{2,}/g,`/`),Ie=e=>Fe(e.join(`/`));function Le(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Re=e=>Le(e).replace(/^\/*/,`/`),ze=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Be=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ve=(e,t=302)=>{let n=t;typeof n==`number`?n={status:n}:n.status===void 0&&(n.status=302);let r=new Headers(n.headers);return r.set(`Location`,e),new Response(null,{...n,headers:r})},He=(e,t)=>{let n=Ve(e,t);return n.headers.set(`X-Remix-Replace`,`true`),n},Ue=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],We=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ge(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ke(e){return Ie(e.map(e=>e.route.path).filter(Boolean))||`/`}var qe=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Je(e,t){let n=e;if(typeof n!=`string`||!y.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(qe)try{let e=new URL(window.location.href),r=b.test(n)?new URL(x(n,e.protocol)):new URL(n),a=Ee(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{E(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var Ye=Symbol(`Uninstrumented`);function Xe(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=Qe(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=Qe(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[Ye]??i,a=Qe(n[e],t,(...e)=>et(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[Ye]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[Ye]??e,r=Qe(n.middleware,t,(...e)=>et(e[0]));return r?(r[Ye]=t,r):e})),r}function Ze(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[Ye]??e.navigate,r=Qe(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?A(n):`.`,...tt(e,r??{})}});r&&(r[Ye]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[Ye]??e.fetch,r=Qe(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...tt(e,i??{})}});r&&(r[Ye]=t,e.fetch=r)}return e}function Qe(e,t,n){return e.length===0?null:async(...r)=>{let i=await $e(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function $e(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=$e(e,t,n,r-1),a=await o,T(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function et(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:nt(t),params:{...r},pattern:i,context:rt(n)}}function tt(e,t){return{currentUrl:A(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function nt(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function rt(e){if(at(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var it=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function at(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===it}var ot=new URL(`http://localhost`);function st(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),ot)}catch{return ot}}function ct(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function lt(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function ut(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!ct(i,n),s=!ct(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!lt(e,i)||!ct(i,a)))throw Error(`External navigation is not allowed`)}var dt=[`POST`,`PUT`,`PATCH`,`DELETE`],ft=new Set(dt),pt=[`GET`,...dt],mt=new Set(pt),ht=new Set([301,302,303,307,308]),gt=new Set([307,308]),_t={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},vt={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},yt={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},bt=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),xt=`remix-router-transitions`,St=Symbol(`ResetLoaderData`),Ct,wt,Tt,Et,Dt=class{constructor(e){_(this,Ct),_(this,wt),_(this,Tt),_(this,Et),v(this,Ct,e),v(this,wt,ce(e))}get stableRoutes(){return g(this,Ct)}get activeRoutes(){return g(this,Tt)??g(this,Ct)}get branches(){return g(this,Et)??g(this,wt)}get hasHMRRoutes(){return g(this,Tt)!=null}setRoutes(e){v(this,Ct,e),v(this,wt,ce(e))}setHmrRoutes(e){v(this,Tt,e),v(this,Et,ce(e))}commitHmrRoutes(){g(this,Tt)&&(v(this,Ct,g(this,Tt)),v(this,wt,g(this,Et)),v(this,Tt,void 0),v(this,Et,void 0))}};Ct=new WeakMap,wt=new WeakMap,Tt=new WeakMap,Et=new WeakMap;function Ot(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;T(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||bt,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...Xe(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new Dt(I(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Gt,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=oe(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,x=null,S,C;if(v==null&&!e.patchRoutesOnNavigation){let t=_n(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=gn(s.activeRoutes);S=!0,C=!S,v=n,x={[r.id]:t}}else if(v&&!e.hydrationData&&ct(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){S=!1,C=!S,v=[];let t=ct(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))S=!1,C=!S;else if(!v.some(e=>Nt(e.route)))S=!0,C=!S;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}C=!1,S=!0,r.forEach(e=>{let r=Pt(e.route,t,n);C||=r.renderFallback,S&&=!r.shouldLoad})}let w,D={historyAction:e.history.action,location:e.history.location,matches:v,initialized:S,renderFallback:C,navigation:_t,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},O=`POP`,M=null,N=!1,F,te=!1,ne=new Map,re=null,ie=!1,L=!1,ae=new Set,ce=new Map,le=0,ue=-1,de=new Map,fe=new Set,pe=new Map,me=new Map,he=new Set,ge=new Map,_e,ve=null;function ye(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(_e){_e(),_e=void 0;return}E(ge.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=nt({currentLocation:D.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{_e=e});e.history.go(r*-1),tt(i,{state:`blocked`,location:n,proceed(){tt(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(D.blockers);e.set(i,yt),Se({blockers:e})}}),M?.resolve(),M=null}else return De(t,n)}),n){Vn(t,ne);let e=()=>Hn(t,ne);t.addEventListener(`pagehide`,e),re=()=>t.removeEventListener(`pagehide`,e)}return D.initialized||De(`POP`,D.location,{initialHydration:!0}),w}function be(){d&&d(),re&&re(),f.clear(),F&&F.abort(),D.fetchers.forEach((e,t)=>We(D.fetchers,t)),D.blockers.forEach((e,t)=>et(t))}function xe(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(D,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function Se(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),D={...D,...e};let n=[],r=[];D.fetchers.forEach((e,t)=>{e.state===`idle`&&(he.has(t)?n.push(t):r.push(t))}),he.forEach(e=>{!D.fetchers.has(e)&&!ce.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(D,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>We(D.fetchers,e)),r.forEach(e=>D.fetchers.delete(e))}function Ce(t,n,{flushSync:r}={}){let i=D.actionData!=null&&D.navigation.formMethod!=null&&Mn(D.navigation.formMethod)&&D.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?D.actionData:null;let o=n.loaderData?pn(D.loaderData,n.loaderData,n.matches||[],n.errors):D.loaderData,c=D.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,yt)));let l=!ie&&st(t,n.matches||D.matches),u=N===!0||D.navigation.formMethod!=null&&Mn(D.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),ie||O===`POP`||(O===`PUSH`?e.history.push(t,t.state):O===`REPLACE`&&e.history.replace(t,t.state));let d;if(O===`POP`&&!ie&&t!==D.location){let e=ne.get(D.location.pathname);e&&e.has(t.pathname)?d={currentLocation:D.location,nextLocation:t}:ne.has(t.pathname)&&(d={currentLocation:t,nextLocation:D.location})}else if(te){let e=ne.get(D.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ne.set(D.location.pathname,e)),d={currentLocation:D.location,nextLocation:t}}Se({...n,actionData:a,loaderData:o,historyAction:O,location:t,initialized:!0,renderFallback:!1,navigation:_t,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),O=`POP`,N=!1,te=!1,ie=!1,L=!1,M?.resolve(),M=null,ve?.resolve(),ve=null}async function we(t,n){if(M?.resolve(),M=null,typeof t==`number`){M||=Un();let n=M.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=jt(!1,At(D.location,D.matches,c,t,n?.fromRouteId,n?.relative),n),o;if(n?.mask){let t=typeof n.mask==`string`?j(n.mask):{...D.location.mask,...n.mask};if(o={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},b.test(o.pathname))throw Error(`External navigation is not allowed`);o.pathname.startsWith(`\\`)&&(o.pathname=o.pathname.replace(/^\\+/,`/`)),ut(typeof n.mask==`string`?n.mask:A(n.mask),A(o),e.history.createURL(`/`),`reject`)}let s=D.location,l=k(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)},ut(t==null?e.history.createHref(D.location):typeof t==`string`?t:A(t),e.history.createHref(l.mask||l),e.history.createURL(`/`),`reject`);let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&Mn(i.formMethod)&&i.formAction===D.location.pathname+D.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=nt({currentLocation:s,nextLocation:l,historyAction:d});m?tt(m,{state:`blocked`,location:l,proceed(){tt(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),we(t,n)},reset(){let e=new Map(D.blockers);e.set(m,yt),Se({blockers:e})}}):await De(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function Te(){ve||=Un(),ze(),Se({revalidation:`loading`});let e=ve.promise;return D.navigation.state===`submitting`?e:D.navigation.state===`idle`?(De(D.historyAction,D.location,{startUninterruptedRevalidation:!0}),e):(De(O||D.historyAction,D.navigation.location,{overrideNavigation:D.navigation,enableViewTransition:te===!0}),e)}async function De(t,n,r){F&&F.abort(),F=null,O=t,ie=(r&&r.startUninterruptedRevalidation)===!0,ot(D.location,D.matches),N=(r&&r.preventScrollReset)===!0,te=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&D.matches&&D.matches.length>0&&!y?D.matches:oe(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&D.initialized&&!L&&bn(D.location,n)&&!(r&&r.submission&&Mn(r.submission.formMethod))){Ce(n,{matches:a},{flushSync:o});return}let l=ct(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=rt(n.pathname);Ce(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;F=new AbortController;let d=sn(e.history,n,F.signal,r&&r.submission),f=e.getContext?await e.getContext():new P,p;if(r&&r.pendingError)p=[hn(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Mn(r.submission.formMethod)){let i=await ke(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(Tn(t)&&Ge(t.error)&&t.error.status===404){F=null,Ce(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=In(n,a,t,r.submission),o=!1,l.active=!1,d=sn(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await Ae(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(F=null,Ce(n,{matches:h||a,...mn(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function ke(t,n,i,l,u,d,f,p,m={}){if(ze(),Se({navigation:Ln(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await lt(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=gn(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=hn(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=rt(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=Pn(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:_n(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Le(t,n,Zt(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(En(h)){let n;return n=m&&m.replace!=null?m.replace:on(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===D.location.pathname+D.location.search,await Ie(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Tn(h)){let e=hn(l,g.route.id);return(m&&m.replace)!==!0&&(O=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function Ae(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||In(n,i,l,p),x=p||m||Fn(b),S=!ie&&!g;if(d){if(S){let e=je(v);Se({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await lt(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=gn(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=hn(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=rt(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:w,revalidatingFetchers:T}=Mt(t,u,a,o,e.history,D,i,x,n,g?[]:r,g===!0,L,ae,he,pe,fe,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(ue=++le,!e.dataStrategy&&!w.some(e=>e.shouldLoad)&&!w.some(e=>e.route.middleware&&e.route.middleware.length>0)&&T.length===0){let e=new Map(D.fetchers),t=Ye(e);return Ce(n,{matches:i,loaderData:{},errors:v&&Tn(v[1])?{[v[0]]:v[1].error}:null,...mn(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=je(v);t!==void 0&&(e.actionData=t)}T.length>0&&(e.fetchers=Me(T)),Se(e,{flushSync:_})}T.forEach(e=>{qe(e.key),e.controller&&ce.set(e.key,e.controller)});let E=()=>T.forEach(e=>qe(e.key));F&&F.signal.addEventListener(`abort`,E);let{loaderResults:O,fetcherResults:k}=await Re(w,T,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener(`abort`,E),T.forEach(e=>ce.delete(e.key));let A=vn(O);if(A)return await Ie(t,A.result,!0,{replace:h}),{shortCircuited:!0};if(A=vn(k),A)return fe.add(A.key),await Ie(t,A.result,!0,{replace:h}),{shortCircuited:!0};let j=new Map(D.fetchers),{loaderData:M,errors:ee}=fn(D,i,O,v,T,k,j);g&&D.errors&&(ee={...D.errors,...ee});let N=Ye(j),P=Qe(ue,j),te=N||P||T.length>0;return{matches:i,loaderData:M,errors:ee,...te?{workingFetchers:j}:{}}}function je(e){if(e&&!Tn(e[1]))return{[e[0]]:e[1].data};if(D.actionData)return Object.keys(D.actionData).length===0?null:D.actionData}function Me(e){let t=new Map(D.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=Rn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Ne(t,n,r,i){qe(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=At(D.location,D.matches,c,r,n,i?.relative),u=oe(o,l,c,!1,s.branches),d=ct(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){Ve(t,n,_n(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=jt(!0,l,i);if(m){Ve(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new P,g=(i&&i.preventScrollReset)===!0;p&&Mn(p.formMethod)?await Pe(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate):(pe.set(t,{routeId:n,path:f}),await Fe(t,n,f,u,h,d.active,a,g,p))}async function Pe(t,n,i,l,u,d,f,p,m,h){ze(),pe.delete(t),Be(t,zn(m,D.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=sn(e.history,i,g.signal,m);if(d){let e=await lt(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Ve(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{Ve(t,n,_n(404,{pathname:i}),{flushSync:f});return}}let v=Pn(l,i);if(!v.route.action&&!v.route.lazy){Ve(t,n,_n(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}ce.set(t,g);let y=le,b=Zt(a,o,_,i,l,v,r,u),x=await Le(_,i,b,u,t),S=x[v.route.id];if(!S){for(let e of b)if(x[e.route.id]){S=x[e.route.id];break}}if(_.signal.aborted){ce.get(t)===g&&ce.delete(t);return}if(he.has(t)){if(En(S)||Tn(S)){Be(t,Bn(void 0));return}}else{if(En(S)){if(ce.delete(t),ue>y){Be(t,Bn(void 0));return}return fe.add(t),Be(t,Rn(m)),Ie(_,S,!1,{fetcherSubmission:m,preventScrollReset:p})}if(Tn(S)){Ve(t,n,S.error);return}}let C=D.navigation.location||D.location,w=sn(e.history,C,g.signal),E=s.activeRoutes,k=D.navigation.state===`idle`?D.matches:oe(E,D.navigation.location,c,!1,s.branches);T(k,`Didn't find any matches after fetcher action`);let A=++le;de.set(t,A);let{dsMatches:j,revalidatingFetchers:M}=Mt(w,u,a,o,e.history,D,k,m,C,r,!1,L,ae,he,pe,fe,E,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),ee=Rn(m,S.data),N=new Map(D.fetchers);N.set(t,ee),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=N.get(t),r=Rn(void 0,n?n.data:void 0);N.set(t,r),qe(t),e.controller&&ce.set(t,e.controller)}),Se({fetchers:N});let P=()=>M.forEach(e=>qe(e.key));g.signal.addEventListener(`abort`,P);let{loaderResults:te,fetcherResults:ne}=await Re(j,M,w,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,P),de.delete(t),ce.delete(t),M.forEach(e=>ce.delete(e.key));let re=D.fetchers.has(t),ie=e=>{if(!re)return e;let n=new Map(e.fetchers);return n.set(t,Bn(S.data)),{...e,fetchers:n}},I=vn(te);if(I)return D=ie(D),Ie(w,I.result,!1,{preventScrollReset:p});if(I=vn(ne),I)return fe.add(I.key),D=ie(D),Ie(w,I.result,!1,{preventScrollReset:p});let se=new Map(D.fetchers);re&&se.set(t,Bn(S.data));let{loaderData:me,errors:ge}=fn(D,k,te,void 0,M,ne,se);Qe(A,se),D.navigation.state===`loading`&&A>ue?(T(O,`Expected pending action`),F&&F.abort(),Ce(D.navigation.location,{matches:k,loaderData:me,errors:ge,fetchers:se})):(Se({errors:ge,loaderData:pn(D.loaderData,me,k,ge),fetchers:se}),L=!1)}async function Fe(t,n,i,s,c,l,u,d,f){let p=D.fetchers.get(t);Be(t,Rn(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=sn(e.history,i,m.signal);if(l){let e=await lt(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Ve(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{Ve(t,n,_n(404,{pathname:i}),{flushSync:u});return}}let g=Pn(s,i);ce.set(t,m);let _=le,v=await Le(h,i,Zt(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(ce.get(t)===m&&ce.delete(t),!h.signal.aborted){if(he.has(t))Be(t,Bn(void 0));else if(En(y)){if(ue>_){Be(t,Bn(void 0));return}fe.add(t),await Ie(h,y,!1,{preventScrollReset:d})}else Tn(y)?Ve(t,n,y.error):Be(t,Bn(y.data))}}async function Ie(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(M?.resolve(),M=null),i.response.headers.has(`X-Remix-Revalidate`)&&(L=!0);let d=i.response.headers.get(`Location`);T(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=on(d,p,c,e.history),ut(f,d,p,`allow-explicit`);let m=k(D.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Oe(d)){let n=ee(t,d,!0);e=n.origin!==t.location.origin||Ee(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}F=null;let h=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=D.navigation;!o&&!s&&g&&_&&v&&(o=Fn(D.navigation));let y=o||s;gt.has(i.response.status)&&y&&Mn(y.formMethod)?await De(h,m,{submission:{...y,formAction:d},preventScrollReset:l||N,enableViewTransition:a?te:void 0}):await De(h,m,{overrideNavigation:In(m,[],h,o),fetcherSubmission:s,preventScrollReset:l||N,enableViewTransition:a?te:void 0})}async function Le(e,t,n,r,i){let a,o={};try{a=await Qt(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Mn(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;a.hasOwnProperty(e.route.id)||D.loaderData.hasOwnProperty(e.route.id)||D.errors&&D.errors.hasOwnProperty(e.route.id)||!e.shouldCallHandler()||(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(wn(r)){let i=r.result;o[t]={type:`redirect`,response:nn(i,e,t,n,c)}}else o[t]=await tn(r);return o}async function Re(e,t,n,r,i){let a=Le(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Le(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:_n(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function ze(){L=!0,pe.forEach((e,t)=>{ce.has(t)&&ae.add(t),qe(t)})}function Be(e,t,n={}){let r=new Map(D.fetchers);r.set(e,t),Se({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Ve(e,t,n,r={}){let i=hn(D.matches,t),a=new Map(D.fetchers);We(a,e),Se({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function He(e){return me.set(e,(me.get(e)||0)+1),he.has(e)&&he.delete(e),D.fetchers.get(e)||vt}function Ue(e,t){qe(e,t?.reason),Be(e,Bn(null))}function We(e,t){let n=D.fetchers.get(t);ce.has(t)&&!(n&&n.state===`loading`&&de.has(t))&&qe(t),pe.delete(t),de.delete(t),fe.delete(t),he.delete(t),ae.delete(t),e.delete(t)}function Ke(e){let t=(me.get(e)||0)-1;t<=0?(me.delete(e),he.add(e)):me.set(e,t),Se({fetchers:new Map(D.fetchers)})}function qe(e,t){let n=ce.get(e);n&&(n.abort(t),ce.delete(e))}function Je(e,t){for(let n of e){let e=t.get(n);T(e,`Expected fetcher: ${n}`);let r=Bn(e.data);t.set(n,r)}}function Ye(e){let t=[],n=!1;for(let r of fe){let i=e.get(r);T(i,`Expected fetcher: ${r}`),i.state===`loading`&&(fe.delete(r),t.push(r),n=!0)}return Je(t,e),n}function Qe(e,t){let n=[];for(let[r,i]of de)if(i<e){let e=t.get(r);T(e,`Expected fetcher: ${r}`),e.state===`loading`&&(qe(r),de.delete(r),n.push(r))}return Je(n,t),n.length>0}function $e(e,t){let n=D.blockers.get(e)||yt;return ge.get(e)!==t&&ge.set(e,t),n}function et(e){D.blockers.delete(e),ge.delete(e)}function tt(e,t){let n=D.blockers.get(e)||yt;T(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(D.blockers);r.set(e,t),Se({blockers:r})}function nt({currentLocation:e,nextLocation:t,historyAction:n}){if(ge.size===0)return;ge.size>1&&E(!1,`A router only supports one blocker at a time`);let r=Array.from(ge.entries()),[i,a]=r[r.length-1],o=D.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function rt(e){let t=_n(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=gn(n);return{notFoundMatches:r,route:i,error:t}}function it(e,t,n){if(m=e,g=t,h=n||null,!_&&D.navigation===_t){_=!0;let e=st(D.location,D.matches);e!=null&&Se({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function at(e,t){return h&&h(e,t.map(e=>se(e,D.loaderData)))||e.key}function ot(e,t){if(m&&g){let n=at(e,t);m[n]=g()}}function st(e,t){if(m){let n=at(e,t),r=m[n];if(typeof r==`number`)return r}return null}function ct(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:oe(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:oe(n,r,c,!0,e)}}return{active:!1,matches:null}}async function lt(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||Rt(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=oe(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=oe(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&dt(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=oe(s.activeRoutes,n,c,!0,u),!f||dt(l,f))return{type:`success`,matches:null};l=f}}function dt(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function ft(e){o={},s.setHmrRoutes(I(e,a,void 0,o))}function pt(e,t,n=!1){Rt(e,t,s,o,a,n),s.hasHMRRoutes||Se({})}return w={get basename(){return c},get future(){return u},get state(){return D},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:ye,subscribe:xe,enableScrollRestoration:it,navigate:we,fetch:Ne,revalidate:Te,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:He,resetFetcher:Ue,deleteFetcher:Ke,dispose:be,getBlocker:$e,deleteBlocker:et,patchRoutes:pt,_internalFetchControllers:ce,_internalSetRoutes:ft,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){Se(e)}},e.instrumentations&&(w=Ze(w,e.instrumentations.map(e=>e.router).filter(Boolean))),w}function kt(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function At(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=Pe(r||`.`,Ne(o),Ee(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=Nn(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=De({basename:n,pathname:c.pathname})),A(c)}function jt(e,t,n){if(!n||!kt(n))return{path:t};if(n.formMethod&&!jn(n.formMethod))return{path:t,error:_n(405,{method:n.formMethod})};let r=()=>({path:t,error:_n(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=yn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Mn(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-CTOp7rv3.js","assets/index-DXsLZBrh.js","assets/editor.api-Cf23vh6d.js","assets/editor-DjpsE8to.css","assets/monaco-n7clI0si.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./index-DXsLZBrh.js";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),c=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ee(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ee(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),ee(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=ee(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=ee(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ee(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return ee(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var F=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},te={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=te,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),f=s(((e,t)=>{t.exports=d()})),p=u(f(),1),m=e=>{throw TypeError(e)},h=(e,t,n)=>t.has(e)||m(`Cannot `+n),g=(e,t,n)=>(h(e,t,`read from private field`),n?n.call(e):t.get(e)),_=(e,t,n)=>t.has(e)?m(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),v=(e,t,n,r)=>(h(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),y=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,b=/^[\\/]{2}/;function x(e,t){return t+e.replace(/\\/g,`/`)}var S=`popstate`;function C(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function w(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return k(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:A(t)}return M(t,n,null,e)}function T(e,t){if(e===!1||e==null)throw Error(t)}function E(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function D(){return Math.random().toString(36).substring(2,10)}function O(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function k(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?j(t):t,state:n,key:t&&t.key||r||D(),mask:i}}function A({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function j(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function M(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=C(e)?e:k(h.location,e,t);n&&n(r,e),l=u()+1;let d=O(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=C(e)?e:k(h.location,e,t);n&&n(r,e),l=u();let i=O(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ee(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(S,d),c=e,()=>{i.removeEventListener(S,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ee(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),T(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:A(t);return i=i.replace(/ $/,`%20`),!n&&b.test(i)&&(i=r+i),new URL(i,r)}var N,P=class{constructor(e){if(_(this,N,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(g(this,N).has(e))return g(this,N).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){g(this,N).set(e,t)}};N=new WeakMap;var F=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function te(e){return F.has(e)}var ne=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function re(e){return ne.has(e)}function ie(e){return e.index===!0}function I(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(T(e.index!==!0||!e.children,`Cannot specify children on an index route`),T(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),ie(e)){let n={...e,id:s};return r[s]=L(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=L(n,t(n)),e.children&&(n.children=I(e.children,t,o,r,i)),n}})}function L(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ae(e,t,n=`/`){return oe(e,t,n,!1)}function oe(e,t,n,r,i){let a=Ee((typeof t==`string`?j(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ce(e),s=null,c=Te(a);for(let e=0;s==null&&e<o.length;++e)s=xe(o[e],c,r);return s}function se(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ce(e){let t=le(e);return de(t),t}function le(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;T(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Ie([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(T(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),le(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:ye(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=we(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ue(e.path))a(e,t,!0,n)}),t}function ue(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ue(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function de(e){e.sort((e,t)=>e.score===t.score?be(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var fe=/^:[\w-]+$/,pe=3,me=2,he=1,ge=10,_e=-2,ve=e=>e===`*`;function ye(e,t){let n=e.split(`/`),r=n.length;return n.some(ve)&&(r+=_e),t&&(r+=me),n.filter(e=>!ve(e)).reduce((e,t)=>e+(fe.test(t)?pe:t===``?he:ge),r)}function be(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function xe(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Ce(u,l,s.matcher,s.compiledParams):Se(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Se({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Ie([a,d.pathname]),pathnameBase:Re(Ie([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Ie([a,d.pathnameBase]))}return o}function Se(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=we(e.path,e.caseSensitive,e.end);return Ce(e,t,n,r)}function Ce(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Le(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Le(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function we(e,t=!1,n=!0){E(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Te(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return E(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ee(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function De({basename:e,pathname:t}){return t===`/`?e:Ie([e,t])}var Oe=e=>y.test(e);function ke(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?j(e):e,a;return n?(n=Fe(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Ae(n.substring(1),`/`):Ae(n,t)):a=t,{pathname:a,search:ze(r),hash:Be(i)}}function Ae(e,t){let n=Le(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function je(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Me(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ne(e){let t=Me(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Pe(e,t,n,r=!1){let i;typeof e==`string`?i=j(e):(i={...e},T(!i.pathname||!i.pathname.includes(`?`),je(`?`,`pathname`,`search`,i)),T(!i.pathname||!i.pathname.includes(`#`),je(`#`,`pathname`,`hash`,i)),T(!i.search||!i.search.includes(`#`),je(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=ke(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Fe=e=>e.replace(/[\\/]{2,}/g,`/`),Ie=e=>Fe(e.join(`/`));function Le(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Re=e=>Le(e).replace(/^\/*/,`/`),ze=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Be=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ve=(e,t=302)=>{let n=t;typeof n==`number`?n={status:n}:n.status===void 0&&(n.status=302);let r=new Headers(n.headers);return r.set(`Location`,e),new Response(null,{...n,headers:r})},He=(e,t)=>{let n=Ve(e,t);return n.headers.set(`X-Remix-Replace`,`true`),n},Ue=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],We=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ge(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ke(e){return Ie(e.map(e=>e.route.path).filter(Boolean))||`/`}var qe=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Je(e,t){let n=e;if(typeof n!=`string`||!y.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(qe)try{let e=new URL(window.location.href),r=b.test(n)?new URL(x(n,e.protocol)):new URL(n),a=Ee(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{E(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var Ye=Symbol(`Uninstrumented`);function Xe(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=Qe(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=Qe(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[Ye]??i,a=Qe(n[e],t,(...e)=>et(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[Ye]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[Ye]??e,r=Qe(n.middleware,t,(...e)=>et(e[0]));return r?(r[Ye]=t,r):e})),r}function Ze(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[Ye]??e.navigate,r=Qe(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?A(n):`.`,...tt(e,r??{})}});r&&(r[Ye]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[Ye]??e.fetch,r=Qe(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...tt(e,i??{})}});r&&(r[Ye]=t,e.fetch=r)}return e}function Qe(e,t,n){return e.length===0?null:async(...r)=>{let i=await $e(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function $e(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=$e(e,t,n,r-1),a=await o,T(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function et(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:nt(t),params:{...r},pattern:i,context:rt(n)}}function tt(e,t){return{currentUrl:A(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function nt(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function rt(e){if(at(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var it=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function at(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===it}var ot=new URL(`http://localhost`);function st(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),ot)}catch{return ot}}function ct(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function lt(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function ut(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!ct(i,n),s=!ct(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!lt(e,i)||!ct(i,a)))throw Error(`External navigation is not allowed`)}var dt=[`POST`,`PUT`,`PATCH`,`DELETE`],ft=new Set(dt),pt=[`GET`,...dt],mt=new Set(pt),ht=new Set([301,302,303,307,308]),gt=new Set([307,308]),_t={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},vt={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},yt={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},bt=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),xt=`remix-router-transitions`,St=Symbol(`ResetLoaderData`),Ct,wt,Tt,Et,Dt=class{constructor(e){_(this,Ct),_(this,wt),_(this,Tt),_(this,Et),v(this,Ct,e),v(this,wt,ce(e))}get stableRoutes(){return g(this,Ct)}get activeRoutes(){return g(this,Tt)??g(this,Ct)}get branches(){return g(this,Et)??g(this,wt)}get hasHMRRoutes(){return g(this,Tt)!=null}setRoutes(e){v(this,Ct,e),v(this,wt,ce(e))}setHmrRoutes(e){v(this,Tt,e),v(this,Et,ce(e))}commitHmrRoutes(){g(this,Tt)&&(v(this,Ct,g(this,Tt)),v(this,wt,g(this,Et)),v(this,Tt,void 0),v(this,Et,void 0))}};Ct=new WeakMap,wt=new WeakMap,Tt=new WeakMap,Et=new WeakMap;function Ot(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;T(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||bt,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...Xe(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new Dt(I(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Gt,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=oe(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,x=null,S,C;if(v==null&&!e.patchRoutesOnNavigation){let t=_n(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=gn(s.activeRoutes);S=!0,C=!S,v=n,x={[r.id]:t}}else if(v&&!e.hydrationData&&ct(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){S=!1,C=!S,v=[];let t=ct(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))S=!1,C=!S;else if(!v.some(e=>Nt(e.route)))S=!0,C=!S;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}C=!1,S=!0,r.forEach(e=>{let r=Pt(e.route,t,n);C||=r.renderFallback,S&&=!r.shouldLoad})}let w,D={historyAction:e.history.action,location:e.history.location,matches:v,initialized:S,renderFallback:C,navigation:_t,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},O=`POP`,M=null,N=!1,F,te=!1,ne=new Map,re=null,ie=!1,L=!1,ae=new Set,ce=new Map,le=0,ue=-1,de=new Map,fe=new Set,pe=new Map,me=new Map,he=new Set,ge=new Map,_e,ve=null;function ye(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(_e){_e(),_e=void 0;return}E(ge.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=nt({currentLocation:D.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{_e=e});e.history.go(r*-1),tt(i,{state:`blocked`,location:n,proceed(){tt(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(D.blockers);e.set(i,yt),Se({blockers:e})}}),M?.resolve(),M=null}else return De(t,n)}),n){Vn(t,ne);let e=()=>Hn(t,ne);t.addEventListener(`pagehide`,e),re=()=>t.removeEventListener(`pagehide`,e)}return D.initialized||De(`POP`,D.location,{initialHydration:!0}),w}function be(){d&&d(),re&&re(),f.clear(),F&&F.abort(),D.fetchers.forEach((e,t)=>We(D.fetchers,t)),D.blockers.forEach((e,t)=>et(t))}function xe(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(D,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function Se(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),D={...D,...e};let n=[],r=[];D.fetchers.forEach((e,t)=>{e.state===`idle`&&(he.has(t)?n.push(t):r.push(t))}),he.forEach(e=>{!D.fetchers.has(e)&&!ce.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(D,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>We(D.fetchers,e)),r.forEach(e=>D.fetchers.delete(e))}function Ce(t,n,{flushSync:r}={}){let i=D.actionData!=null&&D.navigation.formMethod!=null&&Mn(D.navigation.formMethod)&&D.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?D.actionData:null;let o=n.loaderData?pn(D.loaderData,n.loaderData,n.matches||[],n.errors):D.loaderData,c=D.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,yt)));let l=!ie&&st(t,n.matches||D.matches),u=N===!0||D.navigation.formMethod!=null&&Mn(D.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),ie||O===`POP`||(O===`PUSH`?e.history.push(t,t.state):O===`REPLACE`&&e.history.replace(t,t.state));let d;if(O===`POP`&&!ie&&t!==D.location){let e=ne.get(D.location.pathname);e&&e.has(t.pathname)?d={currentLocation:D.location,nextLocation:t}:ne.has(t.pathname)&&(d={currentLocation:t,nextLocation:D.location})}else if(te){let e=ne.get(D.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ne.set(D.location.pathname,e)),d={currentLocation:D.location,nextLocation:t}}Se({...n,actionData:a,loaderData:o,historyAction:O,location:t,initialized:!0,renderFallback:!1,navigation:_t,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),O=`POP`,N=!1,te=!1,ie=!1,L=!1,M?.resolve(),M=null,ve?.resolve(),ve=null}async function we(t,n){if(M?.resolve(),M=null,typeof t==`number`){M||=Un();let n=M.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=jt(!1,At(D.location,D.matches,c,t,n?.fromRouteId,n?.relative),n),o;if(n?.mask){let t=typeof n.mask==`string`?j(n.mask):{...D.location.mask,...n.mask};if(o={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},b.test(o.pathname))throw Error(`External navigation is not allowed`);o.pathname.startsWith(`\\`)&&(o.pathname=o.pathname.replace(/^\\+/,`/`)),ut(typeof n.mask==`string`?n.mask:A(n.mask),A(o),e.history.createURL(`/`),`reject`)}let s=D.location,l=k(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)},ut(t==null?e.history.createHref(D.location):typeof t==`string`?t:A(t),e.history.createHref(l.mask||l),e.history.createURL(`/`),`reject`);let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&Mn(i.formMethod)&&i.formAction===D.location.pathname+D.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=nt({currentLocation:s,nextLocation:l,historyAction:d});m?tt(m,{state:`blocked`,location:l,proceed(){tt(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),we(t,n)},reset(){let e=new Map(D.blockers);e.set(m,yt),Se({blockers:e})}}):await De(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function Te(){ve||=Un(),ze(),Se({revalidation:`loading`});let e=ve.promise;return D.navigation.state===`submitting`?e:D.navigation.state===`idle`?(De(D.historyAction,D.location,{startUninterruptedRevalidation:!0}),e):(De(O||D.historyAction,D.navigation.location,{overrideNavigation:D.navigation,enableViewTransition:te===!0}),e)}async function De(t,n,r){F&&F.abort(),F=null,O=t,ie=(r&&r.startUninterruptedRevalidation)===!0,ot(D.location,D.matches),N=(r&&r.preventScrollReset)===!0,te=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&D.matches&&D.matches.length>0&&!y?D.matches:oe(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&D.initialized&&!L&&bn(D.location,n)&&!(r&&r.submission&&Mn(r.submission.formMethod))){Ce(n,{matches:a},{flushSync:o});return}let l=ct(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=rt(n.pathname);Ce(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;F=new AbortController;let d=sn(e.history,n,F.signal,r&&r.submission),f=e.getContext?await e.getContext():new P,p;if(r&&r.pendingError)p=[hn(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Mn(r.submission.formMethod)){let i=await ke(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(Tn(t)&&Ge(t.error)&&t.error.status===404){F=null,Ce(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=In(n,a,t,r.submission),o=!1,l.active=!1,d=sn(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await Ae(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(F=null,Ce(n,{matches:h||a,...mn(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function ke(t,n,i,l,u,d,f,p,m={}){if(ze(),Se({navigation:Ln(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await lt(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=gn(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=hn(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=rt(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=Pn(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:_n(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Le(t,n,Zt(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(En(h)){let n;return n=m&&m.replace!=null?m.replace:on(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===D.location.pathname+D.location.search,await Ie(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Tn(h)){let e=hn(l,g.route.id);return(m&&m.replace)!==!0&&(O=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function Ae(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||In(n,i,l,p),x=p||m||Fn(b),S=!ie&&!g;if(d){if(S){let e=je(v);Se({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await lt(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=gn(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=hn(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=rt(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:w,revalidatingFetchers:T}=Mt(t,u,a,o,e.history,D,i,x,n,g?[]:r,g===!0,L,ae,he,pe,fe,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(ue=++le,!e.dataStrategy&&!w.some(e=>e.shouldLoad)&&!w.some(e=>e.route.middleware&&e.route.middleware.length>0)&&T.length===0){let e=new Map(D.fetchers),t=Ye(e);return Ce(n,{matches:i,loaderData:{},errors:v&&Tn(v[1])?{[v[0]]:v[1].error}:null,...mn(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=je(v);t!==void 0&&(e.actionData=t)}T.length>0&&(e.fetchers=Me(T)),Se(e,{flushSync:_})}T.forEach(e=>{qe(e.key),e.controller&&ce.set(e.key,e.controller)});let E=()=>T.forEach(e=>qe(e.key));F&&F.signal.addEventListener(`abort`,E);let{loaderResults:O,fetcherResults:k}=await Re(w,T,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener(`abort`,E),T.forEach(e=>ce.delete(e.key));let A=vn(O);if(A)return await Ie(t,A.result,!0,{replace:h}),{shortCircuited:!0};if(A=vn(k),A)return fe.add(A.key),await Ie(t,A.result,!0,{replace:h}),{shortCircuited:!0};let j=new Map(D.fetchers),{loaderData:M,errors:ee}=fn(D,i,O,v,T,k,j);g&&D.errors&&(ee={...D.errors,...ee});let N=Ye(j),P=Qe(ue,j),te=N||P||T.length>0;return{matches:i,loaderData:M,errors:ee,...te?{workingFetchers:j}:{}}}function je(e){if(e&&!Tn(e[1]))return{[e[0]]:e[1].data};if(D.actionData)return Object.keys(D.actionData).length===0?null:D.actionData}function Me(e){let t=new Map(D.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=Rn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Ne(t,n,r,i){qe(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=At(D.location,D.matches,c,r,n,i?.relative),u=oe(o,l,c,!1,s.branches),d=ct(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){Ve(t,n,_n(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=jt(!0,l,i);if(m){Ve(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new P,g=(i&&i.preventScrollReset)===!0;p&&Mn(p.formMethod)?await Pe(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate):(pe.set(t,{routeId:n,path:f}),await Fe(t,n,f,u,h,d.active,a,g,p))}async function Pe(t,n,i,l,u,d,f,p,m,h){ze(),pe.delete(t),Be(t,zn(m,D.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=sn(e.history,i,g.signal,m);if(d){let e=await lt(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Ve(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{Ve(t,n,_n(404,{pathname:i}),{flushSync:f});return}}let v=Pn(l,i);if(!v.route.action&&!v.route.lazy){Ve(t,n,_n(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}ce.set(t,g);let y=le,b=Zt(a,o,_,i,l,v,r,u),x=await Le(_,i,b,u,t),S=x[v.route.id];if(!S){for(let e of b)if(x[e.route.id]){S=x[e.route.id];break}}if(_.signal.aborted){ce.get(t)===g&&ce.delete(t);return}if(he.has(t)){if(En(S)||Tn(S)){Be(t,Bn(void 0));return}}else{if(En(S)){if(ce.delete(t),ue>y){Be(t,Bn(void 0));return}return fe.add(t),Be(t,Rn(m)),Ie(_,S,!1,{fetcherSubmission:m,preventScrollReset:p})}if(Tn(S)){Ve(t,n,S.error);return}}let C=D.navigation.location||D.location,w=sn(e.history,C,g.signal),E=s.activeRoutes,k=D.navigation.state===`idle`?D.matches:oe(E,D.navigation.location,c,!1,s.branches);T(k,`Didn't find any matches after fetcher action`);let A=++le;de.set(t,A);let{dsMatches:j,revalidatingFetchers:M}=Mt(w,u,a,o,e.history,D,k,m,C,r,!1,L,ae,he,pe,fe,E,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),ee=Rn(m,S.data),N=new Map(D.fetchers);N.set(t,ee),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=N.get(t),r=Rn(void 0,n?n.data:void 0);N.set(t,r),qe(t),e.controller&&ce.set(t,e.controller)}),Se({fetchers:N});let P=()=>M.forEach(e=>qe(e.key));g.signal.addEventListener(`abort`,P);let{loaderResults:te,fetcherResults:ne}=await Re(j,M,w,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,P),de.delete(t),ce.delete(t),M.forEach(e=>ce.delete(e.key));let re=D.fetchers.has(t),ie=e=>{if(!re)return e;let n=new Map(e.fetchers);return n.set(t,Bn(S.data)),{...e,fetchers:n}},I=vn(te);if(I)return D=ie(D),Ie(w,I.result,!1,{preventScrollReset:p});if(I=vn(ne),I)return fe.add(I.key),D=ie(D),Ie(w,I.result,!1,{preventScrollReset:p});let se=new Map(D.fetchers);re&&se.set(t,Bn(S.data));let{loaderData:me,errors:ge}=fn(D,k,te,void 0,M,ne,se);Qe(A,se),D.navigation.state===`loading`&&A>ue?(T(O,`Expected pending action`),F&&F.abort(),Ce(D.navigation.location,{matches:k,loaderData:me,errors:ge,fetchers:se})):(Se({errors:ge,loaderData:pn(D.loaderData,me,k,ge),fetchers:se}),L=!1)}async function Fe(t,n,i,s,c,l,u,d,f){let p=D.fetchers.get(t);Be(t,Rn(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=sn(e.history,i,m.signal);if(l){let e=await lt(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Ve(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{Ve(t,n,_n(404,{pathname:i}),{flushSync:u});return}}let g=Pn(s,i);ce.set(t,m);let _=le,v=await Le(h,i,Zt(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(ce.get(t)===m&&ce.delete(t),!h.signal.aborted){if(he.has(t))Be(t,Bn(void 0));else if(En(y)){if(ue>_){Be(t,Bn(void 0));return}fe.add(t),await Ie(h,y,!1,{preventScrollReset:d})}else Tn(y)?Ve(t,n,y.error):Be(t,Bn(y.data))}}async function Ie(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(M?.resolve(),M=null),i.response.headers.has(`X-Remix-Revalidate`)&&(L=!0);let d=i.response.headers.get(`Location`);T(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=on(d,p,c,e.history),ut(f,d,p,`allow-explicit`);let m=k(D.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Oe(d)){let n=ee(t,d,!0);e=n.origin!==t.location.origin||Ee(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}F=null;let h=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=D.navigation;!o&&!s&&g&&_&&v&&(o=Fn(D.navigation));let y=o||s;gt.has(i.response.status)&&y&&Mn(y.formMethod)?await De(h,m,{submission:{...y,formAction:d},preventScrollReset:l||N,enableViewTransition:a?te:void 0}):await De(h,m,{overrideNavigation:In(m,[],h,o),fetcherSubmission:s,preventScrollReset:l||N,enableViewTransition:a?te:void 0})}async function Le(e,t,n,r,i){let a,o={};try{a=await Qt(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Mn(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;a.hasOwnProperty(e.route.id)||D.loaderData.hasOwnProperty(e.route.id)||D.errors&&D.errors.hasOwnProperty(e.route.id)||!e.shouldCallHandler()||(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(wn(r)){let i=r.result;o[t]={type:`redirect`,response:nn(i,e,t,n,c)}}else o[t]=await tn(r);return o}async function Re(e,t,n,r,i){let a=Le(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Le(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:_n(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function ze(){L=!0,pe.forEach((e,t)=>{ce.has(t)&&ae.add(t),qe(t)})}function Be(e,t,n={}){let r=new Map(D.fetchers);r.set(e,t),Se({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Ve(e,t,n,r={}){let i=hn(D.matches,t),a=new Map(D.fetchers);We(a,e),Se({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function He(e){return me.set(e,(me.get(e)||0)+1),he.has(e)&&he.delete(e),D.fetchers.get(e)||vt}function Ue(e,t){qe(e,t?.reason),Be(e,Bn(null))}function We(e,t){let n=D.fetchers.get(t);ce.has(t)&&!(n&&n.state===`loading`&&de.has(t))&&qe(t),pe.delete(t),de.delete(t),fe.delete(t),he.delete(t),ae.delete(t),e.delete(t)}function Ke(e){let t=(me.get(e)||0)-1;t<=0?(me.delete(e),he.add(e)):me.set(e,t),Se({fetchers:new Map(D.fetchers)})}function qe(e,t){let n=ce.get(e);n&&(n.abort(t),ce.delete(e))}function Je(e,t){for(let n of e){let e=t.get(n);T(e,`Expected fetcher: ${n}`);let r=Bn(e.data);t.set(n,r)}}function Ye(e){let t=[],n=!1;for(let r of fe){let i=e.get(r);T(i,`Expected fetcher: ${r}`),i.state===`loading`&&(fe.delete(r),t.push(r),n=!0)}return Je(t,e),n}function Qe(e,t){let n=[];for(let[r,i]of de)if(i<e){let e=t.get(r);T(e,`Expected fetcher: ${r}`),e.state===`loading`&&(qe(r),de.delete(r),n.push(r))}return Je(n,t),n.length>0}function $e(e,t){let n=D.blockers.get(e)||yt;return ge.get(e)!==t&&ge.set(e,t),n}function et(e){D.blockers.delete(e),ge.delete(e)}function tt(e,t){let n=D.blockers.get(e)||yt;T(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(D.blockers);r.set(e,t),Se({blockers:r})}function nt({currentLocation:e,nextLocation:t,historyAction:n}){if(ge.size===0)return;ge.size>1&&E(!1,`A router only supports one blocker at a time`);let r=Array.from(ge.entries()),[i,a]=r[r.length-1],o=D.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function rt(e){let t=_n(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=gn(n);return{notFoundMatches:r,route:i,error:t}}function it(e,t,n){if(m=e,g=t,h=n||null,!_&&D.navigation===_t){_=!0;let e=st(D.location,D.matches);e!=null&&Se({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function at(e,t){return h&&h(e,t.map(e=>se(e,D.loaderData)))||e.key}function ot(e,t){if(m&&g){let n=at(e,t);m[n]=g()}}function st(e,t){if(m){let n=at(e,t),r=m[n];if(typeof r==`number`)return r}return null}function ct(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:oe(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:oe(n,r,c,!0,e)}}return{active:!1,matches:null}}async function lt(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||Rt(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=oe(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=oe(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&dt(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=oe(s.activeRoutes,n,c,!0,u),!f||dt(l,f))return{type:`success`,matches:null};l=f}}function dt(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function ft(e){o={},s.setHmrRoutes(I(e,a,void 0,o))}function pt(e,t,n=!1){Rt(e,t,s,o,a,n),s.hasHMRRoutes||Se({})}return w={get basename(){return c},get future(){return u},get state(){return D},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:ye,subscribe:xe,enableScrollRestoration:it,navigate:we,fetch:Ne,revalidate:Te,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:He,resetFetcher:Ue,deleteFetcher:Ke,dispose:be,getBlocker:$e,deleteBlocker:et,patchRoutes:pt,_internalFetchControllers:ce,_internalSetRoutes:ft,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){Se(e)}},e.instrumentations&&(w=Ze(w,e.instrumentations.map(e=>e.router).filter(Boolean))),w}function kt(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function At(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=Pe(r||`.`,Ne(o),Ee(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=Nn(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=De({basename:n,pathname:c.pathname})),A(c)}function jt(e,t,n){if(!n||!kt(n))return{path:t};if(n.formMethod&&!jn(n.formMethod))return{path:t,error:_n(405,{method:n.formMethod})};let r=()=>({path:t,error:_n(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=yn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Mn(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
|
|
3
3
|
`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!Mn(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}T(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=ln(n.formData),s=n.formData;else if(n.body instanceof FormData)o=ln(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=un(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=un(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Mn(c.formMethod))return{path:t,submission:c};let l=j(t);return e&&l.search&&Nn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:A(l),submission:c}}function Mt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?Tn(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&Tn(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,O={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},k=Ke(o),A=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!Nt(s))f=!1;else if(u){let{shouldLoad:e}=Pt(s,a.loaderData,a.errors);f=e}else Ft(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Xt(n,r,e,c,k,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?It(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p},h=Lt(i,m);return Xt(n,r,e,c,k,i,l,t,h,m,x)}),j=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=oe(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=Pn(b,e.path),C=new AbortController,w=sn(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=Zt(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=Zt(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};Lt(S,a)&&(T=Zt(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:j}}function Nt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Pt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Nt(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function Ft(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function It(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Lt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Rt(e,t,n,r,i,a){let o;if(e){let t=r[e];T(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>zt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=I(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=I([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function zt(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>zt(e,t)))??!1}var Bt=new WeakMap,Vt=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(T(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Bt.get(i);o||(o={},Bt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=te(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)E(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)E(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},Ht=new WeakMap;function Ut(e,t,n,r,i){let a=n[e.id];if(T(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Ht.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{T(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=re(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?E(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?E(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return Ht.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=Vt({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function Wt(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Gt(e){return e.matches.some(e=>e.route.middleware)?Kt(e,()=>Wt(e)):Wt(e)}function Kt(e,t){return qt(e,t,e=>{if(An(e))throw e;return e},Sn,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=hn(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function qt(e,t,n,r,i){let{matches:a,...o}=e;return await Jt(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Jt(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Jt(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function Yt(e,t,n,r,i){let a=Vt({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Ut(r.route,Mn(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Xt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Yt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Lt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Lt(a,{...l,defaultShouldRevalidate:e}):Lt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Mn(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Mn(n.method)||!p)?$t({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Zt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Xt(e,t,n,r,Ke(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Yt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Qt(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:cn(t,n),pattern:Ke(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Kt(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function $t({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Mn(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:cn(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw _n(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw _n(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function en(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function tn(e){let{result:t,type:n}=e;if(On(t)){let e;try{e=await en(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new We(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Dn(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:xn(t),statusCode:Ge(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Ge(t)?t.status:void 0}:Dn(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function nn(e,t,n,r,i){let a=e.headers.get(`Location`);if(T(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Oe(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=At(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var rn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function an(e){try{return rn.includes(new URL(e).protocol)}catch{return!1}}function on(e,t,n,r){if(Oe(e)){let r=e,i=b.test(r)?new URL(x(r,t.protocol)):new URL(r);if(an(i.toString()))throw Error(`Invalid redirect location`);let a=Ee(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Fe(i.pathname)+i.search+i.hash}try{if(an(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function sn(e,t,n,r){let i=e.createURL(yn(t)).toString(),a={signal:n};if(r&&Mn(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?ln(r.formData):r.formData}return new Request(i,a)}function cn(e,t){let n=new URL(e.url),r=typeof t==`string`?j(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function ln(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function un(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function dn(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Tn(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(T(!En(f),`Cannot handle redirect results in processLoaderData`),Tn(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=hn(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=St),c||(c=!0,s=Ge(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function fn(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=dn(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(T(s,`Did not find corresponding fetcher result`),Tn(s)){let t=hn(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(En(s))T(!1,`Unhandled fetcher revalidation redirect`);else{let e=Bn(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function pn(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==St).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function mn(e){return e?Tn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function hn(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function gn(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function _n(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new We(e||500,o,Error(s),!0)}function vn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(En(r))return{key:n,result:r}}}function yn(e){return A({...typeof e==`string`?j(e):e,hash:``})}function bn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function xn(e){return new We(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Sn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Cn(t))}function Cn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function wn(e){return On(e.result)&&ht.has(e.result.status)}function Tn(e){return e.type===`error`}function En(e){return(e&&e.type)===`redirect`}function Dn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function On(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function kn(e){return ht.has(e)}function An(e){return On(e)&&kn(e.status)&&e.headers.has(`Location`)}function jn(e){return mt.has(e.toUpperCase())}function Mn(e){return ft.has(e.toUpperCase())}function Nn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Pn(e,t){let n=typeof t==`string`?j(t).search:t.search;if(e[e.length-1].route.index&&Nn(n||``))return e[e.length-1];let r=Me(e);return r[r.length-1]}function Fn(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function In(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Ln(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Rn(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function zn(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Bn(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Vn(e,t){try{let n=e.sessionStorage.getItem(xt);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function Hn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(xt,JSON.stringify(n))}catch(e){E(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Un(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Wn=p.createContext(null);Wn.displayName=`DataRouter`;var Gn=p.createContext(null);Gn.displayName=`DataRouterState`;var Kn=p.createContext(!1);function qn(){return p.useContext(Kn)}var Jn=p.createContext({isTransitioning:!1});Jn.displayName=`ViewTransition`;var Yn=p.createContext(new Map);Yn.displayName=`Fetchers`;var Xn=p.createContext(null);Xn.displayName=`Await`;var Zn=p.createContext(null);Zn.displayName=`Navigation`;var Qn=p.createContext(null);Qn.displayName=`Location`;var $n=p.createContext({outlet:null,matches:[],isDataRoute:!1});$n.displayName=`Route`;var er=p.createContext(null);er.displayName=`RouteError`;var tr=`REACT_ROUTER_ERROR`,nr=`REDIRECT`,rr=`ROUTE_ERROR_RESPONSE`;function ir(e){if(e.startsWith(`${tr}:${nr}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function ar(e){if(e.startsWith(`${tr}:${rr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new We(t.status,t.statusText,t.data)}catch{}}function or(e,{relative:t}={}){T(sr(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=p.useContext(Zn),{hash:i,pathname:a,search:o}=_r(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Ie([n,a])),r.createHref({pathname:s,search:o,hash:i})}function sr(){return p.useContext(Qn)!=null}function cr(){return T(sr(),`useLocation() may be used only in the context of a <Router> component.`),p.useContext(Qn).location}var lr=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function ur(e){p.useContext(Zn).static||p.useLayoutEffect(e)}function dr(){let{isDataRoute:e}=p.useContext($n);return e?Pr():fr()}function fr(){T(sr(),`useNavigate() may be used only in the context of a <Router> component.`);let e=p.useContext(Wn),{basename:t,navigator:n}=p.useContext(Zn),{matches:r}=p.useContext($n),{pathname:i}=cr(),a=JSON.stringify(Ne(r)),o=p.useRef(!1);return ur(()=>{o.current=!0}),p.useCallback((r,s={})=>{if(E(o.current,lr),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Pe(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Ie([t,c.pathname])),ut(typeof r==`string`?r:A(r),n.createHref(c),st(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var pr=p.createContext(null);function mr(){return p.useContext(pr)}function hr(e){let t=p.useContext($n).outlet;return p.useMemo(()=>t&&p.createElement(pr.Provider,{value:e},t),[t,e])}function gr(){let{matches:e}=p.useContext($n);return e[e.length-1]?.params??{}}function _r(e,{relative:t}={}){let{matches:n}=p.useContext($n),{pathname:r}=cr(),i=JSON.stringify(Ne(n));return p.useMemo(()=>Pe(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function vr(e,t,n){T(sr(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=p.useContext(Zn),{matches:i}=p.useContext($n),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Ir(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
4
4
|
|
|
5
5
|
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=cr(),d;if(t){let e=typeof t==`string`?j(t):t;T(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,m=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);m=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ae(e,{pathname:m});E(l||h!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),E(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=Tr(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Ie([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Ie([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?p.createElement(Qn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},g):g}function yr(){let e=Nr(),t=Ge(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=p.createElement(p.Fragment,null,p.createElement(`p`,null,`💿 Hey developer 👋`),p.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,p.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,p.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),p.createElement(p.Fragment,null,p.createElement(`h2`,null,`Unexpected Application Error!`),p.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?p.createElement(`pre`,{style:i},n):null,o)}var br=p.createElement(yr,null),xr=class extends p.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=ar(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:p.createElement($n.Provider,{value:this.props.routeContext},p.createElement(er.Provider,{value:e,children:this.props.component}));return this.context?p.createElement(Cr,{error:e},t):t}};xr.contextType=Kn;var Sr=new WeakMap;function Cr({children:e,error:t}){let{basename:n,navigator:r}=p.useContext(Zn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=ir(t.digest);if(e){let i=Sr.get(t);if(i)throw i;let a=Je(e.location,n),o=a.absoluteURL||a.to;if(ut(e.location,o,st(r),`allow-explicit`),an(o))throw Error(`Invalid redirect location`);if(qe&&!Sr.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Sr.set(t,n),n}}return p.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function wr({routeContext:e,match:t,children:n}){let r=p.useContext(Wn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),p.createElement($n.Provider,{value:e},n)}function Tr(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);T(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ke(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,m=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||br,o&&(s<0&&c===0?(Ir(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,m=null):s===c&&(d=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=u?f:d?m:n.route.Component?p.createElement(n.route.Component,null):n.route.element?n.route.element:e,p.createElement(wr,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?p.createElement(xr,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()},null)}function Er(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Dr(e){let t=p.useContext(Wn);return T(t,Er(e)),t}function Or(e){let t=p.useContext(Gn);return T(t,Er(e)),t}function kr(e){let t=p.useContext($n);return T(t,Er(e)),t}function Ar(e){let t=kr(e),n=t.matches[t.matches.length-1];return T(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function jr(){return Ar(`useRouteId`)}function Mr(){let{matches:e,loaderData:t}=Or(`useMatches`);return p.useMemo(()=>e.map(e=>se(e,t)),[e,t])}function Nr(){let e=p.useContext(er),t=Or(`useRouteError`),n=Ar(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Pr(){let{router:e}=Dr(`useNavigate`),t=Ar(`useNavigate`),n=p.useRef(!1);return ur(()=>{n.current=!0}),p.useCallback(async(r,i={})=>{E(n.current,lr),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Fr={};function Ir(e,t,n){!t&&!Fr[e]&&(Fr[e]=!0,E(!1,n))}var Lr={};function Rr(e,t){!e&&!Lr[t]&&(Lr[t]=!0,console.warn(t))}var zr=p.useOptimistic,Br=()=>void 0;function Vr(e){return zr?zr(e):[e,Br]}function Hr(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&E(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:p.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&E(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&E(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Ur=[`HydrateFallback`,`hydrateFallbackElement`],Wr=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Gr({router:e,flushSync:t,onError:n,useTransitions:r}){r=qn()||r;let[i,a]=p.useState(e.state),[o,s]=Vr(i),[c,l]=p.useState(),[u,d]=p.useState({isTransitioning:!1}),[f,m]=p.useState(),[h,g]=p.useState(),[_,v]=p.useState(),y=p.useRef(new Map),b=p.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:_})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:Ke(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),o.forEach(e=>y.current.delete(e)),Rr(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(Rr(_==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!b)t&&u?t(()=>a(i)):r===!1?a(i):p.startTransition(()=>{r===!0&&s(e=>Kr(e,i)),a(i)});else if(t&&u){t(()=>{h&&(f?.resolve(),h.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>g(n))}else h?(f?.resolve(),h.skipTransition(),v({state:i,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,f,r,s,n]);p.useLayoutEffect(()=>e.subscribe(b),[e,b]),p.useEffect(()=>{u.isTransitioning&&!u.flushSync&&m(new Wr)},[u]),p.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):p.startTransition(()=>{r===!0&&s(e=>Kr(e,t)),a(t)}),await n});i.finished.finally(()=>{m(void 0),g(void 0),l(void 0),d({isTransitioning:!1})}),g(i)}},[c,f,e.window,r,s]),p.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,h,o.location,c]),p.useEffect(()=>{!u.isTransitioning&&_&&(l(_.state),d({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[u.isTransitioning,_]);let x=p.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=p.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return p.createElement(p.Fragment,null,p.createElement(Wn.Provider,{value:C},p.createElement(Gn.Provider,{value:o},p.createElement(Yn.Provider,{value:y.current},p.createElement(Jn.Provider,{value:u},p.createElement(Xr,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,useTransitions:r},p.createElement(qr,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function Kr(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var qr=p.memo(Jr);function Jr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return vr(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Yr(e){return hr(e.context)}function Xr({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){T(!sr(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=p.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=j(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:m=`default`,mask:h}=n,g=p.useMemo(()=>{let e=Ee(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:m,mask:h},navigationType:r}},[s,l,u,d,f,m,r,h]);return E(g!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:p.createElement(Zn.Provider,{value:c},p.createElement(Qn.Provider,{children:t,value:g}))}p.Component;var Zr=`get`,Qr=`application/x-www-form-urlencoded`;function $r(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function ei(e){return $r(e)&&e.tagName.toLowerCase()===`button`}function ti(e){return $r(e)&&e.tagName.toLowerCase()===`form`}function ni(e){return $r(e)&&e.tagName.toLowerCase()===`input`}function ri(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ii(e,t){return e.button===0&&(!t||t===`_self`)&&!ri(e)}function ai(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function oi(e,t){let n=ai(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var si=null;function ci(){if(si===null)try{new FormData(document.createElement(`form`),0),si=!1}catch{si=!0}return si}var li=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ui(e){return e!=null&&!li.has(e)?(E(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Qr}"`),null):e}function di(e,t){let n,r,i,a,o;if(ti(e)){let o=e.getAttribute(`action`);r=o?Ee(o,t):null,n=e.getAttribute(`method`)||Zr,i=ui(e.getAttribute(`enctype`))||Qr,a=new FormData(e)}else if(ei(e)||ni(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Ee(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Zr,i=ui(e.getAttribute(`formenctype`))||ui(o.getAttribute(`enctype`))||Qr,a=new FormData(o,e),!ci()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if($r(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Zr,r=null,i=Qr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function fi(e,t){if(e===!1||e==null)throw Error(t)}function pi(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&Ee(i.pathname,t)===`/`?`${Le(t)}/_root.${r}`:`${Le(i.pathname)}.${r}`,i}async function mi(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function hi(e){return e!=null&&typeof e.page==`string`}function gi(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function _i(e,t,n){return Si((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await mi(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(gi).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function vi(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function yi(e,t,{includeHydrateFallback:n}={}){return bi(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function bi(e){return[...new Set(e)]}function xi(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Si(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!hi(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(xi(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Ci(){let e=p.useContext(Wn);return fi(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function wi(){let e=p.useContext(Gn);return fi(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Ti=p.createContext(void 0);Ti.displayName=`FrameworkContext`;function Ei(){let e=p.useContext(Ti);return fi(e,`You must render this element inside a <HydratedRouter> element`),e}function Di(e,t){let n=p.useContext(Ti),[r,i]=p.useState(!1),[a,o]=p.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=p.useRef(null);p.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),p.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Oi(s,m),onBlur:Oi(c,h),onMouseEnter:Oi(l,m),onMouseLeave:Oi(u,h),onTouchStart:Oi(d,m)}]:[a,f,{}]:[!1,f,{}]}function Oi(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function ki({page:e,...t}){let n=qn(),{nonce:r}=Ei(),{router:i}=Ci(),a=p.useMemo(()=>ae(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?p.createElement(ji,{page:e,matches:a,...t}):p.createElement(Mi,{page:e,matches:a,...t})):null}function Ai(e){let{manifest:t,routeModules:n}=Ei(),[r,i]=p.useState([]);return p.useEffect(()=>{let r=!1;return _i(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function ji({page:e,matches:t,...n}){let r=cr(),{future:i}=Ei(),{basename:a}=Ci(),o=p.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=pi(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return p.createElement(p.Fragment,null,o.map(e=>p.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Mi({page:e,matches:t,...n}){let r=cr(),{future:i,manifest:a,routeModules:o}=Ei(),{basename:s}=Ci(),{loaderData:c,matches:l}=wi(),u=p.useMemo(()=>vi(e,t,l,a,r,`data`),[e,t,l,a,r]),d=p.useMemo(()=>vi(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=p.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=pi(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),m=p.useMemo(()=>yi(d,a),[d,a]),h=Ai(d);return p.createElement(p.Fragment,null,f.map(e=>p.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>p.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>p.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ni(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}p.Component;var R=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{R&&(window.__reactRouterVersion=`7.18.4`)}catch{}function Pi(e,t){return Ot({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:w({window:t?.window}),hydrationData:t?.hydrationData||Fi(),routes:e,mapRouteProperties:Hr,hydrationRouteProperties:Ur,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function Fi(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Ii(e.errors)}),e}function Ii(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new We(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&Ue.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var Li=p.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...m},h){let{basename:g,navigator:_,useTransitions:v}=p.useContext(Zn),b=typeof l==`string`&&y.test(l),x=Je(l,g);l=x.to;let S=or(l,{relative:r}),C=cr(),w=null;if(o){let e=Pe(o,[],C.mask?C.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:Ie([g,e.pathname])),w=_.createHref(e)}let[T,E,D]=Di(n,m),O=Hi(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:v});function k(t){e&&e(t),t.defaultPrevented||O(t)}let A=!(x.isExternal||i),j=p.createElement(`a`,{...m,...D,href:(A?w:void 0)||x.absoluteURL||S,onClick:A?k:e,ref:Ni(h,E),target:c,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?p.createElement(p.Fragment,null,j,p.createElement(ki,{page:S})):j});Li.displayName=`Link`;var Ri=p.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=_r(a,{relative:c.relative}),d=cr(),f=p.useContext(Gn),{navigator:m,basename:h}=p.useContext(Zn),g=f!=null&&Ji(u)&&o===!0,_=m.encodeLocation?m.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=Ee(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return p.createElement(Li,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Ri.displayName=`NavLink`;var zi=p.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Zr,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...m},h)=>{let{useTransitions:g}=p.useContext(Zn),_=Ki(),v=qi(s,{relative:l}),b=o.toLowerCase()===`get`?`get`:`post`,x=typeof s==`string`&&y.test(s);return p.createElement(`form`,{ref:h,method:b,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});g&&n!==!1?p.startTransition(()=>m()):m()},...m,"data-discover":!x&&e===`render`?`true`:void 0})});zi.displayName=`Form`;function Bi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vi(e){let t=p.useContext(Wn);return T(t,Bi(e)),t}function Hi(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=dr(),d=cr(),f=_r(e,{relative:o});return p.useCallback(m=>{if(ii(m,t)){m.preventDefault();let t=n===void 0?A(d)===A(f):n,h=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?p.startTransition(()=>h()):h()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Ui(e){E(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=p.useRef(ai(e)),n=p.useRef(!1),r=cr(),i=p.useMemo(()=>oi(r.search,n.current?null:t.current),[r.search]),a=dr();return[i,p.useCallback((e,t)=>{let r=ai(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Wi=0,Gi=()=>`__${String(++Wi)}__`;function Ki(){let{router:e}=Vi(`useSubmit`),{basename:t}=p.useContext(Zn),n=jr(),r=e.fetch,i=e.navigate;return p.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=di(e,t);if(a.navigate===!1){let e=a.fetcherKey||Gi();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function qi(e,{relative:t}={}){let{basename:n}=p.useContext(Zn),r=p.useContext($n);T(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={..._r(e||`.`,{relative:t})},o=cr();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Ie([n,a.pathname])),A(a)}function Ji(e,{relative:t}={}){let n=p.useContext(Jn);T(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Vi(`useViewTransitionState`),i=_r(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ee(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ee(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Se(i.pathname,o)!=null||Se(i.pathname,a)!=null}var Yi=class extends Error{status;constructor(e,t){super(t),this.status=e,this.name=`HttpError`}},Xi=class{options;constructor(e){this.options=e}get(e){return this.request(`GET`,e)}post(e,t,n=[200]){return this.request(`POST`,e,t,n)}patch(e,t){return this.request(`PATCH`,e,t)}delete(e){return this.request(`DELETE`,e)}async request(e,t,n,r=[200]){let i=await this.options.requestLib(`${this.options.endpoint??``}/api/${t}`,{method:e,headers:{"Content-Type":`application/json`},body:n===void 0?void 0:JSON.stringify(n)}),a;try{a=i.body?JSON.parse(i.body):void 0}catch{a=void 0}if(!r.includes(i.status)){let e=a&&typeof a==`object`&&`error`in a?String(a.error):i.body||`请求失败 (${i.status})`;throw new Yi(i.status,e)}return a}},Zi=class e{options;static fetchToRequestLib=e=>async(t,n)=>{let r=await e(t,{method:n.method,headers:n.headers,body:n.body});return{status:r.status,body:await r.text()}};client;project;files;conformance;changelog;baselines;tasks;changes;code;constructor(e){this.options=e,this.client=new Xi(e),this.project={get:()=>this.client.get(`project`)},this.files={list:e=>this.client.get(`files?${Qi({directory:e})}`),read:(e,t=0)=>this.client.get(`files/content?${Qi({path:e,offset:String(t)})}`)},this.conformance={list:()=>this.client.get(`conformance`),readme:e=>this.client.get(`conformance/readme?${Qi({rule:e})}`)},this.changelog={list:()=>this.client.get(`changelog`),files:e=>this.client.get(`changelog/${encodeURIComponent(e)}/files`),diff:(e,t)=>this.client.get(`changelog/${encodeURIComponent(e)}/diff?${Qi({path:t})}`),update:(e,t)=>this.client.patch(`changelog/${encodeURIComponent(e)}`,t)},this.baselines={list:()=>this.client.get(`baselines`),delete:(e,t,n)=>this.client.delete(`namespaces/${encodeURIComponent(e)}/baselines?${Qi({file:t,version:n})}`)},this.tasks={list:()=>this.client.get(`tasks`),detail:e=>this.client.get(`tasks/${encodeURIComponent(e)}`),removable:()=>this.client.get(`tasks/removable`),prune:()=>this.client.delete(`tasks/removable`),approve:(e,t,n)=>this.client.post(`tasks/${encodeURIComponent(e)}/approvals`,{caseIds:t,baselineVersion:n},[200,409])},this.changes={list:e=>this.client.get(`baseline-changes?${Qi({ref:e})}`),review:(e,t,n,r)=>this.client.patch(`baseline-changes/reviews`,{ref:e,version:t,items:n,reviewed:r})},this.code={list:e=>this.client.get(`code-changes?${Qi({ref:e})}`),diff:(e,t,n)=>this.client.get(`code-changes/diff?${Qi({ref:e,path:t,...n?{version:n}:{}})}`),review:(e,t,n,r)=>this.client.patch(`code-changes/reviews`,{ref:e,version:t,items:n,reviewed:r})}}clone(){return new e(this.options)}};function Qi(e){return new URLSearchParams(e).toString()}var $i=new EventTarget,ea=new AbortController;function ta(){ea.signal.aborted&&(ea=new AbortController)}var na=new Zi({requestLib:Zi.fetchToRequestLib(async(e,t)=>{let n=ea,r=t?.signal?AbortSignal.any([t.signal,n.signal]):n.signal,i=await fetch(e,{...t,signal:r});if(i.status===401){let e=await i.clone().json().catch(()=>null);if(r.throwIfAborted(),e?.code===`REPORT_PASSWORD_REQUIRED`)throw n.abort(),$i.dispatchEvent(new Event(`unauthorized`)),n.signal.reason}else i.ok&&(r.throwIfAborted(),$i.dispatchEvent(new Event(`authorized`)));return i})}),ra={password:{form:`password.form`,input:`password.input`,submit:`password.submit`,error:`password.error`},ignoredBaseline:`baseline.ignored`,deleteBaseline:`baseline.delete`,module:{root:`module`,loading:`module.loading`,baseline:`view.baseline`,tasks:`view.tasks`,changes:`module.changes`,code:`module.code`,changelog:`module.changelog`,conformance:`module.conformance`,files:`module.files`,tooltip:e=>`module.tooltip.${e}`},conformance:{list:`conformance.list`,enabled:`conformance.enabled`,disabled:`conformance.disabled`,rule:e=>`conformance.rule.${e}`,readme:`conformance.readme`,state:`conformance.state`},changelog:{commits:`changelog.commits`,commit:e=>`changelog.commit.${e}`,review:e=>`changelog.review.${e}`,reviewCount:`changelog.reviewCount`,reviewFilter:`changelog.reviewFilter`,files:`changelog.files`,file:e=>`changelog.file.${e}`,detail:`changelog.detail`,empty:`changelog.empty`,editor:`changelog.editor`,scopes:`changelog.scopes`,entry:e=>`changelog.entry.${e}`,saveState:e=>`changelog.save.${e}`,retry:e=>`changelog.retry.${e}`,tag:e=>`changelog.tag.${e}`},files:{tree:`files.tree`,folderLoading:e=>`files.folderLoading.${e}`,file:e=>`files.file.${e}`,content:`files.content`,editor:`files.editor`,previous:`files.previous`,next:`files.next`},code:{tree:`code.tree`,scroll:`code.scroll`,file:e=>`code.file.${e}`,content:`code.content`,empty:`code.empty`,refresh:`code.refresh`,review:e=>`code.review.${e}`,reviewCount:`code.reviewCount`},changes:{tree:`changes.tree`,review:e=>`changes.review.${e}`,reviewCount:`changes.reviewCount`},visual:{stage:{root:`visual.stage`,image:e=>`visual.stage.image.${e}`,zoom:e=>`visual.stage.zoom.${e}`,approve:`approve`}},dialog:{root:`dialog`,close:`dialog.close`},branches:`changes.branches`,resize:`sidebar.resize`,approveBatch:`approve.batch`,selectionBar:`selection.bar`,pageHeader:`page.header`,headerMetadata:`page.header.metadata`,statusBadge:`status.badge`,taskStatus:e=>`status.task.${e}`,folder:e=>`tree.folder.${e}`,clearSelection:`selection.clear`,previous:`stage.previous`,next:`stage.next`,snapshotTab:e=>`snapshot.tab.${e}`,sourceTab:e=>`source.tab.${e}`,collapse:`source.collapse`,copy:`source.copy`,source:`source.code`,sourceLineNumbers:`source.lineNumbers`,diffUnified:`diff.unified`,diffExpand:`diff.expand`,diffEditor:`diff.editor`,diffOriginal:`diff.original`,diffModified:`diff.modified`,namespace:e=>`namespace.${e}`,view:{baseline:`view.baseline`,tasks:`view.tasks`},tasks:{root:`tasks`,empty:`tasks.empty`,item:e=>`tasks.${e}`,removable:`tasks.removable`,prune:`tasks.prune`},tree:`cases`,case:e=>`case.${e}`,selectFolder:e=>`select.folder.${e}`,select:e=>`select.${e}`,detail:`detail`,snapshotContent:`detail.snapshots`,supplement:`detail.supplement`,taskInfo:`detail.taskInfo`,caseEyebrow:`detail.caseEyebrow`,taskExecutionId:`detail.taskExecutionId`,copyTaskExecutionId:`detail.copyTaskExecutionId`,caseId:`detail.caseId`,copyCaseIds:`detail.copyCaseIds`,taskError:`detail.taskError`,empty:`empty`,approve:`approve`,refresh:`refresh`,message:`message`,previewTab:e=>`preview.tab.${e}`,preview:{tabs:`preview.tabs`,title:`preview.title`,card:`preview.card`,previous:`preview.previous`,next:`preview.next`,left:`preview.left`,right:`preview.right`,position:`preview.position`,version:`preview.version`,hints:`preview.hints`,case:`preview.case`,status:`preview.status`,select:`preview.select`,evidence:`preview.evidence`,evidenceTab:e=>`preview.evidence.${e}`},snapshotPreview:e=>`snapshot.preview.${e}`,imageVersion:(e,t)=>`image.version.${e}.${t}`,snapshotViewLabel:e=>`snapshot.viewLabel.${e}`,snapshotCompare:e=>`snapshot.compare.${e}`,snapshotStatus:e=>`snapshot.status.${e}`,snapshotMetrics:e=>`snapshot.metrics.${e}`,snapshotDiff:e=>`snapshot.diff.${e}`,snapshot:e=>`snapshot.${e}`,image:(e,t)=>`image.${e}.${t}`,text:e=>`text.${e}`,observation:e=>`observation.${e}`,filter:e=>`filter.${e}`,filterGroup:`filter.group`,filterThumb:`filter.thumb`,mobile:{tabbar:`mobile.tabbar`,tab:e=>`mobile.tab.${e}`,more:`mobile.more`,moreSheet:`mobile.moreSheet`,editTabs:`mobile.editTabs`,tabOrder:e=>`mobile.tabOrder.${e}`,tabHandle:e=>`mobile.tabHandle.${e}`,saveTabs:`mobile.saveTabs`,resetTabs:`mobile.resetTabs`,rule:e=>`mobile.rule.${e}`,conformanceEnabled:`mobile.conformance.enabled`,conformanceDisabled:`mobile.conformance.disabled`,ruleReadme:`mobile.conformance.readme`,ruleState:`mobile.conformance.state`,page:e=>`mobile.page.${e}`,back:`mobile.back`,prev:`mobile.prev`,next:`mobile.next`,switchHand:`mobile.switchHand`,empty:`mobile.empty`,toast:`mobile.toast`,diff:e=>`mobile.diff.${e}`,ref:`mobile.ref`,refDialog:`mobile.refDialog`,refOption:e=>`mobile.refOption.${e}`,review:`mobile.review`,file:e=>`mobile.file.${e}`,check:e=>`mobile.check.${e}`,commit:e=>`mobile.commit.${e}`,actionSheet:`mobile.actionSheet`,moreActions:`mobile.moreActions`,caseInfo:`mobile.caseInfo`,copyCaseId:`mobile.copyCaseId`,copyPath:`mobile.copyPath`,pathDisclosure:`mobile.pathDisclosure`,metrics:e=>`mobile.metrics.${e}`,copy:e=>`mobile.copy.${e}`,diagnostics:`mobile.diagnostics`,expandAll:`mobile.expandAll`,tag:e=>`mobile.tag.${e}`,note:e=>`mobile.note.${e}`,noteState:e=>`mobile.noteState.${e}`,task:e=>`mobile.task.${e}`,case:e=>`mobile.case.${e}`,baselineCase:e=>`mobile.baselineCase.${e}`,folder:e=>`mobile.folder.${e}`,evidence:e=>`mobile.evidence.${e}`,filter:e=>`mobile.filter.${e}`,confirm:`mobile.confirm`,confirmOk:`mobile.confirm.ok`,confirmCancel:`mobile.confirm.cancel`,image:e=>`mobile.image.${e}`,fileDiff:`mobile.fileDiff`,approve:`mobile.approve`,approveAll:`mobile.approveAll`,prune:`mobile.prune`,deleteBaseline:`mobile.deleteBaseline`}},ia=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),aa=s(((e,t)=>{t.exports=ia()})),z=aa();function oa(e,t,n){if(!e||!e.startsWith(`/`)||e.startsWith(`//`))return t;try{let r=new URL(e,window.location.origin);if(r.origin!==window.location.origin||r.pathname.startsWith(`//`))return t;let i=ae(n,r.pathname)?.at(-1);return!i||i.route.path===`*`?t:r.pathname+r.search+r.hash}catch{return t}}function sa(e,t){let n=!1,r=()=>{n=!0},i=()=>{if(window.location.pathname===t)return;let r=window.location.pathname+window.location.search+window.location.hash;e.navigate(`${t}?from=${encodeURIComponent(r)}`,{replace:!0,state:{expired:n}}),n=!1};return $i.addEventListener(`authorized`,r),$i.addEventListener(`unauthorized`,i),()=>{$i.removeEventListener(`authorized`,r),$i.removeEventListener(`unauthorized`,i),ta()}}function ca({variant:e,routes:t}){let n=cr(),r=dr(),i=n.state,[a,o]=(0,p.useState)(``),[s,c]=(0,p.useState)(!1),[l,u]=(0,p.useState)(()=>i?.expired?{message:`会话已失效,请重新输入密码。`}:void 0),d=(0,p.useRef)(null),[f]=(0,p.useState)(()=>new AbortController);(0,p.useEffect)(()=>()=>{f.abort(),ta()},[f]);let m=e===`mobile`?`/mobile/tasks`:`/tasks`,h=oa(new URLSearchParams(n.search).get(`from`),m,t);async function g(e){if(e.preventDefault(),!s&&a){c(!0),u(void 0);try{let e=await fetch(`/api/session`,{method:`POST`,signal:f.signal,headers:{"Content-Type":`application/json`},body:JSON.stringify({password:a})});if(e.status===401){let t=await e.json().catch(()=>null);t?.code===`REPORT_PASSWORD_INVALID`&&t.error?(u({message:t.error,invalidPassword:!0}),d.current?.focus(),d.current?.select()):u({message:`无法连接服务,请稍后重试。`})}else if(e.ok){ta(),await r(h,{replace:!0});return}else throw Error()}catch{if(f.signal.aborted)return;u({message:`无法连接服务,请稍后重试。`})}c(!1)}}return(0,z.jsx)(`main`,{className:`report-access`,"data-variant":e,children:(0,z.jsxs)(`form`,{className:`report-access-panel`,onSubmit:g,"aria-labelledby":`report-access-title`,"aria-describedby":`report-access-description`,"aria-busy":s||void 0,"data-testid":ra.password.form,children:[(0,z.jsxs)(`div`,{className:`report-access-header`,children:[(0,z.jsx)(`h1`,{id:`report-access-title`,className:`report-access-title`,children:`输入访问密码`}),(0,z.jsx)(`p`,{id:`report-access-description`,className:`report-access-description`,children:`此报告受密码保护,请输入密码以继续。`})]}),(0,z.jsxs)(`div`,{className:`report-access-field`,children:[(0,z.jsx)(`label`,{htmlFor:`report-password`,className:`report-access-label`,children:`密码`}),(0,z.jsx)(`input`,{id:`report-password`,ref:d,className:`report-access-input`,type:`password`,autoComplete:`current-password`,autoFocus:!0,required:!0,value:a,onChange:e=>{o(e.target.value),u(void 0)},"aria-describedby":l?`report-access-error`:void 0,"aria-invalid":l?.invalidPassword,"data-testid":ra.password.input}),l&&(0,z.jsx)(`p`,{id:`report-access-error`,className:`report-access-error`,role:`alert`,"data-testid":ra.password.error,children:l.message})]}),(0,z.jsx)(`button`,{type:`submit`,className:`report-access-button is-primary`,disabled:!a||s,"data-pending":s||void 0,"data-testid":ra.password.submit,children:s?`验证中…`:`继续`})]})})}var la=s((e=>{var t=f();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),ua=s(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=la()})),da=u(ua(),1);function fa(e){return p.createElement(Gr,{flushSync:da.flushSync,...e})}function pa(e){let t=(0,p.useCallback)(t=>{let n=e.onDidChange(t);return()=>n.dispose()},[e]);return(0,p.useSyncExternalStore)(t,e.getSnapshot),e}var ma=(0,p.createContext)(null);function ha({createServices:e,children:t}){let[n]=(0,p.useState)(e);return(0,p.useEffect)(()=>()=>n.dispose(),[n]),(0,z.jsx)(ma.Provider,{value:n.instantiationService,children:t})}function ga(e){let t=(0,p.useContext)(ma);if(!t)throw Error(`组件必须位于 ServicesProvider 内`);return t.invokeFunction(t=>t.get(e))}var _a=class{ctor;staticArguments;supportsDelayedInstantiation;constructor(e,t=[],n=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=n}},va;(function(e){e.serviceIds=new Map,e.DI_TARGET=`$di$target`,e.DI_DEPENDENCIES=`$di$dependencies`;function t(t){return t[e.DI_DEPENDENCIES]||[]}e.getServiceDependencies=t})(va||={});var ya=xa(`instantiationService`);function ba(e,t,n){t[va.DI_TARGET]===t?t[va.DI_DEPENDENCIES].push({id:e,index:n}):(t[va.DI_DEPENDENCIES]=[{id:e,index:n}],t[va.DI_TARGET]=t)}function xa(e){if(va.serviceIds.has(e))return va.serviceIds.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);ba(t,e,r)};return t.toString=()=>e,va.serviceIds.set(e,t),t}var Sa=new class{unexpectedErrorHandler;listeners;constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ka.isErrorNoTelemetry(e)?new ka(e.message+`
|
|
@@ -13,7 +13,7 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
|
|
|
13
13
|
`).slice(3,4).join(`
|
|
14
14
|
`)):e._None}static traceCreation(t,n){return t?new e(1,n.name):e._None}static _totals=0;_start=Date.now();_dep=[];constructor(e,t){this.type=e,this.name=t}branch(t,n){let r=new e(3,t.toString());return this._dep.push([t,n,r]),r}stop(){let t=Date.now()-this._start;e._totals+=t;let n=!1;function r(e,t){let i=[],a=Array(e+1).join(` `);for(let[o,s,c]of t._dep)if(s&&c){n=!0,i.push(`${a}CREATES -> ${o}`);let t=r(e+1,c);t&&i.push(t)}else i.push(`${a}uses -> ${o}`);return i.join(`
|
|
15
15
|
`)}let i=[`${this.type===1?`CREATE`:`CALL`} ${this.name}`,`${r(1,this)}`,`DONE, took ${t.toFixed(2)}ms (grand total ${e._totals.toFixed(2)}ms)`];(t>2||n)&&e.all.add(i.join(`
|
|
16
|
-
`))}},Go=class{changed;state={data:null,loading:!1,error:null};currentKey=null;get key(){return this.currentKey}generation=0;pending=null;constructor(e){this.changed=e}clear(){this.currentKey=null,this.generation++,this.pending=null,this.state={data:null,loading:!1,error:null},this.changed()}load(e,t,n=!1){if(e!==this.key&&(this.currentKey=e,this.generation++,this.pending=null,this.state={data:null,loading:!1,error:null}),this.pending&&!n)return this.pending;let r=++this.generation;return this.state={...this.state,loading:!0,error:null},this.pending=Promise.resolve().then(t).then(e=>{r===this.generation&&(this.state={data:e,loading:!1,error:null})},e=>{if(r!==this.generation)return;let t=e instanceof Error?e:Error(String(e));this.state={data:t instanceof Yi&&t.status===404?null:this.state.data,loading:!1,error:t}}).then(()=>{r===this.generation&&(this.pending=null,this.changed())}),this.changed(),this.pending}dispose(){this.currentKey=null,this.generation++,this.pending=null,this.state={data:null,loading:!1,error:null}}},Ko=xa(`baselineService`),qo=class extends Va{changed=this._register(new Oo);onDidChange=this.changed.event;revision=0;getSnapshot=()=>this.revision;disposed=!1;get loading(){return this.list.state.loading}publish(){this.disposed||(this.revision++,this.changed.fire())}list=this._register(new Go(()=>this.publish()));get baseline(){return this.list.state}async refresh(){await this.list.load(`baseline`,()=>na.baselines.list())}async deleteBaseline(e,t,n){await na.baselines.delete(e,t,n),await this.list.load(`baseline`,()=>na.baselines.list(),!0)}dispose(){this.disposed=!0,super.dispose()}},Jo=xa(`tasksService`),Yo=class extends Va{changed=this._register(new Oo);onDidChange=this.changed.event;revision=0;getSnapshot=()=>this.revision;disposed=!1;get loading(){return this.list.state.loading||this.detail.state.loading}publish(){this.disposed||(this.revision++,this.changed.fire())}list=this._register(new Go(()=>this.publish()));detail=this._register(new Go(()=>this.publish()));removableCount=this._register(new Go(()=>this.publish()));get removable(){return this.removableCount.state.data?.count??0}async prune(){let{count:e}=await na.tasks.prune();return await this.removableCount.load(`removable`,()=>na.tasks.removable(),!0),e}get tasks(){return this.list.state}get task(){return this.detail.state}async refreshTask(e,t=!1){e?(await this.detail.load(e,()=>na.tasks.detail(e),t),await this.refreshUncachedSummary()):this.detail.clear()}async refreshUncachedSummary(){let e=this.task.data;!this.disposed&&e&&this.tasks.data?.some(t=>t.id===e.task.id&&t.cached===!1)&&await this.list.load(`tasks`,()=>na.tasks.list(),!0)}async refresh(e){await Promise.all([this.list.load(`tasks`,()=>na.tasks.list()),this.removableCount.load(`removable`,()=>na.tasks.removable()),this.refreshTask(e)]),await this.refreshUncachedSummary()}async approve(e,t,n){let r=await na.tasks.approve(e,t,n);return await Promise.all([this.list.load(`tasks`,()=>na.tasks.list(),!0),this.detail.key===e?this.refreshTask(e,!0):Promise.resolve()]),await this.refreshUncachedSummary(),r}dispose(){this.disposed=!0,super.dispose()}},Xo=xa(`baselineChangeService`),Zo=class extends Va{changed=this._register(new Oo);onDidChange=this.changed.event;revision=0;getSnapshot=()=>this.revision;disposed=!1;refreshRequest=0;get loading(){return this.projectResource.state.loading||this.changes.state.loading}publish(){this.disposed||(this.revision++,this.changed.fire())}projectResource=this._register(new Go(()=>this.publish()));changes=this._register(new Go(()=>this.publish()));get project(){return this.projectResource.state}get baselineChanges(){return this.changes.state}async refresh(e){let t=++this.refreshRequest,n=e||this.project.data?.defaultRef;if(n&&this.changes.key!==n&&this.changes.clear(),await this.projectResource.load(`project`,()=>na.project.get()),this.disposed||t!==this.refreshRequest)return;let r=e||this.project.data?.defaultRef||`HEAD`;await this.changes.load(r,()=>na.changes.list(r))}async reviewBaseline(e,t,n,r){let i=this.refreshRequest;await na.changes.review(e,t,n,r),!(this.disposed||i!==this.refreshRequest)&&await this.changes.load(e,()=>na.changes.list(e),!0)}dispose(){this.disposed=!0,super.dispose()}};function Qo(e,t,n){return JSON.stringify([e,t,n])}var $o=xa(`codeDiffService`),es=class extends Va{changed=this._register(new Oo);onDidChange=this.changed.event;revision=0;getSnapshot=()=>this.revision;disposed=!1;refreshRequest=0;diffRequest=0;get loading(){return this.projectResource.state.loading||this.changes.state.loading||this.diff.state.loading}publish(){this.disposed||(this.revision++,this.changed.fire())}projectResource=this._register(new Go(()=>this.publish()));changes=this._register(new Go(()=>this.publish()));diff=this._register(new Go(()=>this.publish()));get project(){return this.projectResource.state}get codeChanges(){return this.changes.state}get codeDiff(){return this.diff.state}get codeDiffKey(){return this.diff.key}async refreshDiff(e){this.diffRequest++;let t=this.codeChanges.data,n=t?.files.find(n=>n.path===(e||t.files[0]?.path));if(!t||!n){this.diff.clear();return}let r=Qo(t.sha,n.path,n.reviewKey);await this.diff.load(r,()=>na.code.diff(t.sha,n.path,n.reviewKey))}async refresh(e,t=``,{diff:n=!0}={}){let r=++this.refreshRequest,i=this.diffRequest,a=e||this.project.data?.defaultRef;if(a&&this.changes.key!==a&&(this.changes.clear(),this.diff.clear()),await this.projectResource.load(`project`,()=>na.project.get()),this.disposed||r!==this.refreshRequest)return;let o=e||this.project.data?.defaultRef||`HEAD`;await this.changes.load(o,()=>na.code.list(o)),n&&!this.disposed&&r===this.refreshRequest&&i===this.diffRequest&&await this.refreshDiff(t)}async reviewCode(e,t,n,r,{diff:i=!0}={}){let a=this.refreshRequest,o=this.diffRequest,s=this.codeDiff.data?.path||``;await na.code.review(e,t,n,r),!(this.disposed||a!==this.refreshRequest)&&(await this.changes.load(e,()=>na.code.list(e),!0),i&&!this.disposed&&a===this.refreshRequest&&o===this.diffRequest&&await this.refreshDiff(s))}dispose(){this.disposed=!0,super.dispose()}},ts=xa(`changelogService`),ns=class extends Va{changed=this._register(new Oo);onDidChange=this.changed.event;revision=0;getSnapshot=()=>this.revision;disposed=!1;refreshRequest=0;writeChain=Promise.resolve();writeRevision=0;updatedNotes=new Map;publish(){this.disposed||(this.revision++,this.changed.fire())}commitResource=this._register(new Go(()=>this.publish()));fileResource=this._register(new Go(()=>this.publish()));diffResource=this._register(new Go(()=>this.publish()));get commits(){return this.commitResource.state}get files(){return this.fileResource.state}get diff(){return this.diffResource.state}get loading(){return this.commits.loading||this.files.loading||this.diff.loading}async refresh(){let e=++this.refreshRequest;await this.writeChain,!(this.disposed||e!==this.refreshRequest)&&(await this.commitResource.load(`changelog`,async()=>{let e=this.writeRevision,t=await na.changelog.list();return t?{...t,commits:t.commits.map(t=>{let n=this.updatedNotes.get(t.commitId);return n&&n.revision>e?n.note:t})}:``}),this.disposed||e!==this.refreshRequest||this.commits.data&&this.commits.data.commits.length||(this.fileResource.clear(),this.diffResource.clear()))}async selectCommit(e){this.diffResource.clear(),e?await this.fileResource.load(e,()=>na.changelog.files(e)):this.fileResource.clear()}async selectFile(e,t){!e||!t?this.diffResource.clear():await this.diffResource.load(JSON.stringify([e,t]),()=>na.changelog.diff(e,t))}update(e,t){let n=this.writeChain.then(async()=>{let n=await na.changelog.update(e,t);this.updatedNotes.set(e,{revision:++this.writeRevision,note:n});let r=this.commitResource.state;return r.data&&!this.disposed&&(this.commitResource.state={...r,data:{...r.data,commits:r.data.commits.map(t=>t.commitId===e?n:t)}},this.publish()),n});return this.writeChain=n.catch(()=>{}),n}dispose(){this.disposed=!0,super.dispose()}},rs=xa(`conformanceService`),is=class extends Va{changed=this._register(new Oo);revision=0;publish=()=>{this.revision++,this.changed.fire()};ruleResource=this._register(new Go(this.publish));readmeResource=this._register(new Go(this.publish));onDidChange=this.changed.event;getSnapshot=()=>this.revision;get rules(){return this.ruleResource.state}get readme(){return this.readmeResource.state}get readmeId(){return this.readmeResource.key}get loading(){return this.rules.loading||this.readme.loading}refresh(){return this.ruleResource.load(`conformance`,na.conformance.list)}refreshReadme(e){return this.readmeResource.load(e,()=>na.conformance.readme(e))}},as=xa(`filesService`),os=class extends Va{changed=this._register(new Oo);revision=0;onDidChange=this.changed.event;getSnapshot=()=>this.revision;publish=()=>{this.revision++,this.changed.fire()};directories=new Map;content=this._register(new Go(this.publish));get loading(){return this.content.state.loading||!!this.directories.get(``)?.state.loading}loadDirectory(e){let t=this.directories.get(e);return t||(t=new Go(this.publish),this.directories.set(e,t)),t.load(e,()=>na.files.list(e))}toggleDirectory(e){if(!this.directories.has(e))this.loadDirectory(e);else{for(let[t,n]of this.directories)(t===e||t.startsWith(e+`/`))&&(n.dispose(),this.directories.delete(t));this.publish()}}readFile(e,t){return this.content.load(JSON.stringify([e,t]),()=>na.files.read(e,t))}dispose(){for(let e of this.directories.values())e.dispose();this.directories.clear(),super.dispose()}},ss=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),cs=s(((e,t)=>{t.exports=ss()})),ls=s((e=>{var t=cs(),n=f(),r=ua();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var ee=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},te=[],ne=-1;function re(e){return{current:e}}function ie(e){0>ne||(e.current=te[ne],te[ne]=null,ne--)}function I(e,t){ne++,te[ne]=e.current,e.current=t}var L=re(null),ae=re(null),oe=re(null),se=re(null);function ce(e,t){switch(I(oe,t),I(ae,e),I(L,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=Jd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ie(L),I(L,e)}function le(){ie(L),ie(ae),ie(oe)}function ue(e){e.memoizedState!==null&&I(se,e);var t=L.current,n=Jd(t,e.type);t!==n&&(I(ae,e),I(L,n))}function de(e){ae.current===e&&(ie(L),ie(ae)),se.current===e&&(ie(se),rp._currentValue=F)}var fe,pe;function me(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1<e.stack.indexOf(`
|
|
16
|
+
`))}},Go=class{changed;state={data:null,loading:!1,error:null};currentKey=null;get key(){return this.currentKey}generation=0;pending=null;constructor(e){this.changed=e}clear(){this.currentKey=null,this.generation++,this.pending=null,this.state={data:null,loading:!1,error:null},this.changed()}load(e,t,n=!1){if(e!==this.key&&(this.currentKey=e,this.generation++,this.pending=null,this.state={data:null,loading:!1,error:null}),this.pending&&!n)return this.pending;let r=++this.generation;return this.state={...this.state,loading:!0,error:null},this.pending=Promise.resolve().then(t).then(e=>{r===this.generation&&(this.state={data:e,loading:!1,error:null})},e=>{if(r!==this.generation)return;let t=e instanceof Error?e:Error(String(e));this.state={data:t instanceof Yi&&t.status===404?null:this.state.data,loading:!1,error:t}}).then(()=>{r===this.generation&&(this.pending=null,this.changed())}),this.changed(),this.pending}dispose(){this.currentKey=null,this.generation++,this.pending=null,this.state={data:null,loading:!1,error:null}}},Ko=xa(`baselineService`),qo=class extends Va{changed=this._register(new Oo);onDidChange=this.changed.event;revision=0;getSnapshot=()=>this.revision;disposed=!1;get loading(){return this.list.state.loading}publish(){this.disposed||(this.revision++,this.changed.fire())}list=this._register(new Go(()=>this.publish()));get baseline(){return this.list.state}async refresh(){await this.list.load(`baseline`,()=>na.baselines.list())}async deleteBaseline(e,t,n){await na.baselines.delete(e,t,n),await this.list.load(`baseline`,()=>na.baselines.list(),!0)}dispose(){this.disposed=!0,super.dispose()}},Jo=xa(`tasksService`),Yo=class extends Va{changed=this._register(new Oo);onDidChange=this.changed.event;revision=0;getSnapshot=()=>this.revision;disposed=!1;get loading(){return this.list.state.loading||this.detail.state.loading}publish(){this.disposed||(this.revision++,this.changed.fire())}list=this._register(new Go(()=>this.publish()));detail=this._register(new Go(()=>this.publish()));removableCount=this._register(new Go(()=>this.publish()));get removable(){return this.removableCount.state.data?.count??0}async prune(){let{count:e}=await na.tasks.prune();return await this.removableCount.load(`removable`,()=>na.tasks.removable(),!0),e}get tasks(){return this.list.state}get task(){return this.detail.state}async refreshTask(e,t=!1){e?(await this.detail.load(e,()=>na.tasks.detail(e),t),await this.refreshUncachedSummary()):this.detail.clear()}async refreshUncachedSummary(){let e=this.task.data;!this.disposed&&e&&this.tasks.data?.some(t=>t.id===e.task.id&&t.cached===!1)&&await this.list.load(`tasks`,()=>na.tasks.list(),!0)}async refresh(e){await Promise.all([this.list.load(`tasks`,()=>na.tasks.list()),this.removableCount.load(`removable`,()=>na.tasks.removable()),this.refreshTask(e)]),await this.refreshUncachedSummary()}async approve(e,t,n){let r=await na.tasks.approve(e,t,n);return await Promise.all([this.list.load(`tasks`,()=>na.tasks.list(),!0),this.detail.key===e?this.refreshTask(e,!0):Promise.resolve()]),await this.refreshUncachedSummary(),r}dispose(){this.disposed=!0,super.dispose()}},Xo=xa(`baselineChangeService`),Zo=class extends Va{changed=this._register(new Oo);onDidChange=this.changed.event;revision=0;getSnapshot=()=>this.revision;disposed=!1;refreshRequest=0;get loading(){return this.projectResource.state.loading||this.changes.state.loading}publish(){this.disposed||(this.revision++,this.changed.fire())}projectResource=this._register(new Go(()=>this.publish()));changes=this._register(new Go(()=>this.publish()));get project(){return this.projectResource.state}get baselineChanges(){return this.changes.state}async refresh(e){let t=++this.refreshRequest,n=e||this.project.data?.defaultRef;if(n&&this.changes.key!==n&&this.changes.clear(),await this.projectResource.load(`project`,()=>na.project.get()),this.disposed||t!==this.refreshRequest)return;let r=e||this.project.data?.defaultRef||`HEAD`;await this.changes.load(r,()=>na.changes.list(r))}async reviewBaseline(e,t,n,r){let i=this.refreshRequest;await na.changes.review(e,t,n,r),!(this.disposed||i!==this.refreshRequest)&&await this.changes.load(e,()=>na.changes.list(e),!0)}dispose(){this.disposed=!0,super.dispose()}};function Qo(e,t,n){return JSON.stringify([e,t,n])}var $o=xa(`codeDiffService`),es=class extends Va{changed=this._register(new Oo);onDidChange=this.changed.event;revision=0;getSnapshot=()=>this.revision;disposed=!1;refreshRequest=0;diffRequest=0;get loading(){return this.projectResource.state.loading||this.changes.state.loading||this.diff.state.loading}publish(){this.disposed||(this.revision++,this.changed.fire())}projectResource=this._register(new Go(()=>this.publish()));changes=this._register(new Go(()=>this.publish()));diff=this._register(new Go(()=>this.publish()));get project(){return this.projectResource.state}get codeChanges(){return this.changes.state}get codeDiff(){return this.diff.state}get codeDiffKey(){return this.diff.key}get defaultFile(){let e=this.codeChanges.data?.files,t=this.project.data?.reportDir;return t&&e?.find(({path:e})=>!e.startsWith(`${t}/`))?.path||e?.[0]?.path||``}async refreshDiff(e){this.diffRequest++;let t=this.codeChanges.data,n=e||this.defaultFile,r=t?.files.find(e=>e.path===n);if(!t||!r){this.diff.clear();return}let i=Qo(t.sha,r.path,r.reviewKey);await this.diff.load(i,()=>na.code.diff(t.sha,r.path,r.reviewKey))}async refresh(e,t=``,{diff:n=!0}={}){let r=++this.refreshRequest,i=this.diffRequest,a=e||this.project.data?.defaultRef;if(a&&this.changes.key!==a&&(this.changes.clear(),this.diff.clear()),await this.projectResource.load(`project`,()=>na.project.get()),this.disposed||r!==this.refreshRequest)return;let o=e||this.project.data?.defaultRef||`HEAD`;await this.changes.load(o,()=>na.code.list(o)),n&&!this.disposed&&r===this.refreshRequest&&i===this.diffRequest&&await this.refreshDiff(t)}async reviewCode(e,t,n,r,{diff:i=!0}={}){let a=this.refreshRequest,o=this.diffRequest,s=this.codeDiff.data?.path||``;await na.code.review(e,t,n,r),!(this.disposed||a!==this.refreshRequest)&&(await this.changes.load(e,()=>na.code.list(e),!0),i&&!this.disposed&&a===this.refreshRequest&&o===this.diffRequest&&await this.refreshDiff(s))}dispose(){this.disposed=!0,super.dispose()}},ts=xa(`changelogService`),ns=class extends Va{changed=this._register(new Oo);onDidChange=this.changed.event;revision=0;getSnapshot=()=>this.revision;disposed=!1;refreshRequest=0;writeChain=Promise.resolve();writeRevision=0;updatedNotes=new Map;publish(){this.disposed||(this.revision++,this.changed.fire())}commitResource=this._register(new Go(()=>this.publish()));fileResource=this._register(new Go(()=>this.publish()));diffResource=this._register(new Go(()=>this.publish()));get commits(){return this.commitResource.state}get files(){return this.fileResource.state}get diff(){return this.diffResource.state}get loading(){return this.commits.loading||this.files.loading||this.diff.loading}async refresh(){let e=++this.refreshRequest;await this.writeChain,!(this.disposed||e!==this.refreshRequest)&&(await this.commitResource.load(`changelog`,async()=>{let e=this.writeRevision,t=await na.changelog.list();return t?{...t,commits:t.commits.map(t=>{let n=this.updatedNotes.get(t.commitId);return n&&n.revision>e?n.note:t})}:``}),this.disposed||e!==this.refreshRequest||this.commits.data&&this.commits.data.commits.length||(this.fileResource.clear(),this.diffResource.clear()))}async selectCommit(e){this.diffResource.clear(),e?await this.fileResource.load(e,()=>na.changelog.files(e)):this.fileResource.clear()}async selectFile(e,t){!e||!t?this.diffResource.clear():await this.diffResource.load(JSON.stringify([e,t]),()=>na.changelog.diff(e,t))}update(e,t){let n=this.writeChain.then(async()=>{let n=await na.changelog.update(e,t);this.updatedNotes.set(e,{revision:++this.writeRevision,note:n});let r=this.commitResource.state;return r.data&&!this.disposed&&(this.commitResource.state={...r,data:{...r.data,commits:r.data.commits.map(t=>t.commitId===e?n:t)}},this.publish()),n});return this.writeChain=n.catch(()=>{}),n}dispose(){this.disposed=!0,super.dispose()}},rs=xa(`conformanceService`),is=class extends Va{changed=this._register(new Oo);revision=0;publish=()=>{this.revision++,this.changed.fire()};ruleResource=this._register(new Go(this.publish));readmeResource=this._register(new Go(this.publish));onDidChange=this.changed.event;getSnapshot=()=>this.revision;get rules(){return this.ruleResource.state}get readme(){return this.readmeResource.state}get readmeId(){return this.readmeResource.key}get loading(){return this.rules.loading||this.readme.loading}refresh(){return this.ruleResource.load(`conformance`,na.conformance.list)}refreshReadme(e){return this.readmeResource.load(e,()=>na.conformance.readme(e))}},as=xa(`filesService`),os=class extends Va{changed=this._register(new Oo);revision=0;onDidChange=this.changed.event;getSnapshot=()=>this.revision;publish=()=>{this.revision++,this.changed.fire()};directories=new Map;content=this._register(new Go(this.publish));get loading(){return this.content.state.loading||!!this.directories.get(``)?.state.loading}loadDirectory(e){let t=this.directories.get(e);return t||(t=new Go(this.publish),this.directories.set(e,t)),t.load(e,()=>na.files.list(e))}toggleDirectory(e){if(!this.directories.has(e))this.loadDirectory(e);else{for(let[t,n]of this.directories)(t===e||t.startsWith(e+`/`))&&(n.dispose(),this.directories.delete(t));this.publish()}}readFile(e,t){return this.content.load(JSON.stringify([e,t]),()=>na.files.read(e,t))}dispose(){for(let e of this.directories.values())e.dispose();this.directories.clear(),super.dispose()}},ss=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),cs=s(((e,t)=>{t.exports=ss()})),ls=s((e=>{var t=cs(),n=f(),r=ua();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var ee=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},te=[],ne=-1;function re(e){return{current:e}}function ie(e){0>ne||(e.current=te[ne],te[ne]=null,ne--)}function I(e,t){ne++,te[ne]=e.current,e.current=t}var L=re(null),ae=re(null),oe=re(null),se=re(null);function ce(e,t){switch(I(oe,t),I(ae,e),I(L,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=Jd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ie(L),I(L,e)}function le(){ie(L),ie(ae),ie(oe)}function ue(e){e.memoizedState!==null&&I(se,e);var t=L.current,n=Jd(t,e.type);t!==n&&(I(ae,e),I(L,n))}function de(e){ae.current===e&&(ie(L),ie(ae)),se.current===e&&(ie(se),rp._currentValue=F)}var fe,pe;function me(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1<e.stack.indexOf(`
|
|
17
17
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
18
18
|
`+fe+e+pe}var he=!1;function ge(e,t){if(!e||he)return``;he=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
19
19
|
`),l=s.split(`
|
|
@@ -100,4 +100,4 @@ Error generating stack: `+e.message+`
|
|
|
100
100
|
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
101
101
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
102
102
|
`}),n}function pE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function mE(e,t){let n=cE(e,t),r=n.one(e,void 0),i=GT(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
103
|
-
`},i)),a}function hE(e,t){return e&&`run`in e?async function(n,r){let i=mE(n,{file:r,...t});await e.run(i,r)}:function(n,r){return mE(n,{file:r,...e||t})}}function gE(e){if(e)throw e}var _E=u(s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function vE(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function yE(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?bE(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function bE(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var xE={basename:SE,dirname:CE,extname:wE,join:TE,sep:`/`};function SE(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);OE(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function CE(e){if(OE(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function wE(e){OE(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function TE(...e){let t=-1,n;for(;++t<e.length;)OE(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:EE(n)}function EE(e){OE(e);let t=e.codePointAt(0)===47,n=DE(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function DE(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function OE(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var kE={cwd:AE};function AE(){return`/`}function jE(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function ME(e){if(typeof e==`string`)e=new URL(e);else if(!jE(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return NE(e)}function NE(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var PE=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],FE=class{constructor(e){let t;t=e?jE(e)?{path:e}:typeof e==`string`||zE(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:kE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<PE.length;){let e=PE[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)PE.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?xE.basename(this.path):void 0}set basename(e){LE(e,`basename`),IE(e,`basename`),this.path=xE.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?xE.dirname(this.path):void 0}set dirname(e){RE(this.basename,`dirname`),this.path=xE.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?xE.extname(this.path):void 0}set extname(e){if(IE(e,`extname`),RE(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=xE.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){jE(e)&&(e=ME(e)),LE(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?xE.basename(this.path,this.extname):void 0}set stem(e){LE(e,`stem`),IE(e,`stem`),this.path=xE.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new _x(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function IE(e,t){if(e&&e.includes(xE.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+xE.sep+"`")}function LE(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function RE(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function zE(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var BE=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),VE={}.hasOwnProperty,HE=new class e extends BE{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=yE()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,_E.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(GE(`data`,this.frozen),this.namespace[e]=t,this):VE.call(this.namespace,e)&&this.namespace[e]||void 0:e?(GE(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=JE(e),n=this.parser||this.Parser;return UE(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),UE(`process`,this.parser||this.Parser),WE(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=JE(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);XE(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),UE(`processSync`,this.parser||this.Parser),WE(`processSync`,this.compiler||this.Compiler),this.process(e,r),qE(`processSync`,`process`,t),n;function r(e,r){t=!0,gE(e),n=r}}run(e,t,n){KE(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=JE(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),qE(`runSync`,`run`,n),r;function i(e,t){gE(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=JE(t),r=this.compiler||this.Compiler;return WE(`stringify`,r),KE(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(GE(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,_E.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];vE(o)&&vE(r)&&(r=(0,_E.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function UE(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function WE(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function GE(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function KE(e){if(!vE(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function qE(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function JE(e){return YE(e)?e:new FE(e)}function YE(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function XE(e){return typeof e==`string`||ZE(e)}function ZE(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var QE=[],$E={allowDangerousHtml:!0},eD=/^(https?|ircs?|mailto|xmpp)$/i,tD=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function nD(e){let t=rD(e),n=iD(e);return aD(t.runSync(t.parse(n),n),e)}function rD(e){let t=e.rehypePlugins||QE,n=e.remarkPlugins||QE,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...$E}:$E;return HE().use(Xw).use(n).use(hE,r).use(t)}function iD(e){let t=e.children||``,n=new FE;return typeof t==`string`?n.value=t:``+t,n}function aD(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||oD;for(let e of tD)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return rE(e,l),Tx(e,{Fragment:z.Fragment,components:i,ignoreInvalidStyle:!0,jsx:z.jsx,jsxs:z.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Jx)if(Object.hasOwn(Jx,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Jx[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function oD(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||eD.test(e.slice(0,t))?e:``}function sD(e){let t=pa(ga(as)),[n,r]=(0,p.useState)([0]),i=n.at(-1);Wy(()=>t.readFile(e,i),[e,i]);let a=t.content.key===JSON.stringify([e,i])?t.content.state:null,o=a?.data,s=o?.kind===`text`?o.text:void 0,c=o?.kind===`text`?o.nextOffset:void 0;return{offset:i,text:s,loading:!a||a.loading,error:a?.error?.message,note:o?.kind===`binary`?`二进制文件不支持文本预览。`:s===``?`空文件`:void 0,pager:i>0||c!==void 0?{index:n.length-1,hasNext:c!==void 0,onPrev:()=>{i>0&&r(n.slice(0,-1))},onNext:()=>{c!==void 0&&r([...n,c])}}:null}}var cD=e=>`/mobile/${e}`;function lD(e,t={}){let n=new URLSearchParams(Object.entries(t).filter(e=>!!e[1])).toString();return n?`${e}?${n}`:e}function uD(e){let t=pa(ga(as));Wy(()=>t.loadDirectory(``));let n=t.directories.get(``)?.state,r=e?16:14,i=n=>(t.directories.get(n)?.state?.data??[]).map(({name:a,directory:o,ignored:s})=>{let c=n?n+`/`+a:a,l=o&&t.directories.has(c),u=o?t.directories.get(c)?.state:void 0;return{key:c,label:a,icon:o?(0,z.jsx)(ib,{open:l,size:r,muted:s}):(0,z.jsx)(rb,{name:a,size:r,muted:s}),muted:s,trailing:u?.loading?(0,z.jsx)(yy,{className:`project-folder-loading`,size:r,role:`status`,"aria-label":`正在读取 ${a}`,"data-testid":ra.files.folderLoading(c)}):u?.error?(0,z.jsx)(`span`,{className:`project-folder-error`,role:`img`,"aria-label":u.error.message,title:u.error.message,children:(0,z.jsx)(pv,{size:r,"aria-hidden":`true`})}):void 0,testId:o?(e?ra.mobile.folder:ra.folder)(c):(e?ra.mobile.file:ra.files.file)(c),children:o?i(c):void 0,href:e&&!o?lD(`/mobile/files/file`,{path:c}):void 0}});return{nodes:i(``),error:n?.error,loading:n?.loading??!0,isExpanded:e=>t.directories.has(e),onToggle:e=>t.toggleDirectory(e)}}function dD({path:t,text:n,mobile:r=!1}){let i=(0,p.useRef)(null),[a,o]=(0,p.useState)(`loading`);return(0,p.useEffect)(()=>{let a=!0,s;return o(`loading`),e(async()=>{let{monaco:e,languageForPath:t}=await import(`./monaco-BIg-2np-.js`);return{monaco:e,languageForPath:t}},__vite__mapDeps([0,1,2,3,4])).then(async({monaco:e,languageForPath:c})=>{if(!a)return;let l=c(t);await e.editor.colorize(``,l,{}),a&&i.current&&(s=e.editor.create(i.current,{value:n,language:l,theme:`vs`,ariaLabel:t,readOnly:!0,domReadOnly:!0,automaticLayout:!0,minimap:{enabled:!1},renderValidationDecorations:`off`,renderLineHighlight:`none`,overviewRulerLanes:0,overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollBeyondLastLine:!1,lineNumbersMinChars:3,fontSize:12,fontFamily:getComputedStyle(i.current).getPropertyValue(r?`--m-font-mono`:`--font-metadata`).trim(),lineHeight:r?20:22,...r&&{folding:!1,glyphMargin:!1,lineDecorationsWidth:8},padding:{top:8,bottom:8}}),o(`ready`))}).catch(()=>{a&&o(`error`)}),()=>{a=!1,s?.dispose()}},[t,n,r]),(0,z.jsxs)(`div`,{className:`project-file-editor`,"data-testid":ra.files.editor,"aria-busy":a===`loading`,children:[(0,z.jsx)(`div`,{className:`project-file-editor-host`,ref:i}),a!==`ready`&&(0,z.jsx)(`pre`,{className:`project-file-fallback`,tabIndex:0,children:n})]})}export{rs as $,Ri as $t,_v as A,Ga as At,Gg as B,xa as Bt,Zv as C,_o as Ct,kv as D,co as Dt,Fv as E,vo as Et,sv as F,za as Ft,l_ as G,fa as Gt,qg as H,ha as Ht,av as I,ja as It,ds as J,sa as Jt,L_ as K,ua as Kt,Y as L,Da as Lt,pv as M,Ba as Mt,dv as N,Ha as Nt,Tv as O,ao as Ot,lv as P,Ia as Pt,is as Q,Li as Qt,V_ as R,Oa as Rt,$v as S,yo as St,Uv as T,oo as Tt,n_ as U,ga as Ut,Yg as V,_a as Vt,C_ as W,pa as Wt,os as X,ra as Xt,us as Y,aa as Yt,as as Z,Yi as Zt,_y as _,Mo as _t,sD as a,Mr as an,Zo as at,ly as b,no as bt,rb as c,gr as cn,Yo as ct,Wy as d,c as dn,Uo as dt,Yr as en,ns as et,Ny as f,u as fn,Bo as ft,yy as g,So as gt,Cy as h,Oo as ht,cD as i,cr as in,Qo as it,hv as j,Va as jt,yv as k,qa as kt,ib as l,Ui as ln,qo as lt,Dy as m,No as mt,uD as n,Ve as nn,es as nt,nD as o,dr as on,Xo as ot,ky as p,Po as pt,fs as q,ca as qt,lD as r,He as rn,$o as rt,ab as s,mr as sn,Jo as st,dD as t,Pi as tn,ts as tt,Gy as u,f as un,Ko as ut,hy as v,ho as vt,Yv as w,so as wt,ay as x,go as xt,dy as y,mo as yt,H_ as z,ya as zt};
|
|
103
|
+
`},i)),a}function hE(e,t){return e&&`run`in e?async function(n,r){let i=mE(n,{file:r,...t});await e.run(i,r)}:function(n,r){return mE(n,{file:r,...e||t})}}function gE(e){if(e)throw e}var _E=u(s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function vE(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function yE(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?bE(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function bE(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var xE={basename:SE,dirname:CE,extname:wE,join:TE,sep:`/`};function SE(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);OE(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function CE(e){if(OE(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function wE(e){OE(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function TE(...e){let t=-1,n;for(;++t<e.length;)OE(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:EE(n)}function EE(e){OE(e);let t=e.codePointAt(0)===47,n=DE(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function DE(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function OE(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var kE={cwd:AE};function AE(){return`/`}function jE(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function ME(e){if(typeof e==`string`)e=new URL(e);else if(!jE(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return NE(e)}function NE(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var PE=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],FE=class{constructor(e){let t;t=e?jE(e)?{path:e}:typeof e==`string`||zE(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:kE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<PE.length;){let e=PE[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)PE.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?xE.basename(this.path):void 0}set basename(e){LE(e,`basename`),IE(e,`basename`),this.path=xE.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?xE.dirname(this.path):void 0}set dirname(e){RE(this.basename,`dirname`),this.path=xE.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?xE.extname(this.path):void 0}set extname(e){if(IE(e,`extname`),RE(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=xE.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){jE(e)&&(e=ME(e)),LE(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?xE.basename(this.path,this.extname):void 0}set stem(e){LE(e,`stem`),IE(e,`stem`),this.path=xE.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new _x(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function IE(e,t){if(e&&e.includes(xE.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+xE.sep+"`")}function LE(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function RE(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function zE(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var BE=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),VE={}.hasOwnProperty,HE=new class e extends BE{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=yE()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,_E.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(GE(`data`,this.frozen),this.namespace[e]=t,this):VE.call(this.namespace,e)&&this.namespace[e]||void 0:e?(GE(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=JE(e),n=this.parser||this.Parser;return UE(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),UE(`process`,this.parser||this.Parser),WE(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=JE(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);XE(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),UE(`processSync`,this.parser||this.Parser),WE(`processSync`,this.compiler||this.Compiler),this.process(e,r),qE(`processSync`,`process`,t),n;function r(e,r){t=!0,gE(e),n=r}}run(e,t,n){KE(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=JE(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),qE(`runSync`,`run`,n),r;function i(e,t){gE(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=JE(t),r=this.compiler||this.Compiler;return WE(`stringify`,r),KE(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(GE(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,_E.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];vE(o)&&vE(r)&&(r=(0,_E.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function UE(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function WE(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function GE(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function KE(e){if(!vE(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function qE(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function JE(e){return YE(e)?e:new FE(e)}function YE(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function XE(e){return typeof e==`string`||ZE(e)}function ZE(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var QE=[],$E={allowDangerousHtml:!0},eD=/^(https?|ircs?|mailto|xmpp)$/i,tD=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function nD(e){let t=rD(e),n=iD(e);return aD(t.runSync(t.parse(n),n),e)}function rD(e){let t=e.rehypePlugins||QE,n=e.remarkPlugins||QE,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...$E}:$E;return HE().use(Xw).use(n).use(hE,r).use(t)}function iD(e){let t=e.children||``,n=new FE;return typeof t==`string`?n.value=t:``+t,n}function aD(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||oD;for(let e of tD)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return rE(e,l),Tx(e,{Fragment:z.Fragment,components:i,ignoreInvalidStyle:!0,jsx:z.jsx,jsxs:z.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Jx)if(Object.hasOwn(Jx,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Jx[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function oD(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||eD.test(e.slice(0,t))?e:``}function sD(e){let t=pa(ga(as)),[n,r]=(0,p.useState)([0]),i=n.at(-1);Wy(()=>t.readFile(e,i),[e,i]);let a=t.content.key===JSON.stringify([e,i])?t.content.state:null,o=a?.data,s=o?.kind===`text`?o.text:void 0,c=o?.kind===`text`?o.nextOffset:void 0;return{offset:i,text:s,loading:!a||a.loading,error:a?.error?.message,note:o?.kind===`binary`?`二进制文件不支持文本预览。`:s===``?`空文件`:void 0,pager:i>0||c!==void 0?{index:n.length-1,hasNext:c!==void 0,onPrev:()=>{i>0&&r(n.slice(0,-1))},onNext:()=>{c!==void 0&&r([...n,c])}}:null}}var cD=e=>`/mobile/${e}`;function lD(e,t={}){let n=new URLSearchParams(Object.entries(t).filter(e=>!!e[1])).toString();return n?`${e}?${n}`:e}function uD(e){let t=pa(ga(as));Wy(()=>t.loadDirectory(``));let n=t.directories.get(``)?.state,r=e?16:14,i=n=>(t.directories.get(n)?.state?.data??[]).map(({name:a,directory:o,ignored:s})=>{let c=n?n+`/`+a:a,l=o&&t.directories.has(c),u=o?t.directories.get(c)?.state:void 0;return{key:c,label:a,icon:o?(0,z.jsx)(ib,{open:l,size:r,muted:s}):(0,z.jsx)(rb,{name:a,size:r,muted:s}),muted:s,trailing:u?.loading?(0,z.jsx)(yy,{className:`project-folder-loading`,size:r,role:`status`,"aria-label":`正在读取 ${a}`,"data-testid":ra.files.folderLoading(c)}):u?.error?(0,z.jsx)(`span`,{className:`project-folder-error`,role:`img`,"aria-label":u.error.message,title:u.error.message,children:(0,z.jsx)(pv,{size:r,"aria-hidden":`true`})}):void 0,testId:o?(e?ra.mobile.folder:ra.folder)(c):(e?ra.mobile.file:ra.files.file)(c),children:o?i(c):void 0,href:e&&!o?lD(`/mobile/files/file`,{path:c}):void 0}});return{nodes:i(``),error:n?.error,loading:n?.loading??!0,isExpanded:e=>t.directories.has(e),onToggle:e=>t.toggleDirectory(e)}}function dD({path:t,text:n,mobile:r=!1}){let i=(0,p.useRef)(null),[a,o]=(0,p.useState)(`loading`);return(0,p.useEffect)(()=>{let a=!0,s;return o(`loading`),e(async()=>{let{monaco:e,languageForPath:t}=await import(`./monaco-CTOp7rv3.js`);return{monaco:e,languageForPath:t}},__vite__mapDeps([0,1,2,3,4])).then(async({monaco:e,languageForPath:c})=>{if(!a)return;let l=c(t);await e.editor.colorize(``,l,{}),a&&i.current&&(s=e.editor.create(i.current,{value:n,language:l,theme:`vs`,ariaLabel:t,readOnly:!0,domReadOnly:!0,automaticLayout:!0,minimap:{enabled:!1},renderValidationDecorations:`off`,renderLineHighlight:`none`,overviewRulerLanes:0,overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollBeyondLastLine:!1,lineNumbersMinChars:3,fontSize:12,fontFamily:getComputedStyle(i.current).getPropertyValue(r?`--m-font-mono`:`--font-metadata`).trim(),lineHeight:r?20:22,...r&&{folding:!1,glyphMargin:!1,lineDecorationsWidth:8},padding:{top:8,bottom:8}}),o(`ready`))}).catch(()=>{a&&o(`error`)}),()=>{a=!1,s?.dispose()}},[t,n,r]),(0,z.jsxs)(`div`,{className:`project-file-editor`,"data-testid":ra.files.editor,"aria-busy":a===`loading`,children:[(0,z.jsx)(`div`,{className:`project-file-editor-host`,ref:i}),a!==`ready`&&(0,z.jsx)(`pre`,{className:`project-file-fallback`,tabIndex:0,children:n})]})}export{rs as $,Ri as $t,_v as A,Ga as At,Gg as B,xa as Bt,Zv as C,_o as Ct,kv as D,co as Dt,Fv as E,vo as Et,sv as F,za as Ft,l_ as G,fa as Gt,qg as H,ha as Ht,av as I,ja as It,ds as J,sa as Jt,L_ as K,ua as Kt,Y as L,Da as Lt,pv as M,Ba as Mt,dv as N,Ha as Nt,Tv as O,ao as Ot,lv as P,Ia as Pt,is as Q,Li as Qt,V_ as R,Oa as Rt,$v as S,yo as St,Uv as T,oo as Tt,n_ as U,ga as Ut,Yg as V,_a as Vt,C_ as W,pa as Wt,os as X,ra as Xt,us as Y,aa as Yt,as as Z,Yi as Zt,_y as _,Mo as _t,sD as a,Mr as an,Zo as at,ly as b,no as bt,rb as c,gr as cn,Yo as ct,Wy as d,c as dn,Uo as dt,Yr as en,ns as et,Ny as f,u as fn,Bo as ft,yy as g,So as gt,Cy as h,Oo as ht,cD as i,cr as in,Qo as it,hv as j,Va as jt,yv as k,qa as kt,ib as l,Ui as ln,qo as lt,Dy as m,No as mt,uD as n,Ve as nn,es as nt,nD as o,dr as on,Xo as ot,ky as p,Po as pt,fs as q,ca as qt,lD as r,He as rn,$o as rt,ab as s,mr as sn,Jo as st,dD as t,Pi as tn,ts as tt,Gy as u,f as un,Ko as ut,hy as v,ho as vt,Yv as w,so as wt,ay as x,go as xt,dy as y,mo as yt,H_ as z,ya as zt};
|