@krate/runtime 0.5.0-rc.4 → 0.5.0-rc.6
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/actions.js +10 -1
- package/dist/cache-scope.d.ts +6 -0
- package/dist/cache-scope.js +14 -1
- package/dist/context.d.ts +5 -0
- package/dist/context.js +28 -17
- package/dist/flight-props.d.ts +7 -0
- package/dist/flight-props.js +105 -0
- package/dist/hints.d.ts +25 -2
- package/dist/hints.js +148 -74
- package/dist/index.d.ts +1 -0
- package/dist/krate-core.js +1 -1
- package/dist/krate-f-actions.js +1 -1
- package/dist/krate-f-list.js +1 -1
- package/dist/krate-f-navigation.js +1 -1
- package/dist/krate-f-router.js +1 -1
- package/dist/krate-features.json +24 -0
- package/dist/krate-hydrate-lite.js +5 -5
- package/dist/krate-hydrate.js +5 -5
- package/dist/krate-runtime.js +5 -5
- package/dist/list.d.ts +14 -4
- package/dist/list.js +4 -5
- package/dist/navigation-react.d.ts +13 -0
- package/dist/navigation-react.js +86 -0
- package/dist/navigation.d.ts +19 -0
- package/dist/navigation.js +35 -0
- package/dist/react-compat.d.ts +26 -0
- package/dist/react-compat.js +292 -0
- package/dist/react-server.d.ts +63 -0
- package/dist/react-server.js +125 -0
- package/dist/router.js +9 -0
- package/dist/server-handler.js +89 -10
- package/dist/server.d.ts +57 -10
- package/dist/server.js +455 -94
- package/dist/ssr-core.d.ts +2 -0
- package/dist/ssr-core.js +8 -0
- package/package.json +19 -2
- package/dist/actions.test.d.ts +0 -1
- package/dist/actions.test.js +0 -75
- package/dist/after.test.d.ts +0 -1
- package/dist/after.test.js +0 -58
- package/dist/builtin-tags.test.d.ts +0 -1
- package/dist/builtin-tags.test.js +0 -12
- package/dist/cache-adapter.test.d.ts +0 -1
- package/dist/cache-adapter.test.js +0 -45
- package/dist/cache.test.d.ts +0 -1
- package/dist/cache.test.js +0 -37
- package/dist/events.test.d.ts +0 -1
- package/dist/events.test.js +0 -42
- package/dist/handler-html.test.d.ts +0 -1
- package/dist/handler-html.test.js +0 -55
- package/dist/handler-segments.test.d.ts +0 -1
- package/dist/handler-segments.test.js +0 -25
- package/dist/head-tags.test.d.ts +0 -1
- package/dist/head-tags.test.js +0 -24
- package/dist/inline-action-token.test.d.ts +0 -1
- package/dist/inline-action-token.test.js +0 -31
- package/dist/jsx-svg-types.test.d.ts +0 -1
- package/dist/jsx-svg-types.test.js +0 -58
- package/dist/link-base-path.test.d.ts +0 -1
- package/dist/link-base-path.test.js +0 -28
- package/dist/node-server.test.d.ts +0 -1
- package/dist/node-server.test.js +0 -138
- package/dist/platform.test.d.ts +0 -1
- package/dist/platform.test.js +0 -44
- package/dist/router-nav.test.d.ts +0 -1
- package/dist/router-nav.test.js +0 -130
- package/dist/server-handler.test.d.ts +0 -1
- package/dist/server-handler.test.js +0 -247
- package/dist/server-renderer.test.d.ts +0 -1
- package/dist/server-renderer.test.js +0 -162
- package/dist/server.test.d.ts +0 -1
- package/dist/server.test.js +0 -80
- package/dist/sha256.test.d.ts +0 -1
- package/dist/sha256.test.js +0 -13
- package/dist/signal.test.d.ts +0 -1
- package/dist/signal.test.js +0 -68
- package/dist/site-config.test.d.ts +0 -1
- package/dist/site-config.test.js +0 -30
- package/dist/slot.test.d.ts +0 -1
- package/dist/slot.test.js +0 -25
- package/dist/ssr-core-behavior.test.d.ts +0 -1
- package/dist/ssr-core-behavior.test.js +0 -108
- package/dist/testing.test.d.ts +0 -1
- package/dist/testing.test.js +0 -73
package/dist/krate-core.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __krate_exports=(()=>{var un=Object.defineProperty;var Bo=Object.getOwnPropertyDescriptor;var zo=Object.getOwnPropertyNames;var Vo=Object.prototype.hasOwnProperty;var Go=(e,n)=>{for(var t in n)un(e,t,{get:n[t],enumerable:!0})},Uo=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of zo(n))!Vo.call(e,r)&&r!==t&&un(e,r,{get:()=>n[r],enumerable:!(o=Bo(n,r))||o.enumerable});return e};var Wo=e=>Uo(un({},"__esModule",{value:!0}),e);var os={};Go(os,{BLOCKED_URL:()=>po,KRATE_CONTEXT:()=>gt,__krate_useId:()=>Qi,adoptValue:()=>rn,afterFlush:()=>lr,appendChild:()=>xe,clearBetween:()=>ut,clearNodes:()=>So,clearPersisted:()=>Zo,createCSSChoice:()=>hr,createCSSFlags:()=>kr,createCSSGroup:()=>yr,createCSSRange:()=>wr,createCSSStack:()=>vr,createCSSToggle:()=>mr,createCallbackDeps:()=>$r,createContext:()=>ln,createEffect:()=>y,createEffectDeps:()=>Br,createEffectEvent:()=>Wr,createMemo:()=>Nr,createMemoDeps:()=>Gt,createReducer:()=>Or,createResource:()=>Gi,createRoot:()=>Ar,createScope:()=>Xo,createScopeFlags:()=>Qo,createSignal:()=>S,disposeAll:()=>bt,disposeNode:()=>se,flushPassive:()=>te,forwardRef:()=>Hr,h:()=>Bi,hydrate:()=>Vi,insert:()=>Ri,insertAt:()=>ie,isDerivedGetter:()=>Fe,isSignalGetter:()=>xr,krateApplyStyle:()=>To,krateAttachRef:()=>ve,krateBindRef:()=>Ai,krateCommitSnapshot:()=>wt,krateCommitting:()=>Q,krateCondActivity:()=>qr,krateCondDetached:()=>vi,krateCondReset:()=>Si,krateCondSwap:()=>Ti,krateContextRows:()=>Jo,krateControl:()=>Je,krateCurrentScope:()=>M,krateCustomProp:()=>xo,krateDepsOf:()=>Xr,krateDerived:()=>Sr,krateDisposeExcept:()=>pr,krateDisposeOwner:()=>me,krateDisposeScopes:()=>gr,krateEnterScope:()=>or,krateEpoch:()=>He,krateEventName:()=>Zn,krateEventRoot:()=>Xe,krateFlushSync:()=>De,krateForgetOwner:()=>Dr,krateGetOwner:()=>J,krateHintPreconnect:()=>Zi,krateHintPrefetchDNS:()=>es,krateHintPreinit:()=>ns,krateHintPreinitModule:()=>ts,krateHintPreload:()=>Ji,krateHintPreloadModule:()=>Yi,krateHook:()=>Tr,krateHookState:()=>nr,krateIsDiscrete:()=>ar,krateKeepScopes:()=>ir,krateLeaveScope:()=>rr,krateMount:()=>Ir,krateMountFields:()=>Qe,krateMountPortals:()=>ki,krateMuteEvents:()=>ci,krateOn:()=>Se,krateOnAfterFlush:()=>Rn,krateOnBeforeFlush:()=>_n,krateOnDispose:()=>Nn,krateOnHookError:()=>zr,krateOnLayoutCommit:()=>Gr,krateOnSettle:()=>Er,krateOnUnmount:()=>Kr,krateOwner:()=>Fr,krateOwnerId:()=>Mr,krateParam:()=>Ui,kratePendingFlush:()=>On,kratePortalFind:()=>yi,kratePortalMount:()=>nt,kratePortalReset:()=>wi,kratePortalScan:()=>ao,kratePortalTarget:()=>gi,kratePortalUnmount:()=>en,kratePortalsEnter:()=>rt,kratePortalsIn:()=>ot,kratePortalsLeave:()=>it,kratePruneSnapshots:()=>xn,krateReadAt:()=>Le,krateRefsEnter:()=>Ge,krateRefsFlush:()=>Un,krateRefsHold:()=>$t,krateRefsLeave:()=>Ve,krateRenderPhase:()=>sr,krateRequestFlush:()=>Cr,krateRunEvent:()=>Ke,krateSanitizeAttr:()=>st,krateScopeOfId:()=>Ln,krateSetControl:()=>z,krateSetOwner:()=>b,krateSetRef:()=>Wt,krateSlotReplaced:()=>jr,krateSpread:()=>Hi,krateSynthetic:()=>$e,krateTagOwner:()=>he,krateTakeSyncLane:()=>Cn,krateTrackNode:()=>nn,krateTransitionWrites:()=>ur,krateUnmount:()=>B,krateWithIdScope:()=>Xi,krateWithOwner:()=>zn,mount:()=>zi,onCleanup:()=>I,onMount:()=>_r,readDurableState:()=>gn,readPersisted:()=>hn,removeRest:()=>Ko,resetContexts:()=>Ce,resolvePersist:()=>pn,runAfterFlush:()=>ke,sameValue:()=>dr,setOwnerHooks:()=>tr,subscribePersist:()=>kn,trackEffect:()=>A,untrack:()=>E,useRef:()=>Pr,withDOM:()=>_o,withVNodes:()=>Ao,writePersisted:()=>mn});var $o=0,gt=Symbol.for("krate.context"),ae=class{constructor(n){this.get=n}};function an(e){if(e instanceof Node)return e;let n=document.createDocumentFragment();if(Array.isArray(e))for(let t of e)n.appendChild(an(t));else e!=null&&e!==!1&&e!==!0&&n.appendChild(document.createTextNode(String(e)));return n}var O=new Map;function Ce(){for(let[e,n]of O)if(n.length>0){let t=n[0];O.set(e,[t])}}function Xo(){return ln({})}function Qo(){return ln({})}function ln(e){let n=$o++;O.set(n,[e]);let t=()=>{let c=O.get(n);if(c&&c.length>0){let u=c[c.length-1];return u instanceof ae?u.get():u}return e},o=()=>{let c=O.get(n),u=c&&c.length>0?c[c.length-1]:e;return u instanceof ae?()=>u.get():()=>u},r=c=>{let u=O.get(n)||[e];u.push(c.value),O.set(n,u);let a=document.createElement("div");a.style.display="contents";let f=c.children;if(f)for(let p of Array.isArray(f)?f:[f])p instanceof Node?a.appendChild(p):p!=null&&a.appendChild(document.createTextNode(String(p)));return u.pop(),u.length===0&&u.push(e),a},i=c=>{let u=c.children;return Array.isArray(u)&&(u=u.find(a=>typeof a=="function")),an(typeof u=="function"?u(t()):null)},s=(c=>r(c));return s.$$typeof=gt,s.id=n,s.defaultValue=e,s.Provider=r,s.Consumer=i,s.useContext=t,s.use=t,s.useContextLive=o,s}function Jo(e,n){return(...t)=>{let o=[];for(let[r,i]of e){let s=O.get(r.id);s&&(s.push(new ae(i)),o.push(s))}try{return n(...t)}finally{for(let r of o)r.pop()}}}function Yo(){let e=new Map;return{getItem:n=>e.has(n)?e.get(n):null,setItem:(n,t)=>{e.set(n,t)},removeItem:n=>{e.delete(n)}}}var fn=Yo();function mt(){return typeof window<"u"}function dn(e){if(e&&typeof e=="object")return e;if(!mt())return fn;try{return e==="session"?window.sessionStorage:e==="memory"?fn:window.localStorage}catch{return fn}}function pn(e){let n=typeof e=="string"?{key:e}:e;if(!n.key)throw new Error("[krate] createSignal persist requires a key");let t=n.store??"local";return{key:n.key,store:t,serialize:n.serialize??(o=>JSON.stringify(o)),deserialize:n.deserialize??(o=>JSON.parse(o)),sync:n.sync??t==="local"}}function gn(e,n){let o=globalThis.__KRATE_STATE__;if(!o||!Object.prototype.hasOwnProperty.call(o,e))return{found:!1};let r=o[e];if(typeof r=="string")try{return{found:!0,value:n(r)}}catch{return{found:!0,value:r}}return{found:!0,value:r}}function hn(e){let n=dn(e.store),t;try{t=n.getItem(e.key)}catch{return{found:!1}}if(t==null)return{found:!1};try{return{found:!0,value:e.deserialize(t)}}catch{return{found:!1}}}function mn(e,n){let t=dn(e.store);try{t.setItem(e.key,e.serialize(n))}catch{}}function Zo(e){let n=dn(e.store);try{n.removeItem(e.key)}catch{}}var Ae=new Map,ht=!1;function er(){ht||!mt()||(ht=!0,window.addEventListener("storage",e=>{if(e.key===null)return;let n=Ae.get(e.key);if(n)for(let t of n)t(e.newValue)}))}function kn(e,n){if(!e.sync)return()=>{};let t=Ae.get(e.key)??new Set;return t.add(n),Ae.set(e.key,t),er(),()=>{t.delete(n),t.size===0&&Ae.delete(e.key)}}var nr={react:!0},d=[],kt=[],wn=!1,m=null;function tr(e){m=e}var Ne=[],x=new Set,le=[],G=null,yt=new Set,K=new Map;function or(e){return yt.has(e)?!1:(G=e,h=null,!0)}function rr(){G=null,h=null}function M(){let e=d[d.length-1];return e?e.scope:G!==null?G:h!==null&&K.has(h)?K.get(h)??null:null}function ir(e){yt=new Set(e)}function he(e,n){e!==null&&!K.has(e)&&K.set(e,n)}var w=[],fe=!1;function U(e){let n=M(),t={fn:e,cleanups:[],disposed:!1,sources:new Set,running:!1,rerun:!1,queued:!1,owner:h,boundaryOwner:m?m.current():null,scope:n};if(h!==null){he(h,n);let o=F.get(h);o||F.set(h,o=new Set),o.add(t)}return t}var F=new Map,W=new Map;function me(e){let n=F.get(e);if(F.delete(e),n)for(let o of n)Hn(o),x.delete(o);let t=W.get(e);if(W.delete(e),K.delete(e),t)for(let o of t)try{o()}catch{}}var D=0,v=null,_e=0,$=new Set,de=new Set;function sr(e){D++;let n=v;v=null;try{return e()}finally{v=n,D--}}function wt(){_e++;for(let e of $)e.commit(_e);return $.clear(),_e}function He(){return _e}function Le(e,n){let t=v;v=e;try{return n()}finally{v=t}}function xn(e){for(let n of de)n.prune(e)||de.delete(n)}var bn=new Set("auxclick beforeinput blur cancel change click close compositionend compositionstart compositionupdate contextmenu copy cut dblclick dragend dragstart drop focusin focusout input invalid keydown keypress keyup mousedown mouseup paste pause play pointercancel pointerdown pointerup ratechange reset resize seeked select submit touchcancel touchend touchstart volumechange focus".split(" ")),En=0,pe=!1,Re=0;function cr(){if(Re>0)return!0;let e=typeof window<"u"?window.event:void 0;return!!e&&bn.has(e.type)}var Oe=0;function ur(e){Oe++;try{return e()}finally{Oe--}}function ar(e){return bn.has(e)}function Ke(e,n,t){if(!bn.has(e)){t();return}Re++;try{t()}finally{Re--,n&&Re===0&&vn===0&&En===0&&(w.length>0||pe)&&De()}}function Q(e){En+=e?1:-1}function Cn(){let e=pe;return pe=!1,e}function vt(){return d[d.length-1]||null}var h=null;function J(){return h}function b(e){let n=h;return h=e,n}var St=[],Tt=[],An=[];function _n(e){St.push(e)}function Rn(e){Tt.push(e)}function Nn(e){An.push(e)}function On(){return w.length>0}function E(e){d.push(null);try{return e()}finally{d.pop()}}function lr(e){Ne.push(e),Mn()}function fr(){if(Ne.length===0)return;let e=Ne.splice(0);for(let n of e)n()}function dr(e,n){return Object.is(e,n)}function Pn(e){let n=!1,t;for(let o of e.splice(0))try{o()}catch(r){n?typeof console<"u"&&console.error(r):(n=!0,t=r)}if(n)throw t}function ge(e){if(!e.disposed){e.disposed=!0,e.owner!==null&&F.get(e.owner)?.delete(e);for(let n of e.sources)n.delete(e);e.sources.clear(),Pn(e.cleanups)}}function Hn(e){try{ge(e)}catch(n){typeof console<"u"&&console.error(n)}}function pr(e){if(e.length===0){bt();return}let n=new Set(e);xt(t=>!(t!=null&&n.has(t)),!0)}function gr(e){if(e.length===0)return;let n=new Set(e);xt(t=>t!=null&&n.has(t),!1)}function Ln(e){if(e.charCodeAt(0)!==95)return null;let n=e.indexOf("_",1);return n>0?e.slice(0,n+1):null}function xt(e,n){for(let s of An)try{s(e)}catch(c){typeof console<"u"&&console.error(c)}for(let s of Array.from(x))e(s.scope)&&(Hn(s),x.delete(s));let t=[];for(let s of le.splice(0)){if(!e(s.scope)){t.push(s);continue}try{s.fn()}catch{}}le.push(...t);let o=new Set([...W.keys(),...F.keys()]);for(let s of o)e(K.get(s)??null)&&me(s);if(!n)return;let r=globalThis,i=r.__krate_island_cleanups;if(Array.isArray(i)){r.__krate_island_cleanups=[];for(let s of i)try{s()}catch{}}G=null,Ce()}function bt(){G=null;for(let t of An)try{t(null)}catch(o){typeof console<"u"&&console.error(o)}for(let t of x)Hn(t);x.clear();for(let t of le)try{t.fn()}catch{}le.length=0;for(let t of Array.from(W.keys()))me(t);F.clear(),K.clear(),$.clear(),de.clear(),v=null;let e=globalThis,n=e.__krate_island_cleanups;if(Array.isArray(n)){e.__krate_island_cleanups=[];for(let t of n)try{t()}catch{}}w.length=0,Ne.length=0,fe=!1,P=0,X++,pe=!1,Ce()}function hr(e,n){return Me(S(e))}function mr(e,n){return Me(S(e))}function kr(e,n){let t={};for(let i of e){let[s]=S(!1);t[i]=s}let r=[t,(i,s)=>{}];return r.trigger=i=>({"data-krate-scope":"trigger",value:i}),r.panel=i=>({"data-krate-scope":"panel",value:i}),r.close=()=>({"data-krate-scope":"close"}),r}function yr(e,n){return Me(S(e))}function wr(e,n){return Me(S(e))}function Me(e){let n=e;return n.trigger=t=>({"data-krate-scope":"trigger",value:t}),n.panel=t=>({"data-krate-scope":"panel",value:t}),n.close=()=>({"data-krate-scope":"close"}),n.current=()=>e[0](),n}function vr(e,n){let t=()=>e[0];return[{top:t,peek:t},{push:o=>{},pop:()=>{},clear:()=>{}}]}function S(e,n){let t=e,o=null;if(n?.persist){o=pn(n.persist);let l=gn(o.key,o.deserialize);if(l.found)t=l.value;else{let g=hn(o);g.found&&(t=g.value)}}let r=new Set,i=!!n?.react,s=t,c=null,u=i?{commit(l){Object.is(s,t)||(c||(c=[[0,s]]),c.push([l,t]),s=t,de.add(u))},prune(l){if(!c)return!1;for(;c.length>1&&c[1][0]<=l;)c.shift();return c.length===1?(c=null,!1):!0}}:null,a=l=>{if(!c)return s;for(let g=c.length-1;g>=0;g--)if(c[g][0]<=l)return c[g][1];return c[0][1]},f=()=>{let l=d[d.length-1];if(l&&!l.disposed&&(r.add(l),l.sources.add(r)),i){if(v!==null)return a(v);if(D===0)return s}return t},p=(l=!1)=>Et(r,l),_=l=>{let g=typeof l=="function"?l(t):l;Object.is(g,t)||(t=g,o&&mn(o,t),u&&$.add(u),p(i))};if(o&&o.sync){let l=o,g=kn(l,ue=>{if(ue!==null)try{let be=l.deserialize(ue);Object.is(be,t)||(t=be,p())}catch{}});I(g)}return Kn.add(f),[f,_]}function Et(e,n=!1){let t=Array.from(e);for(let o of t){if(o.disposed){e.delete(o);continue}if(o.mark){o.mark(n);continue}if(o.running){o.rerun=!0;continue}o.queued||(o.queued=!0,w.push(o))}Mn(n)}var Ct=new WeakSet;function Sr(e,n){let t,o=!0,r=new Set,i=U(()=>{});i.mark=u=>{o||(o=!0,Et(r,u))},x.add(i);let s=()=>{let u=d[d.length-1];if(u&&!u.disposed&&(r.add(u),u.sources.add(r)),(D===0||v!==null)&&($.size>0||v!==null&&de.size>0))return E(e);if(o&&!i.disposed){for(let a of i.sources)a.delete(i);i.sources.clear(),o=!1,d.push(i);try{n&&n(),t=e()}catch(a){throw o=!0,a}finally{d.pop()}}else if(i.disposed)return E(e);return t},c=d[d.length-1];return c&&c.cleanups.push(()=>{ge(i),x.delete(i)}),Ct.add(s),Kn.add(s),s}function Fe(e){return typeof e=="function"&&Ct.has(e)}function Tr(e){return Fe(e)?e:()=>e}var Kn=new WeakSet;function xr(e){return typeof e=="function"&&Kn.has(e)}var P=0,X=0;function Mn(e=!1){let n=Oe===0&&cr();n&&(pe=!0);let o=!(e||Oe>0)||n||En>0||D>0||typeof setTimeout!="function";if(P===1||!o&&P===2)return;fe=!0;let r=++X,i=()=>{r===X&&Fn()};o?(P=1,queueMicrotask(i)):(P=2,setTimeout(i,0))}var vn=0;function Fn(){vn++;try{br()}finally{vn--}}function br(){fe=!1,P=0,X++;let e=!1,n,t=r=>{e?typeof console<"u"&&console.error(r):(e=!0,n=r)};for(let r of St)r();let o=0;for(;w.length>0&&o<At;o++){let r=w.splice(0);Sn=r;for(let i of r)if(!i.disposed){i.queued=!1,i.rerun=!1;try{Pe(i)}catch(s){t(s)}if(i.rerun&&!i.disposed){i.rerun=!1;try{Pe(i)}catch(s){t(s)}}}}if(w.length>0)try{Tn()}catch(r){t(r)}if(w.length===0&&(P=0,fe=!1,X++),w.length===0){for(let r of _t)try{r()}catch(i){t(i)}if(w.length>0){if(yn>=50)try{Tn()}catch(r){throw t(r),n}yn++;try{Fn()}catch(r){t(r)}finally{yn--}if(e)throw n;return}try{ke()}catch(r){t(r)}}if(e)throw n}var At=100,Sn=[];function Tn(){let e=w.splice(0);for(let r of e)r.queued=!1;fe=!1,P=0,X++;let n=e.length>0?e:Sn;Sn=[];let t=Array.from(new Set(n.map(r=>r.fn.name||"anonymous effect"))).slice(0,3).join(", "),o=new Error("Maximum update depth exceeded. An effect keeps writing state that re-runs itself or another effect ("+t+"). Make the write conditional or remove the dependency that changes on every run.");for(let r of n)if(r.boundaryOwner&&m&&m.error(r.boundaryOwner,o))return;throw o}var _t=[],yn=0;function Er(e){_t.push(e)}function Cr(){Mn()}function ke(){$.size>0&&wt(),typeof document<"u"&&document.activeElement;for(let e of Tt)e();fr()}function De(){if(w.length===0){ke();return}let e=0;for(;w.length>0;)e++>=At&&Tn(),Fn()}function Pe(e){e.running=!0;let n=!1,t=h;h=e.owner,D++;let o=v;v=null;try{Pn(e.cleanups);for(let i of e.sources)i.delete(e);e.sources.clear(),d.push(e),n=!0;let r=e.fn();typeof r=="function"&&e.cleanups.push(r)}catch(r){if(!(e.boundaryOwner&&m&&m.error(e.boundaryOwner,r)))throw r}finally{v=o,D--,h=t,n&&d.pop(),e.running=!1}}function y(e){let n=U(e);x.add(n);let t=d[d.length-1],o=()=>{ge(n),x.delete(n)};return n.boundaryOwner&&m&&m.cleanup(n.boundaryOwner,o),Pe(n),t&&!t.disposed?t.cleanups.push(o):t&&t.root&&Dn(t,o),o}function I(e){let n=vt();if(n){Dn(n,e);return}let t=m?m.current():null;if(t&&m)m.cleanup(t,e);else if(h!==null){he(h,M());let o=W.get(h);o||W.set(h,o=[]),o.push(e)}else le.push({fn:e,scope:M()})}function Dn(e,n){if(e.dead){n();return}e.cleanups.push(n)}function Ar(e){let n=U(()=>{});n.disposed=!0,n.root=!0;let t=()=>{if(n.dead)return;n.dead=!0;let o=n.cleanups.splice(0);for(let r of o)try{r()}catch(i){console.error(i)}};d.push(n);try{return e(t)}finally{d.pop()}}function _r(e){kt.push({fn:e,owner:d[d.length-1],boundary:m?m.current():null}),wn||(wn=!0,queueMicrotask(Rr))}function Rr(){wn=!1;let e=kt.splice(0);for(let{fn:n,owner:t,boundary:o}of e){let r=()=>{if(!t){n();return}if(t.dead||!t.root&&t.disposed)return;let i=U(()=>{});i.disposed=!0,d.push(i);try{n()}finally{d.pop()}for(let s of i.cleanups)Dn(t,s)};o&&m?m.run(o,r):r()}}function Nr(e){let[n,t]=S(void 0),o=!0,r=U(()=>{});x.add(r);let i=()=>{Pn(r.cleanups);for(let p of r.sources)p.delete(r);r.sources.clear(),o=!1,d.push(r);let f;try{f=e()}catch(p){throw o=!0,p}finally{d.pop()}t(f)},s=U(()=>{o&&!r.disposed&&i()});x.add(s),r.mark=()=>{o=!0,!s.queued&&!s.disposed&&(s.queued=!0,w.push(s))},Pe(s);let c=()=>(o&&!r.disposed&&i(),n()),u=vt(),a=()=>{r.disposed||(ge(r),x.delete(r),ge(s),x.delete(s))};return u?u.cleanups.push(a):s.boundaryOwner&&m&&m.cleanup(s.boundaryOwner,a),c}function Or(e,n,t,o){t&&typeof t=="object"&&(o=t,t=void 0);let r=typeof t=="function"?t(n):n,[i,s]=S(r,o);return[i,u=>s(a=>e(a,u))]}function Pr(e){return{current:e}}function Hr(e){return n=>e(n,n.ref||(()=>{}))}var k=je(null,null),C=new Map,R=new Map,q=new Set,N=new Set,Lr=0,Ie=!1,H=null,L=[],j=[],Y=[],Z=new Map,Ot=[];function je(e,n){let t=n&&n.parent!==null?n.scope:n?M():null,o={id:e,parent:n,children:[],hooks:[],disposed:!1,shown:!0,conds:[],slot:null,record:null,scope:t};return n&&he(o,t),o}function Kr(e){Ot.push(e)}function Mr(e){return qe(e).id}function qe(e){return e&&typeof e=="object"&&"hooks"in e?e:k}function ee(e){for(let n=e;n;n=n.parent)if(n.disposed||!n.shown)return!1;return!0}function Pt(e){for(let[n,t]of e.conds){let o=R.get(n);if(o!==void 0&&o!==t)return!1}return!0}function Fr(e,n,t,o){if(e==null){b(null);return}let r=C.get(e);if(!r){let i=n!=null&&C.get(n)||k;r=je(e,i);for(let s=i;s;s=s.parent)s.disposed&&(r.disposed=!0);i.children.push(r),C.set(e,r);for(let[s,c,u]of t||[])r.conds.push([s,c]),R.has(s)||R.set(s,u?c:c==="c"?"a":"c");r.shown=Pt(r),o&&(r.slot=o,q.has(o)&&(r.disposed=!0))}b(r)}function zn(e){let n=qe(J()),t=je(null,n);n.children.push(t);let o=b(t);try{return{value:e(),owner:t}}finally{b(o)}}function B(e){let n=qe(e);if(n===k||n.disposed)return;let t=ee(n),o=[];if(Be(n,t,o),n.parent){let r=n.parent.children,i=r.indexOf(n);i>=0&&r.splice(i,1)}o.length&&(L.push(...o),Vn())}function Be(e,n,t){e.disposed=!0;for(let o of e.hooks){if(o.stop(),N.delete(o),!n){o.mounted&&(o.mounted=!1,o.cleanup=null,Bn(o.epoch));continue}if(o.phase==="passive"){let r=ye(o);r&&t.push(r)}else ne(o)}for(let o of Ot)o(e,e.id);me(e),e.record&&e.record.owner===e&&(e.record.owner=null);for(let o of e.children.slice())Be(o,n&&o.shown,t)}function Dr(e){let n=C.get(e);n&&(B(n),C.delete(e))}function Ir(e,n,t,o,r){let i={id:e,parentId:n,conds:[],slot:o||null,fn:r,owner:null};for(let[s,c,u]of t||[])i.conds.push([s,c]),R.has(s)||R.set(s,u?c:c==="c"?"a":"c");Y.push(i),In(i)&&Lt(i)}function Ht(e){if(e.parentId==null)return k;let n=C.get(e.parentId);if(!n)return k;for(let t=n;t;t=t.parent)if(t.disposed)return null;return n}function In(e){if(e.slot&&q.has(e.slot))return!1;for(let[n,t]of e.conds){let o=R.get(n);if(o!==void 0&&o!==t)return!1}return Ht(e)!==null}function Lt(e){let n=Ht(e)||k,t=je(e.id,n);t.record=e,t.slot=e.slot,n.children.push(t),C.set(e.id,t),e.owner=t;let o=b(t);try{E(e.fn)}finally{b(o)}}function jr(e){if(!q.has(e)){q.add(e);for(let n of Array.from(C.values()))n.slot===e&&B(n)}}function qr(e,n){if(R.get(e)===n)return;R.set(e,n);for(let r of Y)r.owner&&!r.owner.disposed&&!In(r)&&B(r.owner);for(let r of Y)!r.owner&&In(r)&&Lt(r);let t=[];for(let r of C.values())!r.record&&r.conds.some(([i])=>i===e)&&t.push(r);let o=[];for(let r of t){let i=Pt(r);if(i===r.shown)continue;let s=ee(r);r.shown=i;let c=ee(r);s&&!c?Kt(r,o):!s&&c&&Mt(r)}o.length&&(L.push(...o),o=[],Vn()),jt()}function Kt(e,n){for(let t of e.hooks)if(N.delete(t),t.phase==="passive"){let o=ye(t);o&&n.push(o)}else ne(t);for(let t of e.children)t.shown&&!t.disposed&&Kt(t,n)}function Mt(e){for(let n of e.hooks)It(n);for(let n of e.children)n.shown&&!n.disposed&&Mt(n)}function Ft(e,n){if(!e||!n||e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!Object.is(e[t],n[t]))return!1;return!0}function Dt(e){if(e!=null)return Array.isArray(e)?e:Array.from(e)}function It(e){e.dirty=!0,N.add(e),jt()}function jt(){Ie||(Ie=!0,queueMicrotask(()=>{On()||(te(),ke())}))}function Br(e,n,t="passive"){let o=qe(J()),r={owner:o,phase:t,fn:e,deps:n||null,prev:void 0,hasPrev:!1,cleanup:null,mounted:!1,epoch:0,dirty:!1,seq:Lr++,stop:()=>{},scope:o===k?M():o.scope};o.hooks.push(r),!o.disposed&&(r.stop=y(()=>{let i=r.deps?Dt(r.deps()):[];r.hasPrev&&Ft(r.prev,i)||(r.prev=i,r.hasPrev=!0,ee(r.owner)&&It(r))}))}function jn(e,n){if(e.owner.disposed)return;let t;try{t=Le(n,()=>E(e.fn))}catch(o){qt(o,e.owner);return}e.cleanup=typeof t=="function"?t:null,e.mounted=!0,e.epoch=n,Z.set(n,(Z.get(n)||0)+1)}var qn=null;function zr(e){qn=e}function qt(e,n){let t=null;for(let o=n;o&&t===null;o=o.parent)t=o.id;if(!(qn&&qn(e,t)))throw e}function Bt(e,n){try{E(e)}catch(t){qt(t,n)}}function zt(e){if(!e.mounted)return null;e.mounted=!1;let n=e.epoch,t=e.cleanup;return e.cleanup=null,t?()=>{try{Le(n,()=>E(t))}finally{Bn(n)}}:(Bn(n),null)}function Bn(e){let n=(Z.get(e)||1)-1;n>0?Z.set(e,n):Z.delete(e)}function ne(e){let n=zt(e);n&&Bt(n,e.owner)}function ye(e){let n=zt(e);return n?()=>Bt(n,e.owner):null}function Rt(){let e=He();for(let n of Z.keys())n<e&&(e=n);xn(e)}function Vr(e){let n=new Map,t=0,o=r=>{for(let i of r.children)o(i);n.set(r,t++)};for(let r of k.children)o(r);return n.set(k,t++),Array.from(e).sort((r,i)=>{let s=n.get(r.owner)??t,c=n.get(i.owner)??t;return s!==c?s-c:r.seq-i.seq})}var Vt=[];function Gr(e){Vt.push(e)}function Nt(){for(let e of Vt)e()}function Ur(){Ie=!1;let e=He(),n=Cn();if(N.size===0){Nt(),n&&te(),Rt();return}let t=Vr(N).filter(o=>ee(o.owner));N.clear();for(let o of t)o.dirty=!1;Q(!0);try{let o=0;for(;o<t.length;){let i=t[o].owner,s=o;for(;s<t.length&&t[s].owner===i;)s++;for(let c=o;c<s;c++)t[c].phase==="insertion"&&(ne(t[c]),jn(t[c],e));for(let c=o;c<s;c++)t[c].phase==="layout"&&ne(t[c]);o=s}for(let i of t)i.phase==="layout"&&jn(i,e);Nt();let r=!1;for(let i of t){if(i.phase!=="passive")continue;let s=ye(i);s&&L.push(s),j.push([i,e]),r=!0}r&&Vn(),n&&te()}finally{Q(!1)}Rt()}function Vn(){H===null&&(H=setTimeout(te,0))}function te(){H!==null&&(clearTimeout(H),H=null);let e=!1,n,t=o=>{e?typeof console<"u"&&console.error(o):(e=!0,n=o)};for(;L.length||j.length;){let o=L,r=j;L=[],j=[],Q(!0);try{for(let i of o)try{i()}catch(s){t(s)}for(let[i,s]of r)if(ee(i.owner))try{jn(i,s)}catch(c){t(c)}}finally{Q(!1)}}if(e)throw n}function Gt(e,n){let t,o=!1,r;return()=>{let i=Dt(n())||[];return(!o||!Ft(t,i))&&(t=i,o=!0,r=E(e)),r}}function Wr(e){return function(...t){return E(()=>e.apply(this,t))}}function $r(e,n){let t=!0;return Gt(()=>{if(t)return t=!1,e;let o=e;return function(...r){return o.apply(this,r)}},n)}function Xr(e){if(e&&typeof e=="object"){let n=Object.getPrototypeOf(e);if(n===Object.prototype||n===null){let t=[];for(let o of Object.keys(e))o!=="children"&&t.push(e[o]);return t}}return[e]}function Qr(e){let n=[];for(let r of k.children.slice()){if(!e(r.scope))continue;Be(r,r.shown,n);let i=k.children.indexOf(r);i>=0&&k.children.splice(i,1)}let t=[];for(let r of k.hooks){if(!e(r.scope)){t.push(r);continue}if(r.stop(),N.delete(r),r.phase==="passive"){let i=ye(r);i&&n.push(i)}else ne(r)}k.hooks=t;for(let[r,i]of Array.from(C))(i.disposed||e(i.scope))&&C.delete(r);let o=r=>!e(Ln(r));for(let r of Array.from(R.keys()))o(r)||R.delete(r);for(let r of Array.from(q))o(r)||q.delete(r);for(let r=Y.length-1;r>=0;r--)o(Y[r].id)||Y.splice(r,1);for(let r of Array.from(N))r.owner.disposed&&N.delete(r);j=j.filter(([r])=>!r.owner.disposed&&!(r.owner===k&&e(r.scope)));for(let r of n)try{E(r)}catch{}b(null)}function Jr(e){if(e){Qr(e);return}let n=[];for(let o of k.children.slice())Be(o,o.shown,n);for(let o of k.hooks)if(o.stop(),o.phase==="passive"){let r=ye(o);r&&n.push(r)}else ne(o);k.children.length=0,k.hooks.length=0,C.clear(),R.clear(),q.clear(),N.clear(),j=[];let t=L.concat(n);L=[],H!==null&&(clearTimeout(H),H=null);for(let o of t)try{E(o)}catch{}Ie=!1,b(null)}_n(te);Rn(Ur);Nn(Jr);var we=new Set;function Ut(e){let n,t=!1;if(y(()=>{try{e()}catch(o){n=o,t=!0}})(),t)throw n}function ze(e){if(e.on)return;e.on=!0;let n=e.ref;Ut(()=>{if(typeof n=="function"){let t=n(e.el);e.undo=typeof t=="function"?t:()=>n(null)}else if(n&&typeof n=="object")n.current=e.el,e.undo=()=>{n.current=null};else if(e.assign){let t=e.assign;t(e.el),e.undo=()=>t(null)}else e.undo=null})}function Gn(e){if(!e.on)return;e.on=!1;let n=e.undo;e.undo=null,n&&Ut(n)}function Wt(e,n){let t={el:n,ref:e,on:!1,undo:null};return ze(t),()=>Gn(t)}var oe=null;function $t(){oe||(oe=[],queueMicrotask(Un))}function Un(){let e=oe;if(oe=null,!!e)for(let n of e)we.has(n)&&n.el.isConnected&&ze(n)}function ve(e,n,t,o){let r={el:e,ref:n,assign:t,on:!1,undo:null};return we.add(r),o==="defer"&&oe?oe.push(r):(o==="now"||e.isConnected)&&ze(r),()=>{we.delete(r),Gn(r)}}function Ve(e){for(let n of we)n.on&&e.contains(n.el)&&Gn(n)}function Ge(){for(let e of we)!e.on&&e.el.isConnected&&ze(e)}var Yr={doubleclick:"dblclick",focus:"focusin",blur:"focusout"},Zr={dblclick:"doubleclick",focusin:"focus",focusout:"blur"},ei={focusin:"focus",focusout:"blur"},ni=new Set("scroll scrollend load error abort cancel close invalid toggle beforetoggle mouseenter mouseleave pointerenter pointerleave canplay canplaythrough durationchange emptied encrypted ended loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" ")),Zt={change:["change","input","click"],beforeinput:["beforeinput","compositionend"]},ti={preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()},stopPropagation(){this._s=!0,this.nativeEvent.stopPropagation()},isDefaultPrevented(){return this.defaultPrevented},isPropagationStopped(){return!!this._s},persist(){},isPersistent(){return!0}},oi={get(e,n){if(n in e)return e[n];let t=e.nativeEvent,o=t[n];return typeof o=="function"?o.bind(t):o}};function $e(e,n,t){let o=Object.create(ti),r=t===void 0?e.target:t;return r&&r.nodeType===3&&(r=r.parentNode),o.type=n||ei[e.type]||e.type,o.target=r,o.currentTarget=null,o.nativeEvent=e,o.defaultPrevented=e.defaultPrevented,new Proxy(o,oi)}var Wn,Ue=!1;function eo(e,n){try{e(n)}catch(t){Ue||(Ue=!0,Wn=t)}}function no(){if(Ue){let e=Wn;throw Ue=!1,Wn=void 0,e}}function Yn(e,n,t,o,r){let i=[],s=[];for(let a=t;a;a=a.__kpp||a.parentNode){let f=a.__kh;if(!f)continue;let p;o&1&&(p=f[n+"$"])&&i.unshift(a,p),o&2&&(p=f[n])&&s.push(a,p)}if(!i.length&&!s.length)return null;let c=$e(e,r,t),u=i.concat(s);for(let a=0;a<u.length&&!c._s;a+=2)c.currentTarget=u[a],eo(u[a+1],c);return c.currentTarget=null,c}var Xt=new WeakMap,$n=new Set,to=new Set;function ri(){return typeof document>"u"?null:document.getElementById("root")||document.body}function Xn(e,n){let t=Xt.get(e);t||(t=new Set,Xt.set(e,t)),!t.has(n)&&(t.add(n),e.addEventListener(n,ii,!0),e.addEventListener(n,si,!1))}function Qn(e){to.add(e);let n=ri();n&&($n.add(n),Xn(n,e));for(let t of $n)t!==n&&t.isConnected&&Xn(t,e)}function Xe(e){$n.add(e);for(let n of to)Xn(e,n)}function ii(e){oo(e,!0)}function si(e){oo(e,!1)}var We=0;function ci(e){We++;try{return e()}finally{We--}}function oo(e,n){if(We>0)return;let t=n?"__kdc":"__kdb",o=e;if(o[t])return;o[t]=1;let r=e.type,i=e.target;Ke(r,!n,()=>{r!=="change"&&r!=="beforeinput"&&Yn(e,Zr[r]||r,i,n?1:2),n||(r==="change"||r==="input"||r==="click"?di(e):(r==="beforeinput"||r==="compositionend")&&pi(e))}),no()}function ui(e){ro(this,e,!1)}function ai(e){ro(this,e,!0)}function ro(e,n,t){if(We>0)return;let o=e.__kh,r=o&&o[n.type+(t?"$":"")];if(!r)return;let i=$e(n);i.currentTarget=e,Ke(n.type,!0,()=>eo(r,i)),i.currentTarget=null,no()}function Zn(e){let n=e.slice(2),t=!1;return n.length>7&&n.slice(-7)==="Capture"&&!/^(Got|Lost)PointerCapture$/.test(n)&&(n=n.slice(0,-7),t=!0),[n.toLowerCase(),t]}function Se(e,n,t){let[o,r]=Zn(n),i=e,s=i.__kh||(i.__kh={}),c=o+(r?"$":"");if(typeof t!="function"){s[c]=void 0;return}if(s[c]=t,ni.has(o)){let a=i.__kd||(i.__kd={});a[c]||(a[c]=1,e.addEventListener(o,r?ai:ui,r));return}let u=Zt[o];if(u){for(let a of u)Qn(a);o==="change"&&co(e)}else Qn(Yr[o]||o)}function Qe(e){let n=e.querySelectorAll("input[value]");for(let t=0;t<n.length;t++){let o=n[t];if(!io.has(o.type||"text")||!o.value||o.ownerDocument.activeElement===o)continue;let r=o.value;o.value="",o.value=r}}var io=new Set("color date datetime datetime-local email month number password range search tel text time url week".split(" "));function et(e){return e.tagName==="INPUT"&&(e.type==="checkbox"||e.type==="radio")}function so(e){return et(e)?String(e.checked):String(e.value)}function co(e){e.__kv===void 0&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")&&(e.__kv=so(e))}function Jn(e){let n=so(e);return e.__kv===n?!1:(e.__kv=n,!0)}function li(e){if(!e.name||!e.ownerDocument)return[e];let n=[],t=e.ownerDocument.getElementsByName(e.name);for(let o=0;o<t.length;o++){let r=t[o];r.tagName==="INPUT"&&r.type==="radio"&&r.form===e.form&&n.push(r)}return n}function fi(e){let n=e.target;if(!n||!n.tagName)return null;let t=e.type,o=n.tagName;return o==="SELECT"||o==="INPUT"&&n.type==="file"?t==="change"?n:null:et(n)?t==="click"&&Jn(n)?n:null:(o==="TEXTAREA"||o==="INPUT"&&io.has(n.type||"text"))&&t!=="click"&&Jn(n)?n:null}function di(e){let n=fi(e);if(n)if(Yn(e,"change",n,3,"change"),n.type==="radio")for(let t of li(n))Jn(t),Yt(t);else Yt(n)}function pi(e){let n=e;e.type==="beforeinput"&&(n.isComposing||typeof n.data!="string"||n.data==="")||e.type==="compositionend"&&!n.data||Yn(e,"beforeinput",e.target,3,"beforeinput")}function Qt(e,n){e.__kw||(e.__kw=1,console.error(n))}function Jt(e,n,t){let o=e.options;if(e.multiple){let s=new Set((Array.isArray(n)?n:[n]).map(String));for(let c=0;c<o.length;c++){let u=s.has(o[c].value);t?o[c].defaultSelected=u:o[c].selected!==u&&(o[c].selected=u)}return}let r=String(n),i=null;for(let s=0;s<o.length;s++){if(o[s].value===r){t?o[s].defaultSelected=!0:o[s].selected=!0;return}!i&&!o[s].disabled&&(i=o[s])}i&&!t&&(i.selected=!0)}function z(e,n,t){let o=e;switch(n){case"value":{if(t==null)return;if(o.tagName==="SELECT"){Jt(o,t,!1);return}let r=String(t);o.value!==r&&(o.value=r),o.type!=="file"&&!(o.type==="number"&&o.ownerDocument&&o.ownerDocument.activeElement===o)&&o.defaultValue!==r&&(o.defaultValue=r),et(o)||(o.__kv=r);return}case"checked":{if(t==null)return;let r=!!t;o.checked!==r&&(o.checked=r),o.__kv=String(r);return}case"defaultValue":o.tagName==="SELECT"?Jt(o,t,!0):o.defaultValue=t==null?"":String(t);return;case"defaultChecked":o.defaultChecked=!!t;return;default:o[n]=!!t}}function Yt(e){let n=e.__kc;n&&(De(),n.value&&z(e,"value",n.value()),n.checked&&z(e,"checked",n.checked()))}function Je(e,n,t){let o=e,r=n==="value"||n==="checked";if(r){(o.__kc||(o.__kc={}))[n]=t;for(let c of Zt.change)Qn(c);co(o)}let i,s=!1;return y(()=>{let c=t();if(r){let u=c!=null;c===null&&n==="value"?Qt(o,"`value` prop on `"+o.tagName.toLowerCase()+"` should not be null. Use an empty string to clear it or `undefined` for an uncontrolled field."):i!==void 0&&i!==u&&Qt(o,"A component is changing "+(i?"a controlled":"an uncontrolled")+" input to be "+(u?"controlled":"uncontrolled")+". Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),i=u}z(o,n,c),!s&&n==="value"&&o.tagName==="TEXTAREA"&&o.ownerDocument.activeElement!==o&&o.setSelectionRange(0,0),s=!0})}var uo="template[data-krate-portal]",Ye=new Map,Ze=new Set;function gi(e,n){Ye.set(e,n)}function hi(e){return!!e&&typeof e=="object"&&(e.nodeType===1||e.nodeType===11)}function mi(e){let n=e.getAttribute("data-krate-portal")||"",t=Ye.get(n);if(t){let r=null;try{r=t()}catch{r=null}return hi(r)?r:null}let o=e.getAttribute("data-krate-portal-target");if(!o||o==="body")return document.body;try{return document.querySelector(o)}catch{return null}}function nt(e){if(e.__kpn||!e.isConnected)return;let n=mi(e);if(!n)return;let t=Array.from(e.content.childNodes),o=document.createDocumentFragment();for(let i of t)i.__kpp=e,o.appendChild(i);n.appendChild(o),e.__kpn=t,Ze.add(e);let r=document.getElementById("root");n.nodeType===1&&!(r&&r.contains(n))&&Xe(n),e.__kpd||(e.__kpd=!0,nn(e,()=>en(e,!0)))}function en(e,n){let t=e.__kpn;if(t){e.__kpn=void 0,Ze.delete(e);for(let o of t)n?o.parentNode&&o.parentNode.removeChild(o):e.content.appendChild(o),o.__kpp=void 0}}function tt(e){let n=[];return e.matches?.(uo)&&n.push(e),e.querySelectorAll(uo).forEach(t=>n.push(t)),n}function ki(e){if(!(typeof document>"u"))for(let n of tt(e||document))nt(n)}function ot(e){return tt(e)}function rt(e){for(let n of e)nt(n)}function it(e){for(let n of tt(e))en(n)}function ao(e,n){let t=e.slice(),o=new Set;for(;t.length;)t.shift().querySelectorAll("template").forEach(i=>{if(o.has(i))return;o.add(i);let s=i;s.hasAttribute("data-krate-portal")&&n(s.content),t.push(s.content)})}function yi(e,n){for(let o of Ze)for(let r of o.__kpn||[]){if(r.nodeType!==1)continue;let i=r;if(i.matches(e))return i;let s=i.querySelector(e);if(s)return s}let t=null;return ao(n,o=>{t||(t=o.querySelector(e))}),t}function wi(){let e=new Set;for(let n of Array.from(Ze))n.isConnected?e.add(n.getAttribute("data-krate-portal")||""):en(n,!0);for(let n of Array.from(Ye.keys()))e.has(n)||Ye.delete(n)}var re=new Set,fo=new WeakMap;function vi(){return Array.from(re)}function Si(){let e=new Set,n=!0;for(;n;){n=!1;for(let t of re){if(e.has(t))continue;let o=fo.get(t);if(!o)continue;let r=o.getRootNode();(o.isConnected||e.has(r))&&(e.add(t),n=!0)}}for(let t of Array.from(re))e.has(t)||re.delete(t)}function lo(e){let n="/"+(e.nodeValue||"");for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.nodeValue===n)return t;return null}function Ti(e,n,t){let o=e,r=n?"c":"a",i=o.__krateCond;if(!i){let l=t?t.getAttribute("data-kb"):null;i={shown:l==="c"?"a":l==="a"?"c":r,other:null,tpl:t,end:lo(e)},o.__krateCond=i}if(i.shown===r)return;let s=e.parentNode;if(!s)return;(!i.end||i.end.parentNode!==s)&&(i.end=lo(e));let c=i.end,u=document.createDocumentFragment(),a=e.nextSibling;for(;a&&a!==c;){let l=a.nextSibling;u.appendChild(a),a=l}Ve(u),it(u);let f=i.other;if(!f&&(f=document.createDocumentFragment(),i.tpl&&(f.appendChild(i.tpl.content),i.tpl.getAttribute("data-kns")==="svg"))){let l=f.firstChild;if(l&&l.nodeType===1){for(;l.firstChild;)f.insertBefore(l.firstChild,l);f.removeChild(l)}}re.delete(f);let p=f.querySelector("[autofocus]");Qe(f);let _=ot(f);s.insertBefore(f,c),rt(_),i.other=u,re.add(u),fo.set(u,e),i.shown=r,Ge(),p&&(p.removeAttribute("autofocus"),p.focus())}var xi={href:!0,src:!0,action:!0,formaction:!0,"xlink:href":!0},bi=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,po="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')";function st(e,n){return xi[e.toLowerCase()]&&bi.test(n)?po:n}var Ei="__krate_cfg__";function go(){let e=globalThis;if(e.__KRATE_CFG__)return e.__KRATE_CFG__;let n=e.document,t=n&&typeof n.getElementById=="function"?n.getElementById(Ei):null;if(t)try{let o=JSON.parse(t.textContent||"{}");if(o&&typeof o=="object")return e.__KRATE_CFG__=o,o}catch{}return{}}function Ci(){let e=go(),n=e&&e.basePath||"";return!n||n==="/"?"":"/"+n.replace(/^\/+|\/+$/g,"")}function ho(e){let n=Ci();return n&&e.charCodeAt(0)===47&&e.charCodeAt(1)!==47?n+e:e}var Te=new WeakMap;function A(e,n){nn(e,n)}function nn(e,n){let t=Te.get(e);t||(t=[],Te.set(e,t)),t.push(n)}function wo(e,n){let t=()=>B(n);if(typeof DocumentFragment<"u"&&e instanceof DocumentFragment)for(let o=0;o<e.childNodes.length;o++)A(e.childNodes[o],t);else if(typeof Node<"u"&&e instanceof Node)A(e,t);else if(Array.isArray(e))for(let o of e)wo(o,n);else lt(e)&&(e.u||(e.u=[])).push(n)}function vo(e,n){if(e.u)for(let t of e.u)A(n,()=>B(t))}function Ai(e,n,t){let o=!0,r=y(()=>{let i=ve(e,n?n():void 0,t,o?"defer":void 0);o=!1,I(i)});return A(e,r),r}function se(e){let n=Te.get(e);if(n){for(let t of n)t();n.length=0}for(let t=0;t<e.childNodes.length;t++)se(e.childNodes[t])}function _i(e){let n=e.nextSibling;for(;n;){if(n.nodeType===8&&n.nodeValue==="k")return n;n=n.nextSibling}return null}function So(e,n){let t=e.parentNode;if(!t)return;let o=e.nextSibling;for(;o&&o!==n;){let r=o.nextSibling;se(o),t.removeChild(o),o=r}}function Ri(e,n,t){let o=_i(t);o?(So(t,o),ct(e,n,o)):ct(e,n,null)}function ct(e,n,t){if(!(n==null||n===!1||n===!0)){if(typeof n=="string"||typeof n=="number"||typeof n=="bigint")e.insertBefore(document.createTextNode(String(n)),t);else if(n instanceof Node)e.insertBefore(n,t);else if(Array.isArray(n))for(let o of n)ct(e,o,t)}}var Ni={htmlFor:"for"},Oi=new Set(["animation-iteration-count","aspect-ratio","border-image-outset","border-image-slice","border-image-width","box-flex","box-flex-group","box-ordinal-group","column-count","columns","flex","flex-grow","flex-positive","flex-shrink","flex-negative","flex-order","grid-area","grid-row","grid-row-end","grid-row-span","grid-row-start","grid-column","grid-column-end","grid-column-span","grid-column-start","font-weight","line-clamp","line-height","opacity","order","orphans","scale","tab-size","widows","z-index","zoom","fill-opacity","flood-opacity","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity","stroke-width"]);function Pi(e){if(e.startsWith("--"))return e;let n=e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase());return n.startsWith("ms-")?"-"+n:n}var mo=new WeakMap;function To(e,n){let t=e.style;if(!t)return;let o=new Set;for(let i of Object.keys(n)){let s=n[i];if(s==null||typeof s=="boolean"||s==="")continue;let c=Pi(i),u=c.replace(/^-(webkit|moz|ms|o)-/,""),a=typeof s=="number"&&s!==0&&!c.startsWith("--")&&!Oi.has(u)?s+"px":String(s);t.setProperty(c,a),o.add(c)}let r=mo.get(e);if(r)for(let i of r)o.has(i)||t.removeProperty(i);mo.set(e,o)}function xo(e,n,t){if(e.localName.indexOf("-")<1||n.indexOf("-")>=0)return!1;let o=typeof t=="object"&&t!==null||typeof t=="function";if(!o&&!(n in e))return!1;e[n]=t;let r=typeof customElements<"u"?customElements:null;return o&&r&&!r.get(e.localName)&&typeof r.whenDefined=="function"&&r.whenDefined(e.localName).then(()=>{let i=e;delete i[n],i[n]=t}),!0}function tn(e,n,t){if(!(e.localName.indexOf("-")>0&&n!=="class"&&n!=="className"&&n!=="style"&&n!=="ref"&&n!=="key"&&n!=="children"&&!n.startsWith("on")&&xo(e,n,t))){if(n==="class"||n==="className"){let o=t===!1||t===null||t===void 0?"":String(t);if(e.getAttribute("class")!==o){if(o===""&&!e.hasAttribute("class")&&typeof t!="string")return;e.setAttribute("class",o)}}else if(n==="style")typeof t=="string"?e.getAttribute("style")!==t&&e.setAttribute("style",t):t&&typeof t=="object"?To(e,t):(t==null||t===!1)&&e.removeAttribute("style");else if(n.startsWith("on")&&typeof t=="function")Se(e,n,t);else if(n==="value"||n==="checked"||n==="selected"||n==="defaultValue"||n==="defaultChecked")z(e,n,t);else if(n==="ref"){let o=ve(e,t,void 0,"now");A(e,o),I(o)}else if(!(n==="key"||n==="children"||n==="dangerouslySetInnerHTML")){let o=Ni[n]||n,r=/^(aria|data)-/.test(o);if(t==null||typeof t=="function"||typeof t=="symbol"||t===!1&&!r)e.hasAttribute(o)&&e.removeAttribute(o);else{let i=t===!0&&!r?"":st(o,String(t));e.getAttribute(o)!==i&&e.setAttribute(o,i)}}}}function bo(e){return"data-krate-no-base"in e?!1:"data-krate-link"in e||"data-krate-external"in e}function at(e){return typeof e=="string"?ho(e):typeof e=="function"?()=>at(e()):e}function Eo(e,n){for(let o in n){let r=o==="href"&&bo(n)?at(n[o]):n[o];typeof r=="function"&&(o==="value"||o==="checked")?A(e,Je(e,o,r)):typeof r=="function"&&!o.startsWith("on")&&o!=="ref"?A(e,y(()=>tn(e,o,r()))):tn(e,o,r)}let t=n.dangerouslySetInnerHTML;if(t&&typeof t=="object"&&t.__html!=null){let o=String(t.__html);e.innerHTML!==o&&(e.innerHTML=o)}}var ko=new WeakMap;function Hi(e,n){A(e,y(()=>{let t=n()||{},o=new Set;for(let i of Object.keys(t)){if(i==="children"||i==="key"||i==="dangerouslySetInnerHTML")continue;o.add(i);let s=i==="href"&&(bo(t)||e.hasAttribute("data-krate-link")&&!("data-krate-no-base"in t));tn(e,i,s?at(t[i]):t[i])}let r=ko.get(e);if(r)for(let i of r)o.has(i)||(i.startsWith("on")?Se(e,i,null):tn(e,i,void 0));ko.set(e,o)}))}function Co(e,n){if(e===void 0)return n();let t=b(e);try{return n()}finally{b(t)}}var V=0;function Ao(e){let n=V;V=n+1;try{return e()}finally{V=n}}function _o(e){let n=V;V=0;try{return e()}finally{V=n}}function lt(e){return!!e&&typeof e=="object"&&e.__kv===1}function Ro(e){return!!e&&typeof e=="object"&&e.__ka===1}var on="http://www.w3.org/2000/svg",Li=new Set(["svg","g","defs","symbol","use","switch","desc","metadata","path","circle","ellipse","line","polygon","polyline","rect","text","tspan","textPath","image","foreignObject","marker","mask","pattern","clipPath","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","animate","animateMotion","animateTransform","set","mpath","view"]);function Ki(e){return Li.has(e)?document.createElementNS(on,e):document.createElement(e)}function Mi(e){let n=e;return n.namespaceURI===on&&n.localName!=="foreignObject"}function yo(e,n){let t=n;if(t.nodeType!==1||t.namespaceURI===on||!Mi(e))return n;let o=document.createElementNS(on,t.localName);for(let r of Array.from(t.attributes))o.setAttribute(r.name,r.value);for(;t.firstChild;)o.appendChild(t.firstChild);return o}function No(e,n,t){let o=Ki(e);if(n&&Eo(o,n),!n||!n.dangerouslySetInnerHTML)for(let r of t)xe(o,r);return o}function Oo(e){let n=Co(e.o,()=>_o(()=>No(e.tag,e.props,e.children)));return vo(e,n),n}function ft(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"}function dt(e){return e==null||typeof e=="boolean"?"":String(e)}function xe(e,n){if(!(n==null||n===!1||n===!0)){if(Array.isArray(n)){for(let t of n)xe(e,t);return}if(typeof n=="function"){Ii(e,n,null);return}if(lt(n)){e.appendChild(yo(e,Oo(n)));return}if(Ro(n)){e.appendChild(n.mount());return}e.appendChild(n instanceof Node?yo(e,n):document.createTextNode(String(n)))}}function Fi(e,n){let t=Te.get(e);if(t){Te.delete(e);for(let o of t)A(n,o)}}function ut(e,n){let t=e.parentNode;if(!t)return;let o=e.nextSibling;for(;o&&o!==n;){let r=o.nextSibling;se(o),t.removeChild(o),o=r}}function Di(e){if(!e.text)return;let n=e.text,t=n.parentNode;e.start=document.createComment(""),e.end=document.createComment(""),t.insertBefore(e.start,n),t.insertBefore(e.end,n.nextSibling),Fi(n,e.start),t.removeChild(n),e.text=null}function Po(e,n){if(ft(n)){let o=dt(n);if(e.text){e.text.data!==o&&(e.text.data=o);return}ut(e.start,e.end),o!==""&&e.end.parentNode.insertBefore(document.createTextNode(o),e.end);return}Di(e),ut(e.start,e.end);let t=document.createDocumentFragment();xe(t,n),e.end.parentNode.insertBefore(t,e.end)}function Ii(e,n,t){let o={text:null,start:null,end:null},r=!0,i=y(()=>{let s=n();if(!r){Po(o,s);return}if(r=!1,ft(s)){o.text=document.createTextNode(dt(s)),e.insertBefore(o.text,t);return}o.start=document.createComment(""),o.end=document.createComment(""),e.insertBefore(o.start,t);let c=document.createDocumentFragment();xe(c,s),e.insertBefore(c,t),e.insertBefore(o.end,t)});A(o.text||o.start,i)}function Ho(e){for(;e.next&&e.next.nodeType===8;)e.next=e.next.nextSibling}function ie(e,n){e.parent.insertBefore(n,e.next)}function Lo(e,n){Ho(e);let t=e.next;if(n!==""&&t&&t.nodeType===3){let r=t;return r.data.length>n.length&&r.data.startsWith(n)?r.splitText(n.length):r.data!==n&&(r.data=n),e.next=r.nextSibling,r}let o=document.createTextNode(n);return ie(e,o),o}function Ko(e,n){let t=e.next;for(;t&&t!==n;){let o=t.nextSibling;se(t),e.parent.removeChild(t),t=o}e.next=n}function ji(e,n){Ho(n);let t=n.next;if(t&&t.nodeType===1&&t.localName.toLowerCase()===e.tag.toLowerCase()){n.next=t.nextSibling;let o=t;vo(e,o),Co(e.o,()=>{if(e.props&&Eo(o,e.props),!e.props||!e.props.dangerouslySetInnerHTML){let r={parent:o,next:o.firstChild};for(let i of e.children)rn(i,r);Ko(r,null)}});return}ie(n,Oo(e))}function qi(e,n){let t={text:null,start:null,end:null},o=!0,r=y(()=>{if(!o){Po(t,e());return}o=!1;let i=Ao(e);if(ft(i)){t.text=Lo(n,dt(i));return}t.start=document.createComment(""),ie(n,t.start),rn(i,n),t.end=document.createComment(""),ie(n,t.end)});A(t.text||t.start,r)}function rn(e,n){if(!(e==null||typeof e=="boolean")){if(Array.isArray(e)){for(let t of e)rn(t,n);return}if(typeof e=="function"){qi(e,n);return}if(lt(e)){ji(e,n);return}if(Ro(e)){e.adopt(n);return}if(e instanceof Node){ie(n,e);return}Lo(n,String(e))}}function Bi(e,n,...t){if(typeof e=="function"){let o=n||{};(t.length>0||!("children"in o))&&(o.children=t);let{value:r,owner:i}=zn(()=>e(o));return wo(r,i),r}return V>0?{__kv:1,tag:e,props:n,children:t,o:J()}:No(e,n,t)}function Mo(e){if(typeof e=="string"){let n=document.querySelector(e);if(!n)throw new Error(`Container "${e}" not found`);return n}return e}function zi(e,n){let t=Mo(n),o=!1;y(()=>{o||(o=!0,t.appendChild(e()))})}function Vi(e,n){let t=Mo(n);if(t.childNodes.length===0){t.appendChild(e());return}let o=e();o&&se(o)}function Fo(){return globalThis.__krateSuspenseHook}function Gi(e,n){let[t,o]=S(void 0),[r,i]=S(!0),[s,c]=S(void 0),[u,a]=S("unresolved"),[f,p]=S(0),_,l=Fo()?.current()??null,g=null,ue=null,be=()=>typeof e=="function"?e():e,Io=()=>{let T=jo();return g=T,T.then(()=>{g===T&&(g=null)}),T},jo=async()=>{_&&_.abort(),_=new AbortController;let T=_,qo=be();a(f()>0?"refreshing":"loading"),i(!0),c(void 0);try{let Ee=await n(qo,{signal:T.signal});T.signal.aborted||(o(()=>Ee),a("ready"))}catch(Ee){Ee?.name!=="AbortError"&&!T.signal.aborted&&(c(Ee),a("error"))}finally{T.signal.aborted||i(!1)}};y(()=>{typeof e=="function"&&e.length===0&&e(),f(),Io(),I(()=>{_&&(_.abort(),_=void 0)})});let pt=function(){return l&&g&&ue!==g&&(ue=g,Fo()?.suspend(l,g)),t()};return Object.defineProperties(pt,{loading:{get:()=>r()},error:{get:()=>s()},state:{get:()=>u()}}),[pt,{mutate:T=>{o(T)},refetch:()=>{p(T=>T+1)}}]}function Ui(e){return Fe(e)?e():e}var ce=null,Wi=0,Do=typeof TextEncoder<"u"?new TextEncoder:null;function $i(e){return e.replace(/[^A-Za-z0-9_.:$-]/gu,n=>(Do?Array.from(Do.encode(n)):[n.charCodeAt(0)&255]).map(o=>"%"+o.toString(16).toUpperCase().padStart(2,"0")).join(""))}function Xi(e,n){if(!e)return n();let t=ce;ce={prefix:$i(e),n:0};try{return n()}finally{ce=t}}function Qi(){return ce?"krate-"+ce.prefix+"-u"+ce.n++:"krate_u"+Wi++}function sn(e){return!!document.head.querySelector(e)}function cn(e,n,t){if(typeof document>"u"||!n)return;let o='link[rel="'+e+'"][href="'+(window.CSS&&CSS.escape?CSS.escape(n):n)+'"]';if(sn(o))return;let r=document.createElement("link");r.rel=e,r.href=n,t&&(t.as&&(r.as=t.as),t.crossOrigin!==void 0&&(r.crossOrigin=t.crossOrigin),t.integrity&&(r.integrity=t.integrity),t.type&&(r.type=t.type),t.media&&(r.media=t.media),t.nonce&&(r.nonce=t.nonce),t.fetchPriority&&r.setAttribute("fetchpriority",t.fetchPriority),t.referrerPolicy&&(r.referrerPolicy=t.referrerPolicy),t.imageSrcSet&&r.setAttribute("imagesrcset",t.imageSrcSet),t.imageSizes&&r.setAttribute("imagesizes",t.imageSizes)),document.head.appendChild(r)}function Ji(e,n){cn("preload",e,n)}function Yi(e,n){cn("modulepreload",e,n)}function Zi(e,n){cn("preconnect",e,n)}function es(e){cn("dns-prefetch",e)}function ns(e,n){if(typeof document>"u"||!e)return;if(n&&n.as==="script"){if(sn('script[src="'+e+'"]'))return;let o=document.createElement("script");o.src=e,o.async=!0,n.crossOrigin!==void 0&&(o.crossOrigin=n.crossOrigin),n.integrity&&(o.integrity=n.integrity),n.nonce&&(o.nonce=n.nonce),document.head.appendChild(o);return}if(sn('link[rel="stylesheet"][href="'+e+'"]'))return;let t=document.createElement("link");t.rel="stylesheet",t.href=e,n&&n.crossOrigin!==void 0&&(t.crossOrigin=n.crossOrigin),n&&n.integrity&&(t.integrity=n.integrity),n&&n.media&&(t.media=n.media),document.head.appendChild(t)}function ts(e,n){if(typeof document>"u"||!e||sn('script[type="module"][src="'+e+'"]'))return;let t=document.createElement("script");t.type="module",t.src=e,n&&n.crossOrigin!==void 0&&(t.crossOrigin=n.crossOrigin),n&&n.integrity&&(t.integrity=n.integrity),document.head.appendChild(t)}return Wo(os);})();
|
|
1
|
+
var __krate_exports=(()=>{var cn=Object.defineProperty;var Yo=Object.getOwnPropertyDescriptor;var Zo=Object.getOwnPropertyNames;var er=Object.prototype.hasOwnProperty;var nr=(e,n)=>{for(var t in n)cn(e,t,{get:n[t],enumerable:!0})},tr=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Zo(n))!er.call(e,r)&&r!==t&&cn(e,r,{get:()=>n[r],enumerable:!(o=Yo(n,r))||o.enumerable});return e};var or=e=>tr(cn({},"__esModule",{value:!0}),e);var ws={};nr(ws,{BLOCKED_URL:()=>ho,KRATE_CONTEXT:()=>ht,__krate_useId:()=>ss,adoptValue:()=>sn,afterFlush:()=>Sr,appendChild:()=>Te,clearBetween:()=>ct,clearNodes:()=>To,clearPersisted:()=>ar,createCSSChoice:()=>Er,createCSSFlags:()=>Ar,createCSSGroup:()=>_r,createCSSRange:()=>Rr,createCSSStack:()=>Nr,createCSSToggle:()=>Cr,createCallbackDeps:()=>ri,createContext:()=>an,createEffect:()=>y,createEffectDeps:()=>Yr,createEffectEvent:()=>oi,createMemo:()=>jr,createMemoDeps:()=>Wt,createReducer:()=>qr,createResource:()=>ns,createRoot:()=>Fr,createScope:()=>ir,createScopeFlags:()=>sr,createSignal:()=>v,disposeAll:()=>Ct,disposeNode:()=>se,flushPassive:()=>te,flushSync:()=>ys,forwardRef:()=>zr,h:()=>Yi,hydrate:()=>es,insert:()=>Ii,insertAt:()=>ie,isDerivedGetter:()=>De,isSignalGetter:()=>Hr,krateApplyStyle:()=>bo,krateAttachRef:()=>Se,krateBindRef:()=>Fi,krateCommitSnapshot:()=>vt,krateCommitting:()=>Q,krateCondActivity:()=>Jr,krateCondDetached:()=>Ni,krateCondReset:()=>Oi,krateCondSwap:()=>Pi,krateContextRows:()=>cr,krateControl:()=>Ye,krateCurrentScope:()=>K,krateCustomProp:()=>Eo,krateDepsOf:()=>ii,krateDerived:()=>Or,krateDisposeExcept:()=>Tr,krateDisposeOwner:()=>me,krateDisposeScopes:()=>br,krateEnterScope:()=>pr,krateEpoch:()=>Le,krateEventName:()=>Yn,krateEventRoot:()=>Qe,krateFlushSync:()=>Ie,krateForgetOwner:()=>$r,krateGetOwner:()=>J,krateHintPreconnect:()=>Uo,krateHintPrefetchDNS:()=>Go,krateHintPreinit:()=>Wo,krateHintPreinitModule:()=>$o,krateHintPreload:()=>zo,krateHintPreloadModule:()=>Vo,krateHintTags:()=>fs,krateHook:()=>Pr,krateHookState:()=>fr,krateIsDiscrete:()=>wr,krateKeepScopes:()=>hr,krateLeaveScope:()=>gr,krateMount:()=>Xr,krateMountFields:()=>Je,krateMountPortals:()=>Ai,krateMuteEvents:()=>ki,krateOn:()=>ve,krateOnAfterFlush:()=>_n,krateOnBeforeFlush:()=>An,krateOnDispose:()=>Rn,krateOnHookError:()=>Zr,krateOnLayoutCommit:()=>ni,krateOnSettle:()=>Mr,krateOnUnmount:()=>Ur,krateOwner:()=>Wr,krateOwnerId:()=>Gr,krateParam:()=>ts,kratePendingFlush:()=>Nn,kratePortalFind:()=>_i,kratePortalMount:()=>et,kratePortalReset:()=>Ri,kratePortalScan:()=>fo,kratePortalTarget:()=>bi,kratePortalUnmount:()=>nn,kratePortalsEnter:()=>ot,kratePortalsIn:()=>tt,kratePortalsLeave:()=>rt,kratePruneSnapshots:()=>xn,krateReadAt:()=>Me,krateRefsEnter:()=>Ge,krateRefsFlush:()=>Un,krateRefsHold:()=>Qt,krateRefsLeave:()=>Ue,krateRenderPhase:()=>mr,krateRequestFlush:()=>Kr,krateRunEvent:()=>Ke,krateSanitizeAttr:()=>it,krateScopeOfId:()=>Hn,krateSetControl:()=>z,krateSetOwner:()=>b,krateSetRef:()=>Xt,krateSlotReplaced:()=>Qr,krateSpread:()=>zi,krateSynthetic:()=>Xe,krateTagOwner:()=>he,krateTakeSyncLane:()=>En,krateTrackNode:()=>tn,krateTransitionWrites:()=>yr,krateUnmount:()=>B,krateWithContexts:()=>mt,krateWithIdScope:()=>is,krateWithOwner:()=>Bn,mount:()=>Zi,onCleanup:()=>I,onMount:()=>Dr,preconnect:()=>gs,prefetchDNS:()=>hs,preinit:()=>ps,preinitModule:()=>ks,preload:()=>ds,preloadModule:()=>ms,readDurableState:()=>pn,readPersisted:()=>gn,removeRest:()=>Fo,resetContexts:()=>Ae,resolvePersist:()=>dn,runAfterFlush:()=>ke,sameValue:()=>xr,setOwnerHooks:()=>dr,subscribePersist:()=>mn,trackEffect:()=>A,untrack:()=>E,useRef:()=>Br,withDOM:()=>No,withVNodes:()=>Ro,writePersisted:()=>hn});var rr=0,ht=Symbol.for("krate.context"),ae=class{constructor(n){this.get=n}};function un(e){if(e instanceof Node)return e;let n=document.createDocumentFragment();if(Array.isArray(e))for(let t of e)n.appendChild(un(t));else e!=null&&e!==!1&&e!==!0&&n.appendChild(document.createTextNode(String(e)));return n}var O=new Map;function Ae(){for(let[e,n]of O)if(n.length>0){let t=n[0];O.set(e,[t])}}function ir(){return an({})}function sr(){return an({})}function an(e){let n=rr++;O.set(n,[e]);let t=()=>{let c=O.get(n);if(c&&c.length>0){let u=c[c.length-1];return u instanceof ae?u.get():u}return e},o=()=>{let c=O.get(n),u=c&&c.length>0?c[c.length-1]:e;return u instanceof ae?()=>u.get():()=>u},r=c=>{let u=O.get(n)||[e];u.push(c.value),O.set(n,u);let a=document.createElement("div");a.style.display="contents";let f=c.children;if(f)for(let p of Array.isArray(f)?f:[f])p instanceof Node?a.appendChild(p):p!=null&&a.appendChild(document.createTextNode(String(p)));return u.pop(),u.length===0&&u.push(e),a},i=c=>{let u=c.children;return Array.isArray(u)&&(u=u.find(a=>typeof a=="function")),un(typeof u=="function"?u(t()):null)},s=(c=>r(c));return s.$$typeof=ht,s.id=n,s.defaultValue=e,s.Provider=r,r.__kctxOf=s,s.Consumer=i,s.useContext=t,s.use=t,s.useContextLive=o,s}function cr(e,n){let t=(...o)=>mt(e,()=>n(...o));return t.__kctx=e,t}function mt(e,n){let t=[];for(let[o,r]of e){let i=O.get(o.id);i&&(i.push(new ae(r)),t.push(i))}try{return n()}finally{for(let o=t.length-1;o>=0;o--)t[o].pop()}}function ur(){let e=new Map;return{getItem:n=>e.has(n)?e.get(n):null,setItem:(n,t)=>{e.set(n,t)},removeItem:n=>{e.delete(n)}}}var ln=ur();function yt(){return typeof window<"u"}function fn(e){if(e&&typeof e=="object")return e;if(!yt())return ln;try{return e==="session"?window.sessionStorage:e==="memory"?ln:window.localStorage}catch{return ln}}function dn(e){let n=typeof e=="string"?{key:e}:e;if(!n.key)throw new Error("[krate] createSignal persist requires a key");let t=n.store??"local";return{key:n.key,store:t,serialize:n.serialize??(o=>JSON.stringify(o)),deserialize:n.deserialize??(o=>JSON.parse(o)),sync:n.sync??t==="local"}}function pn(e,n){let o=globalThis.__KRATE_STATE__;if(!o||!Object.prototype.hasOwnProperty.call(o,e))return{found:!1};let r=o[e];if(typeof r=="string")try{return{found:!0,value:n(r)}}catch{return{found:!0,value:r}}return{found:!0,value:r}}function gn(e){let n=fn(e.store),t;try{t=n.getItem(e.key)}catch{return{found:!1}}if(t==null)return{found:!1};try{return{found:!0,value:e.deserialize(t)}}catch{return{found:!1}}}function hn(e,n){let t=fn(e.store);try{t.setItem(e.key,e.serialize(n))}catch{}}function ar(e){let n=fn(e.store);try{n.removeItem(e.key)}catch{}}var _e=new Map,kt=!1;function lr(){kt||!yt()||(kt=!0,window.addEventListener("storage",e=>{if(e.key===null)return;let n=_e.get(e.key);if(n)for(let t of n)t(e.newValue)}))}function mn(e,n){if(!e.sync)return()=>{};let t=_e.get(e.key)??new Set;return t.add(n),_e.set(e.key,t),lr(),()=>{t.delete(n),t.size===0&&_e.delete(e.key)}}var fr={react:!0},d=[],wt=[],yn=!1,m=null;function dr(e){m=e}var Oe=[],T=new Set,le=[],U=null,St=new Set,M=new Map;function pr(e){return St.has(e)?!1:(U=e,h=null,!0)}function gr(){U=null,h=null}function K(){let e=d[d.length-1];return e?e.scope:U!==null?U:h!==null&&M.has(h)?M.get(h)??null:null}function hr(e){St=new Set(e)}function he(e,n){e!==null&&!M.has(e)&&M.set(e,n)}var w=[],fe=!1;function G(e){let n=K(),t={fn:e,cleanups:[],disposed:!1,sources:new Set,running:!1,rerun:!1,queued:!1,owner:h,boundaryOwner:m?m.current():null,scope:n};if(h!==null){he(h,n);let o=F.get(h);o||F.set(h,o=new Set),o.add(t)}return t}var F=new Map,W=new Map;function me(e){let n=F.get(e);if(F.delete(e),n)for(let o of n)Pn(o),T.delete(o);let t=W.get(e);if(W.delete(e),M.delete(e),t)for(let o of t)try{o()}catch{}}var D=0,S=null,Re=0,$=new Set,de=new Set;function mr(e){D++;let n=S;S=null;try{return e()}finally{S=n,D--}}function vt(){Re++;for(let e of $)e.commit(Re);return $.clear(),Re}function Le(){return Re}function Me(e,n){let t=S;S=e;try{return n()}finally{S=t}}function xn(e){for(let n of de)n.prune(e)||de.delete(n)}var Tn=new Set("auxclick beforeinput blur cancel change click close compositionend compositionstart compositionupdate contextmenu copy cut dblclick dragend dragstart drop focusin focusout input invalid keydown keypress keyup mousedown mouseup paste pause play pointercancel pointerdown pointerup ratechange reset resize seeked select submit touchcancel touchend touchstart volumechange focus".split(" ")),bn=0,pe=!1,Ne=0;function kr(){if(Ne>0)return!0;let e=typeof window<"u"?window.event:void 0;return!!e&&Tn.has(e.type)}var Pe=0;function yr(e){Pe++;try{return e()}finally{Pe--}}function wr(e){return Tn.has(e)}function Ke(e,n,t){if(!Tn.has(e)){t();return}Ne++;try{t()}finally{Ne--,n&&Ne===0&&wn===0&&bn===0&&(w.length>0||pe)&&Ie()}}function Q(e){bn+=e?1:-1}function En(){let e=pe;return pe=!1,e}function xt(){return d[d.length-1]||null}var h=null;function J(){return h}function b(e){let n=h;return h=e,n}var Tt=[],bt=[],Cn=[];function An(e){Tt.push(e)}function _n(e){bt.push(e)}function Rn(e){Cn.push(e)}function Nn(){return w.length>0}function E(e){d.push(null);try{return e()}finally{d.pop()}}function Sr(e){Oe.push(e),Mn()}function vr(){if(Oe.length===0)return;let e=Oe.splice(0);for(let n of e)n()}function xr(e,n){return Object.is(e,n)}function On(e){let n=!1,t;for(let o of e.splice(0))try{o()}catch(r){n?typeof console<"u"&&console.error(r):(n=!0,t=r)}if(n)throw t}function ge(e){if(!e.disposed){e.disposed=!0,e.owner!==null&&F.get(e.owner)?.delete(e);for(let n of e.sources)n.delete(e);e.sources.clear(),On(e.cleanups)}}function Pn(e){try{ge(e)}catch(n){typeof console<"u"&&console.error(n)}}function Tr(e){if(e.length===0){Ct();return}let n=new Set(e);Et(t=>!(t!=null&&n.has(t)),!0)}function br(e){if(e.length===0)return;let n=new Set(e);Et(t=>t!=null&&n.has(t),!1)}function Hn(e){if(e.charCodeAt(0)!==95)return null;let n=e.indexOf("_",1);return n>0?e.slice(0,n+1):null}function Et(e,n){for(let s of Cn)try{s(e)}catch(c){typeof console<"u"&&console.error(c)}for(let s of Array.from(T))e(s.scope)&&(Pn(s),T.delete(s));let t=[];for(let s of le.splice(0)){if(!e(s.scope)){t.push(s);continue}try{s.fn()}catch{}}le.push(...t);let o=new Set([...W.keys(),...F.keys()]);for(let s of o)e(M.get(s)??null)&&me(s);if(!n)return;let r=globalThis,i=r.__krate_island_cleanups;if(Array.isArray(i)){r.__krate_island_cleanups=[];for(let s of i)try{s()}catch{}}U=null,Ae()}function Ct(){U=null;for(let t of Cn)try{t(null)}catch(o){typeof console<"u"&&console.error(o)}for(let t of T)Pn(t);T.clear();for(let t of le)try{t.fn()}catch{}le.length=0;for(let t of Array.from(W.keys()))me(t);F.clear(),M.clear(),$.clear(),de.clear(),S=null;let e=globalThis,n=e.__krate_island_cleanups;if(Array.isArray(n)){e.__krate_island_cleanups=[];for(let t of n)try{t()}catch{}}w.length=0,Oe.length=0,fe=!1,P=0,X++,pe=!1,Ae()}function Er(e,n){return Fe(v(e))}function Cr(e,n){return Fe(v(e))}function Ar(e,n){let t={};for(let i of e){let[s]=v(!1);t[i]=s}let r=[t,(i,s)=>{}];return r.trigger=i=>({"data-krate-scope":"trigger",value:i}),r.panel=i=>({"data-krate-scope":"panel",value:i}),r.close=()=>({"data-krate-scope":"close"}),r}function _r(e,n){return Fe(v(e))}function Rr(e,n){return Fe(v(e))}function Fe(e){let n=e;return n.trigger=t=>({"data-krate-scope":"trigger",value:t}),n.panel=t=>({"data-krate-scope":"panel",value:t}),n.close=()=>({"data-krate-scope":"close"}),n.current=()=>e[0](),n}function Nr(e,n){let t=()=>e[0];return[{top:t,peek:t},{push:o=>{},pop:()=>{},clear:()=>{}}]}function v(e,n){let t=e,o=null;if(n?.persist){o=dn(n.persist);let l=pn(o.key,o.deserialize);if(l.found)t=l.value;else{let g=gn(o);g.found&&(t=g.value)}}let r=new Set,i=!!n?.react,s=t,c=null,u=i?{commit(l){Object.is(s,t)||(c||(c=[[0,s]]),c.push([l,t]),s=t,de.add(u))},prune(l){if(!c)return!1;for(;c.length>1&&c[1][0]<=l;)c.shift();return c.length===1?(c=null,!1):!0}}:null,a=l=>{if(!c)return s;for(let g=c.length-1;g>=0;g--)if(c[g][0]<=l)return c[g][1];return c[0][1]},f=()=>{let l=d[d.length-1];if(l&&!l.disposed&&(r.add(l),l.sources.add(r)),i){if(S!==null)return a(S);if(D===0)return s}return t},p=(l=!1)=>At(r,l),_=l=>{let g=typeof l=="function"?l(t):l;Object.is(g,t)||(t=g,o&&hn(o,t),u&&$.add(u),p(i))};if(o&&o.sync){let l=o,g=mn(l,ue=>{if(ue!==null)try{let Ee=l.deserialize(ue);Object.is(Ee,t)||(t=Ee,p())}catch{}});I(g)}return Ln.add(f),[f,_]}function At(e,n=!1){let t=Array.from(e);for(let o of t){if(o.disposed){e.delete(o);continue}if(o.mark){o.mark(n);continue}if(o.running){o.rerun=!0;continue}o.queued||(o.queued=!0,w.push(o))}Mn(n)}var _t=new WeakSet;function Or(e,n){let t,o=!0,r=new Set,i=G(()=>{});i.mark=u=>{o||(o=!0,At(r,u))},T.add(i);let s=()=>{let u=d[d.length-1];if(u&&!u.disposed&&(r.add(u),u.sources.add(r)),(D===0||S!==null)&&($.size>0||S!==null&&de.size>0))return E(e);if(o&&!i.disposed){for(let a of i.sources)a.delete(i);i.sources.clear(),o=!1,d.push(i);try{n&&n(),t=e()}catch(a){throw o=!0,a}finally{d.pop()}}else if(i.disposed)return E(e);return t},c=d[d.length-1];return c&&c.cleanups.push(()=>{ge(i),T.delete(i)}),_t.add(s),Ln.add(s),s}function De(e){return typeof e=="function"&&_t.has(e)}function Pr(e){return De(e)?e:()=>e}var Ln=new WeakSet;function Hr(e){return typeof e=="function"&&Ln.has(e)}var P=0,X=0;function Mn(e=!1){let n=Pe===0&&kr();n&&(pe=!0);let o=!(e||Pe>0)||n||bn>0||D>0||typeof setTimeout!="function";if(P===1||!o&&P===2)return;fe=!0;let r=++X,i=()=>{r===X&&Kn()};o?(P=1,queueMicrotask(i)):(P=2,setTimeout(i,0))}var wn=0;function Kn(){wn++;try{Lr()}finally{wn--}}function Lr(){fe=!1,P=0,X++;let e=!1,n,t=r=>{e?typeof console<"u"&&console.error(r):(e=!0,n=r)};for(let r of Tt)r();let o=0;for(;w.length>0&&o<Rt;o++){let r=w.splice(0);Sn=r;for(let i of r)if(!i.disposed){i.queued=!1,i.rerun=!1;try{He(i)}catch(s){t(s)}if(i.rerun&&!i.disposed){i.rerun=!1;try{He(i)}catch(s){t(s)}}}}if(w.length>0)try{vn()}catch(r){t(r)}if(w.length===0&&(P=0,fe=!1,X++),w.length===0){for(let r of Nt)try{r()}catch(i){t(i)}if(w.length>0){if(kn>=50)try{vn()}catch(r){throw t(r),n}kn++;try{Kn()}catch(r){t(r)}finally{kn--}if(e)throw n;return}try{ke()}catch(r){t(r)}}if(e)throw n}var Rt=100,Sn=[];function vn(){let e=w.splice(0);for(let r of e)r.queued=!1;fe=!1,P=0,X++;let n=e.length>0?e:Sn;Sn=[];let t=Array.from(new Set(n.map(r=>r.fn.name||"anonymous effect"))).slice(0,3).join(", "),o=new Error("Maximum update depth exceeded. An effect keeps writing state that re-runs itself or another effect ("+t+"). Make the write conditional or remove the dependency that changes on every run.");for(let r of n)if(r.boundaryOwner&&m&&m.error(r.boundaryOwner,o))return;throw o}var Nt=[],kn=0;function Mr(e){Nt.push(e)}function Kr(){Mn()}function ke(){$.size>0&&vt(),typeof document<"u"&&document.activeElement;for(let e of bt)e();vr()}function Ie(){if(w.length===0){ke();return}let e=0;for(;w.length>0;)e++>=Rt&&vn(),Kn()}function He(e){e.running=!0;let n=!1,t=h;h=e.owner,D++;let o=S;S=null;try{On(e.cleanups);for(let i of e.sources)i.delete(e);e.sources.clear(),d.push(e),n=!0;let r=e.fn();typeof r=="function"&&e.cleanups.push(r)}catch(r){if(!(e.boundaryOwner&&m&&m.error(e.boundaryOwner,r)))throw r}finally{S=o,D--,h=t,n&&d.pop(),e.running=!1}}function y(e){let n=G(e);T.add(n);let t=d[d.length-1],o=()=>{ge(n),T.delete(n)};return n.boundaryOwner&&m&&m.cleanup(n.boundaryOwner,o),He(n),t&&!t.disposed?t.cleanups.push(o):t&&t.root&&Fn(t,o),o}function I(e){let n=xt();if(n){Fn(n,e);return}let t=m?m.current():null;if(t&&m)m.cleanup(t,e);else if(h!==null){he(h,K());let o=W.get(h);o||W.set(h,o=[]),o.push(e)}else le.push({fn:e,scope:K()})}function Fn(e,n){if(e.dead){n();return}e.cleanups.push(n)}function Fr(e){let n=G(()=>{});n.disposed=!0,n.root=!0;let t=()=>{if(n.dead)return;n.dead=!0;let o=n.cleanups.splice(0);for(let r of o)try{r()}catch(i){console.error(i)}};d.push(n);try{return e(t)}finally{d.pop()}}function Dr(e){wt.push({fn:e,owner:d[d.length-1],boundary:m?m.current():null}),yn||(yn=!0,queueMicrotask(Ir))}function Ir(){yn=!1;let e=wt.splice(0);for(let{fn:n,owner:t,boundary:o}of e){let r=()=>{if(!t){n();return}if(t.dead||!t.root&&t.disposed)return;let i=G(()=>{});i.disposed=!0,d.push(i);try{n()}finally{d.pop()}for(let s of i.cleanups)Fn(t,s)};o&&m?m.run(o,r):r()}}function jr(e){let[n,t]=v(void 0),o=!0,r=G(()=>{});T.add(r);let i=()=>{On(r.cleanups);for(let p of r.sources)p.delete(r);r.sources.clear(),o=!1,d.push(r);let f;try{f=e()}catch(p){throw o=!0,p}finally{d.pop()}t(f)},s=G(()=>{o&&!r.disposed&&i()});T.add(s),r.mark=()=>{o=!0,!s.queued&&!s.disposed&&(s.queued=!0,w.push(s))},He(s);let c=()=>(o&&!r.disposed&&i(),n()),u=xt(),a=()=>{r.disposed||(ge(r),T.delete(r),ge(s),T.delete(s))};return u?u.cleanups.push(a):s.boundaryOwner&&m&&m.cleanup(s.boundaryOwner,a),c}function qr(e,n,t,o){t&&typeof t=="object"&&(o=t,t=void 0);let r=typeof t=="function"?t(n):n,[i,s]=v(r,o);return[i,u=>s(a=>e(a,u))]}function Br(e){return{current:e}}function zr(e){return n=>e(n,n.ref||(()=>{}))}var k=qe(null,null),C=new Map,R=new Map,q=new Set,N=new Set,Vr=0,je=!1,H=null,L=[],j=[],Y=[],Z=new Map,Ht=[];function qe(e,n){let t=n&&n.parent!==null?n.scope:n?K():null,o={id:e,parent:n,children:[],hooks:[],disposed:!1,shown:!0,conds:[],slot:null,record:null,scope:t};return n&&he(o,t),o}function Ur(e){Ht.push(e)}function Gr(e){return Be(e).id}function Be(e){return e&&typeof e=="object"&&"hooks"in e?e:k}function ee(e){for(let n=e;n;n=n.parent)if(n.disposed||!n.shown)return!1;return!0}function Lt(e){for(let[n,t]of e.conds){let o=R.get(n);if(o!==void 0&&o!==t)return!1}return!0}function Wr(e,n,t,o){if(e==null){b(null);return}let r=C.get(e);if(!r){let i=n!=null&&C.get(n)||k;r=qe(e,i);for(let s=i;s;s=s.parent)s.disposed&&(r.disposed=!0);i.children.push(r),C.set(e,r);for(let[s,c,u]of t||[])r.conds.push([s,c]),R.has(s)||R.set(s,u?c:c==="c"?"a":"c");r.shown=Lt(r),o&&(r.slot=o,q.has(o)&&(r.disposed=!0))}b(r)}function Bn(e){let n=Be(J()),t=qe(null,n);n.children.push(t);let o=b(t);try{return{value:e(),owner:t}}finally{b(o)}}function B(e){let n=Be(e);if(n===k||n.disposed)return;let t=ee(n),o=[];if(ze(n,t,o),n.parent){let r=n.parent.children,i=r.indexOf(n);i>=0&&r.splice(i,1)}o.length&&(L.push(...o),zn())}function ze(e,n,t){e.disposed=!0;for(let o of e.hooks){if(o.stop(),N.delete(o),!n){o.mounted&&(o.mounted=!1,o.cleanup=null,qn(o.epoch));continue}if(o.phase==="passive"){let r=ye(o);r&&t.push(r)}else ne(o)}for(let o of Ht)o(e,e.id);me(e),e.record&&e.record.owner===e&&(e.record.owner=null);for(let o of e.children.slice())ze(o,n&&o.shown,t)}function $r(e){let n=C.get(e);n&&(B(n),C.delete(e))}function Xr(e,n,t,o,r){let i={id:e,parentId:n,conds:[],slot:o||null,fn:r,owner:null};for(let[s,c,u]of t||[])i.conds.push([s,c]),R.has(s)||R.set(s,u?c:c==="c"?"a":"c");Y.push(i),Dn(i)&&Kt(i)}function Mt(e){if(e.parentId==null)return k;let n=C.get(e.parentId);if(!n)return k;for(let t=n;t;t=t.parent)if(t.disposed)return null;return n}function Dn(e){if(e.slot&&q.has(e.slot))return!1;for(let[n,t]of e.conds){let o=R.get(n);if(o!==void 0&&o!==t)return!1}return Mt(e)!==null}function Kt(e){let n=Mt(e)||k,t=qe(e.id,n);t.record=e,t.slot=e.slot,n.children.push(t),C.set(e.id,t),e.owner=t;let o=b(t);try{E(e.fn)}finally{b(o)}}function Qr(e){if(!q.has(e)){q.add(e);for(let n of Array.from(C.values()))n.slot===e&&B(n)}}function Jr(e,n){if(R.get(e)===n)return;R.set(e,n);for(let r of Y)r.owner&&!r.owner.disposed&&!Dn(r)&&B(r.owner);for(let r of Y)!r.owner&&Dn(r)&&Kt(r);let t=[];for(let r of C.values())!r.record&&r.conds.some(([i])=>i===e)&&t.push(r);let o=[];for(let r of t){let i=Lt(r);if(i===r.shown)continue;let s=ee(r);r.shown=i;let c=ee(r);s&&!c?Ft(r,o):!s&&c&&Dt(r)}o.length&&(L.push(...o),o=[],zn()),Bt()}function Ft(e,n){for(let t of e.hooks)if(N.delete(t),t.phase==="passive"){let o=ye(t);o&&n.push(o)}else ne(t);for(let t of e.children)t.shown&&!t.disposed&&Ft(t,n)}function Dt(e){for(let n of e.hooks)qt(n);for(let n of e.children)n.shown&&!n.disposed&&Dt(n)}function It(e,n){if(!e||!n||e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!Object.is(e[t],n[t]))return!1;return!0}function jt(e){if(e!=null)return Array.isArray(e)?e:Array.from(e)}function qt(e){e.dirty=!0,N.add(e),Bt()}function Bt(){je||(je=!0,queueMicrotask(()=>{Nn()||(te(),ke())}))}function Yr(e,n,t="passive"){let o=Be(J()),r={owner:o,phase:t,fn:e,deps:n||null,prev:void 0,hasPrev:!1,cleanup:null,mounted:!1,epoch:0,dirty:!1,seq:Vr++,stop:()=>{},scope:o===k?K():o.scope};o.hooks.push(r),!o.disposed&&(r.stop=y(()=>{let i=r.deps?jt(r.deps()):[];r.hasPrev&&It(r.prev,i)||(r.prev=i,r.hasPrev=!0,ee(r.owner)&&qt(r))}))}function In(e,n){if(e.owner.disposed)return;let t;try{t=Me(n,()=>E(e.fn))}catch(o){zt(o,e.owner);return}e.cleanup=typeof t=="function"?t:null,e.mounted=!0,e.epoch=n,Z.set(n,(Z.get(n)||0)+1)}var jn=null;function Zr(e){jn=e}function zt(e,n){let t=null;for(let o=n;o&&t===null;o=o.parent)t=o.id;if(!(jn&&jn(e,t)))throw e}function Vt(e,n){try{E(e)}catch(t){zt(t,n)}}function Ut(e){if(!e.mounted)return null;e.mounted=!1;let n=e.epoch,t=e.cleanup;return e.cleanup=null,t?()=>{try{Me(n,()=>E(t))}finally{qn(n)}}:(qn(n),null)}function qn(e){let n=(Z.get(e)||1)-1;n>0?Z.set(e,n):Z.delete(e)}function ne(e){let n=Ut(e);n&&Vt(n,e.owner)}function ye(e){let n=Ut(e);return n?()=>Vt(n,e.owner):null}function Ot(){let e=Le();for(let n of Z.keys())n<e&&(e=n);xn(e)}function ei(e){let n=new Map,t=0,o=r=>{for(let i of r.children)o(i);n.set(r,t++)};for(let r of k.children)o(r);return n.set(k,t++),Array.from(e).sort((r,i)=>{let s=n.get(r.owner)??t,c=n.get(i.owner)??t;return s!==c?s-c:r.seq-i.seq})}var Gt=[];function ni(e){Gt.push(e)}function Pt(){for(let e of Gt)e()}function ti(){je=!1;let e=Le(),n=En();if(N.size===0){Pt(),n&&te(),Ot();return}let t=ei(N).filter(o=>ee(o.owner));N.clear();for(let o of t)o.dirty=!1;Q(!0);try{let o=0;for(;o<t.length;){let i=t[o].owner,s=o;for(;s<t.length&&t[s].owner===i;)s++;for(let c=o;c<s;c++)t[c].phase==="insertion"&&(ne(t[c]),In(t[c],e));for(let c=o;c<s;c++)t[c].phase==="layout"&&ne(t[c]);o=s}for(let i of t)i.phase==="layout"&&In(i,e);Pt();let r=!1;for(let i of t){if(i.phase!=="passive")continue;let s=ye(i);s&&L.push(s),j.push([i,e]),r=!0}r&&zn(),n&&te()}finally{Q(!1)}Ot()}function zn(){H===null&&(H=setTimeout(te,0))}function te(){H!==null&&(clearTimeout(H),H=null);let e=!1,n,t=o=>{e?typeof console<"u"&&console.error(o):(e=!0,n=o)};for(;L.length||j.length;){let o=L,r=j;L=[],j=[],Q(!0);try{for(let i of o)try{i()}catch(s){t(s)}for(let[i,s]of r)if(ee(i.owner))try{In(i,s)}catch(c){t(c)}}finally{Q(!1)}}if(e)throw n}function Wt(e,n){let t,o=!1,r;return()=>{let i=jt(n())||[];return(!o||!It(t,i))&&(t=i,o=!0,r=E(e)),r}}function oi(e){return function(...t){return E(()=>e.apply(this,t))}}function ri(e,n){let t=!0;return Wt(()=>{if(t)return t=!1,e;let o=e;return function(...r){return o.apply(this,r)}},n)}function ii(e){if(e&&typeof e=="object"){let n=Object.getPrototypeOf(e);if(n===Object.prototype||n===null){let t=[];for(let o of Object.keys(e))o!=="children"&&t.push(e[o]);return t}}return[e]}function si(e){let n=[];for(let r of k.children.slice()){if(!e(r.scope))continue;ze(r,r.shown,n);let i=k.children.indexOf(r);i>=0&&k.children.splice(i,1)}let t=[];for(let r of k.hooks){if(!e(r.scope)){t.push(r);continue}if(r.stop(),N.delete(r),r.phase==="passive"){let i=ye(r);i&&n.push(i)}else ne(r)}k.hooks=t;for(let[r,i]of Array.from(C))(i.disposed||e(i.scope))&&C.delete(r);let o=r=>!e(Hn(r));for(let r of Array.from(R.keys()))o(r)||R.delete(r);for(let r of Array.from(q))o(r)||q.delete(r);for(let r=Y.length-1;r>=0;r--)o(Y[r].id)||Y.splice(r,1);for(let r of Array.from(N))r.owner.disposed&&N.delete(r);j=j.filter(([r])=>!r.owner.disposed&&!(r.owner===k&&e(r.scope)));for(let r of n)try{E(r)}catch{}b(null)}function ci(e){if(e){si(e);return}let n=[];for(let o of k.children.slice())ze(o,o.shown,n);for(let o of k.hooks)if(o.stop(),o.phase==="passive"){let r=ye(o);r&&n.push(r)}else ne(o);k.children.length=0,k.hooks.length=0,C.clear(),R.clear(),q.clear(),N.clear(),j=[];let t=L.concat(n);L=[],H!==null&&(clearTimeout(H),H=null);for(let o of t)try{E(o)}catch{}je=!1,b(null)}An(te);_n(ti);Rn(ci);var we=new Set;function $t(e){let n,t=!1;if(y(()=>{try{e()}catch(o){n=o,t=!0}})(),t)throw n}function Ve(e){if(e.on)return;e.on=!0;let n=e.ref;$t(()=>{if(typeof n=="function"){let t=n(e.el);e.undo=typeof t=="function"?t:()=>n(null)}else if(n&&typeof n=="object")n.current=e.el,e.undo=()=>{n.current=null};else if(e.assign){let t=e.assign;t(e.el),e.undo=()=>t(null)}else e.undo=null})}function Vn(e){if(!e.on)return;e.on=!1;let n=e.undo;e.undo=null,n&&$t(n)}function Xt(e,n){let t={el:n,ref:e,on:!1,undo:null};return Ve(t),()=>Vn(t)}var oe=null;function Qt(){oe||(oe=[],queueMicrotask(Un))}function Un(){let e=oe;if(oe=null,!!e)for(let n of e)we.has(n)&&n.el.isConnected&&Ve(n)}function Se(e,n,t,o){let r={el:e,ref:n,assign:t,on:!1,undo:null};return we.add(r),o==="defer"&&oe?oe.push(r):(o==="now"||e.isConnected)&&Ve(r),()=>{we.delete(r),Vn(r)}}function Ue(e){for(let n of we)n.on&&e.contains(n.el)&&Vn(n)}function Ge(){for(let e of we)!e.on&&e.el.isConnected&&Ve(e)}var ui={doubleclick:"dblclick",focus:"focusin",blur:"focusout"},ai={dblclick:"doubleclick",focusin:"focus",focusout:"blur"},li={focusin:"focus",focusout:"blur"},fi=new Set("scroll scrollend load error abort cancel close invalid toggle beforetoggle mouseenter mouseleave pointerenter pointerleave canplay canplaythrough durationchange emptied encrypted ended loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" ")),no={change:["change","input","click"],beforeinput:["beforeinput","compositionend"]},di={preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()},stopPropagation(){this._s=!0,this.nativeEvent.stopPropagation()},isDefaultPrevented(){return this.defaultPrevented},isPropagationStopped(){return!!this._s},persist(){},isPersistent(){return!0}},pi={get(e,n){if(n in e)return e[n];let t=e.nativeEvent,o=t[n];return typeof o=="function"?o.bind(t):o}};function Xe(e,n,t){let o=Object.create(di),r=t===void 0?e.target:t;return r&&r.nodeType===3&&(r=r.parentNode),o.type=n||li[e.type]||e.type,o.target=r,o.currentTarget=null,o.nativeEvent=e,o.defaultPrevented=e.defaultPrevented,new Proxy(o,pi)}var Gn,We=!1;function to(e,n){try{e(n)}catch(t){We||(We=!0,Gn=t)}}function oo(){if(We){let e=Gn;throw We=!1,Gn=void 0,e}}function Jn(e,n,t,o,r){let i=[],s=[];for(let a=t;a;a=a.__kpp||a.parentNode){let f=a.__kh;if(!f)continue;let p;o&1&&(p=f[n+"$"])&&i.unshift(a,p),o&2&&(p=f[n])&&s.push(a,p)}if(!i.length&&!s.length)return null;let c=Xe(e,r,t),u=i.concat(s);for(let a=0;a<u.length&&!c._s;a+=2)c.currentTarget=u[a],to(u[a+1],c);return c.currentTarget=null,c}var Jt=new WeakMap,Wn=new Set,ro=new Set;function gi(){return typeof document>"u"?null:document.getElementById("root")||document.body}function $n(e,n){let t=Jt.get(e);t||(t=new Set,Jt.set(e,t)),!t.has(n)&&(t.add(n),e.addEventListener(n,hi,!0),e.addEventListener(n,mi,!1))}function Xn(e){ro.add(e);let n=gi();n&&(Wn.add(n),$n(n,e));for(let t of Wn)t!==n&&t.isConnected&&$n(t,e)}function Qe(e){Wn.add(e);for(let n of ro)$n(e,n)}function hi(e){io(e,!0)}function mi(e){io(e,!1)}var $e=0;function ki(e){$e++;try{return e()}finally{$e--}}function io(e,n){if($e>0)return;let t=n?"__kdc":"__kdb",o=e;if(o[t])return;o[t]=1;let r=e.type,i=e.target;Ke(r,!n,()=>{r!=="change"&&r!=="beforeinput"&&Jn(e,ai[r]||r,i,n?1:2),n||(r==="change"||r==="input"||r==="click"?xi(e):(r==="beforeinput"||r==="compositionend")&&Ti(e))}),oo()}function yi(e){so(this,e,!1)}function wi(e){so(this,e,!0)}function so(e,n,t){if($e>0)return;let o=e.__kh,r=o&&o[n.type+(t?"$":"")];if(!r)return;let i=Xe(n);i.currentTarget=e,Ke(n.type,!0,()=>to(r,i)),i.currentTarget=null,oo()}function Yn(e){let n=e.slice(2),t=!1;return n.length>7&&n.slice(-7)==="Capture"&&!/^(Got|Lost)PointerCapture$/.test(n)&&(n=n.slice(0,-7),t=!0),[n.toLowerCase(),t]}function ve(e,n,t){let[o,r]=Yn(n),i=e,s=i.__kh||(i.__kh={}),c=o+(r?"$":"");if(typeof t!="function"){s[c]=void 0;return}if(s[c]=t,fi.has(o)){let a=i.__kd||(i.__kd={});a[c]||(a[c]=1,e.addEventListener(o,r?wi:yi,r));return}let u=no[o];if(u){for(let a of u)Xn(a);o==="change"&&ao(e)}else Xn(ui[o]||o)}function Je(e){let n=e.querySelectorAll("input[value]");for(let t=0;t<n.length;t++){let o=n[t];if(!co.has(o.type||"text")||!o.value||o.ownerDocument.activeElement===o)continue;let r=o.value;o.value="",o.value=r}}var co=new Set("color date datetime datetime-local email month number password range search tel text time url week".split(" "));function Zn(e){return e.tagName==="INPUT"&&(e.type==="checkbox"||e.type==="radio")}function uo(e){return Zn(e)?String(e.checked):String(e.value)}function ao(e){e.__kv===void 0&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")&&(e.__kv=uo(e))}function Qn(e){let n=uo(e);return e.__kv===n?!1:(e.__kv=n,!0)}function Si(e){if(!e.name||!e.ownerDocument)return[e];let n=[],t=e.ownerDocument.getElementsByName(e.name);for(let o=0;o<t.length;o++){let r=t[o];r.tagName==="INPUT"&&r.type==="radio"&&r.form===e.form&&n.push(r)}return n}function vi(e){let n=e.target;if(!n||!n.tagName)return null;let t=e.type,o=n.tagName;return o==="SELECT"||o==="INPUT"&&n.type==="file"?t==="change"?n:null:Zn(n)?t==="click"&&Qn(n)?n:null:(o==="TEXTAREA"||o==="INPUT"&&co.has(n.type||"text"))&&t!=="click"&&Qn(n)?n:null}function xi(e){let n=vi(e);if(n)if(Jn(e,"change",n,3,"change"),n.type==="radio")for(let t of Si(n))Qn(t),eo(t);else eo(n)}function Ti(e){let n=e;e.type==="beforeinput"&&(n.isComposing||typeof n.data!="string"||n.data==="")||e.type==="compositionend"&&!n.data||Jn(e,"beforeinput",e.target,3,"beforeinput")}function Yt(e,n){e.__kw||(e.__kw=1,console.error(n))}function Zt(e,n,t){let o=e.options;if(e.multiple){let s=new Set((Array.isArray(n)?n:[n]).map(String));for(let c=0;c<o.length;c++){let u=s.has(o[c].value);t?o[c].defaultSelected=u:o[c].selected!==u&&(o[c].selected=u)}return}let r=String(n),i=null;for(let s=0;s<o.length;s++){if(o[s].value===r){t?o[s].defaultSelected=!0:o[s].selected=!0;return}!i&&!o[s].disabled&&(i=o[s])}i&&!t&&(i.selected=!0)}function z(e,n,t){let o=e;switch(n){case"value":{if(t==null)return;if(o.tagName==="SELECT"){Zt(o,t,!1);return}let r=String(t);o.value!==r&&(o.value=r),o.type!=="file"&&!(o.type==="number"&&o.ownerDocument&&o.ownerDocument.activeElement===o)&&o.defaultValue!==r&&(o.defaultValue=r),Zn(o)||(o.__kv=r);return}case"checked":{if(t==null)return;let r=!!t;o.checked!==r&&(o.checked=r),o.__kv=String(r);return}case"defaultValue":o.tagName==="SELECT"?Zt(o,t,!0):o.defaultValue=t==null?"":String(t);return;case"defaultChecked":o.defaultChecked=!!t;return;default:o[n]=!!t}}function eo(e){let n=e.__kc;n&&(Ie(),n.value&&z(e,"value",n.value()),n.checked&&z(e,"checked",n.checked()))}function Ye(e,n,t){let o=e,r=n==="value"||n==="checked";if(r){(o.__kc||(o.__kc={}))[n]=t;for(let c of no.change)Xn(c);ao(o)}let i,s=!1;return y(()=>{let c=t();if(r){let u=c!=null;c===null&&n==="value"?Yt(o,"`value` prop on `"+o.tagName.toLowerCase()+"` should not be null. Use an empty string to clear it or `undefined` for an uncontrolled field."):i!==void 0&&i!==u&&Yt(o,"A component is changing "+(i?"a controlled":"an uncontrolled")+" input to be "+(u?"controlled":"uncontrolled")+". Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),i=u}z(o,n,c),!s&&n==="value"&&o.tagName==="TEXTAREA"&&o.ownerDocument.activeElement!==o&&o.setSelectionRange(0,0),s=!0})}var lo="template[data-krate-portal]",Ze=new Map,en=new Set;function bi(e,n){Ze.set(e,n)}function Ei(e){return!!e&&typeof e=="object"&&(e.nodeType===1||e.nodeType===11)}function Ci(e){let n=e.getAttribute("data-krate-portal")||"",t=Ze.get(n);if(t){let r=null;try{r=t()}catch{r=null}return Ei(r)?r:null}let o=e.getAttribute("data-krate-portal-target");if(!o||o==="body")return document.body;try{return document.querySelector(o)}catch{return null}}function et(e){if(e.__kpn||!e.isConnected)return;let n=Ci(e);if(!n)return;let t=Array.from(e.content.childNodes),o=document.createDocumentFragment();for(let i of t)i.__kpp=e,o.appendChild(i);n.appendChild(o),e.__kpn=t,en.add(e);let r=document.getElementById("root");n.nodeType===1&&!(r&&r.contains(n))&&Qe(n),e.__kpd||(e.__kpd=!0,tn(e,()=>nn(e,!0)))}function nn(e,n){let t=e.__kpn;if(t){e.__kpn=void 0,en.delete(e);for(let o of t)n?o.parentNode&&o.parentNode.removeChild(o):e.content.appendChild(o),o.__kpp=void 0}}function nt(e){let n=[];return e.matches?.(lo)&&n.push(e),e.querySelectorAll(lo).forEach(t=>n.push(t)),n}function Ai(e){if(!(typeof document>"u"))for(let n of nt(e||document))et(n)}function tt(e){return nt(e)}function ot(e){for(let n of e)et(n)}function rt(e){for(let n of nt(e))nn(n)}function fo(e,n){let t=e.slice(),o=new Set;for(;t.length;)t.shift().querySelectorAll("template").forEach(i=>{if(o.has(i))return;o.add(i);let s=i;s.hasAttribute("data-krate-portal")&&n(s.content),t.push(s.content)})}function _i(e,n){for(let o of en)for(let r of o.__kpn||[]){if(r.nodeType!==1)continue;let i=r;if(i.matches(e))return i;let s=i.querySelector(e);if(s)return s}let t=null;return fo(n,o=>{t||(t=o.querySelector(e))}),t}function Ri(){let e=new Set;for(let n of Array.from(en))n.isConnected?e.add(n.getAttribute("data-krate-portal")||""):nn(n,!0);for(let n of Array.from(Ze.keys()))e.has(n)||Ze.delete(n)}var re=new Set,go=new WeakMap;function Ni(){return Array.from(re)}function Oi(){let e=new Set,n=!0;for(;n;){n=!1;for(let t of re){if(e.has(t))continue;let o=go.get(t);if(!o)continue;let r=o.getRootNode();(o.isConnected||e.has(r))&&(e.add(t),n=!0)}}for(let t of Array.from(re))e.has(t)||re.delete(t)}function po(e){let n="/"+(e.nodeValue||"");for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.nodeValue===n)return t;return null}function Pi(e,n,t){let o=e,r=n?"c":"a",i=o.__krateCond;if(!i){let l=t?t.getAttribute("data-kb"):null;i={shown:l==="c"?"a":l==="a"?"c":r,other:null,tpl:t,end:po(e)},o.__krateCond=i}if(i.shown===r)return;let s=e.parentNode;if(!s)return;(!i.end||i.end.parentNode!==s)&&(i.end=po(e));let c=i.end,u=document.createDocumentFragment(),a=e.nextSibling;for(;a&&a!==c;){let l=a.nextSibling;u.appendChild(a),a=l}Ue(u),rt(u);let f=i.other;if(!f&&(f=document.createDocumentFragment(),i.tpl&&(f.appendChild(i.tpl.content),i.tpl.getAttribute("data-kns")==="svg"))){let l=f.firstChild;if(l&&l.nodeType===1){for(;l.firstChild;)f.insertBefore(l.firstChild,l);f.removeChild(l)}}re.delete(f);let p=f.querySelector("[autofocus]");Je(f);let _=tt(f);s.insertBefore(f,c),ot(_),i.other=u,re.add(u),go.set(u,e),i.shown=r,Ge(),p&&(p.removeAttribute("autofocus"),p.focus())}var Hi={href:!0,src:!0,action:!0,formaction:!0,"xlink:href":!0},Li=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,ho="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')";function it(e,n){return Hi[e.toLowerCase()]&&Li.test(n)?ho:n}var Mi="__krate_cfg__";function mo(){let e=globalThis;if(e.__KRATE_CFG__)return e.__KRATE_CFG__;let n=e.document,t=n&&typeof n.getElementById=="function"?n.getElementById(Mi):null;if(t)try{let o=JSON.parse(t.textContent||"{}");if(o&&typeof o=="object")return e.__KRATE_CFG__=o,o}catch{}return{}}function Ki(){let e=mo(),n=e&&e.basePath||"";return!n||n==="/"?"":"/"+n.replace(/^\/+|\/+$/g,"")}function ko(e){let n=Ki();return n&&e.charCodeAt(0)===47&&e.charCodeAt(1)!==47?n+e:e}var xe=new WeakMap;function A(e,n){tn(e,n)}function tn(e,n){let t=xe.get(e);t||(t=[],xe.set(e,t)),t.push(n)}function vo(e,n){let t=()=>B(n);if(typeof DocumentFragment<"u"&&e instanceof DocumentFragment)for(let o=0;o<e.childNodes.length;o++)A(e.childNodes[o],t);else if(typeof Node<"u"&&e instanceof Node)A(e,t);else if(Array.isArray(e))for(let o of e)vo(o,n);else at(e)&&(e.u||(e.u=[])).push(n)}function xo(e,n){if(e.u)for(let t of e.u)A(n,()=>B(t))}function Fi(e,n,t){let o=!0,r=y(()=>{let i=Se(e,n?n():void 0,t,o?"defer":void 0);o=!1,I(i)});return A(e,r),r}function se(e){let n=xe.get(e);if(n){for(let t of n)t();n.length=0}for(let t=0;t<e.childNodes.length;t++)se(e.childNodes[t])}function Di(e){let n=e.nextSibling;for(;n;){if(n.nodeType===8&&n.nodeValue==="k")return n;n=n.nextSibling}return null}function To(e,n){let t=e.parentNode;if(!t)return;let o=e.nextSibling;for(;o&&o!==n;){let r=o.nextSibling;se(o),t.removeChild(o),o=r}}function Ii(e,n,t){let o=Di(t);o?(To(t,o),st(e,n,o)):st(e,n,null)}function st(e,n,t){if(!(n==null||n===!1||n===!0)){if(typeof n=="string"||typeof n=="number"||typeof n=="bigint")e.insertBefore(document.createTextNode(String(n)),t);else if(n instanceof Node)e.insertBefore(n,t);else if(Array.isArray(n))for(let o of n)st(e,o,t)}}var ji={htmlFor:"for"},qi=new Set(["animation-iteration-count","aspect-ratio","border-image-outset","border-image-slice","border-image-width","box-flex","box-flex-group","box-ordinal-group","column-count","columns","flex","flex-grow","flex-positive","flex-shrink","flex-negative","flex-order","grid-area","grid-row","grid-row-end","grid-row-span","grid-row-start","grid-column","grid-column-end","grid-column-span","grid-column-start","font-weight","line-clamp","line-height","opacity","order","orphans","scale","tab-size","widows","z-index","zoom","fill-opacity","flood-opacity","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity","stroke-width"]);function Bi(e){if(e.startsWith("--"))return e;let n=e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase());return n.startsWith("ms-")?"-"+n:n}var yo=new WeakMap;function bo(e,n){let t=e.style;if(!t)return;let o=new Set;for(let i of Object.keys(n)){let s=n[i];if(s==null||typeof s=="boolean"||s==="")continue;let c=Bi(i),u=c.replace(/^-(webkit|moz|ms|o)-/,""),a=typeof s=="number"&&s!==0&&!c.startsWith("--")&&!qi.has(u)?s+"px":String(s);t.setProperty(c,a),o.add(c)}let r=yo.get(e);if(r)for(let i of r)o.has(i)||t.removeProperty(i);yo.set(e,o)}function Eo(e,n,t){if(e.localName.indexOf("-")<1||n.indexOf("-")>=0)return!1;let o=typeof t=="object"&&t!==null||typeof t=="function";if(!o&&!(n in e))return!1;e[n]=t;let r=typeof customElements<"u"?customElements:null;return o&&r&&!r.get(e.localName)&&typeof r.whenDefined=="function"&&r.whenDefined(e.localName).then(()=>{let i=e;delete i[n],i[n]=t}),!0}function on(e,n,t){if(!(e.localName.indexOf("-")>0&&n!=="class"&&n!=="className"&&n!=="style"&&n!=="ref"&&n!=="key"&&n!=="children"&&!n.startsWith("on")&&Eo(e,n,t))){if(n==="class"||n==="className"){let o=t===!1||t===null||t===void 0?"":String(t);if(e.getAttribute("class")!==o){if(o===""&&!e.hasAttribute("class")&&typeof t!="string")return;e.setAttribute("class",o)}}else if(n==="style")typeof t=="string"?e.getAttribute("style")!==t&&e.setAttribute("style",t):t&&typeof t=="object"?bo(e,t):(t==null||t===!1)&&e.removeAttribute("style");else if(n.startsWith("on")&&typeof t=="function")ve(e,n,t);else if(n==="value"||n==="checked"||n==="selected"||n==="defaultValue"||n==="defaultChecked")z(e,n,t);else if(n==="ref"){let o=Se(e,t,void 0,"now");A(e,o),I(o)}else if(!(n==="key"||n==="children"||n==="dangerouslySetInnerHTML")){let o=ji[n]||n,r=/^(aria|data)-/.test(o);if(t==null||typeof t=="function"||typeof t=="symbol"||t===!1&&!r)e.hasAttribute(o)&&e.removeAttribute(o);else{let i=t===!0&&!r?"":it(o,String(t));e.getAttribute(o)!==i&&e.setAttribute(o,i)}}}}function Co(e){return"data-krate-no-base"in e?!1:"data-krate-link"in e||"data-krate-external"in e}function ut(e){return typeof e=="string"?ko(e):typeof e=="function"?()=>ut(e()):e}function Ao(e,n){for(let o in n){let r=o==="href"&&Co(n)?ut(n[o]):n[o];typeof r=="function"&&(o==="value"||o==="checked")?A(e,Ye(e,o,r)):typeof r=="function"&&!o.startsWith("on")&&o!=="ref"?A(e,y(()=>on(e,o,r()))):on(e,o,r)}let t=n.dangerouslySetInnerHTML;if(t&&typeof t=="object"&&t.__html!=null){let o=String(t.__html);e.innerHTML!==o&&(e.innerHTML=o)}}var wo=new WeakMap;function zi(e,n){A(e,y(()=>{let t=n()||{},o=new Set;for(let i of Object.keys(t)){if(i==="children"||i==="key"||i==="dangerouslySetInnerHTML")continue;o.add(i);let s=i==="href"&&(Co(t)||e.hasAttribute("data-krate-link")&&!("data-krate-no-base"in t));on(e,i,s?ut(t[i]):t[i])}let r=wo.get(e);if(r)for(let i of r)o.has(i)||(i.startsWith("on")?ve(e,i,null):on(e,i,void 0));wo.set(e,o)}))}function _o(e,n){if(e===void 0)return n();let t=b(e);try{return n()}finally{b(t)}}var V=0;function Ro(e){let n=V;V=n+1;try{return e()}finally{V=n}}function No(e){let n=V;V=0;try{return e()}finally{V=n}}function at(e){return!!e&&typeof e=="object"&&e.__kv===1}function Oo(e){return!!e&&typeof e=="object"&&e.__ka===1}var rn="http://www.w3.org/2000/svg",Vi=new Set(["svg","g","defs","symbol","use","switch","desc","metadata","path","circle","ellipse","line","polygon","polyline","rect","text","tspan","textPath","image","foreignObject","marker","mask","pattern","clipPath","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","animate","animateMotion","animateTransform","set","mpath","view"]);function Ui(e){return Vi.has(e)?document.createElementNS(rn,e):document.createElement(e)}function Gi(e){let n=e;return n.namespaceURI===rn&&n.localName!=="foreignObject"}function So(e,n){let t=n;if(t.nodeType!==1||t.namespaceURI===rn||!Gi(e))return n;let o=document.createElementNS(rn,t.localName);for(let r of Array.from(t.attributes))o.setAttribute(r.name,r.value);for(;t.firstChild;)o.appendChild(t.firstChild);return o}function Po(e,n,t){let o=Ui(e);if(n&&Ao(o,n),!n||!n.dangerouslySetInnerHTML)for(let r of t)Te(o,r);return o}function Ho(e){let n=_o(e.o,()=>No(()=>Po(e.tag,e.props,e.children)));return xo(e,n),n}function lt(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"}function ft(e){return e==null||typeof e=="boolean"?"":String(e)}function Te(e,n){if(!(n==null||n===!1||n===!0)){if(Array.isArray(n)){for(let t of n)Te(e,t);return}if(typeof n=="function"){Xi(e,n,null);return}if(at(n)){e.appendChild(So(e,Ho(n)));return}if(Oo(n)){e.appendChild(n.mount());return}e.appendChild(n instanceof Node?So(e,n):document.createTextNode(String(n)))}}function Wi(e,n){let t=xe.get(e);if(t){xe.delete(e);for(let o of t)A(n,o)}}function ct(e,n){let t=e.parentNode;if(!t)return;let o=e.nextSibling;for(;o&&o!==n;){let r=o.nextSibling;se(o),t.removeChild(o),o=r}}function $i(e){if(!e.text)return;let n=e.text,t=n.parentNode;e.start=document.createComment(""),e.end=document.createComment(""),t.insertBefore(e.start,n),t.insertBefore(e.end,n.nextSibling),Wi(n,e.start),t.removeChild(n),e.text=null}function Lo(e,n){if(lt(n)){let o=ft(n);if(e.text){e.text.data!==o&&(e.text.data=o);return}ct(e.start,e.end),o!==""&&e.end.parentNode.insertBefore(document.createTextNode(o),e.end);return}$i(e),ct(e.start,e.end);let t=document.createDocumentFragment();Te(t,n),e.end.parentNode.insertBefore(t,e.end)}function Xi(e,n,t){let o={text:null,start:null,end:null},r=!0,i=y(()=>{let s=n();if(!r){Lo(o,s);return}if(r=!1,lt(s)){o.text=document.createTextNode(ft(s)),e.insertBefore(o.text,t);return}o.start=document.createComment(""),o.end=document.createComment(""),e.insertBefore(o.start,t);let c=document.createDocumentFragment();Te(c,s),e.insertBefore(c,t),e.insertBefore(o.end,t)});A(o.text||o.start,i)}function Mo(e){for(;e.next&&e.next.nodeType===8;)e.next=e.next.nextSibling}function ie(e,n){e.parent.insertBefore(n,e.next)}function Ko(e,n){Mo(e);let t=e.next;if(n!==""&&t&&t.nodeType===3){let r=t;return r.data.length>n.length&&r.data.startsWith(n)?r.splitText(n.length):r.data!==n&&(r.data=n),e.next=r.nextSibling,r}let o=document.createTextNode(n);return ie(e,o),o}function Fo(e,n){let t=e.next;for(;t&&t!==n;){let o=t.nextSibling;se(t),e.parent.removeChild(t),t=o}e.next=n}function Qi(e,n){Mo(n);let t=n.next;if(t&&t.nodeType===1&&t.localName.toLowerCase()===e.tag.toLowerCase()){n.next=t.nextSibling;let o=t;xo(e,o),_o(e.o,()=>{if(e.props&&Ao(o,e.props),!e.props||!e.props.dangerouslySetInnerHTML){let r={parent:o,next:o.firstChild};for(let i of e.children)sn(i,r);Fo(r,null)}});return}ie(n,Ho(e))}function Ji(e,n){let t={text:null,start:null,end:null},o=!0,r=y(()=>{if(!o){Lo(t,e());return}o=!1;let i=Ro(e);if(lt(i)){t.text=Ko(n,ft(i));return}t.start=document.createComment(""),ie(n,t.start),sn(i,n),t.end=document.createComment(""),ie(n,t.end)});A(t.text||t.start,r)}function sn(e,n){if(!(e==null||typeof e=="boolean")){if(Array.isArray(e)){for(let t of e)sn(t,n);return}if(typeof e=="function"){Ji(e,n);return}if(at(e)){Qi(e,n);return}if(Oo(e)){e.adopt(n);return}if(e instanceof Node){ie(n,e);return}Ko(n,String(e))}}function Yi(e,n,...t){if(typeof e=="function"){let o=n||{};(t.length>0||!("children"in o))&&(o.children=t);let{value:r,owner:i}=Bn(()=>e(o));return vo(r,i),r}return V>0?{__kv:1,tag:e,props:n,children:t,o:J()}:Po(e,n,t)}function Do(e){if(typeof e=="string"){let n=document.querySelector(e);if(!n)throw new Error(`Container "${e}" not found`);return n}return e}function Zi(e,n){let t=Do(n),o=!1;y(()=>{o||(o=!0,t.appendChild(e()))})}function es(e,n){let t=Do(n);if(t.childNodes.length===0){t.appendChild(e());return}let o=e();o&&se(o)}function Io(){return globalThis.__krateSuspenseHook}function ns(e,n){let[t,o]=v(void 0),[r,i]=v(!0),[s,c]=v(void 0),[u,a]=v("unresolved"),[f,p]=v(0),_,l=Io()?.current()??null,g=null,ue=null,Ee=()=>typeof e=="function"?e():e,Xo=()=>{let x=Qo();return g=x,x.then(()=>{g===x&&(g=null)}),x},Qo=async()=>{_&&_.abort(),_=new AbortController;let x=_,Jo=Ee();a(f()>0?"refreshing":"loading"),i(!0),c(void 0);try{let Ce=await n(Jo,{signal:x.signal});x.signal.aborted||(o(()=>Ce),a("ready"))}catch(Ce){Ce?.name!=="AbortError"&&!x.signal.aborted&&(c(Ce),a("error"))}finally{x.signal.aborted||i(!1)}};y(()=>{typeof e=="function"&&e.length===0&&e(),f(),Xo(),I(()=>{_&&(_.abort(),_=void 0)})});let gt=function(){return l&&g&&ue!==g&&(ue=g,Io()?.suspend(l,g)),t()};return Object.defineProperties(gt,{loading:{get:()=>r()},error:{get:()=>s()},state:{get:()=>u()}}),[gt,{mutate:x=>{o(x)},refetch:()=>{p(x=>x+1)}}]}function ts(e){return De(e)?e():e}var ce=null,os=0,jo=typeof TextEncoder<"u"?new TextEncoder:null;function rs(e){return e.replace(/[^A-Za-z0-9_.:$-]/gu,n=>(jo?Array.from(jo.encode(n)):[n.charCodeAt(0)&255]).map(o=>"%"+o.toString(16).toUpperCase().padStart(2,"0")).join(""))}function is(e,n){if(!e)return n();let t=ce;ce={prefix:rs(e),n:0};try{return n()}finally{ce=t}}function ss(){return ce?"krate-"+ce.prefix+"-u"+ce.n++:"krate_u"+os++}function dt(e,n){let t=[];if(!e)return t;for(let o of n){let r=e[o];if(r==null||r===!1||r===""&&o!=="crossOrigin")continue;let i=o==="crossOrigin"?"crossorigin":o==="fetchPriority"?"fetchpriority":o==="referrerPolicy"?"referrerpolicy":o==="imageSrcSet"?"imagesrcset":o==="imageSizes"?"imagesizes":o;if(o==="crossOrigin"){t.push([i,r==="use-credentials"?r:""]);continue}t.push([i,r===!0?"":String(r)])}return t}function cs(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function us(){let e=globalThis[Symbol.for("krate.cache.runtime")],n=e&&e.renderStore;return n&&typeof n.getStore=="function"?n.getStore():void 0}function Bo(){let e=us();if(e)return e.hints??(e.hints=new Set);let n=globalThis.__krate_island_hints;return n instanceof Set?n:void 0}function qo(e){try{return new URL(e,document.baseURI).href}catch{return e}}function as(e,n){let t=s=>{for(let[c,u]of n)if(c===s)return u};if(e==="script"){let s=qo(t("src")||""),c=t("type")==="module";for(let u of Array.from(document.querySelectorAll("script[src]")))if(u.src===s&&u.type==="module"===c)return!0;return!1}let o=t("rel")||"",r=qo(t("href")||""),i=t("as");for(let s of Array.from(document.querySelectorAll("link[href]")))if(s.href===r&&(s.getAttribute("rel")||"").toLowerCase()===o&&!(o==="preload"&&(s.getAttribute("as")||"")!==(i||"")))return!0;return!1}function ls(e,n){let t=n.map(([o,r])=>r===""&&o!=="crossorigin"?" "+o:" "+o+'="'+cs(r)+'"').join("");return e==="link"?"<link"+t+">":"<script"+t+"><\/script>"}function pt(e,n){if(typeof document>"u"){Bo()?.add(ls(e,n));return}if(as(e,n))return;let t=document.createElement(e);for(let[o,r]of n)t.setAttribute(o,r);document.head.appendChild(t)}function be(e,n,t,o){!n||typeof n!="string"||pt("link",[["rel",e],["href",n],...dt(t,o)])}function fs(e){if(typeof document<"u")return;let n=Bo();if(n)for(let t of e)n.add(t)}function zo(e,n){be("preload",e,n,["as","crossOrigin","integrity","type","media","nonce","fetchPriority","referrerPolicy","imageSrcSet","imageSizes"])}function Vo(e,n){be("modulepreload",e,n,["as","crossOrigin","integrity","nonce"])}function Uo(e,n){be("preconnect",e,n,["crossOrigin"])}function Go(e){be("dns-prefetch",e,void 0,[])}function Wo(e,n){if(!(!e||typeof e!="string")){if(n&&n.as==="script"){pt("script",[["src",e],["async",""],...dt(n,["crossOrigin","integrity","nonce","fetchPriority"])]);return}be("stylesheet",e,n,["crossOrigin","integrity","media","nonce","fetchPriority"])}}function $o(e,n){!e||typeof e!="string"||pt("script",[["type","module"],["src",e],["async",""],...dt(n,["crossOrigin","integrity","nonce"])])}var ds=zo,ps=Wo,gs=Uo,hs=Go,ms=Vo,ks=$o;function ys(e){return e()}return or(ws);})();
|
|
2
2
|
for (const k in __krate_exports) { window[k] = __krate_exports[k]; }
|
package/dist/krate-f-actions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __krate_exports=(()=>{var v=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var V=Object.prototype.hasOwnProperty;var z=(t,e)=>{for(var n in e)v(t,n,{get:e[n],enumerable:!0})},X=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Q(e))!V.call(t,r)&&r!==n&&v(t,r,{get:()=>e[r],enumerable:!(o=U(e,r))||o.enumerable});return t};var Y=t=>X(v({},"__esModule",{value:!0}),t);var
|
|
1
|
+
var __krate_exports=(()=>{var v=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var V=Object.prototype.hasOwnProperty;var z=(t,e)=>{for(var n in e)v(t,n,{get:e[n],enumerable:!0})},X=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Q(e))!V.call(t,r)&&r!==n&&v(t,r,{get:()=>e[r],enumerable:!(o=U(e,r))||o.enumerable});return t};var Y=t=>X(v({},"__esModule",{value:!0}),t);var vt={};z(vt,{ACTION_ARGS_FIELD:()=>p,ServerActionError:()=>w,__krateAction:()=>at,__krateActionState:()=>mt,__krateAssignRef:()=>ut,__krateBeginAction:()=>F,__krateBindFormAction:()=>ft,__krateFormStatusMount:()=>ct,__krateOptimistic:()=>gt,callServerAction:()=>y,getFormStatus:()=>lt,installActionForms:()=>W,isActionPending:()=>it,isServerAction:()=>G,reportActionError:()=>_,requestFormReset:()=>dt,runActionTransition:()=>b,setActionTransitionRunner:()=>st,stripActionURL:()=>N,submitFormAction:()=>K,takeFlash:()=>J});var Z="__krate_cfg__";function R(){let t=globalThis;if(t.__KRATE_CFG__)return t.__KRATE_CFG__;let e=t.document,n=e&&typeof e.getElementById=="function"?e.getElementById(Z):null;if(n)try{let o=JSON.parse(n.textContent||"{}");if(o&&typeof o=="object")return t.__KRATE_CFG__=o,o}catch{}return{}}function h(){let t=R(),e=t&&t.basePath||"";return!e||e==="/"?"":"/"+e.replace(/^\/+|\/+$/g,"")}function C(t){let e=h();return e&&t.charCodeAt(0)===47&&t.charCodeAt(1)!==47?e+t:t}var P=window.createEffect;var O=window.krateRunEvent;var d=window.krateTransitionWrites,L=window.onCleanup;var p="__krate_args",w=class extends Error{constructor(e,n,o){super(e),this.name="ServerActionError",this.status=n,o&&(this.digest=o)}};function G(t){return typeof t=="function"&&typeof t.$$krateAction=="string"}var S=0;function tt(t){let e=nt(t);if(!e)return;let n=globalThis.navigate;typeof n=="function"?n(e):typeof location<"u"&&location.assign(C(e))}function et(t){typeof location>"u"||!/^https?:\/\//i.test(t)||location.assign(t)}function nt(t){return!t||!t.startsWith("/")||t.startsWith("//")||t.includes("\\")||/[\u0000-\u001f\u007f]/.test(t)?"":t}function ot(t){if(typeof window>"u"||typeof CustomEvent>"u")return;let e={paths:t&&Array.isArray(t.paths)?t.paths:[],tags:t&&Array.isArray(t.tags)?t.tags:[]};window.dispatchEvent(new CustomEvent("krate:revalidate",{detail:e}))}function rt(t,e,n){let o=t?t.error:void 0;if(o&&typeof o=="object")return new w(o.message||"Server action failed",e,o.digest);let r=t&&(t.details||(typeof o=="string"?o:""))||n||"Server action failed";return new w(r,e)}async function y(t,e){let n={accept:"application/json","x-krate-action":"fetch"};typeof location<"u"&&(n["x-krate-return"]=location.pathname+location.search);let o,r=e[e.length-1];if(typeof FormData<"u"&&r instanceof FormData){let s=new FormData;r.forEach((u,l)=>{l!==p&&s.append(l,u)});let c=e.slice(0,-1);c.length>0&&s.set(p,JSON.stringify(c)),o=s}else n["content-type"]="application/json",o=JSON.stringify({args:e});let a=await fetch(t,{method:"POST",credentials:"same-origin",headers:n,body:o}),i=null;try{i=await a.json()}catch{i=null}if(!a.ok||!i||i.ok===!1)throw rt(i,a.status,a.statusText);return i.revalidated&&ot(i.revalidation),typeof i.redirect=="string"&&i.redirect&&(S++,i.external?et(i.redirect):tt(i.redirect)),i.result}function B(t,e){let n=h()+"/__krate/action/"+t,o=function(...r){return y(n,e.concat(r))};return Object.defineProperty(o,"actionUrl",{value:n}),Object.defineProperty(o,"$$krateAction",{value:t}),Object.defineProperty(o,"$$krateBound",{value:e}),Object.defineProperty(o,"bind",{value:(r,...a)=>B(t,e.concat(a))}),o.toString=()=>n,o}function at(t){return B(t,[])}var f=0,x=new Set;function F(){f++;let t=!1;return()=>{t||(t=!0,f--,f===0&&d(()=>{for(let e of Array.from(x))e()}))}}function it(){return f>0}var I=t=>{let e=F(),n;try{n=t()}catch(o){return e(),Promise.reject(o)}return Promise.resolve(n).finally(e)},q=I;function st(t){q=t||I}function b(t){return q(t)}function _(t,e){let n=globalThis;if(typeof n.__krateActionError=="function")try{if(n.__krateActionError(t,e)===!0)return}catch{}let o=e||(typeof document<"u"?document:null),r=!1;if(o&&typeof CustomEvent<"u"){let a=new CustomEvent("krate:action-error",{bubbles:!0,cancelable:!0,detail:{error:t}});r=!o.dispatchEvent(a)}r||console.error("krate server action:",t)}var T=Object.freeze({pending:!1,data:null,method:null,action:null}),k=new WeakMap;function $(t){let e=k.get(t);return e||(e={status:T,subs:new Set,running:0,resetRequested:!1},k.set(t,e)),e}function D(t,e){t.status=e;for(let n of Array.from(t.subs))n(e)}function ct(t,e){let n=null;for(let a=t?t.parentElement:null;a;a=a.parentElement)if(a.tagName==="FORM"){n=a;break}if(!n)return()=>{};let o=$(n),r=a=>{e.status&&e.status(a),e.pending&&e.pending(a.pending),e.data&&e.data(a.data),e.method&&e.method(a.method),e.action&&e.action(a.action)};return o.subs.add(r),r(o.status),()=>{o.subs.delete(r)}}function ut(t,e){typeof t=="function"?t(e):t&&typeof t=="object"&&(t.current=e)}function lt(t){return k.get(t)?.status||T}function j(t){let e=Array.from(t.querySelectorAll("[data-kattr-value],[data-kattr-checked]")).map(n=>({el:n,value:n.value,checked:n.checked}));t.reset();for(let n of e)n.el.hasAttribute("data-kattr-value")&&(n.el.value=n.value),n.el.hasAttribute("data-kattr-checked")&&(n.el.checked=n.checked)}function dt(t){let e=k.get(t);if(e&&e.running>0){e.resetRequested=!0;return}j(t)}function ft(t,e){t&&(t.__krateFormAction=e,t.tagName==="FORM"?(t.removeAttribute("action"),t.removeAttribute("method")):(t.removeAttribute("formaction"),t.removeAttribute("formmethod")),t.removeAttribute("data-krate-action"))}function M(t){if(!t)return null;let e=t.__krateFormAction;if(typeof e!="function")return null;try{return e()}catch{return null}}function pt(t,e){if(e&&e!==t){let o=M(e);if(typeof o=="function")return{fn:o};if(e.hasAttribute("data-krate-action"))return{url:e.formAction||t.action};if(e.hasAttribute("formaction"))return null}let n=M(t);return typeof n=="function"?{fn:n}:t.hasAttribute("data-krate-action")?{url:t.action}:null}function wt(t,e){let n;try{n=e?new FormData(t,e):new FormData(t)}catch{n=new FormData(t);let o=e;o&&o.name&&n.append(o.name,o.value)}return n}function N(t){let e=t.indexOf("?");if(e<0)return t;let n=t.slice(0,e);try{let o=new URLSearchParams(t.slice(e+1)).get(p),r=o?JSON.parse(o):null;if(Array.isArray(r)&&typeof r[0]=="string"&&r[0].startsWith("k1."))return n+"?"+p+"="+encodeURIComponent(JSON.stringify([r[0]]))}catch{}return n}async function K(t,e,n,o=null,r){let a=$(t),i=(o&&o.getAttribute("formmethod")||t.getAttribute("method")||"get").toLowerCase();a.running++,D(a,{pending:!0,data:n,method:i,action:e||r||null}),t.setAttribute("data-krate-action-pending","1");let s=!1;try{await b(async()=>{let c=e;if(c&&typeof c.__krateRun=="function"){s=await c.__krateRun(n);return}typeof c=="function"?await c(n):r&&await y(N(r),[n]),s=!0})}catch(c){_(c,t)}finally{a.running--,a.running===0&&(t.removeAttribute("data-krate-action-pending"),d(()=>D(a,T)),(s||a.resetRequested)&&(a.resetRequested=!1,s&&t.hasAttribute("data-krate-reload")?location.reload():j(t)))}return s}function kt(t){let e=t.target;if(!e||e.tagName!=="FORM"||t.defaultPrevented)return;let n=t.submitter||null,o=pt(e,n);if(!o)return;t.preventDefault();let r=wt(e,n);O("submit",!0,()=>{K(e,o.fn,r,n,o.url)})}function W(t=typeof document<"u"?document:void 0){if(!t)return;let e=t.defaultView;!e||e.__krateActionBound||(e.__krateActionBound=!0,t.addEventListener("submit",kt,!1))}function A(t){try{let e=t.split(".")[0].replace(/-/g,"+").replace(/_/g,"/"),n=atob(e+"=".repeat((4-e.length%4)%4));return JSON.parse(decodeURIComponent(escape(n)))}catch{return null}}function J(t){if(typeof document>"u")return{found:!1};let e=/(?:^|;\s*)krate_flash=([^;]*)/.exec(document.cookie||"");if(e){let o=A(e[1]);return o&&o.a===t?(document.cookie="krate_flash=; Path=/; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax",H(t),{found:!0,value:o.r}):{found:!1}}let n=document.querySelectorAll("[data-krate-flash]");for(let o=0;o<n.length;o++){let r=A(n[o].getAttribute("data-krate-flash")||"");if(r&&r.a===t)return H(t),{found:!0,value:r.r}}return{found:!1}}function H(t){let e=document.querySelectorAll("[data-krate-flash]");for(let n=0;n<e.length;n++){let o=A(e[n].getAttribute("data-krate-flash")||"");o&&o.a===t&&e[n].parentNode?.removeChild(e[n])}}function mt(t,e,n,o){let r=[],a=!1;if(G(t)){let u=J(t.$$krateAction);u.found&&n(u.value)}let i=async()=>{for(a=!0;r.length>0;){let u=r.shift(),l=!1;try{let m=S,g=await b(()=>t(e(),u.payload));S===m&&d(()=>n(g)),l=!0}catch(m){let g=r.splice(0);for(let E of g)E.end(),E.done(!1);_(m)}finally{d(()=>{u.end(),u.done(l)})}}a=!1,d(()=>o(!1))},s=u=>new Promise(l=>{r.push({payload:u,end:F(),done:l}),o(!0),a||i()}),c=(u=>{s(u)});return c.__krateRun=s,c}function gt(t,e,n){let o=[],r=i=>{let s=i;for(let c of o)s=n?n(s,c):c;return s};P(()=>{e(r(t()))});let a=()=>{o.length!==0&&(o=[],e(t()))};return x.add(a),L(()=>{x.delete(a)}),i=>{o.push(i),e(r(t())),f===0&&queueMicrotask(()=>{f===0&&a()})}}typeof document<"u"&&W(document);return Y(vt);})();
|
|
2
2
|
for (const k in __krate_exports) { window[k] = __krate_exports[k]; }
|
package/dist/krate-f-list.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __krate_exports=(()=>{var C=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var J=Object.prototype.hasOwnProperty;var Q=(e,t)=>{for(var r in t)C(e,r,{get:t[r],enumerable:!0})},X=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of z(t))!J.call(e,i)&&i!==r&&C(e,i,{get:()=>t[i],enumerable:!(n=$(t,i))||n.enumerable});return e};var Y=e=>X(C({},"__esModule",{value:!0}),e);var le={};Q(le,{krateBindList:()=>de,krateList:()=>we,longestIncreasingSubsequence:()=>q});var I=window.createEffect;var A=window.createRoot,v=window.createSignal;var D=window.onCleanup;var
|
|
1
|
+
var __krate_exports=(()=>{var C=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var J=Object.prototype.hasOwnProperty;var Q=(e,t)=>{for(var r in t)C(e,r,{get:t[r],enumerable:!0})},X=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of z(t))!J.call(e,i)&&i!==r&&C(e,i,{get:()=>t[i],enumerable:!(n=$(t,i))||n.enumerable});return e};var Y=e=>X(C({},"__esModule",{value:!0}),e);var le={};Q(le,{krateBindList:()=>de,krateList:()=>we,longestIncreasingSubsequence:()=>q});var I=window.createEffect;var A=window.createRoot,v=window.createSignal;var D=window.onCleanup;var L=window.untrack;var M=window.krateUnmount,V=window.krateWithOwner;var _=window.adoptValue,T=window.appendChild;var m=window.disposeNode;var K=window.insertAt;var H=window.removeRest,R=window.trackEffect,S=window.withDOM,B=window.withVNodes;var b=window.krateMuteEvents;var P=window.krateWithIdScope;function Z(e,t,r){if(!e)return String(r);let n=e(t,r);return n==null?String(r):"$"+String(n)}function ee(e){try{return decodeURIComponent(e)}catch{return e}}function te(e){let t=e.map(r=>r.charAt(0)==="$"?r.slice(1):r);console.error("Encountered two children with the same key, `"+t.join("`, `")+"`. Keys should be unique so that components maintain their identity across updates. Krate keeps the first occurrence on its existing row and renders each duplicate as its own row.")}function ne(){return[document.createComment(""),document.createComment("")]}function G(e,t,r,n,i){A(a=>{R(t.start,a);let s=(e.start.nodeValue||"").slice(2),{value:d,owner:l}=V(()=>P(s?s+":"+t.key:"",()=>{if(!e.accessor)return e.render(r,n);let[u,k]=v(r),[x,w]=v(n);return t.setItem=k,t.setIndex=w,e.render(u,x)}));D(()=>M(l)),i(d)})}function U(e,t,r,n){let[i,a]=ne(),s={key:t,item:r,index:n,start:i,end:a,setItem:null,setIndex:null,live:!0},d=document.createDocumentFragment();return d.appendChild(i),S(()=>G(e,s,r,n,l=>T(d,l))),d.appendChild(a),d.__row=s,d}function oe(e,t,r,n){t.item=r,t.index=n,t.live=!0;let i=t.start.parentNode;try{B(()=>G(e,t,r,n,a=>{let s={parent:i,next:t.start.nextSibling};S(()=>_(a,s)),H(s,t.end)}))}catch(a){console.error(a),W(t.start,t.end,!1),m(t.start);let s=U(e,t.key,r,n),d=s.__row;i.insertBefore(s,t.start),i.removeChild(t.start),i.removeChild(t.end),Object.assign(t,d)}}function W(e,t,r){let n=e.parentNode;if(!n)return;let i=e.nextSibling;for(;i&&i!==t;){let a=i.nextSibling;m(i),n.removeChild(i),i=a}r&&(m(e),n.removeChild(e),t.parentNode===n&&n.removeChild(t))}function j(e){W(e.start,e.end,!0)}function re(e,t){let r=t.parentNode;if(e.end.nextSibling===t)return;let n=e.start;for(;n;){let i=n===e.end?null:n.nextSibling;r.insertBefore(n,t),n=i}}function q(e){let t=e.length,r=new Int32Array(t),n=[];for(let s=0;s<t;s++){let d=e[s];if(d<0)continue;let l=0,u=n.length;for(;l<u;){let k=l+u>>1;e[n[k]]<d?l=k+1:u=k}r[s]=l>0?n[l-1]:-1,n[l]=s}let i=new Array(n.length),a=n.length?n[n.length-1]:-1;for(let s=n.length-1;s>=0;s--)i[s]=a,a=r[a];return i}function se(e){return e==null?[]:Array.isArray(e)?e:typeof e[Symbol.iterator]=="function"?Array.from(e):[]}function ie(e){if(typeof document>"u")return null;let t=document.activeElement;if(!t||t===document.body||!e||!e.contains(t))return null;let r=null;try{let n=t;typeof n.selectionStart=="number"&&(r=[n.selectionStart,n.selectionEnd,n.selectionDirection])}catch{r=null}return()=>{if(!(document.activeElement===t||!t.isConnected)&&(t.focus({preventScroll:!0}),r))try{t.setSelectionRange(r[0],r[1],r[2]||void 0)}catch{}}}function ae(e,t){let{end:r,keyFn:n}=e,i=r.parentNode,a=e.rows,s=t.length,d=new Array(s),l=new Map,u=null;for(let o=0;o<s;o++){let c=Z(n,t[o],o),p=l.get(c);p!==void 0?((u||(u=[])).push(c),l.set(c,p+1),c=c+"\0"+p):l.set(c,1),d[o]=c}u&&te(u);let k=new Map;for(let o=0;o<a.length;o++)k.set(a[o].key,o);for(let o=0;o<s&&o<a.length;o++){let c=a[o];!c.live&&!l.has(c.key)&&!k.has(d[o])&&(k.delete(c.key),c.key=d[o],k.set(c.key,o))}let x=ie(i),w=new Array(s),g=new Int32Array(s).fill(-1),E=new Uint8Array(a.length);for(let o=0;o<s;o++){let c=k.get(d[o]);if(c===void 0)continue;let p=a[c],h=t[o];p.live&&!e.accessor&&(p.item!==h||e.usesIndex&&p.index!==o)||(E[c]=1,g[o]=c,w[o]=p)}b(()=>{for(let o=0;o<a.length;o++)E[o]||j(a[o])});for(let o=0;o<s;o++){let c=w[o];if(!c)continue;let p=t[o];if(!c.live){oe(e,c,p,o);continue}c.item!==p&&(c.item=p,c.setItem&&c.setItem(()=>p)),c.index!==o&&(c.index=o,c.setIndex&&c.setIndex(o))}let y=new Array(s),f=null;for(let o=0;o<s;o++){if(w[o]){f=null;continue}let c=U(e,d[o],t[o],o);w[o]=c.__row,f?(f.appendChild(c),y[o-1]=null):f=c,y[o]=f}let N=new Uint8Array(s);for(let o of q(g))N[o]=1;b(()=>{let o=r;for(let c=s-1;c>=0;c--){let p=w[c],h=y[c];h?i.insertBefore(h,o):g[c]>=0&&!N[c]&&re(p,o),o=p.start}e.rows=w,x&&x()})}function ce(e){let{start:t,end:r}=e,n=t.parentNode,i=(t.nodeValue||"").slice(2),a="k:"+i+":",s=[],d=t.nextSibling;for(;d&&d!==r;){let u=d.nodeType===8&&d.nodeValue||"";if(i&&u.indexOf(a)===0){let x="/"+u,w=d.nextSibling;for(;w&&w!==r&&!(w.nodeType===8&&w.nodeValue===x);)w=w.nextSibling;if(w&&w!==r){s.push({key:ee(u.slice(a.length)),item:void 0,index:s.length,start:d,end:w,setItem:null,setIndex:null,live:!1}),d=w.nextSibling;continue}}let k=d.nextSibling;m(d),n.removeChild(d),d=k}let l=new Set;e.rows=s.filter(u=>l.has(u.key)?(j(u),!1):(l.add(u.key),!0))}function O(e,t,r){let n=!0,i=I(()=>{let a=se(t());L(()=>{n&&(n=!1,r&&ce(e)),ae(e,a)})});R(e.start,i)}function F(e,t,r,n,i){return{start:e,end:t,rows:[],keyFn:r,render:n,accessor:i===1,usesIndex:n.length>1}}function de(e,t,r,n,i){let a="/"+(e.nodeValue||""),s=e.nextSibling;for(;s&&!(s.nodeType===8&&s.nodeValue===a);)s=s.nextSibling;s||(s=document.createComment(a),e.parentNode.insertBefore(s,e.nextSibling)),O(F(e,s,r,n,i),t,!0)}function we(e,t,r,n){return{__ka:1,items:e,key:t,render:r,mode:n,mount(){let i=document.createDocumentFragment(),a=document.createComment(""),s=document.createComment("");return i.appendChild(a),i.appendChild(s),O(F(a,s,t,r,n),e,!1),i},adopt(i){let a=i.next;for(;a&&a.nodeType===8&&(a.nodeValue||"").indexOf("/k:")===0;)a=a.nextSibling;if(a&&a.nodeType===8&&(a.nodeValue||"").indexOf("k:")===0){let s="/"+a.nodeValue,d=a.nextSibling;for(;d&&!(d.nodeType===8&&d.nodeValue===s);)d=d.nextSibling;if(d){i.next=d.nextSibling,S(()=>O(F(a,d,t,r,n),e,!0));return}}K(i,S(()=>this.mount()))}}}return Y(le);})();
|
|
2
2
|
for (const k in __krate_exports) { window[k] = __krate_exports[k]; }
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __krate_exports=(()=>{var
|
|
1
|
+
var __krate_exports=(()=>{var m=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var U=(e,t)=>{for(var n in t)m(e,n,{get:t[n],enumerable:!0})},M=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of I(t))!B.call(e,o)&&o!==n&&m(e,o,{get:()=>t[o],enumerable:!(r=q(t,o))||r.enumerable});return e};var G=e=>M(m({},"__esModule",{value:!0}),e);var se={};U(se,{forbidden:()=>A,krateLayoutSegments:()=>z,krateMatchParams:()=>W,krateResetNavigation:()=>$,krateRouteStore:()=>j,notFound:()=>T,permanentRedirect:()=>oe,redirect:()=>F,unauthorized:()=>_,useParams:()=>Q,usePathname:()=>Z,useRouter:()=>te,useSearchParams:()=>Y,useSelectedLayoutSegment:()=>re,useSelectedLayoutSegments:()=>ne});var b=window.createSignal;var c=window.krateDerived;var X=Symbol.for("krate.request.store");function i(){let e=globalThis[X];return e&&typeof e.getStore=="function"?e.getStore():void 0}function T(){let e=new Error("NEXT_NOT_FOUND");throw e.__krateNotFound=!0,e.digest="NEXT_NOT_FOUND",e}function C(e){let t=new Error(e===403?"NEXT_FORBIDDEN":"NEXT_UNAUTHORIZED");throw t.__krateHTTPStatus=e,t.digest="NEXT_HTTP_ERROR_FALLBACK;"+e,t}function A(){return C(403)}function _(){return C(401)}function x(){let e=i();if(!e)return{path:"/",route:"",params:{}};let t=e.url.split("?")[0]||"/",n=e.params||{},r=[];for(let o of t.split("/").filter(Boolean)){let s=/^\[(\[)?(\.\.\.)?([^\]]+)\]?\]$/.exec(o);if(!s){r.push(o);continue}let u=n[s[3]];u!==void 0&&u!==""&&r.push(...u.split("/").filter(Boolean))}return{path:"/"+r.join("/"),route:t,params:n}}function w(e){try{return decodeURIComponent(e)}catch{return e}}function E(){return x().path}function O(){let e=i(),t=new URLSearchParams;for(let[n,r]of Object.entries(e&&e.searchParams||{}))t.append(n,String(r));return t}function N(){let{route:e,params:t}=x(),n={};for(let r of e.split("/").filter(Boolean)){let o=/^\[(\[)?(\.\.\.)?([^\]]+)\]?\]$/.exec(r);if(!o)continue;let s=t[o[3]];s===void 0||s===""||(n[o[3]]=o[2]?s.split("/").filter(Boolean).map(w):w(s))}return n}function d(e){return()=>{throw new Error(`useRouter().${e}() can only be called in the browser; use redirect() while rendering`)}}function P(){return{push:d("push"),replace:d("replace"),back:d("back"),forward:d("forward"),refresh:d("refresh"),prefetch:()=>{}}}function k(e,t){return x().path.split("/").filter(Boolean).map(w).slice(typeof t=="number"?t:0)}function D(e,t){let n=k(e,t);return n.length>0?n[0]:null}var H=window.getNavigationState,S=window.subscribeNavigation,a=window.krateRouter;function J(){let e=globalThis.__KRATE_ROUTE__;if(typeof e=="string")return e;if(typeof document>"u")return"";let t=document.getElementById("__krate_page");if(!t)return"";try{let n=JSON.parse(t.textContent||"{}");return typeof n.r=="string"?n.r:""}catch{return""}}function V(e){return e.length>1&&e.endsWith("/")?e.replace(/\/+$/,"")||"/":e}function y(){if(typeof location>"u")return{pathname:"/",search:"",route:""};let{pathname:e,search:t}=H();return{pathname:V(e),search:t,route:J()}}var p=null;function l(){if(p)return p;let[e,t]=b(y());if(p=e,typeof window<"u"){let n=()=>{let r=y(),o=e();(r.pathname!==o.pathname||r.search!==o.search||r.route!==o.route)&&t(r)};S(n),window.addEventListener("krate:navigate-end",n)}return e}function j(){let e=null;return{subscribe:r=>{let o=S(r);return typeof window<"u"&&window.addEventListener("krate:navigate-end",r),()=>{o(),typeof window<"u"&&window.removeEventListener("krate:navigate-end",r)}},getSnapshot:()=>{let r=y();return e&&e.pathname===r.pathname&&e.search===r.search&&e.route===r.route?e:(e=r,r)}}}function W(e,t){return L(e,t)}function z(e,t){return e.split("/").filter(Boolean).map(f).slice(typeof t=="number"?t:0)}function $(){p=null}function g(e,t){let n=e;return n.toString=t,n.toJSON=()=>e(),e}function Z(){if(i())return E();let e=l(),t=c(()=>e().pathname);return g(t,()=>t())}function Y(){if(i())return O();let e=l(),t=c(()=>new URLSearchParams(e().search));return g(t,()=>e().search)}function f(e){try{return decodeURIComponent(e)}catch{return e}}function L(e,t){let n={};if(!e)return n;let r=e.split("/").filter(Boolean),o=t.split("/").filter(Boolean);for(let s=0;s<r.length;s++){let u=r[s],h=/^\[(\[)?(\.\.\.)?([^\]]+)\]?\]$/.exec(u);if(!h)continue;let R=h[3];if(h[2]){let v=o.slice(s).map(f);return v.length>0&&(n[R]=v),n}s<o.length&&(n[R]=f(o[s]))}return n}function Q(){if(i())return N();let e=l(),t=c(()=>{let n=e();return L(n.route,n.pathname)});return g(t,()=>JSON.stringify(t()))}var ee={push:(e,t)=>{a.push(e,t)},replace:(e,t)=>{a.replace(e,t)},back:()=>a.back(),forward:()=>a.forward(),refresh:()=>{a.refresh()},prefetch:e=>{a.prefetch(e)}};function te(){return i()?P():ee}function ne(e,t){if(i())return k(e,t);let n=l(),r=typeof t=="number"?t:0,o=c(()=>n().pathname.split("/").filter(Boolean).map(f).slice(r));return g(o,()=>o().join("/"))}function re(e,t){if(i())return D(e,t);let n=l(),r=typeof t=="number"?t:0,o=c(()=>{let s=n().pathname.split("/").filter(Boolean).map(f);return s.length>r?s[r]:null});return g(o,()=>String(o()))}function F(e){typeof location<"u"&&a.push(e);let t=new Error("Server action redirect to "+e);throw t.__krateRedirect=e,t}function oe(e){return F(e)}return G(se);})();
|
|
2
2
|
for (const k in __krate_exports) { window[k] = __krate_exports[k]; }
|
package/dist/krate-f-router.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __krate_exports=(()=>{var ft=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var ye=Object.prototype.hasOwnProperty;var ve=(t,e)=>{for(var n in e)ft(t,n,{get:e[n],enumerable:!0})},ke=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ge(e))!ye.call(t,o)&&o!==n&&ft(t,o,{get:()=>e[o],enumerable:!(r=me(e,o))||r.enumerable});return t};var be=t=>ke(ft({},"__esModule",{value:!0}),t);var sn={};ve(sn,{compareRouteSpecificity:()=>qt,destroyRouter:()=>on,getHistoryState:()=>xe,getNavigationState:()=>Ft,initRouter:()=>he,invalidatePrefetchCache:()=>Et,krateRouter:()=>en,matchRoutePattern:()=>Zt,navigate:()=>nn,pageAssetURLs:()=>Ot,reinitRouter:()=>rn,subscribeNavigation:()=>Wt});var we="__krate_cfg__";function Q(){let t=globalThis;if(t.__KRATE_CFG__)return t.__KRATE_CFG__;let e=t.document,n=e&&typeof e.getElementById=="function"?e.getElementById(we):null;if(n)try{let r=JSON.parse(n.textContent||"{}");if(r&&typeof r=="object")return t.__KRATE_CFG__=r,r}catch{}return{}}function U(){let t=Q(),e=t&&t.basePath||"";return!e||e==="/"?"":"/"+e.replace(/^\/+|\/+$/g,"")}function C(t){let e=U();return e&&t.charCodeAt(0)===47&&t.charCodeAt(1)!==47?e+t:t}var kt=/\/chunks\/runtime\.[^/]+\.js$/;function bt(){return Q()}function O(t){let e=U();if(e&&(t===e||t.startsWith(e+"/"))){let n=t.slice(e.length);return n===""?"/":n}return t}function pt(t){return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function F(t){if(bt().dev)try{console.warn("[krate router] "+t)}catch{}}function Kt(t,e){if(/^(https?:)?\/\//.test(t)||t.startsWith("/"))return new URL(t,e).href;let n=e;if(!n.endsWith("/")){let r=n.lastIndexOf("/");n=r>0?n.slice(0,r+1):"/"}return new URL(t,n).href}function Ot(t,e,n){let r=new DOMParser().parseFromString(t,"text/html"),o=[],i=new Set,s=a=>{if(!a)return;let c;try{c=Kt(a,e)}catch{return}i.has(c)||n.has(c)||kt.test(c)||(i.add(c),o.push(c))};return r.querySelectorAll("script[src]").forEach(a=>s(a.getAttribute("src"))),r.querySelectorAll('link[rel="modulepreload"][href], link[rel="preload"][as="script"][href]').forEach(a=>s(a.getAttribute("href"))),o}var R=!1,_=0,k,Pt=0,m="",A="",j="idle",$=new Set,S=new Map,T=new Map,Ee=30,Se=3e4,L=new Map,Ae=50,dt=new Set,Le=128,q=new Map,W=new Map,H=null,J=[],_e="_krate/i",Te=150,Re=200;function mt(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}function I(){return Pt++,Date.now().toString(36)+"-"+Pt.toString(36)}function it(t){try{let e=new URL(t,location.href);return e.hash="",e.href}catch{return t}}function x(t){let e=new URL(t,location.href);return pt(e.pathname)+e.search}function V(t,e=!1){let n=globalThis.__krateHardNavigate;if(typeof n=="function"){n(t,e);return}e?location.replace(t):location.assign(t)}function z(t,e){return{__krate:t,state:e===void 0?null:e}}function tt(t){if(t&&typeof t=="object"&&typeof t.__krate=="string")return t.__krate}function xe(){if(typeof history>"u")return null;let t=history.state;return tt(t)!==void 0?t.state:t}function Bt(){let t=new URL(location.href);return{url:t.href,pathname:O(t.pathname),search:t.search,hash:t.hash,status:j}}function Ft(){return typeof location>"u"?{url:"",pathname:"/",search:"",hash:"",status:"idle"}:Bt()}function st(){if($.size===0)return;let t=Bt();for(let e of Array.from($))try{e(t)}catch(n){console.error(n)}}function D(t){j!==t&&(j=t,st())}function Wt(t){return $.add(t),()=>{$.delete(t)}}function b(t,e,n=!1){try{let r=new CustomEvent(t,{detail:e,cancelable:n});return window.dispatchEvent(r),!r.defaultPrevented}catch{return!0}}function wt(t){try{let e=globalThis.__krate_onNavigation;typeof e=="function"&&e(t)}catch{}}function Y(t){if(t){if(L.delete(t),L.size>=Ae){let e=L.keys().next().value;e!==void 0&&L.delete(e)}L.set(t,window.scrollY||0)}}function jt(){let t=bt().prefetchTTL;return typeof t=="number"&&t>=0?t:Se}function Ce(t,e){for(S.delete(t);S.size>=Ee;){let n=S.keys().next().value;if(n===void 0)break;S.delete(n)}S.set(t,e)}function Pe(t){let e=S.get(t);if(e&&(S.delete(t),!(mt()-e.at>jt())))return e}function Et(t){if(t===void 0){S.clear(),T.clear();return}let e=it(t);S.delete(e),T.delete(e)}function St(t){return/text\/html|application\/xhtml\+xml/i.test(t)}function G(t){return/^\s*(<!doctype html|<html|<head|<body)/i.test(t)}function Ne(t){if(dt.has(t)||dt.size>=Le)return;dt.add(t);let e=document.createElement("link");e.rel="prefetch",e.as="script",e.href=t,document.head.appendChild(e)}function At(t){let e=it(t),n=S.get(e);if(n&&mt()-n.at<=jt())return Promise.resolve();let r=T.get(e);if(r)return r;let o=fetch(e,{headers:{Accept:"text/html"},credentials:"same-origin"}).then(async i=>{if(!i.ok)return;let s=i.headers.get("content-type")||"",a=i.url||e;if(new URL(a,location.href).origin!==location.origin)return;let c=await i.text();if(!(St(s)||s===""&&G(c))||T.get(e)!==o)return;Ce(e,{html:c,url:a,status:i.status,at:mt()});let u=new Set;document.querySelectorAll("script[src]").forEach(l=>u.add(l.src));for(let l of Ot(c,a,u))Ne(l)}).catch(()=>{}).finally(()=>{T.get(e)===o&&T.delete(e)});return T.set(e,o),o}function Lt(t){if(t.hasAttribute("data-krate-external")||t.hasAttribute("download"))return!1;let e=t.getAttribute("href");if(!e||e.startsWith("javascript:"))return!1;let n;try{n=new URL(e,location.href)}catch{return!1}if(n.origin!==location.origin)return!1;let r=t.getAttribute("target");return!(r&&r!=="_self")}function _t(t){let e=t.getAttribute("data-prefetch");return t.hasAttribute("data-prefetch")&&e!=="false"&&e!=="0"}function Me(t){let e=window.requestIdleCallback;typeof e=="function"?e(t,{timeout:1e3}):setTimeout(t,50)}function et(t){let e=t.target;if(!e||typeof e.closest!="function")return;let n=e.closest("a[data-prefetch]");if(!n||!_t(n)||!Lt(n))return;let r=n.getAttribute("href");if(!r)return;let o=new URL(r,location.href).href;if(x(o)===A)return;let i=W.get(n);i&&clearTimeout(i);let s=setTimeout(()=>{W.delete(n),At(o)},Re);W.set(n,s)}function $t(){H&&document.querySelectorAll("a[data-prefetch]").forEach(t=>{_t(t)&&H.observe(t)})}function He(){document.addEventListener("mouseover",et),document.addEventListener("focusin",et),typeof IntersectionObserver<"u"&&(H=new IntersectionObserver(t=>{for(let e of t){if(!e.isIntersecting)continue;let n=e.target,r=n.getAttribute("href");if(r&&Lt(n)&&_t(n)){let o=new URL(r,location.href).href;x(o)!==A&&Me(()=>{At(o)})}H.unobserve(e.target)}},{rootMargin:"200px"}),$t())}function De(){let t=typeof HTMLScriptElement<"u"?HTMLScriptElement.supports:void 0;if(!(typeof t!="function"||!t("speculationrules"))&&!document.querySelector('meta[http-equiv="Content-Security-Policy" i]'))try{let e=document.createElement("script");e.type="speculationrules";let n=U();e.textContent=JSON.stringify({prefetch:[{where:{and:[{href_matches:n+"/*"},{not:{href_matches:n+"/__krate/*"}},{not:{href_matches:n+"/api/*"}}]},eagerness:"moderate"}]}),document.head.appendChild(e)}catch{}}function Jt(){if(typeof window<"u"&&window.matchMedia)try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{}return!1}function Vt(){return bt().viewTransitions===!1||Jt()?!1:typeof document.startViewTransition=="function"}function w(t){return t.getElementById("root")||t.body}function Ie(){let t=document.querySelector("template[data-krate-loading]");if(t&&t.content&&J.length===0){let e=t.content.cloneNode(!0);J=Array.from(e.childNodes),document.body.appendChild(e)}if(!Vt()&&!Jt()){let e=w(document);e.style.transition=`opacity ${Te}ms ease`,e.style.opacity="0"}}function Tt(){for(let e of J)e.parentNode&&e.parentNode.removeChild(e);J=[];let t=w(document);t.style.opacity==="0"&&(t.style.opacity="")}function zt(t){t.querySelectorAll("[data-view-transition]").forEach(e=>{let n=e.getAttribute("data-view-transition");n&&(e.style.viewTransitionName=n);let r=e.getAttribute("data-view-transition-class");r&&e.style.setProperty("view-transition-class",r)})}var Ue=3e3;function Ke(t,e){let n=[];t.querySelectorAll('link[rel="stylesheet"]').forEach(u=>{let l=u.getAttribute("href");if(!l)return;let p=new URL(l,e).href;n.includes(p)||n.push(p)});let r=new Map,o=[];document.querySelectorAll('link[rel="stylesheet"]').forEach(u=>{let l=u;l.href&&(n.includes(l.href)&&!r.has(l.href)?r.set(l.href,l):o.push(l))});let i=[],s=[],a=null;n.forEach((u,l)=>{let p=r.get(u)||null;if(!p){let h=document.createElement("link");if(h.rel="stylesheet",h.href=u,s.push(new Promise(g=>{let f=()=>{h.removeEventListener("load",f),h.removeEventListener("error",f),g()};h.addEventListener("load",f),h.addEventListener("error",f)})),i.push({link:h,media:h.getAttribute("media")}),h.media="not all",a)a.after(h);else{let g=n.slice(l+1).map(f=>r.get(f)).find(f=>!!f);g?g.before(h):document.head.appendChild(h)}p=h}a=p});let c=Promise.resolve();if(s.length>0){let u,l=new Promise(p=>{u=setTimeout(p,Ue)});c=Promise.race([Promise.all(s).then(()=>{}),l]).then(()=>clearTimeout(u))}return{ready:c,commit(){for(let{link:u,media:l}of i)l===null?u.removeAttribute("media"):u.setAttribute("media",l);o.forEach(u=>u.remove())},abort(){i.forEach(({link:u})=>u.remove())}}}var Nt='meta[name="description"], meta[name="robots"], meta[property^="og:"], meta[name^="twitter:"], link[rel="canonical"], script[type="application/ld+json"]';function Oe(t){document.head.querySelectorAll(Nt).forEach(e=>e.remove()),t.head.querySelectorAll(Nt).forEach(e=>{document.head.appendChild(document.importNode(e,!0))})}var gt=null;function Mt(t){let e={};if(t)for(let n of Array.from(t.attributes))e[n.name]=n.value;return e}function yt(t){return{html:Mt(t.documentElement),body:Mt(t.body)}}function Be(t){let e=gt??yt(document),n=yt(t),r=(o,i,s)=>{if(o)for(let a of new Set([...Object.keys(i),...Object.keys(s)]))i[a]!==s[a]&&(s[a]===void 0?o.removeAttribute(a):o.setAttribute(a,s[a]))};r(document.documentElement,e.html,n.html),r(document.body,e.body,n.body),gt=n}function Gt(t,e){let n=new Set;document.querySelectorAll("script[src]:not([data-krate-spa])").forEach(i=>n.add(i.src));let r=[],o=new Set;return t.querySelectorAll("script[src]").forEach(i=>{let s=i.getAttribute("src");if(!s)return;let a=(i.getAttribute("type")||"").toLowerCase();if(a&&a!=="module"&&a!=="text/javascript"&&a!=="application/javascript")return;let c=Kt(s,e);!n.has(c)&&!o.has(c)&&(o.add(c),r.push({src:c,module:a==="module"}))}),r}function Yt(t){return new Promise(e=>{let n=document.createElement("script");n.src=t.src,t.module&&(n.type="module"),kt.test(t.src)||n.setAttribute("data-krate-spa",""),n.onload=()=>e(!0),n.onerror=()=>e(!1),document.body.appendChild(n)})}var nt=new Set;function Xt(t){t.querySelectorAll("script[data-krate-boot]").forEach(e=>{let n=e.textContent||"";if(!n||nt.has(n))return;nt.add(n);let r=document.createElement("script");r.text=n,document.head.appendChild(r),r.remove()})}function Fe(t){if(!t||t==="#")return null;let e=t.slice(1);try{e=decodeURIComponent(e)}catch{}return document.getElementById(e)||document.getElementsByName(e)[0]||null}function Rt(t){let e=Fe(t);if(!e)return!1;try{e.scrollIntoView({block:"start"})}catch{}return!0}function We(t,e){if(e.kind==="pop"){let r=e.restoreKey?L.get(e.restoreKey):void 0;if(r!==void 0){window.scrollTo(0,r);return}}let n=new URL(t,location.href).hash;Rt(n)||e.scroll&&e.kind!=="refresh"&&window.scrollTo(0,0)}var Z=null;function je(){let t=document.activeElement;if(t&&t!==document.body&&t.isConnected&&t!==Z)return;let e=w(document);e.hasAttribute("tabindex")||(e.setAttribute("tabindex","-1"),Z=e,e.addEventListener("blur",()=>{Z===e&&(e.removeAttribute("tabindex"),Z=null)},{once:!0}));try{e.focus({preventScroll:!0})}catch{}}var Ht="__krate-route-announcer";function $e(){let t=document.getElementById(Ht);t||(t=document.createElement("div"),t.id=Ht,t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.setAttribute("role","status"),t.setAttribute("style","position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0"),document.body.appendChild(t));let e=w(document).querySelector("h1"),n=document.title||(e&&e.textContent?e.textContent.trim():"")||O(location.pathname);t.textContent=n}function at(){let t=pt(O(location.pathname));document.querySelectorAll("a[data-krate-link]").forEach(e=>{let n=e.getAttribute("href"),r="";try{r=n?pt(O(new URL(n,location.href).pathname)):""}catch{r=""}let o="";r&&r===t?o="exact":r&&r!=="/"&&t.startsWith(r+"/")&&(o="segment"),o==="exact"?e.setAttribute("aria-current","page"):e.removeAttribute("aria-current"),o?e.setAttribute("data-krate-active",o):e.removeAttribute("data-krate-active")})}function Dt(t){let e=U()+t;return q.has(e)?Promise.resolve(q.get(e)??null):fetch(e,{headers:{Accept:"text/html"},credentials:"same-origin"}).then(async n=>{let r=n.ok?await n.text():null,o=r&&G(r)?r:null;return q.set(e,o),o}).catch(()=>null)}async function Je(t,e){let n=it(t.url);if(!t.bypassCache){let p=T.get(n);if(p&&await p,e.aborted)return{ok:!1,aborted:!0};let h=Pe(n);if(h){let g=new URL(t.url,location.href).hash,f=g&&!new URL(h.url,location.href).hash?h.url+g:h.url;return{ok:!0,doc:{html:h.html,url:f,status:h.status}}}}let r;try{r=await fetch(n,{headers:{Accept:"text/html"},credentials:"same-origin",signal:e,cache:t.bypassCache?"no-cache":"default"})}catch(p){return p?.name==="AbortError"||e.aborted?{ok:!1,aborted:!0}:b("krate:navigate-error",{url:t.url,status:0,error:p},!0)?{ok:!1,hard:t.url}:{ok:!1,aborted:!0}}let o=r.url||n;if(new URL(o,location.href).origin!==location.origin)return{ok:!1,hard:o};let i=r.headers.get("content-type")||"",s="";try{s=await r.text()}catch(p){if(p?.name==="AbortError"||e.aborted)return{ok:!1,aborted:!0};s=""}if(e.aborted)return{ok:!1,aborted:!0};let a=St(i)||i===""&&G(s),c=new URL(t.url,location.href).hash,u=c&&!new URL(o).hash?o+c:o;if(r.ok)return a?{ok:!0,doc:{html:s,url:u,status:r.status}}:{ok:!1,hard:u};if(b("krate:navigate-error",{url:t.url,status:r.status}),a&&G(s))return{ok:!0,doc:{html:s,url:u,status:r.status}};let l=null;return r.status===404||r.status===410?l=await Dt("/404.html"):r.status>=500&&(l=await Dt("/500.html")),e.aborted?{ok:!1,aborted:!0}:l?{ok:!0,doc:{html:l,url:u,status:r.status}}:{ok:!1,hard:u}}async function ct(t){let e=location.href;if(t.kind!=="pop"){if(!b("krate:navigate-start",{url:t.url,from:e,kind:t.kind},!0))return}else b("krate:navigate-start",{url:t.url,from:e,kind:t.kind});let n=++_;k&&k.abort();let r=new AbortController;k=r,D("loading"),!t.bypassCache&&S.has(it(t.url))||Ie();let i;try{i=await Je(t,r.signal)}finally{k===r&&(k=void 0)}if(n===_){if(!i.ok){Tt(),D("idle"),"hard"in i&&V(i.hard,t.kind==="replace"||t.kind==="refresh");return}await Ve(i.doc,t,n)}}async function Ve(t,e,n){let r=new DOMParser().parseFromString(t.html,"text/html"),o=t.url,i=w(r),s=w(document);e.kind==="push"&&Y(m);let a=Qt(r),c=Xe(N,a,location.href,o,r),u=Ke(r,o);if(await u.ready,n!==_){u.abort();return}if(await ze(()=>{let g=r.querySelector("title");g&&(document.title=g.textContent||"");let f=globalThis;if(c.keep.length>0&&typeof f.krateDisposeExcept=="function"?f.krateDisposeExcept(c.keep):typeof f.disposeAll=="function"&&f.disposeAll(),c.region){let{live:v,next:d}=c.region;rt(v[0],v[1]);let E=K(d[0],d[1]).map(y=>document.importNode(y,!0));for(let y of E)v[1].parentNode.insertBefore(y,v[1]);for(let y of c.slots){rt(y.live[0],y.live[1]);for(let B of K(y.next[0],y.next[1]))y.live[1].parentNode.insertBefore(document.importNode(B,!0),y.live[1])}Ge(s,i)}else{let v=Array.from(i.childNodes).map(d=>document.importNode(d,!0));s.replaceChildren(...v)}N=c.chain,X.clear(),u.commit(),Oe(r),Be(r),zt(document)}),n!==_)return;Tt(),e.kind==="push"?(m=I(),history.pushState(z(m,e.state),"",o)):e.kind==="replace"?(L.delete(m),m=I(),history.replaceState(z(m,e.state),"",o)):e.kind==="refresh"?o!==location.href&&history.replaceState(history.state,"",o):e.restoreKey&&(m=e.restoreKey),A=x(location.href),M=A,ee(r),Qe(r),We(o,e),e.kind!=="pop"&&e.kind!=="refresh"&&je(),e.kind!=="refresh"&&$e(),at(),b("krate:navigate",{url:location.href,status:t.status}),wt(location.href),D("idle"),document.querySelectorAll("script[data-krate-spa]").forEach(g=>g.remove()),Xt(r);let p=Gt(r,o);Ut(c.skip);let h=await Promise.all(p.map(Yt));if(Ut([]),n===_){if(h.some(g=>!g)){b("krate:navigate-error",{url:location.href,status:t.status,error:"script-load"}),V(location.href,!0);return}ot(),b("krate:navigate-end",{url:location.href,status:t.status})}}function ze(t){if(!Vt())return t(),Promise.resolve();let e=!1,n=()=>{e||(e=!0,t())};try{let r=document.startViewTransition(n);r&&r.finished&&typeof r.finished.catch=="function"&&r.finished.catch(()=>{}),r&&r.ready&&typeof r.ready.catch=="function"&&r.ready.catch(()=>{});let o=r&&r.updateCallbackDone;if(o&&typeof o.then=="function")return o.then(()=>n(),()=>n())}catch{}return n(),Promise.resolve()}var N=[];function Qt(t){let e=t.getElementById("__krate_route");if(!e)return[];try{let n=JSON.parse(e.textContent||"{}");return Array.isArray(n.chain)?n.chain:[]}catch{return F("unreadable #__krate_route route info; layouts will be remounted"),[]}}function It(t,e){let n=O(new URL(t,location.href).pathname).split("/").filter(Boolean);return(e<0?n:n.slice(0,e)).join("/")}function P(t,e,n="kl:"){let o=(t.ownerDocument||t).createTreeWalker(t,128),i=n+e,s="/"+n+e;for(;o.nextNode();){let a=o.currentNode;if(a.nodeValue===i){for(let c=a.nextSibling;c;c=c.nextSibling)if(c.nodeType===8&&c.nodeValue===s)return[a,c];return null}}return null}function K(t,e){let n=[];for(let r=t.nextSibling;r&&r!==e;r=r.nextSibling)n.push(r);return n}function rt(t,e){let n=globalThis.disposeNode;for(let r of K(t,e))r.parentNode.removeChild(r),typeof n=="function"&&n(r)}function Ge(t,e){let n=":scope > template[data-krate-loading]";t.querySelectorAll(n).forEach(r=>r.remove()),e.querySelectorAll(n).forEach(r=>t.appendChild(document.importNode(r,!0)))}function Ut(t){let e=globalThis.krateKeepScopes;typeof e=="function"&&e(t)}function Ye(t){let e=globalThis.krateScopeFailed;return typeof e=="function"&&!!e(t)}function Xe(t,e,n,r,o){let i={keep:[],skip:[],region:null,slots:[],chain:e},s=0;for(;s<t.length&&s<e.length;){let f=t[s],v=e[s];if(f.id!==v.id||f.k!==v.k||f.k!=="layout"&&f.k!=="error"||It(n,f.d)!==It(r,v.d)||f.k==="error"&&Ye(f.id))break;if(!f.p||!v.p){F(`layout ${v.f||v.id} is remounted on this navigation: ${v.why||f.why||"not persistable"}`);break}s++}if(s===0)return i;if(typeof globalThis.krateDisposeExcept!="function")return F("the runtime has no krateDisposeExcept; layouts are remounted"),i;let a=e[s-1].id,c=P(w(document),a),u=P(w(o),a);if(!c||!u)return F(`layout ${e[s-1].f||a} boundary markers are missing; the whole page is swapped`),i;let l=t.slice(0,s).map(f=>f.id),p=l.slice(),h=[],g=e.slice();for(let f=0;f<s;f++){let v=t[f].s||[],d=[];for(let E of e[f].s||[]){let y=v.find(pe=>pe.key===E.key),B=P(w(document),E.key,"ks:"),ut=P(w(o),E.key,"ks:");if(y&&B&&(E.src!=="page"||!ut)){l.push(y.scope),p.push(y.scope,E.scope),d.push({...E,scope:y.scope,src:y.src});continue}if(B&&ut){h.push({live:B,next:ut}),d.push(E);continue}return F(`slot @${E.n} markers are missing; the whole page is swapped`),i}g[f]={...e[f],s:d}}return{keep:l,skip:p,region:{live:c,next:u},slots:h,chain:g}}var X=new Map,M="";function vt(t){let e=t.replace(/^\/+|\/+$/g,"");return e?e.split("/").map(n=>n.startsWith("[[...")&&n.endsWith("]]")?{kind:3,text:n.slice(5,-2)}:n.startsWith("[...")&&n.endsWith("]")?{kind:2,text:n.slice(4,-1)}:n.startsWith("[")&&n.endsWith("]")?{kind:1,text:n.slice(1,-1)}:{kind:0,text:n}):[]}function Zt(t,e){let n=vt(e),r=t.replace(/^\/+|\/+$/g,""),o=r?r.split("/"):[],i={};for(let s=0;s<n.length;s++){let a=n[s];if(a.kind>=2){if(s!==n.length-1)return null;let c=o.slice(s);return a.kind===2&&c.length===0||c.some(u=>u==="")?null:(i[a.text]=c.map(ht).join("/"),i)}if(s>=o.length)return null;if(a.kind===1){if(!o[s])return null;i[a.text]=ht(o[s])}else if(ht(o[s])!==a.text)return null}return o.length===n.length?i:null}function ht(t){try{return decodeURIComponent(t)}catch{return t}}function qt(t,e){let n=vt(t),r=vt(e);for(let o=0;o<n.length&&o<r.length;o++){if(n[o].kind!==r[o].kind)return n[o].kind-r[o].kind;if(n[o].kind===0&&n[o].text!==r[o].text)return n[o].text<r[o].text?-1:1}return n.length!==r.length?r.length-n.length:t<e?-1:t>e?1:0}function xt(t){let e=O(new URL(t,location.href).pathname).replace(/^\/+|\/+$/g,""),n=null;for(let r of N)for(let o of r.s||[])for(let i of o.i||[])Zt(e,i)&&(!n||qt(i,n.pattern)<0)&&(n={hit:{entry:r,slot:o,path:e},pattern:i});return n&&!P(w(document),n.hit.slot.key,"ks:")?null:n?n.hit:null}function te(t,e){N=N.map(n=>n.s&&n.s.some(r=>r.key===t)?{...n,s:n.s.map(r=>r.key===t?e:r)}:n)}function ee(t){let e="",n=t.getElementById("__krate_page");if(n)try{let r=JSON.parse(n.textContent||"{}");typeof r.r=="string"&&(e=r.r)}catch{}globalThis.__KRATE_ROUTE__=e;for(let r of Array.from(t.querySelectorAll("script:not([src])"))){let o=/window\.__KRATE_PARAMS__\s*=\s*(\{[\s\S]*?\})\s*;?\s*$/.exec(r.textContent||"");if(o){try{globalThis.__KRATE_PARAMS__=JSON.parse(o[1])}catch{}return}}delete globalThis.__KRATE_PARAMS__}function Qe(t){let e=t.getElementById("__krate_error"),n=document.getElementById("__krate_error");if(!e){n&&n.remove();return}let r=document.importNode(e,!0);n?n.replaceWith(r):document.head.appendChild(r)}function ne(t){let e=globalThis.krateDisposeScopes;typeof e=="function"&&e(t)}async function Ct(t,e){let n=location.href;if(t.kind!=="pop"&&!b("krate:navigate-start",{url:t.url,from:n,kind:t.kind,intercept:e.slot.n},!0))return;let r=++_;k&&k.abort();let o=new AbortController;k=o,D("loading");let i=location.origin+U()+"/"+_e+"/"+e.slot.key+(e.path?"/"+e.path:""),s="",a=!1;try{let d=await fetch(i,{headers:{Accept:"text/html"},credentials:"same-origin",signal:o.signal,cache:t.bypassCache?"no-cache":"default"});s=await d.text(),a=d.ok&&(St(d.headers.get("content-type")||"")||G(s)),a||b("krate:navigate-error",{url:t.url,status:d.status,intercept:e.slot.n})}catch(d){if(d?.name==="AbortError"||o.signal.aborted)return;b("krate:navigate-error",{url:t.url,status:0,error:d,intercept:e.slot.n})}finally{k===o&&(k=void 0)}if(r!==_)return;let c=a?new DOMParser().parseFromString(s,"text/html"):null,u=c?P(w(c),e.slot.key,"ks:"):null,l=P(w(document),e.slot.key,"ks:"),p=null;try{let d=c&&c.getElementById("__krate_route");p=d&&JSON.parse(d.textContent||"{}").frag||null}catch{p=null}if(!c||!u||!l||!p||p.key!==e.slot.key||!p.scope){try{console.warn(`[krate router] intercepting route for ${t.url} (slot @${e.slot.n}) could not be loaded; navigating to the page`)}catch{}return D("idle"),ct({...t})}if(t.kind==="push"&&Y(m),e.slot.src!=="intercept"){X.set(m,{key:e.slot.key,nodes:K(l[0],l[1]),slot:e.slot,path:M});for(let d of K(l[0],l[1]))d.parentNode.removeChild(d)}else ne([e.slot.scope]),rt(l[0],l[1]);for(let d of K(u[0],u[1]))l[1].parentNode.insertBefore(document.importNode(d,!0),l[1]);let h=new Set;document.querySelectorAll('link[rel="stylesheet"]').forEach(d=>h.add(d.href)),c.querySelectorAll('link[rel="stylesheet"][href]').forEach(d=>{let E=new URL(d.getAttribute("href"),i).href;if(h.has(E))return;let y=document.createElement("link");y.rel="stylesheet",y.href=E,document.head.appendChild(y)}),te(e.slot.key,{...e.slot,scope:p.scope,src:"intercept"}),Xt(c);let g={__krate:"",state:t.state===void 0?null:t.state,__kint:{key:e.slot.key,base:M}};t.kind==="push"?(m=I(),g.__krate=m,history.pushState(g,"",t.url)):t.kind==="replace"?(m=I(),g.__krate=m,history.replaceState(g,"",t.url)):t.kind==="pop"&&t.restoreKey&&(m=t.restoreKey),A=x(location.href),ee(c),at(),b("krate:navigate",{url:location.href,status:200,intercept:e.slot.n}),wt(location.href),D("idle");let f=Gt(c,i),v=await Promise.all(f.map(Yt));if(r===_){if(v.some(d=>!d)){b("krate:navigate-error",{url:location.href,status:200,error:"script-load",intercept:e.slot.n}),V(location.href,!0);return}ot(),b("krate:navigate-end",{url:location.href,status:200,intercept:e.slot.n})}}function Ze(t,e){let n=P(w(document),t.key,"ks:"),r=N.flatMap(i=>i.s||[]).find(i=>i.key===t.key);if(!n||!r||r.src!=="intercept")return!1;ne([r.scope]),rt(n[0],n[1]);for(let i of t.nodes)n[1].parentNode.insertBefore(i,n[1]);te(t.key,t.slot),X.delete(e),m=e,A=x(location.href);let o=L.get(e);return o!==void 0&&window.scrollTo(0,o),at(),b("krate:navigate",{url:location.href,status:200}),wt(location.href),st(),!0}function qe(t){return x(t)===A}function re(){j==="loading"&&(_++,k&&k.abort(),k=void 0,Tt(),D("idle"))}function tn(t,e){re(),Y(m),(t!==location.href||e.state!==void 0)&&(e.kind==="replace"?history.replaceState(z(m||I(),e.state),"",t):(m=I(),history.pushState(z(m,e.state),"",t)));let n=new URL(t).hash;!Rt(n)&&e.scroll&&!n&&window.scrollTo(0,0),st()}function lt(t){let e;try{e=new URL(t.url,location.href)}catch{return V(t.url),Promise.resolve()}if(e.origin!==location.origin)return V(e.href,t.kind==="replace"),Promise.resolve();if(t.url=e.href,(t.kind==="push"||t.kind==="replace")&&qe(e.href)&&(e.hash||e.href===location.href))return tn(e.href,t),Promise.resolve();if(t.kind==="push"||t.kind==="replace"){let n=xt(e.href);if(n)return Ct(t,n)}return ct(t)}function oe(t){if(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let e=t.target;if(!e||typeof e.closest!="function")return;let n=e.closest("a[data-krate-link]");if(!n||!Lt(n))return;let r=n.getAttribute("href");r&&(t.preventDefault(),lt({url:new URL(r,location.href).href,kind:n.hasAttribute("data-krate-replace")?"replace":"push",scroll:n.getAttribute("data-krate-scroll")!=="false"}))}function ie(t){if(t.defaultPrevented)return;let e=t.target;if(!e||e.tagName!=="FORM"||e.hasAttribute("data-krate-reload"))return;let n=t.submitter||null;if((n&&n.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()!=="get")return;let o=n&&n.getAttribute("formtarget")||e.getAttribute("target");if(o&&o!=="_self")return;let i=n&&n.getAttribute("formaction")||e.getAttribute("action")||"",s;try{s=new URL(i||location.href,location.href)}catch{return}if(s.origin!==location.origin||s.protocol.indexOf("http")!==0)return;let a;try{a=n?new FormData(e,n):new FormData(e)}catch{a=new FormData(e),n&&n.name&&a.append(n.name,n.value)}let c=new URLSearchParams;for(let[u,l]of a.entries()){if(typeof l!="string")return;c.append(u,l)}t.preventDefault(),s.search=c.toString(),s.hash="",lt({url:s.href,kind:"push",scroll:!0})}function se(t){Y(m);let e=tt(t.state),n=location.href;if(x(n)===A){re(),m=e||m;let i=e?L.get(e):void 0;i!==void 0?window.scrollTo(0,i):Rt(location.hash),st();return}let r=e?X.get(e):void 0;if(r&&e&&r.path===x(n)&&r.path===M&&Ze(r,e))return;let o=t.state&&typeof t.state=="object"?t.state.__kint:null;if(o&&o.base===M){let i=xt(n);if(i&&i.slot.key===o.key){Ct({url:n,kind:"pop",scroll:!1,restoreKey:e},i);return}}ct({url:n,kind:"pop",scroll:!0,restoreKey:e})}function ae(){Et(),ue()}function ce(){Y(m);try{history.scrollRestoration="auto"}catch{}}function le(){try{history.scrollRestoration="manual"}catch{}}function ot(){$t(),at(),zt(document),document.querySelectorAll("script[src]").forEach(t=>{kt.test(t.src)||t.setAttribute("data-krate-spa","")})}function ue(){if(!R||typeof location>"u")return typeof location<"u"&&location.reload(),Promise.resolve();if(A!==M){let t=xt(location.href);if(t&&t.slot.src==="intercept")return Ct({url:location.href,kind:"refresh",scroll:!1,bypassCache:!0},t)}return ct({url:location.href,kind:"refresh",scroll:!1,bypassCache:!0})}function fe(t,e={}){return R?lt({url:C(t),kind:"push",scroll:e.scroll!==!1,state:e.state}):(typeof location<"u"&&location.assign(C(t)),Promise.resolve())}function de(t,e={}){return R?lt({url:C(t),kind:"replace",scroll:e.scroll!==!1,state:e.state}):(typeof location<"u"&&location.replace(C(t)),Promise.resolve())}var en={push:fe,replace:de,back(){typeof history<"u"&&history.back()},forward(){typeof history<"u"&&history.forward()},refresh:ue,prefetch(t){if(!R||typeof location>"u")return Promise.resolve();let e;try{e=new URL(C(t),location.href)}catch{return Promise.resolve()}return e.origin!==location.origin?Promise.resolve():At(e.href)},subscribe:Wt,getState:Ft,invalidate:Et};function nn(t,e={}){return R?(e.replace?de(t,e):fe(t,e),!1):(typeof location<"u"&&(e.replace?location.replace(C(t)):location.assign(C(t))),!0)}function he(){if(!(typeof document>"u")){if(R){ot();return}if(R=!0,document.querySelectorAll("script[data-krate-boot]").forEach(t=>nt.add(t.textContent||"")),A=x(location.href),N=Qt(document),gt=yt(document),M=A,m=tt(history.state)||I(),tt(history.state)===void 0)try{history.replaceState(z(m,history.state),"",location.href)}catch{}try{history.scrollRestoration="manual"}catch{}document.addEventListener("click",oe),document.addEventListener("submit",ie),window.addEventListener("popstate",se),window.addEventListener("krate:revalidate",ae),window.addEventListener("pagehide",ce),window.addEventListener("pageshow",le),He(),De(),ot()}}function rn(){he()}function on(){if(R){R=!1,document.removeEventListener("click",oe),document.removeEventListener("submit",ie),window.removeEventListener("popstate",se),window.removeEventListener("krate:revalidate",ae),window.removeEventListener("pagehide",ce),window.removeEventListener("pageshow",le),document.removeEventListener("mouseover",et),document.removeEventListener("focusin",et);for(let t of W.values())clearTimeout(t);W=new Map,H&&(H.disconnect(),H=null),k&&k.abort(),k=void 0,_++,S.clear(),T.clear(),L.clear(),q.clear(),nt.clear(),$.clear(),j="idle",J=[],N=[],X.clear(),M=""}}return be(sn);})();
|
|
1
|
+
var __krate_exports=(()=>{var ft=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var ye=Object.prototype.hasOwnProperty;var ve=(t,e)=>{for(var n in e)ft(t,n,{get:e[n],enumerable:!0})},ke=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ge(e))!ye.call(t,o)&&o!==n&&ft(t,o,{get:()=>e[o],enumerable:!(r=me(e,o))||r.enumerable});return t};var be=t=>ke(ft({},"__esModule",{value:!0}),t);var sn={};ve(sn,{compareRouteSpecificity:()=>qt,destroyRouter:()=>on,getHistoryState:()=>xe,getNavigationState:()=>Ft,initRouter:()=>he,invalidatePrefetchCache:()=>Et,krateRouter:()=>en,matchRoutePattern:()=>Zt,navigate:()=>nn,pageAssetURLs:()=>Ot,reinitRouter:()=>rn,subscribeNavigation:()=>Wt});var we="__krate_cfg__";function Q(){let t=globalThis;if(t.__KRATE_CFG__)return t.__KRATE_CFG__;let e=t.document,n=e&&typeof e.getElementById=="function"?e.getElementById(we):null;if(n)try{let r=JSON.parse(n.textContent||"{}");if(r&&typeof r=="object")return t.__KRATE_CFG__=r,r}catch{}return{}}function U(){let t=Q(),e=t&&t.basePath||"";return!e||e==="/"?"":"/"+e.replace(/^\/+|\/+$/g,"")}function C(t){let e=U();return e&&t.charCodeAt(0)===47&&t.charCodeAt(1)!==47?e+t:t}var kt=/\/chunks\/runtime\.[^/]+\.js$/;function bt(){return Q()}function O(t){let e=U();if(e&&(t===e||t.startsWith(e+"/"))){let n=t.slice(e.length);return n===""?"/":n}return t}function pt(t){return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function F(t){if(bt().dev)try{console.warn("[krate router] "+t)}catch{}}function Kt(t,e){if(/^(https?:)?\/\//.test(t)||t.startsWith("/"))return new URL(t,e).href;let n=e;if(!n.endsWith("/")){let r=n.lastIndexOf("/");n=r>0?n.slice(0,r+1):"/"}return new URL(t,n).href}function Ot(t,e,n){let r=new DOMParser().parseFromString(t,"text/html"),o=[],i=new Set,s=a=>{if(!a)return;let c;try{c=Kt(a,e)}catch{return}i.has(c)||n.has(c)||kt.test(c)||(i.add(c),o.push(c))};return r.querySelectorAll("script[src]").forEach(a=>s(a.getAttribute("src"))),r.querySelectorAll('link[rel="modulepreload"][href], link[rel="preload"][as="script"][href]').forEach(a=>s(a.getAttribute("href"))),o}var R=!1,_=0,k,Pt=0,m="",A="",j="idle",$=new Set,S=new Map,T=new Map,Ee=30,Se=3e4,L=new Map,Ae=50,dt=new Set,Le=128,q=new Map,W=new Map,H=null,J=[],_e="_krate/i",Te=150,Re=200;function mt(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}function I(){return Pt++,Date.now().toString(36)+"-"+Pt.toString(36)}function it(t){try{let e=new URL(t,location.href);return e.hash="",e.href}catch{return t}}function x(t){let e=new URL(t,location.href);return pt(e.pathname)+e.search}function V(t,e=!1){let n=globalThis.__krateHardNavigate;if(typeof n=="function"){n(t,e);return}e?location.replace(t):location.assign(t)}function z(t,e){return{__krate:t,state:e===void 0?null:e}}function tt(t){if(t&&typeof t=="object"&&typeof t.__krate=="string")return t.__krate}function xe(){if(typeof history>"u")return null;let t=history.state;return tt(t)!==void 0?t.state:t}function Bt(){let t=new URL(location.href);return{url:t.href,pathname:O(t.pathname),search:t.search,hash:t.hash,status:j}}function Ft(){return typeof location>"u"?{url:"",pathname:"/",search:"",hash:"",status:"idle"}:Bt()}function st(){if($.size===0)return;let t=Bt();for(let e of Array.from($))try{e(t)}catch(n){console.error(n)}}function D(t){j!==t&&(j=t,st())}function Wt(t){return $.add(t),()=>{$.delete(t)}}function b(t,e,n=!1){try{let r=new CustomEvent(t,{detail:e,cancelable:n});return window.dispatchEvent(r),!r.defaultPrevented}catch{return!0}}function wt(t){try{let e=globalThis.__krate_onNavigation;typeof e=="function"&&e(t)}catch{}}function Y(t){if(t){if(L.delete(t),L.size>=Ae){let e=L.keys().next().value;e!==void 0&&L.delete(e)}L.set(t,window.scrollY||0)}}function jt(){let t=bt().prefetchTTL;return typeof t=="number"&&t>=0?t:Se}function Ce(t,e){for(S.delete(t);S.size>=Ee;){let n=S.keys().next().value;if(n===void 0)break;S.delete(n)}S.set(t,e)}function Pe(t){let e=S.get(t);if(e&&(S.delete(t),!(mt()-e.at>jt())))return e}function Et(t){if(t===void 0){S.clear(),T.clear();return}let e=it(t);S.delete(e),T.delete(e)}function St(t){return/text\/html|application\/xhtml\+xml/i.test(t)}function G(t){return/^\s*(<!doctype html|<html|<head|<body)/i.test(t)}function Ne(t){if(dt.has(t)||dt.size>=Le)return;dt.add(t);let e=document.createElement("link");e.rel="prefetch",e.as="script",e.href=t,document.head.appendChild(e)}function At(t){let e=it(t),n=S.get(e);if(n&&mt()-n.at<=jt())return Promise.resolve();let r=T.get(e);if(r)return r;let o=fetch(e,{headers:{Accept:"text/html"},credentials:"same-origin"}).then(async i=>{if(!i.ok)return;let s=i.headers.get("content-type")||"",a=i.url||e;if(new URL(a,location.href).origin!==location.origin)return;let c=await i.text();if(!(St(s)||s===""&&G(c))||T.get(e)!==o)return;Ce(e,{html:c,url:a,status:i.status,at:mt()});let u=new Set;document.querySelectorAll("script[src]").forEach(l=>u.add(l.src));for(let l of Ot(c,a,u))Ne(l)}).catch(()=>{}).finally(()=>{T.get(e)===o&&T.delete(e)});return T.set(e,o),o}function Lt(t){if(t.hasAttribute("data-krate-external")||t.hasAttribute("download"))return!1;let e=t.getAttribute("href");if(!e||e.startsWith("javascript:"))return!1;let n;try{n=new URL(e,location.href)}catch{return!1}if(n.origin!==location.origin)return!1;let r=t.getAttribute("target");return!(r&&r!=="_self")}function _t(t){let e=t.getAttribute("data-prefetch");return t.hasAttribute("data-prefetch")&&e!=="false"&&e!=="0"}function Me(t){let e=window.requestIdleCallback;typeof e=="function"?e(t,{timeout:1e3}):setTimeout(t,50)}function et(t){let e=t.target;if(!e||typeof e.closest!="function")return;let n=e.closest("a[data-prefetch]");if(!n||!_t(n)||!Lt(n))return;let r=n.getAttribute("href");if(!r)return;let o=new URL(r,location.href).href;if(x(o)===A)return;let i=W.get(n);i&&clearTimeout(i);let s=setTimeout(()=>{W.delete(n),At(o)},Re);W.set(n,s)}function $t(){H&&document.querySelectorAll("a[data-prefetch]").forEach(t=>{_t(t)&&H.observe(t)})}function He(){document.addEventListener("mouseover",et),document.addEventListener("focusin",et),typeof IntersectionObserver<"u"&&(H=new IntersectionObserver(t=>{for(let e of t){if(!e.isIntersecting)continue;let n=e.target,r=n.getAttribute("href");if(r&&Lt(n)&&_t(n)){let o=new URL(r,location.href).href;x(o)!==A&&Me(()=>{At(o)})}H.unobserve(e.target)}},{rootMargin:"200px"}),$t())}function De(){let t=typeof HTMLScriptElement<"u"?HTMLScriptElement.supports:void 0;if(!(typeof t!="function"||!t("speculationrules"))&&!document.querySelector('meta[http-equiv="Content-Security-Policy" i]'))try{let e=document.createElement("script");e.type="speculationrules";let n=U();e.textContent=JSON.stringify({prefetch:[{where:{and:[{href_matches:n+"/*"},{not:{href_matches:n+"/__krate/*"}},{not:{href_matches:n+"/api/*"}}]},eagerness:"moderate"}]});let r=o=>{o&&o.blockedURI==="inline"&&/^script-src/.test(String(o.effectiveDirective||o.violatedDirective||""))&&(e.remove(),document.removeEventListener("securitypolicyviolation",r))};document.addEventListener("securitypolicyviolation",r),document.head.appendChild(e)}catch{}}function Jt(){if(typeof window<"u"&&window.matchMedia)try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{}return!1}function Vt(){return bt().viewTransitions===!1||Jt()?!1:typeof document.startViewTransition=="function"}function w(t){return t.getElementById("root")||t.body}function Ie(){let t=document.querySelector("template[data-krate-loading]");if(t&&t.content&&J.length===0){let e=t.content.cloneNode(!0);J=Array.from(e.childNodes),document.body.appendChild(e)}if(!Vt()&&!Jt()){let e=w(document);e.style.transition=`opacity ${Te}ms ease`,e.style.opacity="0"}}function Tt(){for(let e of J)e.parentNode&&e.parentNode.removeChild(e);J=[];let t=w(document);t.style.opacity==="0"&&(t.style.opacity="")}function zt(t){t.querySelectorAll("[data-view-transition]").forEach(e=>{let n=e.getAttribute("data-view-transition");n&&(e.style.viewTransitionName=n);let r=e.getAttribute("data-view-transition-class");r&&e.style.setProperty("view-transition-class",r)})}var Ue=3e3;function Ke(t,e){let n=[];t.querySelectorAll('link[rel="stylesheet"]').forEach(u=>{let l=u.getAttribute("href");if(!l)return;let p=new URL(l,e).href;n.includes(p)||n.push(p)});let r=new Map,o=[];document.querySelectorAll('link[rel="stylesheet"]').forEach(u=>{let l=u;l.href&&(n.includes(l.href)&&!r.has(l.href)?r.set(l.href,l):o.push(l))});let i=[],s=[],a=null;n.forEach((u,l)=>{let p=r.get(u)||null;if(!p){let h=document.createElement("link");if(h.rel="stylesheet",h.href=u,s.push(new Promise(g=>{let f=()=>{h.removeEventListener("load",f),h.removeEventListener("error",f),g()};h.addEventListener("load",f),h.addEventListener("error",f)})),i.push({link:h,media:h.getAttribute("media")}),h.media="not all",a)a.after(h);else{let g=n.slice(l+1).map(f=>r.get(f)).find(f=>!!f);g?g.before(h):document.head.appendChild(h)}p=h}a=p});let c=Promise.resolve();if(s.length>0){let u,l=new Promise(p=>{u=setTimeout(p,Ue)});c=Promise.race([Promise.all(s).then(()=>{}),l]).then(()=>clearTimeout(u))}return{ready:c,commit(){for(let{link:u,media:l}of i)l===null?u.removeAttribute("media"):u.setAttribute("media",l);o.forEach(u=>u.remove())},abort(){i.forEach(({link:u})=>u.remove())}}}var Nt='meta[name="description"], meta[name="robots"], meta[property^="og:"], meta[name^="twitter:"], link[rel="canonical"], script[type="application/ld+json"]';function Oe(t){document.head.querySelectorAll(Nt).forEach(e=>e.remove()),t.head.querySelectorAll(Nt).forEach(e=>{document.head.appendChild(document.importNode(e,!0))})}var gt=null;function Mt(t){let e={};if(t)for(let n of Array.from(t.attributes))e[n.name]=n.value;return e}function yt(t){return{html:Mt(t.documentElement),body:Mt(t.body)}}function Be(t){let e=gt??yt(document),n=yt(t),r=(o,i,s)=>{if(o)for(let a of new Set([...Object.keys(i),...Object.keys(s)]))i[a]!==s[a]&&(s[a]===void 0?o.removeAttribute(a):o.setAttribute(a,s[a]))};r(document.documentElement,e.html,n.html),r(document.body,e.body,n.body),gt=n}function Gt(t,e){let n=new Set;document.querySelectorAll("script[src]:not([data-krate-spa])").forEach(i=>n.add(i.src));let r=[],o=new Set;return t.querySelectorAll("script[src]").forEach(i=>{let s=i.getAttribute("src");if(!s)return;let a=(i.getAttribute("type")||"").toLowerCase();if(a&&a!=="module"&&a!=="text/javascript"&&a!=="application/javascript")return;let c=Kt(s,e);!n.has(c)&&!o.has(c)&&(o.add(c),r.push({src:c,module:a==="module"}))}),r}function Yt(t){return new Promise(e=>{let n=document.createElement("script");n.src=t.src,t.module&&(n.type="module"),kt.test(t.src)||n.setAttribute("data-krate-spa",""),n.onload=()=>e(!0),n.onerror=()=>e(!1),document.body.appendChild(n)})}var nt=new Set;function Xt(t){t.querySelectorAll("script[data-krate-boot]").forEach(e=>{let n=e.textContent||"";if(!n||nt.has(n))return;nt.add(n);let r=document.createElement("script");r.text=n,document.head.appendChild(r),r.remove()})}function Fe(t){if(!t||t==="#")return null;let e=t.slice(1);try{e=decodeURIComponent(e)}catch{}return document.getElementById(e)||document.getElementsByName(e)[0]||null}function Rt(t){let e=Fe(t);if(!e)return!1;try{e.scrollIntoView({block:"start"})}catch{}return!0}function We(t,e){if(e.kind==="pop"){let r=e.restoreKey?L.get(e.restoreKey):void 0;if(r!==void 0){window.scrollTo(0,r);return}}let n=new URL(t,location.href).hash;Rt(n)||e.scroll&&e.kind!=="refresh"&&window.scrollTo(0,0)}var Z=null;function je(){let t=document.activeElement;if(t&&t!==document.body&&t.isConnected&&t!==Z)return;let e=w(document);e.hasAttribute("tabindex")||(e.setAttribute("tabindex","-1"),Z=e,e.addEventListener("blur",()=>{Z===e&&(e.removeAttribute("tabindex"),Z=null)},{once:!0}));try{e.focus({preventScroll:!0})}catch{}}var Ht="__krate-route-announcer";function $e(){let t=document.getElementById(Ht);t||(t=document.createElement("div"),t.id=Ht,t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.setAttribute("role","status"),t.setAttribute("style","position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0"),document.body.appendChild(t));let e=w(document).querySelector("h1"),n=document.title||(e&&e.textContent?e.textContent.trim():"")||O(location.pathname);t.textContent=n}function at(){let t=pt(O(location.pathname));document.querySelectorAll("a[data-krate-link]").forEach(e=>{let n=e.getAttribute("href"),r="";try{r=n?pt(O(new URL(n,location.href).pathname)):""}catch{r=""}let o="";r&&r===t?o="exact":r&&r!=="/"&&t.startsWith(r+"/")&&(o="segment"),o==="exact"?e.setAttribute("aria-current","page"):e.removeAttribute("aria-current"),o?e.setAttribute("data-krate-active",o):e.removeAttribute("data-krate-active")})}function Dt(t){let e=U()+t;return q.has(e)?Promise.resolve(q.get(e)??null):fetch(e,{headers:{Accept:"text/html"},credentials:"same-origin"}).then(async n=>{let r=n.ok?await n.text():null,o=r&&G(r)?r:null;return q.set(e,o),o}).catch(()=>null)}async function Je(t,e){let n=it(t.url);if(!t.bypassCache){let p=T.get(n);if(p&&await p,e.aborted)return{ok:!1,aborted:!0};let h=Pe(n);if(h){let g=new URL(t.url,location.href).hash,f=g&&!new URL(h.url,location.href).hash?h.url+g:h.url;return{ok:!0,doc:{html:h.html,url:f,status:h.status}}}}let r;try{r=await fetch(n,{headers:{Accept:"text/html"},credentials:"same-origin",signal:e,cache:t.bypassCache?"no-cache":"default"})}catch(p){return p?.name==="AbortError"||e.aborted?{ok:!1,aborted:!0}:b("krate:navigate-error",{url:t.url,status:0,error:p},!0)?{ok:!1,hard:t.url}:{ok:!1,aborted:!0}}let o=r.url||n;if(new URL(o,location.href).origin!==location.origin)return{ok:!1,hard:o};let i=r.headers.get("content-type")||"",s="";try{s=await r.text()}catch(p){if(p?.name==="AbortError"||e.aborted)return{ok:!1,aborted:!0};s=""}if(e.aborted)return{ok:!1,aborted:!0};let a=St(i)||i===""&&G(s),c=new URL(t.url,location.href).hash,u=c&&!new URL(o).hash?o+c:o;if(r.ok)return a?{ok:!0,doc:{html:s,url:u,status:r.status}}:{ok:!1,hard:u};if(b("krate:navigate-error",{url:t.url,status:r.status}),a&&G(s))return{ok:!0,doc:{html:s,url:u,status:r.status}};let l=null;return r.status===404||r.status===410?l=await Dt("/404.html"):r.status>=500&&(l=await Dt("/500.html")),e.aborted?{ok:!1,aborted:!0}:l?{ok:!0,doc:{html:l,url:u,status:r.status}}:{ok:!1,hard:u}}async function ct(t){let e=location.href;if(t.kind!=="pop"){if(!b("krate:navigate-start",{url:t.url,from:e,kind:t.kind},!0))return}else b("krate:navigate-start",{url:t.url,from:e,kind:t.kind});let n=++_;k&&k.abort();let r=new AbortController;k=r,D("loading"),!t.bypassCache&&S.has(it(t.url))||Ie();let i;try{i=await Je(t,r.signal)}finally{k===r&&(k=void 0)}if(n===_){if(!i.ok){Tt(),D("idle"),"hard"in i&&V(i.hard,t.kind==="replace"||t.kind==="refresh");return}await Ve(i.doc,t,n)}}async function Ve(t,e,n){let r=new DOMParser().parseFromString(t.html,"text/html"),o=t.url,i=w(r),s=w(document);e.kind==="push"&&Y(m);let a=Qt(r),c=Xe(N,a,location.href,o,r),u=Ke(r,o);if(await u.ready,n!==_){u.abort();return}if(await ze(()=>{let g=r.querySelector("title");g&&(document.title=g.textContent||"");let f=globalThis;if(c.keep.length>0&&typeof f.krateDisposeExcept=="function"?f.krateDisposeExcept(c.keep):typeof f.disposeAll=="function"&&f.disposeAll(),c.region){let{live:v,next:d}=c.region;rt(v[0],v[1]);let E=K(d[0],d[1]).map(y=>document.importNode(y,!0));for(let y of E)v[1].parentNode.insertBefore(y,v[1]);for(let y of c.slots){rt(y.live[0],y.live[1]);for(let B of K(y.next[0],y.next[1]))y.live[1].parentNode.insertBefore(document.importNode(B,!0),y.live[1])}Ge(s,i)}else{let v=Array.from(i.childNodes).map(d=>document.importNode(d,!0));s.replaceChildren(...v)}N=c.chain,X.clear(),u.commit(),Oe(r),Be(r),zt(document)}),n!==_)return;Tt(),e.kind==="push"?(m=I(),history.pushState(z(m,e.state),"",o)):e.kind==="replace"?(L.delete(m),m=I(),history.replaceState(z(m,e.state),"",o)):e.kind==="refresh"?o!==location.href&&history.replaceState(history.state,"",o):e.restoreKey&&(m=e.restoreKey),A=x(location.href),M=A,ee(r),Qe(r),We(o,e),e.kind!=="pop"&&e.kind!=="refresh"&&je(),e.kind!=="refresh"&&$e(),at(),b("krate:navigate",{url:location.href,status:t.status}),wt(location.href),D("idle"),document.querySelectorAll("script[data-krate-spa]").forEach(g=>g.remove()),Xt(r);let p=Gt(r,o);Ut(c.skip);let h=await Promise.all(p.map(Yt));if(Ut([]),n===_){if(h.some(g=>!g)){b("krate:navigate-error",{url:location.href,status:t.status,error:"script-load"}),V(location.href,!0);return}ot(),b("krate:navigate-end",{url:location.href,status:t.status})}}function ze(t){if(!Vt())return t(),Promise.resolve();let e=!1,n=()=>{e||(e=!0,t())};try{let r=document.startViewTransition(n);r&&r.finished&&typeof r.finished.catch=="function"&&r.finished.catch(()=>{}),r&&r.ready&&typeof r.ready.catch=="function"&&r.ready.catch(()=>{});let o=r&&r.updateCallbackDone;if(o&&typeof o.then=="function")return o.then(()=>n(),()=>n())}catch{}return n(),Promise.resolve()}var N=[];function Qt(t){let e=t.getElementById("__krate_route");if(!e)return[];try{let n=JSON.parse(e.textContent||"{}");return Array.isArray(n.chain)?n.chain:[]}catch{return F("unreadable #__krate_route route info; layouts will be remounted"),[]}}function It(t,e){let n=O(new URL(t,location.href).pathname).split("/").filter(Boolean);return(e<0?n:n.slice(0,e)).join("/")}function P(t,e,n="kl:"){let o=(t.ownerDocument||t).createTreeWalker(t,128),i=n+e,s="/"+n+e;for(;o.nextNode();){let a=o.currentNode;if(a.nodeValue===i){for(let c=a.nextSibling;c;c=c.nextSibling)if(c.nodeType===8&&c.nodeValue===s)return[a,c];return null}}return null}function K(t,e){let n=[];for(let r=t.nextSibling;r&&r!==e;r=r.nextSibling)n.push(r);return n}function rt(t,e){let n=globalThis.disposeNode;for(let r of K(t,e))r.parentNode.removeChild(r),typeof n=="function"&&n(r)}function Ge(t,e){let n=":scope > template[data-krate-loading]";t.querySelectorAll(n).forEach(r=>r.remove()),e.querySelectorAll(n).forEach(r=>t.appendChild(document.importNode(r,!0)))}function Ut(t){let e=globalThis.krateKeepScopes;typeof e=="function"&&e(t)}function Ye(t){let e=globalThis.krateScopeFailed;return typeof e=="function"&&!!e(t)}function Xe(t,e,n,r,o){let i={keep:[],skip:[],region:null,slots:[],chain:e},s=0;for(;s<t.length&&s<e.length;){let f=t[s],v=e[s];if(f.id!==v.id||f.k!==v.k||f.k!=="layout"&&f.k!=="error"||It(n,f.d)!==It(r,v.d)||f.k==="error"&&Ye(f.id))break;if(!f.p||!v.p){F(`layout ${v.f||v.id} is remounted on this navigation: ${v.why||f.why||"not persistable"}`);break}s++}if(s===0)return i;if(typeof globalThis.krateDisposeExcept!="function")return F("the runtime has no krateDisposeExcept; layouts are remounted"),i;let a=e[s-1].id,c=P(w(document),a),u=P(w(o),a);if(!c||!u)return F(`layout ${e[s-1].f||a} boundary markers are missing; the whole page is swapped`),i;let l=t.slice(0,s).map(f=>f.id),p=l.slice(),h=[],g=e.slice();for(let f=0;f<s;f++){let v=t[f].s||[],d=[];for(let E of e[f].s||[]){let y=v.find(pe=>pe.key===E.key),B=P(w(document),E.key,"ks:"),ut=P(w(o),E.key,"ks:");if(y&&B&&(E.src!=="page"||!ut)){l.push(y.scope),p.push(y.scope,E.scope),d.push({...E,scope:y.scope,src:y.src});continue}if(B&&ut){h.push({live:B,next:ut}),d.push(E);continue}return F(`slot @${E.n} markers are missing; the whole page is swapped`),i}g[f]={...e[f],s:d}}return{keep:l,skip:p,region:{live:c,next:u},slots:h,chain:g}}var X=new Map,M="";function vt(t){let e=t.replace(/^\/+|\/+$/g,"");return e?e.split("/").map(n=>n.startsWith("[[...")&&n.endsWith("]]")?{kind:3,text:n.slice(5,-2)}:n.startsWith("[...")&&n.endsWith("]")?{kind:2,text:n.slice(4,-1)}:n.startsWith("[")&&n.endsWith("]")?{kind:1,text:n.slice(1,-1)}:{kind:0,text:n}):[]}function Zt(t,e){let n=vt(e),r=t.replace(/^\/+|\/+$/g,""),o=r?r.split("/"):[],i={};for(let s=0;s<n.length;s++){let a=n[s];if(a.kind>=2){if(s!==n.length-1)return null;let c=o.slice(s);return a.kind===2&&c.length===0||c.some(u=>u==="")?null:(i[a.text]=c.map(ht).join("/"),i)}if(s>=o.length)return null;if(a.kind===1){if(!o[s])return null;i[a.text]=ht(o[s])}else if(ht(o[s])!==a.text)return null}return o.length===n.length?i:null}function ht(t){try{return decodeURIComponent(t)}catch{return t}}function qt(t,e){let n=vt(t),r=vt(e);for(let o=0;o<n.length&&o<r.length;o++){if(n[o].kind!==r[o].kind)return n[o].kind-r[o].kind;if(n[o].kind===0&&n[o].text!==r[o].text)return n[o].text<r[o].text?-1:1}return n.length!==r.length?r.length-n.length:t<e?-1:t>e?1:0}function xt(t){let e=O(new URL(t,location.href).pathname).replace(/^\/+|\/+$/g,""),n=null;for(let r of N)for(let o of r.s||[])for(let i of o.i||[])Zt(e,i)&&(!n||qt(i,n.pattern)<0)&&(n={hit:{entry:r,slot:o,path:e},pattern:i});return n&&!P(w(document),n.hit.slot.key,"ks:")?null:n?n.hit:null}function te(t,e){N=N.map(n=>n.s&&n.s.some(r=>r.key===t)?{...n,s:n.s.map(r=>r.key===t?e:r)}:n)}function ee(t){let e="",n=t.getElementById("__krate_page");if(n)try{let r=JSON.parse(n.textContent||"{}");typeof r.r=="string"&&(e=r.r)}catch{}globalThis.__KRATE_ROUTE__=e;for(let r of Array.from(t.querySelectorAll("script:not([src])"))){let o=/window\.__KRATE_PARAMS__\s*=\s*(\{[\s\S]*?\})\s*;?\s*$/.exec(r.textContent||"");if(o){try{globalThis.__KRATE_PARAMS__=JSON.parse(o[1])}catch{}return}}delete globalThis.__KRATE_PARAMS__}function Qe(t){let e=t.getElementById("__krate_error"),n=document.getElementById("__krate_error");if(!e){n&&n.remove();return}let r=document.importNode(e,!0);n?n.replaceWith(r):document.head.appendChild(r)}function ne(t){let e=globalThis.krateDisposeScopes;typeof e=="function"&&e(t)}async function Ct(t,e){let n=location.href;if(t.kind!=="pop"&&!b("krate:navigate-start",{url:t.url,from:n,kind:t.kind,intercept:e.slot.n},!0))return;let r=++_;k&&k.abort();let o=new AbortController;k=o,D("loading");let i=location.origin+U()+"/"+_e+"/"+e.slot.key+(e.path?"/"+e.path:""),s="",a=!1;try{let d=await fetch(i,{headers:{Accept:"text/html"},credentials:"same-origin",signal:o.signal,cache:t.bypassCache?"no-cache":"default"});s=await d.text(),a=d.ok&&(St(d.headers.get("content-type")||"")||G(s)),a||b("krate:navigate-error",{url:t.url,status:d.status,intercept:e.slot.n})}catch(d){if(d?.name==="AbortError"||o.signal.aborted)return;b("krate:navigate-error",{url:t.url,status:0,error:d,intercept:e.slot.n})}finally{k===o&&(k=void 0)}if(r!==_)return;let c=a?new DOMParser().parseFromString(s,"text/html"):null,u=c?P(w(c),e.slot.key,"ks:"):null,l=P(w(document),e.slot.key,"ks:"),p=null;try{let d=c&&c.getElementById("__krate_route");p=d&&JSON.parse(d.textContent||"{}").frag||null}catch{p=null}if(!c||!u||!l||!p||p.key!==e.slot.key||!p.scope){try{console.warn(`[krate router] intercepting route for ${t.url} (slot @${e.slot.n}) could not be loaded; navigating to the page`)}catch{}return D("idle"),ct({...t})}if(t.kind==="push"&&Y(m),e.slot.src!=="intercept"){X.set(m,{key:e.slot.key,nodes:K(l[0],l[1]),slot:e.slot,path:M});for(let d of K(l[0],l[1]))d.parentNode.removeChild(d)}else ne([e.slot.scope]),rt(l[0],l[1]);for(let d of K(u[0],u[1]))l[1].parentNode.insertBefore(document.importNode(d,!0),l[1]);let h=new Set;document.querySelectorAll('link[rel="stylesheet"]').forEach(d=>h.add(d.href)),c.querySelectorAll('link[rel="stylesheet"][href]').forEach(d=>{let E=new URL(d.getAttribute("href"),i).href;if(h.has(E))return;let y=document.createElement("link");y.rel="stylesheet",y.href=E,document.head.appendChild(y)}),te(e.slot.key,{...e.slot,scope:p.scope,src:"intercept"}),Xt(c);let g={__krate:"",state:t.state===void 0?null:t.state,__kint:{key:e.slot.key,base:M}};t.kind==="push"?(m=I(),g.__krate=m,history.pushState(g,"",t.url)):t.kind==="replace"?(m=I(),g.__krate=m,history.replaceState(g,"",t.url)):t.kind==="pop"&&t.restoreKey&&(m=t.restoreKey),A=x(location.href),ee(c),at(),b("krate:navigate",{url:location.href,status:200,intercept:e.slot.n}),wt(location.href),D("idle");let f=Gt(c,i),v=await Promise.all(f.map(Yt));if(r===_){if(v.some(d=>!d)){b("krate:navigate-error",{url:location.href,status:200,error:"script-load",intercept:e.slot.n}),V(location.href,!0);return}ot(),b("krate:navigate-end",{url:location.href,status:200,intercept:e.slot.n})}}function Ze(t,e){let n=P(w(document),t.key,"ks:"),r=N.flatMap(i=>i.s||[]).find(i=>i.key===t.key);if(!n||!r||r.src!=="intercept")return!1;ne([r.scope]),rt(n[0],n[1]);for(let i of t.nodes)n[1].parentNode.insertBefore(i,n[1]);te(t.key,t.slot),X.delete(e),m=e,A=x(location.href);let o=L.get(e);return o!==void 0&&window.scrollTo(0,o),at(),b("krate:navigate",{url:location.href,status:200}),wt(location.href),st(),!0}function qe(t){return x(t)===A}function re(){j==="loading"&&(_++,k&&k.abort(),k=void 0,Tt(),D("idle"))}function tn(t,e){re(),Y(m),(t!==location.href||e.state!==void 0)&&(e.kind==="replace"?history.replaceState(z(m||I(),e.state),"",t):(m=I(),history.pushState(z(m,e.state),"",t)));let n=new URL(t).hash;!Rt(n)&&e.scroll&&!n&&window.scrollTo(0,0),st()}function lt(t){let e;try{e=new URL(t.url,location.href)}catch{return V(t.url),Promise.resolve()}if(e.origin!==location.origin)return V(e.href,t.kind==="replace"),Promise.resolve();if(t.url=e.href,(t.kind==="push"||t.kind==="replace")&&qe(e.href)&&(e.hash||e.href===location.href))return tn(e.href,t),Promise.resolve();if(t.kind==="push"||t.kind==="replace"){let n=xt(e.href);if(n)return Ct(t,n)}return ct(t)}function oe(t){if(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let e=t.target;if(!e||typeof e.closest!="function")return;let n=e.closest("a[data-krate-link]");if(!n||!Lt(n))return;let r=n.getAttribute("href");r&&(t.preventDefault(),lt({url:new URL(r,location.href).href,kind:n.hasAttribute("data-krate-replace")?"replace":"push",scroll:n.getAttribute("data-krate-scroll")!=="false"}))}function ie(t){if(t.defaultPrevented)return;let e=t.target;if(!e||e.tagName!=="FORM"||e.hasAttribute("data-krate-reload"))return;let n=t.submitter||null;if((n&&n.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()!=="get")return;let o=n&&n.getAttribute("formtarget")||e.getAttribute("target");if(o&&o!=="_self")return;let i=n&&n.getAttribute("formaction")||e.getAttribute("action")||"",s;try{s=new URL(i||location.href,location.href)}catch{return}if(s.origin!==location.origin||s.protocol.indexOf("http")!==0)return;let a;try{a=n?new FormData(e,n):new FormData(e)}catch{a=new FormData(e),n&&n.name&&a.append(n.name,n.value)}let c=new URLSearchParams;for(let[u,l]of a.entries()){if(typeof l!="string")return;c.append(u,l)}t.preventDefault(),s.search=c.toString(),s.hash="",lt({url:s.href,kind:"push",scroll:!0})}function se(t){Y(m);let e=tt(t.state),n=location.href;if(x(n)===A){re(),m=e||m;let i=e?L.get(e):void 0;i!==void 0?window.scrollTo(0,i):Rt(location.hash),st();return}let r=e?X.get(e):void 0;if(r&&e&&r.path===x(n)&&r.path===M&&Ze(r,e))return;let o=t.state&&typeof t.state=="object"?t.state.__kint:null;if(o&&o.base===M){let i=xt(n);if(i&&i.slot.key===o.key){Ct({url:n,kind:"pop",scroll:!1,restoreKey:e},i);return}}ct({url:n,kind:"pop",scroll:!0,restoreKey:e})}function ae(){Et(),ue()}function ce(){Y(m);try{history.scrollRestoration="auto"}catch{}}function le(){try{history.scrollRestoration="manual"}catch{}}function ot(){$t(),at(),zt(document),document.querySelectorAll("script[src]").forEach(t=>{kt.test(t.src)||t.setAttribute("data-krate-spa","")})}function ue(){if(!R||typeof location>"u")return typeof location<"u"&&location.reload(),Promise.resolve();if(A!==M){let t=xt(location.href);if(t&&t.slot.src==="intercept")return Ct({url:location.href,kind:"refresh",scroll:!1,bypassCache:!0},t)}return ct({url:location.href,kind:"refresh",scroll:!1,bypassCache:!0})}function fe(t,e={}){return R?lt({url:C(t),kind:"push",scroll:e.scroll!==!1,state:e.state}):(typeof location<"u"&&location.assign(C(t)),Promise.resolve())}function de(t,e={}){return R?lt({url:C(t),kind:"replace",scroll:e.scroll!==!1,state:e.state}):(typeof location<"u"&&location.replace(C(t)),Promise.resolve())}var en={push:fe,replace:de,back(){typeof history<"u"&&history.back()},forward(){typeof history<"u"&&history.forward()},refresh:ue,prefetch(t){if(!R||typeof location>"u")return Promise.resolve();let e;try{e=new URL(C(t),location.href)}catch{return Promise.resolve()}return e.origin!==location.origin?Promise.resolve():At(e.href)},subscribe:Wt,getState:Ft,invalidate:Et};function nn(t,e={}){return R?(e.replace?de(t,e):fe(t,e),!1):(typeof location<"u"&&(e.replace?location.replace(C(t)):location.assign(C(t))),!0)}function he(){if(!(typeof document>"u")){if(R){ot();return}if(R=!0,document.querySelectorAll("script[data-krate-boot]").forEach(t=>nt.add(t.textContent||"")),A=x(location.href),N=Qt(document),gt=yt(document),M=A,m=tt(history.state)||I(),tt(history.state)===void 0)try{history.replaceState(z(m,history.state),"",location.href)}catch{}try{history.scrollRestoration="manual"}catch{}document.addEventListener("click",oe),document.addEventListener("submit",ie),window.addEventListener("popstate",se),window.addEventListener("krate:revalidate",ae),window.addEventListener("pagehide",ce),window.addEventListener("pageshow",le),He(),De(),ot()}}function rn(){he()}function on(){if(R){R=!1,document.removeEventListener("click",oe),document.removeEventListener("submit",ie),window.removeEventListener("popstate",se),window.removeEventListener("krate:revalidate",ae),window.removeEventListener("pagehide",ce),window.removeEventListener("pageshow",le),document.removeEventListener("mouseover",et),document.removeEventListener("focusin",et);for(let t of W.values())clearTimeout(t);W=new Map,H&&(H.disconnect(),H=null),k&&k.abort(),k=void 0,_++,S.clear(),T.clear(),L.clear(),q.clear(),nt.clear(),$.clear(),j="idle",J=[],N=[],X.clear(),M=""}}return be(sn);})();
|
|
2
2
|
for (const k in __krate_exports) { window[k] = __krate_exports[k]; }
|