@pie-players/pie-assessment-toolkit 0.3.69 → 0.3.70

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.
@@ -1 +1 @@
1
- import"./chunks/ItemToolBar-pe5szfyx.js";import{H as w,J as G,K as Y,d as U,e as V,g as F,o as E,t as W,v as X}from"./chunks/ItemToolBar-rd7te9r0.js";var x=(H,A)=>{if(customElements.get(H))return;try{customElements.define(H,A)}catch(C){if(!(C instanceof DOMException&&C.name==="NotSupportedError"||C&&typeof C==="object"&&C.name==="NotSupportedError")||!customElements.get(H))throw C}},D=W("<pie-item-toolbar></pie-item-toolbar>",2);function Z(H,A){U(A,!0);let C=G(A,"enabledTools",7,""),J=G(A,"position",7,"bottom"),K=G(A,"sectionId",7,""),L=G(A,"size",7,"md"),M=G(A,"language",7,"en-US"),O=G(A,"toolRegistry",7,null),P=G(A,"item",7,null),Q=G(A,"hostButtons",23,()=>[]);var j={get enabledTools(){return C()},set enabledTools(k){C(k),F()},get position(){return J()},set position(k){J(k),F()},get sectionId(){return K()},set sectionId(k){K(k),F()},get size(){return L()},set size(k){L(k),F()},get language(){return M()},set language(k){M(k),F()},get toolRegistry(){return O()},set toolRegistry(k){O(k),F()},get item(){return P()},set item(k){P(k),F()},get hostButtons(){return Q()},set hostButtons(k){Q(k),F()}},q=D();return w(q,"level","section"),E(()=>w(q,"scope-id",K())),E(()=>w(q,"section-id",K())),E(()=>w(q,"tools",C())),w(q,"content-kind","section"),E(()=>w(q,"position",J())),E(()=>w(q,"size",L())),E(()=>w(q,"language",M())),E(()=>w(q,"toolRegistry",O())),E(()=>w(q,"item",P())),E(()=>w(q,"hostButtons",Q())),X(H,q),V(j)}x("pie-section-toolbar",Y(Z,{enabledTools:{attribute:"enabled-tools",type:"String"},position:{attribute:"position",type:"String"},sectionId:{attribute:"section-id",type:"String"},size:{attribute:"size",type:"String"},language:{attribute:"language",type:"String"},toolRegistry:{type:"Object"},item:{type:"Object"},hostButtons:{type:"Object"}},[],[],{mode:"open"}));export{Z as default};
1
+ import"./chunks/ItemToolBar-16t5ary7.js";import{I as w,K as G,L as Y,d as U,e as V,g as F,p as E,u as W,w as X}from"./chunks/ItemToolBar-12jy8e7c.js";var x=(H,A)=>{if(customElements.get(H))return;try{customElements.define(H,A)}catch(C){if(!(C instanceof DOMException&&C.name==="NotSupportedError"||C&&typeof C==="object"&&C.name==="NotSupportedError")||!customElements.get(H))throw C}},D=W("<pie-item-toolbar></pie-item-toolbar>",2);function Z(H,A){U(A,!0);let C=G(A,"enabledTools",7,""),J=G(A,"position",7,"bottom"),K=G(A,"sectionId",7,""),L=G(A,"size",7,"md"),M=G(A,"language",7,"en-US"),O=G(A,"toolRegistry",7,null),P=G(A,"item",7,null),Q=G(A,"hostButtons",23,()=>[]);var j={get enabledTools(){return C()},set enabledTools(k){C(k),F()},get position(){return J()},set position(k){J(k),F()},get sectionId(){return K()},set sectionId(k){K(k),F()},get size(){return L()},set size(k){L(k),F()},get language(){return M()},set language(k){M(k),F()},get toolRegistry(){return O()},set toolRegistry(k){O(k),F()},get item(){return P()},set item(k){P(k),F()},get hostButtons(){return Q()},set hostButtons(k){Q(k),F()}},q=D();return w(q,"level","section"),E(()=>w(q,"scope-id",K())),E(()=>w(q,"section-id",K())),E(()=>w(q,"tools",C())),w(q,"content-kind","section"),E(()=>w(q,"position",J())),E(()=>w(q,"size",L())),E(()=>w(q,"language",M())),E(()=>w(q,"toolRegistry",O())),E(()=>w(q,"item",P())),E(()=>w(q,"hostButtons",Q())),X(H,q),V(j)}x("pie-section-toolbar",Y(Z,{enabledTools:{attribute:"enabled-tools",type:"String"},position:{attribute:"position",type:"String"},sectionId:{attribute:"section-id",type:"String"},size:{attribute:"size",type:"String"},language:{attribute:"language",type:"String"},toolRegistry:{type:"Object"},item:{type:"Object"},hostButtons:{type:"Object"}},[],[],{mode:"open"}));export{Z as default};
@@ -0,0 +1,49 @@
1
+ var a1=((J)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(J,{get:(Q,W)=>(typeof require<"u"?require:Q)[W]}):J)(function(J){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+J+'" is not supported')});var P4="5";if(typeof window<"u")((window.__svelte??={}).v??=new Set).add(P4);var b=2,l0=4,P7=8,A7=16777216,Q0=16,o=32,B0=64,p7=128,wJ=256,W0=512,x=1024,R=2048,_=4096,l=8192,g=16384,H0=32768,U7=33554432,F0=65536,B7=131072,KQ=262144,c0=524288,U4=1048576,v0=33554432,D0=65536,D7=2097152,I0=4194304,b0=8388608,X0=Symbol("$state"),CJ=Symbol("component"),QJ=Symbol("legacy props"),B4=Symbol(""),SJ=Symbol("proxy path"),NJ=Symbol("attributes"),WJ=Symbol("class"),XJ=Symbol("style"),zJ=Symbol("text"),GQ=Symbol("form reset"),$Q=Symbol("hmr anchor"),W7=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},qQ=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");var d7=3,R0=8;var H4=1,Y4=2,PQ=4,M4=8,V4=16,L4=1,F4=2,O4=4,w4=8,C4=16;var S4=1,N4=2;var _7="[",H7="[!",UQ="[?",I7="]",i0={};var y=Symbol("uninitialized"),O0=Symbol("filename"),A4=Symbol("hmr"),AJ="http://www.w3.org/1999/xhtml",ZJ="http://www.w3.org/2000/svg",BQ="http://www.w3.org/1998/Math/MathML";var q=!0;var X7="font-weight: bold",z7="font-weight: normal";function D4(J){if(q)console.warn(`%c[svelte] await_reactivity_loss
2
+ %cDetected reactivity loss when reading \`${J}\`. This happens when state is read in an async function after an earlier \`await\`
3
+ https://svelte.dev/e/await_reactivity_loss`,X7,z7);else console.warn("https://svelte.dev/e/await_reactivity_loss")}function I4(J,Q){if(q)console.warn(`%c[svelte] await_waterfall
4
+ %cAn async derived, \`${J}\` (${Q}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app
5
+ https://svelte.dev/e/await_waterfall`,X7,z7);else console.warn("https://svelte.dev/e/await_waterfall")}function R4(){if(q)console.warn(`%c[svelte] derived_inert
6
+ %cReading a derived belonging to a now-destroyed effect may result in stale values
7
+ https://svelte.dev/e/derived_inert`,X7,z7);else console.warn("https://svelte.dev/e/derived_inert")}function j4(J,Q,W){if(q)console.warn(`%c[svelte] hydration_attribute_changed
8
+ %cThe \`${J}\` attribute on \`${Q}\` changed its value between server and client renders. The client value, \`${W}\`, will be ignored in favour of the server value
9
+ https://svelte.dev/e/hydration_attribute_changed`,X7,z7);else console.warn("https://svelte.dev/e/hydration_attribute_changed")}function T4(J){if(q)console.warn(`%c[svelte] hydration_html_changed
10
+ %c${J?`The value of an \`{@html ...}\` block ${J} changed between server and client renders. The client value will be ignored in favour of the server value`:"The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value"}
11
+ https://svelte.dev/e/hydration_html_changed`,X7,z7);else console.warn("https://svelte.dev/e/hydration_html_changed")}function Y7(J){if(q)console.warn(`%c[svelte] hydration_mismatch
12
+ %c${J?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${J}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
13
+ https://svelte.dev/e/hydration_mismatch`,X7,z7);else console.warn("https://svelte.dev/e/hydration_mismatch")}function x4(){if(q)console.warn(`%c[svelte] lifecycle_double_unmount
14
+ %cTried to unmount a component that was not mounted
15
+ https://svelte.dev/e/lifecycle_double_unmount`,X7,z7);else console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function DJ(J){if(q)console.warn(`%c[svelte] state_proxy_equality_mismatch
16
+ %cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${J}\` will produce unexpected results
17
+ https://svelte.dev/e/state_proxy_equality_mismatch`,X7,z7);else console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function k4(){if(q)console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",X7,z7);else console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var Z7=Array.isArray,E4=Array.prototype.indexOf,M7=Array.prototype.includes,l7=Array.from,KJ=Object.keys,c=Object.defineProperty,Y0=Object.getOwnPropertyDescriptor,IJ=Object.getOwnPropertyDescriptors,HQ=Object.prototype,b4=Array.prototype,R7=Object.getPrototypeOf,YQ=Object.isExtensible;var o0=()=>{};function RJ(J){for(var Q=0;Q<J.length;Q++)J[Q]()}function jJ(){var J,Q,W=new Promise((X,z)=>{J=X,Q=z});return{promise:W,resolve:J,reject:Q}}var MQ=new WeakMap;function y4(J){var Q=L;if(Q===null)return w.f|=b0,J;if(q&&J instanceof Error&&!MQ.has(J))MQ.set(J,B6(J,Q));if((Q.f&H0)===0&&(Q.f&l0)===0){if(q&&!Q.parent&&J instanceof Error)h4(J);throw J}w0(J,Q)}function w0(J,Q){if(Q!==null&&(Q.f&g)!==0)return;while(Q!==null){if((Q.f&p7)!==0&&(Q.f&(g|U7))===0){if((Q.f&H0)===0)throw J;try{Q.b.error(J);return}catch(W){J=W}}Q=Q.parent}if(q&&J instanceof Error)h4(J);throw J}function B6(J,Q){let W=Y0(J,"message");if(W&&!W.configurable)return;var X=GJ?" ":"\t",z=`
18
+ ${X}in ${Q.fn?.name||"<unknown>"}`,Z=Q.ctx;while(Z!==null)z+=`
19
+ ${X}in ${Z.function?.[O0].split("/").pop()}`,Z=Z.p;return{message:J.message+`
20
+ ${z}
21
+ `,stack:J.stack?.split(`
22
+ `).filter((K)=>!K.includes("svelte/src/internal")).join(`
23
+ `)}}function h4(J){let Q=MQ.get(J);if(Q)c(J,"message",{value:Q.message}),c(J,"stack",{value:Q.stack})}function g4(J){if(q){let Q=Error(`invariant_violation
24
+ An invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app — please open an issue at https://github.com/sveltejs/svelte, citing the following message: "${J}"
25
+ https://svelte.dev/e/invariant_violation`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/invariant_violation")}function m4(){if(q){let J=Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/async_derived_orphan")}function u4(){if(q){let J=Error(`derived_references_self
26
+ A derived value cannot reference itself recursively
27
+ https://svelte.dev/e/derived_references_self`);throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/derived_references_self")}function VQ(J,Q,W){if(q){let X=Error(`each_key_duplicate
28
+ ${W?`Keyed each block has duplicate key \`${W}\` at indexes ${J} and ${Q}`:`Keyed each block has duplicate key at indexes ${J} and ${Q}`}
29
+ https://svelte.dev/e/each_key_duplicate`);throw X.name="Svelte error",X}else throw Error("https://svelte.dev/e/each_key_duplicate")}function f4(J,Q,W){if(q){let X=Error(`each_key_volatile
30
+ Keyed each block has key that is not idempotent — the key for item at index ${J} was \`${Q}\` but is now \`${W}\`. Keys must be the same each time for a given item
31
+ https://svelte.dev/e/each_key_volatile`);throw X.name="Svelte error",X}else throw Error("https://svelte.dev/e/each_key_volatile")}function p4(J){if(q){let Q=Error(`effect_in_teardown
32
+ \`${J}\` cannot be used inside an effect cleanup function
33
+ https://svelte.dev/e/effect_in_teardown`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/effect_in_teardown")}function d4(){if(q){let J=Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/effect_in_unowned_derived")}function _4(J){if(q){let Q=Error(`effect_orphan
34
+ \`${J}\` can only be used inside an effect (e.g. during component initialisation)
35
+ https://svelte.dev/e/effect_orphan`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/effect_orphan")}function l4(){if(q){let J=Error(`effect_update_depth_exceeded
36
+ Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
37
+ https://svelte.dev/e/effect_update_depth_exceeded`);throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/effect_update_depth_exceeded")}function c4(){if(q){let J=Error(`hydration_failed
38
+ Failed to hydrate the application
39
+ https://svelte.dev/e/hydration_failed`);throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/hydration_failed")}function i4(J){if(q){let Q=Error(`props_invalid_value
40
+ Cannot do \`bind:${J}={undefined}\` when \`${J}\` has a fallback value
41
+ https://svelte.dev/e/props_invalid_value`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/props_invalid_value")}function o4(J){if(q){let Q=Error(`rune_outside_svelte
42
+ The \`${J}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
43
+ https://svelte.dev/e/rune_outside_svelte`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/rune_outside_svelte")}function s4(){if(q){let J=Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/state_descriptors_fixed")}function a4(){if(q){let J=Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/state_prototype_fixed")}function r4(){if(q){let J=Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/state_unsafe_mutation")}function n4(){if(q){let J=Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var r=!1,V7=!1,m0=!1;var A=null;function K7(J){A=J}var s0=null;function c7(J){s0=J}var j0=null;function TJ(J){j0=J}function LQ(J,Q=!1,W){if(A={p:A,i:!1,c:null,e:null,s:J,x:null,r:L,l:V7&&!Q?{s:null,u:null,$:[]}:null},q)A.function=W,j0=W}function FQ(J){var Q=A,W=Q.e;if(W!==null){Q.e=null;for(var X of W)OQ(X)}if(J!==void 0)Q.x=J;if(Q.i=!0,A=Q.p,q)j0=A?.function??null;return $J(J)}function $J(J={}){return c(J,CJ,{value:!0}),J}function u0(){return!V7||A!==null&&A.l===null}var j7=[];function e4(){var J=j7;j7=[],RJ(J)}function n(J){if(j7.length===0&&!T7){var Q=j7;queueMicrotask(()=>{if(Q===j7)e4()})}j7.push(J)}function J8(){while(j7.length>0)e4()}function xJ(J){return J===this.v}function kJ(J,Q){return J!=J?Q==Q:J!==Q||J!==null&&typeof J==="object"||typeof J==="function"}function EJ(J){return!kJ(J,this.v)}var qJ=null;function G0(J,Q){return J.label=Q,yJ(J.v,Q),J}function yJ(J,Q){return J?.[SJ]?.(Q),J}function f0(J){let Q=Error(),W=H6();if(W.length===0)return null;return W.unshift(`
44
+ `),c(Q,"stack",{value:W.join(`
45
+ `)}),c(Q,"name",{value:J}),Q}function H6(){let J=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let Q=Error().stack;if(Error.stackTraceLimit=J,!Q)return[];let W=Q.split(`
46
+ `),X=[];for(let z=0;z<W.length;z++){let Z=W[z],K=Z.replaceAll("\\","/");if(Z.trim()==="Error")continue;if(Z.includes("validate_each_keys"))return[];if(K.includes("svelte/src/internal")||K.includes("node_modules/.vite"))continue;X.push(Z)}return X}function W8(J,Q){if(!q)throw Error("invariant(...) was not guarded by if (DEV)");if(!J)g4(Q)}function a0(J){var Q=w,W=L;u(null),f(null);try{return J()}finally{u(Q),f(W)}}function hJ(J,Q,W,X){let z=u0()?F7:x7;var Z=J.filter((P)=>!P.settled),K=Q.map(z);if(q)K.forEach((P,M)=>{P.label=Q[M].toString().replace("() => ","").replaceAll("$.eager(() => ","$state.eager(").replace(/\$\.get\((.+?)\)/g,(O,V)=>V)});if(W.length===0&&Z.length===0){X(K);return}var G=L,$=X8(),Y=Z.length===1?Z[0].promise:Z.length>1?Promise.all(Z.map((P)=>P.promise)):null;function H(P){if((G.f&g)!==0)return;$();try{X([...K,...P])}catch(M){w0(M,G)}i7()}var B=wQ();if(W.length===0){Y.then(()=>H([])).finally(B);return}function U(){Promise.all(W.map((P)=>SQ(P))).then(H).catch((P)=>w0(P,G)).finally(B)}if(Y)Y.then(()=>{$(),U(),i7()});else U()}function X8(){var J=L,Q=w,W=A,X=C;if(q)var z=s0;return function(K=!0){if(f(J),u(Q),K7(W),K&&(J.f&g)===0)X?.activate(),X?.apply();if(q)CQ(null),c7(z)}}var M6=!1;function i7(J=!0){if(M6=!1,f(null),u(null),K7(null),J)C?.deactivate();if(q)CQ(null),c7(null)}function wQ(){var J=L,Q=J.b,W=C,X=!!Q?.is_rendered();return Q?.update_pending_count(1,W),W.increment(X,J),()=>{Q?.update_pending_count(-1,W),W.decrement(X,J)}}var L6=~(R|_|x);function T(J,Q){J.f=J.f&L6|Q}function o7(J){if((J.f&W0)!==0||J.deps===null)T(J,x);else T(J,_)}var C0=null;function CQ(J){C0=J}var UJ=new Set;function F7(J){var Q=b|R;if(L!==null)L.f|=c0;let W={ctx:A,deps:null,effects:null,equals:xJ,f:Q,fn:J,reactions:null,rv:0,v:y,wv:0,parent:L,ac:null};if(q&&m0)W.created=f0("created at");return W}var s7=Symbol("obsolete");function SQ(J,Q,W){let X=L;if(X===null)m4();var z=void 0,Z=q0(y);if(q)Z.label=Q??J.toString();var K=!w,G=new Set;if(K8(()=>{var $=L;if(q)C0={effect:$,effect_deps:new Set,warned:!1};var Y=jJ();z=Y.promise;try{Promise.resolve(J()).then(Y.resolve,(P)=>{if(P!==W7)Y.reject(P)}).finally(i7)}catch(P){Y.reject(P),i7()}if(q){if(C0){if($.deps!==null)for(let P=0;P<M0;P+=1)C0.effect_deps.add($.deps[P]);if(t!==null)for(let P=0;P<t.length;P+=1)C0.effect_deps.add(t[P])}C0=null}var H=C;if(K){if(($.f&H0)!==0)var B=wQ();if(X.b?.is_rendered())H.async_deriveds.get($)?.reject(s7);else for(let P of G.values())P.reject(s7);G.add(Y),H.async_deriveds.set($,Y)}let U=(P,M=void 0)=>{if(q)C0=null;if(B?.(),G.delete(Y),M===s7)return;if(H.activate(),M)Z.f|=b0,p0(Z,M);else{if((Z.f&b0)!==0)Z.f^=b0;if(q&&W!==void 0&&!Z.equals(P))UJ.add(Z),setTimeout(()=>{if(UJ.has(Z)&&($.f&g)===0)I4(Z.label,W),UJ.delete(Z)});p0(Z,P)}H.deactivate()};Y.promise.then(U,(P)=>U(null,P||"unknown"))}),$0(()=>{for(let $ of G)$.reject(s7)}),q)Z.f|=I0;return new Promise(($)=>{function Y(H){function B(){if(H===z)$(Z);else Y(z)}H.then(B,B)}Y(z)})}function F6(J){let Q=F7(J);if(!r)mJ(Q);return Q}function x7(J){let Q=F7(J);return Q.equals=EJ,Q}function z8(J){var Q=J.effects;if(Q!==null){J.effects=null;for(var W=0;W<Q.length;W+=1)m(Q[W])}}var NQ=[];function BJ(J){var Q,W=L,X=J.parent;if(!T0&&X!==null&&J.v!==y&&(X.f&(g|l))!==0)return R4(),J.v;if(f(X),q){let z=k7;gJ(new Set);try{if(M7.call(NQ,J))u4();NQ.push(J),J.f&=~D0,z8(J),Q=vJ(J)}finally{f(W),gJ(z),NQ.pop()}}else try{J.f&=~D0,z8(J),Q=vJ(J)}finally{f(W)}return Q}function AQ(J){var Q=BJ(J);if(!J.equals(Q)){if(J.wv=a7(),!C?.is_fork||J.deps===null){if(C!==null)C.capture(J,Q,!0),O7?.capture(J,Q,!0);else J.v=Q;if(J.deps===null){T(J,x);return}}}if(T0)return;if(e!==null){if(L7()||C?.is_fork)e.set(J,Q)}else o7(J)}function Z8(J){if(J.effects===null)return;for(let Q of J.effects)if(Q.teardown||Q.ac){if(Q.teardown?.(),Q.ac!==null)a0(()=>{Q.ac.abort(W7),Q.ac=null});if(Q.fn!==null)Q.teardown=o0;E7(Q,0),HJ(Q)}}function DQ(J){if(J.effects===null)return;for(let Q of J.effects)if(Q.teardown&&Q.fn!==null)r0(Q)}var k7=new Set,y0=new Map;function gJ(J){k7=J}var IQ=!1;function G8(){IQ=!0}function q0(J,Q){var W={f:0,v:J,reactions:null,equals:xJ,rv:0,wv:0};if(q&&m0)W.created=Q??f0("created at"),W.updated=null,W.set_during_effect=!1,W.trace=null;return W}function n0(J,Q){let W=q0(J,Q);return mJ(W),W}function b7(J,Q=!1,W=!0){let X=q0(J);if(!Q)X.equals=EJ;if(V7&&W&&A!==null&&A.l!==null)(A.l.s??=[]).push(X);return X}function P0(J,Q,W=!1){if(w!==null&&(!V0||(w.f&B7)!==0)&&u0()&&(w.f&(b|Q0|I0|B7))!==0&&(d0===null||!d0.has(J)))r4();let X=W?G7(Q):Q;if(q)yJ(X,J.label);return p0(J,X,YJ)}function p0(J,Q,W=null){if(!J.equals(Q)){if(T0)y0.set(J,Q);else if(!y0.has(J))y0.set(J,J.v);var X=K0.ensure();if(X.capture(J,Q),q){if(m0||L!==null){J.updated??=new Map;let z=(J.updated.get("")?.count??0)+1;if(J.updated.set("",{error:null,count:z}),m0||z>5){let Z=f0("updated at");if(Z!==null){let K=J.updated.get(Z.stack);if(!K)K={error:Z,count:0},J.updated.set(Z.stack,K);K.count++}}}if(L!==null)J.set_during_effect=!0}if((J.f&b)!==0){let z=J;if((J.f&R)!==0)BJ(z);if(e===null)o7(z)}if(J.wv=a7(),$8(J,R,W),u0()&&L!==null&&(L.f&x)!==0&&(L.f&(o|B0))===0)if(x0===null)q8([J]);else x0.push(J);if(!X.is_fork&&k7.size>0&&!IQ)uJ()}return Q}function uJ(){IQ=!1;for(let J of k7){if((J.f&x)!==0)T(J,_);let Q;try{Q=w7(J)}catch{Q=!0}if(Q)r0(J)}k7.clear()}function y7(J){P0(J,J.v+1)}function $8(J,Q,W){var X=J.reactions;if(X===null)return;var z=u0(),Z=X.length;for(var K=0;K<Z;K++){var G=X[K],$=G.f;if(!z&&G===L)continue;var Y=($&R)===0;if(Y)T(G,Q);if(($&B7)!==0)k7.add(G);else if(($&b)!==0){var H=G;if(e?.delete(H),($&D0)===0){if($&W0&&(L===null||(L.f&D7)===0))G.f|=D0;$8(H,_,W)}}else if(Y){var B=G;if(($&Q0)!==0&&h0!==null)h0.add(B);if(W!==null)W.push(B);else MJ(B)}}}function P8(J){if(J===null)return;for(let Q of J){if((Q.f&b)===0||(Q.f&D0)===0)continue;Q.f^=D0,P8(Q.deps)}}function fJ(J,Q,W){if((J.f&R)!==0)Q.add(J);else if((J.f&_)!==0)W.add(J);P8(J.deps),T(J,x)}var U8=!1,pJ=!1,YW=Symbol("unmounted");function RQ(J){var Q=pJ;try{return pJ=!1,[J(),pJ]}finally{pJ=Q}}var dJ=null,r7=null,C=null,O7=null,e=null,xQ=null,T7=!1,jQ=!1,h7=null,YJ=null,B8=0,TQ=new Set,C6=1;class K0{id=C6++;#J=!1;linked=!0;#Q=null;#W=null;async_deriveds=new Map;current=new Map;previous=new Map;#G=new Set;#Z=new Set;#K=0;#X=new Map;#$=null;#z=[];#M=[];#P=new Set;#U=new Set;#B=new Map;#V=new Set;is_fork=!1;#q=!1;constructor(){if(r7===null)dJ=r7=this;else r7.#W=this,this.#Q=r7;r7=this}#O(){if(this.is_fork)return!0;for(let W of this.#X.keys()){var J=W,Q=!1;while(J.parent!==null){if(this.#B.has(J)){Q=!0;break}J=J.parent}if(!Q)return!0}return!1}skip_effect(J){if(!this.#B.has(J))this.#B.set(J,{d:[],m:[]});this.#V.delete(J)}unskip_effect(J,Q=(W)=>this.schedule(W)){var W=this.#B.get(J);if(W){this.#B.delete(J);for(var X of W.d)T(X,R),Q(X);for(X of W.m)T(X,_),Q(X)}this.#V.add(J)}#L(){if(this.#J=!0,B8++>1000)this.#Y(),S6();if(q)for(let G of this.current.keys())TQ.add(G);for(let G of this.#P)this.#U.delete(G),T(G,R),this.schedule(G);for(let G of this.#U)T(G,_),this.schedule(G);let J=this.#z;this.#z=[],this.apply();var Q=h7=[],W=[],X=YJ=[];for(let G of J)try{this.#w(G,Q,W)}catch($){if(V8(G),!this.#O())this.discard();throw $}if(C=null,X.length>0){var z=K0.ensure();for(let G of X)z.schedule(G)}if(h7=null,YJ=null,this.#O()){this.#H(W),this.#H(Q);for(let[G,$]of this.#B)M8(G,$);if(X.length>0)C.#L();return}let Z=this.#C();if(Z){this.#H(W),this.#H(Q),Z.#S(this);return}this.#P.clear(),this.#U.clear();for(let G of this.#G)G(this);this.#G.clear(),O7=this,H8(W),H8(Q),O7=null,this.#$?.resolve();var K=C;if(this.#K===0&&(this.#z.length===0||K!==null)){if(this.#Y(),r)this.#F(),C=K}if(this.#z.length>0)if(K!==null){let G=K;G.#z.push(...this.#z.filter(($)=>!G.#z.includes($)))}else K=this;if(K!==null)y0.clear(),K.#L()}#w(J,Q,W){J.f^=x;var X=J.first;while(X!==null){var z=X.f,Z=(z&(o|B0))!==0,K=Z&&(z&x)!==0,G=K||(z&l)!==0||this.#B.has(X);if(!G&&X.fn!==null){if(Z)X.f^=x;else if((z&l0)!==0)Q.push(X);else if(r&&(z&(P7|A7))!==0)W.push(X);else if(w7(X)){if((z&Q0)!==0)this.#U.add(X);r0(X)}var $=X.first;if($!==null){X=$;continue}}while(X!==null){var Y=X.next;if(Y!==null){X=Y;break}X=X.parent}}}#C(){var J=this.#Q;while(J!==null){if(!J.is_fork){for(let[Q,[,W]]of this.current)if(J.current.has(Q)&&!W)return J}J=J.#Q}return null}#S(J){for(let[W,X]of J.current){if(!this.previous.has(W)&&J.previous.has(W))this.previous.set(W,J.previous.get(W));this.current.set(W,X)}for(let[W,X]of J.async_deriveds){let z=this.async_deriveds.get(W);if(z)X.promise.then(z.resolve).catch(z.reject)}J.async_deriveds.clear(),this.transfer_effects(J.#P,J.#U);let Q=(W)=>{var X=W.reactions;if(X===null)return;if((W.f&b)!==0&&(W.f&(R|_))===0)return;for(let K of X){var z=K.f;if((z&b)!==0)Q(K);else{var Z=K;if(z&(I0|Q0)&&!this.async_deriveds.has(Z))this.#U.delete(Z),T(Z,R),this.schedule(Z)}}};for(let W of this.current.keys())Q(W);this.oncommit(()=>J.discard()),J.#Y(),C=this,this.#L()}#H(J){for(var Q=0;Q<J.length;Q+=1)fJ(J[Q],this.#P,this.#U)}capture(J,Q,W=!1){if(J.v!==y&&!this.previous.has(J))this.previous.set(J,J.v);if((J.f&b0)===0)this.current.set(J,[Q,W]),e?.set(J,Q);if(!this.is_fork)J.v=Q}activate(){C=this}deactivate(){C=null,e=null}flush(){try{if(q)TQ.clear();jQ=!0,C=this,this.#L()}finally{if(B8=0,xQ=null,h7=null,YJ=null,jQ=!1,C=null,e=null,y0.clear(),q)for(let J of TQ)J.updated=null}}discard(){for(let J of this.#Z)J(this);this.#Z.clear();for(let J of this.async_deriveds.values())J.reject(s7);this.#Y(),this.#$?.resolve()}register_created_effect(J){this.#M.push(J)}#F(){for(let H=dJ;H!==null;H=H.#W){var J=H.id<this.id,Q=[];for(let[B,[U,P]]of this.current){if(H.current.has(B)){var W=H.current.get(B)[0];if(J&&U!==W)H.current.set(B,[U,P]);else continue}Q.push(B)}if(J)for(let[B,U]of this.async_deriveds){let P=H.async_deriveds.get(B);if(P)U.promise.then(P.resolve).catch(P.reject)}var X=[...H.current.keys()].filter((B)=>!H.current.get(B)[1]);if(!H.#J||X.length===0)continue;var z=X.filter((B)=>!this.current.has(B));if(z.length===0){if(J)H.discard()}else if(Q.length>0){if(q&&!H.#q)W8(H.#z.length===0,"Batch has scheduled roots");if(J)for(let B of this.#V)H.unskip_effect(B,(U)=>{if((U.f&(Q0|I0))!==0)H.schedule(U);else H.#H([U])});H.activate();var Z=new Set,K=new Map;for(var G of Q)Y8(G,z,Z,K);K=new Map;var $=[...H.current].filter(([B,U])=>{let P=this.current.get(B);if(!P)return!0;return P[0]!==U[0]||P[1]!==U[1]}).map(([B])=>B);if($.length>0){for(let B of this.#M)if((B.f&(g|l|B7))===0&&kQ(B,$,K))if((B.f&(I0|Q0))!==0)T(B,R),H.schedule(B);else H.#P.add(B)}if(H.#z.length>0&&!H.#q){H.apply();for(var Y of H.#z)H.#w(Y,[],[]);H.#z=[]}H.deactivate()}}}increment(J,Q){if(this.#K+=1,J){let W=this.#X.get(Q)??0;this.#X.set(Q,W+1)}}decrement(J,Q){if(this.#K-=1,J){let W=this.#X.get(Q)??0;if(W===1)this.#X.delete(Q);else this.#X.set(Q,W-1)}if(this.#q)return;this.#q=!0,n(()=>{if(this.#q=!1,this.linked)this.flush()})}transfer_effects(J,Q){for(let W of J)this.#P.add(W);for(let W of Q)this.#U.add(W);J.clear(),Q.clear()}oncommit(J){this.#G.add(J)}ondiscard(J){this.#Z.add(J)}settled(){return(this.#$??=jJ()).promise}static ensure(){if(C===null){let J=C=new K0;if(!jQ&&!T7)n(()=>{if(!J.#J)J.flush()})}return C}apply(){if(!r||!this.is_fork&&this.#Q===null&&this.#W===null){e=null;return}e=new Map;for(let[Q,[W]]of this.current)e.set(Q,W);for(let Q=dJ;Q!==null;Q=Q.#W){if(Q===this||Q.is_fork)continue;var J=!1;if(Q.id<this.id)for(let[W,[,X]]of Q.current){if(X)continue;if(this.current.has(W)){J=!0;break}}if(!J){for(let[W,X]of Q.previous)if(!e.has(W))e.set(W,X)}}}schedule(J){if(xQ=J,J.b?.is_pending&&(J.f&(l0|P7|A7))!==0&&(J.f&H0)===0){J.b.defer_effect(J);return}var Q=J;while(Q.parent!==null){Q=Q.parent;var W=Q.f;if(h7!==null&&Q===L){if(r)return;if((w===null||(w.f&b)===0)&&!U8)return}if((W&(B0|o))!==0){if((W&x)===0)return;Q.f^=x}}this.#z.push(Q)}#Y(){if(!this.linked)return;var J=this.#Q,Q=this.#W;if(J===null)dJ=Q;else J.#W=Q;if(Q===null)r7=J;else Q.#Q=J;this.linked=!1}}function n7(J){var Q=T7;T7=!0;try{var W;if(J){if(C!==null&&!C.is_fork)C.flush();W=J()}while(!0){if(J8(),C===null)return W;C.flush()}}finally{T7=Q}}function S6(){if(q){var J=new Map;for(let W of C.current.keys())for(let[X,z]of W.updated??[]){var Q=J.get(X);if(!Q)Q={error:z.error,count:0},J.set(X,Q);Q.count+=z.count}for(let W of J.values())if(W.error)console.error(W.error)}try{l4()}catch(W){if(q)c(W,"stack",{value:""});w0(W,xQ)}}var h0=null;function H8(J){var Q=J.length;if(Q===0)return;var W=0;while(W<Q){var X=J[W++];if((X.f&(g|l))===0&&w7(X)){if(h0=new Set,r0(X),X.deps===null&&X.first===null&&X.nodes===null&&X.teardown===null&&X.ac===null)EQ(X);if(h0?.size>0){y0.clear();for(let z of h0){if((z.f&(g|l))!==0)continue;let Z=[z],K=z.parent;while(K!==null){if(h0.has(K))h0.delete(K),Z.push(K);K=K.parent}for(let G=Z.length-1;G>=0;G--){let $=Z[G];if(($.f&(g|l))!==0)continue;r0($)}}h0.clear()}}}h0=null}function Y8(J,Q,W,X){if(W.has(J))return;if(W.add(J),J.reactions!==null)for(let z of J.reactions){let Z=z.f;if((Z&b)!==0)Y8(z,Q,W,X);else if((Z&(I0|Q0))!==0&&(Z&R)===0&&kQ(z,Q,X))T(z,R),MJ(z)}}function kQ(J,Q,W){let X=W.get(J);if(X!==void 0)return X;if(J.deps!==null)for(let z of J.deps){if(M7.call(Q,z))return!0;if((z.f&b)!==0&&kQ(z,Q,W))return W.set(z,!0),!0}return W.set(J,!1),!1}function MJ(J){C.schedule(J)}function M8(J,Q){if((J.f&o)!==0&&(J.f&x)!==0)return;if((J.f&R)!==0)Q.d.push(J);else if((J.f&_)!==0)Q.m.push(J);T(J,x);var W=J.first;while(W!==null)M8(W,Q),W=W.next}function V8(J){T(J,x);var Q=J.first;while(Q!==null)V8(Q),Q=Q.next}function F8(J){if(L===null){if(w===null)_4(J);d4()}if(T0)p4(J)}function A6(J,Q){var W=Q.last;if(W===null)Q.last=Q.first=J;else W.next=J,J.prev=W,Q.last=J}function t0(J,Q){var W=L;if(q)while(W!==null&&(W.f&B7)!==0)W=W.parent;if(W!==null&&(W.f&l)!==0)J|=l;var X={ctx:A,deps:null,nodes:null,f:J|R|W0,first:null,fn:Q,last:null,next:null,parent:W,b:W&&W.b,prev:null,teardown:null,wv:0,ac:null};if(q)X.component_function=j0;C?.register_created_effect(X);var z=X;if((J&l0)!==0)if(h7!==null)h7.push(X);else K0.ensure().schedule(X);else if(Q!==null){try{r0(X)}catch(K){throw m(X),K}if(z.deps===null&&z.teardown===null&&z.nodes===null&&z.first===z.last&&(z.f&c0)===0){if(z=z.first,(J&Q0)!==0&&(J&F0)!==0&&z!==null)z.f|=F0}}if(z!==null){if(z.parent=W,W!==null)A6(z,W);if(w!==null&&(w.f&b)!==0&&(J&B0)===0){var Z=w;(Z.effects??=[]).push(z)}}return X}function L7(){return w!==null&&!V0}function $0(J){let Q=t0(P7,null);return T(Q,x),Q.teardown=J,Q}function yQ(J){if(F8("$effect"),q)c(J,"name",{value:"$effect"});var Q=L.f,W=!w&&(Q&o)!==0&&A!==null&&!A.i;if(W){var X=A;(X.e??=[]).push(J)}else return OQ(J)}function OQ(J){return t0(l0|U4,J)}function hQ(J){K0.ensure();let Q=t0(B0|c0,J);return()=>{m(Q)}}function O8(J){K0.ensure();let Q=t0(B0|c0,J);return(W={})=>{return new Promise((X)=>{if(W.outro)e0(Q,()=>{m(Q),X(void 0)});else m(Q),X(void 0)})}}function L0(J){return t0(l0,J)}function K8(J){return t0(I0|c0,J)}function J0(J,Q=0){return t0(P7|Q,J)}function gQ(J,Q=[],W=[],X=[]){hJ(X,Q,W,(z)=>{t0(P7,()=>{J(...z.map(I))})})}function S0(J,Q=0){var W=t0(Q0|Q,J);if(q)W.dev_stack=s0;return W}function a(J){return t0(o|c0,J)}function vQ(J){var Q=J.teardown;if(Q!==null){let W=T0,X=w;bQ(!0),u(null);try{Q.call(null)}catch(z){w0(z,J.parent)}finally{bQ(W),u(X)}}}function HJ(J,Q=!1){var W=J.first;J.first=J.last=null;while(W!==null){let z=W.ac;if(z!==null)a0(()=>{z.abort(W7)});var X=W.next;if((W.f&B0)!==0)W.parent=null;else m(W,Q);W=X}}function w8(J){var Q=J.first;while(Q!==null){var W=Q.next;if((Q.f&o)===0)m(Q);Q=W}}function m(J,Q=!0){var W=!1;if((Q||(J.f&KQ)!==0)&&J.nodes!==null&&J.nodes.end!==null)mQ(J.nodes.start,J.nodes.end),W=!0;J.f|=U7,HJ(J,Q&&!W),E7(J,0);var X=J.nodes&&J.nodes.t;if(X!==null)for(let Z of X)Z.stop();vQ(J),J.f^=U7,J.f|=g;var z=J.parent;if(z!==null&&z.first!==null)EQ(J);if(q)J.component_function=null;J.next=J.prev=J.teardown=J.ctx=J.deps=J.fn=J.nodes=J.ac=J.b=null}function mQ(J,Q){while(J!==null){var W=J===Q?null:s(J);J.remove(),J=W}}function EQ(J){var{parent:Q,prev:W,next:X}=J;if(W!==null)W.next=X;if(X!==null)X.prev=W;if(Q!==null){if(Q.first===J)Q.first=X;if(Q.last===J)Q.last=W}}function e0(J,Q,W=!0){var X=[];J.f|=wJ,C8(J,X,!0);var z=()=>{if(W)m(J);if(Q)Q()},Z=X.length;if(Z>0){var K=()=>--Z||z();for(var G of X)G.out(K)}else z()}function C8(J,Q,W){if((J.f&l)!==0)return;J.f^=l;var X=J.nodes&&J.nodes.t;if(X!==null){for(let G of X)if(G.is_global||W)Q.push(G)}var z=J.first;while(z!==null){var Z=z.next;if((z.f&B0)===0){var K=(z.f&F0)!==0||(z.f&o)!==0&&(J.f&Q0)!==0;C8(z,Q,K?W:!1)}z=Z}}function t7(J){J.f&=~wJ,S8(J,!0)}function S8(J,Q){if((J.f&wJ)!==0)return;if((J.f&l)===0)return;if(J.f^=l,(J.f&x)===0)T(J,R),K0.ensure().schedule(J);var W=J.first;while(W!==null){var X=W.next,z=(W.f&F0)!==0||(W.f&o)!==0;S8(W,z?Q:!1),W=X}var Z=J.nodes&&J.nodes.t;if(Z!==null){for(let K of Z)if(K.is_global||Q)K.in()}}function e7(J,Q){if(!J.nodes)return;var W=J.nodes.start,X=J.nodes.end;while(W!==null){var z=W===X?null:s(W);Q.append(W),W=z}}var N8=null;var _J=!1,T0=!1;function bQ(J){T0=J}var w=null,V0=!1;function u(J){w=J}var L=null;function f(J){L=J}var d0=null;function mJ(J){if(w!==null&&(!r||(w.f&b)!==0))(d0??=new Set).add(J)}var t=null,M0=0,x0=null;function q8(J){x0=J}var D8=1,g7=0,C7=g7;function uQ(J){C7=J}function a7(){return++D8}function w7(J){var Q=J.f;if((Q&R)!==0)return!0;if(Q&b)J.f&=~D0;if((Q&_)!==0){var W=J.deps,X=W.length;for(var z=0;z<X;z++){var Z=W[z];if(w7(Z))AQ(Z);if(Z.wv>J.wv)return!0}if((Q&W0)!==0&&e===null)T(J,x)}return!1}function I8(J,Q,W=!0){var X=J.reactions;if(X===null)return;if(!r&&d0!==null&&d0.has(J))return;for(var z=0;z<X.length;z++){var Z=X[z];if((Z.f&b)!==0)I8(Z,Q,!1);else if(Q===Z){if(W)T(Z,R);else if((Z.f&x)!==0)T(Z,_);MJ(Z)}}}function vJ(J){var Q=t,W=M0,X=x0,z=w,Z=d0,K=A,G=V0,$=C7,Y=J.f;if(t=null,M0=0,x0=null,w=(Y&(o|B0))===0?J:null,d0=null,K7(J.ctx),V0=!1,C7=++g7,J.ac!==null)a0(()=>{J.ac.abort(W7)}),J.ac=null;try{J.f|=D7;var H=J.fn,B=H();J.f|=H0;var U=A8(J);if(u0()&&x0!==null&&!V0&&U!==null&&(J.f&(b|_|R))===0)for(var P=0;P<x0.length;P++)I8(x0[P],J);if(z!==null&&z!==J){if(g7++,z.deps!==null)for(let M=0;M<W;M+=1)z.deps[M].rv=g7;if(Q!==null)for(let M of Q)M.rv=g7;if(x0!==null)if(X===null)X=x0;else X.push(...x0)}if((J.f&b0)!==0)J.f^=b0;return B}catch(M){return A8(J),y4(M)}finally{J.f^=D7,t=Q,M0=W,x0=X,w=z,d0=Z,K7(K),V0=G,C7=$}}function A8(J){var Q=J.deps,W=C?.is_fork;if(t!==null){var X;if(!W)E7(J,M0);if(Q!==null&&M0>0){Q.length=M0+t.length;for(X=0;X<t.length;X++)Q[M0+X]=t[X]}else J.deps=Q=t;if(L7()&&(J.f&W0)!==0)for(X=M0;X<Q.length;X++)(Q[X].reactions??=[]).push(J)}else if(!W&&Q!==null&&M0<Q.length)E7(J,M0),Q.length=M0;return Q}function D6(J,Q){let W=Q.reactions;if(W!==null){var X=E4.call(W,J);if(X!==-1){var z=W.length-1;if(z===0)W=Q.reactions=null;else W[X]=W[z],W.pop()}}if(W===null&&(Q.f&b)!==0&&(t===null||!M7.call(t,Q))){var Z=Q;if((Z.f&W0)!==0)Z.f^=W0,Z.f&=~D0;if(Z.v!==y)o7(Z);if(Z.ac!==null)a0(()=>{Z.ac.abort(W7),Z.ac=null,T(Z,R)});Z8(Z),E7(Z,0)}}function E7(J,Q){var W=J.deps;if(W===null)return;for(var X=Q;X<W.length;X++)D6(J,W[X])}function r0(J){var Q=J.f;if((Q&g)!==0)return;T(J,x);var W=L,X=_J;if(L=J,_J=(Q&(o|B0))===0,q){var z=j0;TJ(J.component_function);var Z=s0;c7(J.dev_stack??s0)}try{if((Q&(Q0|A7))!==0)w8(J);else HJ(J);vQ(J);var K=vJ(J);if(J.teardown=typeof K==="function"?K:null,J.wv=D8,q&&m0&&(J.f&R)!==0&&J.deps!==null){for(var G of J.deps)if(G.set_during_effect)G.wv=a7(),G.set_during_effect=!1}}finally{if(_J=X,L=W,q)TJ(z),c7(Z)}}function I(J){var Q=J.f,W=(Q&b)!==0;if(N8?.add(J),w!==null&&!V0){var X=L!==null&&(L.f&g)!==0;if(!X&&(d0===null||!d0.has(J))){var z=w.deps;if((w.f&D7)!==0){if(J.rv<g7)if(J.rv=g7,t===null&&z!==null&&z[M0]===J)M0++;else if(t===null)t=[J];else t.push(J)}else{if(w.deps??=[],!M7.call(w.deps,J))w.deps.push(J);var Z=J.reactions;if(Z===null)J.reactions=[w];else if(!M7.call(Z,w))Z.push(w)}}}if(q){if(!V0&&C0&&C===null&&O7===null&&!C0.warned&&(C0.effect.f&D7)===0&&!C0.effect_deps.has(J)){C0.warned=!0,D4(J.label);var K=f0("traced at");if(K)console.warn(K)}if(UJ.delete(J),m0&&!V0&&qJ!==null&&w!==null&&qJ.reaction===w){if(J.trace)J.trace();else if(K=f0("traced at"),K){var G=qJ.entries.get(J);if(G===void 0)G={traces:[]},qJ.entries.set(J,G);var $=G.traces[G.traces.length-1];if(K.stack!==$?.stack)G.traces.push(K)}}}if(T0&&y0.has(J))return y0.get(J);if(W){var Y=J;if(T0){var H=Y.v;if((Y.f&x)===0&&Y.reactions!==null||j8(Y))H=BJ(Y);return y0.set(Y,H),H}var B=(Y.f&W0)===0&&!V0&&w!==null&&(_J||(w.f&W0)!==0),U=(Y.f&H0)===0;if(w7(Y)){if(B)Y.f|=W0;AQ(Y)}if(B&&!U)DQ(Y),R8(Y)}if(e?.has(J))return e.get(J);if((J.f&b0)!==0)throw J.v;return J.v}function R8(J){if(J.f|=W0,J.deps===null)return;for(let Q of J.deps)if((Q.reactions??=[]).push(J),(Q.f&b)!==0&&(Q.f&W0)===0)DQ(Q),R8(Q)}function j8(J){if(J.v===y)return!0;if(J.deps===null)return!1;for(let Q of J.deps){if(y0.has(Q))return!0;if((Q.f&b)!==0&&j8(Q))return!0}return!1}function h(J){var Q=V0;try{return V0=!0,J()}finally{V0=Q}}function cJ(J){if(typeof J!=="object"||!J||J instanceof EventTarget)return;if(X0 in J)lJ(J);else if(!Array.isArray(J))for(let Q in J){let W=J[Q];if(typeof W==="object"&&W&&X0 in W)lJ(W)}}function lJ(J,Q=new Set){if(typeof J==="object"&&J!==null&&!(J instanceof EventTarget)&&!Q.has(J)){if(Q.add(J),J instanceof Date)J.getTime();for(let X in J)try{lJ(J[X],Q)}catch(z){}let W=R7(J);if(W!==Object.prototype&&W!==Array.prototype&&W!==Map.prototype&&W!==Set.prototype&&W!==Date.prototype){let X=IJ(W);for(let z in X){let Z=X[z].get;if(Z)try{Z.call(J)}catch(K){}}}}}var I6=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function G7(J){if(typeof J!=="object"||J===null||X0 in J||CJ in J)return J;let Q=R7(J);if(Q!==HQ&&Q!==b4)return J;var W=new Map,X=Z7(J),z=n0(0),Z=q&&m0?f0("created at"):null,K=C7,G=(B)=>{if(C7===K)return B();var U=w,P=C7;u(null),uQ(K);var M=B();return u(U),uQ(P),M};if(X){if(W.set("length",n0(J.length,Z)),q)J=j6(J)}var $="";let Y=!1;function H(B){if(Y)return;Y=!0,$=B,G0(z,`${$} version`);for(let[U,P]of W)G0(P,v7($,U));Y=!1}return new Proxy(J,{defineProperty(B,U,P){if(!("value"in P)||P.configurable===!1||P.enumerable===!1||P.writable===!1)s4();var M=W.get(U);if(M===void 0)G(()=>{var O=n0(P.value,Z);if(W.set(U,O),q&&typeof U==="string")G0(O,v7($,U));return O});else P0(M,P.value,!0);return!0},deleteProperty(B,U){var P=W.get(U);if(P===void 0){if(U in B){let M=G(()=>n0(y,Z));if(W.set(U,M),y7(z),q)G0(M,v7($,U))}}else P0(P,y),y7(z);return!0},get(B,U,P){if(U===X0)return J;if(q&&U===SJ)return H;var M=W.get(U),O=U in B;if(M===void 0&&(!O||Y0(B,U)?.writable))M=G(()=>{var N=G7(O?B[U]:y),k=n0(N,Z);if(q)G0(k,v7($,U));return k}),W.set(U,M);if(M!==void 0){var V=I(M);return V===y?void 0:V}return Reflect.get(B,U,P)},getOwnPropertyDescriptor(B,U){var P=Reflect.getOwnPropertyDescriptor(B,U);if(P&&"value"in P){var M=W.get(U);if(M)P.value=I(M)}else if(P===void 0){var O=W.get(U),V=O?.v;if(O!==void 0&&V!==y)return{enumerable:!0,configurable:!0,value:V,writable:!0}}return P},has(B,U){if(U===X0)return!0;var P=W.get(U),M=P!==void 0&&P.v!==y||Reflect.has(B,U);if(P!==void 0||L!==null&&(!M||Y0(B,U)?.writable)){if(P===void 0)P=G(()=>{var V=M?G7(B[U]):y,N=n0(V,Z);if(q)G0(N,v7($,U));return N}),W.set(U,P);var O=I(P);if(O===y)return!1}return M},set(B,U,P,M){var O=W.get(U),V=U in B;if(X&&U==="length")for(var N=P;N<O.v;N+=1){var k=W.get(N+"");if(k!==void 0)P0(k,y);else if(N in B){if(k=G(()=>n0(y,Z)),W.set(N+"",k),q)G0(k,v7($,N))}}if(O===void 0){if(!V||Y0(B,U)?.writable){if(O=G(()=>n0(void 0,Z)),q)G0(O,v7($,U));P0(O,G7(P)),W.set(U,O)}}else{V=O.v!==y;var E=G(()=>G7(P));P0(O,E)}var D=Reflect.getOwnPropertyDescriptor(B,U);if(D?.set)D.set.call(M,P);if(!V){if(X&&typeof U==="string"){var E0=W.get("length"),U0=Number(U);if(Number.isInteger(U0)&&U0>=E0.v)P0(E0,U0+1)}y7(z)}return!0},ownKeys(B){I(z);var U=Reflect.ownKeys(B).filter((O)=>{var V=W.get(O);return V===void 0||V.v!==y});for(var[P,M]of W)if(M.v!==y&&!(P in B))U.push(P);return U},setPrototypeOf(){a4()}})}function v7(J,Q){if(typeof Q==="symbol")return`${J}[Symbol(${Q.description??""})]`;if(I6.test(Q))return`${J}.${Q}`;return/^\d+$/.test(Q)?`${J}[${Q}]`:`${J}['${Q}']`}function iJ(J){try{if(J!==null&&typeof J==="object"&&X0 in J)return J[X0]}catch{}return J}var R6=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function j6(J){return new Proxy(J,{get(Q,W,X){var z=Reflect.get(Q,W,X);if(!R6.has(W))return z;return function(...Z){G8();var K=z.apply(this,Z);return uJ(),K}}})}function T8(){let{prototype:J,__svelte_cleanup:Q}=Array;if(Q)Q();let{indexOf:W,lastIndexOf:X,includes:z}=J;J.indexOf=function(Z,K){let G=W.call(this,Z,K);if(G===-1){for(let $=K??0;$<this.length;$+=1)if(iJ(this[$])===Z){DJ("array.indexOf(...)");break}}return G},J.lastIndexOf=function(Z,K){let G=X.call(this,Z,K??this.length-1);if(G===-1){for(let $=0;$<=(K??this.length-1);$+=1)if(iJ(this[$])===Z){DJ("array.lastIndexOf(...)");break}}return G},J.includes=function(Z,K){let G=z.call(this,Z,K);if(!G){for(let $=0;$<this.length;$+=1)if(iJ(this[$])===Z){DJ("array.includes(...)");break}}return G},Array.__svelte_cleanup=()=>{J.indexOf=W,J.lastIndexOf=X,J.includes=z}}var fQ,x8,GJ,k8,E8;function sJ(){if(fQ!==void 0)return;fQ=window,x8=document,GJ=/Firefox/.test(navigator.userAgent);var J=Element.prototype,Q=Node.prototype,W=Text.prototype;if(k8=Y0(Q,"firstChild").get,E8=Y0(Q,"nextSibling").get,YQ(J))J[WJ]=void 0,J[NJ]=null,J[XJ]=void 0,J.__e=void 0;if(YQ(W))W[zJ]=void 0;if(q)J.__svelte_meta=null,T8()}function p(J=""){return document.createTextNode(J)}function v(J){return k8.call(J)}function s(J){return E8.call(J)}function b8(J,Q){if(!F)return v(J);var W=v(S);if(W===null)W=S.appendChild(p());else if(Q&&W.nodeType!==d7){var X=p();return W?.before(X),j(X),X}if(Q)rJ(W);return j(W),W}function T6(J,Q=!1){if(!F){var W=v(J);if(W instanceof Comment&&W.data==="")return s(W);return W}if(Q){if(S?.nodeType!==d7){var X=p();return S?.before(X),j(X),X}rJ(S)}return S}function x6(J,Q=!1){if(!F)return v(J);var W=b8(J,Q);return oJ(J),W}function k6(J,Q=1,W=!1){let X=F?S:J;var z;while(Q--)z=X,X=s(X);if(!F)return X;if(W){if(X?.nodeType!==d7){var Z=p();if(X===null)z?.after(Z);else X.before(Z);return j(Z),Z}rJ(X)}return j(X),X}function PJ(J){J.textContent=""}function aJ(){if(!r)return!1;if(h0!==null)return!1;var J=L.f;return(J&H0)!==0}function k0(J,Q,W){if(Q==null||Q===AJ)return W?document.createElement(J,{is:W}):document.createElement(J);return W?document.createElementNS(Q,J,{is:W}):document.createElementNS(Q,J)}function rJ(J){if(J.nodeValue.length<65536)return;let Q=J.nextSibling;while(Q!==null&&Q.nodeType===d7)Q.remove(),J.nodeValue+=Q.nodeValue,Q=J.nextSibling}var F=!1;function d(J){F=J}var S;function j(J){if(J===null)throw Y7(),i0;return S=J}function i(){return j(s(S))}function oJ(J){if(!F)return;if(s(S)!==null)throw Y7(),i0;S=J}function pQ(J=1){if(F){var Q=J,W=S;while(Q--)W=s(W);S=W}}function J7(J=!0){var Q=0,W=S;while(!0){if(W.nodeType===R0){var X=W.data;if(X===I7){if(Q===0)return W;Q-=1}else if(X===_7||X===H7||X[0]==="["&&!isNaN(Number(X.slice(1))))Q+=1}var z=s(W);if(J)W.remove();W=z}}function VJ(J){if(!J||J.nodeType!==R0)throw Y7(),i0;return J.data}var JJ=Symbol("events"),lQ=new Set,nJ=new Set;function y8(J,Q,W){(Q[JJ]??={})[J]=W}function h8(J){for(var Q=0;Q<J.length;Q++)lQ.add(J[Q]);for(var W of nJ)W(J)}var dQ=null,_Q=!1;function cQ(J){var Q=this,W=Q.ownerDocument,X=J.type,z=J.composedPath?.()||[],Z=z[0]||J.target;if(dQ=J,!_Q)_Q=!0,setTimeout(()=>{_Q=!1,dQ=null});var K=0,G=dQ===J&&J[JJ];if(G){var $=z.indexOf(G);if($!==-1&&(Q===document||Q===window)){J[JJ]=Q;return}var Y=z.indexOf(Q);if(Y===-1)return;if($<=Y)K=$}if(Z=z[K]||J.target,Z===Q)return;c(J,"currentTarget",{configurable:!0,get(){return Z||W}});var H=w,B=L;u(null),f(null);try{var U,P=[];while(Z!==null){if(Z===Q)break;try{var M=Z[JJ]?.[X];if(M!=null&&(!Z.disabled||J.target===Z))M.call(Z,J)}catch(O){if(U)P.push(O);else U=O}if(J.cancelBubble)break;K++,Z=K<z.length?z[K]:null}if(U){for(let O of P)queueMicrotask(()=>{throw O});throw U}}finally{J[JJ]=Q,delete J.currentTarget,u(H),f(B)}}var E6=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:(J)=>{return J}});function g8(J){return E6?.createHTML(J)??J}function iQ(J){var Q=k0("template");return Q.innerHTML=g8(J.replaceAll("<!>","<!---->")),Q.content}function N0(J,Q){var W=L;if(W.nodes===null)W.nodes={start:J,end:Q,a:null,t:null}}function h6(J,Q){var W=(Q&S4)!==0,X=(Q&N4)!==0,z,Z=!J.startsWith("<!>");return()=>{if(F)return N0(S,null),S;if(z===void 0){if(z=iQ(Z?J:"<!>"+J),!W)z=v(z)}var K=X||GJ?document.importNode(z,!0):z.cloneNode(!0);if(W){var G=v(K),$=K.lastChild;N0(G,$)}else N0(K,K);return K}}function g6(){if(F)return N0(S,null),S;var J=document.createDocumentFragment(),Q=document.createComment(""),W=p();return J.append(Q,W),N0(Q,W),J}function LJ(J,Q){if(F){var W=L;if((W.f&H0)===0||W.nodes.end===null)W.nodes.end=S;i();return}if(J===null)return;J.before(Q)}var v6=/\r/g;function v8(J){J=J.replace(v6,"");let Q=5381,W=J.length;while(W--)Q=(Q<<5)-Q^J.charCodeAt(W);return(Q>>>0).toString(36)}var m6=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];var B2=[...m6,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var u6=["touchstart","touchmove"];function m8(J){return u6.includes(J)}var f6=["$state","$state.raw","$derived","$derived.by"],H2=[...f6,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];function tJ(J){return J?.replace(/\//g,"/​")}function u8(J){let Q=0,W=q0(0),X;if(q)G0(W,"createSubscriber version");return()=>{if(L7())I(W),J0(()=>{if(Q===0)X=h(()=>J(()=>y7(W)));return Q+=1,()=>{n(()=>{if(Q-=1,Q===0)X?.(),X=void 0,y7(W)})}})}}var p6=F0|c0;function sQ(J,Q,W,X){new f8(J,Q,W,X)}class f8{parent;is_pending=!1;transform_error;#J;#Q=F?S:null;#W;#G;#Z;#K=null;#X=null;#$=null;#z=null;#M=0;#P=0;#U=!1;#B=new Set;#V=new Set;#q=null;#O=u8(()=>{if(this.#q=q0(this.#M),q)G0(this.#q,"$effect.pending()");return()=>{this.#q=null}});constructor(J,Q,W,X){if(this.#J=J,this.#W=Q,this.#G=(z)=>{var Z=L;Z.b=this,Z.f|=p7,W(z)},this.parent=L.b,this.transform_error=X??this.parent?.transform_error??((z)=>z),this.#Z=S0(()=>{if(F){let z=this.#Q;i();let Z=z.data===H7;if(z.data.startsWith(UQ)){let G=JSON.parse(z.data.slice(UQ.length));this.#w(G)}else if(Z)this.#S();else this.#L()}else this.#H()},p6),F)this.#J=S}#L(){try{this.#K=a(()=>this.#G(this.#J))}catch(J){this.error(J)}}#w(J){let Q=this.#W.failed,{reset:W,invoke_onerror:X}=this.#C(J);if(n(X),!Q)return;this.#$=a(()=>{Q(this.#J,()=>J,()=>W)})}#C(J){var Q=!1,W=!1;let X=()=>{if(Q){k4();return}if(Q=!0,W)n4();if(this.#$!==null)e0(this.#$,()=>{this.#$=null});this.#Y(()=>{this.#H()})};return{reset:X,invoke_onerror:()=>{try{W=!0,this.#W.onerror?.(J,X),W=!1}catch(Z){w0(Z,this.#Z&&this.#Z.parent)}}}}#S(){let J=this.#W.pending;if(!J)return;this.is_pending=!0,this.#X=a(()=>J(this.#J)),n(()=>{var Q=this.#z=document.createDocumentFragment(),W=p(),X=!1;if(Q.append(W),this.#K=this.#Y(()=>{try{return a(()=>this.#G(W))}catch(z){try{this.error(z),X=!0}catch(Z){w0(Z,this.#Z.parent)}return null}}),this.#K===null){if(this.#z=null,X)this.#F(C);return}if(this.#P===0)this.#J.before(Q),this.#z=null,e0(this.#X,()=>{this.#X=null}),this.#F(C)})}#H(){try{if(this.is_pending=this.has_pending_snippet(),this.#P=0,this.#M=0,this.#K=a(()=>{this.#G(this.#J)}),this.#P>0){var J=this.#z=document.createDocumentFragment();e7(this.#K,J);let Q=this.#W.pending;this.#X=a(()=>Q(this.#J))}else this.#F(C)}catch(Q){this.error(Q)}}#F(J){this.is_pending=!1,J.transfer_effects(this.#B,this.#V)}defer_effect(J){fJ(J,this.#B,this.#V)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#W.pending}#Y(J){var Q=L,W=w,X=A;f(this.#Z),u(this.#Z),K7(this.#Z.ctx);try{return K0.ensure(),J()}finally{f(Q),u(W),K7(X)}}#N(J,Q){if(!this.has_pending_snippet()){if(this.parent)this.parent.#N(J,Q);return}if(this.#P+=J,this.#P===0){if(this.#F(Q),this.#X)e0(this.#X,()=>{this.#X=null});if(this.#z)this.#J.before(this.#z),this.#z=null}}update_pending_count(J,Q){if(this.#N(J,Q),this.#M+=J,!this.#q||this.#U)return;this.#U=!0,n(()=>{if(this.#U=!1,this.#q)p0(this.#q,this.#M)})}get_effect_pending(){return this.#O(),I(this.#q)}error(J){if(!this.#W.onerror&&!this.#W.failed)throw J;if(C?.is_fork){if(this.#K)C.skip_effect(this.#K);if(this.#X)C.skip_effect(this.#X);if(this.#$)C.skip_effect(this.#$);C.oncommit(()=>{this.#A(J)})}else this.#A(J)}#A(J){if(this.#K)m(this.#K),this.#K=null;if(this.#X)m(this.#X),this.#X=null;if(this.#$)m(this.#$),this.#$=null;if(F)j(this.#Q),pQ(),j(J7());let Q=this.#W.failed,W=(X)=>{let{reset:z,invoke_onerror:Z}=this.#C(X);if(Z(),Q)this.#$=this.#Y(()=>{try{return a(()=>{var K=L;K.b=this,K.f|=p7,Q(this.#J,()=>X,()=>z)})}catch(K){return w0(K,this.#Z.parent),null}})};n(()=>{var X;try{X=this.transform_error(J)}catch(z){w0(z,this.#Z&&this.#Z.parent);return}if(X!==null&&typeof X==="object"&&typeof X.then==="function")X.then(W,(z)=>w0(z,this.#Z&&this.#Z.parent));else W(X)})}}var aQ=!0;function d6(J,Q){var W=Q==null?"":typeof Q==="object"?`${Q}`:Q;if(W!==(J[zJ]??=J.nodeValue))J[zJ]=W,J.nodeValue=`${W}`}function JQ(J,Q){return p8(J,Q)}function nQ(J,Q){sJ(),Q.intro=Q.intro??!1;let W=Q.target,X=F,z=S;try{var Z=v(W);while(Z&&(Z.nodeType!==R0||Z.data!==_7))Z=s(Z);if(!Z)throw i0;d(!0),j(Z);let K=p8(J,{...Q,anchor:Z});return d(!1),K}catch(K){if(K instanceof Error&&K.message.split(`
47
+ `).some((G)=>G.startsWith("https://svelte.dev/e/")))throw K;if(K!==i0)console.warn("Failed to hydrate: ",K);if(Q.recover===!1)c4();return sJ(),PJ(W),d(!1),JQ(J,Q)}finally{d(X),j(z)}}var eJ=new Map;function p8(J,{target:Q,anchor:W,props:X={},events:z,context:Z,intro:K=!0,transformError:G}){sJ();var $=void 0,Y=O8(()=>{var H=W??Q.appendChild(p());sQ(H,{pending:()=>{}},(P)=>{LQ({});var M=A;if(Z)M.c=Z;if(z)X.$$events=z;if(F)N0(P,null);if(aQ=K,$=J(P,X)||$J(),aQ=!0,F){if(L.nodes.end=S,S===null||S.nodeType!==R0||S.data!==I7)throw Y7(),i0}FQ()},G);var B=new Set,U=(P)=>{for(var M=0;M<P.length;M++){var O=P[M];if(B.has(O))continue;B.add(O);var V=m8(O);for(let E of[Q,document]){var N=eJ.get(E);if(N===void 0)N=new Map,eJ.set(E,N);var k=N.get(O);if(k===void 0)E.addEventListener(O,cQ,{passive:V}),N.set(O,1);else N.set(O,k+1)}}};return U(l7(lQ)),nJ.add(U),()=>{for(var P of B)for(let V of[Q,document]){var M=eJ.get(V),O=M.get(P);if(--O==0){if(V.removeEventListener(P,cQ),M.delete(P),M.size===0)eJ.delete(V)}else M.set(P,O)}if(nJ.delete(U),H!==W)H.parentNode?.removeChild(H)}});return rQ.set($,Y),$}var rQ=new WeakMap;function tQ(J,Q){let W=rQ.get(J);if(W)return rQ.delete(J),W(Q);if(q)x4();return Promise.resolve()}var d8=new Map;function _8(J,Q){var W=d8.get(J);if(!W)W=new Set,d8.set(J,W);W.add(Q)}class $7{anchor;#J=new Map;#Q=new Map;#W=new Map;#G=new Set;#Z=!0;constructor(J,Q=!0){this.anchor=J,this.#Z=Q}#K=(J)=>{if(!this.#J.has(J))return;var Q=this.#J.get(J),W=this.#Q.get(Q);if(W)t7(W),this.#G.delete(Q);else{var X=this.#W.get(Q);if(X){if(t7(X.effect),this.#Q.set(Q,X.effect),this.#W.delete(Q),q)X.fragment.lastChild[$Q]=this.anchor;X.fragment.lastChild.remove(),this.anchor.before(X.fragment),W=X.effect}}for(let[z,Z]of this.#J){if(this.#J.delete(z),z===J)break;let K=this.#W.get(Z);if(K)m(K.effect),this.#W.delete(Z)}for(let[z,Z]of this.#Q){if(z===Q||this.#G.has(z))continue;let K=()=>{if(Array.from(this.#J.values()).includes(z)){var $=document.createDocumentFragment();e7(Z,$),$.append(p()),this.#W.set(z,{effect:Z,fragment:$})}else m(Z);this.#G.delete(z),this.#Q.delete(z)};if(this.#Z||!W)this.#G.add(z),e0(Z,K,!1);else K()}};#X=(J)=>{this.#J.delete(J);let Q=Array.from(this.#J.values());for(let[W,X]of this.#W)if(!Q.includes(W))m(X.effect),this.#W.delete(W)};ensure(J,Q){var W=C,X=aJ();if(Q&&!this.#Q.has(J)&&!this.#W.has(J))if(X){var z=document.createDocumentFragment(),Z=p();z.append(Z),this.#W.set(J,{effect:a(()=>Q(Z)),fragment:z})}else this.#Q.set(J,a(()=>Q(this.anchor)));if(this.#J.set(W,J),X){for(let[K,G]of this.#Q)if(K===J)W.unskip_effect(G);else W.skip_effect(G);for(let[K,G]of this.#W)if(K===J)W.unskip_effect(G.effect);else W.skip_effect(G.effect);W.oncommit(this.#K),W.ondiscard(this.#X)}else{if(F)this.anchor=S;this.#K(W)}}}function c6(J,Q,W=!1){var X;if(F)X=S,i();var z=new $7(J),Z=W?F0:0;function K(G,$){if(F){var Y=VJ(X);if(G!==parseInt(Y.substring(1))){var H=J7();j(H),z.anchor=H,d(!1),z.ensure(G,$),d(!0);return}}z.ensure(G,$)}S0(()=>{var G=!1;if(Q(($,Y=0)=>{G=!0,K(Y,$)}),!G)K(-1,null)},Z)}var i6=Symbol("NaN");function o6(J,Q,W){if(F)i();var X=new $7(J),z=!u0();S0(()=>{var Z=Q();if(Z!==Z)Z=i6;if(z&&Z!==null&&typeof Z==="object")Z={};X.ensure(Z,W)})}function s6(J,Q,W){var X=[],z=Q.length,Z,K=Q.length;for(var G=0;G<z;G++){let B=Q[G];e0(B,()=>{if(Z){if(Z.pending.delete(B),Z.done.add(B),Z.pending.size===0){var U=J.outrogroups;if(eQ(J,l7(Z.done)),U.delete(Z),U.size===0)J.outrogroups=null}}else K-=1},!1)}if(K===0){var $=X.length===0&&W!==null&&J.pending.size===0;if($){var Y=W,H=Y.parentNode;PJ(H),H.append(Y),J.items.clear()}eQ(J,Q,!$)}else Z={pending:new Set(Q),done:new Set},(J.outrogroups??=new Set).add(Z)}function eQ(J,Q,W=!0){var X;if(J.pending.size>0){X=new Set;for(let K of J.pending.values())for(let G of K)X.add(J.items.get(G).e)}for(var z=0;z<Q.length;z++){var Z=Q[z];if(X?.has(Z)){Z.f|=v0;let K=document.createDocumentFragment();e7(Z,K)}else m(Q[z],W)}}var c8;function a6(J,Q,W,X,z,Z=null){var K=J,G=new Map,$=(Q&PQ)!==0;if($){var Y=J;K=F?j(v(Y)):Y.appendChild(p())}if(F)i();var H=null,B=x7(()=>{var E=W();return Z7(E)?E:E==null?[]:l7(E)});if(q)G0(B,"{#each ...}");var U,P=new Map,M=!0;function O(E){if((k.effect.f&g)!==0)return;if(k.pending.delete(E),k.fallback=H,r6(k,U,K,Q,X),H!==null)if(U.length===0)if((H.f&v0)===0)t7(H);else H.f^=v0,OJ(H,null,K);else e0(H,()=>{H=null})}function V(E){k.pending.delete(E)}var N=S0(()=>{U=I(B);var E=U.length;let D=!1;if(F){var E0=VJ(K)===H7;if(E0!==(E===0))K=J7(),j(K),d(!1),D=!0}var U0=new Set,A0=C,u7=aJ();for(var _0=0;_0<E;_0+=1){if(F&&S.nodeType===R0&&S.data===I7)K=S,D=!0,d(!1);var g0=U[_0],f7=X(g0,_0);if(q){var q4=X(g0,_0);if(f7!==q4)f4(String(_0),String(f7),String(q4))}var Q7=M?null:G.get(f7);if(Q7){if(Q7.v)p0(Q7.v,g0);if(Q7.i)p0(Q7.i,_0);if(u7)A0.unskip_effect(Q7.e)}else{if(Q7=n6(G,M?K:c8??=p(),g0,f7,_0,z,Q,W),!M)Q7.e.f|=v0;G.set(f7,Q7)}U0.add(f7)}if(E===0&&Z&&!H)if(M)H=a(()=>Z(K));else H=a(()=>Z(c8??=p())),H.f|=v0;if(E>U0.size)if(q)t6(U,X);else VQ("","","");if(F&&E>0)j(J7());if(!M)if(P.set(A0,U0),u7){for(let[P6,U6]of G)if(!U0.has(P6))A0.skip_effect(U6.e);A0.oncommit(O),A0.ondiscard(V)}else O(A0);if(D)d(!0);I(B)}),k={effect:N,flags:Q,items:G,pending:P,outrogroups:null,fallback:H};if(M=!1,F)K=S}function FJ(J){while(J!==null&&(J.f&o)===0)J=J.next;return J}function r6(J,Q,W,X,z){var Z=(X&M4)!==0,K=Q.length,G=J.items,$=FJ(J.effect.first),Y,H=null,B,U=[],P=[],M,O,V,N;if(Z){for(N=0;N<K;N+=1)if(M=Q[N],O=z(M,N),V=G.get(O).e,(V.f&v0)===0)V.nodes?.a?.measure(),(B??=new Set).add(V)}for(N=0;N<K;N+=1){if(M=Q[N],O=z(M,N),V=G.get(O).e,J.outrogroups!==null)for(let g0 of J.outrogroups)g0.pending.delete(V),g0.done.delete(V);if((V.f&l)!==0){if(t7(V),Z)V.nodes?.a?.unfix(),(B??=new Set).delete(V)}if((V.f&v0)!==0)if(V.f^=v0,V===$)OJ(V,null,W);else{var k=H?H.next:$;if(V===J.effect.last)J.effect.last=V.prev;if(V.prev)V.prev.next=V.next;if(V.next)V.next.prev=V.prev;S7(J,H,V),S7(J,V,k),OJ(V,k,W),H=V,U=[],P=[],$=FJ(H.next);continue}if(V!==$){if(Y!==void 0&&Y.has(V)){if(U.length<P.length){var E=P[0],D;H=E.prev;var E0=U[0],U0=U[U.length-1];for(D=0;D<U.length;D+=1)OJ(U[D],E,W);for(D=0;D<P.length;D+=1)Y.delete(P[D]);S7(J,E0.prev,U0.next),S7(J,H,E0),S7(J,U0,E),$=E,H=U0,N-=1,U=[],P=[]}else Y.delete(V),OJ(V,$,W),S7(J,V.prev,V.next),S7(J,V,H===null?J.effect.first:H.next),S7(J,H,V),H=V;continue}U=[],P=[];while($!==null&&$!==V)(Y??=new Set).add($),P.push($),$=FJ($.next);if($===null)continue}if((V.f&v0)===0)U.push(V);H=V,$=FJ(V.next)}if(J.outrogroups!==null){for(let g0 of J.outrogroups)if(g0.pending.size===0)eQ(J,l7(g0.done)),J.outrogroups?.delete(g0);if(J.outrogroups.size===0)J.outrogroups=null}if($!==null||Y!==void 0){var A0=[];if(Y!==void 0){for(V of Y)if((V.f&l)===0)A0.push(V)}while($!==null){if(($.f&l)===0&&$!==J.fallback)A0.push($);$=FJ($.next)}var u7=A0.length;if(u7>0){var _0=(X&PQ)!==0&&K===0?W:null;if(Z){for(N=0;N<u7;N+=1)A0[N].nodes?.a?.measure();for(N=0;N<u7;N+=1)A0[N].nodes?.a?.fix()}s6(J,A0,_0)}}if(Z)n(()=>{if(B===void 0)return;for(V of B)V.nodes?.a?.apply()})}function n6(J,Q,W,X,z,Z,K,G){var $=(K&H4)!==0?(K&V4)===0?b7(W,!1,!1):q0(W):null,Y=(K&Y4)!==0?q0(z):null;if(q&&$)$.trace=()=>{G()[Y?.v??z]};return{v:$,i:Y,e:a(()=>{return Z(Q,$??W,Y??z,G),()=>{J.delete(X)}})}}function OJ(J,Q,W){if(!J.nodes)return;var X=J.nodes.start,z=J.nodes.end,Z=Q&&(Q.f&v0)===0?Q.nodes.start:W;while(X!==null){var K=s(X);if(Z.before(X),X===z)return;X=K}}function S7(J,Q,W){if(Q===null)J.effect.first=W;else Q.next=W;if(W===null)J.effect.last=Q;else W.prev=Q}function t6(J,Q){let W=new Map,X=J.length;for(let z=0;z<X;z++){let Z=Q(J[z],z);if(W.has(Z)){let K=String(W.get(Z)),G=String(z),$=String(Z);if($.startsWith("[object "))$=null;VQ(K,G,$)}W.set(Z,z)}}function e6(J,Q,W){if(!Q||Q===v8(String(W??"")))return;let X,z=J.__svelte_meta?.loc;if(z)X=`near ${z.file}:${z.line}:${z.column}`;else if(j0?.[O0])X=`in ${j0[O0]}`;T4(tJ(X))}function J1(J,Q,W=!1,X=!1,z=!1,Z=!1){var K=J,G="";if(W){var $=J;if(F)K=j(v($))}gQ(()=>{var Y=L;if(G===(G=Q()??"")){if(F)i();return}if(W&&!F){if(Y.nodes=null,$.innerHTML=G,G!=="")N0(v($),$.lastChild);return}if(Y.nodes!==null)mQ(Y.nodes.start,Y.nodes.end),Y.nodes=null;if(G==="")return;if(F){var H=S.data,B=i(),U=B;while(B!==null&&(B.nodeType!==R0||B.data!==""))U=B,B=s(B);if(B===null)throw Y7(),i0;if(q&&!Z)e6(B.parentNode,H,G);N0(S,U),K=j(B);return}var P=X?ZJ:z?BQ:void 0,M=k0(X?"svg":z?"math":"template",P);M.innerHTML=G;var O=X||z?M:M.content;if(N0(v(O),O.lastChild),X||z)while(v(O))K.before(v(O));else K.before(O)})}function Q1(J,Q,W,X,z){if(F)i();if(Q.$$host?.$$shadowRoot){let G=k0("slot");if(W!=="default")G.name=W;if(LJ(J,G),z!==null){let $=p();G.append($),z($)}return}var Z=Q.$$slots?.[W],K=!1;if(Z===!0)Z=Q[W==="default"?"children":W],K=!0;if(Z===void 0){if(z!==null)z(J)}else Z(J,K?()=>X:X)}function K1(J,Q){L0(()=>{J=L?.parent?.nodes?.start??J;var W=J.getRootNode(),X=W.host?W:W.head??W.ownerDocument.head;if(!X.querySelector("#"+Q.hash)){let z=k0("style");if(z.id=Q.hash,z.textContent=Q.code,X.appendChild(z),q)_8(Q.hash,z)}})}function G1(J,Q,W){L0(()=>{var X=h(()=>Q(J,W?.())||{});if(W&&X?.update){var z=!1,Z={};J0(()=>{var K=W();if(cJ(K),z&&kJ(Z,K))Z=K,X.update(K)}),z=!0}if(X?.destroy)return()=>X.destroy()})}var i8=[...`
48
+ \r\f \v\uFEFF`];function s8(J,Q,W){var X=J==null?"":""+J;if(Q)X=X?X+" "+Q:Q;if(W){for(var z of Object.keys(W))if(W[z])X=X?X+" "+z:z;else if(X.length){var Z=z.length,K=0;while((K=X.indexOf(z,K))>=0){var G=K+Z;if((K===0||i8.includes(X[K-1]))&&(G===X.length||i8.includes(X[G])))X=(K===0?"":X.substring(0,K))+X.substring(G+1);else K=G}}}return X===""?null:X}function o8(J,Q=!1){var W=Q?" !important;":";",X="";for(var z of Object.keys(J)){var Z=J[z];if(Z!=null&&Z!=="")X+=" "+z+": "+Z+W}return X}function J4(J){if(J[0]!=="-"||J[1]!=="-")return J.toLowerCase();return J}function a8(J,Q){if(Q){var W="",X,z;if(Array.isArray(Q))X=Q[0],z=Q[1];else X=Q;if(J){J=String(J).replaceAll(/\/\*.*?\*\//g,"").trim();var Z=!1,K=0,G=!1,$=[];if(X)$.push(...Object.keys(X).map(J4));if(z)$.push(...Object.keys(z).map(J4));var Y=0,H=-1;let O=J.length;for(var B=0;B<O;B++){var U=J[B];if(G){if(U==="/"&&J[B-1]==="*")G=!1}else if(Z){if(Z===U)Z=!1}else if(U==="/"&&J[B+1]==="*")G=!0;else if(U==='"'||U==="'")Z=U;else if(U==="(")K++;else if(U===")")K--;if(!G&&Z===!1&&K===0){if(U===":"&&H===-1)H=B;else if(U===";"||B===O-1){if(H!==-1){var P=J4(J.substring(Y,H).trim());if(!$.includes(P)){if(U!==";")B++;var M=J.substring(Y,B).trim();W+=" "+M+";"}}Y=B+1,H=-1}}}}if(X)W+=o8(X);if(z)W+=o8(z,!0);return W=W.trim(),W===""?null:W}return J==null?null:String(J)}function r8(J,Q,W,X,z,Z){var K=J[WJ];if(F||K!==W||K===void 0){var G=s8(W,X,Z);if(!F||G!==J.getAttribute("class"))if(G==null)J.removeAttribute("class");else if(Q)J.className=G;else J.setAttribute("class",G);J[WJ]=W}else if(Z&&z!==Z)for(var $ in Z){var Y=!!Z[$];if(z==null||Y!==!!z[$])J.classList.toggle($,Y)}return Z}function Q4(J,Q={},W,X){for(var z in W){var Z=W[z];if(Q[z]!==Z)if(W[z]==null)J.style.removeProperty(z);else J.style.setProperty(z,Z,X)}}function n8(J,Q,W,X){var z=J[XJ];if(F||z!==Q){var Z=a8(Q,X);if(!F||Z!==J.getAttribute("style"))if(Z==null)J.removeAttribute("style");else J.style.cssText=Z;J[XJ]=Q}else if(X)if(Array.isArray(X))Q4(J,W?.[0],X[0]),Q4(J,W?.[1],X[1],"important");else Q4(J,W,X);return X}var F1=Symbol("class"),O1=Symbol("style"),w1=Symbol("is custom element"),C1=Symbol("is html"),S1=qQ?"link":"LINK";function J6(J,Q,W,X){var z=A1(J);if(F){if(z[Q]=J.getAttribute(Q),Q==="src"||Q==="srcset"||Q==="href"&&J.nodeName===S1){if(!X)D1(J,Q,W??"");return}}if(z[Q]===(z[Q]=W))return;if(Q==="loading")J[B4]=W;if(W==null)J.removeAttribute(Q);else if(typeof W!=="string"&&Q6(J).has(Q))J[Q]=W;else J.setAttribute(Q,W)}function N1(J,Q,W){var X=w,z=L;let Z=F;if(F)d(!1);u(null),f(null);try{if(Q!=="style"&&(W4.has(J.getAttribute("is")||J.nodeName)||!customElements||customElements.get(J.getAttribute("is")||J.nodeName.toLowerCase())?Q6(J).has(Q):W&&typeof W==="object"))J[Q]=W;else J6(J,Q,W==null?W:String(W))}finally{if(u(X),f(z),Z)d(!0)}}function A1(J){return J[NJ]??={[w1]:J.nodeName.includes("-"),[C1]:J.namespaceURI===AJ}}var W4=new Map;function Q6(J){var Q=J.getAttribute("is")||J.nodeName,W=W4.get(Q);if(W)return W;W4.set(Q,W=new Set);var X,z=J,Z=Element.prototype;while(Z!==z){X=IJ(z);for(var K in X)if(X[K].set&&K!=="innerHTML"&&K!=="textContent"&&K!=="innerText")W.add(K);z=R7(z)}return W}function D1(J,Q,W){if(!q)return;if(Q==="srcset"&&I1(J,W))return;if(X4(J.getAttribute(Q)??"",W))return;j4(Q,J.outerHTML.replace(J.innerHTML,J.innerHTML&&"..."),String(W))}function X4(J,Q){if(J===Q)return!0;return new URL(J,document.baseURI).href===new URL(Q,document.baseURI).href}function t8(J){return J.split(",").map((Q)=>Q.trim().split(" ").filter(Boolean))}function I1(J,Q){var W=t8(J.srcset),X=t8(Q);return X.length===W.length&&X.every(([z,Z],K)=>Z===W[K][1]&&(X4(W[K][0],z)||X4(z,W[K][0])))}class W6{#J=new WeakMap;#Q;#W;static entries=new WeakMap;constructor(J){this.#W=J}observe(J,Q){var W=this.#J.get(J)||new Set;return W.add(Q),this.#J.set(J,W),this.#G().observe(J,this.#W),()=>{var X=this.#J.get(J);if(X.delete(Q),X.size===0)this.#J.delete(J),this.#Q.unobserve(J)}}#G(){return this.#Q??(this.#Q=new ResizeObserver((J)=>{for(var Q of J){W6.entries.set(Q.target,Q);for(var W of this.#J.get(Q.target)||[])W(Q)}}))}}function z4(J,Q){return J===Q||J?.[X0]===Q}function R1(J=$J(),Q,W,X){var z=A.r,Z=L;return L0(()=>{var K,G;return J0(()=>{K=G,G=X?.()||[],h(()=>{if(!z4(W(...G),J)){if(Q(J,...G),K&&z4(W(...K),J))Q(null,...K)}})}),()=>{let $=Z;while($!==z&&$.parent!==null&&$.parent.f&U7)$=$.parent;let Y=()=>{if(G&&z4(W(...G),J))Q(null,...G)},H=$.teardown;$.teardown=()=>{Y(),H?.()}}}),J}function j1(J,Q,W,X){var z=!V7||(W&F4)!==0,Z=(W&w4)!==0,K=(W&C4)!==0,G=X,$=!0,Y=void 0,H=()=>{if(K&&z)return Y??=F7(X),I(Y);if($)$=!1,G=K?h(X):X;return G};let B;if(Z){var U=X0 in J||QJ in J;B=Y0(J,Q)?.set??(U&&Q in J?(D)=>J[Q]=D:void 0)}var P,M=!1;if(Z)[P,M]=RQ(()=>J[Q]);else P=J[Q];if(P===void 0&&X!==void 0){if(P=H(),B){if(z)i4(Q);B(P)}}var O;if(z)O=()=>{var D=J[Q];if(D===void 0)return H();return $=!0,D};else O=()=>{var D=J[Q];if(D!==void 0)G=void 0;return D===void 0?G:D};if(z&&(W&O4)===0)return O;if(B){var V=J.$$legacy;return function(D,E0){if(arguments.length>0){if(!z||!E0||V||M)B(E0?O():D);return D}return O()}}var N=!1,k=((W&L4)!==0?F7:x7)(()=>{return N=!1,O()});if(q)k.label=Q;if(Z)I(k);var E=L;return function(D,E0){if(arguments.length>0){let U0=E0?I(k):z&&Z?G7(D):D;if(P0(k,U0),N=!0,G!==void 0)G=U0;return D}if(T0&&N||(E.f&g)!==0)return k.v;return I(k)}}function X6(J){return new z6(J)}class z6{#J;#Q;constructor(J){var Q=new Map,W=(z,Z)=>{var K=b7(Z,!1,!1);return Q.set(z,K),K};let X=new Proxy({...J.props||{},$$events:{}},{get(z,Z){return I(Q.get(Z)??W(Z,Reflect.get(z,Z)))},has(z,Z){if(Z===QJ)return!0;return I(Q.get(Z)??W(Z,Reflect.get(z,Z))),Reflect.has(z,Z)},set(z,Z,K){return P0(Q.get(Z)??W(Z,K),K),Reflect.set(z,Z,K)}});if(this.#Q=(J.hydrate?nQ:JQ)(J.component,{target:J.target,anchor:J.anchor,props:X,context:J.context,intro:J.intro??!1,recover:J.recover,transformError:J.transformError}),!r&&(!J?.props?.$$host||J.sync===!1))n7();this.#J=X.$$events;for(let z of Object.keys(this.#Q)){if(z==="$set"||z==="$destroy"||z==="$on")continue;c(this,z,{get(){return this.#Q[z]},set(Z){this.#Q[z]=Z},enumerable:!0})}this.#Q.$set=(z)=>{Object.assign(X,z)},this.#Q.$destroy=()=>{tQ(this.#Q)}}$set(J){this.#Q.$set(J)}$on(J,Q){this.#J[J]=this.#J[J]||[];let W=(...X)=>Q.call(this,...X);return this.#J[J].push(W),()=>{this.#J[J]=this.#J[J].filter((X)=>X!==W)}}$destroy(){this.#Q.$destroy()}}var Z6;if(typeof HTMLElement==="function")Z6=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(J,Q,W){super();if(this.$$ctor=J,this.$$s=Q,W)this.$$shadowRoot=this.attachShadow(W)}addEventListener(J,Q,W){if(this.$$l[J]=this.$$l[J]||[],this.$$l[J].push(Q),this.$$c){let X=this.$$c.$on(J,Q);this.$$l_u.set(Q,X)}super.addEventListener(J,Q,W)}removeEventListener(J,Q,W){if(super.removeEventListener(J,Q,W),this.$$c){let X=this.$$l_u.get(Q);if(X)X(),this.$$l_u.delete(Q)}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let J=function(X){return(z)=>{let Z=k0("slot");if(X!=="default")Z.name=X;LJ(z,Z)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let Q={},W=g1(this);for(let X of this.$$s)if(X in W)if(X==="default"&&!this.$$d.children)this.$$d.children=J(X),Q.default=!0;else Q[X]=J(X);for(let X of this.attributes){let z=this.$$g_p(X.name);if(!(z in this.$$d))this.$$d[z]=WQ(z,X.value,this.$$p_d,"toProp")}for(let X in this.$$p_d)if(!(X in this.$$d)&&this[X]!==void 0)this.$$d[X]=this[X],delete this[X];this.$$c=X6({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:Q,$$host:this}}),this.$$me=hQ(()=>{J0(()=>{this.$$r=!0;for(let X of KJ(this.$$c)){if(!this.$$p_d[X]?.reflect)continue;this.$$d[X]=this.$$c[X];let z=WQ(X,this.$$d[X],this.$$p_d,"toAttribute");if(z==null)this.removeAttribute(this.$$p_d[X].attribute||X);else this.setAttribute(this.$$p_d[X].attribute||X,z)}this.$$r=!1})});for(let X in this.$$l)for(let z of this.$$l[X]){let Z=this.$$c.$on(X,z);this.$$l_u.set(z,Z)}this.$$l={}}}attributeChangedCallback(J,Q,W){if(this.$$r)return;J=this.$$g_p(J),this.$$d[J]=WQ(J,W,this.$$p_d,"toProp"),this.$$c?.$set({[J]:this.$$d[J]})}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{if(!this.$$cn&&this.$$c)this.$$c.$destroy(),this.$$me(),this.$$c=void 0})}$$g_p(J){return KJ(this.$$p_d).find((Q)=>this.$$p_d[Q].attribute===J||!this.$$p_d[Q].attribute&&Q.toLowerCase()===J)||J}};function WQ(J,Q,W,X){let z=W[J]?.type;if(Q=z==="Boolean"&&typeof Q!=="boolean"?Q!=null:Q,!X||!W[J])return Q;else if(X==="toAttribute")switch(z){case"Object":case"Array":return Q==null?null:JSON.stringify(Q);case"Boolean":return Q?"":null;case"Number":return Q==null?null:Q;default:return Q}else switch(z){case"Object":case"Array":return Q&&JSON.parse(Q);case"Boolean":return Q;case"Number":return Q!=null?+Q:Q;default:return Q}}function g1(J){let Q={};return J.childNodes.forEach((W)=>{Q[W.slot||"default"]=!0}),Q}function v1(J,Q,W,X,z,Z){let K=class extends Z6{constructor(){super(J,W,z);this.$$p_d=Q}static get observedAttributes(){return KJ(Q).map((G)=>(Q[G].attribute||G).toLowerCase())}};if(KJ(Q).forEach((G)=>{c(K.prototype,G,{get(){return this.$$c&&G in this.$$c?this.$$c[G]:this.$$d[G]},set($){$=WQ(G,$,Q),this.$$d[G]=$;var Y=this.$$c;if(Y){var H=Y0(Y,G)?.get;if(H)Y[G]=$;else Y.$set({[G]:$})}}})}),X.forEach((G)=>{c(K.prototype,G,{get(){return this.$$c?.[G]}})}),Z)K=Z(K);return J.element=K,K}if(q){let J=function(Q){if(!(Q in globalThis)){let W;Object.defineProperty(globalThis,Q,{configurable:!0,get:()=>{if(W!==void 0)return W;o4(Q)},set:(X)=>{W=X}})}};J("$state"),J("$effect"),J("$derived"),J("$inspect"),J("$props"),J("$bindable")}import{createContext as XQ}from"@pie-players/pie-context";var K6=XQ(Symbol.for("pie.assessmentToolkit.runtimeContext")),G6=XQ(Symbol.for("pie.assessmentToolkit.hostRuntimeContext")),$6=XQ(Symbol.for("pie.assessmentToolkit.shellContext")),m1=XQ(Symbol.for("pie.assessmentToolkit.regionScopeContext"));import{ContextConsumer as u1}from"@pie-players/pie-context";function K4(J,Q,W){let X=!1,z=new u1(J,{context:Q,subscribe:!0,onValue:(Y)=>{X=!0,W(Y)}});z.connect();let Z=(Y)=>{if(Y.context!==Q)return;z.requestValue()};J.addEventListener("context-provider",Z);let K=0,G=200,$=globalThis.setInterval(()=>{if(X||K>=G){globalThis.clearInterval($);return}K+=1,z.requestValue()},50);return()=>{globalThis.clearInterval($),J.removeEventListener("context-provider",Z),z.disconnect()}}function DH(J,Q){return K4(J,K6,Q)}function IH(J,Q){return K4(J,G6,Q)}function RH(J,Q){return K4(J,$6,Q)}var zQ={assessment:[],section:[],item:[],passage:[],rubric:[],element:[]};var G4={section:[...zQ.section],item:[...zQ.item],passage:[...zQ.passage]};function m7(J){return typeof J==="object"&&J!==null&&!Array.isArray(J)}function N7(J,Q){if(J==null)return[];if(!Array.isArray(J))throw Error(`Invalid tools config at "${Q}": expected an array of tool ids.`);if(J.find((X)=>typeof X!=="string")!==void 0)throw Error(`Invalid tools config at "${Q}": all entries must be strings.`);return J}function f1(J){if(J==null)return;if(!m7(J))throw Error('Invalid tools config at "placement": expected an object with section/item/passage arrays.');return J}function p1(J){if(J==null)return;if(!m7(J))throw Error('Invalid tools config at "policy": expected an object with allowed/blocked arrays.');return J}function d1(J,Q){if(Q==null)return;if(!m7(Q))throw Error(`Invalid tools config at "providers.${J}": expected an object.`);let W=Q,X=(z)=>z==="polly"||z==="google"||z==="custom";if("enabled"in W&&W.enabled!==void 0&&typeof W.enabled!=="boolean")throw Error(`Invalid tools config at "providers.${J}.enabled": expected a boolean.`);if("settings"in W&&W.settings!==void 0&&!m7(W.settings))throw Error(`Invalid tools config at "providers.${J}.settings": expected an object.`);if("provider"in W&&W.provider!==void 0&&!m7(W.provider)&&!(J==="textToSpeech"&&X(W.provider)))throw Error(`Invalid tools config at "providers.${J}.provider": expected an object.`);return W}function _1(J){if(J==null)return{};if(!m7(J))throw Error('Invalid tools config at "providers": expected an object keyed by tool id.');let Q={};for(let[W,X]of Object.entries(J))Q[W]=d1(W,X);return Q}function $4(J){let Q=J.trim();if(!Q)return"";return Q}function q7(J){if(!J||J.length===0)return[];let Q=new Set;for(let W of J){if(typeof W!=="string")throw Error("Invalid tools config: tool list entries must be strings.");let X=$4(W);if(!X)continue;Q.add(X)}return Array.from(Q)}function kH(J){if(!J)return[];return q7(J.split(",").map((Q)=>Q.trim()).filter(Boolean))}function l1(J,Q){if(J==null)return;if(J==="on"||J==="off")return J;throw Error(`Invalid tools config at "${Q}": expected "on" or "off", got ${JSON.stringify(J)}.`)}function EH(J){if(J!=null&&!m7(J))throw Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');let Q=p1(J?.policy),W=f1(J?.placement),X=_1(J?.providers),z=l1(J?.pnpEnforcement,"pnpEnforcement"),Z={policy:{allowed:q7(N7(Q?.allowed,"policy.allowed")),blocked:q7(N7(Q?.blocked,"policy.blocked"))},placement:{section:q7(N7(W?.section,"placement.section")).length?q7(N7(W?.section,"placement.section")):[...G4.section],item:q7(N7(W?.item,"placement.item")).length?q7(N7(W?.item,"placement.item")):[...G4.item],passage:q7(N7(W?.passage,"placement.passage")).length?q7(N7(W?.passage,"placement.passage")):[...G4.passage]},providers:X};if(z)Z.pnpEnforcement=z;return Z}import{dynamicMessageKey as hH}from"@pie-players/pie-players-shared/i18n/provider";var c1=["assessment","section","item","passage","rubric","element"];function ZQ(J,Q){if(typeof J!=="string"||J.trim().length===0)throw Error(`Invalid tool registration: "${Q}" must be a non-empty string.`)}var i1=[{pattern:/<script\b/i,reason:"contains a <script> tag"},{pattern:/\son[a-z]+\s*=/i,reason:"contains an inline event handler (on*=) attribute"},{pattern:/javascript:/i,reason:"contains a javascript: URL"},{pattern:/<foreignObject\b/i,reason:"contains a <foreignObject> element"}];function o1(J,Q,W){let X=Q.trimStart(),z=X.toLowerCase().startsWith("<svg"),Z=/^https?:/i.test(X);if(/^data:/i.test(X))throw Error(`Invalid tool registration "${J}": "${W}" may not be a data: URL.`);if(!z&&!Z)return;for(let{pattern:G,reason:$}of i1)if(G.test(Q))throw Error(`Invalid tool registration "${J}": "${W}" ${$}. Inline SVG icons must not include scriptable content.`)}function q6(J){ZQ(J.toolId,"toolId"),ZQ(J.name,"name"),ZQ(J.description,"description");let Q=J.activation==="region";if(!Q||J.icon!==void 0){if(typeof J.icon!=="string"&&typeof J.icon!=="function")throw Error(`Invalid tool registration "${J.toolId}": "icon" must be a string or function.`)}if(typeof J.icon==="string")o1(J.toolId,J.icon,"icon");if(!Array.isArray(J.supportedLevels)||J.supportedLevels.length===0)throw Error(`Invalid tool registration "${J.toolId}": "supportedLevels" must be a non-empty array.`);let W=J.supportedLevels.find((X)=>!c1.includes(X));if(W)throw Error(`Invalid tool registration "${J.toolId}": unsupported level "${W}".`);if(J.activation!==void 0&&J.activation!=="toolbar-toggle"&&J.activation!=="selection-gateway"&&J.activation!=="region")throw Error(`Invalid tool registration "${J.toolId}": unsupported activation "${String(J.activation)}".`);if(J.surfaces!==void 0&&(!Array.isArray(J.surfaces)||J.surfaces.some((X)=>typeof X!=="string"||X.trim().length===0)))throw Error(`Invalid tool registration "${J.toolId}": "surfaces" must be an array of non-empty strings.`);if(Q&&!J.surfaces?.length)throw Error(`Invalid tool registration "${J.toolId}": region tools must declare at least one host surface in "surfaces".`);if(Q&&typeof J.renderSurface!=="function")throw Error(`Invalid tool registration "${J.toolId}": region tools must implement "renderSurface".`);if(J.resolvesWithoutGrant!==void 0&&typeof J.resolvesWithoutGrant!=="boolean")throw Error(`Invalid tool registration "${J.toolId}": "resolvesWithoutGrant" must be a boolean.`);if(J.resolvesWithoutGrant&&!J.requiresAuthoredContent)throw Error(`Invalid tool registration "${J.toolId}": "resolvesWithoutGrant" requires "requiresAuthoredContent".`);if(J.renderSurface!==void 0&&typeof J.renderSurface!=="function")throw Error(`Invalid tool registration "${J.toolId}": "renderSurface" must be a function.`);if(J.renderSurface&&!J.surfaces?.length)throw Error(`Invalid tool registration "${J.toolId}": "renderSurface" requires at least one entry in "surfaces".`);if(J.singletonScope!==void 0&&J.singletonScope!=="section")throw Error(`Invalid tool registration "${J.toolId}": unsupported singletonScope "${String(J.singletonScope)}".`);if(J.activation==="selection-gateway"&&J.singletonScope!=="section")throw Error(`Invalid tool registration "${J.toolId}": selection-gateway tools must declare singletonScope "section".`);if(J.pnpSupportIds!==void 0&&(!Array.isArray(J.pnpSupportIds)||J.pnpSupportIds.some((X)=>typeof X!=="string"||X.trim().length===0)))throw Error(`Invalid tool registration "${J.toolId}": "pnpSupportIds" must be an array of non-empty strings.`);if(J.activation!=="region"&&typeof J.isVisibleInContext!=="function")throw Error(`Invalid tool registration "${J.toolId}": "isVisibleInContext" must be a function.`);if(J.isVisibleInContext!==void 0&&typeof J.isVisibleInContext!=="function")throw Error(`Invalid tool registration "${J.toolId}": "isVisibleInContext" must be a function when present.`);if(J.isApplicableToContent!==void 0&&typeof J.isApplicableToContent!=="function")throw Error(`Invalid tool registration "${J.toolId}": "isApplicableToContent" must be a function when present.`);if(J.requiresAuthoredContent!==void 0){if(typeof J.requiresAuthoredContent!=="object"||J.requiresAuthoredContent===null||typeof J.requiresAuthoredContent.resolve!=="function")throw Error(`Invalid tool registration "${J.toolId}": "requiresAuthoredContent" must be an object with a "resolve" function.`);if(!J.pnpSupportIds?.length)throw Error(`Invalid tool registration "${J.toolId}": "requiresAuthoredContent" requires at least one entry in "pnpSupportIds", which is what a host filters a default grant list on.`)}if(J.renderToolbar!==void 0){if(typeof J.renderToolbar!=="function")throw Error(`Invalid tool registration "${J.toolId}": "renderToolbar" must be a function.`)}else if(!Q)throw Error(`Invalid tool registration "${J.toolId}": "renderToolbar" must be a function.`)}class s1{tools=new Map;pnpIndex=new Map;componentOverrides={};moduleLoaders=new Map;loadedToolModules=new Set;moduleLoadPromises=new Map;changeListeners=new Set;emitChange(J){for(let Q of this.changeListeners)try{Q(J)}catch(W){console.warn("[ToolRegistry] change listener failed:",W)}}onRegistryChange(J){this.changeListeners.add(J);let Q=!0;return()=>{if(!Q)return;Q=!1,this.changeListeners.delete(J)}}normalizeToolId(J){return $4(J)}normalizeToolIds(J){return J.map((Q)=>this.normalizeToolId(Q))}register(J){if(q6(J),this.tools.has(J.toolId))throw Error(`Tool '${J.toolId}' is already registered`);if(this.tools.set(J.toolId,J),J.pnpSupportIds)for(let Q of J.pnpSupportIds){if(!this.pnpIndex.has(Q))this.pnpIndex.set(Q,new Set);this.pnpIndex.get(Q).add(J.toolId)}this.emitChange({kind:"register",toolIds:[J.toolId]})}override(J){if(q6(J),!this.tools.has(J.toolId))throw Error(`Cannot override non-existent tool '${J.toolId}'`);let Q=this.tools.get(J.toolId);if(Q.pnpSupportIds)for(let W of Q.pnpSupportIds)this.pnpIndex.get(W)?.delete(J.toolId);if(this.tools.set(J.toolId,J),J.pnpSupportIds)for(let W of J.pnpSupportIds){if(!this.pnpIndex.has(W))this.pnpIndex.set(W,new Set);this.pnpIndex.get(W).add(J.toolId)}this.emitChange({kind:"override",toolIds:[J.toolId]})}unregister(J){let Q=this.tools.get(J);if(!Q)return;if(Q.pnpSupportIds)for(let W of Q.pnpSupportIds)this.pnpIndex.get(W)?.delete(J);this.tools.delete(J),this.emitChange({kind:"unregister",toolIds:[J]})}get(J){return this.tools.get(J)}has(J){return this.tools.has(J)}getAllToolIds(){return Array.from(this.tools.keys())}getAllTools(){return Array.from(this.tools.values())}getToolsByPNPSupport(J){return this.pnpIndex.get(J)||new Set}getToolsByLevel(J){return this.getAllTools().filter((Q)=>Q.supportedLevels.includes(J))}getToolActivation(J){return this.get(J)?.activation||"toolbar-toggle"}getToolSingletonScope(J){return this.get(J)?.singletonScope||null}getToolsBySurface(J){if(!J)return[];return this.getAllTools().filter((Q)=>typeof Q.renderSurface==="function"&&Q.surfaces?.includes(J))}getContentDependentSupportIds(){let J=new Set;for(let Q of this.getAllTools()){if(!Q.requiresAuthoredContent)continue;for(let W of Q.pnpSupportIds||[])J.add(W)}return[...J].sort()}filterToolIdsByActivation(J,Q){return J.filter((W)=>this.getToolActivation(W)===Q)}filterVisibleInContext(J,Q){let W=[];for(let X of J){let z=this.get(X);if(!z){console.warn(`Tool '${X}' is allowed but not registered`);continue}if(!z.supportedLevels.includes(Q.level))continue;try{if(z.isVisibleInContext?.(Q))W.push(z)}catch(Z){console.error(`Error evaluating visibility for tool '${X}':`,Z)}}return W}isApplicableToAnyContext(J,Q){let W=this.get(J);if(!W?.isApplicableToContent)return!0;if(Q.length===0)return!0;return Q.some((X)=>{try{return W.isApplicableToContent?.(X)??!0}catch(z){return console.error(`Error evaluating applicability for tool '${J}':`,z),!0}})}getToolMetadata(){return this.getAllTools().map((J)=>({toolId:J.toolId,name:J.name,description:J.description,pnpSupportIds:J.pnpSupportIds||[],supportedLevels:J.supportedLevels,activation:J.activation||"toolbar-toggle",singletonScope:J.singletonScope||null,surfaces:J.surfaces||[],requiresAuthoredContent:Boolean(J.requiresAuthoredContent),contentDependencyDescription:J.requiresAuthoredContent?.description??null}))}generatePNPSupportsFromTools(J){let Q=new Set;for(let W of J){let X=this.get(W);if(X?.pnpSupportIds)for(let z of X.pnpSupportIds)Q.add(z)}return Array.from(Q)}clear(){let J=this.getAllToolIds();if(J.length===0)return;this.tools.clear(),this.pnpIndex.clear(),this.emitChange({kind:"clear",toolIds:J})}setComponentOverrides(J){if(this.componentOverrides===J)return;this.componentOverrides=J,this.emitChange({kind:"component-overrides",toolIds:[]})}setToolModuleLoaders(J){let Q=Object.entries(J).filter((X)=>X[1]!==void 0);for(let[X,z]of Q)if(ZQ(X,"tool module loader id"),typeof z!=="function")throw Error(`Invalid tool module loader for "${X}": expected a function.`);let W=[];for(let[X,z]of Q){if(this.moduleLoaders.get(X)===z)continue;this.moduleLoaders.set(X,z),W.push(X)}if(W.length>0)this.emitChange({kind:"module-loaders",toolIds:W})}async ensureToolModuleLoaded(J){if(this.loadedToolModules.has(J))return;let Q=this.moduleLoadPromises.get(J);if(Q){await Q;return}let W=this.moduleLoaders.get(J);if(!W)return;let X=(async()=>{await W(),this.loadedToolModules.add(J)})();this.moduleLoadPromises.set(J,X);try{await X}finally{this.moduleLoadPromises.delete(J)}}async ensureToolModulesLoaded(J){await Promise.all(J.map((Q)=>this.ensureToolModuleLoaded(Q)))}isToolModuleLoaded(J){return this.loadedToolModules.has(J)}renderForToolbar(J,Q,W){let X=this.get(J);if(!X)throw Error(`Tool '${J}' is not registered`);if(typeof X.renderToolbar!=="function")throw Error(`Tool '${J}' has activation "${X.activation||"toolbar-toggle"}" and renders into a host surface, not a toolbar. Remove it from toolbar placement.`);let z={...W,componentOverrides:{...this.componentOverrides||{},...W.componentOverrides||{}}};return X.renderToolbar(Q,z)}renderForSurface(J,Q){let W=this.get(J);if(!W)throw Error(`Tool '${J}' is not registered`);if(typeof W.renderSurface!=="function")throw Error(`Tool '${J}' does not render into a host surface. Surface capabilities declare "surfaces" and implement "renderSurface".`);return W.renderSurface({...Q,componentOverrides:{...this.componentOverrides||{},...Q.componentOverrides||{}}})}}
49
+ export{a1 as b,oJ as c,LQ as d,FQ as e,F6 as f,n7 as g,n0 as h,P0 as i,G7 as j,b8 as k,T6 as l,x6 as m,k6 as n,yQ as o,gQ as p,I as q,h as r,y8 as s,h8 as t,h6 as u,g6 as v,LJ as w,d6 as x,c6 as y,o6 as z,a6 as A,J1 as B,Q1 as C,K1 as D,G1 as E,r8 as F,n8 as G,J6 as H,N1 as I,R1 as J,j1 as K,v1 as L,K6 as M,G6 as N,DH as O,IH as P,RH as Q,q7 as R,kH as S,EH as T,s1 as U};
@@ -0,0 +1,46 @@
1
+ import{A as Z0,B as U0,D as hj,E as HL,F as CL,G as cj,H as LL,I as IL,J as sj,K as r,L as ij,M as aj,O as dj,Q as rj,S as lj,U as oj,c as OL,d as gj,e as $j,f as O,g as d,h as fL,i as GL,j as mj,k as aL,l as ZL,n as z0,o as UL,p as KL,q as L,s as f0,t as uj,u as ML,v as QL,w as z,y as XL,z as H0}from"./ItemToolBar-12jy8e7c.js";import{ContextProvider as bJ}from"@pie-players/pie-context";function i0(H){return typeof H.href==="string"}function Ij(H){if(!H||typeof H!=="object"||Array.isArray(H))return!1;let R=H;if(typeof R.id!=="string"||R.id.trim().length===0)return!1;if(typeof R.label!=="string"||R.label.trim().length===0)return!1;if(R.ariaLabel!==void 0&&typeof R.ariaLabel!=="string")return!1;if(R.icon!==void 0&&typeof R.icon!=="string")return!1;if(R.tooltip!==void 0&&typeof R.tooltip!=="string")return!1;if(R.active!==void 0&&typeof R.active!=="boolean")return!1;if(R.disabled!==void 0&&typeof R.disabled!=="boolean")return!1;let y=typeof R.href==="string",YL=typeof R.onClick==="function";if(y===YL)return!1;if(y)return!0;return YL}function a0(H){return typeof H==="string"&&H.trimStart().startsWith("<svg")}function d0(H){return typeof H==="string"&&H.trimStart().startsWith("http")}import{sanitizeSvgIcon as k0}from"@pie-players/pie-players-shared/security";import{resolveInterfaceI18n as _J}from"@pie-players/pie-players-shared/i18n/provider";import{approximateZoomFromWidths as EJ,computeZoomCompensation as vJ,ICON_BUTTON_ZOOM_OPTIONS as bj}from"@pie-players/pie-players-shared/ui/zoom-compensation";import{collectFocusable as gJ,createFocusTrap as $J,FOCUSABLE_SELECTOR as mJ,isProgrammaticFocusTarget as uJ}from"@pie-players/pie-players-shared";var CJ={calculator:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Zm0 2v4h10V4H7Zm0 6v2h2v-2H7Zm4 0v2h2v-2h-2Zm4 0v2h2v-2h-2Zm-8 4v2h2v-2H7Zm4 0v2h2v-2h-2Zm4 0v2h2v-2h-2Zm-8 4v2h2v-2H7Zm4 0v2h2v-2h-2Zm4 0v2h2v-2h-2Z" fill="currentColor"/></svg>',"volume-up":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 3.23v2.06A7.002 7.002 0 0 1 19 12a7 7 0 0 1-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77Zm-2 17.75V3L7 8H3v8h4l5 5Zm4.5-9a4.5 4.5 0 0 0-2.5-4.03v8.05A4.5 4.5 0 0 0 16.5 12Z" fill="currentColor"/></svg>',swatch:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3a9 9 0 1 0 9 9c0-.55-.45-1-1-1h-2.5a1.5 1.5 0 0 1 0-3H20a1 1 0 0 0 1-1 8.99 8.99 0 0 0-9-4Zm-5.5 9A1.5 1.5 0 1 1 8 13.5 1.5 1.5 0 0 1 6.5 12Zm3-4A1.5 1.5 0 1 1 11 9.5 1.5 1.5 0 0 1 9.5 8Zm5 0A1.5 1.5 0 1 1 16 9.5 1.5 1.5 0 0 1 14.5 8Z" fill="currentColor"/></svg>',"chart-bar":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.75 5a.76.76 0 0 1 .75.75v11c0 .438.313.75.75.75h13a.76.76 0 0 1 .696 1.039.74.74 0 0 1-.696.461h-13C5 19 4 18 4 16.75v-11A.74.74 0 0 1 4.75 5ZM8 8.25a.74.74 0 0 1 .75-.75h6.5a.76.76 0 0 1 .696 1.039.74.74 0 0 1-.696.461h-6.5A.722.722 0 0 1 8 8.25Zm.75 2.25h4.5a.76.76 0 0 1 .696 1.039.74.74 0 0 1-.696.461h-4.5a.723.723 0 0 1-.75-.75.74.74 0 0 1 .75-.75Zm0 3h8.5a.76.76 0 0 1 .696 1.039.74.74 0 0 1-.696.461h-8.5a.723.723 0 0 1-.75-.75.74.74 0 0 1 .75-.75Z" fill="currentColor"/></svg>',beaker:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 21c-.85 0-1.454-.38-1.813-1.137-.358-.759-.27-1.463.263-2.113L9 11V5H8a.968.968 0 0 1-.713-.287A.968.968 0 0 1 7 4c0-.283.096-.52.287-.712A.968.968 0 0 1 8 3h8c.283 0 .52.096.712.288.192.191.288.429.288.712s-.096.52-.288.713A.968.968 0 0 1 16 5h-1v6l5.55 6.75c.533.65.62 1.354.262 2.113C20.454 20.62 19.85 21 19 21H5Zm2-3h10l-3.4-4h-3.2L7 18Zm-2 1h14l-6-7.3V5h-2v6.7L5 19Z" fill="currentColor"/></svg>',protractor:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m6.75 21-.25-2.2 2.85-7.85a3.95 3.95 0 0 0 1.75.95l-2.75 7.55L6.75 21Zm10.5 0-1.6-1.55-2.75-7.55a3.948 3.948 0 0 0 1.75-.95l2.85 7.85-.25 2.2ZM12 11a2.893 2.893 0 0 1-2.125-.875A2.893 2.893 0 0 1 9 8c0-.65.188-1.23.563-1.737A2.935 2.935 0 0 1 11 5.2V3h2v2.2c.583.2 1.063.554 1.438 1.063C14.812 6.77 15 7.35 15 8c0 .833-.292 1.542-.875 2.125A2.893 2.893 0 0 1 12 11Zm0-2c.283 0 .52-.096.713-.287A.967.967 0 0 0 13 8a.967.967 0 0 0-.287-.713A.968.968 0 0 0 12 7a.968.968 0 0 0-.713.287A.967.967 0 0 0 11 8c0 .283.096.52.287.713.192.191.43.287.713.287Z" fill="currentColor"/></svg>',"bars-3":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.85 15c.517 0 .98-.15 1.388-.45.408-.3.695-.692.862-1.175l.375-1.15c.267-.8.2-1.537-.2-2.213C8.875 9.337 8.3 9 7.55 9H4.025l.475 3.925c.083.583.346 1.075.787 1.475.442.4.963.6 1.563.6Zm10.3 0c.6 0 1.12-.2 1.563-.6.441-.4.704-.892.787-1.475L19.975 9h-3.5c-.75 0-1.325.342-1.725 1.025-.4.683-.467 1.425-.2 2.225l.35 1.125c.167.483.454.875.862 1.175.409.3.871.45 1.388.45Zm-10.3 2c-1.1 0-2.063-.363-2.887-1.088a4.198 4.198 0 0 1-1.438-2.737L2 9H1V7h6.55c.733 0 1.404.18 2.013.537A3.906 3.906 0 0 1 11 9h2.025c.35-.617.83-1.104 1.438-1.463A3.892 3.892 0 0 1 16.474 7H23v2h-1l-.525 4.175a4.198 4.198 0 0 1-1.438 2.737A4.238 4.238 0 0 1 17.15 17c-.95 0-1.804-.27-2.562-.813A4.234 4.234 0 0 1 13 14.026l-.375-1.125a21.35 21.35 0 0 1-.1-.363 4.926 4.926 0 0 1-.1-.537h-.85c-.033.2-.067.363-.1.488a21.35 21.35 0 0 1-.1.362L11 14a4.3 4.3 0 0 1-1.588 2.175A4.258 4.258 0 0 1 6.85 17Z" fill="currentColor"/></svg>',ruler:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m8.8 10.95 2.15-2.175-1.4-1.425-1.1 1.1-1.4-1.4 1.075-1.1L7 4.825 4.825 7 8.8 10.95Zm8.2 8.225L19.175 17l-1.125-1.125-1.1 1.075-1.4-1.4 1.075-1.1-1.425-1.4-2.15 2.15L17 19.175ZM7.25 21H3v-4.25l4.375-4.375L2 7l5-5 5.4 5.4 3.775-3.8c.2-.2.425-.35.675-.45a2.068 2.068 0 0 1 1.55 0c.25.1.475.25.675.45L20.4 4.95c.2.2.35.425.45.675.1.25.15.508.15.775a1.975 1.975 0 0 1-.6 1.425l-3.775 3.8L22 17l-5 5-5.375-5.375L7.25 21ZM5 19h1.4l9.8-9.775L14.775 7.8 5 17.6V19Z" fill="currentColor"/></svg>',"book-open":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 6.25a6.6 6.6 0 0 0-2.3-1.32A8.6 8.6 0 0 0 7 4.5c-.63 0-1.25.06-1.85.18-.6.12-1.19.3-1.76.54a1.5 1.5 0 0 0-.93 1.4v10.1c0 .52.26.98.68 1.24.42.26.92.28 1.35.06.36-.18.75-.31 1.18-.4.42-.09.86-.13 1.33-.13.78 0 1.53.14 2.24.42.7.28 1.35.7 1.93 1.24l.83-.75.83.75c.58-.54 1.22-.96 1.93-1.24a6.1 6.1 0 0 1 2.24-.42c.47 0 .91.04 1.33.13.43.09.82.22 1.18.4.43.22.93.2 1.35-.06.42-.26.68-.72.68-1.24V6.62c0-.6-.36-1.15-.93-1.4a9.3 9.3 0 0 0-1.76-.54A9.8 9.8 0 0 0 17 4.5a8.6 8.6 0 0 0-2.7.43A6.6 6.6 0 0 0 12 6.25Zm1 10.06V8.02c.55-.5 1.16-.88 1.84-1.13A6 6 0 0 1 17 6.5c.45 0 .89.04 1.32.11.43.08.85.19 1.26.34v9.24a8.2 8.2 0 0 0-1.28-.24A10 10 0 0 0 17 15.85c-.72 0-1.42.09-2.09.26a7.7 7.7 0 0 0-1.91.8Zm-2 0a7.7 7.7 0 0 0-1.91-.8 8.4 8.4 0 0 0-2.09-.26c-.44 0-.87.02-1.3.07-.43.05-.86.13-1.28.24V6.95c.41-.15.83-.26 1.26-.34A7.7 7.7 0 0 1 7 6.5c.76 0 1.48.13 2.16.39.68.25 1.29.63 1.84 1.13Z" fill="currentColor"/></svg>',photo:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 21c-.55 0-1.02-.2-1.41-.59A1.93 1.93 0 0 1 2 19V5c0-.55.2-1.02.59-1.41A1.93 1.93 0 0 1 4 3h16c.55 0 1.02.2 1.41.59.39.39.59.86.59 1.41v14c0 .55-.2 1.02-.59 1.41-.39.39-.86.59-1.41.59H4Zm0-2h16V5H4v14Zm1.5-2.5h13l-4.1-5.47-3.4 4.47-2.5-3.25L5.5 16.5ZM8.5 10a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" fill="currentColor"/></svg>'};function yj(H){return CJ[H]||null}var IJ=["assessment","section","item","passage","rubric"],yJ=new Set(IJ);function pj(H){return yJ.has(H)}function P0(H,R,y){let YL=H.trim(),xL=y.trim();if(!YL||!xL)throw Error("Tool instance ids require non-empty tool and scope ids");if(!pj(R))throw Error(`Unknown tool scope level '${R}'. Register custom levels with registerToolScopeLevel().`);return`${YL}:${R}:${xL}`}function r0(H){let R=H.split(":");if(R.length!==3)return null;let[y,YL,xL]=R;if(!y||!xL)return null;if(!pj(YL))return null;return{baseToolId:y,scopeLevel:YL,scopeId:xL}}import"@pie-players/pie-players-shared/nds-icon-button";var pJ=(H,R)=>{if(customElements.get(H))return;try{customElements.define(H,R)}catch(y){if(!(y instanceof DOMException&&y.name==="NotSupportedError"||y&&typeof y==="object"&&y.name==="NotSupportedError")||!customElements.get(H))throw y}},W0=ML('<span class="item-toolbar__element-host svelte-rnx3ie"></span>'),hJ=ML('<span class="item-toolbar__nds-button-zoom svelte-rnx3ie"><nds-icon-button></nds-icon-button></span>',2),w0=ML('<span aria-hidden="true"></span>'),_j=ML('<img class="item-toolbar__icon-image svelte-rnx3ie" alt=""/>'),Ej=ML('<i aria-hidden="true"></i>'),cJ=ML("<a><!></a>"),sJ=ML('<button type="button"><!></button>'),vj=ML('<span class="item-toolbar__controls-host svelte-rnx3ie"></span>'),iJ=ML("<div></div>"),aJ=ML('<div><div class="item-toolbar__tools-row svelte-rnx3ie"><!> <!> <!></div> <!></div>'),dJ={hash:"svelte-rnx3ie",code:`.item-toolbar.svelte-rnx3ie {display:flex;flex-direction:column;align-items:flex-end;gap:0;--pie-toolbar-tools-row-height: 2rem;--pie-tts-controls-row-height: 2.875rem;}.item-toolbar__tools-row.svelte-rnx3ie {display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;
2
+ /* Cap the gap between toolbar items (e.g. TTS play ↔ calculator) at its
3
+ 200%-zoom size with the same factor the buttons use, so the spacing
4
+ doesn't keep growing past 200% while the buttons themselves freeze. */gap:calc(0.5rem * var(--pie-toolbar-zoom-comp, 1));min-height:var(--pie-toolbar-tools-row-height);}
5
+
6
+ /* A granted section tool must stay reachable even when there isn't room for
7
+ every button: scroll the row rather than clipping items past the edge,
8
+ which left them impossible to focus, tab to, or click. \`min-width: 0\`
9
+ beats the flex default (\`auto\`, i.e. never shrink below content), which
10
+ would otherwise keep the row at full content width and make overflow-x
11
+ moot. Scoped to section level: an item's own toolbar hosts far fewer
12
+ tools and, for the inline TTS tool's "expanding row" layout, relies on
13
+ this row growing freely to host its reading-controls panel — capping its
14
+ width here clips that panel instead. */.item-toolbar[data-level="section"].svelte-rnx3ie .item-toolbar__tools-row:where(.svelte-rnx3ie) {overflow-x:auto;max-width:100%;min-width:0;}.item-toolbar__controls-row.svelte-rnx3ie {display:flex;align-items:center;justify-content:flex-end;width:100%;min-height:0;height:auto;}.item-toolbar__controls-row--reserve.svelte-rnx3ie {min-height:var(--pie-tts-controls-row-height);height:var(--pie-tts-controls-row-height);}.item-toolbar__controls-row--active.svelte-rnx3ie {min-height:var(--pie-tts-controls-row-height);height:var(--pie-tts-controls-row-height);}.item-toolbar__controls-row--align-start.svelte-rnx3ie {justify-content:flex-start;}.item-toolbar__controls-host.svelte-rnx3ie {display:inline-flex;align-items:center;justify-content:flex-end;width:100%;}.item-toolbar--top.svelte-rnx3ie,
15
+ .item-toolbar--bottom.svelte-rnx3ie {align-items:flex-end;}.item-toolbar--left.svelte-rnx3ie,
16
+ .item-toolbar--right.svelte-rnx3ie {align-items:stretch;}.item-toolbar--left.svelte-rnx3ie .item-toolbar__tools-row:where(.svelte-rnx3ie),
17
+ .item-toolbar--right.svelte-rnx3ie .item-toolbar__tools-row:where(.svelte-rnx3ie) {flex-direction:column;align-items:center;justify-content:flex-start;flex-wrap:nowrap;}.item-toolbar--left.svelte-rnx3ie .item-toolbar__controls-row:where(.svelte-rnx3ie),
18
+ .item-toolbar--right.svelte-rnx3ie .item-toolbar__controls-row:where(.svelte-rnx3ie) {justify-content:flex-start;width:auto;min-height:0;height:auto;}.item-toolbar__button.svelte-rnx3ie {display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0.25rem;border:1px solid var(--pie-button-border, var(--pie-border, #ccc));border-radius:0.25rem;background-color:var(--pie-button-bg, var(--pie-background, white));color:var(--pie-button-color, var(--pie-text, #333));cursor:pointer;transition:all 0.15s ease;text-decoration:none;}
19
+
20
+ /* Drive the vendored NDS icon button's outer size via its own \`--height-32\`
21
+ custom property so its light-DOM inner button matches the toolbar's
22
+ md/sm/lg dimensions (32 / 44 / 40 px) without a layout shift. The glyph
23
+ keeps the NDS-native icon size (we render size="small"), so it isn't
24
+ oversized. */
25
+ /* Freeze the calculator's header open/close button at its 200%-zoom size
26
+ (factor is 1 at zoom <= 200%). Zoom on this wrapper, not the host. */.item-toolbar__nds-button-zoom.svelte-rnx3ie {display:inline-flex;zoom:var(--pie-toolbar-zoom-comp, 1);}.item-toolbar.svelte-rnx3ie nds-icon-button:where(.svelte-rnx3ie) {
27
+ /* Host-settable button size per toolbar size (drives the NDS outer button
28
+ via its own --height-32). */--height-32: var(--pie-calculator-button-size, 2rem);
29
+ /* Host-settable accent for the calculator button: the NDS tertiary glyph
30
+ colour derives from --color-interactive-blue, remapped here to a
31
+ themeable variable. --pie-calculator-button-color is package-private, so
32
+ nothing sets it and the default is what ships: it now resolves through
33
+ --pie-button-color (DaisyUI base-content) instead of holding the Figma
34
+ blue on every theme, with the literal as the no-theme last resort.
35
+ Not --pie-primary or --pie-tertiary: both are \`direct\` mappings of
36
+ DaisyUI slots chosen to pair with their own -content colour, so a glyph
37
+ taken from either sits at 1.37:1 against the page under \`pastel\` and 11
38
+ of the 35 shipped themes fall under SC 1.4.11's 3:1. */--color-interactive-blue: var(--pie-calculator-button-color, var(--pie-button-color, var(--pie-text, #222)));
39
+ /* NDS palette bridge — keep in sync with the copies in tool-tts-inline
40
+ and section-player SectionItemsPane (asserted by
41
+ scripts/check-theme-tokens.mjs). The vendored button paints its fill,
42
+ its on-accent glyph, its hover ring and its focus ring from the NDS
43
+ design-system palette, which no PIE theme sets, so a tertiary button
44
+ kept a #f3f5f7 pill on every page — and once the glyph followed the
45
+ theme, a light glyph landed on that light pill. */--color-new-gray: var(--pie-background-dark, #f3f5f7);--color-primary-white: var(--pie-white, #ffffff);--color-primary-black: var(--pie-text, #000000);--color-focus-blue: var(--pie-button-focus-outline, #2b87ff);}.item-toolbar--sm.svelte-rnx3ie nds-icon-button:where(.svelte-rnx3ie) {--height-32: var(--pie-calculator-button-size-sm, 2.75rem);}.item-toolbar--lg.svelte-rnx3ie nds-icon-button:where(.svelte-rnx3ie) {--height-32: var(--pie-calculator-button-size-lg, 2.5rem);}.item-toolbar__element-host.svelte-rnx3ie {display:contents;}.item-toolbar--sm.svelte-rnx3ie .item-toolbar__button:where(.svelte-rnx3ie) {width:2.75rem;height:2.75rem;}.item-toolbar--sm.svelte-rnx3ie {--pie-toolbar-tools-row-height: 2.75rem;--pie-tts-controls-row-height: 3.625rem;}.item-toolbar--lg.svelte-rnx3ie .item-toolbar__button:where(.svelte-rnx3ie) {width:2.5rem;height:2.5rem;}.item-toolbar--lg.svelte-rnx3ie {--pie-toolbar-tools-row-height: 2.5rem;--pie-tts-controls-row-height: 3.375rem;}.item-toolbar__button.svelte-rnx3ie:hover:not(:disabled) {background-color:var(--pie-button-hover-bg, var(--pie-secondary-background, #f5f5f5));border-color:var(--pie-button-hover-border, var(--pie-button-border, var(--pie-border, #ccc)));color:var(--pie-button-hover-color, var(--pie-button-color, var(--pie-text, #333)));transform:translateY(-1px);box-shadow:0 2px 4px color-mix(in srgb, var(--pie-black, #000) 10%, transparent);}.item-toolbar__button.svelte-rnx3ie:active:not(:disabled) {transform:translateY(0);box-shadow:none;}.item-toolbar__button--active.svelte-rnx3ie {background-color:var(--pie-primary, #1976d2);color:var(--pie-white, #fff);border-color:var(--pie-primary, #1976d2);}.item-toolbar__button--active.svelte-rnx3ie:hover:not(:disabled) {background-color:var(--pie-primary-dark, #1565c0);}.item-toolbar__button.svelte-rnx3ie:focus-visible {outline:2px solid var(--pie-button-focus-outline, var(--pie-primary, #1976d2));outline-offset:2px;}.item-toolbar__button.svelte-rnx3ie:disabled {opacity:0.5;cursor:not-allowed;}.item-toolbar__button.svelte-rnx3ie svg {width:100%;height:100%;}.item-toolbar__icon-image.svelte-rnx3ie {width:100%;height:100%;object-fit:contain;}`};function nj(H,R){gj(R,!0),hj(H,dJ);let y=typeof window<"u",YL=["/_fa-pro/fontawesome.min.css","/_fa-pro/light.min.css"],xL="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css",tj="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap",l0=/font.?awesome|fa-?pro/i,o0=!1,x0=()=>{if(!y||o0)return;if(o0=!0,!document.querySelector('link[href*="Roboto"]')){let K=document.createElement("link");K.rel="stylesheet",K.href=tj,document.head.appendChild(K)}if(Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).some((K)=>l0.test(K.href)))return;if(!document.querySelector(`link[href="${xL}"]`)){let K=document.createElement("link");K.rel="stylesheet",K.href=xL,document.head.appendChild(K)}for(let K of YL){if(document.querySelector(`link[href="${K}"]`))continue;let J=document.createElement("link");J.rel="stylesheet",J.href=K,document.head.appendChild(J)}},n0="__pieFaToolbarShadowInstalled",ej=(j)=>{let K=j.getRootNode();if(!(K instanceof ShadowRoot))return;let J=K;if(J[n0])return;J[n0]=!0;let Z=new Set,F=(X)=>{if(!X||Z.has(X))return;Z.add(X);let N=document.createElement("link");N.rel="stylesheet",N.href=X,K.appendChild(N)},b=Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).filter((X)=>l0.test(X.href));for(let X of b)F(X.href)},LJ=(j)=>{return x0(),ej(j),{}},jJ=(j,K)=>{let J=K,Z=()=>{let b=j.querySelector("button");if(b)b.setAttribute("aria-pressed",J?"true":"false")};Z();let F=new MutationObserver(Z);return F.observe(j,{childList:!0,subtree:!0}),{update(b){J=b,Z()},destroy(){F.disconnect()}}},t0=(j)=>j.faIconName||null,JJ=new oj,yL=fL(mj({})),$L=r(R,"level",7,"item"),K0=r(R,"scopeId",7,""),B0=r(R,"itemId",7,""),S0=r(R,"sectionId",7,""),T0=r(R,"catalogId",7,""),A0=r(R,"tools",7,""),C0=r(R,"contentKind",7,"assessment-item"),BL=r(R,"position",7,"bottom"),dL=r(R,"scopeElement",7,null),I0=r(R,"toolRegistry",7,null),y0=r(R,"item",7,null),Q0=r(R,"hostButtons",23,()=>[]),p0=r(R,"class",7,""),rL=r(R,"size",7,"md"),X0=r(R,"language",7,"en-US"),NL=fL(null);function e0(){if(typeof window>"u")return 1;return vJ(EJ(window.outerWidth,window.innerWidth),bj.maxZoom,bj.minCompensation)}let Lj=fL(1);UL(()=>{if(typeof window>"u")return;let j=()=>{GL(Lj,e0(),!0)};return j(),window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)});let x=fL(null),lL=O(()=>L(x)?.ndsIcons===!0),oL=O(()=>_J(L(x))),pL=fL(null),nL=fL(0),V0=fL(0),b0=fL(0);UL(()=>{if(!L(NL))return;return dj(L(NL),(j)=>{GL(x,j,!0)})}),UL(()=>{if(!L(NL))return;return rj(L(NL),(j)=>{GL(pL,j,!0)})}),UL(()=>{let j=L(x)?.toolkitCoordinator;if(!j||typeof j.onPolicyChange!=="function")return;let K=j.onPolicyChange(()=>{GL(V0,L(V0)+1)});return()=>{try{K?.()}catch{}}}),UL(()=>{let j=L(x)?.toolkitCoordinator;if(!j||typeof j.onToolContextResolverChange!=="function")return;let K=j.onToolContextResolverChange(()=>{GL(b0,L(b0)+1)});return()=>{try{K?.()}catch{}}});let B=O(()=>L(x)?.toolCoordinator),jj=O(()=>L(x)?.ttsService),mL=O(()=>L(x)?.elementToolStateStore),Y0=O(()=>L(x)?.assessmentId??""),tL=O(()=>B0()||L(pL)?.itemId||""),l=O(()=>L(pL)?.canonicalItemId||L(tL)),SL=O(()=>S0()||L(x)?.sectionId||""),uL=O(()=>C0()||L(pL)?.contentKind||($L()==="section"?"section":"assessment-item")),p=O(()=>{if($L()&&$L()!=="item")return $L();if(L(uL)==="rubric-block-stimulus")return"passage";return"item"}),PL=O(()=>{if(K0())return K0();if(L(p)==="section")return L(SL)||L(x)?.sectionId||"default-section";if(L(p)==="assessment")return L(x)?.assessmentId||"default-assessment";return L(l)||L(tL)||"default-item"}),Jj=O(()=>T0()||L(PL)),kL=O(()=>y0()||L(pL)?.item||null),t=O(()=>I0()||JJ),ZJ=O(()=>lj(A0())),UJ=O(()=>L(t).normalizeToolIds(L(ZJ)).filter(Boolean)),Zj=O(()=>{if(L(p)==="section")return"section";if(L(p)==="passage"||L(uL)==="rubric-block-stimulus")return"passage";return"item"}),D0=O(()=>{L(V0);let j=L(x)?.toolkitCoordinator;if(!j||typeof j.decideToolPolicy!=="function")return null;return j.decideToolPolicy({level:L(Zj),scope:{level:L(p),scopeId:L(PL),assessmentId:L(x)?.assessmentId,sectionId:L(SL)||void 0,itemId:L(tL)||void 0,canonicalItemId:L(l)||void 0,contentKind:L(uL)}})}),Uj=O(()=>{let j=(K)=>Array.from(new Set(K));if(L(D0))return j(L(t).normalizeToolIds(L(D0).visibleTools.map((K)=>K.toolId)).filter(Boolean));return j(L(UJ))}),KJ=O(()=>{let j=new Set;if(!L(D0))return j;for(let K of L(D0).visibleTools){if(!K.required&&!K.alwaysAvailable)continue;for(let J of L(t).normalizeToolIds([K.toolId]).filter(Boolean))j.add(J)}return j}),_0=O(()=>{if(L(p)==="section"||L(p)==="assessment")return!0;let j=L(kL)?.config;return!!(L(kL)&&j&&typeof j==="object")}),Kj=O(()=>{L(V0);let j=L(x)?.toolkitCoordinator;if(!j||typeof j.getPolicyInputs!=="function")return null;return j.getPolicyInputs()}),hL=O(()=>L(Kj)?.assessment??null),O0=O(()=>L(Kj)?.currentItemRef??null),bL=O(()=>{if(L(p)==="section")return{level:"section",assessment:L(hL)||{},section:{}};if(L(p)==="assessment")return{level:"assessment",assessment:L(hL)||{}};if(!L(_0)||!L(kL))return null;if(L(p)==="passage")return{level:"passage",assessment:L(hL)||{},itemRef:L(O0)||{id:L(l)},passage:L(kL)};return{level:"item",assessment:L(hL)||{},itemRef:L(O0)||{id:L(l)},item:L(kL)}}),Qj=O(()=>{if(L(bL))return L(bL);return{level:"item",assessment:L(hL)||{},itemRef:L(O0)||{id:L(l)},item:L(kL)||{id:L(l),config:{}}}}),G0=O(()=>{if(L(p)!=="item"&&L(p)!=="passage")return[];if(!L(_0)||!L(kL))return[];let j=L(kL)?.config?.models;return(Array.isArray(j)?j:j&&typeof j==="object"?Object.values(j):[]).filter((J)=>J&&typeof J==="object"&&typeof J.id==="string").map((J)=>({level:"element",assessment:L(hL)||{},itemRef:L(O0)||{id:L(l)},item:L(kL),elementId:J.id}))}),QJ=O(()=>{let j=L(x)?.toolkitCoordinator||null,K=(J)=>r0(J)?J:P0(J,L(p),L(PL));return{scope:{level:L(p),scopeId:L(PL),assessmentId:L(x)?.assessmentId,sectionId:L(SL),itemId:L(tL),canonicalItemId:L(l),contentKind:L(uL)},itemId:L(PL),catalogId:L(Jj),language:X0(),i18n:L(oL),ui:{size:rL()},getScopeElement:()=>dL()||L(pL)?.scopeElement||null,getGlobalElementId:()=>{if(!L(mL)||!L(Y0)||!L(SL)||!L(l))return null;return L(mL).getGlobalElementId(L(Y0),L(SL),L(l),L(l))},toolCoordinator:L(B)||null,toolkitCoordinator:j,ttsService:L(jj)||null,elementToolStateStore:L(mL)||null,toggleTool:(J)=>{if(!L(B))return;let Z=K(J);if(!L(B).getToolState(Z))L(B).registerTool(Z,J);L(B).toggleTool(Z)},isToolVisible:(J)=>{if(!L(B))return!1;return L(B).isToolVisible(K(J))},subscribeVisibility:L(B)?(J)=>L(B).subscribe(J):null}}),E0=O(()=>{L(b0);let j=L(x)?.toolkitCoordinator;if(!j||typeof j.hasToolContextResolver!=="function"||typeof j.resolveToolContext!=="function")return{};let K={};for(let J of L(Uj)){if(!L(t).get(J)?.supportedLevels.includes(L(p)))continue;if(!j.hasToolContextResolver(J))continue;let F=j.resolveToolContext({toolId:J,context:L(Qj),toolbarContext:L(QJ)});if(F)K[J]=F}return K}),XJ=O(()=>{let j=L(Uj).filter((X)=>{let N=L(t).get(X);return N?N.supportedLevels.includes(L(p)):!1}),K=Object.values(L(E0)),J=new Set(K.map((X)=>X.toolId)),Z=new Set(K.filter((X)=>X.visible).map((X)=>X.toolId)),F=j.filter((X)=>!J.has(X));if(L(p)==="section")return F.forEach((X)=>Z.add(X)),Array.from(Z);if(!L(_0))return F.forEach((X)=>Z.add(X)),Array.from(Z);if(!L(bL)&&L(G0).length===0)return F.forEach((X)=>Z.add(X)),Array.from(Z);if(F.filter((X)=>L(KJ).has(X)).forEach((X)=>Z.add(X)),L(bL))L(t).filterVisibleInContext(F,L(bL)).forEach((X)=>Z.add(X.toolId));for(let X of L(G0))L(t).filterVisibleInContext(F,X).forEach((N)=>Z.add(N.toolId));let b=L(bL)?[L(bL),...L(G0)]:L(G0);for(let X of Array.from(Z)){if(J.has(X))continue;if(!L(t).isApplicableToAnyContext(X,b))Z.delete(X)}return Array.from(Z)}),eL=O(()=>L(t).filterToolIdsByActivation(L(XJ),"toolbar-toggle"));UL(()=>{if(!y)return;let j=!1;return L(t).ensureToolModulesLoaded(L(eL)).then(()=>{if(!j)GL(nL,L(nL)+1)}).catch((K)=>{console.error("[ItemToolBar] Failed to load one or more tool modules:",K)}),()=>{j=!0}});function VJ(){if(dL())return dL();return L(pL)?.scopeElement||null}function YJ(){if(!L(mL)||!L(Y0)||!L(SL)||!L(l))return null;return L(mL).getGlobalElementId(L(Y0),L(SL),L(l),L(l))}let _L=O(()=>{let j=L(x)?.toolkitCoordinator||null,K=(J)=>{return r0(J)?J:P0(J,L(p),L(PL))};return{scope:{level:L(p),scopeId:L(PL),assessmentId:L(x)?.assessmentId,sectionId:L(SL),itemId:L(tL),canonicalItemId:L(l),contentKind:L(uL)},itemId:L(PL),catalogId:L(Jj),language:X0(),i18n:L(oL),ui:{size:rL()},getScopeElement:VJ,getGlobalElementId:YJ,toolCoordinator:L(B)||null,toolkitCoordinator:j,ttsService:L(jj)||null,elementToolStateStore:L(mL)||null,toggleTool:(J)=>{if(!L(B))return;let Z=K(J);if(!L(B).getToolState(Z))L(B).registerTool(Z,J);L(B).toggleTool(Z)},isToolVisible:(J)=>{if(!L(B))return!1;return L(B).isToolVisible(K(J))},subscribeVisibility:L(B)?(J)=>L(B).subscribe(J):null,getResolvedToolContext:(J)=>L(E0)[J]??null,getToolRenderParams:(J)=>{let Z=L(E0)[J]?.params??null,F=Xj.get(J);if(!F)return Z;return{...Z??{},...F}}}}),Xj=new Map,Vj=0,WL=O(()=>{if(!y)return[];L(nL);let j=[];for(let K of L(eL)){let J=L(t).renderForToolbar(K,L(Qj),L(_L));if(J)j.push(J)}return j}),DJ=O(()=>{if(!Array.isArray(Q0()))return[];let j=[];return Q0().forEach((K,J)=>{if(Ij(K)){j.push(K);return}console.warn(`[ItemToolBar] Ignoring invalid host button at index ${J}. Expected { id, label, href | onClick } with valid types.`)}),j}),OJ=O(()=>L(WL).filter((j)=>!!j.button).map((j)=>{let K=j.button;return{id:j.toolId,label:K.label,ariaLabel:K.ariaLabel||K.label,icon:K.icon,faIconName:K.faIconName,tooltip:K.tooltip||K.label,disabled:K.disabled,active:L(yL)[j.toolId]??K.active??!1,onClick:()=>{K.onClick(),cL()}}})),Yj=O(()=>[...L(OJ),...L(DJ)]),L0=O(()=>{let j={};for(let K of L(WL))j[K.toolId]=L(yL)[K.toolId]??K.button?.active??!1;return j}),GJ=O(()=>L(WL).flatMap((j)=>(j.elements||[]).filter((K)=>K.mount==="before-buttons").filter((K)=>Boolean(K.element)).map((K,J)=>({key:`before-${j.toolId}-${J}`,toolId:j.toolId,entry:K})))),MJ=O(()=>L(WL).flatMap((j)=>(j.elements||[]).filter((K)=>K.mount==="after-buttons").filter((K)=>Boolean(K.element)).map((K,J)=>({key:`after-${j.toolId}-${J}`,toolId:j.toolId,entry:K})))),Dj=O(()=>L(WL).flatMap((j)=>(j.elements||[]).filter((K)=>K.mount==="controls-row").filter((K)=>Boolean(K.element)).map((K,J)=>({key:`controls-row-${j.toolId}-${J}`,toolId:j.toolId,entry:K})))),Oj=O(()=>L(WL).flatMap((j)=>(j.elements||[]).map((K)=>({toolId:j.toolId,hint:K.layoutHints?.controlsRow})).filter((K)=>Boolean(K.hint)))),Gj=O(()=>L(WL).flatMap((j)=>(j.elements||[]).map((K)=>({toolId:j.toolId,hint:K.layoutHints?.headerOverlay})).filter((K)=>Boolean(K.hint)))),Mj=O(()=>L(Oj).some((j)=>j.hint?.reserveSpace===!0)),Nj=O(()=>L(Oj).some((j)=>j.hint?.showWhenToolActive===!0&&(L(L0)[j.toolId]??!1))),NJ=O(()=>BL()==="left"||BL()==="right"),Rj=O(()=>L(Gj).some((j)=>j.hint?.showWhenToolActive===!0&&(L(L0)[j.toolId]??!1))),RJ=O(()=>L(Dj).length>0||L(Mj)||L(Nj));function qJ(){if(!L(NL))return null;let j=L(NL).getRootNode();if(j instanceof ShadowRoot)return j.host;return null}UL(()=>{let j=qJ();if(!j)return;let K=L(Gj).length>0,J=L(Rj);return j.setAttribute("data-pie-header-overlay",K?"true":"false"),j.setAttribute("data-pie-header-overlay-active",J?"true":"false"),()=>{j.removeAttribute("data-pie-header-overlay"),j.removeAttribute("data-pie-header-overlay-active")}}),UL(()=>{if(!y)return;if(L(Yj).some((j)=>!!t0(j)))x0()});function M0(j){if(j.id in L(yL))return L(yL)[j.id]===!0;return j.active===!0}function qj(j){return yj(j)}function cL(){let j={};for(let K of L(WL))if(K.sync?.(),K.button)j[K.toolId]=K.button.active??!1;GL(yL,j,!0)}UL(()=>{let j=[];cL();for(let K of L(WL))if(K.subscribeActive){let J=!1,Z=K.subscribeActive((F)=>{queueMicrotask(()=>{if(J)return;GL(yL,{...L(yL),[K.toolId]:F},!0),K.sync?.()})});j.push(()=>{J=!0,Z()})}return()=>{j.forEach((K)=>K())}}),UL(()=>{let j=L(x)?.toolkitCoordinator;if(typeof j?.registerToolRequestTarget!=="function")return;let K=L(Zj);return j.registerToolRequestTarget({level:K,hostsTool:(J)=>L(eL).includes(J),open:(J,Z)=>{if(!L(B))return;if(!L(eL).includes(J))return;if(Z&&Object.keys(Z).length>0)Vj+=1,Xj.set(J,{...Z,toolRequestId:Vj});let F=P0(J,L(p),L(PL));if(!L(B).getToolState(F))L(B).registerTool(F,J);L(B).showTool(F),queueMicrotask(()=>cL())}})}),UL(()=>{if(!L(_L).subscribeVisibility)return;let j=!1,K=L(_L).subscribeVisibility(()=>{queueMicrotask(()=>{if(j)return;cL()})});return()=>{j=!0,K?.()}}),UL(()=>{let j=L(_L).toolkitCoordinator;if(typeof j?.subscribeTelemetry!=="function")return;let K=!1,J=j.subscribeTelemetry(({eventName:Z,payload:F})=>{if(Z!=="pie-toolkit-tool-config-updated")return;if(F?.toolId&&!L(eL).includes(F.toolId))return;queueMicrotask(()=>{if(K)return;GL(nL,L(nL)+1),cL()})});return()=>{K=!0,J?.()}});let FJ="[data-pie-tool-overlay-boundary]";function PJ(j,K){if(K.container!=="content-boundary")return j;let J=j;while(J){if(J instanceof HTMLElement&&J.matches(FJ))return J;if(J instanceof HTMLElement&&J.parentElement){J=J.parentElement;continue}let Z=J.getRootNode();J=Z instanceof ShadowRoot?Z.host:null}return j}function v0(j,K){let J=K,Z=null,F=j,b=(N)=>{if(!N)return;let VL=N.__pieToolElementUnmount;if(typeof VL==="function")VL()},X=(N)=>{if(Z===N)return;if(Z){if(b(Z),Z.parentNode===F)F.removeChild(Z)}if(Z=N,Z){if(F=PJ(j,J),Z.parentNode&&Z.parentNode!==F)Z.parentNode.removeChild(Z);F.appendChild(Z)}};return X(K.element),{update(N){J=N,X(N.element)},destroy(){X(null)}}}function g0(j,K){let J=K,Z=null,F=null,b=[],X=null,N=null,VL=null,f=null,Y=null,RL=null,jL=null,i=null,a=!1,S=!1,g=()=>J.mounted.entry.shell?.pageTabOrder===!0,_=()=>J.mounted.entry.shell?.ndsHeaderControls===!0,P=null,u=null,C=null,w=0,A=0,$=0,o=0,h=0,qL=0,EL=0,vL=0,wL=null,gL=[],E=0,v=0,k=J.mounted.entry.shell?.initialWidth??720,W=J.mounted.entry.shell?.initialHeight??560,TL=k,sL=W,zL=!1,FL=null,T=null,c=!1,Pj=(U)=>{if(!U)return;let V=U.__pieToolElementUnmount;if(typeof V==="function")V()},$0=()=>{let U=J.mounted.entry.shell;if(!U)return null;return{toolId:J.mounted.toolId,toolbarContext:L(_L),shellConfig:U}},zJ=(U)=>{let V=L(t).get(J.mounted.toolId),G=$0();if(!V?.onHostedMount||!G)return;V.onHostedMount(U,G)},N0=()=>{let U=L(t).get(J.mounted.toolId),V=$0();if(!U?.onHostedResize||!V)return;U.onHostedResize({width:k,height:W},J.mounted.entry.element,V)},fJ=()=>{let U=L(t).get(J.mounted.toolId),V=$0();if(!U?.onHostedUnmount||!V)return;U.onHostedUnmount(J.mounted.entry.element,V)},e=(U,V,G)=>Math.max(V,Math.min(U,G)),HJ=()=>{let U=J.mounted.entry.shell,V=U?.minWidth??320,G=U?.minHeight??240,D=U?.maxWidth??window.innerWidth,Q=U?.maxHeight??window.innerHeight;return{minWidth:V,minHeight:G,maxWidth:D,maxHeight:Q}},m0=()=>{let U=J.mounted.entry.shell?.minWidth,V=typeof U==="number"&&U>0&&k<U,G=V?`${U}px`:"";if(P)P.style.minWidth=G;if(X)X.style.minWidth=G;if(N)N.style.minWidth=G;if(Z)Z.style.overflowX=V?"auto":"visible",Z.style.overflowY="visible"},kj=()=>J.mounted.entry.shell?.content?.overflowY==="auto"?"auto":"hidden",xJ=()=>{if(!X)return 0;let U=X.getBoundingClientRect().height;if(U>0)return U;return X.offsetHeight||0},u0=()=>{if(!N)return;let U=J.mounted.entry.shell;if(N.style.overflowX="hidden",N.style.overflowY=kj(),!P)return;if(U?.content?.preserveMinHeight===!0){let V=xJ(),G=U.minHeight??240,D=Math.max(0,G-V),Q=Math.max(0,W-V),M=Math.max(Q,D);P.style.height=`${M}px`,P.style.minHeight="0",P.style.flex=`0 0 ${M}px`;return}P.style.height="100%",P.style.minHeight="0",P.style.flex="1 1 auto"},BJ=()=>{let U=J.mounted.entry.shell,V=U?.initialWidth??720,G=U?.initialHeight??560;if(V===TL&&G===sL)return;if(TL=V,sL=G,zL)return;k=V,W=G,F0()},R0=()=>{let{minWidth:U,minHeight:V,maxWidth:G,maxHeight:D}=HJ(),Q=Math.min(U,window.innerWidth),M=Math.min(V,window.innerHeight);k=e(k,Q,Math.max(Q,Math.min(G,window.innerWidth))),W=e(W,M,Math.max(M,Math.min(D,window.innerHeight))),E=e(E,0,Math.max(0,window.innerWidth-k)),v=e(v,0,Math.max(0,window.innerHeight-W)),j0(),m0(),u0(),N0()},AL=(U,V)=>{zL=!0,E+=U,v+=V,R0()},q0=(U,V)=>{zL=!0,k+=U,W+=V,R0()},Wj=(U,V,G,D="fa-regular")=>{let Q=document.createElement("nds-icon-button");if(Q.setAttribute("variant","tertiary"),Q.setAttribute("size","small"),Q.setAttribute("type","circle"),Q.setAttribute("icon-name",V),Q.setAttribute("button-aria-label",U),Q.title=U,Q.addEventListener("click",(M)=>{M.stopPropagation(),G(),iL()}),D!=="fa-light"){let M=(I)=>{I.classList.remove("fa-light"),I.classList.add(D)},q=Q.querySelector("i.fa-light");if(q)M(q);else{let I=new MutationObserver(()=>{let s=Q.querySelector("i.fa-light");if(s)M(s),I.disconnect()});I.observe(Q,{childList:!0,subtree:!0})}}return Q},wj=(U,V,G)=>{let D=document.createElement("button");return D.type="button",D.className="pie-tool-shell__control",D.setAttribute("aria-label",U),D.title=U,D.textContent=V,D.style.border="1px solid transparent",D.style.background="color-mix(in srgb, var(--pie-white, #fff) 10%, transparent)",D.style.color="inherit",D.style.cursor="pointer",D.style.display="inline-flex",D.style.alignItems="center",D.style.justifyContent="center",D.style.width="28px",D.style.height="28px",D.style.padding="0",D.style.fontSize="14px",D.style.fontWeight="700",D.style.borderRadius="8px",D.style.lineHeight="1",D.onclick=(Q)=>{Q.stopPropagation(),G(),iL()},D.onfocus=()=>{D.style.outline="2px solid var(--pie-button-focus-outline, var(--pie-primary, #4A90E2))",D.style.outlineOffset="2px"},D.onblur=()=>{D.style.outline="none",D.style.outlineOffset="0"},D},j0=()=>{if(!Z)return;Z.style.left=`${E}px`,Z.style.top=`${v}px`,Z.style.width=`${k}px`,Z.style.height=`${W}px`,Z.style.display=J.active?"flex":"none",Z.style.setProperty("--pie-tool-shell-zoom-comp",String(e0()))},zj=()=>{if(VL)VL.textContent=J.mounted.entry.shell?.title||J.mounted.toolId;for(let{el:U,key:V}of b){let G=J.i18n.t(V);if(U.tagName==="NDS-ICON-BUTTON")U.setAttribute("button-aria-label",G);else U.setAttribute("aria-label",G);if(U.title)U.title=G}},fj=()=>{if(!N)return;let U=J.mounted.entry.element;if(U.style.display="block",U.style.width="100%",U.style.height="100%",U.style.flex="1 1 auto",U.style.minHeight="0",P&&P!==U){if(P.parentNode===N)Pj(P),N.removeChild(P);P=null}if(U.parentNode&&U.parentNode!==N)U.parentNode.removeChild(U);if(U.parentNode!==N)N.appendChild(U);P=U,m0(),u0(),zJ(U)},iL=()=>{if(L(B)&&Z)L(B).bringToFront(Z)},F0=()=>{let{innerWidth:U,innerHeight:V}=window,G=J.mounted.entry.shell,D=G?.initialAlign??"center",Q=G?.initialMargin??16,M=Q+60;switch(D){case"top-left":E=Q,v=M;break;case"top-right":E=Math.max(0,U-k-Q),v=M;break;case"bottom-left":E=Q,v=Math.max(0,V-W-M);break;case"bottom-right":E=Math.max(0,U-k-Q),v=Math.max(0,V-W-M);break;default:E=Math.max(0,Math.round((U-k)/2)),v=Math.max(0,Math.round((V-W)/2))}R0()},SJ=()=>{let U=T;if(!U)return;queueMicrotask(()=>{if(!U.isConnected)return;try{U.focus()}catch{}})},Hj=()=>{if(typeof document>"u")return null;let U=document.activeElement;while(U){let V=U.shadowRoot;if(V&&V.activeElement&&V.activeElement!==U)U=V.activeElement;else break}return U??null},xj=()=>{if(!Z||FL)return;let U=Hj();if(!T&&U&&!Z.contains(U))T=U;if(g()&&!S)document.addEventListener("keydown",c0,!0),S=!0;FL=$J(Z,{initialFocus:Y,onEscape:()=>{s0()},wrap:!g(),onTabExit:g()?(V,G)=>{if(V==="backward"){if(T?.isConnected){G.preventDefault();try{T.focus()}catch{}}return}let D=h0();if(D){G.preventDefault();try{D.focus()}catch{}}}:void 0})},h0=()=>{let U=L(_L).getScopeElement?.()??null;if(!U)return null;let V=(D)=>{if(L(NL)&&L(NL).contains(D))return!0;if(Z&&Z.contains(D))return!0;return!1},G=(D)=>{if(D instanceof HTMLElement){if(V(D))return null;if(D.matches?.(mJ)&&uJ(D))return D}let Q=D.shadowRoot;if(Q)for(let M=0;M<Q.children.length;M++){let q=G(Q.children[M]);if(q)return q}for(let M=0;M<D.children.length;M++){let q=G(D.children[M]);if(q)return q}return null};return G(U)},TJ=()=>{if(!Z)return[];return gJ(Z).filter((U)=>U!==jL&&U!==i)},c0=(U)=>{if(U.key!=="Tab")return;if(!Z||!J.active)return;let V=Hj();if(!V)return;if(Z.contains(V))return;let G=TJ();if(G.length===0)return;if(U.shiftKey){let D=h0();if(V!==D)return;U.preventDefault();try{G[G.length-1].focus()}catch{}return}if(V!==T)return;U.preventDefault();try{G[0].focus()}catch{}},Bj=()=>{if(S)document.removeEventListener("keydown",c0,!0),S=!1;if(!FL)return;let U=FL;FL=null;try{U()}catch{}SJ()},s0=()=>{L(_L).toggleTool(J.mounted.toolId),cL()},Sj=(U)=>{if(!J.mounted.entry.shell?.draggable)return;if(U.target.closest("button")||!Z)return;U.preventDefault(),zL=!0,u=U.pointerId,w=U.clientX-E,A=U.clientY-v,Z.setPointerCapture(U.pointerId),iL()},AJ=(U)=>(V)=>{if(!Z||!J.mounted.entry.shell?.resizable)return;V.preventDefault(),V.stopPropagation(),zL=!0,C=V.pointerId,wL=U,$=k,o=W,h=V.clientX,qL=V.clientY,EL=E,vL=v,Z.setPointerCapture(V.pointerId),iL()},Tj=(U)=>{if(!Z)return;if(u===U.pointerId){U.preventDefault();let V=Math.max(0,window.innerWidth-k),G=Math.max(0,window.innerHeight-W);E=e(U.clientX-w,0,V),v=e(U.clientY-A,0,G),j0();return}if(C===U.pointerId){U.preventDefault();let V=J.mounted.entry.shell,G=V?.minWidth??320,D=V?.minHeight??240,Q=Math.min(G,window.innerWidth),M=Math.min(D,window.innerHeight),q=V?.maxWidth??window.innerWidth,I=V?.maxHeight??window.innerHeight,s=U.clientX-h,JL=U.clientY-qL;if(wL==="se")k=e($+s,Q,Math.max(Q,Math.min(q,window.innerWidth-E))),W=e(o+JL,M,Math.max(M,Math.min(I,window.innerHeight-v)));else if(wL==="sw"){let n=EL+$,DL=e($-s,Q,Math.min(q,n));E=n-DL,k=DL,W=e(o+JL,M,Math.max(M,Math.min(I,window.innerHeight-v)))}else if(wL==="ne"){let n=vL+o;k=e($+s,Q,Math.max(Q,Math.min(q,window.innerWidth-E)));let DL=e(o-JL,M,Math.min(I,n));v=n-DL,W=DL}else if(wL==="nw"){let n=EL+$,DL=vL+o,m=e($-s,Q,Math.min(q,n));E=n-m,k=m;let J0=e(o-JL,M,Math.min(I,DL));v=DL-J0,W=J0}j0(),m0(),u0(),N0()}},Aj=(U)=>{if(!Z)return;if(u===U.pointerId)u=null,Z.releasePointerCapture(U.pointerId);if(C===U.pointerId)C=null,Z.releasePointerCapture(U.pointerId)},Cj=()=>{R0()};if(y&&J.mounted.entry.shell){let U=J.mounted.entry.shell?.ndsHeaderControls===!0&&L(lL);if(U)x0();if(Z=document.createElement("div"),Z.className="pie-tool-shell",Z.setAttribute("data-pie-tool-shell",J.mounted.toolId),Z.style.position="fixed",Z.style.zIndex="2000",Z.style.background="var(--pie-background, #fff)",Z.style.border="1px solid var(--pie-border-light, #d1d5db)",Z.style.borderRadius="12px",Z.style.boxShadow="0 10px 40px color-mix(in srgb, var(--pie-black, #000) 25%, transparent)",Z.style.setProperty("--color-interactive-blue","var(--pie-calculator-button-color, var(--pie-button-color, var(--pie-text, #222)))"),Z.style.setProperty("--color-new-gray","var(--pie-background-dark, #f3f5f7)"),Z.style.setProperty("--color-primary-white","var(--pie-white, #ffffff)"),Z.style.setProperty("--color-primary-black","var(--pie-text, #000000)"),Z.style.setProperty("--color-focus-blue","var(--pie-button-focus-outline, #2b87ff)"),Z.style.overflow="visible",Z.style.display=J.active?"flex":"none",Z.style.flexDirection="column",Z.style.userSelect="none",Z.style.webkitUserSelect="none",Z.style.touchAction="none",Z.setAttribute("draggable","false"),Z.addEventListener("dragstart",(Q)=>Q.preventDefault()),X=document.createElement("div"),X.className="pie-tool-shell__header",X.style.display="flex",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.gap="6px",X.style.padding=_()?"12px 12px 12px 28px":"10px 12px",_())X.style.minHeight="48px";if(_())X.style.background="var(--pie-section-player-card-header-background, var(--pie-button-active-bg, #f3f4f6))",X.style.color="var(--pie-text, #111827)",X.style.borderBottom="1px solid var(--pie-border-light, #e5e7eb)";else X.style.background="var(--pie-primary-dark, #2c3e50)",X.style.color="var(--pie-white, #fff)";X.style.cursor=J.mounted.entry.shell.draggable===!1?"default":"move",X.style.flex="0 0 auto",X.style.borderRadius="12px 12px 0 0",X.style.overflow="hidden",X.style.userSelect="none",X.style.webkitUserSelect="none",X.style.touchAction="none",X.setAttribute("draggable","false"),X.addEventListener("dragstart",(Q)=>Q.preventDefault()),VL=document.createElement("span"),VL.className="pie-tool-shell__title",VL.textContent=J.mounted.entry.shell.title||J.mounted.toolId,X.appendChild(VL),f=document.createElement("div"),f.className="pie-tool-shell__controls",f.style.display="inline-flex",f.style.alignItems="center",f.style.gap=_()?"6px":"4px";let V=J.mounted.entry.shell,G=(Q,M,q,I,s="fa-regular")=>{if(!f)return;let JL=J.i18n.t(Q),n=U?Wj(JL,q,I,s):wj(JL,M,I);b.push({el:n,key:Q}),f.appendChild(n)};if(V?.draggable!==!1)G("toolkit.window.moveLeftA11y","←","chevron-left",()=>AL(-24,0)),G("toolkit.window.moveRightA11y","→","chevron-right",()=>AL(24,0)),G("toolkit.window.moveUpA11y","↑","chevron-up",()=>AL(0,-24)),G("toolkit.window.moveDownA11y","↓","chevron-down",()=>AL(0,24));if(V?.resizable!==!1)G("toolkit.window.shrinkA11y","−","magnifying-glass-minus",()=>q0(-40,-40)),G("toolkit.window.growA11y","+","magnifying-glass-plus",()=>q0(40,40));if(!_()){let Q=wj(J.i18n.t("toolkit.window.centerA11y"),"◎",F0);b.push({el:Q,key:"toolkit.window.centerA11y"}),f.appendChild(Q)}let D=null;if(_())D=document.createElement("div"),D.className="pie-tool-shell__header-right",D.style.display="inline-flex",D.style.alignItems="center",D.style.gap="6px",D.style.setProperty("zoom","var(--pie-tool-shell-zoom-comp, 1)"),D.appendChild(f),X.appendChild(D);else X.appendChild(f);if(U)Y=Wj(J.i18n.t("toolkit.window.closeA11y"),"xmark",s0,"fa-regular"),b.push({el:Y,key:"toolkit.window.closeA11y"}),Y.style.display=J.mounted.entry.shell.closeable===!1?"none":"inline-block";else{let Q=document.createElement("button");Q.type="button",Q.className="pie-tool-shell__close",Q.setAttribute("aria-label",J.i18n.t("toolkit.window.closeA11y")),b.push({el:Q,key:"toolkit.window.closeA11y"});let M="http://www.w3.org/2000/svg",q=document.createElementNS(M,"svg");q.setAttribute("xmlns",M),q.setAttribute("viewBox","0 0 16 16"),q.setAttribute("aria-hidden","true");let I=document.createElementNS(M,"path");I.setAttribute("d","M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5"),I.setAttribute("stroke","currentColor"),I.setAttribute("stroke-width","1.8"),I.setAttribute("stroke-linecap","round"),q.appendChild(I),Q.appendChild(q);let s=q.style;s.width="16px",s.height="16px",s.display="block",s.flexShrink="0",s.pointerEvents="none";let JL="color-mix(in srgb, var(--pie-white, #fff) 8%, transparent)",n="color-mix(in srgb, var(--pie-white, #fff) 18%, transparent)";Q.style.border="1px solid transparent",Q.style.background=JL,Q.style.color="inherit",Q.style.cursor="pointer",Q.style.display="inline-flex",Q.style.alignItems="center",Q.style.justifyItems="center",Q.style.width="28px",Q.style.height="28px",Q.style.padding="0",Q.style.borderRadius="8px",Q.style.lineHeight="0",Q.style.transition="background-color 0.15s ease, border-color 0.15s ease",Q.style.display=J.mounted.entry.shell.closeable===!1?"none":"inline-flex",Q.onmouseenter=()=>{Q.style.background=n},Q.onmouseleave=()=>{Q.style.background=JL},Q.onfocus=()=>{Q.style.outline="2px solid var(--pie-button-focus-outline, var(--pie-primary, #4A90E2))",Q.style.outlineOffset="2px"},Q.onblur=()=>{Q.style.outline="none",Q.style.outlineOffset="0"},Q.onclick=s0,Y=Q}if(D)D.appendChild(Y);else X.appendChild(Y);if(X.tabIndex=0,X.onkeydown=(Q)=>{if(Q.key==="Home"){Q.preventDefault(),F0();return}let M=J.mounted.entry.shell;if(Q.shiftKey&&M?.resizable!==!1){if(Q.key==="ArrowRight"||Q.key==="ArrowDown"){Q.preventDefault(),q0(40,40);return}if(Q.key==="ArrowLeft"||Q.key==="ArrowUp"){Q.preventDefault(),q0(-40,-40);return}}if(M?.draggable!==!1){if(Q.key==="ArrowLeft")Q.preventDefault(),AL(-24,0);else if(Q.key==="ArrowRight")Q.preventDefault(),AL(24,0);else if(Q.key==="ArrowUp")Q.preventDefault(),AL(0,-24);else if(Q.key==="ArrowDown")Q.preventDefault(),AL(0,24)}},N=document.createElement("div"),N.className="pie-tool-shell__content",N.style.position="relative",N.style.width="100%",N.style.flex="1 1 auto",N.style.minHeight="0",N.style.overflowX="hidden",N.style.overflowY=kj(),N.style.borderRadius="0 0 12px 12px",_()){let Q=(M)=>{let q=document.createElement("div");return q.tabIndex=0,q.setAttribute("aria-hidden","true"),q.setAttribute("data-pie-tool-shell-focus-guard",M),q.style.position="absolute",q.style.width="1px",q.style.height="1px",q.style.padding="0",q.style.margin="-1px",q.style.overflow="hidden",q.style.clipPath="inset(50%)",q.style.whiteSpace="nowrap",q.style.border="0",q};jL=Q("start"),i=Q("end"),jL.addEventListener("focus",(M)=>{if(a)return;a=!0;try{if(M.stopPropagation(),T?.isConnected)try{T.focus()}catch{}}finally{queueMicrotask(()=>{a=!1})}}),i.addEventListener("focus",(M)=>{if(a)return;a=!0;try{M.stopPropagation();let q=h0();if(q)try{q.focus()}catch{}}finally{queueMicrotask(()=>{a=!1})}}),Z.appendChild(jL)}if(Z.appendChild(X),Z.appendChild(N),_()&&i)Z.appendChild(i);if(J.mounted.entry.shell.resizable!==!1){let Q=(M,q,I,s,JL,n,DL)=>{let m=document.createElement("div");if(m.className="pie-tool-shell__resize",m.style.position="absolute",m.style.width="24px",m.style.height="24px",m.style.cursor=n,m.style.zIndex="10",m.style.touchAction="none",m.setAttribute("draggable","false"),q!==null)m.style.top=q;if(I!==null)m.style.right=I;if(s!==null)m.style.bottom=s;if(JL!==null)m.style.left=JL;if(DL!==null)m.style.background=`linear-gradient(${DL}, transparent 0%, transparent 40%, rgba(0,0,0,0.35) 40%, rgba(0,0,0,0.35) 60%, transparent 60%, transparent 100%)`;let J0=AJ(M);m.addEventListener("pointerdown",J0),Z.appendChild(m),gL.push({el:m,handler:J0})};Q("se",null,"0","0",null,"nwse-resize",null),Q("nw","0",null,null,"0","nwse-resize","135deg"),Q("ne","0","0",null,null,"nesw-resize",null),Q("sw",null,null,"0","0","nesw-resize",null)}if(X.addEventListener("pointerdown",Sj),Z.addEventListener("pointermove",Tj),Z.addEventListener("pointerup",Aj),Z.addEventListener("pointerdown",iL),window.addEventListener("resize",Cj),document.body.appendChild(Z),F=new bJ(Z,{context:aj,initialValue:J.runtime}),F.connect(),F0(),j0(),zj(),fj(),N0(),J.active)xj();c=J.active}return{update(U){if(J=U,!Z||!N||!VL||!Y)return;F?.setValue(J.runtime),zj(),BJ();let V=Y.tagName.toLowerCase()==="nds-icon-button"?"inline-block":"inline-flex";if(Y.style.display=J.mounted.entry.shell?.closeable===!1?"none":V,j0(),fj(),N0(),!c&&J.active)xj();else if(c&&!J.active)Bj(),T=null;c=J.active},destroy(){if(fJ(),F?.disconnect(),F=null,b.length=0,FL)Bj();if(S)document.removeEventListener("keydown",c0,!0),S=!1;for(let{el:U,handler:V}of gL)U.removeEventListener("pointerdown",V);if(T=null,gL.length=0,X)X.removeEventListener("pointerdown",Sj),X.onkeydown=null;if(Z)Z.removeEventListener("pointermove",Tj),Z.removeEventListener("pointerup",Aj),Z.removeEventListener("pointerdown",iL);if(window.removeEventListener("resize",Cj),P&&N&&P.parentNode===N)Pj(P),N.removeChild(P);if(P=null,Z&&Z.parentElement)Z.remove()}}}var kJ={get level(){return $L()},set level(j){$L(j),d()},get scopeId(){return K0()},set scopeId(j){K0(j),d()},get itemId(){return B0()},set itemId(j){B0(j),d()},get sectionId(){return S0()},set sectionId(j){S0(j),d()},get catalogId(){return T0()},set catalogId(j){T0(j),d()},get tools(){return A0()},set tools(j){A0(j),d()},get contentKind(){return C0()},set contentKind(j){C0(j),d()},get position(){return BL()},set position(j){BL(j),d()},get scopeElement(){return dL()},set scopeElement(j){dL(j),d()},get toolRegistry(){return I0()},set toolRegistry(j){I0(j),d()},get item(){return y0()},set item(j){y0(j),d()},get hostButtons(){return Q0()},set hostButtons(j){Q0(j),d()},get class(){return p0()},set class(j){p0(j),d()},get size(){return rL()},set size(j){rL(j),d()},get language(){return X0()},set language(j){X0(j),d()}},Fj=QL(),WJ=ZL(Fj);{var wJ=(j)=>{var K=aJ();let J;var Z=aL(K),F=aL(Z);Z0(F,17,()=>L(GJ),(f)=>f.key,(f,Y)=>{var RL=QL(),jL=ZL(RL);{var i=(S)=>{var g=QL(),_=ZL(g);H0(_,()=>L(lL),(P)=>{var u=W0();HL(u,(C,w)=>g0?.(C,w),()=>({mounted:L(Y),active:L(L0)[L(Y).toolId]??!1,runtime:L(x),i18n:L(oL)})),z(P,u)}),z(S,g)},a=(S)=>{var g=W0();HL(g,(_,P)=>v0?.(_,P),()=>L(Y).entry),z(S,g)};XL(jL,(S)=>{if(L(Y).entry.shell)S(i);else S(a,-1)})}z(f,RL)});var b=z0(F,2);Z0(b,17,()=>L(Yj),(f)=>f.id,(f,Y,RL,jL)=>{let i=O(()=>L(lL)&&!i0(L(Y))?t0(L(Y)):null);var a=QL(),S=ZL(a);{var g=(C)=>{var w=hJ(),A=aL(w);CL(A,1,"item-toolbar__nds-button svelte-rnx3ie"),IL(A,"type","circle"),IL(A,"size","small"),IL(A,"variant","tertiary"),KL(()=>IL(A,"icon-name",L(i))),KL(()=>IL(A,"button-aria-label",L(Y).ariaLabel||L(Y).label)),KL(()=>IL(A,"title",L(Y).tooltip||L(Y).label)),KL(()=>IL(A,"disabled",L(Y).disabled)),HL(A,($)=>LJ?.($)),HL(A,($,o)=>jJ?.($,o),()=>M0(L(Y))),OL(w),f0("click",A,function(...$){L(Y).onClick?.apply(this,$)}),z(C,w)},_=(C)=>{var w=cJ();let A;var $=aL(w);{var o=(h)=>{var qL=QL(),EL=ZL(qL);{var vL=(k)=>{var W=w0();U0(W,()=>k0(L(Y).icon),!0),OL(W),z(k,W)},wL=O(()=>a0(L(Y).icon)),gL=(k)=>{var W=_j();KL(()=>LL(W,"src",L(Y).icon)),z(k,W)},E=O(()=>d0(L(Y).icon)),v=(k)=>{let W=O(()=>qj(L(Y).icon));var TL=QL(),sL=ZL(TL);{var zL=(T)=>{var c=w0();U0(c,()=>k0(L(W)),!0),OL(c),z(T,c)},FL=(T)=>{var c=Ej();KL(()=>CL(c,1,`icon icon-${L(Y).icon}`,"svelte-rnx3ie")),z(T,c)};XL(sL,(T)=>{if(L(W))T(zL);else T(FL,-1)})}z(k,TL)};XL(EL,(k)=>{if(L(wL))k(vL);else if(L(E))k(gL,1);else k(v,-1)})}z(h,qL)};XL($,(h)=>{if(L(Y).icon)h(o)})}OL(w),KL((h)=>{A=CL(w,1,"item-toolbar__button svelte-rnx3ie",null,A,{"item-toolbar__button--active":h}),LL(w,"href",L(Y).disabled?void 0:L(Y).href),LL(w,"target",L(Y).target),LL(w,"rel",L(Y).rel),LL(w,"aria-label",L(Y).ariaLabel||L(Y).label),LL(w,"title",L(Y).tooltip||L(Y).label),LL(w,"aria-disabled",L(Y).disabled?"true":void 0)},[()=>M0(L(Y))]),f0("click",w,(h)=>{if(L(Y).disabled)h.preventDefault()}),z(C,w)},P=O(()=>i0(L(Y))),u=(C)=>{var w=sJ();let A;var $=aL(w);{var o=(h)=>{var qL=QL(),EL=ZL(qL);{var vL=(k)=>{var W=w0();U0(W,()=>k0(L(Y).icon),!0),OL(W),z(k,W)},wL=O(()=>a0(L(Y).icon)),gL=(k)=>{var W=_j();KL(()=>LL(W,"src",L(Y).icon)),z(k,W)},E=O(()=>d0(L(Y).icon)),v=(k)=>{let W=O(()=>qj(L(Y).icon));var TL=QL(),sL=ZL(TL);{var zL=(T)=>{var c=w0();U0(c,()=>k0(L(W)),!0),OL(c),z(T,c)},FL=(T)=>{var c=Ej();KL(()=>CL(c,1,`icon icon-${L(Y).icon}`,"svelte-rnx3ie")),z(T,c)};XL(sL,(T)=>{if(L(W))T(zL);else T(FL,-1)})}z(k,TL)};XL(EL,(k)=>{if(L(wL))k(vL);else if(L(E))k(gL,1);else k(v,-1)})}z(h,qL)};XL($,(h)=>{if(L(Y).icon)h(o)})}OL(w),KL((h,qL)=>{A=CL(w,1,"item-toolbar__button svelte-rnx3ie",null,A,{"item-toolbar__button--active":h}),LL(w,"aria-label",L(Y).ariaLabel||L(Y).label),LL(w,"aria-pressed",qL),LL(w,"title",L(Y).tooltip||L(Y).label),w.disabled=L(Y).disabled},[()=>M0(L(Y)),()=>M0(L(Y))]),f0("click",w,function(...h){L(Y).onClick?.apply(this,h)}),z(C,w)};XL(S,(C)=>{if(L(i))C(g);else if(L(P))C(_,1);else C(u,-1)})}z(f,a)});var X=z0(b,2);Z0(X,17,()=>L(MJ),(f)=>f.key,(f,Y)=>{var RL=QL(),jL=ZL(RL);{var i=(S)=>{var g=QL(),_=ZL(g);H0(_,()=>L(lL),(P)=>{var u=W0();HL(u,(C,w)=>g0?.(C,w),()=>({mounted:L(Y),active:L(L0)[L(Y).toolId]??!1,runtime:L(x),i18n:L(oL)})),z(P,u)}),z(S,g)},a=(S)=>{var g=W0();HL(g,(_,P)=>v0?.(_,P),()=>L(Y).entry),z(S,g)};XL(jL,(S)=>{if(L(Y).entry.shell)S(i);else S(a,-1)})}z(f,RL)}),OL(Z);var N=z0(Z,2);{var VL=(f)=>{var Y=iJ();let RL;Z0(Y,21,()=>L(Dj),(jL)=>jL.key,(jL,i)=>{var a=QL(),S=ZL(a);{var g=(P)=>{var u=QL(),C=ZL(u);H0(C,()=>L(lL),(w)=>{var A=vj();HL(A,($,o)=>g0?.($,o),()=>({mounted:L(i),active:L(L0)[L(i).toolId]??!1,runtime:L(x),i18n:L(oL)})),z(w,A)}),z(P,u)},_=(P)=>{var u=vj();HL(u,(C,w)=>v0?.(C,w),()=>L(i).entry),z(P,u)};XL(S,(P)=>{if(L(i).entry.shell)P(g);else P(_,-1)})}z(jL,a)}),OL(Y),KL(()=>RL=CL(Y,1,"item-toolbar__controls-row svelte-rnx3ie",null,RL,{"item-toolbar__controls-row--reserve":L(Mj),"item-toolbar__controls-row--active":L(Nj),"item-toolbar__controls-row--align-start":L(NJ)})),z(f,Y)};XL(N,(f)=>{if(L(RJ))f(VL)})}OL(K),sj(K,(f)=>GL(NL,f),()=>L(NL)),KL(()=>{J=CL(K,1,`item-toolbar ${p0()??""} item-toolbar--${rL()??""}`,"svelte-rnx3ie",J,{"item-toolbar--top":BL()==="top","item-toolbar--right":BL()==="right","item-toolbar--bottom":BL()==="bottom","item-toolbar--left":BL()==="left","item-toolbar--header-overlay-active":L(Rj)}),LL(K,"data-content-kind",L(uL)),LL(K,"data-level",L(p)),cj(K,`--pie-toolbar-zoom-comp: ${L(Lj)};`)}),z(j,K)};XL(WJ,(j)=>{if(y)j(wJ)})}return z(H,Fj),$j(kJ)}uj(["click"]);pJ("pie-item-toolbar",ij(nj,{level:{attribute:"level",type:"String"},scopeId:{attribute:"scope-id",type:"String"},itemId:{attribute:"item-id",type:"String"},sectionId:{attribute:"section-id",type:"String"},catalogId:{attribute:"catalog-id",type:"String"},tools:{attribute:"tools",type:"String"},contentKind:{attribute:"content-kind",type:"String"},position:{attribute:"position",type:"String"},size:{attribute:"size",type:"String"},language:{attribute:"language",type:"String"},scopeElement:{type:"Object"},toolRegistry:{type:"Object"},item:{type:"Object"},hostButtons:{type:"Object"},class:{}},[],[],{mode:"open"}));
46
+ export{nj as a};
@@ -226,7 +226,11 @@ export declare class HighlightCoordinator implements HighlightCoordinatorApi {
226
226
  */
227
227
  updateTTSHighlightStyle(color: string, opacity: number): void;
228
228
  /**
229
- * Cleanup - remove all highlights
229
+ * Cleanup this coordinator's highlights and observer.
230
+ *
231
+ * The stylesheet is process-global and shared by every live coordinator, so
232
+ * removing it here would break a replacement or sibling coordinator. Keep the
233
+ * single bounded style element installed for the lifetime of the document.
230
234
  */
231
235
  destroy(): void;
232
236
  }
@@ -900,20 +900,17 @@ export class HighlightCoordinator {
900
900
  this.applyAdaptiveTTSStyle();
901
901
  }
902
902
  /**
903
- * Cleanup - remove all highlights
903
+ * Cleanup this coordinator's highlights and observer.
904
+ *
905
+ * The stylesheet is process-global and shared by every live coordinator, so
906
+ * removing it here would break a replacement or sibling coordinator. Keep the
907
+ * single bounded style element installed for the lifetime of the document.
904
908
  */
905
909
  destroy() {
906
910
  if (!this.supported)
907
911
  return;
908
912
  this.clearTTS();
909
913
  this.clearAnnotations();
910
- // Remove style element
911
- if (typeof document !== "undefined") {
912
- const styleEl = document.getElementById("pie-highlight-styles");
913
- if (styleEl) {
914
- styleEl.remove();
915
- }
916
- }
917
914
  this.themeObserver?.disconnect();
918
915
  this.themeObserver = null;
919
916
  }
@@ -116,6 +116,20 @@ export interface ResolvedToolContext {
116
116
  export interface ToolRenderElement {
117
117
  element: HTMLElement | null;
118
118
  mount: "before-buttons" | "after-buttons" | "controls-row";
119
+ /**
120
+ * Which box the element is appended to. `mount` places it among the toolbar's
121
+ * own regions; this chooses the box it is positioned against.
122
+ *
123
+ * `"toolbar"` (the default) leaves it in the toolbar, whose element is the
124
+ * containing block for anything absolutely positioned inside it.
125
+ * `"content-boundary"` appends it to the nearest element the host marked with
126
+ * `data-pie-tool-overlay-boundary` — the content a tool was placed on. An
127
+ * element that draws its own surface over that content and computes its own
128
+ * coordinates needs the content's box as its frame, and the toolbar's box is a
129
+ * header-sized one. When the host declares no boundary the element stays in
130
+ * the toolbar.
131
+ */
132
+ container?: "toolbar" | "content-boundary";
119
133
  layoutHints?: {
120
134
  controlsRow?: {
121
135
  reserveSpace?: boolean;
@@ -323,7 +323,8 @@ export declare class ToolkitCoordinator {
323
323
  private readonly toolRequests;
324
324
  private readonly sectionControllers;
325
325
  private readonly sectionControllerKeys;
326
- private readonly sectionControllerInitPromises;
326
+ private readonly sectionControllerInitEntries;
327
+ private readonly sectionControllerDisposePromises;
327
328
  private readonly sectionPersistenceStrategies;
328
329
  private readonly sectionControllerLifecycleListeners;
329
330
  /**
@@ -356,14 +357,10 @@ export declare class ToolkitCoordinator {
356
357
  private readonly telemetryListeners;
357
358
  private readonly frameworkErrorBus;
358
359
  private readonly ownsFrameworkErrorBus;
360
+ private frameworkErrorHookUnsubscribe;
361
+ private disposePromise;
359
362
  /**
360
- * Unified Tool Policy Engine. Owned by the coordinator and lives
361
- * for the lifetime of the coordinator instance — there is no
362
- * explicit teardown path today; the engine and its listener set
363
- * are reclaimed by GC when the coordinator becomes unreachable.
364
- * Subscribers attached via {@link onPolicyChange} must therefore
365
- * detach via the unsubscribe function the engine returns; do not
366
- * rely on a `disposed` event being emitted on coordinator teardown.
363
+ * Unified Tool Policy Engine. Owned by the coordinator and disposed with it.
367
364
  *
368
365
  * Hosts read decisions via {@link decideToolPolicy} or subscribe
369
366
  * to changes via {@link onPolicyChange}.
@@ -409,6 +406,7 @@ export declare class ToolkitCoordinator {
409
406
  private reportedUnboundFeaturePolicy;
410
407
  private static resolveConfig;
411
408
  constructor(config: ToolkitCoordinatorConfig);
409
+ private assertNotDisposed;
412
410
  /**
413
411
  * Subscribe the canonical `onFrameworkError` hook adapter to the
414
412
  * framework-error bus.
@@ -572,6 +570,10 @@ export declare class ToolkitCoordinator {
572
570
  private resolveExistingSectionController;
573
571
  private createSectionControllerContext;
574
572
  private initializeNewSectionController;
573
+ private createSectionControllerRetirementError;
574
+ private retireUnpublishedSectionControllerIfNeeded;
575
+ private cleanupUnpublishedSectionController;
576
+ private retirePublishedSectionControllerIfNeeded;
575
577
  private finalizeSectionControllerReady;
576
578
  private handleSectionControllerInitError;
577
579
  disposeSectionController(args: {
@@ -580,8 +582,18 @@ export declare class ToolkitCoordinator {
580
582
  persistBeforeDispose?: boolean;
581
583
  clearPersistence?: boolean;
582
584
  }): Promise<void>;
585
+ private trackSectionControllerDisposal;
586
+ private disposeSectionControllerEntry;
583
587
  private runSectionControllerDisposePipeline;
584
588
  private finalizeSectionControllerDispose;
589
+ /**
590
+ * Release every resource whose lifetime is owned by this coordinator.
591
+ * Borrowed constructor inputs, including a host framework-error bus and tool
592
+ * registry, remain owned by their caller.
593
+ */
594
+ dispose(): Promise<void>;
595
+ private disposeOwnedResources;
596
+ private waitForAdmittedInitialization;
585
597
  /**
586
598
  * Initialize TTS service with provider
587
599
  */
@@ -681,11 +693,9 @@ export declare class ToolkitCoordinator {
681
693
  * that want the new visible tool set should call
682
694
  * {@link decideToolPolicy} with their level / scope.
683
695
  *
684
- * Note: the engine itself can also emit `reason: "disposed"`, but
685
- * the coordinator does not dispose its engine on teardown today,
686
- * so subscribers attached via this method will not observe that
687
- * reason. Detach via the returned unsubscribe function instead of
688
- * relying on a `disposed` event.
696
+ * The owned engine emits `reason: "disposed"` during coordinator teardown.
697
+ * Callers should still detach through the returned unsubscribe function when
698
+ * their own lifetime ends before the coordinator's.
689
699
  */
690
700
  onPolicyChange(listener: ToolPolicyChangeListener): () => void;
691
701
  /**