@pie-players/pie-assessment-toolkit 0.3.63 → 0.3.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -1
- package/dist/components/ItemToolBar.custom-element.js +1 -1
- package/dist/components/PieAssessmentToolkit.custom-element.js +11 -11
- package/dist/components/SectionToolBar.custom-element.js +1 -1
- package/dist/components/chunks/ItemToolBar-cckwpz6c.js +51 -0
- package/dist/components/chunks/ItemToolBar-pryf0rtz.js +22 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.js +12 -4
- package/dist/policy/core/ToolPolicyEngine.d.ts +21 -0
- package/dist/policy/core/ToolPolicyEngine.js +27 -0
- package/dist/policy/core/feature-decision.d.ts +57 -0
- package/dist/policy/core/feature-decision.js +40 -0
- package/dist/policy/engine.d.ts +1 -0
- package/dist/policy/sources/PnpPolicySource.d.ts +22 -0
- package/dist/policy/sources/PnpPolicySource.js +41 -11
- package/dist/runtime/catalog-registration.d.ts +56 -1
- package/dist/runtime/catalog-registration.js +64 -31
- package/dist/runtime/composition-emit-scheduler.d.ts +78 -0
- package/dist/runtime/composition-emit-scheduler.js +154 -0
- package/dist/runtime/core/engine-resolver.d.ts +1 -1
- package/dist/services/AccessibilityCatalogResolver.d.ts +100 -4
- package/dist/services/AccessibilityCatalogResolver.js +183 -58
- package/dist/services/SSMLExtractor.js +28 -18
- package/dist/services/TTSService.d.ts +25 -0
- package/dist/services/TTSService.js +241 -45
- package/dist/services/ToolRegistry.d.ts +218 -8
- package/dist/services/ToolRegistry.js +124 -8
- package/dist/services/ToolkitCoordinator.d.ts +25 -3
- package/dist/services/ToolkitCoordinator.js +47 -6
- package/dist/services/catalog-media.d.ts +25 -0
- package/dist/services/catalog-media.js +101 -0
- package/dist/services/createDefaultToolRegistry.d.ts +25 -58
- package/dist/services/createDefaultToolRegistry.js +24 -104
- package/dist/services/defaultPersonalNeedsProfile.d.ts +20 -2
- package/dist/services/defaultPersonalNeedsProfile.js +21 -19
- package/dist/services/interfaces.d.ts +29 -2
- package/dist/services/pnp-standard-features.d.ts +1 -1
- package/dist/services/spoken-audio-cards.d.ts +54 -0
- package/dist/services/spoken-audio-cards.js +66 -0
- package/dist/services/tool-config-defaults.d.ts +7 -23
- package/dist/services/tool-config-defaults.js +7 -46
- package/dist/services/tool-config-validation.d.ts +1 -1
- package/dist/services/tool-config-validation.js +44 -4
- package/dist/services/tts/browser-provider.js +2 -1
- package/dist/services/tts/math-aware-text-processing.js +3 -3
- package/dist/services/tts/text-processing.d.ts +51 -0
- package/dist/services/tts/text-processing.js +117 -1
- package/dist/services/tts-runtime-config.js +7 -2
- package/dist/tools/internal.d.ts +34 -0
- package/dist/tools/internal.js +33 -0
- package/dist/tools/tool-tag-map.d.ts +15 -3
- package/dist/tools/tool-tag-map.js +21 -18
- package/package.json +14 -10
- package/dist/components/chunks/ItemToolBar-843902tp.js +0 -51
- package/dist/components/chunks/ItemToolBar-84nv78dy.js +0 -22
- package/dist/tools/registrations/accessibility-tools.d.ts +0 -34
- package/dist/tools/registrations/accessibility-tools.js +0 -217
- package/dist/tools/registrations/calculator.d.ts +0 -20
- package/dist/tools/registrations/calculator.js +0 -228
- package/dist/tools/registrations/interaction-tools.d.ts +0 -27
- package/dist/tools/registrations/interaction-tools.js +0 -143
- package/dist/tools/registrations/measurement-tools.d.ts +0 -24
- package/dist/tools/registrations/measurement-tools.js +0 -130
- package/dist/tools/registrations/subject-specific-tools.d.ts +0 -27
- package/dist/tools/registrations/subject-specific-tools.js +0 -158
- package/dist/tools/registrations/tts.d.ts +0 -21
- package/dist/tools/registrations/tts.js +0 -184
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-players/pie-assessment-toolkit",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.65",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "PIE assessment toolkit: composable services + reference implementation for assessment players and tool coordination",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
"types": "./dist/tools/client.d.ts",
|
|
26
26
|
"import": "./dist/tools/client.js"
|
|
27
27
|
},
|
|
28
|
+
"./tools/internal": {
|
|
29
|
+
"types": "./dist/tools/internal.d.ts",
|
|
30
|
+
"import": "./dist/tools/internal.js"
|
|
31
|
+
},
|
|
28
32
|
"./components/item-toolbar-element": {
|
|
29
33
|
"types": "./dist/components/item-toolbar-element.d.ts",
|
|
30
34
|
"import": "./dist/components/item-toolbar-element.js"
|
|
@@ -75,15 +79,15 @@
|
|
|
75
79
|
"test": "bun test"
|
|
76
80
|
},
|
|
77
81
|
"dependencies": {
|
|
78
|
-
"@pie-players/pie-calculator": "0.3.
|
|
79
|
-
"@pie-players/pie-context": "0.3.
|
|
80
|
-
"@pie-players/pie-players-shared": "0.3.
|
|
81
|
-
"@pie-players/pie-tts": "0.3.
|
|
82
|
+
"@pie-players/pie-calculator": "0.3.65",
|
|
83
|
+
"@pie-players/pie-context": "0.3.65",
|
|
84
|
+
"@pie-players/pie-players-shared": "0.3.65",
|
|
85
|
+
"@pie-players/pie-tts": "0.3.65",
|
|
82
86
|
"speech-rule-engine": "^5.0.0-rc.4"
|
|
83
87
|
},
|
|
84
88
|
"peerDependencies": {
|
|
85
|
-
"@pie-players/pie-calculator-desmos": "0.3.
|
|
86
|
-
"@pie-players/tts-client-server": "0.3.
|
|
89
|
+
"@pie-players/pie-calculator-desmos": "0.3.65",
|
|
90
|
+
"@pie-players/tts-client-server": "0.3.65"
|
|
87
91
|
},
|
|
88
92
|
"peerDependenciesMeta": {
|
|
89
93
|
"@pie-players/pie-calculator-desmos": {
|
|
@@ -94,10 +98,10 @@
|
|
|
94
98
|
}
|
|
95
99
|
},
|
|
96
100
|
"devDependencies": {
|
|
97
|
-
"@biomejs/biome": "^2.5.
|
|
101
|
+
"@biomejs/biome": "^2.5.7",
|
|
98
102
|
"@happy-dom/global-registrator": "^20.11.1",
|
|
99
|
-
"@pie-players/pie-calculator-desmos": "0.3.
|
|
100
|
-
"@pie-players/tts-client-server": "0.3.
|
|
103
|
+
"@pie-players/pie-calculator-desmos": "0.3.65",
|
|
104
|
+
"@pie-players/tts-client-server": "0.3.65",
|
|
101
105
|
"svelte": "^5.56.8",
|
|
102
106
|
"typescript": "^5.9.3"
|
|
103
107
|
},
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
var L8=((J)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(J,{get:(Q,X)=>(typeof require<"u"?require:Q)[X]}):J)(function(J){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+J+'" is not supported')});var y9="5";if(typeof window<"u")((window.__svelte??={}).v??=new Set).add(y9);var b=2,s0=4,BJ=8,CJ=16777216,X0=16,c=32,P0=64,iJ=128,K0=512,k=1024,C=2048,v=4096,d=8192,g=16384,Y0=32768,sJ=33554432,w0=65536,VJ=131072,w8=262144,o0=524288,h9=1048576,v0=33554432,j0=65536,IJ=2097152,R0=4194304,y0=8388608,i=Symbol("$state"),z7=Symbol("legacy props"),g9=Symbol(""),E7=Symbol("proxy path"),x7=Symbol("attributes"),q7=Symbol("class"),U7=Symbol("style"),H7=Symbol("text"),O8=Symbol("form reset"),S8=Symbol("hmr anchor"),GJ=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},A8=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");var oJ=3,C0=8;var m9=1,v9=2,N8=4,u9=8,f9=16,p9=1,_9=2,d9=4,l9=8,c9=16;var i9=1,s9=2;var aJ="[",MJ="[!",D8="[?",TJ="]",a0={};var y=Symbol("uninitialized"),O0=Symbol("filename"),o9=Symbol("hmr"),k7="http://www.w3.org/1999/xhtml",P7="http://www.w3.org/2000/svg",j8="http://www.w3.org/1998/Math/MathML";var B=!0;var r0="font-weight: bold",n0="font-weight: normal";function a9(J){if(B)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`,r0,n0);else console.warn("https://svelte.dev/e/await_reactivity_loss")}function r9(J,Q){if(B)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`,r0,n0);else console.warn("https://svelte.dev/e/await_waterfall")}function n9(){if(B)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`,r0,n0);else console.warn("https://svelte.dev/e/derived_inert")}function t9(J,Q,X){if(B)console.warn(`%c[svelte] hydration_attribute_changed
|
|
8
|
-
%cThe \`${J}\` attribute on \`${Q}\` changed its value between server and client renders. The client value, \`${X}\`, will be ignored in favour of the server value
|
|
9
|
-
https://svelte.dev/e/hydration_attribute_changed`,r0,n0);else console.warn("https://svelte.dev/e/hydration_attribute_changed")}function e9(J){if(B)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`,r0,n0);else console.warn("https://svelte.dev/e/hydration_html_changed")}function FJ(J){if(B)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`,r0,n0);else console.warn("https://svelte.dev/e/hydration_mismatch")}function J4(){if(B)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`,r0,n0);else console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function b7(J){if(B)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`,r0,n0);else console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function Q4(){if(B)console.warn(`%c[svelte] state_proxy_unmount
|
|
18
|
-
%cTried to unmount a state proxy, rather than a component
|
|
19
|
-
https://svelte.dev/e/state_proxy_unmount`,r0,n0);else console.warn("https://svelte.dev/e/state_proxy_unmount")}function X4(){if(B)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",r0,n0);else console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var zJ=Array.isArray,K4=Array.prototype.indexOf,LJ=Array.prototype.includes,rJ=Array.from,Y7=Object.keys,n=Object.defineProperty,B0=Object.getOwnPropertyDescriptor,y7=Object.getOwnPropertyDescriptors,R8=Object.prototype,Z4=Array.prototype,EJ=Object.getPrototypeOf,C8=Object.isExtensible;var t0=()=>{};function h7(J){for(var Q=0;Q<J.length;Q++)J[Q]()}function g7(){var J,Q,X=new Promise((K,Z)=>{J=K,Q=Z});return{promise:X,resolve:J,reject:Q}}function W4(J){if(B){let Q=Error(`invariant_violation
|
|
20
|
-
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}"
|
|
21
|
-
https://svelte.dev/e/invariant_violation`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/invariant_violation")}function G4(){if(B){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 z4(){if(B){let J=Error(`derived_references_self
|
|
22
|
-
A derived value cannot reference itself recursively
|
|
23
|
-
https://svelte.dev/e/derived_references_self`);throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/derived_references_self")}function I8(J,Q,X){if(B){let K=Error(`each_key_duplicate
|
|
24
|
-
${X?`Keyed each block has duplicate key \`${X}\` at indexes ${J} and ${Q}`:`Keyed each block has duplicate key at indexes ${J} and ${Q}`}
|
|
25
|
-
https://svelte.dev/e/each_key_duplicate`);throw K.name="Svelte error",K}else throw Error("https://svelte.dev/e/each_key_duplicate")}function q4(J,Q,X){if(B){let K=Error(`each_key_volatile
|
|
26
|
-
Keyed each block has key that is not idempotent — the key for item at index ${J} was \`${Q}\` but is now \`${X}\`. Keys must be the same each time for a given item
|
|
27
|
-
https://svelte.dev/e/each_key_volatile`);throw K.name="Svelte error",K}else throw Error("https://svelte.dev/e/each_key_volatile")}function U4(J){if(B){let Q=Error(`effect_in_teardown
|
|
28
|
-
\`${J}\` cannot be used inside an effect cleanup function
|
|
29
|
-
https://svelte.dev/e/effect_in_teardown`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/effect_in_teardown")}function H4(){if(B){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 P4(J){if(B){let Q=Error(`effect_orphan
|
|
30
|
-
\`${J}\` can only be used inside an effect (e.g. during component initialisation)
|
|
31
|
-
https://svelte.dev/e/effect_orphan`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/effect_orphan")}function Y4(){if(B){let J=Error(`effect_update_depth_exceeded
|
|
32
|
-
Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
|
|
33
|
-
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 B4(){if(B){let J=Error(`hydration_failed
|
|
34
|
-
Failed to hydrate the application
|
|
35
|
-
https://svelte.dev/e/hydration_failed`);throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/hydration_failed")}function V4(J){if(B){let Q=Error(`props_invalid_value
|
|
36
|
-
Cannot do \`bind:${J}={undefined}\` when \`${J}\` has a fallback value
|
|
37
|
-
https://svelte.dev/e/props_invalid_value`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/props_invalid_value")}function M4(J){if(B){let Q=Error(`rune_outside_svelte
|
|
38
|
-
The \`${J}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
|
|
39
|
-
https://svelte.dev/e/rune_outside_svelte`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/rune_outside_svelte")}function F4(){if(B){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 L4(){if(B){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 w4(){if(B){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 O4(){if(B){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 t=!1,wJ=!1,u0=!1;var D=null;function qJ(J){D=J}var e0=null;function nJ(J){e0=J}var I0=null;function m7(J){I0=J}function T8(J,Q=!1,X){if(D={p:D,i:!1,c:null,e:null,s:J,x:null,r:L,l:wJ&&!Q?{s:null,u:null,$:[]}:null},B)D.function=X,I0=X}function E8(J){var Q=D,X=Q.e;if(X!==null){Q.e=null;for(var K of X)x8(K)}if(J!==void 0)Q.x=J;if(Q.i=!0,D=Q.p,B)I0=D?.function??null;return J??{}}function f0(){return!wJ||D!==null&&D.l===null}var xJ=[];function A4(){var J=xJ;xJ=[],h7(J)}function s(J){if(xJ.length===0&&!kJ){var Q=xJ;queueMicrotask(()=>{if(Q===xJ)A4()})}xJ.push(J)}function N4(){while(xJ.length>0)A4()}var k8=new WeakMap;function v7(J){var Q=L;if(Q===null)return S.f|=y0,J;if(B&&J instanceof Error&&!k8.has(J))k8.set(J,V6(J,Q));if((Q.f&Y0)===0&&(Q.f&s0)===0){if(B&&!Q.parent&&J instanceof Error)D4(J);throw J}p0(J,Q)}function p0(J,Q){if(Q!==null&&(Q.f&g)!==0)return;while(Q!==null){if((Q.f&iJ)!==0){if((Q.f&Y0)===0)throw J;try{Q.b.error(J);return}catch(X){J=X}}Q=Q.parent}if(B&&J instanceof Error)D4(J);throw J}function V6(J,Q){let X=B0(J,"message");if(X&&!X.configurable)return;var K=B7?" ":"\t",Z=`
|
|
40
|
-
${K}in ${Q.fn?.name||"<unknown>"}`,W=Q.ctx;while(W!==null)Z+=`
|
|
41
|
-
${K}in ${W.function?.[O0].split("/").pop()}`,W=W.p;return{message:J.message+`
|
|
42
|
-
${Z}
|
|
43
|
-
`,stack:J.stack?.split(`
|
|
44
|
-
`).filter(($)=>!$.includes("svelte/src/internal")).join(`
|
|
45
|
-
`)}}function D4(J){let Q=k8.get(J);if(Q)n(J,"message",{value:Q.message}),n(J,"stack",{value:Q.stack})}function u7(J){return J===this.v}function f7(J,Q){return J!=J?Q==Q:J!==Q||J!==null&&typeof J==="object"||typeof J==="function"}function p7(J){return!f7(J,this.v)}var V7=null;function G0(J,Q){return J.label=Q,d7(J.v,Q),J}function d7(J,Q){return J?.[E7]?.(Q),J}function _0(J){let Q=Error(),X=M6();if(X.length===0)return null;return X.unshift(`
|
|
46
|
-
`),n(Q,"stack",{value:X.join(`
|
|
47
|
-
`)}),n(Q,"name",{value:J}),Q}function M6(){let J=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let Q=Error().stack;if(Error.stackTraceLimit=J,!Q)return[];let X=Q.split(`
|
|
48
|
-
`),K=[];for(let Z=0;Z<X.length;Z++){let W=X[Z],$=W.replaceAll("\\","/");if(W.trim()==="Error")continue;if(W.includes("validate_each_keys"))return[];if($.includes("svelte/src/internal")||$.includes("node_modules/.vite"))continue;K.push(W)}return K}function R4(J,Q){if(!B)throw Error("invariant(...) was not guarded by if (DEV)");if(!J)W4(Q)}function JJ(J){var Q=S,X=L;f(null),p(null);try{return J()}finally{f(Q),p(X)}}function C4(J){let Q=0,X=q0(0),K;if(B)G0(X,"createSubscriber version");return()=>{if(OJ())I(X),e(()=>{if(Q===0)K=h(()=>J(()=>bJ(X)));return Q+=1,()=>{s(()=>{if(Q-=1,Q===0)K?.(),K=void 0,bJ(X)})}})}}var L6=~(C|v|k);function x(J,Q){J.f=J.f&L6|Q}function tJ(J){if((J.f&K0)!==0||J.deps===null)x(J,k);else x(J,v)}function I4(J){if(J===null)return;for(let Q of J){if((Q.f&b)===0||(Q.f&j0)===0)continue;Q.f^=j0,I4(Q.deps)}}function l7(J,Q,X){if((J.f&C)!==0)Q.add(J);else if((J.f&v)!==0)X.add(J);I4(J.deps),x(J,k)}var w6=w0|o0;function h8(J,Q,X,K){new g8(J,Q,X,K)}class g8{parent;is_pending=!1;transform_error;#J;#Q=w?N:null;#X;#G;#W;#$=null;#K=null;#z=null;#Z=null;#V=0;#U=0;#H=!1;#P=new Set;#M=new Set;#q=null;#w=C4(()=>{if(this.#q=q0(this.#V),B)G0(this.#q,"$effect.pending()");return()=>{this.#q=null}});constructor(J,Q,X,K){if(this.#J=J,this.#X=Q,this.#G=(Z)=>{var W=L;W.b=this,W.f|=iJ,X(Z)},this.parent=L.b,this.transform_error=K??this.parent?.transform_error??((Z)=>Z),this.#W=S0(()=>{if(w){let Z=this.#Q;l();let W=Z.data===MJ;if(Z.data.startsWith(D8)){let G=JSON.parse(Z.data.slice(D8.length));this.#O(G)}else if(W)this.#A();else this.#F()}else this.#Y()},w6),w)this.#J=N}#F(){try{this.#$=o(()=>this.#G(this.#J))}catch(J){this.error(J)}}#O(J){let Q=this.#X.failed,{reset:X,invoke_onerror:K}=this.#S(J);if(s(K),!Q)return;this.#z=o(()=>{Q(this.#J,()=>J,()=>X)})}#S(J){var Q=!1,X=!1;let K=()=>{if(Q){X4();return}if(Q=!0,X)O4();if(this.#z!==null)QJ(this.#z,()=>{this.#z=null});this.#B(()=>{this.#Y()})};return{reset:K,invoke_onerror:()=>{try{X=!0,this.#X.onerror?.(J,K),X=!1}catch(W){p0(W,this.#W&&this.#W.parent)}}}}#A(){let J=this.#X.pending;if(!J)return;this.is_pending=!0,this.#K=o(()=>J(this.#J)),s(()=>{var Q=this.#Z=document.createDocumentFragment(),X=a();if(Q.append(X),this.#$=this.#B(()=>{return o(()=>this.#G(X))}),this.#U===0)this.#J.before(Q),this.#Z=null,QJ(this.#K,()=>{this.#K=null}),this.#L(A)})}#Y(){try{if(this.is_pending=this.has_pending_snippet(),this.#U=0,this.#V=0,this.#$=o(()=>{this.#G(this.#J)}),this.#U>0){var J=this.#Z=document.createDocumentFragment();eJ(this.#$,J);let Q=this.#X.pending;this.#K=o(()=>Q(this.#J))}else this.#L(A)}catch(Q){this.error(Q)}}#L(J){this.is_pending=!1,J.transfer_effects(this.#P,this.#M)}defer_effect(J){l7(J,this.#P,this.#M)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#X.pending}#B(J){var Q=L,X=S,K=D;p(this.#W),f(this.#W),qJ(this.#W.ctx);try{return $0.ensure(),J()}catch(Z){return v7(Z),null}finally{p(Q),f(X),qJ(K)}}#N(J,Q){if(!this.has_pending_snippet()){if(this.parent)this.parent.#N(J,Q);return}if(this.#U+=J,this.#U===0){if(this.#L(Q),this.#K)QJ(this.#K,()=>{this.#K=null});if(this.#Z)this.#J.before(this.#Z),this.#Z=null}}update_pending_count(J,Q){if(this.#N(J,Q),this.#V+=J,!this.#q||this.#H)return;this.#H=!0,s(()=>{if(this.#H=!1,this.#q)d0(this.#q,this.#V)})}get_effect_pending(){return this.#w(),I(this.#q)}error(J){if(!this.#X.onerror&&!this.#X.failed)throw J;if(A?.is_fork){if(this.#$)A.skip_effect(this.#$);if(this.#K)A.skip_effect(this.#K);if(this.#z)A.skip_effect(this.#z);A.oncommit(()=>{this.#D(J)})}else this.#D(J)}#D(J){if(this.#$)m(this.#$),this.#$=null;if(this.#K)m(this.#K),this.#K=null;if(this.#z)m(this.#z),this.#z=null;if(w)E(this.#Q),y8(),E(XJ());let Q=this.#X.failed,X=(K)=>{let{reset:Z,invoke_onerror:W}=this.#S(K);if(W(),Q)this.#z=this.#B(()=>{try{return o(()=>{var $=L;$.b=this,$.f|=iJ,Q(this.#J,()=>K,()=>Z)})}catch($){return p0($,this.#W.parent),null}})};s(()=>{var K;try{K=this.transform_error(J)}catch(Z){p0(Z,this.#W&&this.#W.parent);return}if(K!==null&&typeof K==="object"&&typeof K.then==="function")K.then(X,(Z)=>p0(Z,this.#W&&this.#W.parent));else X(K)})}}function c7(J,Q,X,K){let Z=f0()?SJ:yJ;var W=J.filter((Y)=>!Y.settled),$=Q.map(Z);if(B)$.forEach((Y,V)=>{Y.label=Q[V].toString().replace("() => ","").replaceAll("$.eager(() => ","$state.eager(").replace(/\$\.get\((.+?)\)/g,(F,M)=>M)});if(X.length===0&&W.length===0){K($);return}var G=L,z=T4(),U=W.length===1?W[0].promise:W.length>1?Promise.all(W.map((Y)=>Y.promise)):null;function q(Y){if((G.f&g)!==0)return;z();try{K([...$,...Y])}catch(V){p0(V,G)}J7()}var P=m8();if(X.length===0){U.then(()=>q([])).finally(P);return}function H(){Promise.all(X.map((Y)=>u8(Y))).then(q).catch((Y)=>p0(Y,G)).finally(P)}if(U)U.then(()=>{z(),H(),J7()});else H()}function T4(){var J=L,Q=S,X=D,K=A;if(B)var Z=e0;return function($=!0){if(p(J),f(Q),qJ(X),$&&(J.f&g)===0)K?.activate(),K?.apply();if(B)v8(null),nJ(Z)}}function J7(J=!0){if(p(null),f(null),qJ(null),J)A?.deactivate();if(B)v8(null),nJ(null)}function m8(){var J=L,Q=J.b,X=A,K=!!Q?.is_rendered();return Q?.update_pending_count(1,X),X.increment(K,J),()=>{Q?.update_pending_count(-1,X),X.decrement(K,J)}}var A0=null;function v8(J){A0=J}var F7=new Set;function SJ(J){var Q=b|C;if(L!==null)L.f|=o0;let X={ctx:D,deps:null,effects:null,equals:u7,f:Q,fn:J,reactions:null,rv:0,v:y,wv:0,parent:L,ac:null};if(B&&u0)X.created=_0("created at");return X}var Q7=Symbol("obsolete");function u8(J,Q,X){let K=L;if(K===null)G4();var Z=void 0,W=q0(y);if(B)W.label=Q??J.toString();var $=!S,G=new Set;if(k4(()=>{var z=L;if(B)A0={effect:z,effect_deps:new Set,warned:!1};var U=g7();Z=U.promise;try{Promise.resolve(J()).then(U.resolve,(Y)=>{if(Y!==GJ)U.reject(Y)}).finally(J7)}catch(Y){U.reject(Y),J7()}if(B){if(A0){if(z.deps!==null)for(let Y=0;Y<V0;Y+=1)A0.effect_deps.add(z.deps[Y]);if(J0!==null)for(let Y=0;Y<J0.length;Y+=1)A0.effect_deps.add(J0[Y])}A0=null}var q=A;if($){if((z.f&Y0)!==0)var P=m8();if(K.b?.is_rendered())q.async_deriveds.get(z)?.reject(Q7);else for(let Y of G.values())Y.reject(Q7);G.add(U),q.async_deriveds.set(z,U)}let H=(Y,V=void 0)=>{if(B)A0=null;if(P?.(),G.delete(U),V===Q7)return;if(q.activate(),V)W.f|=y0,d0(W,V);else{if((W.f&y0)!==0)W.f^=y0;if(B&&X!==void 0&&!W.equals(Y))F7.add(W),setTimeout(()=>{if(F7.has(W)&&(z.f&g)===0)r9(W.label,X),F7.delete(W)});d0(W,Y)}q.deactivate()};U.promise.then(H,(Y)=>H(null,Y||"unknown"))}),z0(()=>{for(let z of G)z.reject(Q7)}),B)W.f|=R0;return new Promise((z)=>{function U(q){function P(){if(q===Z)z(W);else U(Z)}q.then(P,P)}U(Z)})}function S6(J){let Q=SJ(J);if(!t)o7(Q);return Q}function yJ(J){let Q=SJ(J);return Q.equals=p7,Q}function E4(J){var Q=J.effects;if(Q!==null){J.effects=null;for(var X=0;X<Q.length;X+=1)m(Q[X])}}var f8=[];function L7(J){var Q,X=L,K=J.parent;if(!T0&&K!==null&&J.v!==y&&(K.f&(g|d))!==0)return n9(),J.v;if(p(K),B){let Z=hJ;i7(new Set);try{if(LJ.call(f8,J))z4();f8.push(J),J.f&=~j0,E4(J),Q=s7(J)}finally{p(X),i7(Z),f8.pop()}}else try{J.f&=~j0,E4(J),Q=s7(J)}finally{p(X)}return Q}function p8(J){var Q=L7(J);if(!J.equals(Q)){if(J.wv=X7(),!A?.is_fork||J.deps===null){if(A!==null)A.capture(J,Q,!0),AJ?.capture(J,Q,!0);else J.v=Q;if(J.deps===null){x(J,k);return}}}if(T0)return;if(Q0!==null){if(OJ()||A?.is_fork)Q0.set(J,Q)}else tJ(J)}function x4(J){if(J.effects===null)return;for(let Q of J.effects)if(Q.teardown||Q.ac){if(Q.teardown?.(),Q.ac!==null)JJ(()=>{Q.ac.abort(GJ),Q.ac=null});if(Q.fn!==null)Q.teardown=t0;gJ(Q,0),w7(Q)}}function _8(J){if(J.effects===null)return;for(let Q of J.effects)if(Q.teardown&&Q.fn!==null)KJ(Q)}var hJ=new Set,UJ=new Map;function i7(J){hJ=J}var d8=!1;function b4(){d8=!0}function q0(J,Q){var X={f:0,v:J,reactions:null,equals:u7,rv:0,wv:0};if(B&&u0)X.created=Q??_0("created at"),X.updated=null,X.set_during_effect=!1,X.trace=null;return X}function ZJ(J,Q){let X=q0(J,Q);return o7(X),X}function mJ(J,Q=!1,X=!0){let K=q0(J);if(!Q)K.equals=p7;if(wJ&&X&&D!==null&&D.l!==null)(D.l.s??=[]).push(K);return K}function U0(J,Q,X=!1){if(S!==null&&(!M0||(S.f&VJ)!==0)&&f0()&&(S.f&(b|X0|R0|VJ))!==0&&(l0===null||!l0.has(J)))w4();let K=X?HJ(Q):Q;if(B)d7(K,J.label);return d0(J,K,O7)}function d0(J,Q,X=null){if(!J.equals(Q)){UJ.set(J,T0?Q:J.v);var K=$0.ensure();if(K.capture(J,Q),B){if(u0||L!==null){J.updated??=new Map;let Z=(J.updated.get("")?.count??0)+1;if(J.updated.set("",{error:null,count:Z}),u0||Z>5){let W=_0("updated at");if(W!==null){let $=J.updated.get(W.stack);if(!$)$={error:W,count:0},J.updated.set(W.stack,$);$.count++}}}if(L!==null)J.set_during_effect=!0}if((J.f&b)!==0){let Z=J;if((J.f&C)!==0)L7(Z);if(Q0===null)tJ(Z)}if(J.wv=X7(),y4(J,C,X),f0()&&L!==null&&(L.f&k)!==0&&(L.f&(c|P0))===0)if(E0===null)h4([J]);else E0.push(J);if(!K.is_fork&&hJ.size>0&&!d8)a7()}return Q}function a7(){d8=!1;for(let J of hJ){if((J.f&k)!==0)x(J,v);let Q;try{Q=NJ(J)}catch{Q=!0}if(Q)KJ(J)}hJ.clear()}function bJ(J){U0(J,J.v+1)}function y4(J,Q,X){var K=J.reactions;if(K===null)return;var Z=f0(),W=K.length;for(var $=0;$<W;$++){var G=K[$],z=G.f;if(!Z&&G===L)continue;var U=(z&C)===0;if(U)x(G,Q);if((z&VJ)!==0)hJ.add(G);else if((z&b)!==0){var q=G;if(Q0?.delete(q),(z&j0)===0){if(z&K0&&(L===null||(L.f&IJ)===0))G.f|=j0;y4(q,v,X)}}else if(U){var P=G;if((z&X0)!==0&&h0!==null)h0.add(P);if(X!==null)X.push(P);else S7(P)}}}var g4=!1,r7=!1,qK=Symbol("unmounted");function l8(J){var Q=r7;try{return r7=!1,[J(),r7]}finally{r7=Q}}var n7=null,K7=null,A=null,AJ=null,Q0=null,s8=null,kJ=!1,c8=!1,vJ=null,O7=null,m4=0,i8=new Set,D6=1;class $0{id=D6++;#J=!1;linked=!0;#Q=null;#X=null;async_deriveds=new Map;current=new Map;previous=new Map;#G=new Set;#W=new Set;#$=0;#K=new Map;#z=null;#Z=[];#V=[];#U=new Set;#H=new Set;#P=new Map;#M=new Set;is_fork=!1;#q=!1;constructor(){if(K7===null)n7=K7=this;else K7.#X=this,this.#Q=K7;K7=this}#w(){if(this.is_fork)return!0;for(let X of this.#K.keys()){var J=X,Q=!1;while(J.parent!==null){if(this.#P.has(J)){Q=!0;break}J=J.parent}if(!Q)return!0}return!1}skip_effect(J){if(!this.#P.has(J))this.#P.set(J,{d:[],m:[]});this.#M.delete(J)}unskip_effect(J,Q=(X)=>this.schedule(X)){var X=this.#P.get(J);if(X){this.#P.delete(J);for(var K of X.d)x(K,C),Q(K);for(K of X.m)x(K,v),Q(K)}this.#M.add(J)}#F(){if(this.#J=!0,m4++>1000)this.#B(),j6();if(B)for(let G of this.current.keys())i8.add(G);for(let G of this.#U)this.#H.delete(G),x(G,C),this.schedule(G);for(let G of this.#H)x(G,v),this.schedule(G);let J=this.#Z;this.#Z=[],this.apply();var Q=vJ=[],X=[],K=O7=[];for(let G of J)try{this.#O(G,Q,X)}catch(z){if(p4(G),!this.#w())this.discard();throw z}if(A=null,K.length>0){var Z=$0.ensure();for(let G of K)Z.schedule(G)}if(vJ=null,O7=null,this.#w()){this.#Y(X),this.#Y(Q);for(let[G,z]of this.#P)f4(G,z);if(K.length>0)A.#F();return}let W=this.#S();if(W){this.#Y(X),this.#Y(Q),W.#A(this);return}this.#U.clear(),this.#H.clear();for(let G of this.#G)G(this);this.#G.clear(),AJ=this,v4(X),v4(Q),AJ=null,this.#z?.resolve();var $=A;if(this.#$===0&&(this.#Z.length===0||$!==null)){if(this.#B(),t)this.#L(),A=$}if(this.#Z.length>0)if($!==null){let G=$;G.#Z.push(...this.#Z.filter((z)=>!G.#Z.includes(z)))}else $=this;if($!==null)$.#F()}#O(J,Q,X){J.f^=k;var K=J.first;while(K!==null){var Z=K.f,W=(Z&(c|P0))!==0,$=W&&(Z&k)!==0,G=$||(Z&d)!==0||this.#P.has(K);if(!G&&K.fn!==null){if(W)K.f^=k;else if((Z&s0)!==0)Q.push(K);else if(t&&(Z&(BJ|CJ))!==0)X.push(K);else if(NJ(K)){if((Z&X0)!==0)this.#H.add(K);KJ(K)}var z=K.first;if(z!==null){K=z;continue}}while(K!==null){var U=K.next;if(U!==null){K=U;break}K=K.parent}}}#S(){var J=this.#Q;while(J!==null){if(!J.is_fork){for(let[Q,[,X]]of this.current)if(J.current.has(Q)&&!X)return J}J=J.#Q}return null}#A(J){for(let[X,K]of J.current){if(!this.previous.has(X)&&J.previous.has(X))this.previous.set(X,J.previous.get(X));this.current.set(X,K)}for(let[X,K]of J.async_deriveds){let Z=this.async_deriveds.get(X);if(Z)K.promise.then(Z.resolve).catch(Z.reject)}J.async_deriveds.clear(),this.transfer_effects(J.#U,J.#H);let Q=(X)=>{var K=X.reactions;if(K===null)return;if((X.f&b)!==0&&(X.f&(C|v))===0)return;for(let $ of K){var Z=$.f;if((Z&b)!==0)Q($);else{var W=$;if(Z&(R0|X0)&&!this.async_deriveds.has(W))this.#H.delete(W),x(W,C),this.schedule(W)}}};for(let X of this.current.keys())Q(X);this.oncommit(()=>J.discard()),J.#B(),A=this,this.#F()}#Y(J){for(var Q=0;Q<J.length;Q+=1)l7(J[Q],this.#U,this.#H)}capture(J,Q,X=!1){if(J.v!==y&&!this.previous.has(J))this.previous.set(J,J.v);if((J.f&y0)===0)this.current.set(J,[Q,X]),Q0?.set(J,Q);if(!this.is_fork)J.v=Q}activate(){A=this}deactivate(){A=null,Q0=null}flush(){try{if(B)i8.clear();c8=!0,A=this,this.#F()}finally{if(m4=0,s8=null,vJ=null,O7=null,c8=!1,A=null,Q0=null,UJ.clear(),B)for(let J of i8)J.updated=null}}discard(){for(let J of this.#W)J(this);this.#W.clear();for(let J of this.async_deriveds.values())J.reject(Q7);this.#B(),this.#z?.resolve()}register_created_effect(J){this.#V.push(J)}#L(){for(let q=n7;q!==null;q=q.#X){var J=q.id<this.id,Q=[];for(let[P,[H,Y]]of this.current){if(q.current.has(P)){var X=q.current.get(P)[0];if(J&&H!==X)q.current.set(P,[H,Y]);else continue}Q.push(P)}if(J)for(let[P,H]of this.async_deriveds){let Y=q.async_deriveds.get(P);if(Y)H.promise.then(Y.resolve).catch(Y.reject)}var K=[...q.current.keys()].filter((P)=>!q.current.get(P)[1]);if(!q.#J||K.length===0)continue;var Z=K.filter((P)=>!this.current.has(P));if(Z.length===0){if(J)q.discard()}else if(Q.length>0){if(B&&!q.#q)R4(q.#Z.length===0,"Batch has scheduled roots");if(J)for(let P of this.#M)q.unskip_effect(P,(H)=>{if((H.f&(X0|R0))!==0)q.schedule(H);else q.#Y([H])});q.activate();var W=new Set,$=new Map;for(var G of Q)u4(G,Z,W,$);$=new Map;var z=[...q.current].filter(([P,H])=>{let Y=this.current.get(P);if(!Y)return!0;return Y[0]!==H[0]||Y[1]!==H[1]}).map(([P])=>P);if(z.length>0){for(let P of this.#V)if((P.f&(g|d|VJ))===0&&o8(P,z,$))if((P.f&(R0|X0))!==0)x(P,C),q.schedule(P);else q.#U.add(P)}if(q.#Z.length>0&&!q.#q){q.apply();for(var U of q.#Z)q.#O(U,[],[]);q.#Z=[]}q.deactivate()}}}increment(J,Q){if(this.#$+=1,J){let X=this.#K.get(Q)??0;this.#K.set(Q,X+1)}}decrement(J,Q){if(this.#$-=1,J){let X=this.#K.get(Q)??0;if(X===1)this.#K.delete(Q);else this.#K.set(Q,X-1)}if(this.#q)return;this.#q=!0,s(()=>{if(this.#q=!1,this.linked)this.flush()})}transfer_effects(J,Q){for(let X of J)this.#U.add(X);for(let X of Q)this.#H.add(X);J.clear(),Q.clear()}oncommit(J){this.#G.add(J)}ondiscard(J){this.#W.add(J)}settled(){return(this.#z??=g7()).promise}static ensure(){if(A===null){let J=A=new $0;if(!c8&&!kJ)s(()=>{if(!J.#J)J.flush()})}return A}apply(){if(!t||!this.is_fork&&this.#Q===null&&this.#X===null){Q0=null;return}Q0=new Map;for(let[Q,[X]]of this.current)Q0.set(Q,X);for(let Q=n7;Q!==null;Q=Q.#X){if(Q===this||Q.is_fork)continue;var J=!1;if(Q.id<this.id)for(let[X,[,K]]of Q.current){if(K)continue;if(this.current.has(X)){J=!0;break}}if(!J){for(let[X,K]of Q.previous)if(!Q0.has(X))Q0.set(X,K)}}}schedule(J){if(s8=J,J.b?.is_pending&&(J.f&(s0|BJ|CJ))!==0&&(J.f&Y0)===0){J.b.defer_effect(J);return}var Q=J;while(Q.parent!==null){Q=Q.parent;var X=Q.f;if(vJ!==null&&Q===L){if(t)return;if((S===null||(S.f&b)===0)&&!g4)return}if((X&(P0|c))!==0){if((X&k)===0)return;Q.f^=k}}this.#Z.push(Q)}#B(){if(!this.linked)return;var J=this.#Q,Q=this.#X;if(J===null)n7=Q;else J.#X=Q;if(Q===null)K7=J;else Q.#Q=J;this.linked=!1}}function Z7(J){var Q=kJ;kJ=!0;try{var X;if(J){if(A!==null&&!A.is_fork)A.flush();X=J()}while(!0){if(N4(),A===null)return X;A.flush()}}finally{kJ=Q}}function j6(){if(B){var J=new Map;for(let X of A.current.keys())for(let[K,Z]of X.updated??[]){var Q=J.get(K);if(!Q)Q={error:Z.error,count:0},J.set(K,Q);Q.count+=Z.count}for(let X of J.values())if(X.error)console.error(X.error)}try{Y4()}catch(X){if(B)n(X,"stack",{value:""});p0(X,s8)}}var h0=null;function v4(J){var Q=J.length;if(Q===0)return;var X=0;while(X<Q){var K=J[X++];if((K.f&(g|d))===0&&NJ(K)){if(h0=new Set,KJ(K),K.deps===null&&K.first===null&&K.nodes===null&&K.teardown===null&&K.ac===null)a8(K);if(h0?.size>0){UJ.clear();for(let Z of h0){if((Z.f&(g|d))!==0)continue;let W=[Z],$=Z.parent;while($!==null){if(h0.has($))h0.delete($),W.push($);$=$.parent}for(let G=W.length-1;G>=0;G--){let z=W[G];if((z.f&(g|d))!==0)continue;KJ(z)}}h0.clear()}}}h0=null}function u4(J,Q,X,K){if(X.has(J))return;if(X.add(J),J.reactions!==null)for(let Z of J.reactions){let W=Z.f;if((W&b)!==0)u4(Z,Q,X,K);else if((W&(R0|X0))!==0&&(W&C)===0&&o8(Z,Q,K))x(Z,C),S7(Z)}}function o8(J,Q,X){let K=X.get(J);if(K!==void 0)return K;if(J.deps!==null)for(let Z of J.deps){if(LJ.call(Q,Z))return!0;if((Z.f&b)!==0&&o8(Z,Q,X))return X.set(Z,!0),!0}return X.set(J,!1),!1}function S7(J){A.schedule(J)}function f4(J,Q){if((J.f&c)!==0&&(J.f&k)!==0)return;if((J.f&C)!==0)Q.d.push(J);else if((J.f&v)!==0)Q.m.push(J);x(J,k);var X=J.first;while(X!==null)f4(X,Q),X=X.next}function p4(J){x(J,k);var Q=J.first;while(Q!==null)p4(Q),Q=Q.next}function d4(J){if(L===null){if(S===null)P4(J);H4()}if(T0)U4(J)}function C6(J,Q){var X=Q.last;if(X===null)Q.last=Q.first=J;else X.next=J,J.prev=X,Q.last=J}function WJ(J,Q){var X=L;if(B)while(X!==null&&(X.f&VJ)!==0)X=X.parent;if(X!==null&&(X.f&d)!==0)J|=d;var K={ctx:D,deps:null,nodes:null,f:J|C|K0,first:null,fn:Q,last:null,next:null,parent:X,b:X&&X.b,prev:null,teardown:null,wv:0,ac:null};if(B)K.component_function=I0;A?.register_created_effect(K);var Z=K;if((J&s0)!==0)if(vJ!==null)vJ.push(K);else $0.ensure().schedule(K);else if(Q!==null){try{KJ(K)}catch($){throw m(K),$}if(Z.deps===null&&Z.teardown===null&&Z.nodes===null&&Z.first===Z.last&&(Z.f&o0)===0){if(Z=Z.first,(J&X0)!==0&&(J&w0)!==0&&Z!==null)Z.f|=w0}}if(Z!==null){if(Z.parent=X,X!==null)C6(Z,X);if(S!==null&&(S.f&b)!==0&&(J&P0)===0){var W=S;(W.effects??=[]).push(Z)}}return K}function OJ(){return S!==null&&!M0}function z0(J){let Q=WJ(BJ,null);return x(Q,k),Q.teardown=J,Q}function n8(J){if(d4("$effect"),B)n(J,"name",{value:"$effect"});var Q=L.f,X=!S&&(Q&c)!==0&&D!==null&&!D.i;if(X){var K=D;(K.e??=[]).push(J)}else return x8(J)}function x8(J){return WJ(s0|h9,J)}function t8(J){$0.ensure();let Q=WJ(P0|o0,J);return()=>{m(Q)}}function l4(J){$0.ensure();let Q=WJ(P0|o0,J);return(X={})=>{return new Promise((K)=>{if(X.outro)QJ(Q,()=>{m(Q),K(void 0)});else m(Q),K(void 0)})}}function F0(J){return WJ(s0,J)}function k4(J){return WJ(R0|o0,J)}function e(J,Q=0){return WJ(BJ|Q,J)}function e8(J,Q=[],X=[],K=[]){c7(K,Q,X,(Z)=>{WJ(BJ,()=>{J(...Z.map(I))})})}function S0(J,Q=0){var X=WJ(X0|Q,J);if(B)X.dev_stack=e0;return X}function o(J){return WJ(c|o0,J)}function J9(J){var Q=J.teardown;if(Q!==null){let X=T0,K=S;r8(!0),f(null);try{Q.call(null)}finally{r8(X),f(K)}}}function w7(J,Q=!1){var X=J.first;J.first=J.last=null;while(X!==null){let Z=X.ac;if(Z!==null)JJ(()=>{Z.abort(GJ)});var K=X.next;if((X.f&P0)!==0)X.parent=null;else m(X,Q);X=K}}function c4(J){var Q=J.first;while(Q!==null){var X=Q.next;if((Q.f&c)===0)m(Q);Q=X}}function m(J,Q=!0){var X=!1;if((Q||(J.f&w8)!==0)&&J.nodes!==null&&J.nodes.end!==null)Q9(J.nodes.start,J.nodes.end),X=!0;J.f|=sJ,w7(J,Q&&!X),gJ(J,0);var K=J.nodes&&J.nodes.t;if(K!==null)for(let W of K)W.stop();J9(J),J.f^=sJ,J.f|=g;var Z=J.parent;if(Z!==null&&Z.first!==null)a8(J);if(B)J.component_function=null;J.next=J.prev=J.teardown=J.ctx=J.deps=J.fn=J.nodes=J.ac=J.b=null}function Q9(J,Q){while(J!==null){var X=J===Q?null:r(J);J.remove(),J=X}}function a8(J){var{parent:Q,prev:X,next:K}=J;if(X!==null)X.next=K;if(K!==null)K.prev=X;if(Q!==null){if(Q.first===J)Q.first=K;if(Q.last===J)Q.last=X}}function QJ(J,Q,X=!0){var K=[];i4(J,K,!0);var Z=()=>{if(X)m(J);if(Q)Q()},W=K.length;if(W>0){var $=()=>--W||Z();for(var G of K)G.out($)}else Z()}function i4(J,Q,X){if((J.f&d)!==0)return;J.f^=d;var K=J.nodes&&J.nodes.t;if(K!==null){for(let G of K)if(G.is_global||X)Q.push(G)}var Z=J.first;while(Z!==null){var W=Z.next;if((Z.f&P0)===0){var $=(Z.f&w0)!==0||(Z.f&c)!==0&&(J.f&X0)!==0;i4(Z,Q,$?X:!1)}Z=W}}function W7(J){s4(J,!0)}function s4(J,Q){if((J.f&d)===0)return;if(J.f^=d,(J.f&k)===0)x(J,C),$0.ensure().schedule(J);var X=J.first;while(X!==null){var K=X.next,Z=(X.f&w0)!==0||(X.f&c)!==0;s4(X,Z?Q:!1),X=K}var W=J.nodes&&J.nodes.t;if(W!==null){for(let $ of W)if($.is_global||Q)$.in()}}function eJ(J,Q){if(!J.nodes)return;var X=J.nodes.start,K=J.nodes.end;while(X!==null){var Z=X===K?null:r(X);Q.append(X),X=Z}}var o4=null;var t7=!1,T0=!1;function r8(J){T0=J}var S=null,M0=!1;function f(J){S=J}var L=null;function p(J){L=J}var l0=null;function o7(J){if(S!==null&&(!t||(S.f&b)!==0))(l0??=new Set).add(J)}var J0=null,V0=0,E0=null;function h4(J){E0=J}var a4=1,uJ=0,DJ=uJ;function X9(J){DJ=J}function X7(){return++a4}function NJ(J){var Q=J.f;if((Q&C)!==0)return!0;if(Q&b)J.f&=~j0;if((Q&v)!==0){var X=J.deps,K=X.length;for(var Z=0;Z<K;Z++){var W=X[Z];if(NJ(W))p8(W);if(W.wv>J.wv)return!0}if((Q&K0)!==0&&Q0===null)x(J,k)}return!1}function r4(J,Q,X=!0){var K=J.reactions;if(K===null)return;if(!t&&l0!==null&&l0.has(J))return;for(var Z=0;Z<K.length;Z++){var W=K[Z];if((W.f&b)!==0)r4(W,Q,!1);else if(Q===W){if(X)x(W,C);else if((W.f&k)!==0)x(W,v);S7(W)}}}function s7(J){var Q=J0,X=V0,K=E0,Z=S,W=l0,$=D,G=M0,z=DJ,U=J.f;if(J0=null,V0=0,E0=null,S=(U&(c|P0))===0?J:null,l0=null,qJ(J.ctx),M0=!1,DJ=++uJ,J.ac!==null)JJ(()=>{J.ac.abort(GJ)}),J.ac=null;try{J.f|=IJ;var q=J.fn,P=q();J.f|=Y0;var H=J.deps,Y=A?.is_fork;if(J0!==null){var V;if(!Y)gJ(J,V0);if(H!==null&&V0>0){H.length=V0+J0.length;for(V=0;V<J0.length;V++)H[V0+V]=J0[V]}else J.deps=H=J0;if(OJ()&&(J.f&K0)!==0)for(V=V0;V<H.length;V++)(H[V].reactions??=[]).push(J)}else if(!Y&&H!==null&&V0<H.length)gJ(J,V0),H.length=V0;if(f0()&&E0!==null&&!M0&&H!==null&&(J.f&(b|v|C))===0)for(V=0;V<E0.length;V++)r4(E0[V],J);if(Z!==null&&Z!==J){if(uJ++,Z.deps!==null)for(let F=0;F<X;F+=1)Z.deps[F].rv=uJ;if(Q!==null)for(let F of Q)F.rv=uJ;if(E0!==null)if(K===null)K=E0;else K.push(...E0)}if((J.f&y0)!==0)J.f^=y0;return P}catch(F){return v7(F)}finally{J.f^=IJ,J0=Q,V0=X,E0=K,S=Z,l0=W,qJ($),M0=G,DJ=z}}function I6(J,Q){let X=Q.reactions;if(X!==null){var K=K4.call(X,J);if(K!==-1){var Z=X.length-1;if(Z===0)X=Q.reactions=null;else X[K]=X[Z],X.pop()}}if(X===null&&(Q.f&b)!==0&&(J0===null||!LJ.call(J0,Q))){var W=Q;if((W.f&K0)!==0)W.f^=K0,W.f&=~j0;if(W.v!==y)tJ(W);if(W.ac!==null)JJ(()=>{W.ac.abort(GJ),W.ac=null,x(W,C)});x4(W),gJ(W,0)}}function gJ(J,Q){var X=J.deps;if(X===null)return;for(var K=Q;K<X.length;K++)I6(J,X[K])}function KJ(J){var Q=J.f;if((Q&g)!==0)return;x(J,k);var X=L,K=t7;if(L=J,t7=(Q&(c|P0))===0,B){var Z=I0;m7(J.component_function);var W=e0;nJ(J.dev_stack??e0)}try{if((Q&(X0|CJ))!==0)c4(J);else w7(J);J9(J);var $=s7(J);if(J.teardown=typeof $==="function"?$:null,J.wv=a4,B&&u0&&(J.f&C)!==0&&J.deps!==null){for(var G of J.deps)if(G.set_during_effect)G.wv=X7(),G.set_during_effect=!1}}finally{if(t7=K,L=X,B)m7(Z),nJ(W)}}function I(J){var Q=J.f,X=(Q&b)!==0;if(o4?.add(J),S!==null&&!M0){var K=L!==null&&(L.f&g)!==0;if(!K&&(l0===null||!l0.has(J))){var Z=S.deps;if((S.f&IJ)!==0){if(J.rv<uJ)if(J.rv=uJ,J0===null&&Z!==null&&Z[V0]===J)V0++;else if(J0===null)J0=[J];else J0.push(J)}else{if(S.deps??=[],!LJ.call(S.deps,J))S.deps.push(J);var W=J.reactions;if(W===null)J.reactions=[S];else if(!LJ.call(W,S))W.push(S)}}}if(B){if(!M0&&A0&&A===null&&AJ===null&&!A0.warned&&(A0.effect.f&IJ)===0&&!A0.effect_deps.has(J)){A0.warned=!0,a9(J.label);var $=_0("traced at");if($)console.warn($)}if(F7.delete(J),u0&&!M0&&V7!==null&&S!==null&&V7.reaction===S){if(J.trace)J.trace();else if($=_0("traced at"),$){var G=V7.entries.get(J);if(G===void 0)G={traces:[]},V7.entries.set(J,G);var z=G.traces[G.traces.length-1];if($.stack!==z?.stack)G.traces.push($)}}}if(T0&&UJ.has(J))return UJ.get(J);if(X){var U=J;if(T0){var q=U.v;if((U.f&k)===0&&U.reactions!==null||t4(U))q=L7(U);return UJ.set(U,q),q}var P=(U.f&K0)===0&&!M0&&S!==null&&(t7||(S.f&K0)!==0),H=(U.f&Y0)===0;if(NJ(U)){if(P)U.f|=K0;p8(U)}if(P&&!H)_8(U),n4(U)}if(Q0?.has(J))return Q0.get(J);if((J.f&y0)!==0)throw J.v;return J.v}function n4(J){if(J.f|=K0,J.deps===null)return;for(let Q of J.deps)if((Q.reactions??=[]).push(J),(Q.f&b)!==0&&(Q.f&K0)===0)_8(Q),n4(Q)}function t4(J){if(J.v===y)return!0;if(J.deps===null)return!1;for(let Q of J.deps){if(UJ.has(Q))return!0;if((Q.f&b)!==0&&t4(Q))return!0}return!1}function h(J){var Q=M0;try{return M0=!0,J()}finally{M0=Q}}function J8(J){if(typeof J!=="object"||!J||J instanceof EventTarget)return;if(i in J)e7(J);else if(!Array.isArray(J))for(let Q in J){let X=J[Q];if(typeof X==="object"&&X&&i in X)e7(X)}}function e7(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 K in J)try{e7(J[K],Q)}catch(Z){}let X=EJ(J);if(X!==Object.prototype&&X!==Array.prototype&&X!==Map.prototype&&X!==Set.prototype&&X!==Date.prototype){let K=y7(X);for(let Z in K){let W=K[Z].get;if(W)try{W.call(J)}catch($){}}}}}var T6=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function HJ(J){if(typeof J!=="object"||J===null||i in J)return J;let Q=EJ(J);if(Q!==R8&&Q!==Z4)return J;var X=new Map,K=zJ(J),Z=ZJ(0),W=B&&u0?_0("created at"):null,$=DJ,G=(P)=>{if(DJ===$)return P();var H=S,Y=DJ;f(null),X9($);var V=P();return f(H),X9(Y),V};if(K){if(X.set("length",ZJ(J.length,W)),B)J=x6(J)}var z="";let U=!1;function q(P){if(U)return;U=!0,z=P,G0(Z,`${z} version`);for(let[H,Y]of X)G0(Y,fJ(z,H));U=!1}return new Proxy(J,{defineProperty(P,H,Y){if(!("value"in Y)||Y.configurable===!1||Y.enumerable===!1||Y.writable===!1)F4();var V=X.get(H);if(V===void 0)G(()=>{var F=ZJ(Y.value,W);if(X.set(H,F),B&&typeof H==="string")G0(F,fJ(z,H));return F});else U0(V,Y.value,!0);return!0},deleteProperty(P,H){var Y=X.get(H);if(Y===void 0){if(H in P){let V=G(()=>ZJ(y,W));if(X.set(H,V),bJ(Z),B)G0(V,fJ(z,H))}}else U0(Y,y),bJ(Z);return!0},get(P,H,Y){if(H===i)return J;if(B&&H===E7)return q;var V=X.get(H),F=H in P;if(V===void 0&&(!F||B0(P,H)?.writable))V=G(()=>{var O=HJ(F?P[H]:y),j=ZJ(O,W);if(B)G0(j,fJ(z,H));return j}),X.set(H,V);if(V!==void 0){var M=I(V);return M===y?void 0:M}return Reflect.get(P,H,Y)},getOwnPropertyDescriptor(P,H){var Y=Reflect.getOwnPropertyDescriptor(P,H);if(Y&&"value"in Y){var V=X.get(H);if(V)Y.value=I(V)}else if(Y===void 0){var F=X.get(H),M=F?.v;if(F!==void 0&&M!==y)return{enumerable:!0,configurable:!0,value:M,writable:!0}}return Y},has(P,H){if(H===i)return!0;var Y=X.get(H),V=Y!==void 0&&Y.v!==y||Reflect.has(P,H);if(Y!==void 0||L!==null&&(!V||B0(P,H)?.writable)){if(Y===void 0)Y=G(()=>{var M=V?HJ(P[H]):y,O=ZJ(M,W);if(B)G0(O,fJ(z,H));return O}),X.set(H,Y);var F=I(Y);if(F===y)return!1}return V},set(P,H,Y,V){var F=X.get(H),M=H in P;if(K&&H==="length")for(var O=Y;O<F.v;O+=1){var j=X.get(O+"");if(j!==void 0)U0(j,y);else if(O in P){if(j=G(()=>ZJ(y,W)),X.set(O+"",j),B)G0(j,fJ(z,O))}}if(F===void 0){if(!M||B0(P,H)?.writable){if(F=G(()=>ZJ(void 0,W)),B)G0(F,fJ(z,H));U0(F,HJ(Y)),X.set(H,F)}}else{M=F.v!==y;var T=G(()=>HJ(Y));U0(F,T)}var R=Reflect.getOwnPropertyDescriptor(P,H);if(R?.set)R.set.call(V,Y);if(!M){if(K&&typeof H==="string"){var b0=X.get("length"),H0=Number(H);if(Number.isInteger(H0)&&H0>=b0.v)U0(b0,H0+1)}bJ(Z)}return!0},ownKeys(P){I(Z);var H=Reflect.ownKeys(P).filter((F)=>{var M=X.get(F);return M===void 0||M.v!==y});for(var[Y,V]of X)if(V.v!==y&&!(Y in P))H.push(Y);return H},setPrototypeOf(){L4()}})}function fJ(J,Q){if(typeof Q==="symbol")return`${J}[Symbol(${Q.description??""})]`;if(T6.test(Q))return`${J}.${Q}`;return/^\d+$/.test(Q)?`${J}[${Q}]`:`${J}['${Q}']`}function Q8(J){try{if(J!==null&&typeof J==="object"&&i in J)return J[i]}catch{}return J}var E6=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function x6(J){return new Proxy(J,{get(Q,X,K){var Z=Reflect.get(Q,X,K);if(!E6.has(X))return Z;return function(...W){b4();var $=Z.apply(this,W);return a7(),$}}})}function e4(){let{prototype:J,__svelte_cleanup:Q}=Array;if(Q)Q();let{indexOf:X,lastIndexOf:K,includes:Z}=J;J.indexOf=function(W,$){let G=X.call(this,W,$);if(G===-1){for(let z=$??0;z<this.length;z+=1)if(Q8(this[z])===W){b7("array.indexOf(...)");break}}return G},J.lastIndexOf=function(W,$){let G=K.call(this,W,$??this.length-1);if(G===-1){for(let z=0;z<=($??this.length-1);z+=1)if(Q8(this[z])===W){b7("array.lastIndexOf(...)");break}}return G},J.includes=function(W,$){let G=Z.call(this,W,$);if(!G){for(let z=0;z<this.length;z+=1)if(Q8(this[z])===W){b7("array.includes(...)");break}}return G},Array.__svelte_cleanup=()=>{J.indexOf=X,J.lastIndexOf=K,J.includes=Z}}var K9,JQ,B7,QQ,XQ;function X8(){if(K9!==void 0)return;K9=window,JQ=document,B7=/Firefox/.test(navigator.userAgent);var J=Element.prototype,Q=Node.prototype,X=Text.prototype;if(QQ=B0(Q,"firstChild").get,XQ=B0(Q,"nextSibling").get,C8(J))J[q7]=void 0,J[x7]=null,J[U7]=void 0,J.__e=void 0;if(C8(X))X[H7]=void 0;if(B)J.__svelte_meta=null,e4()}function a(J=""){return document.createTextNode(J)}function u(J){return QQ.call(J)}function r(J){return XQ.call(J)}function k6(J,Q){if(!w)return u(J);var X=u(N);if(X===null)X=N.appendChild(a());else if(Q&&X.nodeType!==oJ){var K=a();return X?.before(K),E(K),K}if(Q)Z8(X);return E(X),X}function b6(J,Q=!1){if(!w){var X=u(J);if(X instanceof Comment&&X.data==="")return r(X);return X}if(Q){if(N?.nodeType!==oJ){var K=a();return N?.before(K),E(K),K}Z8(N)}return N}function y6(J,Q=1,X=!1){let K=w?N:J;var Z;while(Q--)Z=K,K=r(K);if(!w)return K;if(X){if(K?.nodeType!==oJ){var W=a();if(K===null)Z?.after(W);else K.before(W);return E(W),W}Z8(K)}return E(K),K}function M7(J){J.textContent=""}function K8(){if(!t)return!1;if(h0!==null)return!1;var J=L.f;return(J&Y0)!==0}function c0(J,Q,X){if(Q==null||Q===k7)return X?document.createElement(J,{is:X}):document.createElement(J);return X?document.createElementNS(Q,J,{is:X}):document.createElementNS(Q,J)}function Z8(J){if(J.nodeValue.length<65536)return;let Q=J.nextSibling;while(Q!==null&&Q.nodeType===oJ)Q.remove(),J.nodeValue+=Q.nodeValue,Q=J.nextSibling}var w=!1;function _(J){w=J}var N;function E(J){if(J===null)throw FJ(),a0;return N=J}function l(){return E(r(N))}function KQ(J){if(!w)return;if(r(N)!==null)throw FJ(),a0;N=J}function y8(J=1){if(w){var Q=J,X=N;while(Q--)X=r(X);N=X}}function XJ(J=!0){var Q=0,X=N;while(!0){if(X.nodeType===C0){var K=X.data;if(K===TJ){if(Q===0)return X;Q-=1}else if(K===aJ||K===MJ||K[0]==="["&&!isNaN(Number(K.slice(1))))Q+=1}var Z=r(X);if(J)X.remove();X=Z}}function A7(J){if(!J||J.nodeType!==C0)throw FJ(),a0;return J.data}var $7=Symbol("events"),Z9=new Set,W8=new Set;function WQ(J,Q,X){(Q[$7]??={})[J]=X}function $Q(J){for(var Q=0;Q<J.length;Q++)Z9.add(J[Q]);for(var X of W8)X(J)}var ZQ=null;function W9(J){var Q=this,X=Q.ownerDocument,K=J.type,Z=J.composedPath?.()||[],W=Z[0]||J.target;ZQ=J;var $=0,G=ZQ===J&&J[$7];if(G){var z=Z.indexOf(G);if(z!==-1&&(Q===document||Q===window)){J[$7]=Q;return}var U=Z.indexOf(Q);if(U===-1)return;if(z<=U)$=z}if(W=Z[$]||J.target,W===Q)return;n(J,"currentTarget",{configurable:!0,get(){return W||X}});var q=S,P=L;f(null),p(null);try{var H,Y=[];while(W!==null){if(W===Q)break;try{var V=W[$7]?.[K];if(V!=null&&(!W.disabled||J.target===W))V.call(W,J)}catch(F){if(H)Y.push(F);else H=F}if(J.cancelBubble)break;$++,W=$<Z.length?Z[$]:null}if(H){for(let F of Y)queueMicrotask(()=>{throw F});throw H}}finally{J[$7]=Q,delete J.currentTarget,f(q),p(P)}}var h6=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:(J)=>{return J}});function GQ(J){return h6?.createHTML(J)??J}function $9(J){var Q=c0("template");return Q.innerHTML=GQ(J.replaceAll("<!>","<!---->")),Q.content}function N0(J,Q){var X=L;if(X.nodes===null)X.nodes={start:J,end:Q,a:null,t:null}}function v6(J,Q){var X=(Q&i9)!==0,K=(Q&s9)!==0,Z,W=!J.startsWith("<!>");return()=>{if(w)return N0(N,null),N;if(Z===void 0){if(Z=$9(W?J:"<!>"+J),!X)Z=u(Z)}var $=K||B7?document.importNode(Z,!0):Z.cloneNode(!0);if(X){var G=u($),z=$.lastChild;N0(G,z)}else N0($,$);return $}}function u6(){if(w)return N0(N,null),N;var J=document.createDocumentFragment(),Q=document.createComment(""),X=a();return J.append(Q,X),N0(Q,X),J}function G9(J,Q){if(w){var X=L;if((X.f&Y0)===0||X.nodes.end===null)X.nodes.end=N;l();return}if(J===null)return;J.before(Q)}var f6=/\r/g;function zQ(J){J=J.replace(f6,"");let Q=5381,X=J.length;while(X--)Q=(Q<<5)-Q^J.charCodeAt(X);return(Q>>>0).toString(36)}var p6=["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 $Z=[...p6,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var _6=["touchstart","touchmove"];function qQ(J){return _6.includes(J)}var d6=["$state","$state.raw","$derived","$derived.by"],GZ=[...d6,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];function $8(J){return J?.replace(/\//g,"/")}var z9=!0;function l6(J,Q){var X=Q==null?"":typeof Q==="object"?`${Q}`:Q;if(X!==(J[H7]??=J.nodeValue))J[H7]=X,J.nodeValue=`${X}`}function z8(J,Q){return UQ(J,Q)}function U9(J,Q){X8(),Q.intro=Q.intro??!1;let X=Q.target,K=w,Z=N;try{var W=u(X);while(W&&(W.nodeType!==C0||W.data!==aJ))W=r(W);if(!W)throw a0;_(!0),E(W);let $=UQ(J,{...Q,anchor:W});return _(!1),$}catch($){if($ instanceof Error&&$.message.split(`
|
|
49
|
-
`).some((G)=>G.startsWith("https://svelte.dev/e/")))throw $;if($!==a0)console.warn("Failed to hydrate: ",$);if(Q.recover===!1)B4();return X8(),M7(X),_(!1),z8(J,Q)}finally{_(K),E(Z)}}var G8=new Map;function UQ(J,{target:Q,anchor:X,props:K={},events:Z,context:W,intro:$=!0,transformError:G}){X8();var z=void 0,U=l4(()=>{var q=X??Q.appendChild(a());h8(q,{pending:()=>{}},(Y)=>{T8({});var V=D;if(W)V.c=W;if(Z)K.$$events=Z;if(w)N0(Y,null);if(z9=$,z=J(Y,K)||{},z9=!0,w){if(L.nodes.end=N,N===null||N.nodeType!==C0||N.data!==TJ)throw FJ(),a0}E8()},G);var P=new Set,H=(Y)=>{for(var V=0;V<Y.length;V++){var F=Y[V];if(P.has(F))continue;P.add(F);var M=qQ(F);for(let T of[Q,document]){var O=G8.get(T);if(O===void 0)O=new Map,G8.set(T,O);var j=O.get(F);if(j===void 0)T.addEventListener(F,W9,{passive:M}),O.set(F,1);else O.set(F,j+1)}}};return H(rJ(Z9)),W8.add(H),()=>{for(var Y of P)for(let M of[Q,document]){var V=G8.get(M),F=V.get(Y);if(--F==0){if(M.removeEventListener(Y,W9),V.delete(Y),V.size===0)G8.delete(M)}else V.set(Y,F)}if(W8.delete(H),q!==X)q.parentNode?.removeChild(q)}});return q9.set(z,U),z}var q9=new WeakMap;function H9(J,Q){let X=q9.get(J);if(X)return q9.delete(J),X(Q);if(B)if(i in J)Q4();else J4();return Promise.resolve()}var HQ=new Map;function PQ(J,Q){var X=HQ.get(J);if(!X)X=new Set,HQ.set(J,X);X.add(Q)}class PJ{anchor;#J=new Map;#Q=new Map;#X=new Map;#G=new Set;#W=!0;constructor(J,Q=!0){this.anchor=J,this.#W=Q}#$=(J)=>{if(!this.#J.has(J))return;var Q=this.#J.get(J),X=this.#Q.get(Q);if(X)W7(X),this.#G.delete(Q);else{var K=this.#X.get(Q);if(K){if(W7(K.effect),this.#Q.set(Q,K.effect),this.#X.delete(Q),B)K.fragment.lastChild[S8]=this.anchor;K.fragment.lastChild.remove(),this.anchor.before(K.fragment),X=K.effect}}for(let[Z,W]of this.#J){if(this.#J.delete(Z),Z===J)break;let $=this.#X.get(W);if($)m($.effect),this.#X.delete(W)}for(let[Z,W]of this.#Q){if(Z===Q||this.#G.has(Z))continue;let $=()=>{if(Array.from(this.#J.values()).includes(Z)){var z=document.createDocumentFragment();eJ(W,z),z.append(a()),this.#X.set(Z,{effect:W,fragment:z})}else m(W);this.#G.delete(Z),this.#Q.delete(Z)};if(this.#W||!X)this.#G.add(Z),QJ(W,$,!1);else $()}};#K=(J)=>{this.#J.delete(J);let Q=Array.from(this.#J.values());for(let[X,K]of this.#X)if(!Q.includes(X))m(K.effect),this.#X.delete(X)};ensure(J,Q){var X=A,K=K8();if(Q&&!this.#Q.has(J)&&!this.#X.has(J))if(K){var Z=document.createDocumentFragment(),W=a();Z.append(W),this.#X.set(J,{effect:o(()=>Q(W)),fragment:Z})}else this.#Q.set(J,o(()=>Q(this.anchor)));if(this.#J.set(X,J),K){for(let[$,G]of this.#Q)if($===J)X.unskip_effect(G);else X.skip_effect(G);for(let[$,G]of this.#X)if($===J)X.unskip_effect(G.effect);else X.skip_effect(G.effect);X.oncommit(this.#$),X.ondiscard(this.#K)}else{if(w)this.anchor=N;this.#$(X)}}}function s6(J,Q,X=!1){var K;if(w)K=N,l();var Z=new PJ(J),W=X?w0:0;function $(G,z){if(w){var U=A7(K);if(G!==parseInt(U.substring(1))){var q=XJ();E(q),Z.anchor=q,_(!1),Z.ensure(G,z),_(!0);return}}Z.ensure(G,z)}S0(()=>{var G=!1;if(Q((z,U=0)=>{G=!0,$(U,z)}),!G)$(-1,null)},W)}var o6=Symbol("NaN");function a6(J,Q,X){if(w)l();var K=new PJ(J),Z=!f0();S0(()=>{var W=Q();if(W!==W)W=o6;if(Z&&W!==null&&typeof W==="object")W={};K.ensure(W,X)})}function r6(J,Q,X){var K=[],Z=Q.length,W,$=Q.length;for(var G=0;G<Z;G++){let P=Q[G];QJ(P,()=>{if(W){if(W.pending.delete(P),W.done.add(P),W.pending.size===0){var H=J.outrogroups;if(P9(J,rJ(W.done)),H.delete(W),H.size===0)J.outrogroups=null}}else $-=1},!1)}if($===0){var z=K.length===0&&X!==null;if(z){var U=X,q=U.parentNode;M7(q),q.append(U),J.items.clear()}P9(J,Q,!z)}else W={pending:new Set(Q),done:new Set},(J.outrogroups??=new Set).add(W)}function P9(J,Q,X=!0){var K;if(J.pending.size>0){K=new Set;for(let $ of J.pending.values())for(let G of $)K.add(J.items.get(G).e)}for(var Z=0;Z<Q.length;Z++){var W=Q[Z];if(K?.has(W)){W.f|=v0;let $=document.createDocumentFragment();eJ(W,$)}else m(Q[Z],X)}}var BQ;function n6(J,Q,X,K,Z,W=null){var $=J,G=new Map,z=(Q&N8)!==0;if(z){var U=J;$=w?E(u(U)):U.appendChild(a())}if(w)l();var q=null,P=yJ(()=>{var T=X();return zJ(T)?T:T==null?[]:rJ(T)});if(B)G0(P,"{#each ...}");var H,Y=new Map,V=!0;function F(T){if((j.effect.f&g)!==0)return;if(j.pending.delete(T),j.fallback=q,t6(j,H,$,Q,K),q!==null)if(H.length===0)if((q.f&v0)===0)W7(q);else q.f^=v0,D7(q,null,$);else QJ(q,()=>{q=null})}function M(T){j.pending.delete(T)}var O=S0(()=>{H=I(P);var T=H.length;let R=!1;if(w){var b0=A7($)===MJ;if(b0!==(T===0))$=XJ(),E($),_(!1),R=!0}var H0=new Set,D0=A,lJ=K8();for(var i0=0;i0<T;i0+=1){if(w&&N.nodeType===C0&&N.data===TJ)$=N,R=!0,_(!1);var m0=H[i0],cJ=K(m0,i0);if(B){var b9=K(m0,i0);if(cJ!==b9)q4(String(i0),String(cJ),String(b9))}var $J=V?null:G.get(cJ);if($J){if($J.v)d0($J.v,m0);if($J.i)d0($J.i,i0);if(lJ)D0.unskip_effect($J.e)}else{if($J=e6(G,V?$:BQ??=a(),m0,cJ,i0,Z,Q,X),!V)$J.e.f|=v0;G.set(cJ,$J)}H0.add(cJ)}if(T===0&&W&&!q)if(V)q=o(()=>W($));else q=o(()=>W(BQ??=a())),q.f|=v0;if(T>H0.size)if(B)J1(H,K);else I8("","","");if(w&&T>0)E(XJ());if(!V)if(Y.set(D0,H0),lJ){for(let[Y6,B6]of G)if(!H0.has(Y6))D0.skip_effect(B6.e);D0.oncommit(F),D0.ondiscard(M)}else F(D0);if(R)_(!0);I(P)}),j={effect:O,flags:Q,items:G,pending:Y,outrogroups:null,fallback:q};if(V=!1,w)$=N}function N7(J){while(J!==null&&(J.f&c)===0)J=J.next;return J}function t6(J,Q,X,K,Z){var W=(K&u9)!==0,$=Q.length,G=J.items,z=N7(J.effect.first),U,q=null,P,H=[],Y=[],V,F,M,O;if(W){for(O=0;O<$;O+=1)if(V=Q[O],F=Z(V,O),M=G.get(F).e,(M.f&v0)===0)M.nodes?.a?.measure(),(P??=new Set).add(M)}for(O=0;O<$;O+=1){if(V=Q[O],F=Z(V,O),M=G.get(F).e,J.outrogroups!==null)for(let m0 of J.outrogroups)m0.pending.delete(M),m0.done.delete(M);if((M.f&d)!==0){if(W7(M),W)M.nodes?.a?.unfix(),(P??=new Set).delete(M)}if((M.f&v0)!==0)if(M.f^=v0,M===z)D7(M,null,X);else{var j=q?q.next:z;if(M===J.effect.last)J.effect.last=M.prev;if(M.prev)M.prev.next=M.next;if(M.next)M.next.prev=M.prev;jJ(J,q,M),jJ(J,M,j),D7(M,j,X),q=M,H=[],Y=[],z=N7(q.next);continue}if(M!==z){if(U!==void 0&&U.has(M)){if(H.length<Y.length){var T=Y[0],R;q=T.prev;var b0=H[0],H0=H[H.length-1];for(R=0;R<H.length;R+=1)D7(H[R],T,X);for(R=0;R<Y.length;R+=1)U.delete(Y[R]);jJ(J,b0.prev,H0.next),jJ(J,q,b0),jJ(J,H0,T),z=T,q=H0,O-=1,H=[],Y=[]}else U.delete(M),D7(M,z,X),jJ(J,M.prev,M.next),jJ(J,M,q===null?J.effect.first:q.next),jJ(J,q,M),q=M;continue}H=[],Y=[];while(z!==null&&z!==M)(U??=new Set).add(z),Y.push(z),z=N7(z.next);if(z===null)continue}if((M.f&v0)===0)H.push(M);q=M,z=N7(M.next)}if(J.outrogroups!==null){for(let m0 of J.outrogroups)if(m0.pending.size===0)P9(J,rJ(m0.done)),J.outrogroups?.delete(m0);if(J.outrogroups.size===0)J.outrogroups=null}if(z!==null||U!==void 0){var D0=[];if(U!==void 0){for(M of U)if((M.f&d)===0)D0.push(M)}while(z!==null){if((z.f&d)===0&&z!==J.fallback)D0.push(z);z=N7(z.next)}var lJ=D0.length;if(lJ>0){var i0=(K&N8)!==0&&$===0?X:null;if(W){for(O=0;O<lJ;O+=1)D0[O].nodes?.a?.measure();for(O=0;O<lJ;O+=1)D0[O].nodes?.a?.fix()}r6(J,D0,i0)}}if(W)s(()=>{if(P===void 0)return;for(M of P)M.nodes?.a?.apply()})}function e6(J,Q,X,K,Z,W,$,G){var z=($&m9)!==0?($&f9)===0?mJ(X,!1,!1):q0(X):null,U=($&v9)!==0?q0(Z):null;if(B&&z)z.trace=()=>{G()[U?.v??Z]};return{v:z,i:U,e:o(()=>{return W(Q,z??X,U??Z,G),()=>{J.delete(K)}})}}function D7(J,Q,X){if(!J.nodes)return;var K=J.nodes.start,Z=J.nodes.end,W=Q&&(Q.f&v0)===0?Q.nodes.start:X;while(K!==null){var $=r(K);if(W.before(K),K===Z)return;K=$}}function jJ(J,Q,X){if(Q===null)J.effect.first=X;else Q.next=X;if(X===null)J.effect.last=Q;else X.prev=Q}function J1(J,Q){let X=new Map,K=J.length;for(let Z=0;Z<K;Z++){let W=Q(J[Z],Z);if(X.has(W)){let $=String(X.get(W)),G=String(Z),z=String(W);if(z.startsWith("[object "))z=null;I8($,G,z)}X.set(W,Z)}}function Q1(J,Q,X){if(!Q||Q===zQ(String(X??"")))return;let K,Z=J.__svelte_meta?.loc;if(Z)K=`near ${Z.file}:${Z.line}:${Z.column}`;else if(I0?.[O0])K=`in ${I0[O0]}`;e9($8(K))}function X1(J,Q,X=!1,K=!1,Z=!1,W=!1){var $=J,G="";if(X){var z=J;if(w)$=E(u(z))}e8(()=>{var U=L;if(G===(G=Q()??"")){if(w)l();return}if(X&&!w){if(U.nodes=null,z.innerHTML=G,G!=="")N0(u(z),z.lastChild);return}if(U.nodes!==null)Q9(U.nodes.start,U.nodes.end),U.nodes=null;if(G==="")return;if(w){var q=N.data,P=l(),H=P;while(P!==null&&(P.nodeType!==C0||P.data!==""))H=P,P=r(P);if(P===null)throw FJ(),a0;if(B&&!W)Q1(P.parentNode,q,G);N0(N,H),$=E(P);return}var Y=K?P7:Z?j8:void 0,V=c0(K?"svg":Z?"math":"template",Y);V.innerHTML=G;var F=K||Z?V:V.content;if(N0(u(F),F.lastChild),K||Z)while(u(F))$.before(u(F));else $.before(F)})}function K1(J,Q,X,K,Z){if(w)l();var W=Q.$$slots?.[X],$=!1;if(W===!0)W=Q[X==="default"?"children":X],$=!0;if(W===void 0){if(Z!==null)Z(J)}else W(J,$?()=>K:K)}function z1(J,Q){F0(()=>{var X=J.getRootNode(),K=X.host?X:X.head??X.ownerDocument.head;if(!K.querySelector("#"+Q.hash)){let Z=c0("style");if(Z.id=Q.hash,Z.textContent=Q.code,K.appendChild(Z),B)PQ(Q.hash,Z)}})}function q1(J,Q,X){F0(()=>{var K=h(()=>Q(J,X?.())||{});if(X&&K?.update){var Z=!1,W={};e(()=>{var $=X();if(J8($),Z&&f7(W,$))W=$,K.update($)}),Z=!0}if(K?.destroy)return()=>K.destroy()})}var VQ=[...`
|
|
50
|
-
\r\f \v\uFEFF`];function FQ(J,Q,X){var K=J==null?"":""+J;if(Q)K=K?K+" "+Q:Q;if(X){for(var Z of Object.keys(X))if(X[Z])K=K?K+" "+Z:Z;else if(K.length){var W=Z.length,$=0;while(($=K.indexOf(Z,$))>=0){var G=$+W;if(($===0||VQ.includes(K[$-1]))&&(G===K.length||VQ.includes(K[G])))K=($===0?"":K.substring(0,$))+K.substring(G+1);else $=G}}}return K===""?null:K}function MQ(J,Q=!1){var X=Q?" !important;":";",K="";for(var Z of Object.keys(J)){var W=J[Z];if(W!=null&&W!=="")K+=" "+Z+": "+W+X}return K}function Y9(J){if(J[0]!=="-"||J[1]!=="-")return J.toLowerCase();return J}function LQ(J,Q){if(Q){var X="",K,Z;if(Array.isArray(Q))K=Q[0],Z=Q[1];else K=Q;if(J){J=String(J).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var W=!1,$=0,G=!1,z=[];if(K)z.push(...Object.keys(K).map(Y9));if(Z)z.push(...Object.keys(Z).map(Y9));var U=0,q=-1;let F=J.length;for(var P=0;P<F;P++){var H=J[P];if(G){if(H==="/"&&J[P-1]==="*")G=!1}else if(W){if(W===H)W=!1}else if(H==="/"&&J[P+1]==="*")G=!0;else if(H==='"'||H==="'")W=H;else if(H==="(")$++;else if(H===")")$--;if(!G&&W===!1&&$===0){if(H===":"&&q===-1)q=P;else if(H===";"||P===F-1){if(q!==-1){var Y=Y9(J.substring(U,q).trim());if(!z.includes(Y)){if(H!==";")P++;var V=J.substring(U,P).trim();X+=" "+V+";"}}U=P+1,q=-1}}}}if(K)X+=MQ(K);if(Z)X+=MQ(Z,!0);return X=X.trim(),X===""?null:X}return J==null?null:String(J)}function wQ(J,Q,X,K,Z,W){var $=J[q7];if(w||$!==X||$===void 0){var G=FQ(X,K,W);if(!w||G!==J.getAttribute("class"))if(G==null)J.removeAttribute("class");else if(Q)J.className=G;else J.setAttribute("class",G);J[q7]=X}else if(W&&Z!==W)for(var z in W){var U=!!W[z];if(Z==null||U!==!!Z[z])J.classList.toggle(z,U)}return W}function B9(J,Q={},X,K){for(var Z in X){var W=X[Z];if(Q[Z]!==W)if(X[Z]==null)J.style.removeProperty(Z);else J.style.setProperty(Z,W,K)}}function OQ(J,Q,X,K){var Z=J[U7];if(w||Z!==Q){var W=LQ(Q,K);if(!w||W!==J.getAttribute("style"))if(W==null)J.removeAttribute("style");else J.style.cssText=W;J[U7]=Q}else if(K)if(Array.isArray(K))B9(J,X?.[0],K[0]),B9(J,X?.[1],K[1],"important");else B9(J,X,K);return K}var L1=Symbol("class"),w1=Symbol("style"),O1=Symbol("is custom element"),S1=Symbol("is html"),A1=A8?"link":"LINK";function NQ(J,Q,X,K){var Z=D1(J);if(w){if(Z[Q]=J.getAttribute(Q),Q==="src"||Q==="srcset"||Q==="href"&&J.nodeName===A1){if(!K)j1(J,Q,X??"");return}}if(Z[Q]===(Z[Q]=X))return;if(Q==="loading")J[g9]=X;if(X==null)J.removeAttribute(Q);else if(typeof X!=="string"&&DQ(J).includes(Q))J[Q]=X;else J.setAttribute(Q,X)}function N1(J,Q,X){var K=S,Z=L;let W=w;if(w)_(!1);f(null),p(null);try{if(Q!=="style"&&(V9.has(J.getAttribute("is")||J.nodeName)||!customElements||customElements.get(J.getAttribute("is")||J.nodeName.toLowerCase())?DQ(J).includes(Q):X&&typeof X==="object"))J[Q]=X;else NQ(J,Q,X==null?X:String(X))}finally{if(f(K),p(Z),W)_(!0)}}function D1(J){return J[x7]??={[O1]:J.nodeName.includes("-"),[S1]:J.namespaceURI===k7}}var V9=new Map;function DQ(J){var Q=J.getAttribute("is")||J.nodeName,X=V9.get(Q);if(X)return X;V9.set(Q,X=[]);var K,Z=J,W=Element.prototype;while(W!==Z){K=y7(Z);for(var $ in K)if(K[$].set&&$!=="innerHTML"&&$!=="textContent"&&$!=="innerText")X.push($);Z=EJ(Z)}return X}function j1(J,Q,X){if(!B)return;if(Q==="srcset"&&R1(J,X))return;if(M9(J.getAttribute(Q)??"",X))return;t9(Q,J.outerHTML.replace(J.innerHTML,J.innerHTML&&"..."),String(X))}function M9(J,Q){if(J===Q)return!0;return new URL(J,document.baseURI).href===new URL(Q,document.baseURI).href}function SQ(J){return J.split(",").map((Q)=>Q.trim().split(" ").filter(Boolean))}function R1(J,Q){var X=SQ(J.srcset),K=SQ(Q);return K.length===X.length&&K.every(([Z,W],$)=>W===X[$][1]&&(M9(X[$][0],Z)||M9(Z,X[$][0])))}class jQ{#J=new WeakMap;#Q;#X;static entries=new WeakMap;constructor(J){this.#X=J}observe(J,Q){var X=this.#J.get(J)||new Set;return X.add(Q),this.#J.set(J,X),this.#G().observe(J,this.#X),()=>{var K=this.#J.get(J);if(K.delete(Q),K.size===0)this.#J.delete(J),this.#Q.unobserve(J)}}#G(){return this.#Q??(this.#Q=new ResizeObserver((J)=>{for(var Q of J){jQ.entries.set(Q.target,Q);for(var X of this.#J.get(Q.target)||[])X(Q)}}))}}function F9(J,Q){return J===Q||J?.[i]===Q}function C1(J={},Q,X,K){var Z=D.r,W=L;return F0(()=>{var $,G;return e(()=>{$=G,G=K?.()||[],h(()=>{if(!F9(X(...G),J)){if(Q(J,...G),$&&F9(X(...$),J))Q(null,...$)}})}),()=>{let z=W;while(z!==Z&&z.parent!==null&&z.parent.f&sJ)z=z.parent;let U=()=>{if(G&&F9(X(...G),J))Q(null,...G)},q=z.teardown;z.teardown=()=>{U(),q?.()}}}),J}function I1(J,Q,X,K){var Z=!wJ||(X&_9)!==0,W=(X&l9)!==0,$=(X&c9)!==0,G=K,z=!0,U=void 0,q=()=>{if($&&Z)return U??=SJ(K),I(U);if(z)z=!1,G=$?h(K):K;return G};let P;if(W){var H=i in J||z7 in J;P=B0(J,Q)?.set??(H&&Q in J?(R)=>J[Q]=R:void 0)}var Y,V=!1;if(W)[Y,V]=l8(()=>J[Q]);else Y=J[Q];if(Y===void 0&&K!==void 0){if(Y=q(),P){if(Z)V4(Q);P(Y)}}var F;if(Z)F=()=>{var R=J[Q];if(R===void 0)return q();return z=!0,R};else F=()=>{var R=J[Q];if(R!==void 0)G=void 0;return R===void 0?G:R};if(Z&&(X&d9)===0)return F;if(P){var M=J.$$legacy;return function(R,b0){if(arguments.length>0){if(!Z||!b0||M||V)P(b0?F():R);return R}return F()}}var O=!1,j=((X&p9)!==0?SJ:yJ)(()=>{return O=!1,F()});if(B)j.label=Q;if(W)I(j);var T=L;return function(R,b0){if(arguments.length>0){let H0=b0?I(j):Z&&W?HJ(R):R;if(U0(j,H0),O=!0,G!==void 0)G=H0;return R}if(T0&&O||(T.f&g)!==0)return j.v;return I(j)}}function RQ(J){return new CQ(J)}class CQ{#J;#Q;constructor(J){var Q=new Map,X=(Z,W)=>{var $=mJ(W,!1,!1);return Q.set(Z,$),$};let K=new Proxy({...J.props||{},$$events:{}},{get(Z,W){return I(Q.get(W)??X(W,Reflect.get(Z,W)))},has(Z,W){if(W===z7)return!0;return I(Q.get(W)??X(W,Reflect.get(Z,W))),Reflect.has(Z,W)},set(Z,W,$){return U0(Q.get(W)??X(W,$),$),Reflect.set(Z,W,$)}});if(this.#Q=(J.hydrate?U9:z8)(J.component,{target:J.target,anchor:J.anchor,props:K,context:J.context,intro:J.intro??!1,recover:J.recover,transformError:J.transformError}),!t&&(!J?.props?.$$host||J.sync===!1))Z7();this.#J=K.$$events;for(let Z of Object.keys(this.#Q)){if(Z==="$set"||Z==="$destroy"||Z==="$on")continue;n(this,Z,{get(){return this.#Q[Z]},set(W){this.#Q[Z]=W},enumerable:!0})}this.#Q.$set=(Z)=>{Object.assign(K,Z)},this.#Q.$destroy=()=>{H9(this.#Q)}}$set(J){this.#Q.$set(J)}$on(J,Q){this.#J[J]=this.#J[J]||[];let X=(...K)=>Q.call(this,...K);return this.#J[J].push(X),()=>{this.#J[J]=this.#J[J].filter((K)=>K!==X)}}$destroy(){this.#Q.$destroy()}}var IQ;if(typeof HTMLElement==="function")IQ=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(J,Q,X){super();if(this.$$ctor=J,this.$$s=Q,X)this.$$shadowRoot=this.attachShadow(X)}addEventListener(J,Q,X){if(this.$$l[J]=this.$$l[J]||[],this.$$l[J].push(Q),this.$$c){let K=this.$$c.$on(J,Q);this.$$l_u.set(Q,K)}super.addEventListener(J,Q,X)}removeEventListener(J,Q,X){if(super.removeEventListener(J,Q,X),this.$$c){let K=this.$$l_u.get(Q);if(K)K(),this.$$l_u.delete(Q)}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let J=function(K){return(Z)=>{let W=c0("slot");if(K!=="default")W.name=K;G9(Z,W)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let Q={},X=g1(this);for(let K of this.$$s)if(K in X)if(K==="default"&&!this.$$d.children)this.$$d.children=J(K),Q.default=!0;else Q[K]=J(K);for(let K of this.attributes){let Z=this.$$g_p(K.name);if(!(Z in this.$$d))this.$$d[Z]=U8(Z,K.value,this.$$p_d,"toProp")}for(let K in this.$$p_d)if(!(K in this.$$d)&&this[K]!==void 0)this.$$d[K]=this[K],delete this[K];this.$$c=RQ({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:Q,$$host:this}}),this.$$me=t8(()=>{e(()=>{this.$$r=!0;for(let K of Y7(this.$$c)){if(!this.$$p_d[K]?.reflect)continue;this.$$d[K]=this.$$c[K];let Z=U8(K,this.$$d[K],this.$$p_d,"toAttribute");if(Z==null)this.removeAttribute(this.$$p_d[K].attribute||K);else this.setAttribute(this.$$p_d[K].attribute||K,Z)}this.$$r=!1})});for(let K in this.$$l)for(let Z of this.$$l[K]){let W=this.$$c.$on(K,Z);this.$$l_u.set(Z,W)}this.$$l={}}}attributeChangedCallback(J,Q,X){if(this.$$r)return;J=this.$$g_p(J),this.$$d[J]=U8(J,X,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 Y7(this.$$p_d).find((Q)=>this.$$p_d[Q].attribute===J||!this.$$p_d[Q].attribute&&Q.toLowerCase()===J)||J}};function U8(J,Q,X,K){let Z=X[J]?.type;if(Q=Z==="Boolean"&&typeof Q!=="boolean"?Q!=null:Q,!K||!X[J])return Q;else if(K==="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((X)=>{Q[X.slot||"default"]=!0}),Q}function m1(J,Q,X,K,Z,W){let $=class extends IQ{constructor(){super(J,X,Z);this.$$p_d=Q}static get observedAttributes(){return Y7(Q).map((G)=>(Q[G].attribute||G).toLowerCase())}};if(Y7(Q).forEach((G)=>{n($.prototype,G,{get(){return this.$$c&&G in this.$$c?this.$$c[G]:this.$$d[G]},set(z){z=U8(G,z,Q),this.$$d[G]=z;var U=this.$$c;if(U){var q=B0(U,G)?.get;if(q)U[G]=z;else U.$set({[G]:z})}}})}),K.forEach((G)=>{n($.prototype,G,{get(){return this.$$c?.[G]}})}),W)$=W($);return J.element=$,$}if(B){let J=function(Q){if(!(Q in globalThis)){let X;Object.defineProperty(globalThis,Q,{configurable:!0,get:()=>{if(X!==void 0)return X;M4(Q)},set:(K)=>{X=K}})}};J("$state"),J("$effect"),J("$derived"),J("$inspect"),J("$props"),J("$bindable")}import{createContext as H8}from"@pie-players/pie-context";var TQ=H8(Symbol.for("pie.assessmentToolkit.runtimeContext")),EQ=H8(Symbol.for("pie.assessmentToolkit.hostRuntimeContext")),xQ=H8(Symbol.for("pie.assessmentToolkit.shellContext")),v1=H8(Symbol.for("pie.assessmentToolkit.regionScopeContext"));import{ContextConsumer as u1}from"@pie-players/pie-context";function w9(J,Q,X){let K=!1,Z=new u1(J,{context:Q,subscribe:!0,onValue:(U)=>{K=!0,X(U)}});Z.connect();let W=(U)=>{if(U.context!==Q)return;Z.requestValue()};J.addEventListener("context-provider",W);let $=0,G=200,z=globalThis.setInterval(()=>{if(K||$>=G){globalThis.clearInterval(z);return}$+=1,Z.requestValue()},50);return()=>{globalThis.clearInterval(z),J.removeEventListener("context-provider",W),Z.disconnect()}}function iB(J,Q){return w9(J,TQ,Q)}function sB(J,Q){return w9(J,EQ,Q)}function oB(J,Q){return w9(J,xQ,Q)}var j7={assessment:[],section:[],item:[],passage:[],rubric:[],element:[]};var O9={section:[...j7.section],item:[...j7.item],passage:[...j7.passage]};function pJ(J){return typeof J==="object"&&J!==null&&!Array.isArray(J)}function RJ(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((K)=>typeof K!=="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(!pJ(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(!pJ(J))throw Error('Invalid tools config at "policy": expected an object with allowed/blocked arrays.');return J}function _1(J,Q){if(Q==null)return;if(!pJ(Q))throw Error(`Invalid tools config at "providers.${J}": expected an object.`);let X=Q,K=(Z)=>Z==="polly"||Z==="google"||Z==="custom";if("enabled"in X&&X.enabled!==void 0&&typeof X.enabled!=="boolean")throw Error(`Invalid tools config at "providers.${J}.enabled": expected a boolean.`);if("settings"in X&&X.settings!==void 0&&!pJ(X.settings))throw Error(`Invalid tools config at "providers.${J}.settings": expected an object.`);if("provider"in X&&X.provider!==void 0&&!pJ(X.provider)&&!(J==="textToSpeech"&&K(X.provider)))throw Error(`Invalid tools config at "providers.${J}.provider": expected an object.`);return X}function d1(J){if(J==null)return{};if(!pJ(J))throw Error('Invalid tools config at "providers": expected an object keyed by tool id.');let Q={};for(let[X,K]of Object.entries(J))Q[X]=_1(X,K);return Q}function S9(J){let Q=J.trim();if(!Q)return"";return Q}function YJ(J){if(!J||J.length===0)return[];let Q=new Set;for(let X of J){if(typeof X!=="string")throw Error("Invalid tools config: tool list entries must be strings.");let K=S9(X);if(!K)continue;Q.add(K)}return Array.from(Q)}function tB(J){if(!J)return[];return YJ(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 eB(J){if(J!=null&&!pJ(J))throw Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');let Q=p1(J?.policy),X=f1(J?.placement),K=d1(J?.providers),Z=l1(J?.pnpEnforcement,"pnpEnforcement"),W={policy:{allowed:YJ(RJ(Q?.allowed,"policy.allowed")),blocked:YJ(RJ(Q?.blocked,"policy.blocked"))},placement:{section:YJ(RJ(X?.section,"placement.section")).length?YJ(RJ(X?.section,"placement.section")):[...O9.section],item:YJ(RJ(X?.item,"placement.item")).length?YJ(RJ(X?.item,"placement.item")):[...O9.item],passage:YJ(RJ(X?.passage,"placement.passage")).length?YJ(RJ(X?.passage,"placement.passage")):[...O9.passage]},providers:K};if(Z)W.pnpEnforcement=Z;return W}var c1=["assessment","section","item","passage","rubric"],i1=new Set(c1);function kQ(J){return i1.has(J)}function G7(J,Q,X){let K=J.trim(),Z=X.trim();if(!K||!Z)throw Error("Tool instance ids require non-empty tool and scope ids");if(!kQ(Q))throw Error(`Unknown tool scope level '${Q}'. Register custom levels with registerToolScopeLevel().`);return`${K}:${Q}:${Z}`}function QV(J){let Q=J.split(":");if(Q.length!==3)return null;let[X,K,Z]=Q;if(!X||!Z)return null;if(!kQ(K))return null;return{baseToolId:X,scopeLevel:K,scopeId:Z}}var s1=["assessment","section","item","passage","rubric","element"];function P8(J,Q){if(typeof J!=="string"||J.trim().length===0)throw Error(`Invalid tool registration: "${Q}" must be a non-empty string.`)}var o1=[{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 a1(J,Q,X){let K=Q.trimStart(),Z=K.toLowerCase().startsWith("<svg"),W=/^https?:/i.test(K);if(/^data:/i.test(K))throw Error(`Invalid tool registration "${J}": "${X}" may not be a data: URL.`);if(!Z&&!W)return;for(let{pattern:G,reason:z}of o1)if(G.test(Q))throw Error(`Invalid tool registration "${J}": "${X}" ${z}. Inline SVG icons must not include scriptable content.`)}function bQ(J){if(P8(J.toolId,"toolId"),P8(J.name,"name"),P8(J.description,"description"),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")a1(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 Q=J.supportedLevels.find((X)=>!s1.includes(X));if(Q)throw Error(`Invalid tool registration "${J.toolId}": unsupported level "${Q}".`);if(J.activation!==void 0&&J.activation!=="toolbar-toggle"&&J.activation!=="selection-gateway")throw Error(`Invalid tool registration "${J.toolId}": unsupported activation "${String(J.activation)}".`);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(typeof J.isVisibleInContext!=="function")throw Error(`Invalid tool registration "${J.toolId}": "isVisibleInContext" must be a function.`);if(typeof J.renderToolbar!=="function")throw Error(`Invalid tool registration "${J.toolId}": "renderToolbar" must be a function.`)}class A9{tools=new Map;pnpIndex=new Map;componentOverrides={};moduleLoaders=new Map;loadedToolModules=new Set;moduleLoadPromises=new Map;normalizeToolId(J){return S9(J)}normalizeToolIds(J){return J.map((Q)=>this.normalizeToolId(Q))}register(J){if(bQ(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)}}override(J){if(bQ(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 X of Q.pnpSupportIds)this.pnpIndex.get(X)?.delete(J.toolId);if(this.tools.set(J.toolId,J),J.pnpSupportIds)for(let X of J.pnpSupportIds){if(!this.pnpIndex.has(X))this.pnpIndex.set(X,new Set);this.pnpIndex.get(X).add(J.toolId)}}unregister(J){let Q=this.tools.get(J);if(!Q)return;if(Q.pnpSupportIds)for(let X of Q.pnpSupportIds)this.pnpIndex.get(X)?.delete(J);this.tools.delete(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}filterToolIdsByActivation(J,Q){return J.filter((X)=>this.getToolActivation(X)===Q)}filterVisibleInContext(J,Q){let X=[];for(let K of J){let Z=this.get(K);if(!Z){console.warn(`Tool '${K}' is allowed but not registered`);continue}if(!Z.supportedLevels.includes(Q.level))continue;try{if(Z.isVisibleInContext(Q))X.push(Z)}catch(W){console.error(`Error evaluating visibility for tool '${K}':`,W)}}return X}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}))}generatePNPSupportsFromTools(J){let Q=new Set;for(let X of J){let K=this.get(X);if(K?.pnpSupportIds)for(let Z of K.pnpSupportIds)Q.add(Z)}return Array.from(Q)}clear(){this.tools.clear(),this.pnpIndex.clear()}setComponentOverrides(J){this.componentOverrides=J}setToolModuleLoaders(J){for(let[Q,X]of Object.entries(J)){if(!X)continue;if(P8(Q,"tool module loader id"),typeof X!=="function")throw Error(`Invalid tool module loader for "${Q}": expected a function.`);this.moduleLoaders.set(Q,X)}}async ensureToolModuleLoaded(J){if(this.loadedToolModules.has(J))return;let Q=this.moduleLoadPromises.get(J);if(Q){await Q;return}let X=this.moduleLoaders.get(J);if(!X)return;let K=(async()=>{await X(),this.loadedToolModules.add(J)})();this.moduleLoadPromises.set(J,K);try{await K}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,X){let K=this.get(J);if(!K)throw Error(`Tool '${J}' is not registered`);let Z={...X,componentOverrides:{...this.componentOverrides||{},...X.componentOverrides||{}}};return K.renderToolbar(Q,Z)}}function yQ(J){return J.level==="item"}function r1(J){return J.level==="passage"}function n1(J){return J.level==="rubric"}function hQ(J){return J.level==="element"}function N9(J){if(hQ(J)){let Q=J.item.config;if(!Q)return"";let X=[],K=(z)=>z.replace(/<[^>]*>/g," ").trim(),Z=Q.elements?.[J.elementId];if(Z){if(typeof Z==="string")X.push(K(Z))}let W=Q.models,G=(Array.isArray(W)?W:W&&typeof W==="object"?Object.values(W):[]).find((z)=>z&&typeof z==="object"&&z.id===J.elementId);if(G)for(let z of Object.values(G)){if(typeof z==="string")X.push(K(z));if(Array.isArray(z)){for(let U of z)if(U&&typeof U==="object"){for(let q of Object.values(U))if(typeof q==="string")X.push(K(q))}}}return X.filter(Boolean).join(" ").trim()}if(yQ(J)){let Q=J.item;if(!Q?.config)return"";let X=Q.config,K=[],Z=(z)=>z.replace(/<[^>]*>/g," ").trim();if(typeof X.markup==="string")K.push(Z(X.markup));let W=X.elements;if(W&&typeof W==="object"){for(let z of Object.values(W))if(typeof z==="string")K.push(Z(z))}let $=X.models,G=Array.isArray($)?$:$&&typeof $==="object"?Object.values($):[];for(let z of G){if(!z||typeof z!=="object")continue;for(let U of Object.values(z)){if(typeof U==="string")K.push(Z(U));if(Array.isArray(U)){for(let q of U)if(q&&typeof q==="object"){for(let P of Object.values(q))if(typeof P==="string")K.push(Z(P))}}}}return K.filter(Boolean).join(" ").trim()}if(r1(J)){let Q=J.passage;if(!Q?.config)return"";let X=Q.config,K=[],Z=(z)=>z.replace(/<[^>]*>/g," ").trim();if(typeof X.markup==="string")K.push(Z(X.markup));if(typeof X.content==="string")K.push(Z(X.content));if(typeof X.prompt==="string")K.push(Z(X.prompt));let W=X.elements;if(W&&typeof W==="object"){for(let z of Object.values(W))if(typeof z==="string")K.push(Z(z))}let $=X.models,G=Array.isArray($)?$:$&&typeof $==="object"?Object.values($):[];for(let z of G){if(!z||typeof z!=="object")continue;for(let U of Object.values(z)){if(typeof U==="string")K.push(Z(U));if(Array.isArray(U)){for(let q of U)if(q&&typeof q==="object"){for(let P of Object.values(q))if(typeof P==="string")K.push(Z(P))}}}}return K.filter(Boolean).join(" ").trim()}if(n1(J)){let Q=J.rubricBlock;if(Q.passage?.config)return(Q.passage.config.markup||"").replace(/<[^>]*>/g," ").trim();return(Q.content||"").replace(/<[^>]*>/g," ").trim()}return""}function _J(J){let Q=N9(J);return[/<math[>\s]/i,/\\\[([^\]]+)\\\]/,/\$\$[^$]+\$\$/,/\\\(/,/[+\-*/=<>≤≥∑∫√π]/,/\d+\s*[+\-*/=]\s*\d+/].some((K)=>K.test(Q))}function gQ(J){let Q=["pie-multiple-choice","pie-inline-choice","pie-select-text","pie-ebsr","multiple-choice","inline-choice","select-text","ebsr"];if(hQ(J)){let X=J.item.config;if(!X?.models)return!1;let Z=(Array.isArray(X.models)?X.models:Object.values(X.models)).find(($)=>$&&typeof $==="object"&&$.id===J.elementId);if(!Z)return!1;let W=Z.element||"";return Q.includes(W)}if(yQ(J)){let X=J.item.config?.models;return(Array.isArray(X)?X:X&&typeof X==="object"?Object.values(X):[]).some((Z)=>{if(!Z||typeof Z!=="object")return!1;let W=Z.element||"";if(Q.includes(W))return!0;return Array.isArray(Z.choices)&&Z.choices.length>0})}return!1}function dJ(J){return N9(J).trim().length>=10}function mQ(J){let Q=N9(J);return[/chemistry|chemical|element|atom|molecule|compound/i,/periodic\s+table/i,/H₂O|CO₂|NaCl|O₂|N₂/i,/\b[A-Z][a-z]?\d*\b/,/biology|organism|cell|DNA|RNA|protein/i,/physics|force|energy|velocity|acceleration/i].some((K)=>K.test(Q))}class vQ{providers=new Map;configs=new Map;initialized=new Map;initializationPromises=new Map;async emitTelemetry(J,Q,X){try{await J.onTelemetry?.(Q,X)}catch(K){console.warn("[ToolProviderRegistry] Telemetry callback failed:",K)}}register(J,Q){if(this.providers.has(J)){console.warn(`[ToolProviderRegistry] Provider "${J}" already registered, skipping`);return}if(this.providers.set(J,Q.provider),this.configs.set(J,Q),this.initialized.set(J,!1),console.log(`[ToolProviderRegistry] Registered provider "${J}" (${Q.provider.providerName})`),Q.lazy===!1)this.initialize(J).catch((X)=>{console.error(`[ToolProviderRegistry] Failed to initialize provider "${J}":`,X)})}async initialize(J){if(this.initialized.get(J))return;let Q=this.initializationPromises.get(J);if(Q)return Q;let X=this._doInitialize(J);this.initializationPromises.set(J,X);try{await X}finally{this.initializationPromises.delete(J)}}async _doInitialize(J){let Q=this.providers.get(J),X=this.configs.get(J);if(!Q||!X)throw Error(`[ToolProviderRegistry] Provider "${J}" not registered`);let K={...X.config},Z=($)=>{if(!$||typeof $!=="object")return"unknown";let G=$;return(typeof G.backend==="string"?G.backend:typeof G.provider==="string"?G.provider:typeof G.serverProvider==="string"?G.serverProvider:typeof G.providerId==="string"?G.providerId:"")||"unknown"},W=Date.now();if(await this.emitTelemetry(X,"pie-tool-init-start",{toolId:J,providerId:J,backend:Z(K),operation:"provider-initialize"}),Q.requiresAuth&&X.authFetcher){let $=Date.now();await this.emitTelemetry(X,"pie-tool-backend-call-start",{toolId:J,providerId:J,backend:Z(K),operation:"auth-fetch"}),console.log(`[ToolProviderRegistry] Fetching auth for "${J}"...`);try{let G=await X.authFetcher();K={...K,...G},await this.emitTelemetry(X,"pie-tool-backend-call-success",{toolId:J,providerId:J,backend:Z(K),operation:"auth-fetch",duration:Date.now()-$})}catch(G){throw await this.emitTelemetry(X,"pie-tool-backend-call-error",{toolId:J,providerId:J,backend:Z(K),operation:"auth-fetch",duration:Date.now()-$,errorType:"ProviderAuthFetchError",message:G instanceof Error?G.message:String(G)}),console.error(`[ToolProviderRegistry] Auth fetch failed for "${J}":`,G),Error(`Failed to fetch auth credentials for provider "${J}"`)}}try{await Q.initialize(K),this.initialized.set(J,!0),await this.emitTelemetry(X,"pie-tool-init-success",{toolId:J,providerId:J,backend:Z(K),operation:"provider-initialize",duration:Date.now()-W}),console.log(`[ToolProviderRegistry] Provider "${J}" initialized`)}catch($){throw await this.emitTelemetry(X,"pie-tool-init-error",{toolId:J,providerId:J,backend:Z(K),operation:"provider-initialize",duration:Date.now()-W,errorType:"ProviderInitializationError",message:$ instanceof Error?$.message:String($)}),console.error(`[ToolProviderRegistry] Initialization failed for "${J}":`,$),$}}async getProvider(J,Q=!0){console.log("[ToolProviderRegistry] getProvider called",{providerId:J,autoInitialize:Q,isRegistered:this.providers.has(J),isInitialized:this.initialized.get(J),allProviderIds:Array.from(this.providers.keys())});let X=this.providers.get(J);if(!X)throw console.error("[ToolProviderRegistry] Provider not found:",{requestedId:J,availableProviders:Array.from(this.providers.keys())}),Error(`[ToolProviderRegistry] Provider "${J}" not registered`);if(Q&&!this.initialized.get(J))console.log("[ToolProviderRegistry] Auto-initializing provider:",J),await this.initialize(J);return console.log("[ToolProviderRegistry] Returning provider:",{providerId:J,providerName:X.providerName,isReady:X.isReady()}),X}getProvidersByCategory(J){return Array.from(this.providers.entries()).filter(([Q,X])=>X.category===J).map(([Q])=>Q)}getProviderIds(){return Array.from(this.providers.keys())}has(J){return this.providers.has(J)}isInitialized(J){return this.initialized.get(J)===!0}isInitializing(J){return this.initializationPromises.has(J)}async unregister(J){let Q=this.providers.get(J);if(Q){let X=this.initializationPromises.get(J);if(X)try{await X}catch{}Q.destroy(),this.providers.delete(J),this.configs.delete(J),this.initialized.delete(J),this.initializationPromises.delete(J),console.log(`[ToolProviderRegistry] Unregistered provider "${J}"`)}}async destroy(){let J=Array.from(this.providers.keys());await Promise.all(J.map((Q)=>this.unregister(Q))),console.log("[ToolProviderRegistry] Registry destroyed")}}class Y8{providerId="desmos-calculator";providerName="Desmos Calculator";category="calculator";version="1.12";requiresAuth=!0;desmosProvider=null;config=null;async emitTelemetry(J,Q){try{await this.config?.onTelemetry?.(J,Q)}catch(X){console.warn("[DesmosToolProvider] telemetry callback failed:",X)}}async initialize(J){if(this.desmosProvider){console.warn("[DesmosToolProvider] Already initialized, skipping reinitialization");return}this.config=J;let Q=Date.now();await this.emitTelemetry("pie-tool-library-load-start",{toolId:"calculator",operation:"desmos-provider-module-import",backend:"desmos"});let X=await(async()=>{try{let K=await import("@pie-players/pie-calculator-desmos");return await this.emitTelemetry("pie-tool-library-load-success",{toolId:"calculator",operation:"desmos-provider-module-import",backend:"desmos",duration:Date.now()-Q}),K}catch(K){throw await this.emitTelemetry("pie-tool-library-load-error",{toolId:"calculator",operation:"desmos-provider-module-import",backend:"desmos",duration:Date.now()-Q,errorType:"ToolLibraryLoadError",message:K instanceof Error?K.message:String(K)}),K}})();this.desmosProvider=new X.DesmosCalculatorProvider;try{await this.desmosProvider.initialize({apiKey:J.apiKey,proxyEndpoint:J.proxyEndpoint,onTelemetry:J.onTelemetry}),console.log(`[DesmosToolProvider] Initialized successfully ${J.proxyEndpoint?"(using proxy)":J.apiKey?"(direct API key)":"(no auth)"}`)}catch(K){throw console.error("[DesmosToolProvider] Initialization failed:",K),Error("Failed to initialize Desmos calculator provider. Check API key or proxy endpoint.")}}async createInstance(J){if(!this.desmosProvider)throw Error("[DesmosToolProvider] Provider not initialized. Call initialize() first.");return this.desmosProvider}getCapabilities(){return{supportsOffline:!1,requiresAuth:!0,maxInstances:null,features:{basic:!0,scientific:!0,graphing:!0,fourFunction:!0}}}isReady(){return this.desmosProvider!==null}destroy(){if(this.desmosProvider)this.desmosProvider.destroy(),this.desmosProvider=null;this.config=null,console.log("[DesmosToolProvider] Destroyed")}}var uQ=(J,Q)=>{let X=Q?.useSentenceSegmenter!==!1;try{if(!X)throw Error("Segmenter disabled by policy");let G=globalThis.Intl?.Segmenter;if(typeof G==="function"){let z=new G(Q?.locale,{granularity:"sentence"}),U=Array.from(z.segment(J)).map((q)=>({text:q.segment,offset:q.index})).filter((q)=>q.text.trim().length>0);if(U.length>0)return U}}catch{}let K=/[^.!?]+(?:[.!?]+|$)/g,Z=J.match(K)||[J],W=[],$=0;for(let G of Z){let z=J.indexOf(G,$);if(z===-1)continue;W.push({text:G,offset:z}),$=z+G.length}return W.length>0?W:[{text:J,offset:0}]};var fQ=(J)=>String(J||"").trim().toLowerCase(),t1=()=>{let J=typeof navigator<"u"?navigator.language||navigator.languages?.[0]:"";return fQ(J||"en-US")},e1=(J,Q)=>{if(Q){let $=J.find((G)=>G.name===Q);if($)return $}let X=t1(),K=X.split("-")[0]||"en",Z=($)=>{let G=fQ($.lang);return G===X||G.startsWith(`${K}-`)},W=[($)=>$.localService&&Z($),($)=>$.default&&Z($),($)=>Z($),($)=>$.localService,($)=>$.default];for(let $ of W){let G=J.find($);if(G)return G}return J[0]||null},J5=(J)=>!J.default;class D9{providerId="browser";providerName="Browser Speech Synthesis";version="1.0.0";async initialize(J){if(typeof window>"u")throw Error("BrowserTTSProvider requires browser environment");if(!("speechSynthesis"in window))throw Error("Browser does not support Speech Synthesis API");return new pQ(J)}supportsFeature(J){return!0}getCapabilities(){return{supportsPause:!0,supportsResume:!0,supportsWordBoundary:!0,supportsVoiceSelection:!0,supportsRateControl:!0,supportsPitchControl:!0,supportsSSML:!1}}destroy(){}}class pQ{utterance=null;config=null;_isPlaying=!1;_isPaused=!1;speakRunId=0;constructor(J){this.config=J}async speak(J){if(!this.config)throw Error("TTS not initialized");this.stop();let Q=this.speakRunId,X=this.splitIntoChunks(J);for(let K of X){if(Q!==this.speakRunId)break;if(!await this.speakChunk(K.text,K.offset,Q))break}}async speakSegments(J){if(!this.config)throw Error("TTS not initialized");this.stop();let Q=this.speakRunId;for(let X of J){if(Q!==this.speakRunId)break;let K=this.splitIntoChunks(X.text);for(let W of K){if(Q!==this.speakRunId)break;if(!await this.speakChunk(W.text,X.startOffset+W.offset,Q))break}let Z=Math.max(0,Number(X.pauseMsAfter||0));if(Z>0&&Q===this.speakRunId){if(!await this.waitForPause(Z,Q))break}}}async waitForPause(J,Q){return await new Promise((X)=>setTimeout(X,J)),Q===this.speakRunId}splitIntoChunks(J){if(J.length<=260)return[{text:J,offset:0}];let X=this.segmentSentences(J),K=[],Z="",W=0;for(let $ of X){let G=$.text.trim();if(!G)continue;let z=$.text.search(/\S/),U=$.offset+(z===-1?0:z);if(!Z){Z=G,W=U;continue}let q=`${Z} ${G}`;if(q.length<=260)Z=q;else K.push({text:Z,offset:W}),Z=G,W=U}if(Z)K.push({text:Z,offset:W});return K.length?K:[{text:J,offset:0}]}getHighlightMode(){return(this.config?.providerOptions||{}).highlightMode==="word"?"word":"sentence"}getSegmentationPolicy(){let J=this.config?.providerOptions||{},Q=J.segmenter||{},K=Q.mode!=="regexOnly",Z=typeof Q.locale==="string"&&Q.locale.trim().length>0?Q.locale:typeof J.locale==="string"&&J.locale.trim().length>0?J.locale:void 0;return{useSentenceSegmenter:K,useWordSegmenter:K,locale:Z}}segmentSentences(J){let Q=this.getSegmentationPolicy();return uQ(J,{locale:Q.locale,useSentenceSegmenter:Q.useSentenceSegmenter})}inferWordLength(J,Q){let X=Math.max(0,Math.min(Q,Math.max(0,J.length-1)));return J.slice(X).match(/^\s*([^\s]+)/)?.[1]?.length||1}async speakChunk(J,Q,X){return new Promise((K,Z)=>{if(X!==this.speakRunId){K(!1);return}let W=new SpeechSynthesisUtterance(J);this.utterance=W;let $=e1(speechSynthesis.getVoices(),this.config?.voice);if($&&J5($))W.voice=$;if(this.config?.rate)W.rate=this.config.rate;if(this.config?.pitch)W.pitch=this.config.pitch;let G=()=>{if(this.utterance===W)this.utterance=null};W.onstart=()=>{if(X!==this.speakRunId)return;this._isPlaying=!0,this._isPaused=!1},W.onend=()=>{if(G(),X!==this.speakRunId){K(!1);return}this._isPlaying=!1,this._isPaused=!1,K(!0)},W.onerror=(z)=>{if(G(),X!==this.speakRunId){K(!1);return}if(this._isPlaying=!1,this._isPaused=!1,z.error==="interrupted"||z.error==="canceled"){K(!1);return}Z(Error(`Speech synthesis error: ${z.error}`))},W.onpause=()=>{if(X!==this.speakRunId)return;this._isPaused=!0},W.onresume=()=>{if(X!==this.speakRunId)return;this._isPaused=!1},W.onboundary=(z)=>{if(X!==this.speakRunId)return;if(console.log("[BrowserProvider] Boundary event:",z.name,"charIndex:",z.charIndex,"charLength:",z.charLength),z.name!=="word"||!this.onWordBoundary)return;if(this.getHighlightMode()==="sentence")return;let U=Math.max(0,Math.min(z.charIndex,Math.max(0,J.length-1))),q=Number(z.charLength||0),P=this.inferWordLength(J,U),H=Number.isFinite(q)&&q>0&&q<=80&&U+q<=J.length?q:P,Y=J.substring(U,Math.min(J.length,U+H)).trim(),V=Q+U;console.log("[BrowserProvider] Calling onWordBoundary with word:",Y,"at position:",V),this.onWordBoundary(Y,V,H)},speechSynthesis.speak(W)})}pause(){if(this._isPlaying&&!this._isPaused)speechSynthesis.pause()}resume(){if(this._isPlaying&&this._isPaused)speechSynthesis.resume()}stop(){if(this.speakRunId+=1,this._isPlaying||this.utterance)speechSynthesis.cancel();this.utterance=null,this._isPlaying=!1,this._isPaused=!1}isPlaying(){return this._isPlaying&&!this._isPaused}isPaused(){return this._isPaused}updateSettings(J){if(!this.config)this.config={};if(J.rate!==void 0)this.config.rate=J.rate;if(J.pitch!==void 0)this.config.pitch=J.pitch;if(J.voice!==void 0)this.config.voice=J.voice;if(J.providerOptions!==void 0)this.config.providerOptions={...this.config.providerOptions||{},...J.providerOptions||{}}}onWordBoundary}class B8{providerId="tts-service";providerName="Text-to-Speech";category="tts";version="1.0";requiresAuth;ttsProvider=null;config=null;async emitTelemetry(J,Q){try{await this.config?.onTelemetry?.(J,Q)}catch(X){console.warn("[TTSToolProvider] telemetry callback failed:",X)}}constructor(J="browser"){this.requiresAuth=J!=="browser"}async initialize(J){if(this.ttsProvider){console.warn("[TTSToolProvider] Already initialized, skipping reinitialization");return}switch(this.config=J,J.backend){case"browser":await this._initializeBrowserTTS(J);break;case"polly":case"google":case"server":await this._initializeServerTTS(J);break;default:throw Error(`[TTSToolProvider] Unknown backend: ${J.backend}`)}console.log(`[TTSToolProvider] Initialized successfully (backend: ${J.backend})`)}async _initializeBrowserTTS(J){if(typeof window>"u"||!("speechSynthesis"in window))throw Error("[TTSToolProvider] Browser TTS not supported (Web Speech API not available)");this.ttsProvider=new D9,console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)")}async _initializeServerTTS(J){if(!J.apiEndpoint)throw Error("[TTSToolProvider] apiEndpoint required for server-based TTS backends");let Q=Date.now();await this.emitTelemetry("pie-tool-library-load-start",{toolId:"textToSpeech",operation:"server-provider-module-import",backend:J.serverProvider||J.backend});let X=await(async()=>{try{let K=await import("@pie-players/tts-client-server");return await this.emitTelemetry("pie-tool-library-load-success",{toolId:"textToSpeech",operation:"server-provider-module-import",backend:J.serverProvider||J.backend,duration:Date.now()-Q}),K}catch(K){throw await this.emitTelemetry("pie-tool-library-load-error",{toolId:"textToSpeech",operation:"server-provider-module-import",backend:J.serverProvider||J.backend,duration:Date.now()-Q,errorType:"ToolLibraryLoadError",message:K instanceof Error?K.message:String(K)}),K}})();this.ttsProvider=new X.ServerTTSProvider,console.log(`[TTSToolProvider] Server TTS initialized (provider: ${J.serverProvider||J.backend})`)}async createInstance(J){if(!this.ttsProvider)throw Error("[TTSToolProvider] Provider not initialized. Call initialize() first.");return this.ttsProvider}getCapabilities(){let J=this.config?.backend==="browser";return{supportsOffline:J,requiresAuth:!J,maxInstances:1,features:{wordBoundary:!0,pause:!0,resume:!0,rateControl:!0,pitchControl:J,voiceSelection:!0}}}isReady(){return this.ttsProvider!==null}destroy(){if(this.ttsProvider)this.ttsProvider.destroy(),this.ttsProvider=null;this.config=null,console.log("[TTSToolProvider] Destroyed")}}import{validateCustomElementTag as Q5}from"@pie-players/pie-players-shared/pie/tag-names";var j9={calculator:"pie-tool-calculator",textToSpeech:"pie-tool-text-to-speech",ruler:"pie-tool-ruler",protractor:"pie-tool-protractor",answerEliminator:"pie-tool-answer-eliminator",highlighter:"pie-tool-annotation-toolbar",lineReader:"pie-tool-line-reader",theme:"pie-tool-theme",annotationToolbar:"pie-tool-annotation-toolbar",graph:"pie-tool-graph",periodicTable:"pie-tool-periodic-table"},X5=(J,Q)=>{let X=Q?.toolTagMap?.[J]??j9[J]??J;return Q5(X,`tool component tag for "${J}"`)},K5=(J)=>document.createElement(J),L0=(J,Q,X,K)=>{let Z=X5(J,K),$=K?.toolComponentFactories?.[J]??K?.toolComponentFactory;return $?$({toolId:J,tagName:Z,context:Q,toolbarContext:X}):K5(Z)};var R9=new WeakMap;function Z5(J,Q){if(!J)return null;let X=R9.get(J),K=X?.get(Q);if(!K)return null;if(!K.isConnected)return X?.delete(Q),null;return K}function W5(J,Q,X){if(!J)return;let K=R9.get(J);if(!K)K=new Map,R9.set(J,K);K.set(Q,X)}function _Q(J){return J==="basic"||J==="scientific"?J:null}function $5(J){let Q=J.getToolRenderParams?.("calculator")??{},X=_Q(Q.calculatorType),K=Q.availableTypes,Z=Array.isArray(K)?K.map((W)=>_Q(W)).filter((W)=>W!==null):X?[X]:null;return{calculatorType:X,availableTypes:Z,displayName:X==="scientific"?"Scientific Calculator":X==="basic"?"Basic Calculator":"Calculator"}}function dQ(J,Q,X){let K=J;if(Q)K.calculatorType=Q,J.setAttribute("calculator-type",Q);else delete K.calculatorType,J.removeAttribute("calculator-type");if(X&&X.length>0)K.availableTypes=X;else delete K.availableTypes}var lQ={toolId:"calculator",name:"Calculator",description:"Multi-type calculator (basic, scientific, graphing)",icon:"calculator",provider:{getProviderId:(J)=>typeof J?.provider?.id==="string"&&J.provider.id.length>0?J.provider.id:"calculator-desmos",createProvider:()=>new Y8,getInitConfig:(J)=>J?.provider?.init??{},getAuthFetcher:(J)=>{let Q=J?.provider?.runtime?.authFetcher;if(typeof Q==="function")return Q;return async()=>{let X=await fetch("/api/tools/desmos/auth",{method:"GET",credentials:"same-origin"});if(!X.ok)throw Error(`Failed to fetch Desmos auth config (${X.status})`);return await X.json()}},lazy:!0},supportedLevels:["item"],pnpSupportIds:["calculator","graphingCalculator","basicCalculator","scientificCalculator"],isVisibleInContext(J){return _J(J)},renderToolbar(J,Q){let{calculatorType:X,availableTypes:K,displayName:Z}=$5(Q),W=G7(this.toolId,Q.scope.level,Q.scope.scopeId),$=Q.componentOverrides,G=Z5(Q.toolCoordinator,W),z=G??L0(this.toolId,J,Q,$);if(!G)W5(Q.toolCoordinator,W,z);z.setAttribute("tool-id",W),z.toolkitCoordinator=Q.toolkitCoordinator,dQ(z,X,K);let U=X===null?"Open scientific calculator":`Open ${Z.toLowerCase()}`,q=X===null?"Close scientific calculator":`Close ${Z.toLowerCase()}`,P={toolId:this.toolId,label:Z,icon:typeof this.icon==="function"?this.icon(J):this.icon,disabled:!1,ariaLabel:U,tooltip:Z,onClick:()=>Q.toggleTool(this.toolId),active:Q.isToolVisible(W)},H=P.active;if(z.visible!==P.active)z.visible=P.active;return{toolId:this.toolId,elements:[{element:z,mount:"after-buttons",shell:{title:this.name,draggable:!0,resizable:!0,closeable:!0,initialWidth:380,initialHeight:420,minWidth:380,minHeight:420,initialAlign:"bottom-right",initialMargin:16,content:{overflowY:"auto",preserveMinHeight:!0}}}],button:P,sync:()=>{let Y=Q.isToolVisible(W);if(P.active=Y,P.label=Z,P.ariaLabel=Y?q:U,P.tooltip=Y?`Close ${Z.toLowerCase()}`:Z,H!==Y)z.visible=Y,H=Y;if(z.toolkitCoordinator!==Q.toolkitCoordinator)z.toolkitCoordinator=Q.toolkitCoordinator;dQ(z,X,K)},subscribeActive:(Y)=>{if(!Q.subscribeVisibility)return()=>{};return Q.subscribeVisibility(()=>{Y(Q.isToolVisible(W))})}}}};var V8=(J)=>J.trim().replace(/\s+/g," "),DV=()=>/[\p{L}]+|\d+(?:\.\d+)?|[±√=+\-*/()²³^×÷≤≥≠≈<>|%°'′\u2062]/gu,G5=(J)=>{if(J.hidden)return!0;if(J.tagName?.toLowerCase()==="mjx-assistive-mml")return!0;if(J.getAttribute("aria-hidden")==="true")return!0;if(J.hasAttribute("inert"))return!0;let Q=J.classList;if(Q?.contains("sr-only")||Q?.contains("pie-sr-only")||Q?.contains("visually-hidden"))return!0;if(typeof window<"u"){let X=window.getComputedStyle(J);if(X.display==="none"||X.visibility==="hidden")return!0;let K=Number.parseFloat(X.width||"0"),Z=Number.parseFloat(X.height||"0"),W=Number.isFinite(K)&&Number.isFinite(Z)&&K<=1&&Z<=1,$=X.clipPath.includes("inset(50%")||X.clipPath.includes("inset(100%")||X.clip.includes("rect(0px, 0px, 0px, 0px)")||X.clip.includes("rect(0 0 0 0)");if((X.position==="absolute"||X.position==="fixed")&&W&&(X.overflow==="hidden"||$))return!0;if(X.opacity==="0"&&W)return!0}return!1},z5=(J,Q)=>{let X=J.nodeType===1?J:J.parentElement;while(X){if(G5(X))return!0;if(Q&&X===Q)break;X=X.parentElement}return!1},q5=(J,Q,X)=>{if(!J||!Q)return!1;if(/\s/.test(J)||/\s/.test(Q))return!1;let K=X?.boundarySpacingMode??"segmenterPreferred";if(K==="none")return!1;if(K==="segmenterPreferred")try{let $=globalThis.Intl?.Segmenter;if(typeof $==="function"){let G=new $(X?.locale,{granularity:"word"});if(Array.from(G.segment(`${J}${Q}`)).filter((q)=>q.isWordLike!==!1&&q.segment.trim().length>0).length>=2)return!0}}catch{}let Z=/[A-Za-z0-9]/.test(J),W=/[A-Za-z0-9]/.test(Q);return Z&&W},jV=(J,Q)=>{let X=new Map;if(typeof document>"u"||typeof document.createTreeWalker!=="function"||typeof NodeFilter>"u")return{text:"",map:X};let K=[],Z=0,W=!0,$=!1,G=null,z=null,U=document.createTreeWalker(J,NodeFilter.SHOW_TEXT),q=U.nextNode();while(q){let H=q;if(H.parentElement&&!z5(H,J)){let V=H.textContent||"",F=V.match(/\S/),M=F?F[0]:null;if(!W&&!$&&q5(z,M,Q)){if(K.push(" "),G)X.set(Z,G);Z++,$=!0}for(let O=0;O<V.length;O++){let j=V[O],T=/\s/.test(j);if(W){if(!T)W=!1,K.push(j),X.set(Z,{node:H,offset:O}),G={node:H,offset:O},Z++,$=!1,z=j}else if(T){if(!$)K.push(" "),X.set(Z,{node:H,offset:O}),G={node:H,offset:O},Z++;$=!0}else K.push(j),X.set(Z,{node:H,offset:O}),G={node:H,offset:O},Z++,$=!1,z=j}}q=U.nextNode()}let P=K.join("").trimEnd();while(X.has(P.length))X.delete(P.length);return{text:P,map:X}};var C9=null,cQ=Promise.resolve(),U5=(J)=>(J||"en").split("-")[0].toLowerCase()||"en",H5=async()=>{if(!C9)C9=import("speech-rule-engine").then((J)=>{let Q=J.default||J;if(!Q||typeof Q.toSpeech!=="function")throw Error("speech-rule-engine did not expose toSpeech");return Q});return C9},P5=(J)=>J==="en"?"clearspeak":"mathspeak",iQ=(J)=>!!J&&typeof J==="object"&&!Array.isArray(J),sQ=(J)=>typeof J==="string"&&J.trim()?J.trim():void 0,I9=(J)=>{if(!iQ(J))return;let Q=sQ(J.domain),X=sQ(J.style),K=iQ(J.engineOptions)?J.engineOptions:void 0;if(!Q&&!X&&!K)return;return{...Q?{domain:Q}:{},...X?{style:X}:{},...K?{engineOptions:K}:{}}},Y5=async(J,Q,X,K)=>{let Z=U5(Q),W=I9(K);await J.setupEngine?.({...W?.engineOptions||{},locale:Z,domain:W?.domain||P5(Z),...W?.style?{style:W.style}:{},modality:"speech",markup:X}),await J.engineReady?.()},B5=async(J)=>{let Q=cQ.then(J,J);return cQ=Q.then(()=>{return},()=>{return}),Q},oQ=async(J,Q,X,K,Z)=>B5(async()=>{return await Y5(J,X,K,Z),J.toSpeech(Q)}),V5=(J)=>J.replace(/^\s*<\?xml[^>]*\?>\s*/i,""),M5=async(J,Q,X,K)=>{try{let Z=V5(await oQ(J,Q,X,"ssml",K));return Z.includes("<speak")?Z:null}catch(Z){return console.debug("[TTSService] Math SSML generation failed; using plain",{message:Z instanceof Error?Z.message:String(Z)}),null}},IV=async(J,Q={})=>{if(!J.some((U)=>U.type==="math"))return{speechText:V8(J.map((U)=>U.type==="text"?U.text:U.fallbackText).join(" ")),usedMathSpeech:!1,usedFallback:!1};let X=null,K=!1,Z=!1,W=Q.loadSre||H5,$=[];for(let U of J){if(U.type==="text"){$.push(U.text);continue}try{if(!X)X=await W();let q=V8(await oQ(X,U.mathml,Q.language,"none",Q.mathSpeech));if(q){$.push(q),K=!0;continue}Z=!0,$.push(U.fallbackText)}catch(q){Z=!0,console.debug("[TTSService] Math speech generation failed; using visible fallback",{message:q instanceof Error?q.message:String(q)}),$.push(U.fallbackText)}}let G=V8($.join(" ")),z;if(Q.produceSsml&&X&&K&&J.length===1&&J[0].type==="math")z=await M5(X,J[0].mathml,Q.language,Q.mathSpeech)??void 0;return{speechText:G,usedMathSpeech:K,usedFallback:Z,ssml:z}};var F5=new Set(["reserved-row","expanding-row","floating-overlay","left-aligned"]),T9=(J)=>J&&typeof J==="object"?J:{},L5=(J)=>J==="polly"||J==="google"||J==="server",g0=(J,Q)=>J===void 0?Q:J,R7=(J,Q="left-aligned")=>typeof J==="string"&&F5.has(J)?J:Q,xV=Object.freeze([0.8,1.25]),aQ=Object.freeze([{rate:0.8,label:"Slow",ariaLabel:"Slow speed"},{rate:1,label:"Normal",ariaLabel:"Normal speed",default:!0},{rate:1.25,label:"Fast",ariaLabel:"Fast speed"}]);var rQ=(J)=>{if(typeof J!=="number"||!Number.isFinite(J)||J<=0)return;return Math.round(J*100)/100},nQ=(J)=>{if(typeof J!=="string")return;let Q=J.trim();return Q.length?Q:void 0},tQ=(J)=>`${J}x`,eQ=(J,Q)=>J.toLowerCase()==="normal"?"Normal speed":Q?`Speed ${J}`:`${J} speed`,w5=(J,Q,X)=>{if(!Q)return eQ(J,X);if(Q.toLowerCase().includes(J.toLowerCase()))return Q;return`${J} ${Q}`};var C7=(J)=>{let Q=Array.isArray(J)?J:[...aQ];if(Q.length===0)return[];let X=new Set,K=[];for(let $ of Q){let G=T9($),z=typeof $==="number"?rQ($):rQ(G.rate);if(z===void 0||X.has(z))continue;X.add(z);let U=z===1?"Normal":typeof $==="number"?tQ(z):tQ(z),q=typeof $==="number"?U:nQ(G.label)||U,P=typeof $==="number"?z===1?"Normal speed":eQ(q,!0):w5(q,nQ(G.ariaLabel),q===U);K.push({rate:z,label:q,ariaLabel:P,isDefault:!1,requestedDefault:G.default===!0||G.isDefault===!0})}if(!K.length)return C7(aQ);if(!X.has(1)){let $={rate:1,label:"Normal",ariaLabel:"Normal speed",isDefault:!1,requestedDefault:!1},G=K.findIndex((z)=>z.rate>1);if(G>=0)K.splice(G,0,$);else K.push($)}let Z=K.findIndex(($)=>$.requestedDefault),W=Z>=0?Z:K.findIndex(($)=>$.rate===1);return K.map(({requestedDefault:$,...G},z)=>({...G,isDefault:z===W}))};var kV=Object.freeze([0.8,1,1.25]);var O5=(J)=>{let Q={...J,layoutMode:R7(J.layoutMode)},X=J.backend||"browser";if(!L5(X))return Q;let K={...Q,apiEndpoint:g0(Q.apiEndpoint,"/api/tts"),transportMode:g0(Q.transportMode,"pie"),endpointValidationMode:g0(Q.endpointValidationMode,"voices"),validateEndpoint:g0(Q.validateEndpoint,!0),includeAuthOnAssetFetch:g0(Q.includeAuthOnAssetFetch,!1),rate:g0(Q.rate,1),language:g0(Q.language,"en-US")};if(X==="polly")return{...K,defaultVoice:g0(K.defaultVoice,"Joanna"),engine:g0(K.engine,"neural"),format:g0(K.format,"mp3"),speechMarksMode:g0(K.speechMarksMode,"word+sentence")};if(X==="google")return{...K,defaultVoice:g0(K.defaultVoice,"en-US-Wavenet-A")};return K},M8=(J)=>{let Q=T9(J),X=T9(Q.settings);return O5({...Q,...X})},F8=(J)=>J.backend||"browser",E9=(J,Q)=>{if(Q==="polly"||Q==="google")return Q;if(Q==="server")return J.serverProvider||J.provider;return J.serverProvider||J.provider},x9=(J,Q)=>J.transportMode||(Q==="custom"?"custom":"pie"),J6=(J)=>{let Q=F8(J),X=E9(J,Q),K=x9(J,X),Z=I9(J.mathSpeech);return{voice:J.defaultVoice,rate:J.rate,pitch:J.pitch,providerOptions:{...J.language?{locale:J.language}:{},...Q==="polly"&&J.engine?{engine:J.engine}:{},...Q==="polly"&&typeof J.sampleRate==="number"?{sampleRate:J.sampleRate}:{},...Q==="polly"&&J.format?{format:J.format}:{},...Q==="polly"?{speechMarkTypes:J.speechMarksMode==="word+sentence"?["word","sentence"]:["word"]}:{},...K==="custom"&&typeof J.cache==="boolean"?{cache:J.cache}:{},...K==="custom"&&J.speedRate?{speedRate:J.speedRate}:{},...K==="custom"&&J.lang_id?{lang_id:J.lang_id}:{},...Z?{mathSpeech:Z}:{}},apiEndpoint:J.apiEndpoint,provider:X,language:J.language,transportMode:K,endpointMode:J.endpointMode,endpointValidationMode:J.endpointValidationMode,includeAuthOnAssetFetch:J.includeAuthOnAssetFetch,validateEndpoint:J.validateEndpoint,...typeof J.mathTokenHighlighting==="boolean"?{mathTokenHighlighting:J.mathTokenHighlighting}:{}}},k9=(J)=>R7(J.layoutMode),Q6=(J)=>{switch(k9(J)){case"reserved-row":return{mount:"before-buttons",controlsRow:{reserveSpace:!0,expandWhenToolActive:!1},headerOverlay:{expandWhenToolActive:!1}};case"expanding-row":return{mount:"before-buttons",controlsRow:{reserveSpace:!1,expandWhenToolActive:!0},headerOverlay:{expandWhenToolActive:!1}};case"floating-overlay":return{mount:"before-buttons",controlsRow:{reserveSpace:!1,expandWhenToolActive:!1},headerOverlay:{expandWhenToolActive:!1}};case"left-aligned":default:return{mount:"before-buttons",controlsRow:{reserveSpace:!1,expandWhenToolActive:!1},headerOverlay:{expandWhenToolActive:!0}}}};var I7=new Map,S5="__pieToolElementUnmount",X6="pie-tool-active-change",K6={toolId:"textToSpeech",name:"Text to Speech",description:"Read content aloud",icon:"volume-up",provider:{getProviderId:()=>"tts",createProvider:(J)=>{let Q=M8(J);return new B8(F8(Q))},getInitConfig:(J)=>{let Q=M8(J),X=F8(Q),K=E9(Q,X),Z=x9(Q,K);return{backend:X,serverProvider:K,transportMode:Z,...J6(Q)}},getAuthFetcher:(J)=>{let Q=J?.provider?.runtime?.authFetcher;return typeof Q==="function"?Q:void 0},sanitizeConfig:(J)=>{let Q=J.settings&&typeof J.settings==="object"?{...J.settings}:void 0;if(Q&&"layoutMode"in Q)Q.layoutMode=R7(Q.layoutMode);if(Q&&"speedOptions"in Q)Q.speedOptions=C7(Q.speedOptions);let X={...J};if("layoutMode"in X)X.layoutMode=R7(X.layoutMode);if("speedOptions"in X)X.speedOptions=C7(X.speedOptions);if(Q)X.settings=Q;return X},lazy:!0},supportedLevels:["item","passage"],pnpSupportIds:["textToSpeech","readAloud","tts","speechOutput"],isVisibleInContext(J){return dJ(J)},renderToolbar(J,Q){let X=()=>M8(Q.toolkitCoordinator?.getToolConfig(this.toolId)||void 0),K=()=>{let q=X();return C7(q.speedOptions)},Z=()=>k9(X()),W=()=>Q6(X()),$=G7(this.toolId,Q.scope.level,Q.scope.scopeId),G=()=>{let q=Q.ui?.size;return q==="sm"||q==="lg"?q:"md"},z=()=>{let q=I7.get($);if(q&&typeof q.isConnected==="boolean"&&!q.isConnected)I7.delete($),q=void 0;if(!q)q=document.createElement("pie-tool-tts-inline"),q[S5]=()=>{if(I7.get($)===q)I7.delete($)},I7.set($,q);return q.setAttribute("tool-id",$),q.setAttribute("catalog-id",Q.catalogId||Q.itemId),q.setAttribute("language",Q.language||"en-US"),q.setAttribute("size",G()),q.setAttribute("layout-mode",Z()),q.speedOptions=K(),q.showSingleSpeedOption=X().showSingleSpeedOption===!0,q},U=W();return{toolId:this.toolId,button:null,elements:[{element:z(),mount:U.mount,layoutHints:{controlsRow:{reserveSpace:U.controlsRow.reserveSpace,showWhenToolActive:U.controlsRow.expandWhenToolActive},headerOverlay:{showWhenToolActive:U.headerOverlay.expandWhenToolActive}}}],subscribeActive:(q)=>{let P=z(),H=(Y)=>{let V=Y.detail;q(V?.active===!0)};return P.addEventListener(X6,H),()=>{P.removeEventListener(X6,H)}},sync:()=>{let q=z();q.setAttribute("tool-id",$),q.setAttribute("catalog-id",Q.catalogId||Q.itemId),q.setAttribute("language",Q.language||"en-US"),q.setAttribute("size",G()),q.setAttribute("layout-mode",Z()),q.speedOptions=K(),q.showSingleSpeedOption=X().showSingleSpeedOption===!0}}}};function x0(J,Q){let X=G7(J,Q.scope.level,Q.scope.scopeId);return{fullToolId:X,isActive:()=>Q.isToolVisible(X),subscribeActive:(K)=>{if(!Q.subscribeVisibility)return()=>{};return Q.subscribeVisibility(()=>{K(Q.isToolVisible(X))})}}}function k0(J){let Q=J.isActive();J.button.active=Q,J.overlay.visible=Q,J.onActiveChange?.(Q)}function T7(J,Q){J.setAttribute("data-pie-tool-surface",Q)}var Z6={toolId:"ruler",name:"Ruler",description:"On-screen ruler for measurements",icon:"ruler",supportedLevels:["section","item","element"],pnpSupportIds:["ruler","measurement"],isVisibleInContext(J){return _J(J)},renderToolbar(J,Q){let X=x0(this.toolId,Q),K={toolId:this.toolId,label:this.name,icon:typeof this.icon==="function"?this.icon(J):this.icon,disabled:!1,ariaLabel:"Open ruler tool",tooltip:"Ruler",onClick:()=>Q.toggleTool(this.toolId),active:X.isActive()},Z=Q.componentOverrides??{},W=L0(this.toolId,J,Q,Z);return W.setAttribute("tool-id",X.fullToolId),T7(W,"frameless"),{toolId:this.toolId,button:K,elements:[{element:W,mount:"after-buttons"}],sync:()=>{if(k0({button:K,overlay:W,isActive:X.isActive}),Q.toolkitCoordinator)W.toolkitCoordinator=Q.toolkitCoordinator},subscribeActive:X.subscribeActive}}},W6={toolId:"protractor",name:"Protractor",description:"On-screen protractor for angle measurements",icon:"protractor",supportedLevels:["section","item","element"],pnpSupportIds:["protractor","angleMeasurement"],isVisibleInContext(J){return _J(J)},renderToolbar(J,Q){let X=x0(this.toolId,Q),K={toolId:this.toolId,label:this.name,icon:typeof this.icon==="function"?this.icon(J):this.icon,disabled:!1,ariaLabel:"Open protractor tool",tooltip:"Protractor",onClick:()=>Q.toggleTool(this.toolId),active:X.isActive()},Z=Q.componentOverrides??{},W=L0(this.toolId,J,Q,Z);return W.setAttribute("tool-id",X.fullToolId),T7(W,"frameless"),{toolId:this.toolId,button:K,elements:[{element:W,mount:"after-buttons"}],sync:()=>{if(k0({button:K,overlay:W,isActive:X.isActive}),Q.toolkitCoordinator)W.toolkitCoordinator=Q.toolkitCoordinator},subscribeActive:X.subscribeActive}}};var $6={toolId:"answerEliminator",name:"Answer Eliminator",description:"Strike through answer choices",icon:"strikethrough",supportedLevels:["item"],pnpSupportIds:["answerMasking","answerEliminator","strikethrough","choiceMasking"],isVisibleInContext(J){return gQ(J)},renderToolbar(J,Q){let X=x0(this.toolId,Q),K=Q.componentOverrides??{},Z=L0(this.toolId,J,Q,K);Z.setAttribute("tool-id",X.fullToolId),Z.setAttribute("strategy","strikethrough"),Z.setAttribute("button-alignment","inline");let W={toolId:this.toolId,label:this.name,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="currentColor" aria-hidden="true"><path d="M19,3H16.3H7.7H5A2,2 0 0,0 3,5V7.7V16.4V19A2,2 0 0,0 5,21H7.7H16.4H19A2,2 0 0,0 21,19V16.3V7.7V5A2,2 0 0,0 19,3M15.6,17L12,13.4L8.4,17L7,15.6L10.6,12L7,8.4L8.4,7L12,10.6L15.6,7L17,8.4L13.4,12L17,15.6L15.6,17Z"/></svg>',disabled:!1,ariaLabel:"Answer eliminator - Strike through choices",tooltip:"Strike Through",onClick:()=>Q.toggleTool(this.toolId),active:X.isActive()};return{toolId:this.toolId,button:W,elements:[{element:Z,mount:"after-buttons"}],sync:()=>{if(k0({button:W,overlay:Z,isActive:X.isActive}),Q.toolCoordinator)Z.coordinator=Q.toolCoordinator;if(Z.scopeElement=Q.getScopeElement?.()||null,Q.elementToolStateStore)Z.elementToolStateStore=Q.elementToolStateStore;let $=Q.getGlobalElementId?.();if($)Z.globalElementId=$},subscribeActive:X.subscribeActive}}},G6={toolId:"highlighter",name:"Highlighter",description:"Highlight text",icon:"highlighter",activation:"toolbar-toggle",supportedLevels:["passage","rubric","item","element"],pnpSupportIds:["highlighter","textHighlight","annotation"],isVisibleInContext(J){return dJ(J)},renderToolbar(J,Q){let X=x0(this.toolId,Q),K={toolId:this.toolId,label:this.name,icon:typeof this.icon==="function"?this.icon(J):this.icon,disabled:!1,ariaLabel:"Highlighter - Highlight text",tooltip:"Highlight",onClick:()=>Q.toggleTool(this.toolId),active:X.isActive()},Z=Q.componentOverrides??{},W=L0(this.toolId,J,Q,Z);return W.setAttribute("tool-id",X.fullToolId),{toolId:this.toolId,button:K,elements:[{element:W,mount:"after-buttons"}],sync:()=>{if(k0({button:K,overlay:W,isActive:X.isActive,onActiveChange:($)=>{W.enabled=$}}),Q.ttsService)W.ttsService=Q.ttsService},subscribeActive:X.subscribeActive}}};var z6={toolId:"lineReader",name:"Line Reader",description:"Reading guide overlay",icon:"bars-3",supportedLevels:["section","passage","rubric","item"],pnpSupportIds:["readingMask","readingGuide","readingRuler","lineReader","trackingGuide"],isVisibleInContext(J){return dJ(J)},renderToolbar(J,Q){let X=x0(this.toolId,Q),K={toolId:this.toolId,label:this.name,icon:typeof this.icon==="function"?this.icon(J):this.icon,disabled:!1,ariaLabel:"Line reader - Reading guide",tooltip:"Line Reader",onClick:()=>Q.toggleTool(this.toolId),active:X.isActive()},Z=Q.componentOverrides??{},W=L0(this.toolId,J,Q,Z);return W.setAttribute("tool-id",X.fullToolId),T7(W,"frameless"),{toolId:this.toolId,button:K,elements:[{element:W,mount:"after-buttons"}],sync:()=>{if(k0({button:K,overlay:W,isActive:X.isActive}),Q.toolkitCoordinator)W.toolkitCoordinator=Q.toolkitCoordinator},subscribeActive:X.subscribeActive}}},q6={toolId:"theme",name:"Theme",description:"Accessible themes and contrast",icon:"swatch",supportedLevels:["assessment","section"],pnpSupportIds:["highContrastDisplay","colorContrast","invertColors","theme","highContrast","customColors"],isVisibleInContext(J){return!0},renderToolbar(J,Q){let X=x0(this.toolId,Q),K={toolId:this.toolId,label:this.name,icon:typeof this.icon==="function"?this.icon(J):this.icon,disabled:!1,ariaLabel:"Theme - Change colors and contrast",tooltip:"Theme",onClick:()=>Q.toggleTool(this.toolId),active:X.isActive()},Z=Q.componentOverrides??{},W=L0(this.toolId,J,Q,Z);return W.setAttribute("tool-id",X.fullToolId),{toolId:this.toolId,button:K,elements:[{element:W,mount:"after-buttons",shell:{title:this.name,draggable:!0,resizable:!1,closeable:!0,initialWidth:520,initialHeight:380,minWidth:420,minHeight:300}}],sync:()=>{if(k0({button:K,overlay:W,isActive:X.isActive}),Q.toolkitCoordinator)W.toolkitCoordinator=Q.toolkitCoordinator},subscribeActive:X.subscribeActive}}},U6={toolId:"annotationToolbar",name:"Highlighter",description:"Highlight and annotate text",icon:"highlighter",activation:"selection-gateway",singletonScope:"section",supportedLevels:["passage","rubric","item","element"],pnpSupportIds:["highlighting","annotations","highlighter","textHighlight","annotation"],isVisibleInContext(J){return dJ(J)},renderToolbar(J,Q){let X=x0(this.toolId,Q),K={toolId:this.toolId,label:this.name,icon:typeof this.icon==="function"?this.icon(J):this.icon,disabled:!1,ariaLabel:"Annotation toolbar - Highlight text",tooltip:"Highlight",onClick:()=>Q.toggleTool(this.toolId),active:X.isActive()},Z=Q.componentOverrides??{},W=L0(this.toolId,J,Q,Z);return W.setAttribute("tool-id",X.fullToolId),{toolId:this.toolId,button:K,elements:[{element:W,mount:"after-buttons"}],sync:()=>{if(k0({button:K,overlay:W,isActive:X.isActive}),Q.toolkitCoordinator)W.toolkitCoordinator=Q.toolkitCoordinator},subscribeActive:X.subscribeActive}}};var H6={toolId:"graph",name:"Graph",description:"Graphing calculator and coordinate plane",icon:"chart-bar",supportedLevels:["section"],pnpSupportIds:["graph","graphingCalculator","coordinatePlane","graphingTool"],isVisibleInContext(J){return _J(J)},renderToolbar(J,Q){let X=x0(this.toolId,Q),K={toolId:this.toolId,label:this.name,icon:typeof this.icon==="function"?this.icon(J):this.icon,disabled:!1,ariaLabel:"Graph - Graphing calculator",tooltip:"Graph",onClick:()=>Q.toggleTool(this.toolId),active:X.isActive()},Z=Q.componentOverrides??{},W=L0(this.toolId,J,Q,Z);return W.setAttribute("tool-id",X.fullToolId),{toolId:this.toolId,button:K,elements:[{element:W,mount:"after-buttons",shell:{title:this.name,draggable:!0,resizable:!0,closeable:!0,initialWidth:920,initialHeight:680,minWidth:640,minHeight:500}}],sync:()=>{k0({button:K,overlay:W,isActive:X.isActive})},subscribeActive:X.subscribeActive}}},P6={toolId:"periodicTable",name:"Periodic Table",description:"Chemistry periodic table reference",icon:"beaker",supportedLevels:["section"],pnpSupportIds:["periodicTable","chemistryReference","elementReference"],isVisibleInContext(J){return mQ(J)},renderToolbar(J,Q){let X=x0(this.toolId,Q),K={toolId:this.toolId,label:this.name,icon:typeof this.icon==="function"?this.icon(J):this.icon,disabled:!1,ariaLabel:"Periodic table - Chemistry reference",tooltip:"Periodic Table",onClick:()=>Q.toggleTool(this.toolId),active:X.isActive()},Z=Q.componentOverrides??{},W=L0(this.toolId,J,Q,Z);return W.setAttribute("tool-id",X.fullToolId),{toolId:this.toolId,button:K,elements:[{element:W,mount:"after-buttons",shell:{title:this.name,draggable:!0,resizable:!0,closeable:!0,initialWidth:1160,initialHeight:760,minWidth:920,minHeight:620}}],sync:()=>{k0({button:K,overlay:W,isActive:X.isActive})},subscribeActive:X.subscribeActive}}};var A5=[lQ,K6,Z6,W6,$6,G6,z6,q6,U6,H6,P6];function N5(J={}){let Q=new A9,X={toolTagMap:{...j9,...J.toolTagMap||{}},toolComponentFactory:J.toolComponentFactory,toolComponentFactories:J.toolComponentFactories},K=(Z)=>J.overrides?.[Z.toolId]||Z;if(J.includePackagedTools)D5(Q,{toolIds:J.toolIds,applyOverrides:K});if(J.toolModuleLoaders&&Object.keys(J.toolModuleLoaders).length>0)Q.setToolModuleLoaders(J.toolModuleLoaders);return Q.setComponentOverrides(X),Q}function D5(J,Q={}){let X=Q.toolIds&&Q.toolIds.length>0?new Set(Q.toolIds):null,K=Q.applyOverrides||((Z)=>Z);for(let Z of A5){if(X&&!X.has(Z.toolId))continue;J.register(K(Z))}}function BM(J={}){return N5({...J,includePackagedTools:!0})}
|
|
51
|
-
export{KQ as b,T8 as c,E8 as d,S6 as e,Z7 as f,ZJ as g,U0 as h,HJ as i,k6 as j,b6 as k,y6 as l,n8 as m,e8 as n,I as o,h as p,WQ as q,$Q as r,v6 as s,u6 as t,G9 as u,l6 as v,s6 as w,a6 as x,n6 as y,X1 as z,K1 as A,z1 as B,q1 as C,wQ as D,OQ as E,NQ as F,N1 as G,C1 as H,I1 as I,m1 as J,TQ as K,EQ as L,iB as M,sB as N,oB as O,YJ as P,tB as Q,eB as R,G7 as S,QV as T,vQ as U,uQ as V,D9 as W,V8 as X,DV as Y,G5 as Z,z5 as _,q5 as $,jV as aa,I9 as ba,IV as ca,M8 as da,F8 as ea,J6 as fa,BM as ga};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{B as bJ,C as H0,D as S0,E as pJ,F as L0,G as I0,H as _J,I as d,J as EJ,M as vJ,O as gJ,Q as $J,S as mj,T as hj,b as G0,c as SJ,d as IJ,e as N,f as a,g as w0,ga as mJ,h as P0,i as CJ,j as $0,k as K0,l as Gj,m as Y0,n as Q0,o as j,q as Pj,r as yJ,s as M0,t as U0,u as F,w as D0,x as Mj,y as e0,z as jj}from"./ItemToolBar-843902tp.js";function vj(v){return typeof v.href==="string"}function wJ(v){if(!v||typeof v!=="object"||Array.isArray(v))return!1;let q=v;if(typeof q.id!=="string"||q.id.trim().length===0)return!1;if(typeof q.label!=="string"||q.label.trim().length===0)return!1;if(q.ariaLabel!==void 0&&typeof q.ariaLabel!=="string")return!1;if(q.icon!==void 0&&typeof q.icon!=="string")return!1;if(q.tooltip!==void 0&&typeof q.tooltip!=="string")return!1;if(q.active!==void 0&&typeof q.active!=="boolean")return!1;if(q.disabled!==void 0&&typeof q.disabled!=="boolean")return!1;let s=typeof q.href==="string",m0=typeof q.onClick==="function";if(s===m0)return!1;if(s)return!0;return m0}function gj(v){return typeof v==="string"&&v.trimStart().startsWith("<svg")}function $j(v){return typeof v==="string"&&v.trimStart().startsWith("http")}import{sanitizeSvgIcon as Yj}from"@pie-players/pie-players-shared/security";import{approximateZoomFromWidths as qZ,computeZoomCompensation as FZ,ICON_BUTTON_ZOOM_OPTIONS as HJ}from"@pie-players/pie-players-shared/ui/zoom-compensation";import{createFocusTrap as kZ,FOCUSABLE_SELECTOR as xJ,isProgrammaticFocusTarget as BJ}from"@pie-players/pie-players-shared";import"@pie-players/pie-players-shared/nds-icon-button";var RZ=(v,q)=>{if(customElements.get(v))return;try{customElements.define(v,q)}catch(s){if(!(s instanceof DOMException&&s.name==="NotSupportedError"||s&&typeof s==="object"&&s.name==="NotSupportedError")||!customElements.get(v))throw s}},Oj=M0('<span class="item-toolbar__element-host svelte-rnx3ie"></span>'),WZ=M0('<span class="item-toolbar__nds-button-zoom svelte-rnx3ie"><nds-icon-button></nds-icon-button></span>',2),Nj=M0('<span aria-hidden="true"></span>'),AJ=M0('<img class="item-toolbar__icon-image svelte-rnx3ie" alt=""/>'),fJ=M0('<i aria-hidden="true"></i>'),zZ=M0("<a><!></a>"),wZ=M0('<button type="button"><!></button>'),TJ=M0('<span class="item-toolbar__controls-host svelte-rnx3ie"></span>'),HZ=M0("<div></div>"),xZ=M0('<div><div class="item-toolbar__tools-row svelte-rnx3ie"><!> <!> <!></div> <!></div>'),BZ={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);}.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,
|
|
5
|
-
.item-toolbar--bottom.svelte-rnx3ie {align-items:flex-end;}.item-toolbar--left.svelte-rnx3ie,
|
|
6
|
-
.item-toolbar--right.svelte-rnx3ie {align-items:stretch;}.item-toolbar--left.svelte-rnx3ie .item-toolbar__tools-row:where(.svelte-rnx3ie),
|
|
7
|
-
.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),
|
|
8
|
-
.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;}
|
|
9
|
-
|
|
10
|
-
/* Drive the vendored NDS icon button's outer size via its own \`--height-32\`
|
|
11
|
-
custom property so its light-DOM inner button matches the toolbar's
|
|
12
|
-
md/sm/lg dimensions (32 / 44 / 40 px) without a layout shift. The glyph
|
|
13
|
-
keeps the NDS-native icon size (we render size="small"), so it isn't
|
|
14
|
-
oversized. */
|
|
15
|
-
/* Freeze the calculator's header open/close button at its 200%-zoom size
|
|
16
|
-
(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) {
|
|
17
|
-
/* Host-settable button size per toolbar size (drives the NDS outer button
|
|
18
|
-
via its own --height-32). */--height-32: var(--pie-calculator-button-size, 2rem);
|
|
19
|
-
/* Host-settable accent for the calculator button: the NDS tertiary glyph
|
|
20
|
-
colour derives from --color-interactive-blue, remapped here to a
|
|
21
|
-
themeable variable. */--color-interactive-blue: var(--pie-calculator-button-color, #146eb3);}.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 hJ(v,q){SJ(q,!0),bJ(v,BZ);let s=typeof window<"u",m0=["/_fa-pro/fontawesome.min.css","/_fa-pro/light.min.css"],uj="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css",uJ="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap",cj=/font.?awesome|fa-?pro/i,sj=!1,Rj=()=>{if(!s||sj)return;if(sj=!0,!document.querySelector('link[href*="Roboto"]')){let K=document.createElement("link");K.rel="stylesheet",K.href=uJ,document.head.appendChild(K)}if(Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).some((K)=>cj.test(K.href)))return;if(!document.querySelector(`link[href="${uj}"]`)){let K=document.createElement("link");K.rel="stylesheet",K.href=uj,document.head.appendChild(K)}for(let K of m0){if(document.querySelector(`link[href="${K}"]`))continue;let Z=document.createElement("link");Z.rel="stylesheet",Z.href=K,document.head.appendChild(Z)}},ij="__pieFaToolbarShadowInstalled",cJ=(J)=>{let K=J.getRootNode();if(!(K instanceof ShadowRoot))return;let Z=K;if(Z[ij])return;Z[ij]=!0;let Q=new Set,X=(w)=>{if(!w||Q.has(w))return;Q.add(w);let i=document.createElement("link");i.rel="stylesheet",i.href=w,K.appendChild(i)},Y=Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).filter((w)=>cj.test(w.href));for(let w of Y)X(w.href)},sJ=(J)=>{return Rj(),cJ(J),{}},iJ=(J,K)=>{let Z=K,Q=()=>{let Y=J.querySelector("button");if(Y)Y.setAttribute("aria-pressed",Z?"true":"false")};Q();let X=new MutationObserver(Q);return X.observe(J,{childList:!0,subtree:!0}),{update(Y){Z=Y,Q()},destroy(){X.disconnect()}}},aJ={calculator:"calculator"},dJ=(J)=>aJ[J.id]??null,rJ=mJ(),C0=w0(CJ({})),p0=d(q,"level",7,"item"),Jj=d(q,"scopeId",7,""),qj=d(q,"itemId",7,""),Fj=d(q,"sectionId",7,""),kj=d(q,"catalogId",7,""),Wj=d(q,"tools",7,"calculator,textToSpeech,answerEliminator"),zj=d(q,"contentKind",7,"assessment-item"),x0=d(q,"position",7,"bottom"),h0=d(q,"scopeElement",7,null),wj=d(q,"toolRegistry",7,null),Hj=d(q,"item",7,null),Zj=d(q,"hostButtons",23,()=>[]),xj=d(q,"class",7,""),u0=d(q,"size",7,"md"),Lj=d(q,"language",7,"en-US"),R0=w0(null);function aj(){if(typeof window>"u")return 1;return FZ(qZ(window.outerWidth,window.innerWidth),HJ.maxZoom,HJ.minCompensation)}let dj=w0(1);Y0(()=>{if(typeof window>"u")return;let J=()=>{P0(dj,aj(),!0)};return J(),window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)});let g=w0(null),c0=N(()=>j(g)?.ndsIcons===!0),y0=w0(null),s0=w0(0),Kj=w0(0),Bj=w0(0);Y0(()=>{if(!j(R0))return;return vJ(j(R0),(J)=>{P0(g,J,!0)})}),Y0(()=>{if(!j(R0))return;return gJ(j(R0),(J)=>{P0(y0,J,!0)})}),Y0(()=>{let J=j(g)?.toolkitCoordinator;if(!J||typeof J.onPolicyChange!=="function")return;let K=J.onPolicyChange(()=>{P0(Kj,j(Kj)+1)});return()=>{try{K?.()}catch{}}}),Y0(()=>{let J=j(g)?.toolkitCoordinator;if(!J||typeof J.onToolContextResolverChange!=="function")return;let K=J.onToolContextResolverChange(()=>{P0(Bj,j(Bj)+1)});return()=>{try{K?.()}catch{}}});let I=N(()=>j(g)?.toolCoordinator),rj=N(()=>j(g)?.ttsService),_0=N(()=>j(g)?.elementToolStateStore),Qj=N(()=>j(g)?.assessmentId??""),i0=N(()=>qj()||j(y0)?.itemId||""),r=N(()=>j(y0)?.canonicalItemId||j(i0)),B0=N(()=>Fj()||j(g)?.sectionId||""),E0=N(()=>zj()||j(y0)?.contentKind||(p0()==="section"?"section":"assessment-item")),C=N(()=>{if(p0()&&p0()!=="item")return p0();if(j(E0)==="rubric-block-stimulus")return"passage";return"item"}),A0=N(()=>{if(Jj())return Jj();if(j(C)==="section")return j(B0)||j(g)?.sectionId||"default-section";if(j(C)==="assessment")return j(g)?.assessmentId||"default-assessment";return j(r)||j(i0)||"default-item"}),lj=N(()=>kj()||j(A0)),k0=N(()=>Hj()||j(y0)?.item||null),X0=N(()=>wj()||rJ),lJ=N(()=>$J(Wj())),oJ=N(()=>j(X0).normalizeToolIds(j(lJ)).filter(Boolean)),nJ=N(()=>{if(j(C)==="section")return"section";if(j(C)==="passage"||j(E0)==="rubric-block-stimulus")return"passage";return"item"}),oj=N(()=>{j(Kj);let J=j(g)?.toolkitCoordinator;if(!J||typeof J.decideToolPolicy!=="function")return null;return J.decideToolPolicy({level:j(nJ),scope:{level:j(C),scopeId:j(A0),assessmentId:j(g)?.assessmentId,sectionId:j(B0)||void 0,itemId:j(i0)||void 0,canonicalItemId:j(r)||void 0,contentKind:j(E0)}})}),nj=N(()=>{let J=(K)=>Array.from(new Set(K));if(j(oj))return J(j(X0).normalizeToolIds(j(oj).visibleTools.map((K)=>K.toolId)).filter(Boolean));return J(j(oJ))}),Aj=N(()=>{if(j(C)==="section"||j(C)==="assessment")return!0;let J=j(k0)?.config;return!!(j(k0)&&J&&typeof J==="object")}),tj=N(()=>{j(Kj);let J=j(g)?.toolkitCoordinator;if(!J||typeof J.getPolicyInputs!=="function")return null;return J.getPolicyInputs()}),v0=N(()=>j(tj)?.assessment??null),Uj=N(()=>j(tj)?.currentItemRef??null),a0=N(()=>{if(j(C)==="section")return{level:"section",assessment:j(v0)||{},section:{}};if(j(C)==="assessment")return{level:"assessment",assessment:j(v0)||{}};if(!j(Aj)||!j(k0))return null;if(j(C)==="passage")return{level:"passage",assessment:j(v0)||{},itemRef:j(Uj)||{id:j(r)},passage:j(k0)};return{level:"item",assessment:j(v0)||{},itemRef:j(Uj)||{id:j(r)},item:j(k0)}}),ej=N(()=>{if(j(a0))return j(a0);return{level:"item",assessment:j(v0)||{},itemRef:j(Uj)||{id:j(r)},item:j(k0)||{id:j(r),config:{}}}}),jJ=N(()=>{if(j(C)!=="item"&&j(C)!=="passage")return[];if(!j(Aj)||!j(k0))return[];let J=j(k0)?.config?.models;return(Array.isArray(J)?J:J&&typeof J==="object"?Object.values(J):[]).filter((Z)=>Z&&typeof Z==="object"&&typeof Z.id==="string").map((Z)=>({level:"element",assessment:j(v0)||{},itemRef:j(Uj)||{id:j(r)},item:j(k0),elementId:Z.id}))}),tJ=N(()=>{let J=j(g)?.toolkitCoordinator||null,K=(Z)=>hj(Z)?Z:mj(Z,j(C),j(A0));return{scope:{level:j(C),scopeId:j(A0),assessmentId:j(g)?.assessmentId,sectionId:j(B0),itemId:j(i0),canonicalItemId:j(r),contentKind:j(E0)},itemId:j(A0),catalogId:j(lj),language:Lj(),ui:{size:u0()},getScopeElement:()=>h0()||j(y0)?.scopeElement||null,getGlobalElementId:()=>{if(!j(_0)||!j(Qj)||!j(B0)||!j(r))return null;return j(_0).getGlobalElementId(j(Qj),j(B0),j(r),j(r))},toolCoordinator:j(I)||null,toolkitCoordinator:J,ttsService:j(rj)||null,elementToolStateStore:j(_0)||null,toggleTool:(Z)=>{if(!j(I))return;let Q=K(Z);if(!j(I).getToolState(Q))j(I).registerTool(Q,Z);j(I).toggleTool(Q)},isToolVisible:(Z)=>{if(!j(I))return!1;return j(I).isToolVisible(K(Z))},subscribeVisibility:j(I)?(Z)=>j(I).subscribe(Z):null}}),fj=N(()=>{j(Bj);let J=j(g)?.toolkitCoordinator;if(!J||typeof J.hasToolContextResolver!=="function"||typeof J.resolveToolContext!=="function")return{};let K={};for(let Z of j(nj)){if(!j(X0).get(Z)?.supportedLevels.includes(j(C)))continue;if(!J.hasToolContextResolver(Z))continue;let X=J.resolveToolContext({toolId:Z,context:j(ej),toolbarContext:j(tJ)});if(X)K[Z]=X}return K}),eJ=N(()=>{let J=j(nj).filter((Y)=>{let w=j(X0).get(Y);return w?w.supportedLevels.includes(j(C)):!1}),K=Object.values(j(fj)),Z=new Set(K.map((Y)=>Y.toolId)),Q=new Set(K.filter((Y)=>Y.visible).map((Y)=>Y.toolId)),X=J.filter((Y)=>!Z.has(Y));if(j(C)==="section")return X.forEach((Y)=>Q.add(Y)),Array.from(Q);if(!j(Aj))return X.forEach((Y)=>Q.add(Y)),Array.from(Q);if(!j(a0)&&j(jJ).length===0)return X.forEach((Y)=>Q.add(Y)),Array.from(Q);if(j(a0))j(X0).filterVisibleInContext(X,j(a0)).forEach((Y)=>Q.add(Y.toolId));for(let Y of j(jJ))j(X0).filterVisibleInContext(X,Y).forEach((w)=>Q.add(w.toolId));return Array.from(Q)}),Tj=N(()=>j(X0).filterToolIdsByActivation(j(eJ),"toolbar-toggle"));Y0(()=>{if(!s)return;let J=!1;return j(X0).ensureToolModulesLoaded(j(Tj)).then(()=>{if(!J)P0(s0,j(s0)+1)}).catch((K)=>{console.error("[ItemToolBar] Failed to load one or more tool modules:",K)}),()=>{J=!0}});function jZ(){if(h0())return h0();return j(y0)?.scopeElement||null}function JZ(){if(!j(_0)||!j(Qj)||!j(B0)||!j(r))return null;return j(_0).getGlobalElementId(j(Qj),j(B0),j(r),j(r))}let b0=N(()=>{let J=j(g)?.toolkitCoordinator||null,K=(Z)=>{return hj(Z)?Z:mj(Z,j(C),j(A0))};return{scope:{level:j(C),scopeId:j(A0),assessmentId:j(g)?.assessmentId,sectionId:j(B0),itemId:j(i0),canonicalItemId:j(r),contentKind:j(E0)},itemId:j(A0),catalogId:j(lj),language:Lj(),ui:{size:u0()},getScopeElement:jZ,getGlobalElementId:JZ,toolCoordinator:j(I)||null,toolkitCoordinator:J,ttsService:j(rj)||null,elementToolStateStore:j(_0)||null,toggleTool:(Z)=>{if(!j(I))return;let Q=K(Z);if(!j(I).getToolState(Q))j(I).registerTool(Q,Z);j(I).toggleTool(Q)},isToolVisible:(Z)=>{if(!j(I))return!1;return j(I).isToolVisible(K(Z))},subscribeVisibility:j(I)?(Z)=>j(I).subscribe(Z):null,getResolvedToolContext:(Z)=>j(fj)[Z]??null,getToolRenderParams:(Z)=>j(fj)[Z]?.params??null}}),W0=N(()=>{if(!s)return[];j(s0);let J=[];for(let K of j(Tj)){let Z=j(X0).renderForToolbar(K,j(ej),j(b0));if(Z)J.push(Z)}return J}),ZZ=N(()=>{if(!Array.isArray(Zj()))return[];let J=[];return Zj().forEach((K,Z)=>{if(wJ(K)){J.push(K);return}console.warn(`[ItemToolBar] Ignoring invalid host button at index ${Z}. Expected { id, label, href | onClick } with valid types.`)}),J}),LZ=N(()=>j(W0).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,tooltip:K.tooltip||K.label,disabled:K.disabled,active:j(C0)[J.toolId]??K.active??!1,onClick:()=>{K.onClick(),r0()}}})),JJ=N(()=>[...j(LZ),...j(ZZ)]),d0=N(()=>{let J={};for(let K of j(W0))J[K.toolId]=j(C0)[K.toolId]??K.button?.active??!1;return J}),KZ=N(()=>j(W0).flatMap((J)=>(J.elements||[]).filter((K)=>K.mount==="before-buttons").filter((K)=>Boolean(K.element)).map((K,Z)=>({key:`before-${J.toolId}-${Z}`,toolId:J.toolId,entry:K})))),QZ=N(()=>j(W0).flatMap((J)=>(J.elements||[]).filter((K)=>K.mount==="after-buttons").filter((K)=>Boolean(K.element)).map((K,Z)=>({key:`after-${J.toolId}-${Z}`,toolId:J.toolId,entry:K})))),ZJ=N(()=>j(W0).flatMap((J)=>(J.elements||[]).filter((K)=>K.mount==="controls-row").filter((K)=>Boolean(K.element)).map((K,Z)=>({key:`controls-row-${J.toolId}-${Z}`,toolId:J.toolId,entry:K})))),LJ=N(()=>j(W0).flatMap((J)=>(J.elements||[]).map((K)=>({toolId:J.toolId,hint:K.layoutHints?.controlsRow})).filter((K)=>Boolean(K.hint)))),KJ=N(()=>j(W0).flatMap((J)=>(J.elements||[]).map((K)=>({toolId:J.toolId,hint:K.layoutHints?.headerOverlay})).filter((K)=>Boolean(K.hint)))),QJ=N(()=>j(LJ).some((J)=>J.hint?.reserveSpace===!0)),UJ=N(()=>j(LJ).some((J)=>J.hint?.showWhenToolActive===!0&&(j(d0)[J.toolId]??!1))),UZ=N(()=>x0()==="left"||x0()==="right"),DJ=N(()=>j(KJ).some((J)=>J.hint?.showWhenToolActive===!0&&(j(d0)[J.toolId]??!1))),DZ=N(()=>j(ZJ).length>0||j(QJ)||j(UJ));function XZ(){if(!j(R0))return null;let J=j(R0).getRootNode();if(J instanceof ShadowRoot)return J.host;return null}Y0(()=>{let J=XZ();if(!J)return;let K=j(KJ).length>0,Z=j(DJ);return J.setAttribute("data-pie-header-overlay",K?"true":"false"),J.setAttribute("data-pie-header-overlay-active",Z?"true":"false"),()=>{J.removeAttribute("data-pie-header-overlay"),J.removeAttribute("data-pie-header-overlay-active")}}),Y0(()=>{if(!s)return;if(j(JJ).some((J)=>J.icon==="calculator"))Rj()});function Dj(J){if(J.id in j(C0))return j(C0)[J.id]===!0;return J.active===!0}function XJ(J){return{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>'}[J]||null}function r0(){let J={};for(let K of j(W0))if(K.sync?.(),K.button)J[K.toolId]=K.button.active??!1;P0(C0,J,!0)}Y0(()=>{let J=[];r0();for(let K of j(W0))if(K.subscribeActive){let Z=!1,Q=K.subscribeActive((X)=>{queueMicrotask(()=>{if(Z)return;P0(C0,{...j(C0),[K.toolId]:X},!0),K.sync?.()})});J.push(()=>{Z=!0,Q()})}return()=>{J.forEach((K)=>K())}}),Y0(()=>{if(!j(b0).subscribeVisibility)return;let J=!1,K=j(b0).subscribeVisibility(()=>{queueMicrotask(()=>{if(J)return;r0()})});return()=>{J=!0,K?.()}}),Y0(()=>{let J=j(b0).toolkitCoordinator;if(typeof J?.subscribeTelemetry!=="function")return;let K=!1,Z=J.subscribeTelemetry(({eventName:Q,payload:X})=>{if(Q!=="pie-toolkit-tool-config-updated")return;if(X?.toolId&&!j(Tj).includes(X.toolId))return;queueMicrotask(()=>{if(K)return;P0(s0,j(s0)+1),r0()})});return()=>{K=!0,Z?.()}});function Sj(J,K){let Z=null,Q=(Y)=>{if(!Y)return;let w=Y.__pieToolElementUnmount;if(typeof w==="function")w()},X=(Y)=>{if(Z===Y)return;if(Z){if(Q(Z),Z.parentNode===J)J.removeChild(Z)}if(Z=Y,Z){if(Z.parentNode&&Z.parentNode!==J)Z.parentNode.removeChild(Z);J.appendChild(Z)}};return X(K),{update(Y){X(Y)},destroy(){X(null)}}}function Ij(J,K){let Z=K,Q=null,X=null,Y=null,w=null,i=null,q0=null,u=null,O=null,l=null,o=!1,c=!1,k=null,A=null,y=null,j0=0,$=0,T=0,H=0,R=0,B=0,n=0,O0=0,S=null,N0=[],b=0,p=0,_=Z.mounted.entry.shell?.initialWidth??720,E=Z.mounted.entry.shell?.initialHeight??560,F0=null,J0=null,x=!1,f=(L)=>{if(!L)return;let D=L.__pieToolElementUnmount;if(typeof D==="function")D()},z0=()=>{let L=Z.mounted.entry.shell;if(!L)return null;return{toolId:Z.mounted.toolId,toolbarContext:j(b0),shellConfig:L}},l0=(L)=>{let D=j(X0).get(Z.mounted.toolId),P=z0();if(!D?.onHostedMount||!P)return;D.onHostedMount(L,P)},f0=()=>{let L=j(X0).get(Z.mounted.toolId),D=z0();if(!L?.onHostedResize||!D)return;L.onHostedResize({width:_,height:E},Z.mounted.entry.element,D)},o0=()=>{let L=j(X0).get(Z.mounted.toolId),D=z0();if(!L?.onHostedUnmount||!D)return;L.onHostedUnmount(Z.mounted.entry.element,D)},z=(L,D,P)=>Math.max(D,Math.min(L,P)),t=()=>{let L=Z.mounted.entry.shell,D=L?.minWidth??320,P=L?.minHeight??240,V=L?.maxWidth??window.innerWidth,G=L?.maxHeight??window.innerHeight;return{minWidth:D,minHeight:P,maxWidth:V,maxHeight:G}},Cj=()=>{let L=Z.mounted.entry.shell?.minWidth,D=typeof L==="number"&&L>0&&_<L,P=D?`${L}px`:"";if(k)k.style.minWidth=P;if(X)X.style.minWidth=P;if(Y)Y.style.minWidth=P;if(Q)Q.style.overflowX=D?"auto":"visible",Q.style.overflowY="visible"},YJ=()=>Z.mounted.entry.shell?.content?.overflowY==="auto"?"auto":"hidden",NZ=()=>{if(!X)return 0;let L=X.getBoundingClientRect().height;if(L>0)return L;return X.offsetHeight||0},yj=()=>{if(!Y)return;let L=Z.mounted.entry.shell;if(Y.style.overflowX="hidden",Y.style.overflowY=YJ(),!k)return;if(L?.content?.preserveMinHeight===!0){let D=NZ(),P=L.minHeight??240,V=Math.max(0,P-D),G=Math.max(0,E-D),U=Math.max(G,V);k.style.height=`${U}px`,k.style.minHeight="0",k.style.flex=`0 0 ${U}px`;return}k.style.height="100%",k.style.minHeight="0",k.style.flex="1 1 auto"},Xj=()=>{let{minWidth:L,minHeight:D,maxWidth:P,maxHeight:V}=t(),G=Math.min(L,window.innerWidth),U=Math.min(D,window.innerHeight);_=z(_,G,Math.max(G,Math.min(P,window.innerWidth))),E=z(E,U,Math.max(U,Math.min(V,window.innerHeight))),b=z(b,0,Math.max(0,window.innerWidth-_)),p=z(p,0,Math.max(0,window.innerHeight-E)),n0(),Cj(),yj(),f0()},T0=(L,D)=>{b+=L,p+=D,Xj()},Vj=(L,D)=>{_+=L,E+=D,Xj()},OJ=(L,D,P,V="fa-regular")=>{let G=document.createElement("nds-icon-button");if(G.setAttribute("variant","tertiary"),G.setAttribute("size","small"),G.setAttribute("type","circle"),G.setAttribute("icon-name",D),G.setAttribute("button-aria-label",L),G.title=L,G.addEventListener("click",(U)=>{U.stopPropagation(),P(),g0()}),V!=="fa-light"){let U=(M)=>{M.classList.remove("fa-light"),M.classList.add(V)},W=G.querySelector("i.fa-light");if(W)U(W);else{let M=new MutationObserver(()=>{let m=G.querySelector("i.fa-light");if(m)U(m),M.disconnect()});M.observe(G,{childList:!0,subtree:!0})}}return G},NJ=(L,D,P)=>{let V=document.createElement("button");return V.type="button",V.className="pie-tool-shell__control",V.setAttribute("aria-label",L),V.title=L,V.textContent=D,V.style.border="1px solid transparent",V.style.background="color-mix(in srgb, var(--pie-white, #fff) 10%, transparent)",V.style.color="inherit",V.style.cursor="pointer",V.style.display="inline-flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.width="28px",V.style.height="28px",V.style.padding="0",V.style.fontSize="14px",V.style.fontWeight="700",V.style.borderRadius="8px",V.style.lineHeight="1",V.onclick=(G)=>{G.stopPropagation(),P(),g0()},V.onfocus=()=>{V.style.outline="2px solid var(--pie-button-focus-outline, var(--pie-primary, #4A90E2))",V.style.outlineOffset="2px"},V.onblur=()=>{V.style.outline="none",V.style.outlineOffset="0"},V},n0=()=>{if(!Q)return;Q.style.left=`${b}px`,Q.style.top=`${p}px`,Q.style.width=`${_}px`,Q.style.height=`${E}px`,Q.style.display=Z.active?"flex":"none",Q.style.setProperty("--pie-tool-shell-zoom-comp",String(aj()))},GJ=()=>{if(!Y)return;let L=Z.mounted.entry.element;if(L.style.display="block",L.style.width="100%",L.style.height="100%",L.style.flex="1 1 auto",L.style.minHeight="0",k&&k!==L){if(k.parentNode===Y)f(k),Y.removeChild(k);k=null}if(L.parentNode&&L.parentNode!==Y)L.parentNode.removeChild(L);if(L.parentNode!==Y)Y.appendChild(L);k=L,Cj(),yj(),l0(L)},g0=()=>{if(j(I)&&Q)j(I).bringToFront(Q)},bj=()=>{let{innerWidth:L,innerHeight:D}=window,P=Z.mounted.entry.shell,V=P?.initialAlign??"center",G=P?.initialMargin??16,U=G+60;switch(V){case"top-left":b=G,p=U;break;case"top-right":b=Math.max(0,L-_-G),p=U;break;case"bottom-left":b=G,p=Math.max(0,D-E-U);break;case"bottom-right":b=Math.max(0,L-_-G),p=Math.max(0,D-E-U);break;default:b=Math.max(0,Math.round((L-_)/2)),p=Math.max(0,Math.round((D-E)/2))}Xj()},GZ=()=>{let L=J0;if(!L)return;queueMicrotask(()=>{if(!L.isConnected)return;try{L.focus()}catch{}})},PJ=()=>{if(typeof document>"u")return null;let L=document.activeElement;while(L){let D=L.shadowRoot;if(D&&D.activeElement&&D.activeElement!==L)L=D.activeElement;else break}return L??null},MJ=()=>{if(!Q||F0)return;let L=PJ();if(!J0&&L&&!Q.contains(L))J0=L;let D=Z.mounted.toolId==="calculator";if(D&&!c)document.addEventListener("keydown",_j,!0),c=!0;F0=kZ(Q,{initialFocus:q0,onEscape:()=>{Ej()},wrap:!D,onTabExit:D?(P,V)=>{if(P==="backward"){if(J0?.isConnected){V.preventDefault();try{J0.focus()}catch{}}return}let G=pj();if(G){V.preventDefault();try{G.focus()}catch{}}}:void 0})},pj=()=>{let L=j(b0).getScopeElement?.()??null;if(!L)return null;let D=(V)=>{if(j(R0)&&j(R0).contains(V))return!0;if(Q&&Q.contains(V))return!0;return!1},P=(V)=>{if(V instanceof HTMLElement){if(D(V))return null;if(V.matches?.(xJ)&&BJ(V))return V}let G=V.shadowRoot;if(G)for(let U=0;U<G.children.length;U++){let W=P(G.children[U]);if(W)return W}for(let U=0;U<V.children.length;U++){let W=P(V.children[U]);if(W)return W}return null};return P(L)},PZ=()=>{if(!Q)return[];return Array.from(Q.querySelectorAll(xJ)).filter((L)=>L!==O&&L!==l).filter(BJ)},_j=(L)=>{if(L.key!=="Tab")return;if(!Q||!Z.active)return;let D=PJ();if(!D)return;if(Q.contains(D))return;let P=PZ();if(P.length===0)return;if(L.shiftKey){let V=pj();if(D!==V)return;L.preventDefault();try{P[P.length-1].focus()}catch{}return}if(D!==J0)return;L.preventDefault();try{P[0].focus()}catch{}},RJ=()=>{if(c)document.removeEventListener("keydown",_j,!0),c=!1;if(!F0)return;let L=F0;F0=null;try{L()}catch{}GZ()},Ej=()=>{j(b0).toggleTool(Z.mounted.toolId),r0()},qJ=(L)=>{if(!Z.mounted.entry.shell?.draggable)return;if(L.target.closest("button")||!Q)return;L.preventDefault(),A=L.pointerId,j0=L.clientX-b,$=L.clientY-p,Q.setPointerCapture(L.pointerId),g0()},MZ=(L)=>(D)=>{if(!Q||!Z.mounted.entry.shell?.resizable)return;D.preventDefault(),D.stopPropagation(),y=D.pointerId,S=L,T=_,H=E,R=D.clientX,B=D.clientY,n=b,O0=p,Q.setPointerCapture(D.pointerId),g0()},FJ=(L)=>{if(!Q)return;if(A===L.pointerId){L.preventDefault();let D=Math.max(0,window.innerWidth-_),P=Math.max(0,window.innerHeight-E);b=z(L.clientX-j0,0,D),p=z(L.clientY-$,0,P),n0();return}if(y===L.pointerId){L.preventDefault();let D=Z.mounted.entry.shell,P=D?.minWidth??320,V=D?.minHeight??240,G=Math.min(P,window.innerWidth),U=Math.min(V,window.innerHeight),W=D?.maxWidth??window.innerWidth,M=D?.maxHeight??window.innerHeight,m=L.clientX-R,e=L.clientY-B;if(S==="se")_=z(T+m,G,Math.max(G,Math.min(W,window.innerWidth-b))),E=z(H+e,U,Math.max(U,Math.min(M,window.innerHeight-p)));else if(S==="sw"){let Z0=n+T,V0=z(T-m,G,Math.min(W,Z0));b=Z0-V0,_=V0,E=z(H+e,U,Math.max(U,Math.min(M,window.innerHeight-p)))}else if(S==="ne"){let Z0=O0+H;_=z(T+m,G,Math.max(G,Math.min(W,window.innerWidth-b)));let V0=z(H-e,U,Math.min(M,Z0));p=Z0-V0,E=V0}else if(S==="nw"){let Z0=n+T,V0=O0+H,t0=z(T-m,G,Math.min(W,Z0));b=Z0-t0,_=t0;let h=z(H-e,U,Math.min(M,V0));p=V0-h,E=h}n0(),Cj(),yj(),f0()}},kJ=(L)=>{if(!Q)return;if(A===L.pointerId)A=null,Q.releasePointerCapture(L.pointerId);if(y===L.pointerId)y=null,Q.releasePointerCapture(L.pointerId)},WJ=()=>{Xj()};if(s&&Z.mounted.entry.shell){let L=Z.mounted.toolId==="calculator",D=L&&j(c0);if(D)Rj();if(Q=document.createElement("div"),Q.className="pie-tool-shell",Q.setAttribute("data-pie-tool-shell",Z.mounted.toolId),Q.style.position="fixed",Q.style.zIndex="2000",Q.style.background="var(--pie-background, #fff)",Q.style.border="1px solid var(--pie-border-light, #d1d5db)",Q.style.borderRadius="12px",Q.style.boxShadow="0 10px 40px color-mix(in srgb, var(--pie-black, #000) 25%, transparent)",Q.style.overflow="visible",Q.style.display=Z.active?"flex":"none",Q.style.flexDirection="column",Q.style.userSelect="none",Q.style.webkitUserSelect="none",Q.style.touchAction="none",Q.setAttribute("draggable","false"),Q.addEventListener("dragstart",(U)=>U.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=L?"12px 12px 12px 28px":"10px 12px",L)X.style.minHeight="48px";if(L)X.style.background="var(--pie-section-player-card-header-background, #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=Z.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",(U)=>U.preventDefault()),w=document.createElement("span"),w.className="pie-tool-shell__title",w.textContent=Z.mounted.entry.shell.title||Z.mounted.toolId,X.appendChild(w),i=document.createElement("div"),i.className="pie-tool-shell__controls",i.style.display="inline-flex",i.style.alignItems="center",i.style.gap=L?"6px":"4px";let P=Z.mounted.entry.shell,V=(U,W,M,m,e="fa-regular")=>{if(!i)return;i.appendChild(D?OJ(U,M,m,e):NJ(U,W,m))};if(P?.draggable!==!1)V("Move tool left","←","chevron-left",()=>T0(-24,0)),V("Move tool right","→","chevron-right",()=>T0(24,0)),V("Move tool up","↑","chevron-up",()=>T0(0,-24)),V("Move tool down","↓","chevron-down",()=>T0(0,24));if(P?.resizable!==!1)V("Shrink tool window","−","magnifying-glass-minus",()=>Vj(-40,-40)),V("Grow tool window","+","magnifying-glass-plus",()=>Vj(40,40));if(!L)i.appendChild(NJ("Center tool window","◎",bj));let G=null;if(L)G=document.createElement("div"),G.className="pie-tool-shell__header-right",G.style.display="inline-flex",G.style.alignItems="center",G.style.gap="6px",G.style.setProperty("zoom","var(--pie-tool-shell-zoom-comp, 1)"),G.appendChild(i),X.appendChild(G);else X.appendChild(i);if(D)q0=OJ("Close tool","xmark",Ej,"fa-regular"),q0.style.display=Z.mounted.entry.shell.closeable===!1?"none":"inline-block";else{let U=document.createElement("button");U.type="button",U.className="pie-tool-shell__close",U.setAttribute("aria-label","Close tool");let W="http://www.w3.org/2000/svg",M=document.createElementNS(W,"svg");M.setAttribute("xmlns",W),M.setAttribute("viewBox","0 0 16 16"),M.setAttribute("aria-hidden","true");let m=document.createElementNS(W,"path");m.setAttribute("d","M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5"),m.setAttribute("stroke","currentColor"),m.setAttribute("stroke-width","1.8"),m.setAttribute("stroke-linecap","round"),M.appendChild(m),U.appendChild(M);let e=M.style;e.width="16px",e.height="16px",e.display="block",e.flexShrink="0",e.pointerEvents="none";let Z0="color-mix(in srgb, var(--pie-white, #fff) 8%, transparent)",V0="color-mix(in srgb, var(--pie-white, #fff) 18%, transparent)";U.style.border="1px solid transparent",U.style.background=Z0,U.style.color="inherit",U.style.cursor="pointer",U.style.display="inline-flex",U.style.alignItems="center",U.style.justifyItems="center",U.style.width="28px",U.style.height="28px",U.style.padding="0",U.style.borderRadius="8px",U.style.lineHeight="0",U.style.transition="background-color 0.15s ease, border-color 0.15s ease",U.style.display=Z.mounted.entry.shell.closeable===!1?"none":"inline-flex",U.onmouseenter=()=>{U.style.background=V0},U.onmouseleave=()=>{U.style.background=Z0},U.onfocus=()=>{U.style.outline="2px solid var(--pie-button-focus-outline, var(--pie-primary, #4A90E2))",U.style.outlineOffset="2px"},U.onblur=()=>{U.style.outline="none",U.style.outlineOffset="0"},U.onclick=Ej,q0=U}if(G)G.appendChild(q0);else X.appendChild(q0);if(X.tabIndex=0,X.onkeydown=(U)=>{if(U.key==="Home"){U.preventDefault(),bj();return}let W=Z.mounted.entry.shell;if(U.shiftKey&&W?.resizable!==!1){if(U.key==="ArrowRight"||U.key==="ArrowDown"){U.preventDefault(),Vj(40,40);return}if(U.key==="ArrowLeft"||U.key==="ArrowUp"){U.preventDefault(),Vj(-40,-40);return}}if(W?.draggable!==!1){if(U.key==="ArrowLeft")U.preventDefault(),T0(-24,0);else if(U.key==="ArrowRight")U.preventDefault(),T0(24,0);else if(U.key==="ArrowUp")U.preventDefault(),T0(0,-24);else if(U.key==="ArrowDown")U.preventDefault(),T0(0,24)}},Y=document.createElement("div"),Y.className="pie-tool-shell__content",Y.style.position="relative",Y.style.width="100%",Y.style.flex="1 1 auto",Y.style.minHeight="0",Y.style.overflowX="hidden",Y.style.overflowY=YJ(),Y.style.borderRadius="0 0 12px 12px",L){let U=(W)=>{let M=document.createElement("div");return M.tabIndex=0,M.setAttribute("aria-hidden","true"),M.setAttribute("data-pie-tool-shell-focus-guard",W),M.style.position="absolute",M.style.width="1px",M.style.height="1px",M.style.padding="0",M.style.margin="-1px",M.style.overflow="hidden",M.style.clipPath="inset(50%)",M.style.whiteSpace="nowrap",M.style.border="0",M};O=U("start"),l=U("end"),O.addEventListener("focus",(W)=>{if(o)return;o=!0;try{if(W.stopPropagation(),J0?.isConnected)try{J0.focus()}catch{}}finally{queueMicrotask(()=>{o=!1})}}),l.addEventListener("focus",(W)=>{if(o)return;o=!0;try{W.stopPropagation();let M=pj();if(M)try{M.focus()}catch{}}finally{queueMicrotask(()=>{o=!1})}}),Q.appendChild(O)}if(Q.appendChild(X),Q.appendChild(Y),L&&l)Q.appendChild(l);if(Z.mounted.entry.shell.resizable!==!1){let U=(W,M,m,e,Z0,V0,t0)=>{let h=document.createElement("div");if(h.className="pie-tool-shell__resize",h.style.position="absolute",h.style.width="24px",h.style.height="24px",h.style.cursor=V0,h.style.zIndex="10",h.style.touchAction="none",h.setAttribute("draggable","false"),M!==null)h.style.top=M;if(m!==null)h.style.right=m;if(e!==null)h.style.bottom=e;if(Z0!==null)h.style.left=Z0;if(t0!==null)h.style.background=`linear-gradient(${t0}, transparent 0%, transparent 40%, rgba(0,0,0,0.35) 40%, rgba(0,0,0,0.35) 60%, transparent 60%, transparent 100%)`;let zJ=MZ(W);h.addEventListener("pointerdown",zJ),Q.appendChild(h),N0.push({el:h,handler:zJ})};U("se",null,"0","0",null,"nwse-resize",null),U("nw","0",null,null,"0","nwse-resize","135deg"),U("ne","0","0",null,null,"nesw-resize",null),U("sw",null,null,"0","0","nesw-resize",null)}if(X.addEventListener("pointerdown",qJ),Q.addEventListener("pointermove",FJ),Q.addEventListener("pointerup",kJ),Q.addEventListener("pointerdown",g0),window.addEventListener("resize",WJ),document.body.appendChild(Q),bj(),n0(),GJ(),f0(),Z.active)MJ();x=Z.active}return{update(L){if(Z=L,!Q||!Y||!w||!q0)return;w.textContent=Z.mounted.entry.shell?.title||Z.mounted.toolId;let D=Z.mounted.toolId==="calculator"?"inline-block":"inline-flex";if(q0.style.display=Z.mounted.entry.shell?.closeable===!1?"none":D,n0(),GJ(),f0(),!x&&Z.active)MJ();else if(x&&!Z.active)RJ(),J0=null;x=Z.active},destroy(){if(o0(),F0)RJ();if(c)document.removeEventListener("keydown",_j,!0),c=!1;for(let{el:L,handler:D}of N0)L.removeEventListener("pointerdown",D);if(J0=null,N0.length=0,X)X.removeEventListener("pointerdown",qJ),X.onkeydown=null;if(Q)Q.removeEventListener("pointermove",FJ),Q.removeEventListener("pointerup",kJ),Q.removeEventListener("pointerdown",g0);if(window.removeEventListener("resize",WJ),k&&Y&&k.parentNode===Y)f(k),Y.removeChild(k);if(k=null,Q&&Q.parentElement)Q.remove()}}}var VZ={get level(){return p0()},set level(J){p0(J),a()},get scopeId(){return Jj()},set scopeId(J){Jj(J),a()},get itemId(){return qj()},set itemId(J){qj(J),a()},get sectionId(){return Fj()},set sectionId(J){Fj(J),a()},get catalogId(){return kj()},set catalogId(J){kj(J),a()},get tools(){return Wj()},set tools(J){Wj(J),a()},get contentKind(){return zj()},set contentKind(J){zj(J),a()},get position(){return x0()},set position(J){x0(J),a()},get scopeElement(){return h0()},set scopeElement(J){h0(J),a()},get toolRegistry(){return wj()},set toolRegistry(J){wj(J),a()},get item(){return Hj()},set item(J){Hj(J),a()},get hostButtons(){return Zj()},set hostButtons(J){Zj(J),a()},get class(){return xj()},set class(J){xj(J),a()},get size(){return u0()},set size(J){u0(J),a()},get language(){return Lj()},set language(J){Lj(J),a()}},VJ=U0(),YZ=K0(VJ);{var OZ=(J)=>{var K=xZ();let Z;var Q=$0(K),X=$0(Q);e0(X,17,()=>j(KZ),(u)=>u.key,(u,O)=>{var l=U0(),o=K0(l);{var c=(A)=>{var y=U0(),j0=K0(y);Mj(j0,()=>j(c0),($)=>{var T=Oj();H0(T,(H,R)=>Ij?.(H,R),()=>({mounted:j(O),active:j(d0)[j(O).toolId]??!1})),F($,T)}),F(A,y)},k=(A)=>{var y=Oj();H0(y,(j0,$)=>Sj?.(j0,$),()=>j(O).entry.element),F(A,y)};D0(o,(A)=>{if(j(O).entry.shell)A(c);else A(k,-1)})}F(u,l)});var Y=Gj(X,2);e0(Y,17,()=>j(JJ),(u)=>u.id,(u,O,l,o)=>{let c=N(()=>j(c0)&&!vj(j(O))?dJ(j(O)):null);var k=U0(),A=K0(k);{var y=(H)=>{var R=WZ(),B=$0(R);S0(B,1,"item-toolbar__nds-button svelte-rnx3ie"),I0(B,"type","circle"),I0(B,"size","small"),I0(B,"variant","tertiary"),Q0(()=>I0(B,"icon-name",j(c))),Q0(()=>I0(B,"button-aria-label",j(O).ariaLabel||j(O).label)),Q0(()=>I0(B,"title",j(O).tooltip||j(O).label)),Q0(()=>I0(B,"disabled",j(O).disabled)),H0(B,(n)=>sJ?.(n)),H0(B,(n,O0)=>iJ?.(n,O0),()=>Dj(j(O))),G0(R),Pj("click",B,function(...n){j(O).onClick?.apply(this,n)}),F(H,R)},j0=(H)=>{var R=zZ();let B;var n=$0(R);{var O0=(S)=>{var N0=U0(),b=K0(N0);{var p=(x)=>{var f=Nj();jj(f,()=>Yj(j(O).icon),!0),G0(f),F(x,f)},_=N(()=>gj(j(O).icon)),E=(x)=>{var f=AJ();Q0(()=>L0(f,"src",j(O).icon)),F(x,f)},F0=N(()=>$j(j(O).icon)),J0=(x)=>{let f=N(()=>XJ(j(O).icon));var z0=U0(),l0=K0(z0);{var f0=(z)=>{var t=Nj();jj(t,()=>Yj(j(f)),!0),G0(t),F(z,t)},o0=(z)=>{var t=fJ();Q0(()=>S0(t,1,`icon icon-${j(O).icon}`,"svelte-rnx3ie")),F(z,t)};D0(l0,(z)=>{if(j(f))z(f0);else z(o0,-1)})}F(x,z0)};D0(b,(x)=>{if(j(_))x(p);else if(j(F0))x(E,1);else x(J0,-1)})}F(S,N0)};D0(n,(S)=>{if(j(O).icon)S(O0)})}G0(R),Q0((S)=>{B=S0(R,1,"item-toolbar__button svelte-rnx3ie",null,B,S),L0(R,"href",j(O).disabled?void 0:j(O).href),L0(R,"target",j(O).target),L0(R,"rel",j(O).rel),L0(R,"aria-label",j(O).ariaLabel||j(O).label),L0(R,"title",j(O).tooltip||j(O).label),L0(R,"aria-disabled",j(O).disabled?"true":void 0)},[()=>({"item-toolbar__button--active":Dj(j(O))})]),Pj("click",R,(S)=>{if(j(O).disabled)S.preventDefault()}),F(H,R)},$=N(()=>vj(j(O))),T=(H)=>{var R=wZ();let B;var n=$0(R);{var O0=(S)=>{var N0=U0(),b=K0(N0);{var p=(x)=>{var f=Nj();jj(f,()=>Yj(j(O).icon),!0),G0(f),F(x,f)},_=N(()=>gj(j(O).icon)),E=(x)=>{var f=AJ();Q0(()=>L0(f,"src",j(O).icon)),F(x,f)},F0=N(()=>$j(j(O).icon)),J0=(x)=>{let f=N(()=>XJ(j(O).icon));var z0=U0(),l0=K0(z0);{var f0=(z)=>{var t=Nj();jj(t,()=>Yj(j(f)),!0),G0(t),F(z,t)},o0=(z)=>{var t=fJ();Q0(()=>S0(t,1,`icon icon-${j(O).icon}`,"svelte-rnx3ie")),F(z,t)};D0(l0,(z)=>{if(j(f))z(f0);else z(o0,-1)})}F(x,z0)};D0(b,(x)=>{if(j(_))x(p);else if(j(F0))x(E,1);else x(J0,-1)})}F(S,N0)};D0(n,(S)=>{if(j(O).icon)S(O0)})}G0(R),Q0((S,N0)=>{B=S0(R,1,"item-toolbar__button svelte-rnx3ie",null,B,S),L0(R,"aria-label",j(O).ariaLabel||j(O).label),L0(R,"aria-pressed",N0),L0(R,"title",j(O).tooltip||j(O).label),R.disabled=j(O).disabled},[()=>({"item-toolbar__button--active":Dj(j(O))}),()=>Dj(j(O))]),Pj("click",R,function(...S){j(O).onClick?.apply(this,S)}),F(H,R)};D0(A,(H)=>{if(j(c))H(y);else if(j($))H(j0,1);else H(T,-1)})}F(u,k)});var w=Gj(Y,2);e0(w,17,()=>j(QZ),(u)=>u.key,(u,O)=>{var l=U0(),o=K0(l);{var c=(A)=>{var y=U0(),j0=K0(y);Mj(j0,()=>j(c0),($)=>{var T=Oj();H0(T,(H,R)=>Ij?.(H,R),()=>({mounted:j(O),active:j(d0)[j(O).toolId]??!1})),F($,T)}),F(A,y)},k=(A)=>{var y=Oj();H0(y,(j0,$)=>Sj?.(j0,$),()=>j(O).entry.element),F(A,y)};D0(o,(A)=>{if(j(O).entry.shell)A(c);else A(k,-1)})}F(u,l)}),G0(Q);var i=Gj(Q,2);{var q0=(u)=>{var O=HZ();let l;e0(O,21,()=>j(ZJ),(o)=>o.key,(o,c)=>{var k=U0(),A=K0(k);{var y=($)=>{var T=U0(),H=K0(T);Mj(H,()=>j(c0),(R)=>{var B=TJ();H0(B,(n,O0)=>Ij?.(n,O0),()=>({mounted:j(c),active:j(d0)[j(c).toolId]??!1})),F(R,B)}),F($,T)},j0=($)=>{var T=TJ();H0(T,(H,R)=>Sj?.(H,R),()=>j(c).entry.element),F($,T)};D0(A,($)=>{if(j(c).entry.shell)$(y);else $(j0,-1)})}F(o,k)}),G0(O),Q0(()=>l=S0(O,1,"item-toolbar__controls-row svelte-rnx3ie",null,l,{"item-toolbar__controls-row--reserve":j(QJ),"item-toolbar__controls-row--active":j(UJ),"item-toolbar__controls-row--align-start":j(UZ)})),F(u,O)};D0(i,(u)=>{if(j(DZ))u(q0)})}G0(K),_J(K,(u)=>P0(R0,u),()=>j(R0)),Q0(()=>{Z=S0(K,1,`item-toolbar ${xj()??""} item-toolbar--${u0()??""}`,"svelte-rnx3ie",Z,{"item-toolbar--top":x0()==="top","item-toolbar--right":x0()==="right","item-toolbar--bottom":x0()==="bottom","item-toolbar--left":x0()==="left","item-toolbar--header-overlay-active":j(DJ)}),L0(K,"data-content-kind",j(E0)),L0(K,"data-level",j(C)),pJ(K,`--pie-toolbar-zoom-comp: ${j(dj)};`)}),F(J,K)};D0(YZ,(J)=>{if(s)J(OZ)})}return F(v,VJ),IJ(VZ)}yJ(["click"]);RZ("pie-item-toolbar",EJ(hJ,{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"}));
|
|
22
|
-
export{hJ as a};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Accessibility Tools Registrations
|
|
3
|
-
*
|
|
4
|
-
* Registers tools for visual accessibility and reading support:
|
|
5
|
-
* - Line Reader (reading guide)
|
|
6
|
-
* - Color Scheme (theme/contrast)
|
|
7
|
-
* - Annotation Toolbar (text highlighting)
|
|
8
|
-
*
|
|
9
|
-
* Maps to QTI 3.0 standard access features from:
|
|
10
|
-
* - visual category: highContrastDisplay, colorContrast
|
|
11
|
-
* - reading category: readingMask, readingGuide, highlighting
|
|
12
|
-
*/
|
|
13
|
-
import type { ToolRegistration } from "../../services/ToolRegistry.js";
|
|
14
|
-
/**
|
|
15
|
-
* Line Reader tool registration
|
|
16
|
-
*
|
|
17
|
-
* Provides a reading guide overlay to help track reading position.
|
|
18
|
-
* Useful for text-heavy passages and questions.
|
|
19
|
-
*/
|
|
20
|
-
export declare const lineReaderToolRegistration: ToolRegistration;
|
|
21
|
-
/**
|
|
22
|
-
* Theme tool registration
|
|
23
|
-
*
|
|
24
|
-
* Provides accessible theme and contrast controls.
|
|
25
|
-
* Global tool that affects entire assessment.
|
|
26
|
-
*/
|
|
27
|
-
export declare const themeToolRegistration: ToolRegistration;
|
|
28
|
-
/**
|
|
29
|
-
* Annotation Toolbar registration
|
|
30
|
-
*
|
|
31
|
-
* Text highlighting with CSS Custom Highlight API.
|
|
32
|
-
* Zero DOM mutation, optimal performance.
|
|
33
|
-
*/
|
|
34
|
-
export declare const annotationToolbarRegistration: ToolRegistration;
|