@pie-players/pie-assessment-toolkit 0.3.73 → 0.3.75
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 +469 -318
- package/dist/attempt/AssessmentSession.d.ts +1 -5
- package/dist/attempt/AssessmentSession.js +0 -29
- package/dist/attempt/TestSession.d.ts +1 -20
- package/dist/attempt/TestSession.js +8 -99
- package/dist/components/ItemScope.custom-element.d.ts +1 -0
- package/dist/components/ItemScope.custom-element.js +1 -0
- package/dist/components/ItemToolBar.custom-element.d.ts +1 -0
- package/dist/components/ItemToolBar.custom-element.js +1 -1
- package/dist/components/PieAssessmentToolkit.custom-element.d.ts +1 -0
- package/dist/components/PieAssessmentToolkit.custom-element.js +13 -13
- package/dist/components/SectionToolBar.custom-element.d.ts +1 -0
- package/dist/components/SectionToolBar.custom-element.js +1 -1
- package/dist/components/chunks/ItemToolBar-7tt7v2xp.js +4 -0
- package/dist/components/chunks/ItemToolBar-97hx60z4.js +2 -0
- package/dist/components/chunks/ItemToolBar-bxwyhr5p.js +2 -0
- package/dist/components/chunks/ItemToolBar-jx38w99s.js +2 -0
- package/dist/components/chunks/ItemToolBar-rd2bb4p6.js +40 -0
- package/dist/components/chunks/ItemToolBar-vdkyn9f3.js +2 -0
- package/dist/components/chunks/sre-engine-jd8cc08x.js +1 -0
- package/dist/components/item-scope-element.d.ts +2 -0
- package/dist/components/item-scope-element.js +2 -0
- package/dist/context/assessment-toolkit-context.d.ts +32 -6
- package/dist/index.d.ts +23 -48
- package/dist/index.js +12 -37
- package/dist/policy/core/PolicySource.d.ts +1 -1
- package/dist/policy/core/ToolPolicyEngine.d.ts +85 -34
- package/dist/policy/core/ToolPolicyEngine.js +148 -46
- package/dist/policy/core/compose-decision.d.ts +28 -7
- package/dist/policy/core/compose-decision.js +75 -54
- package/dist/policy/core/decision-types.d.ts +65 -34
- package/dist/policy/core/feature-decision.d.ts +16 -9
- package/dist/policy/core/feature-decision.js +14 -8
- package/dist/policy/core/pnp-policy-inputs.d.ts +24 -33
- package/dist/policy/core/pnp-policy-inputs.js +28 -56
- package/dist/policy/core/provenance.d.ts +9 -4
- package/dist/policy/core/provenance.js +1 -1
- package/dist/policy/engine.d.ts +7 -23
- package/dist/policy/engine.js +5 -20
- package/dist/policy/sources/PnpPolicySource.d.ts +44 -61
- package/dist/policy/sources/PnpPolicySource.js +117 -118
- package/dist/runtime/SectionControllerBinding.d.ts +279 -0
- package/dist/runtime/SectionControllerBinding.js +450 -0
- package/dist/runtime/SectionRuntimeEngine.d.ts +26 -289
- package/dist/runtime/SectionRuntimeEngine.js +30 -372
- package/dist/runtime/adapter/SectionEngineAdapter.d.ts +19 -80
- package/dist/runtime/adapter/SectionEngineAdapter.js +19 -92
- package/dist/runtime/adapter/dom-event-bridge.d.ts +15 -30
- package/dist/runtime/adapter/dom-event-bridge.js +17 -44
- package/dist/runtime/adapter/subscriber-fanout.d.ts +1 -2
- package/dist/runtime/adapter/subscriber-fanout.js +1 -2
- package/dist/runtime/catalog-context.d.ts +19 -0
- package/dist/runtime/catalog-context.js +28 -0
- package/dist/runtime/composition-emit-scheduler.d.ts +9 -15
- package/dist/runtime/composition-emit-scheduler.js +9 -15
- package/dist/runtime/content-language.d.ts +32 -0
- package/dist/runtime/content-language.js +46 -0
- package/dist/runtime/content-region.d.ts +17 -0
- package/dist/runtime/content-region.js +29 -0
- package/dist/runtime/content-registration.d.ts +13 -0
- package/dist/runtime/content-registration.js +25 -0
- package/dist/runtime/core/SectionEngineCore.d.ts +2 -2
- package/dist/runtime/core/SectionEngineCore.js +2 -2
- package/dist/runtime/core/cohort.d.ts +1 -1
- package/dist/runtime/core/cohort.js +1 -1
- package/dist/runtime/core/engine-input.d.ts +18 -30
- package/dist/runtime/core/engine-input.js +11 -12
- package/dist/runtime/core/engine-output.d.ts +16 -40
- package/dist/runtime/core/engine-output.js +9 -21
- package/dist/runtime/core/engine-readiness.d.ts +5 -37
- package/dist/runtime/core/engine-readiness.js +8 -41
- package/dist/runtime/core/engine-resolver.d.ts +46 -74
- package/dist/runtime/core/engine-resolver.js +18 -43
- package/dist/runtime/core/engine-state.d.ts +28 -36
- package/dist/runtime/core/engine-state.js +18 -21
- package/dist/runtime/core/engine-transition.d.ts +14 -19
- package/dist/runtime/core/engine-transition.js +71 -51
- package/dist/runtime/engine.d.ts +16 -19
- package/dist/runtime/engine.js +12 -19
- package/dist/runtime/page-warnings.d.ts +13 -0
- package/dist/runtime/page-warnings.js +22 -0
- package/dist/runtime/policy-input-forwarding.d.ts +25 -0
- package/dist/runtime/policy-input-forwarding.js +25 -0
- package/dist/runtime/registration-events.d.ts +14 -0
- package/dist/runtime/runtime-event-claim.d.ts +8 -0
- package/dist/runtime/runtime-event-claim.js +15 -0
- package/dist/runtime/shell-event-bridge.d.ts +45 -0
- package/dist/runtime/shell-event-bridge.js +127 -0
- package/dist/runtime/shell-registration.d.ts +73 -0
- package/dist/runtime/shell-registration.js +95 -0
- package/dist/runtime/shell-scope.d.ts +68 -0
- package/dist/runtime/shell-scope.js +188 -0
- package/dist/runtime/tool-host-contract.d.ts +28 -10
- package/dist/runtime/tool-host-contract.js +31 -10
- package/dist/runtime/unclaimed-registration-watch.d.ts +7 -0
- package/dist/runtime/unclaimed-registration-watch.js +23 -0
- package/dist/services/ElementToolStateStore.d.ts +14 -10
- package/dist/services/ElementToolStateStore.js +37 -13
- package/dist/services/HighlightCoordinator.d.ts +22 -28
- package/dist/services/HighlightCoordinator.js +431 -327
- package/dist/services/RangeSerializer.d.ts +10 -1
- package/dist/services/RangeSerializer.js +87 -14
- package/dist/services/TTSService.d.ts +130 -69
- package/dist/services/TTSService.js +713 -570
- package/dist/services/ToolCoordinator.d.ts +43 -66
- package/dist/services/ToolCoordinator.js +164 -208
- package/dist/services/ToolRegistry.d.ts +78 -54
- package/dist/services/ToolRegistry.js +107 -105
- package/dist/services/ToolkitCoordinator.d.ts +261 -175
- package/dist/services/ToolkitCoordinator.js +667 -433
- package/dist/services/audio-handoff.d.ts +6 -7
- package/dist/services/audio-handoff.js +20 -14
- package/dist/services/catalog-owner.d.ts +11 -1
- package/dist/services/catalog-owner.js +25 -0
- package/dist/services/create-tools-config.d.ts +2 -2
- package/dist/services/framework-error-bus.d.ts +3 -6
- package/dist/services/framework-error-bus.js +3 -6
- package/dist/services/framework-error.d.ts +30 -8
- package/dist/services/framework-error.js +9 -7
- package/dist/services/interfaces.d.ts +158 -129
- package/dist/services/section-controller-types.d.ts +15 -0
- package/dist/services/section-session-assignment.d.ts +21 -0
- package/dist/services/section-session-assignment.js +82 -0
- package/dist/services/spoken-audio-cards.d.ts +0 -2
- package/dist/services/spoken-audio-cards.js +1 -3
- package/dist/services/tool-config-defaults.d.ts +3 -3
- package/dist/services/tool-config-defaults.js +3 -3
- package/dist/services/tool-config-validation.d.ts +14 -4
- package/dist/services/tool-config-validation.js +63 -71
- package/dist/services/tool-context.d.ts +0 -8
- package/dist/services/tool-context.js +29 -25
- package/dist/services/tool-icons.d.ts +4 -3
- package/dist/services/tool-icons.js +4 -3
- package/dist/services/tool-instance-id.d.ts +0 -1
- package/dist/services/tool-instance-id.js +0 -6
- package/dist/services/tool-providers/TTSToolProvider.d.ts +41 -80
- package/dist/services/tool-providers/TTSToolProvider.js +81 -40
- package/dist/services/tool-providers/ToolProviderApi.d.ts +10 -4
- package/dist/services/tool-providers/ToolProviderRegistry.d.ts +32 -28
- package/dist/services/tool-providers/ToolProviderRegistry.js +121 -107
- package/dist/services/tool-providers/index.d.ts +0 -9
- package/dist/services/tool-providers/index.js +2 -4
- package/dist/services/tool-request.d.ts +27 -12
- package/dist/services/tool-request.js +24 -14
- package/dist/services/toolbar-decided-tools.d.ts +15 -0
- package/dist/services/toolbar-decided-tools.js +28 -0
- package/dist/services/tools-config-normalizer.d.ts +37 -23
- package/dist/services/tools-config-normalizer.js +2 -10
- package/dist/services/tts/browser-provider.d.ts +38 -2
- package/dist/services/tts/browser-provider.js +276 -140
- package/dist/services/tts/catalog-span-alignment.d.ts +2 -17
- package/dist/services/tts/catalog-span-alignment.js +17 -142
- package/dist/services/tts/flat-tree.d.ts +71 -0
- package/dist/services/tts/flat-tree.js +269 -0
- package/dist/services/tts/generated-speech/assemble-plan.d.ts +3 -1
- package/dist/services/tts/generated-speech/assemble-plan.js +3 -1
- package/dist/services/tts/generated-speech/dom/build-dom-plan.d.ts +2 -0
- package/dist/services/tts/generated-speech/dom/build-dom-plan.js +1 -1
- package/dist/services/tts/generated-speech/math-speech-cache.d.ts +3 -1
- package/dist/services/tts/generated-speech/math-speech-cache.js +5 -1
- package/dist/services/tts/generated-speech/types.d.ts +0 -12
- package/dist/services/tts/highlight-pipeline/boundary-normalizer.js +12 -62
- package/dist/services/tts/highlight-pipeline/create-highlight-plan.js +38 -5
- package/dist/services/tts/highlight-pipeline/normalize-speech-chunks.js +3 -6
- package/dist/services/tts/highlight-pipeline/prose-boundary-resolver.js +6 -4
- package/dist/services/tts/highlight-pipeline/readable-region.js +3 -2
- package/dist/services/tts/highlight-pipeline/types.d.ts +5 -0
- package/dist/services/tts/highlight-pipeline/visible-map-range.d.ts +12 -0
- package/dist/services/tts/highlight-pipeline/visible-map-range.js +73 -7
- package/dist/services/tts/math-alignment/index.d.ts +0 -5
- package/dist/services/tts/math-alignment/index.js +5 -25
- package/dist/services/tts/math-alignment/speech-tokenizer.d.ts +9 -1
- package/dist/services/tts/math-alignment/speech-tokenizer.js +38 -36
- package/dist/services/tts/math-alignment/types.d.ts +4 -2
- package/dist/services/tts/math-aware-text-processing.d.ts +5 -1
- package/dist/services/tts/math-aware-text-processing.js +74 -18
- package/dist/services/tts/math-control-names.d.ts +21 -0
- package/dist/services/tts/math-control-names.js +142 -0
- package/dist/services/tts/math-speech.d.ts +16 -1
- package/dist/services/tts/math-speech.js +55 -19
- package/dist/services/tts/provider-options.d.ts +41 -0
- package/dist/services/tts/provider-options.js +1 -0
- package/dist/services/tts/sre-engine.d.ts +7 -0
- package/dist/services/tts/sre-engine.js +11 -0
- package/dist/services/tts/sre-locales.d.ts +14 -0
- package/dist/services/tts/sre-locales.js +57 -0
- package/dist/services/tts/ssml/spoken-text.d.ts +2 -26
- package/dist/services/tts/ssml/spoken-text.js +29 -0
- package/dist/services/tts/start-failure.d.ts +11 -0
- package/dist/services/tts/start-failure.js +19 -0
- package/dist/services/tts/text-processing.d.ts +9 -1
- package/dist/services/tts/text-processing.js +46 -34
- package/dist/services/tts/text-segmentation.d.ts +7 -0
- package/dist/services/tts/text-segmentation.js +47 -0
- package/dist/services/tts-runtime-config.d.ts +44 -18
- package/dist/services/tts-runtime-config.js +22 -93
- package/dist/tools/content-capability-resolution.d.ts +7 -9
- package/dist/tools/content-capability-resolution.js +8 -45
- package/dist/tools/registration.d.ts +58 -0
- package/dist/tools/registration.js +54 -0
- package/dist/tools/registrations/toolbar-registration-helpers.js +2 -2
- package/dist/tools/tool-surface-host.d.ts +6 -10
- package/dist/tools/tool-surface-host.js +44 -42
- package/dist/tools/tool-tag-map.d.ts +5 -15
- package/dist/tools/tool-tag-map.js +6 -20
- package/dist/utils/structural-equality.d.ts +11 -0
- package/dist/utils/structural-equality.js +47 -0
- package/package.json +24 -59
- package/dist/attempt/adapters/activity-to-test-attempt-session.d.ts +0 -49
- package/dist/attempt/adapters/activity-to-test-attempt-session.js +0 -138
- package/dist/components/chunks/ItemToolBar-byq80z42.js +0 -40
- package/dist/components/chunks/ItemToolBar-d36g3aw4.js +0 -49
- package/dist/context/runtime-context-consumer.d.ts +0 -13
- package/dist/context/runtime-context-consumer.js +0 -51
- package/dist/item-loader.d.ts +0 -44
- package/dist/item-loader.js +0 -61
- package/dist/policy/core/engine-context.d.ts +0 -29
- package/dist/policy/core/engine-context.js +0 -27
- package/dist/policy/core/policy-source-tag.d.ts +0 -31
- package/dist/policy/core/policy-source-tag.js +0 -28
- package/dist/policy/internal.d.ts +0 -25
- package/dist/policy/internal.js +0 -25
- package/dist/runtime/adapter/coordinator-bridge.d.ts +0 -92
- package/dist/runtime/adapter/coordinator-bridge.js +0 -126
- package/dist/runtime/adapter/framework-error-bridge.d.ts +0 -36
- package/dist/runtime/adapter/framework-error-bridge.js +0 -46
- package/dist/runtime/adapter/instrumentation-bridge.d.ts +0 -31
- package/dist/runtime/adapter/instrumentation-bridge.js +0 -38
- package/dist/runtime/core/engine-stage-derivation.d.ts +0 -18
- package/dist/runtime/core/engine-stage-derivation.js +0 -29
- package/dist/runtime/engine-context.d.ts +0 -39
- package/dist/runtime/engine-context.js +0 -31
- package/dist/runtime/internal.d.ts +0 -43
- package/dist/runtime/internal.js +0 -45
- package/dist/runtime/section-runtime-engine-host-context.d.ts +0 -80
- package/dist/runtime/section-runtime-engine-host-context.js +0 -95
- package/dist/runtime/stage-emit-gate.d.ts +0 -92
- package/dist/runtime/stage-emit-gate.js +0 -82
- package/dist/services/I18nService.d.ts +0 -47
- package/dist/services/I18nService.js +0 -84
- package/dist/services/ThemeProvider.d.ts +0 -95
- package/dist/services/ThemeProvider.js +0 -334
- package/dist/services/ToolConfigResolver.d.ts +0 -161
- package/dist/services/ToolConfigResolver.js +0 -229
- package/dist/services/catalog-media.d.ts +0 -56
- package/dist/services/catalog-media.js +0 -190
- package/dist/services/createDefaultToolRegistry.d.ts +0 -53
- package/dist/services/createDefaultToolRegistry.js +0 -45
- package/dist/services/defaultPersonalNeedsProfile.d.ts +0 -21
- package/dist/services/defaultPersonalNeedsProfile.js +0 -26
- package/dist/services/pnp-standard-features.d.ts +0 -238
- package/dist/services/pnp-standard-features.js +0 -338
- package/dist/services/tool-providers/CortexToolProvider.d.ts +0 -13
- package/dist/services/tool-providers/CortexToolProvider.js +0 -32
- package/dist/services/tool-providers/DesmosToolProvider.d.ts +0 -14
- package/dist/services/tool-providers/DesmosToolProvider.js +0 -32
- package/dist/services/tool-providers/GeoGebraToolProvider.d.ts +0 -16
- package/dist/services/tool-providers/GeoGebraToolProvider.js +0 -32
- package/dist/services/tool-providers/LazyCalculatorToolProvider.d.ts +0 -35
- package/dist/services/tool-providers/LazyCalculatorToolProvider.js +0 -95
- package/dist/services/tts/visual-line-ranges.d.ts +0 -18
- package/dist/services/tts/visual-line-ranges.js +0 -226
- package/dist/tools/client.d.ts +0 -12
- package/dist/tools/client.js +0 -14
- package/dist/tools/index.d.ts +0 -8
- package/dist/tools/index.js +0 -10
- package/dist/tools/internal.d.ts +0 -43
- package/dist/tools/internal.js +0 -41
- package/dist/tools/response-discovery.d.ts +0 -61
- package/dist/tools/response-discovery.js +0 -113
- package/dist/tools/types.d.ts +0 -337
- package/dist/tools/types.js +0 -12
- package/dist/tools/variant-resolver.d.ts +0 -41
- package/dist/tools/variant-resolver.js +0 -207
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.75",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "PIE assessment toolkit: composable services + reference implementation for assessment players and tool coordination",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"import": "./dist/index.js"
|
|
23
23
|
},
|
|
24
|
-
"./tools/
|
|
25
|
-
"types": "./dist/tools/
|
|
26
|
-
"import": "./dist/tools/
|
|
24
|
+
"./tools/registration": {
|
|
25
|
+
"types": "./dist/tools/registration.d.ts",
|
|
26
|
+
"import": "./dist/tools/registration.js"
|
|
27
27
|
},
|
|
28
|
-
"./
|
|
29
|
-
"types": "./dist/
|
|
30
|
-
"import": "./dist/
|
|
28
|
+
"./components/item-scope-element": {
|
|
29
|
+
"types": "./dist/components/item-scope-element.d.ts",
|
|
30
|
+
"import": "./dist/components/item-scope-element.js"
|
|
31
31
|
},
|
|
32
32
|
"./components/item-toolbar-element": {
|
|
33
33
|
"types": "./dist/components/item-toolbar-element.d.ts",
|
|
@@ -45,29 +45,13 @@
|
|
|
45
45
|
"types": "./dist/services/AccessibilityCatalogResolver.d.ts",
|
|
46
46
|
"import": "./dist/services/AccessibilityCatalogResolver.js"
|
|
47
47
|
},
|
|
48
|
-
"./services/pnp-standard-features": {
|
|
49
|
-
"types": "./dist/services/pnp-standard-features.d.ts",
|
|
50
|
-
"import": "./dist/services/pnp-standard-features.js"
|
|
51
|
-
},
|
|
52
|
-
"./services/I18nService": {
|
|
53
|
-
"types": "./dist/services/I18nService.d.ts",
|
|
54
|
-
"import": "./dist/services/I18nService.js"
|
|
55
|
-
},
|
|
56
48
|
"./runtime/engine": {
|
|
57
49
|
"types": "./dist/runtime/engine.d.ts",
|
|
58
50
|
"import": "./dist/runtime/engine.js"
|
|
59
51
|
},
|
|
60
|
-
"./runtime/internal": {
|
|
61
|
-
"types": "./dist/runtime/internal.d.ts",
|
|
62
|
-
"import": "./dist/runtime/internal.js"
|
|
63
|
-
},
|
|
64
52
|
"./policy/engine": {
|
|
65
53
|
"types": "./dist/policy/engine.d.ts",
|
|
66
54
|
"import": "./dist/policy/engine.js"
|
|
67
|
-
},
|
|
68
|
-
"./policy/internal": {
|
|
69
|
-
"types": "./dist/policy/internal.d.ts",
|
|
70
|
-
"import": "./dist/policy/internal.js"
|
|
71
55
|
}
|
|
72
56
|
},
|
|
73
57
|
"files": [
|
|
@@ -77,46 +61,24 @@
|
|
|
77
61
|
"scripts": {
|
|
78
62
|
"build": "rm -rf dist tsconfig.tsbuildinfo && tsc -p tsconfig.json && bun ./scripts/build-ce-components.mjs",
|
|
79
63
|
"dev": "tsc -p tsconfig.json --watch",
|
|
80
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
81
|
-
"lint": "biome
|
|
82
|
-
"check": "
|
|
64
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.tests.json",
|
|
65
|
+
"lint": "biome lint .",
|
|
66
|
+
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
83
67
|
"test": "bun test"
|
|
84
68
|
},
|
|
85
69
|
"dependencies": {
|
|
86
|
-
"@pie-players/pie-calculator": "0.3.
|
|
87
|
-
"@pie-players/pie-context": "0.3.
|
|
88
|
-
"@pie-players/pie-players-shared": "0.3.
|
|
89
|
-
"@pie-players/pie-tts": "0.3.
|
|
90
|
-
"speech-rule-engine": "
|
|
91
|
-
},
|
|
92
|
-
"peerDependencies": {
|
|
93
|
-
"@pie-players/pie-calculator-cortex": "0.3.73",
|
|
94
|
-
"@pie-players/pie-calculator-desmos": "0.3.73",
|
|
95
|
-
"@pie-players/pie-calculator-geogebra": "0.3.73",
|
|
96
|
-
"@pie-players/tts-client-server": "0.3.73"
|
|
97
|
-
},
|
|
98
|
-
"peerDependenciesMeta": {
|
|
99
|
-
"@pie-players/pie-calculator-cortex": {
|
|
100
|
-
"optional": true
|
|
101
|
-
},
|
|
102
|
-
"@pie-players/pie-calculator-desmos": {
|
|
103
|
-
"optional": true
|
|
104
|
-
},
|
|
105
|
-
"@pie-players/pie-calculator-geogebra": {
|
|
106
|
-
"optional": true
|
|
107
|
-
},
|
|
108
|
-
"@pie-players/tts-client-server": {
|
|
109
|
-
"optional": true
|
|
110
|
-
}
|
|
70
|
+
"@pie-players/pie-calculator": "0.3.75",
|
|
71
|
+
"@pie-players/pie-context": "0.3.75",
|
|
72
|
+
"@pie-players/pie-players-shared": "0.3.75",
|
|
73
|
+
"@pie-players/pie-tts": "0.3.75",
|
|
74
|
+
"speech-rule-engine": "5.0.0-rc.4"
|
|
111
75
|
},
|
|
112
76
|
"devDependencies": {
|
|
113
|
-
"@biomejs/biome": "^2.5.
|
|
114
|
-
"@happy-dom/global-registrator": "^20.
|
|
115
|
-
"@pie-players/
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"@pie-players/tts-client-server": "0.3.73",
|
|
119
|
-
"svelte": "^5.57.0",
|
|
77
|
+
"@biomejs/biome": "^2.5.15",
|
|
78
|
+
"@happy-dom/global-registrator": "^20.14.5",
|
|
79
|
+
"@pie-players/tts-client-server": "0.3.75",
|
|
80
|
+
"svelte": "^5.57.1",
|
|
81
|
+
"svelte-check": "^4.7.6",
|
|
120
82
|
"typescript": "^5.9.3"
|
|
121
83
|
},
|
|
122
84
|
"homepage": "https://github.com/pie-framework/pie-players/tree/master/packages/assessment-toolkit#readme",
|
|
@@ -126,5 +88,8 @@
|
|
|
126
88
|
"engines": {
|
|
127
89
|
"node": ">=20.0.0"
|
|
128
90
|
},
|
|
129
|
-
"sideEffects":
|
|
91
|
+
"sideEffects": [
|
|
92
|
+
"./dist/components/*.js",
|
|
93
|
+
"./dist/components/chunks/*.js"
|
|
94
|
+
]
|
|
130
95
|
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { TestAttemptSession } from "../TestSession.js";
|
|
2
|
-
export interface PieBackendActivityItemRef {
|
|
3
|
-
identifier?: string;
|
|
4
|
-
item?: {
|
|
5
|
-
id?: string;
|
|
6
|
-
identifier?: string;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
export interface PieBackendActivityDefinition {
|
|
10
|
-
id?: string;
|
|
11
|
-
identifier?: string;
|
|
12
|
-
assessmentId?: string;
|
|
13
|
-
assessmentItemRefs?: PieBackendActivityItemRef[];
|
|
14
|
-
}
|
|
15
|
-
export interface PieBackendActivitySession {
|
|
16
|
-
id?: string;
|
|
17
|
-
activitySessionId?: string;
|
|
18
|
-
startedAt?: string;
|
|
19
|
-
updatedAt?: string;
|
|
20
|
-
completedAt?: string;
|
|
21
|
-
currentItemIndex?: number;
|
|
22
|
-
currentSectionIdentifier?: string;
|
|
23
|
-
visitedItemIdentifiers?: string[];
|
|
24
|
-
itemSessions?: Record<string, unknown>;
|
|
25
|
-
}
|
|
26
|
-
export interface MapActivityToTestAttemptSessionArgs {
|
|
27
|
-
activityDefinition?: PieBackendActivityDefinition | null;
|
|
28
|
-
activitySession?: PieBackendActivitySession | null;
|
|
29
|
-
itemRefs?: PieBackendActivityItemRef[];
|
|
30
|
-
itemSessionsByItemIdentifier?: Record<string, unknown>;
|
|
31
|
-
assessmentId?: string;
|
|
32
|
-
testAttemptSessionIdentifier?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface ActivitySessionPatchPayload {
|
|
35
|
-
activitySession: {
|
|
36
|
-
id: string;
|
|
37
|
-
startedAt?: string;
|
|
38
|
-
updatedAt?: string;
|
|
39
|
-
completedAt?: string;
|
|
40
|
-
currentItemIndex: number;
|
|
41
|
-
currentSectionIdentifier?: string;
|
|
42
|
-
visitedItemIdentifiers: string[];
|
|
43
|
-
itemSessions: Record<string, unknown>;
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export declare function mapActivityToTestAttemptSession(args: MapActivityToTestAttemptSessionArgs): TestAttemptSession;
|
|
47
|
-
export declare function toItemSessionsRecord(testAttemptSession: TestAttemptSession): Record<string, unknown>;
|
|
48
|
-
export declare function buildActivitySessionPatchFromTestAttemptSession(testAttemptSession: TestAttemptSession): ActivitySessionPatchPayload;
|
|
49
|
-
export declare function buildActivitySessionItemUpdate(testAttemptSession: TestAttemptSession, itemIdentifier: string): ActivitySessionPatchPayload;
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
function nowIso() {
|
|
2
|
-
return new Date().toISOString();
|
|
3
|
-
}
|
|
4
|
-
function getItemIdentifier(itemRef) {
|
|
5
|
-
return (itemRef.identifier || itemRef.item?.identifier || itemRef.item?.id || null);
|
|
6
|
-
}
|
|
7
|
-
function resolveItemIdentifiers(args) {
|
|
8
|
-
const refs = args.itemRefs || args.activityDefinition?.assessmentItemRefs || [];
|
|
9
|
-
const identifiers = refs
|
|
10
|
-
.map((itemRef) => getItemIdentifier(itemRef))
|
|
11
|
-
.filter((itemIdentifier) => !!itemIdentifier);
|
|
12
|
-
return Array.from(new Set(identifiers));
|
|
13
|
-
}
|
|
14
|
-
function resolveAssessmentId(args) {
|
|
15
|
-
return (args.assessmentId ||
|
|
16
|
-
args.activityDefinition?.assessmentId ||
|
|
17
|
-
args.activityDefinition?.identifier ||
|
|
18
|
-
args.activityDefinition?.id ||
|
|
19
|
-
"unknown-assessment");
|
|
20
|
-
}
|
|
21
|
-
function resolveTestAttemptSessionIdentifier(args, assessmentId) {
|
|
22
|
-
return (args.testAttemptSessionIdentifier ||
|
|
23
|
-
args.activitySession?.activitySessionId ||
|
|
24
|
-
args.activitySession?.id ||
|
|
25
|
-
`tas_${assessmentId}`);
|
|
26
|
-
}
|
|
27
|
-
function resolveBackendItemSessions(args) {
|
|
28
|
-
return {
|
|
29
|
-
...(args.activitySession?.itemSessions || {}),
|
|
30
|
-
...(args.itemSessionsByItemIdentifier || {}),
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
function mapItemSessions(itemIdentifiers, backendItemSessions) {
|
|
34
|
-
return itemIdentifiers.reduce((acc, itemIdentifier) => {
|
|
35
|
-
const rawSession = backendItemSessions[itemIdentifier];
|
|
36
|
-
if (!rawSession)
|
|
37
|
-
return acc;
|
|
38
|
-
const pieSessionId = typeof rawSession.id === "string" ? rawSession.id : undefined;
|
|
39
|
-
const attemptCount = typeof rawSession.attemptCount === "number" &&
|
|
40
|
-
rawSession.attemptCount > 0
|
|
41
|
-
? rawSession.attemptCount
|
|
42
|
-
: pieSessionId
|
|
43
|
-
? 1
|
|
44
|
-
: 0;
|
|
45
|
-
const isCompleted = typeof rawSession.isCompleted === "boolean"
|
|
46
|
-
? rawSession.isCompleted
|
|
47
|
-
: Boolean(rawSession.complete);
|
|
48
|
-
const startedAt = typeof rawSession.startedAt === "string"
|
|
49
|
-
? rawSession.startedAt
|
|
50
|
-
: undefined;
|
|
51
|
-
const updatedAt = typeof rawSession.updatedAt === "string"
|
|
52
|
-
? rawSession.updatedAt
|
|
53
|
-
: undefined;
|
|
54
|
-
const completedAt = typeof rawSession.completedAt === "string"
|
|
55
|
-
? rawSession.completedAt
|
|
56
|
-
: undefined;
|
|
57
|
-
acc[itemIdentifier] = {
|
|
58
|
-
itemIdentifier,
|
|
59
|
-
pieSessionId,
|
|
60
|
-
attemptCount,
|
|
61
|
-
isCompleted,
|
|
62
|
-
startedAt,
|
|
63
|
-
updatedAt,
|
|
64
|
-
completedAt,
|
|
65
|
-
session: rawSession,
|
|
66
|
-
};
|
|
67
|
-
return acc;
|
|
68
|
-
}, {});
|
|
69
|
-
}
|
|
70
|
-
export function mapActivityToTestAttemptSession(args) {
|
|
71
|
-
const assessmentId = resolveAssessmentId(args);
|
|
72
|
-
const itemIdentifiers = resolveItemIdentifiers(args);
|
|
73
|
-
const testAttemptSessionIdentifier = resolveTestAttemptSessionIdentifier(args, assessmentId);
|
|
74
|
-
const backendItemSessions = resolveBackendItemSessions(args);
|
|
75
|
-
const now = nowIso();
|
|
76
|
-
const startedAt = args.activitySession?.startedAt || now;
|
|
77
|
-
const updatedAt = args.activitySession?.updatedAt || startedAt;
|
|
78
|
-
return {
|
|
79
|
-
version: 1,
|
|
80
|
-
testAttemptSessionIdentifier,
|
|
81
|
-
assessmentId,
|
|
82
|
-
startedAt,
|
|
83
|
-
updatedAt,
|
|
84
|
-
completedAt: args.activitySession?.completedAt,
|
|
85
|
-
navigationState: {
|
|
86
|
-
currentItemIndex: args.activitySession?.currentItemIndex ?? -1,
|
|
87
|
-
visitedItemIdentifiers: [
|
|
88
|
-
...(args.activitySession?.visitedItemIdentifiers || []),
|
|
89
|
-
],
|
|
90
|
-
currentSectionIdentifier: args.activitySession?.currentSectionIdentifier,
|
|
91
|
-
},
|
|
92
|
-
realization: {
|
|
93
|
-
seed: testAttemptSessionIdentifier,
|
|
94
|
-
itemIdentifiers,
|
|
95
|
-
},
|
|
96
|
-
itemSessions: mapItemSessions(itemIdentifiers, backendItemSessions),
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
export function toItemSessionsRecord(testAttemptSession) {
|
|
100
|
-
return Object.entries(testAttemptSession.itemSessions).reduce((acc, [itemIdentifier, itemSession]) => {
|
|
101
|
-
if (itemSession.session) {
|
|
102
|
-
acc[itemIdentifier] = itemSession.session;
|
|
103
|
-
}
|
|
104
|
-
return acc;
|
|
105
|
-
}, {});
|
|
106
|
-
}
|
|
107
|
-
export function buildActivitySessionPatchFromTestAttemptSession(testAttemptSession) {
|
|
108
|
-
return {
|
|
109
|
-
activitySession: {
|
|
110
|
-
id: testAttemptSession.testAttemptSessionIdentifier,
|
|
111
|
-
startedAt: testAttemptSession.startedAt,
|
|
112
|
-
updatedAt: testAttemptSession.updatedAt,
|
|
113
|
-
completedAt: testAttemptSession.completedAt,
|
|
114
|
-
currentItemIndex: testAttemptSession.navigationState.currentItemIndex,
|
|
115
|
-
currentSectionIdentifier: testAttemptSession.navigationState.currentSectionIdentifier,
|
|
116
|
-
visitedItemIdentifiers: [
|
|
117
|
-
...testAttemptSession.navigationState.visitedItemIdentifiers,
|
|
118
|
-
],
|
|
119
|
-
itemSessions: toItemSessionsRecord(testAttemptSession),
|
|
120
|
-
},
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
export function buildActivitySessionItemUpdate(testAttemptSession, itemIdentifier) {
|
|
124
|
-
const itemSession = testAttemptSession.itemSessions[itemIdentifier];
|
|
125
|
-
return {
|
|
126
|
-
activitySession: {
|
|
127
|
-
id: testAttemptSession.testAttemptSessionIdentifier,
|
|
128
|
-
currentItemIndex: testAttemptSession.navigationState.currentItemIndex,
|
|
129
|
-
currentSectionIdentifier: testAttemptSession.navigationState.currentSectionIdentifier,
|
|
130
|
-
visitedItemIdentifiers: [
|
|
131
|
-
...testAttemptSession.navigationState.visitedItemIdentifiers,
|
|
132
|
-
],
|
|
133
|
-
itemSessions: itemSession?.session
|
|
134
|
-
? { [itemIdentifier]: itemSession.session }
|
|
135
|
-
: {},
|
|
136
|
-
},
|
|
137
|
-
};
|
|
138
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{A as U0,B as K0,D as $j,E as fL,F as CL,G as jL,H as IL,I as mj,J as r,K as uj,L as hj,N as cj,P as sj,R as ij,T as aj,c as OL,d as _j,e as Ej,f as O,g as d,h as AL,i as FL,j as vj,k as aL,l as UL,n as f0,o as XL,p as KL,q as L,s as Z0,t as gj,u as GL,v as QL,w as f,y as VL,z as H0}from"./ItemToolBar-d36g3aw4.js";import{ContextProvider as CJ}from"@pie-players/pie-context";function i0(H){return typeof H.href==="string"}function Aj(H){if(!H||typeof H!=="object"||Array.isArray(H))return!1;let R=H;if(typeof R.id!=="string"||R.id.trim().length===0)return!1;if(typeof R.label!=="string"||R.label.trim().length===0)return!1;if(R.ariaLabel!==void 0&&typeof R.ariaLabel!=="string")return!1;if(R.icon!==void 0&&typeof R.icon!=="string")return!1;if(R.tooltip!==void 0&&typeof R.tooltip!=="string")return!1;if(R.active!==void 0&&typeof R.active!=="boolean")return!1;if(R.disabled!==void 0&&typeof R.disabled!=="boolean")return!1;let p=typeof R.href==="string",YL=typeof R.onClick==="function";if(p===YL)return!1;if(p)return!0;return YL}function a0(H){return typeof H==="string"&&H.trimStart().startsWith("<svg")}function d0(H){return typeof H==="string"&&H.trimStart().startsWith("http")}import{sanitizeSvgIcon as W0}from"@pie-players/pie-players-shared/security";import{resolveInterfaceI18n as IJ}from"@pie-players/pie-players-shared/i18n/provider";import{collectFocusable as yJ,createFocusTrap as pJ,FOCUSABLE_SELECTOR as bJ,isProgrammaticFocusTarget as _J}from"@pie-players/pie-players-shared";var BJ={calculator:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Zm0 2v4h10V4H7Zm0 6v2h2v-2H7Zm4 0v2h2v-2h-2Zm4 0v2h2v-2h-2Zm-8 4v2h2v-2H7Zm4 0v2h2v-2h-2Zm4 0v2h2v-2h-2Zm-8 4v2h2v-2H7Zm4 0v2h2v-2h-2Zm4 0v2h2v-2h-2Z" fill="currentColor"/></svg>',"volume-up":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 3.23v2.06A7.002 7.002 0 0 1 19 12a7 7 0 0 1-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77Zm-2 17.75V3L7 8H3v8h4l5 5Zm4.5-9a4.5 4.5 0 0 0-2.5-4.03v8.05A4.5 4.5 0 0 0 16.5 12Z" fill="currentColor"/></svg>',swatch:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3a9 9 0 1 0 9 9c0-.55-.45-1-1-1h-2.5a1.5 1.5 0 0 1 0-3H20a1 1 0 0 0 1-1 8.99 8.99 0 0 0-9-4Zm-5.5 9A1.5 1.5 0 1 1 8 13.5 1.5 1.5 0 0 1 6.5 12Zm3-4A1.5 1.5 0 1 1 11 9.5 1.5 1.5 0 0 1 9.5 8Zm5 0A1.5 1.5 0 1 1 16 9.5 1.5 1.5 0 0 1 14.5 8Z" fill="currentColor"/></svg>',"chart-bar":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.75 5a.76.76 0 0 1 .75.75v11c0 .438.313.75.75.75h13a.76.76 0 0 1 .696 1.039.74.74 0 0 1-.696.461h-13C5 19 4 18 4 16.75v-11A.74.74 0 0 1 4.75 5ZM8 8.25a.74.74 0 0 1 .75-.75h6.5a.76.76 0 0 1 .696 1.039.74.74 0 0 1-.696.461h-6.5A.722.722 0 0 1 8 8.25Zm.75 2.25h4.5a.76.76 0 0 1 .696 1.039.74.74 0 0 1-.696.461h-4.5a.723.723 0 0 1-.75-.75.74.74 0 0 1 .75-.75Zm0 3h8.5a.76.76 0 0 1 .696 1.039.74.74 0 0 1-.696.461h-8.5a.723.723 0 0 1-.75-.75.74.74 0 0 1 .75-.75Z" fill="currentColor"/></svg>',beaker:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 21c-.85 0-1.454-.38-1.813-1.137-.358-.759-.27-1.463.263-2.113L9 11V5H8a.968.968 0 0 1-.713-.287A.968.968 0 0 1 7 4c0-.283.096-.52.287-.712A.968.968 0 0 1 8 3h8c.283 0 .52.096.712.288.192.191.288.429.288.712s-.096.52-.288.713A.968.968 0 0 1 16 5h-1v6l5.55 6.75c.533.65.62 1.354.262 2.113C20.454 20.62 19.85 21 19 21H5Zm2-3h10l-3.4-4h-3.2L7 18Zm-2 1h14l-6-7.3V5h-2v6.7L5 19Z" fill="currentColor"/></svg>',protractor:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m6.75 21-.25-2.2 2.85-7.85a3.95 3.95 0 0 0 1.75.95l-2.75 7.55L6.75 21Zm10.5 0-1.6-1.55-2.75-7.55a3.948 3.948 0 0 0 1.75-.95l2.85 7.85-.25 2.2ZM12 11a2.893 2.893 0 0 1-2.125-.875A2.893 2.893 0 0 1 9 8c0-.65.188-1.23.563-1.737A2.935 2.935 0 0 1 11 5.2V3h2v2.2c.583.2 1.063.554 1.438 1.063C14.812 6.77 15 7.35 15 8c0 .833-.292 1.542-.875 2.125A2.893 2.893 0 0 1 12 11Zm0-2c.283 0 .52-.096.713-.287A.967.967 0 0 0 13 8a.967.967 0 0 0-.287-.713A.968.968 0 0 0 12 7a.968.968 0 0 0-.713.287A.967.967 0 0 0 11 8c0 .283.096.52.287.713.192.191.43.287.713.287Z" fill="currentColor"/></svg>',"bars-3":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.85 15c.517 0 .98-.15 1.388-.45.408-.3.695-.692.862-1.175l.375-1.15c.267-.8.2-1.537-.2-2.213C8.875 9.337 8.3 9 7.55 9H4.025l.475 3.925c.083.583.346 1.075.787 1.475.442.4.963.6 1.563.6Zm10.3 0c.6 0 1.12-.2 1.563-.6.441-.4.704-.892.787-1.475L19.975 9h-3.5c-.75 0-1.325.342-1.725 1.025-.4.683-.467 1.425-.2 2.225l.35 1.125c.167.483.454.875.862 1.175.409.3.871.45 1.388.45Zm-10.3 2c-1.1 0-2.063-.363-2.887-1.088a4.198 4.198 0 0 1-1.438-2.737L2 9H1V7h6.55c.733 0 1.404.18 2.013.537A3.906 3.906 0 0 1 11 9h2.025c.35-.617.83-1.104 1.438-1.463A3.892 3.892 0 0 1 16.474 7H23v2h-1l-.525 4.175a4.198 4.198 0 0 1-1.438 2.737A4.238 4.238 0 0 1 17.15 17c-.95 0-1.804-.27-2.562-.813A4.234 4.234 0 0 1 13 14.026l-.375-1.125a21.35 21.35 0 0 1-.1-.363 4.926 4.926 0 0 1-.1-.537h-.85c-.033.2-.067.363-.1.488a21.35 21.35 0 0 1-.1.362L11 14a4.3 4.3 0 0 1-1.588 2.175A4.258 4.258 0 0 1 6.85 17Z" fill="currentColor"/></svg>',ruler:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m8.8 10.95 2.15-2.175-1.4-1.425-1.1 1.1-1.4-1.4 1.075-1.1L7 4.825 4.825 7 8.8 10.95Zm8.2 8.225L19.175 17l-1.125-1.125-1.1 1.075-1.4-1.4 1.075-1.1-1.425-1.4-2.15 2.15L17 19.175ZM7.25 21H3v-4.25l4.375-4.375L2 7l5-5 5.4 5.4 3.775-3.8c.2-.2.425-.35.675-.45a2.068 2.068 0 0 1 1.55 0c.25.1.475.25.675.45L20.4 4.95c.2.2.35.425.45.675.1.25.15.508.15.775a1.975 1.975 0 0 1-.6 1.425l-3.775 3.8L22 17l-5 5-5.375-5.375L7.25 21ZM5 19h1.4l9.8-9.775L14.775 7.8 5 17.6V19Z" fill="currentColor"/></svg>',"book-open":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 6.25a6.6 6.6 0 0 0-2.3-1.32A8.6 8.6 0 0 0 7 4.5c-.63 0-1.25.06-1.85.18-.6.12-1.19.3-1.76.54a1.5 1.5 0 0 0-.93 1.4v10.1c0 .52.26.98.68 1.24.42.26.92.28 1.35.06.36-.18.75-.31 1.18-.4.42-.09.86-.13 1.33-.13.78 0 1.53.14 2.24.42.7.28 1.35.7 1.93 1.24l.83-.75.83.75c.58-.54 1.22-.96 1.93-1.24a6.1 6.1 0 0 1 2.24-.42c.47 0 .91.04 1.33.13.43.09.82.22 1.18.4.43.22.93.2 1.35-.06.42-.26.68-.72.68-1.24V6.62c0-.6-.36-1.15-.93-1.4a9.3 9.3 0 0 0-1.76-.54A9.8 9.8 0 0 0 17 4.5a8.6 8.6 0 0 0-2.7.43A6.6 6.6 0 0 0 12 6.25Zm1 10.06V8.02c.55-.5 1.16-.88 1.84-1.13A6 6 0 0 1 17 6.5c.45 0 .89.04 1.32.11.43.08.85.19 1.26.34v9.24a8.2 8.2 0 0 0-1.28-.24A10 10 0 0 0 17 15.85c-.72 0-1.42.09-2.09.26a7.7 7.7 0 0 0-1.91.8Zm-2 0a7.7 7.7 0 0 0-1.91-.8 8.4 8.4 0 0 0-2.09-.26c-.44 0-.87.02-1.3.07-.43.05-.86.13-1.28.24V6.95c.41-.15.83-.26 1.26-.34A7.7 7.7 0 0 1 7 6.5c.76 0 1.48.13 2.16.39.68.25 1.29.63 1.84 1.13Z" fill="currentColor"/></svg>',photo:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 21c-.55 0-1.02-.2-1.41-.59A1.93 1.93 0 0 1 2 19V5c0-.55.2-1.02.59-1.41A1.93 1.93 0 0 1 4 3h16c.55 0 1.02.2 1.41.59.39.39.59.86.59 1.41v14c0 .55-.2 1.02-.59 1.41-.39.39-.86.59-1.41.59H4Zm0-2h16V5H4v14Zm1.5-2.5h13l-4.1-5.47-3.4 4.47-2.5-3.25L5.5 16.5ZM8.5 10a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" fill="currentColor"/></svg>'};function Cj(H){return BJ[H]||null}var SJ=["assessment","section","item","passage","rubric"],TJ=new Set(SJ);function Ij(H){return TJ.has(H)}function k0(H,R,p){let YL=H.trim(),HL=p.trim();if(!YL||!HL)throw Error("Tool instance ids require non-empty tool and scope ids");if(!Ij(R))throw Error(`Unknown tool scope level '${R}'. Register custom levels with registerToolScopeLevel().`);return`${YL}:${R}:${HL}`}function r0(H){let R=H.split(":");if(R.length!==3)return null;let[p,YL,HL]=R;if(!p||!HL)return null;if(!Ij(YL))return null;return{baseToolId:p,scopeLevel:YL,scopeId:HL}}import"@pie-players/pie-players-shared/nds-icon-button";var AJ=(H,R)=>{if(customElements.get(H))return;try{customElements.define(H,R)}catch(p){if(!(p instanceof DOMException&&p.name==="NotSupportedError"||p&&typeof p==="object"&&p.name==="NotSupportedError")||!customElements.get(H))throw p}},w0=GL('<span class="item-toolbar__element-host svelte-rnx3ie"></span>'),EJ=GL('<span class="item-toolbar__nds-button-zoom svelte-rnx3ie"><nds-icon-button></nds-icon-button></span>',2),z0=GL('<span aria-hidden="true"></span>'),yj=GL('<img class="item-toolbar__icon-image svelte-rnx3ie" alt=""/>'),pj=GL('<i aria-hidden="true"></i>'),vJ=GL("<a><!></a>"),gJ=GL('<button type="button"><!></button>'),bj=GL('<span class="item-toolbar__controls-host svelte-rnx3ie"></span>'),$J=GL("<div></div>"),mJ=GL('<div><div class="item-toolbar__tools-row svelte-rnx3ie"><!> <!> <!></div> <!></div>'),uJ={hash:"svelte-rnx3ie",code:`.item-toolbar.svelte-rnx3ie {display:flex;flex-direction:column;align-items:flex-end;min-width:0;max-width:100%;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:wrap;gap:0.5rem;max-width:100%;min-height:var(--pie-toolbar-tools-row-height);}
|
|
2
|
-
|
|
3
|
-
/* A granted section tool must stay reachable even when there isn't room for
|
|
4
|
-
every button: scroll the row rather than clipping items past the edge,
|
|
5
|
-
which left them impossible to focus, tab to, or click. \`min-width: 0\`
|
|
6
|
-
beats the flex default (\`auto\`, i.e. never shrink below content), which
|
|
7
|
-
would otherwise keep the row at full content width and make overflow-x
|
|
8
|
-
moot. Item and passage rows wrap without an overflow clip so an inline
|
|
9
|
-
reading-controls panel can still extend outside the row. */.item-toolbar[data-level="section"].svelte-rnx3ie .item-toolbar__tools-row:where(.svelte-rnx3ie) {flex-wrap:nowrap;justify-content:flex-start;
|
|
10
|
-
/* Keep the focus outline inside the scrolling box on both axes. */padding:4px;scroll-padding:4px;box-sizing:border-box;overflow-x:auto;max-width:100%;min-width:0;}.item-toolbar__controls-row.svelte-rnx3ie {display:flex;align-items:center;justify-content:flex-end;width:100%;min-height:0;height:auto;}.item-toolbar__controls-row--reserve.svelte-rnx3ie {min-height:var(--pie-tts-controls-row-height);height:var(--pie-tts-controls-row-height);}.item-toolbar__controls-row--active.svelte-rnx3ie {min-height:var(--pie-tts-controls-row-height);height:var(--pie-tts-controls-row-height);}.item-toolbar__controls-row--align-start.svelte-rnx3ie {justify-content:flex-start;}.item-toolbar__controls-host.svelte-rnx3ie {display:inline-flex;align-items:center;justify-content:flex-end;width:100%;}.item-toolbar--top.svelte-rnx3ie,
|
|
11
|
-
.item-toolbar--bottom.svelte-rnx3ie {align-items:flex-end;}.item-toolbar--left.svelte-rnx3ie,
|
|
12
|
-
.item-toolbar--right.svelte-rnx3ie {align-items:stretch;}.item-toolbar--left.svelte-rnx3ie .item-toolbar__tools-row:where(.svelte-rnx3ie),
|
|
13
|
-
.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),
|
|
14
|
-
.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;flex-shrink:0;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;}
|
|
15
|
-
|
|
16
|
-
/* Drive the vendored NDS icon button's outer size via its own \`--height-32\`
|
|
17
|
-
custom property so its light-DOM inner button matches the toolbar's
|
|
18
|
-
md/sm/lg dimensions (32 / 44 / 40 px) without a layout shift. The glyph
|
|
19
|
-
keeps the NDS-native icon size (we render size="small"), so it isn't
|
|
20
|
-
oversized. */.item-toolbar__nds-button-zoom.svelte-rnx3ie {display:inline-flex;flex-shrink:0;}.item-toolbar.svelte-rnx3ie nds-icon-button:where(.svelte-rnx3ie) {
|
|
21
|
-
/* Host-settable button size per toolbar size (drives the NDS outer button
|
|
22
|
-
via its own --height-32). */--height-32: var(--pie-calculator-button-size, 2rem);
|
|
23
|
-
/* Host-settable accent for the calculator button: the NDS tertiary glyph
|
|
24
|
-
colour derives from --color-interactive-blue, remapped here to a
|
|
25
|
-
themeable variable. --pie-calculator-button-color is package-private, so
|
|
26
|
-
nothing sets it and the default is what ships: it now resolves through
|
|
27
|
-
--pie-button-color (DaisyUI base-content) instead of holding the Figma
|
|
28
|
-
blue on every theme, with the literal as the no-theme last resort.
|
|
29
|
-
Not --pie-primary or --pie-tertiary: both are \`direct\` mappings of
|
|
30
|
-
DaisyUI slots chosen to pair with their own -content colour, so a glyph
|
|
31
|
-
taken from either sits at 1.37:1 against the page under \`pastel\` and 11
|
|
32
|
-
of the 35 shipped themes fall under SC 1.4.11's 3:1. */--color-interactive-blue: var(--pie-calculator-button-color, var(--pie-button-color, var(--pie-text, #222)));
|
|
33
|
-
/* NDS palette bridge — keep in sync with the copies in tool-tts-inline
|
|
34
|
-
and section-player SectionItemsPane (asserted by
|
|
35
|
-
scripts/check-theme-tokens.mjs). The vendored button paints its fill,
|
|
36
|
-
its on-accent glyph, its hover ring and its focus ring from the NDS
|
|
37
|
-
design-system palette, which no PIE theme sets, so a tertiary button
|
|
38
|
-
kept a #f3f5f7 pill on every page — and once the glyph followed the
|
|
39
|
-
theme, a light glyph landed on that light pill. */--color-new-gray: var(--pie-background-dark, #f3f5f7);--color-primary-white: var(--pie-white, #ffffff);--color-primary-black: var(--pie-text, #000000);--color-focus-blue: var(--pie-button-focus-outline, #2b87ff);}.item-toolbar--sm.svelte-rnx3ie nds-icon-button:where(.svelte-rnx3ie) {--height-32: var(--pie-calculator-button-size-sm, 2.75rem);}.item-toolbar--lg.svelte-rnx3ie nds-icon-button:where(.svelte-rnx3ie) {--height-32: var(--pie-calculator-button-size-lg, 2.5rem);}.item-toolbar__element-host.svelte-rnx3ie {display:contents;}.item-toolbar--sm.svelte-rnx3ie .item-toolbar__button:where(.svelte-rnx3ie) {width:2.75rem;height:2.75rem;}.item-toolbar--sm.svelte-rnx3ie {--pie-toolbar-tools-row-height: 2.75rem;--pie-tts-controls-row-height: 3.625rem;}.item-toolbar--lg.svelte-rnx3ie .item-toolbar__button:where(.svelte-rnx3ie) {width:2.5rem;height:2.5rem;}.item-toolbar--lg.svelte-rnx3ie {--pie-toolbar-tools-row-height: 2.5rem;--pie-tts-controls-row-height: 3.375rem;}.item-toolbar__button.svelte-rnx3ie:hover:not(:disabled) {background-color:var(--pie-button-hover-bg, var(--pie-secondary-background, #f5f5f5));border-color:var(--pie-button-hover-border, var(--pie-button-border, var(--pie-border, #ccc)));color:var(--pie-button-hover-color, var(--pie-button-color, var(--pie-text, #333)));transform:translateY(-1px);box-shadow:0 2px 4px color-mix(in srgb, var(--pie-black, #000) 10%, transparent);}.item-toolbar__button.svelte-rnx3ie:active:not(:disabled) {transform:translateY(0);box-shadow:none;}.item-toolbar__button--active.svelte-rnx3ie {background-color:var(--pie-primary, #1976d2);color:var(--pie-white, #fff);border-color:var(--pie-primary, #1976d2);}.item-toolbar__button--active.svelte-rnx3ie:hover:not(:disabled) {background-color:var(--pie-primary-dark, #1565c0);}.item-toolbar__button.svelte-rnx3ie:focus-visible {outline:2px solid var(--pie-button-focus-outline, var(--pie-primary, #1976d2));outline-offset:2px;}.item-toolbar__button.svelte-rnx3ie:disabled {opacity:0.5;cursor:not-allowed;}.item-toolbar__button.svelte-rnx3ie svg {width:100%;height:100%;}.item-toolbar__icon-image.svelte-rnx3ie {width:100%;height:100%;object-fit:contain;}`};function dj(H,R){_j(R,!0),$j(H,uJ);let p=typeof window<"u",YL=["/_fa-pro/fontawesome.min.css","/_fa-pro/light.min.css"],HL="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css",rj="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap",l0=/font.?awesome|fa-?pro/i,o0=!1,x0=()=>{if(!p||o0)return;if(o0=!0,!document.querySelector('link[href*="Roboto"]')){let U=document.createElement("link");U.rel="stylesheet",U.href=rj,document.head.appendChild(U)}if(Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).some((U)=>l0.test(U.href)))return;if(!document.querySelector(`link[href="${HL}"]`)){let U=document.createElement("link");U.rel="stylesheet",U.href=HL,document.head.appendChild(U)}for(let U of YL){if(document.querySelector(`link[href="${U}"]`))continue;let J=document.createElement("link");J.rel="stylesheet",J.href=U,document.head.appendChild(J)}},n0="__pieFaToolbarShadowInstalled",lj=(j)=>{let U=j.getRootNode();if(!(U instanceof ShadowRoot))return;let J=U;if(J[n0])return;J[n0]=!0;let K=new Set,F=(V)=>{if(!V||K.has(V))return;K.add(V);let N=document.createElement("link");N.rel="stylesheet",N.href=V,U.appendChild(N)},b=Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).filter((V)=>l0.test(V.href));for(let V of b)F(V.href)},oj=(j)=>{return x0(),lj(j),{}},nj=(j,U)=>{let J=U,K=()=>{let b=j.querySelector("button");if(b)b.setAttribute("aria-pressed",J?"true":"false")};K();let F=new MutationObserver(K);return F.observe(j,{childList:!0,subtree:!0}),{update(b){J=b,K()},destroy(){F.disconnect()}}},t0=(j)=>j.faIconName||null,tj=new aj,yL=AL(vj({})),$L=r(R,"level",7,"item"),Q0=r(R,"scopeId",7,""),B0=r(R,"itemId",7,""),S0=r(R,"sectionId",7,""),T0=r(R,"catalogId",7,""),A0=r(R,"tools",7,""),C0=r(R,"contentKind",7,"assessment-item"),xL=r(R,"position",7,"bottom"),dL=r(R,"scopeElement",7,null),I0=r(R,"toolRegistry",7,null),y0=r(R,"item",7,null),V0=r(R,"hostButtons",23,()=>[]),p0=r(R,"class",7,""),rL=r(R,"size",7,"md"),X0=r(R,"language",7,"en-US"),ML=AL(null),x=AL(null),lL=O(()=>L(x)?.ndsIcons===!0),oL=O(()=>IJ(L(x))),pL=AL(null),nL=AL(0),Y0=AL(0),b0=AL(0);XL(()=>{if(!L(ML))return;return cj(L(ML),(j)=>{FL(x,j,!0)})}),XL(()=>{if(!L(ML))return;return sj(L(ML),(j)=>{FL(pL,j,!0)})}),XL(()=>{let j=L(x)?.toolkitCoordinator;if(!j||typeof j.onPolicyChange!=="function")return;let U=j.onPolicyChange(()=>{FL(Y0,L(Y0)+1)});return()=>{try{U?.()}catch{}}}),XL(()=>{let j=L(x)?.toolkitCoordinator;if(!j||typeof j.onToolContextResolverChange!=="function")return;let U=j.onToolContextResolverChange(()=>{FL(b0,L(b0)+1)});return()=>{try{U?.()}catch{}}});let B=O(()=>L(x)?.toolCoordinator),e0=O(()=>L(x)?.ttsService),mL=O(()=>L(x)?.elementToolStateStore),D0=O(()=>L(x)?.assessmentId??""),tL=O(()=>B0()||L(pL)?.itemId||""),l=O(()=>L(pL)?.canonicalItemId||L(tL)),BL=O(()=>S0()||L(x)?.sectionId||""),uL=O(()=>C0()||L(pL)?.contentKind||($L()==="section"?"section":"assessment-item")),C=O(()=>{if($L()&&$L()!=="item")return $L();if(L(uL)==="rubric-block-stimulus")return"passage";return"item"}),PL=O(()=>{if(Q0())return Q0();if(L(C)==="section")return L(BL)||L(x)?.sectionId||"default-section";if(L(C)==="assessment")return L(x)?.assessmentId||"default-assessment";return L(l)||L(tL)||"default-item"}),Lj=O(()=>T0()||L(PL)),kL=O(()=>y0()||L(pL)?.item||null),t=O(()=>I0()||tj),ej=O(()=>ij(A0())),LJ=O(()=>L(t).normalizeToolIds(L(ej)).filter(Boolean)),jj=O(()=>{if(L(C)==="section")return"section";if(L(C)==="passage"||L(uL)==="rubric-block-stimulus")return"passage";return"item"}),O0=O(()=>{L(Y0);let j=L(x)?.toolkitCoordinator;if(!j||typeof j.decideToolPolicy!=="function")return null;return j.decideToolPolicy({level:L(jj),scope:{level:L(C),scopeId:L(PL),assessmentId:L(x)?.assessmentId,sectionId:L(BL)||void 0,itemId:L(tL)||void 0,canonicalItemId:L(l)||void 0,contentKind:L(uL)}})}),Jj=O(()=>{let j=(U)=>Array.from(new Set(U));if(L(O0))return j(L(t).normalizeToolIds(L(O0).visibleTools.map((U)=>U.toolId)).filter(Boolean));return j(L(LJ))}),jJ=O(()=>{let j=new Set;if(!L(O0))return j;for(let U of L(O0).visibleTools){if(!U.required&&!U.alwaysAvailable)continue;for(let J of L(t).normalizeToolIds([U.toolId]).filter(Boolean))j.add(J)}return j}),_0=O(()=>{if(L(C)==="section"||L(C)==="assessment")return!0;let j=L(kL)?.config;return!!(L(kL)&&j&&typeof j==="object")}),Zj=O(()=>{L(Y0);let j=L(x)?.toolkitCoordinator;if(!j||typeof j.getPolicyInputs!=="function")return null;return j.getPolicyInputs()}),hL=O(()=>L(Zj)?.assessment??null),G0=O(()=>L(Zj)?.currentItemRef??null),bL=O(()=>{if(L(C)==="section")return{level:"section",assessment:L(hL)||{},section:{}};if(L(C)==="assessment")return{level:"assessment",assessment:L(hL)||{}};if(!L(_0)||!L(kL))return null;if(L(C)==="passage")return{level:"passage",assessment:L(hL)||{},itemRef:L(G0)||{id:L(l)},passage:L(kL)};return{level:"item",assessment:L(hL)||{},itemRef:L(G0)||{id:L(l)},item:L(kL)}}),Uj=O(()=>{if(L(bL))return L(bL);return{level:"item",assessment:L(hL)||{},itemRef:L(G0)||{id:L(l)},item:L(kL)||{id:L(l),config:{}}}}),M0=O(()=>{if(L(C)!=="item"&&L(C)!=="passage")return[];if(!L(_0)||!L(kL))return[];let j=L(kL)?.config?.models;return(Array.isArray(j)?j:j&&typeof j==="object"?Object.values(j):[]).filter((J)=>J&&typeof J==="object"&&typeof J.id==="string").map((J)=>({level:"element",assessment:L(hL)||{},itemRef:L(G0)||{id:L(l)},item:L(kL),elementId:J.id}))}),JJ=O(()=>{let j=L(x)?.toolkitCoordinator||null,U=(J)=>r0(J)?J:k0(J,L(C),L(PL));return{scope:{level:L(C),scopeId:L(PL),assessmentId:L(x)?.assessmentId,sectionId:L(BL),itemId:L(tL),canonicalItemId:L(l),contentKind:L(uL)},itemId:L(PL),catalogId:L(Lj),language:X0(),i18n:L(oL),ui:{size:rL()},getScopeElement:()=>dL()||L(pL)?.scopeElement||null,getGlobalElementId:()=>{if(!L(mL)||!L(D0)||!L(BL)||!L(l))return null;return L(mL).getGlobalElementId(L(D0),L(BL),L(l),L(l))},toolCoordinator:L(B)||null,toolkitCoordinator:j,ttsService:L(e0)||null,elementToolStateStore:L(mL)||null,toggleTool:(J)=>{if(!L(B))return;let K=U(J);if(!L(B).getToolState(K))L(B).registerTool(K,J);L(B).toggleTool(K)},isToolVisible:(J)=>{if(!L(B))return!1;return L(B).isToolVisible(U(J))},subscribeVisibility:L(B)?(J)=>L(B).subscribe(J):null}}),E0=O(()=>{L(b0);let j=L(x)?.toolkitCoordinator;if(!j||typeof j.hasToolContextResolver!=="function"||typeof j.resolveToolContext!=="function")return{};let U={};for(let J of L(Jj)){if(!L(t).get(J)?.supportedLevels.includes(L(C)))continue;if(!j.hasToolContextResolver(J))continue;let F=j.resolveToolContext({toolId:J,context:L(Uj),toolbarContext:L(JJ)});if(F)U[J]=F}return U}),ZJ=O(()=>{let j=L(Jj).filter((V)=>{let N=L(t).get(V);return N?N.supportedLevels.includes(L(C)):!1}),U=Object.values(L(E0)),J=new Set(U.map((V)=>V.toolId)),K=new Set(U.filter((V)=>V.visible).map((V)=>V.toolId)),F=j.filter((V)=>!J.has(V));if(L(C)==="section")return F.forEach((V)=>K.add(V)),Array.from(K);if(!L(_0))return F.forEach((V)=>K.add(V)),Array.from(K);if(!L(bL)&&L(M0).length===0)return F.forEach((V)=>K.add(V)),Array.from(K);if(F.filter((V)=>L(jJ).has(V)).forEach((V)=>K.add(V)),L(bL))L(t).filterVisibleInContext(F,L(bL)).forEach((V)=>K.add(V.toolId));for(let V of L(M0))L(t).filterVisibleInContext(F,V).forEach((N)=>K.add(N.toolId));let b=L(bL)?[L(bL),...L(M0)]:L(M0);for(let V of Array.from(K)){if(J.has(V))continue;if(!L(t).isApplicableToAnyContext(V,b))K.delete(V)}return Array.from(K)}),eL=O(()=>L(t).filterToolIdsByActivation(L(ZJ),"toolbar-toggle"));XL(()=>{if(!p)return;let j=!1;return L(t).ensureToolModulesLoaded(L(eL)).then(()=>{if(!j)FL(nL,L(nL)+1)}).catch((U)=>{console.error("[ItemToolBar] Failed to load one or more tool modules:",U)}),()=>{j=!0}});function UJ(){if(dL())return dL();return L(pL)?.scopeElement||null}function KJ(){if(!L(mL)||!L(D0)||!L(BL)||!L(l))return null;return L(mL).getGlobalElementId(L(D0),L(BL),L(l),L(l))}let _L=O(()=>{let j=L(x)?.toolkitCoordinator||null,U=(J)=>{return r0(J)?J:k0(J,L(C),L(PL))};return{scope:{level:L(C),scopeId:L(PL),assessmentId:L(x)?.assessmentId,sectionId:L(BL),itemId:L(tL),canonicalItemId:L(l),contentKind:L(uL)},itemId:L(PL),catalogId:L(Lj),language:X0(),i18n:L(oL),ui:{size:rL()},getScopeElement:UJ,getGlobalElementId:KJ,toolCoordinator:L(B)||null,toolkitCoordinator:j,ttsService:L(e0)||null,elementToolStateStore:L(mL)||null,toggleTool:(J)=>{if(!L(B))return;let K=U(J);if(!L(B).getToolState(K))L(B).registerTool(K,J);L(B).toggleTool(K)},isToolVisible:(J)=>{if(!L(B))return!1;return L(B).isToolVisible(U(J))},subscribeVisibility:L(B)?(J)=>L(B).subscribe(J):null,getResolvedToolContext:(J)=>L(E0)[J]??null,getToolRenderParams:(J)=>{let K=L(E0)[J]?.params??null,F=Kj.get(J);if(!F)return K;return{...K??{},...F}}}}),Kj=new Map,Qj=0,WL=O(()=>{if(!p)return[];L(nL);let j=[];for(let U of L(eL)){let J=L(t).renderForToolbar(U,L(Uj),L(_L));if(J)j.push(J)}return j}),QJ=O(()=>{if(!Array.isArray(V0()))return[];let j=[];return V0().forEach((U,J)=>{if(Aj(U)){j.push(U);return}console.warn(`[ItemToolBar] Ignoring invalid host button at index ${J}. Expected { id, label, href | onClick } with valid types.`)}),j}),VJ=O(()=>L(WL).filter((j)=>!!j.button).map((j)=>{let U=j.button;return{id:j.toolId,label:U.label,ariaLabel:U.ariaLabel||U.label,icon:U.icon,faIconName:U.faIconName,tooltip:U.tooltip||U.label,disabled:U.disabled,active:L(yL)[j.toolId]??U.active??!1,onClick:()=>{U.onClick(),cL()}}})),Vj=O(()=>[...L(VJ),...L(QJ)]),L0=O(()=>{let j={};for(let U of L(WL))j[U.toolId]=L(yL)[U.toolId]??U.button?.active??!1;return j}),XJ=O(()=>L(WL).flatMap((j)=>(j.elements||[]).filter((U)=>U.mount==="before-buttons").filter((U)=>Boolean(U.element)).map((U,J)=>({key:`before-${j.toolId}-${J}`,toolId:j.toolId,entry:U})))),YJ=O(()=>L(WL).flatMap((j)=>(j.elements||[]).filter((U)=>U.mount==="after-buttons").filter((U)=>Boolean(U.element)).map((U,J)=>({key:`after-${j.toolId}-${J}`,toolId:j.toolId,entry:U})))),Xj=O(()=>L(WL).flatMap((j)=>(j.elements||[]).filter((U)=>U.mount==="controls-row").filter((U)=>Boolean(U.element)).map((U,J)=>({key:`controls-row-${j.toolId}-${J}`,toolId:j.toolId,entry:U})))),Yj=O(()=>L(WL).flatMap((j)=>(j.elements||[]).map((U)=>({toolId:j.toolId,hint:U.layoutHints?.controlsRow})).filter((U)=>Boolean(U.hint)))),Dj=O(()=>L(WL).flatMap((j)=>(j.elements||[]).map((U)=>({toolId:j.toolId,hint:U.layoutHints?.headerOverlay})).filter((U)=>Boolean(U.hint)))),Oj=O(()=>L(Yj).some((j)=>j.hint?.reserveSpace===!0)),Gj=O(()=>L(Yj).some((j)=>j.hint?.showWhenToolActive===!0&&(L(L0)[j.toolId]??!1))),DJ=O(()=>xL()==="left"||xL()==="right"),Mj=O(()=>L(Dj).some((j)=>j.hint?.showWhenToolActive===!0&&(L(L0)[j.toolId]??!1))),OJ=O(()=>L(Xj).length>0||L(Oj)||L(Gj));function GJ(){if(!L(ML))return null;let j=L(ML).getRootNode();if(j instanceof ShadowRoot)return j.host;return null}XL(()=>{let j=GJ();if(!j)return;let U=L(Dj).length>0,J=L(Mj);return j.setAttribute("data-pie-header-overlay",U?"true":"false"),j.setAttribute("data-pie-header-overlay-active",J?"true":"false"),()=>{j.removeAttribute("data-pie-header-overlay"),j.removeAttribute("data-pie-header-overlay-active")}}),XL(()=>{if(!p)return;if(L(Vj).some((j)=>!!t0(j)))x0()});function N0(j){if(j.id in L(yL))return L(yL)[j.id]===!0;return j.active===!0}function Nj(j){return Cj(j)}function cL(){let j={};for(let U of L(WL))if(U.sync?.(),U.button)j[U.toolId]=U.button.active??!1;FL(yL,j,!0)}XL(()=>{let j=[];cL();for(let U of L(WL))if(U.subscribeActive){let J=!1,K=U.subscribeActive((F)=>{queueMicrotask(()=>{if(J)return;FL(yL,{...L(yL),[U.toolId]:F},!0),U.sync?.()})});j.push(()=>{J=!0,K()})}return()=>{j.forEach((U)=>U())}}),XL(()=>{let j=L(x)?.toolkitCoordinator;if(typeof j?.registerToolRequestTarget!=="function")return;let U=L(jj);return j.registerToolRequestTarget({level:U,hostsTool:(J)=>L(eL).includes(J),open:(J,K)=>{if(!L(B))return;if(!L(eL).includes(J))return;if(K&&Object.keys(K).length>0)Qj+=1,Kj.set(J,{...K,toolRequestId:Qj});let F=k0(J,L(C),L(PL));if(!L(B).getToolState(F))L(B).registerTool(F,J);L(B).showTool(F),queueMicrotask(()=>cL())}})}),XL(()=>{if(!L(_L).subscribeVisibility)return;let j=!1,U=L(_L).subscribeVisibility(()=>{queueMicrotask(()=>{if(j)return;cL()})});return()=>{j=!0,U?.()}}),XL(()=>{let j=L(_L).toolkitCoordinator;if(typeof j?.subscribeTelemetry!=="function")return;let U=!1,J=j.subscribeTelemetry(({eventName:K,payload:F})=>{if(K!=="pie-toolkit-tool-config-updated")return;if(F?.toolId&&!L(eL).includes(F.toolId))return;queueMicrotask(()=>{if(U)return;FL(nL,L(nL)+1),cL()})});return()=>{U=!0,J?.()}});let MJ="[data-pie-tool-overlay-boundary]";function NJ(j,U){if(U.container!=="content-boundary")return j;let J=j;while(J){if(J instanceof HTMLElement&&J.matches(MJ))return J;if(J instanceof HTMLElement&&J.parentElement){J=J.parentElement;continue}let K=J.getRootNode();J=K instanceof ShadowRoot?K.host:null}return j}function v0(j,U){let J=U,K=null,F=j,b=(N)=>{if(!N)return;let e=N.__pieToolElementUnmount;if(typeof e==="function")e()},V=(N)=>{if(K===N)return;if(K){if(b(K),K.parentNode===F)F.removeChild(K)}if(K=N,K){if(F=NJ(j,J),K.parentNode&&K.parentNode!==F)K.parentNode.removeChild(K);F.appendChild(K)}};return V(U.element),{update(N){J=N,V(N.element)},destroy(){V(null)}}}function g0(j,U){let J=U,K=null,F=null,b=[],V=null,N=null,e=null,z=null,D=null,NL=null,JL=null,i=null,a=!1,S=!1,g=()=>J.mounted.entry.shell?.pageTabOrder===!0,_=()=>J.mounted.entry.shell?.ndsHeaderControls===!0,P=null,u=null,I=null,w=0,A=0,$=0,o=0,h=0,RL=0,EL=0,vL=0,wL=null,gL=[],E=0,v=0,k=J.mounted.entry.shell?.initialWidth??720,W=J.mounted.entry.shell?.initialHeight??560,SL=k,sL=W,zL=!1,qL=null,T=null,c=!1,qj=(Z)=>{if(!Z)return;let X=Z.__pieToolElementUnmount;if(typeof X==="function")X()},$0=()=>{let Z=J.mounted.entry.shell;if(!Z)return null;return{toolId:J.mounted.toolId,toolbarContext:L(_L),shellConfig:Z}},PJ=(Z)=>{let X=L(t).get(J.mounted.toolId),G=$0();if(!X?.onHostedMount||!G)return;X.onHostedMount(Z,G)},R0=()=>{let Z=L(t).get(J.mounted.toolId),X=$0();if(!Z?.onHostedResize||!X)return;Z.onHostedResize({width:k,height:W},J.mounted.entry.element,X)},kJ=()=>{let Z=L(t).get(J.mounted.toolId),X=$0();if(!Z?.onHostedUnmount||!X)return;Z.onHostedUnmount(J.mounted.entry.element,X)},LL=(Z,X,G)=>Math.max(X,Math.min(Z,G)),WJ=()=>{let Z=J.mounted.entry.shell,X=Z?.minWidth??320,G=Z?.minHeight??240,Y=Z?.maxWidth??window.innerWidth,Q=Z?.maxHeight??window.innerHeight;return{minWidth:X,minHeight:G,maxWidth:Y,maxHeight:Q}},m0=()=>{let Z=J.mounted.entry.shell?.minWidth,X=typeof Z==="number"&&Z>0&&k<Z,G=X?`${Z}px`:"";if(P)P.style.minWidth=G;if(V)V.style.minWidth="0";if(N)N.style.minWidth="0",N.style.overflowX=X?"auto":"hidden"},Fj=()=>J.mounted.entry.shell?.content?.overflowY==="auto"?"auto":"hidden",wJ=()=>{if(!V)return 0;let Z=V.getBoundingClientRect().height;if(Z>0)return Z;return V.offsetHeight||0},u0=()=>{if(!N)return;let Z=J.mounted.entry.shell;if(N.style.overflowY=Fj(),!P)return;if(Z?.content?.preserveMinHeight===!0){let X=wJ(),G=Z.minHeight??240,Y=Math.max(0,G-X),Q=Math.max(0,W-X),M=Math.max(Q,Y);P.style.height=`${M}px`,P.style.minHeight="0",P.style.flex=`0 0 ${M}px`;return}P.style.height="100%",P.style.minHeight="0",P.style.flex="1 1 auto"},zJ=()=>{let Z=J.mounted.entry.shell,X=Z?.initialWidth??720,G=Z?.initialHeight??560;if(X===SL&&G===sL)return;if(SL=X,sL=G,zL)return;k=X,W=G,P0()},q0=()=>{let{minWidth:Z,minHeight:X,maxWidth:G,maxHeight:Y}=WJ(),Q=Math.min(Z,window.innerWidth),M=Math.min(X,window.innerHeight);k=LL(k,Q,Math.max(Q,Math.min(G,window.innerWidth))),W=LL(W,M,Math.max(M,Math.min(Y,window.innerHeight))),E=LL(E,0,Math.max(0,window.innerWidth-k)),v=LL(v,0,Math.max(0,window.innerHeight-W)),j0(),m0(),u0(),R0()},TL=(Z,X)=>{zL=!0,E+=Z,v+=X,q0()},F0=(Z,X)=>{zL=!0,k+=Z,W+=X,q0()},Pj=(Z,X,G,Y="fa-regular")=>{let Q=document.createElement("nds-icon-button");if(Q.setAttribute("variant","tertiary"),Q.setAttribute("size","small"),Q.setAttribute("type","circle"),Q.setAttribute("icon-name",X),Q.setAttribute("button-aria-label",Z),Q.title=Z,Q.addEventListener("click",(M)=>{M.stopPropagation(),G(),iL()}),Y!=="fa-light"){let M=(y)=>{y.classList.remove("fa-light"),y.classList.add(Y)},q=Q.querySelector("i.fa-light");if(q)M(q);else{let y=new MutationObserver(()=>{let s=Q.querySelector("i.fa-light");if(s)M(s),y.disconnect()});y.observe(Q,{childList:!0,subtree:!0})}}return Q},kj=(Z,X,G)=>{let Y=document.createElement("button");return Y.type="button",Y.className="pie-tool-shell__control",Y.setAttribute("aria-label",Z),Y.title=Z,Y.textContent=X,Y.style.border="1px solid transparent",Y.style.background="color-mix(in srgb, var(--pie-white, #fff) 10%, transparent)",Y.style.color="inherit",Y.style.cursor="pointer",Y.style.display="inline-flex",Y.style.alignItems="center",Y.style.justifyContent="center",Y.style.width="28px",Y.style.height="28px",Y.style.padding="0",Y.style.fontSize="14px",Y.style.fontWeight="700",Y.style.borderRadius="8px",Y.style.lineHeight="1",Y.onclick=(Q)=>{Q.stopPropagation(),G(),iL()},Y.onfocus=()=>{Y.style.outline="2px solid var(--pie-button-focus-outline, var(--pie-primary, #4A90E2))",Y.style.outlineOffset="2px"},Y.onblur=()=>{Y.style.outline="none",Y.style.outlineOffset="0"},Y},j0=()=>{if(!K)return;K.style.left=`${E}px`,K.style.top=`${v}px`,K.style.width=`${k}px`,K.style.height=`${W}px`,K.style.display=J.active?"flex":"none"},Wj=()=>{if(e)e.textContent=J.mounted.entry.shell?.title||J.mounted.toolId;for(let{el:Z,key:X}of b){let G=J.i18n.t(X);if(Z.tagName==="NDS-ICON-BUTTON")Z.setAttribute("button-aria-label",G);else Z.setAttribute("aria-label",G);if(Z.title)Z.title=G}},wj=()=>{if(!N)return;let Z=J.mounted.entry.element;if(Z.style.display="block",Z.style.width="100%",Z.style.height="100%",Z.style.flex="1 1 auto",Z.style.minHeight="0",P&&P!==Z){if(P.parentNode===N)qj(P),N.removeChild(P);P=null}if(Z.parentNode&&Z.parentNode!==N)Z.parentNode.removeChild(Z);if(Z.parentNode!==N)N.appendChild(Z);P=Z,m0(),u0(),PJ(Z)},iL=()=>{if(L(B)&&K)L(B).bringToFront(K)},P0=()=>{let{innerWidth:Z,innerHeight:X}=window,G=J.mounted.entry.shell,Y=G?.initialAlign??"center",Q=G?.initialMargin??16,M=Q+60;switch(Y){case"top-left":E=Q,v=M;break;case"top-right":E=Math.max(0,Z-k-Q),v=M;break;case"bottom-left":E=Q,v=Math.max(0,X-W-M);break;case"bottom-right":E=Math.max(0,Z-k-Q),v=Math.max(0,X-W-M);break;default:E=Math.max(0,Math.round((Z-k)/2)),v=Math.max(0,Math.round((X-W)/2))}q0()},fJ=()=>{let Z=T;if(!Z)return;queueMicrotask(()=>{if(!Z.isConnected)return;try{Z.focus()}catch{}})},zj=()=>{if(typeof document>"u")return null;let Z=document.activeElement;while(Z){let X=Z.shadowRoot;if(X&&X.activeElement&&X.activeElement!==Z)Z=X.activeElement;else break}return Z??null},fj=()=>{if(!K||qL)return;let Z=zj();if(!T&&Z&&!K.contains(Z))T=Z;if(g()&&!S)document.addEventListener("keydown",c0,!0),S=!0;qL=pJ(K,{initialFocus:D,onEscape:()=>{s0()},wrap:!g(),onTabExit:g()?(X,G)=>{if(X==="backward"){if(T?.isConnected){G.preventDefault();try{T.focus()}catch{}}return}let Y=h0();if(Y){G.preventDefault();try{Y.focus()}catch{}}}:void 0})},h0=()=>{let Z=L(_L).getScopeElement?.()??null;if(!Z)return null;let X=(Y)=>{if(L(ML)&&L(ML).contains(Y))return!0;if(K&&K.contains(Y))return!0;return!1},G=(Y)=>{if(Y instanceof HTMLElement){if(X(Y))return null;if(Y.matches?.(bJ)&&_J(Y))return Y}let Q=Y.shadowRoot;if(Q)for(let M=0;M<Q.children.length;M++){let q=G(Q.children[M]);if(q)return q}for(let M=0;M<Y.children.length;M++){let q=G(Y.children[M]);if(q)return q}return null};return G(Z)},HJ=()=>{if(!K)return[];return yJ(K).filter((Z)=>Z!==JL&&Z!==i)},c0=(Z)=>{if(Z.key!=="Tab")return;if(!K||!J.active)return;let X=zj();if(!X)return;if(K.contains(X))return;let G=HJ();if(G.length===0)return;if(Z.shiftKey){let Y=h0();if(X!==Y)return;Z.preventDefault();try{G[G.length-1].focus()}catch{}return}if(X!==T)return;Z.preventDefault();try{G[0].focus()}catch{}},Hj=()=>{if(S)document.removeEventListener("keydown",c0,!0),S=!1;if(!qL)return;let Z=qL;qL=null;try{Z()}catch{}fJ()},s0=()=>{L(_L).toggleTool(J.mounted.toolId),cL()},xj=(Z)=>{if(!J.mounted.entry.shell?.draggable)return;if(Z.target.closest("button")||!K)return;Z.preventDefault(),zL=!0,u=Z.pointerId,w=Z.clientX-E,A=Z.clientY-v,K.setPointerCapture(Z.pointerId),iL()},xJ=(Z)=>(X)=>{if(!K||!J.mounted.entry.shell?.resizable)return;X.preventDefault(),X.stopPropagation(),zL=!0,I=X.pointerId,wL=Z,$=k,o=W,h=X.clientX,RL=X.clientY,EL=E,vL=v,K.setPointerCapture(X.pointerId),iL()},Bj=(Z)=>{if(!K)return;if(u===Z.pointerId){Z.preventDefault();let X=Math.max(0,window.innerWidth-k),G=Math.max(0,window.innerHeight-W);E=LL(Z.clientX-w,0,X),v=LL(Z.clientY-A,0,G),j0();return}if(I===Z.pointerId){Z.preventDefault();let X=J.mounted.entry.shell,G=X?.minWidth??320,Y=X?.minHeight??240,Q=Math.min(G,window.innerWidth),M=Math.min(Y,window.innerHeight),q=X?.maxWidth??window.innerWidth,y=X?.maxHeight??window.innerHeight,s=Z.clientX-h,ZL=Z.clientY-RL;if(wL==="se")k=LL($+s,Q,Math.max(Q,Math.min(q,window.innerWidth-E))),W=LL(o+ZL,M,Math.max(M,Math.min(y,window.innerHeight-v)));else if(wL==="sw"){let n=EL+$,DL=LL($-s,Q,Math.min(q,n));E=n-DL,k=DL,W=LL(o+ZL,M,Math.max(M,Math.min(y,window.innerHeight-v)))}else if(wL==="ne"){let n=vL+o;k=LL($+s,Q,Math.max(Q,Math.min(q,window.innerWidth-E)));let DL=LL(o-ZL,M,Math.min(y,n));v=n-DL,W=DL}else if(wL==="nw"){let n=EL+$,DL=vL+o,m=LL($-s,Q,Math.min(q,n));E=n-m,k=m;let J0=LL(o-ZL,M,Math.min(y,DL));v=DL-J0,W=J0}j0(),m0(),u0(),R0()}},Sj=(Z)=>{if(!K)return;if(u===Z.pointerId)u=null,K.releasePointerCapture(Z.pointerId);if(I===Z.pointerId)I=null,K.releasePointerCapture(Z.pointerId)},Tj=()=>{q0()};if(p&&J.mounted.entry.shell){let Z=J.mounted.entry.shell?.ndsHeaderControls===!0&&L(lL);if(Z)x0();if(K=document.createElement("div"),K.className="pie-tool-shell",K.setAttribute("data-pie-tool-shell",J.mounted.toolId),K.style.position="fixed",K.style.zIndex="2000",K.style.background="var(--pie-background, #fff)",K.style.border="1px solid var(--pie-border-light, #d1d5db)",K.style.borderRadius="12px",K.style.boxShadow="0 10px 40px color-mix(in srgb, var(--pie-black, #000) 25%, transparent)",K.style.setProperty("--color-interactive-blue","var(--pie-calculator-button-color, var(--pie-button-color, var(--pie-text, #222)))"),K.style.setProperty("--color-new-gray","var(--pie-background-dark, #f3f5f7)"),K.style.setProperty("--color-primary-white","var(--pie-white, #ffffff)"),K.style.setProperty("--color-primary-black","var(--pie-text, #000000)"),K.style.setProperty("--color-focus-blue","var(--pie-button-focus-outline, #2b87ff)"),K.style.overflow="visible",K.style.display=J.active?"flex":"none",K.style.flexDirection="column",K.style.userSelect="none",K.style.webkitUserSelect="none",K.style.touchAction="none",K.setAttribute("draggable","false"),K.addEventListener("dragstart",(Q)=>Q.preventDefault()),V=document.createElement("div"),V.className="pie-tool-shell__header",V.style.display="flex",V.style.flexWrap="wrap",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.gap="6px",V.style.padding=_()?"12px 12px 12px 28px":"10px 12px",_())V.style.minHeight="48px";if(_())V.style.background="var(--pie-section-player-card-header-background, var(--pie-button-active-bg, #f3f4f6))",V.style.color="var(--pie-text, #111827)",V.style.borderBottom="1px solid var(--pie-border-light, #e5e7eb)";else V.style.background="var(--pie-primary-dark, #2c3e50)",V.style.color="var(--pie-white, #fff)";V.style.cursor=J.mounted.entry.shell.draggable===!1?"default":"move",V.style.flex="0 0 auto",V.style.borderRadius="12px 12px 0 0",V.style.overflow="hidden",V.style.userSelect="none",V.style.webkitUserSelect="none",V.style.touchAction="none",V.setAttribute("draggable","false"),V.addEventListener("dragstart",(Q)=>Q.preventDefault()),e=document.createElement("span"),e.className="pie-tool-shell__title",e.style.minWidth="0",e.style.overflowWrap="anywhere",e.textContent=J.mounted.entry.shell.title||J.mounted.toolId,V.appendChild(e),z=document.createElement("div"),z.className="pie-tool-shell__controls",z.style.display="inline-flex",z.style.flexWrap="wrap",z.style.minWidth="0",z.style.alignItems="center",z.style.gap=_()?"6px":"4px";let X=J.mounted.entry.shell,G=(Q,M,q,y,s="fa-regular")=>{if(!z)return;let ZL=J.i18n.t(Q),n=Z?Pj(ZL,q,y,s):kj(ZL,M,y);b.push({el:n,key:Q}),z.appendChild(n)};if(X?.draggable!==!1)G("toolkit.window.moveLeftA11y","←","chevron-left",()=>TL(-24,0)),G("toolkit.window.moveRightA11y","→","chevron-right",()=>TL(24,0)),G("toolkit.window.moveUpA11y","↑","chevron-up",()=>TL(0,-24)),G("toolkit.window.moveDownA11y","↓","chevron-down",()=>TL(0,24));if(X?.resizable!==!1)G("toolkit.window.shrinkA11y","−","magnifying-glass-minus",()=>F0(-40,-40)),G("toolkit.window.growA11y","+","magnifying-glass-plus",()=>F0(40,40));if(!_()){let Q=kj(J.i18n.t("toolkit.window.centerA11y"),"◎",P0);b.push({el:Q,key:"toolkit.window.centerA11y"}),z.appendChild(Q)}let Y=null;if(_())Y=document.createElement("div"),Y.className="pie-tool-shell__header-right",Y.style.display="inline-flex",Y.style.flexWrap="wrap",Y.style.maxWidth="100%",Y.style.justifyContent="flex-end",Y.style.alignItems="center",Y.style.gap="6px",Y.appendChild(z),V.appendChild(Y);else V.appendChild(z);if(Z)D=Pj(J.i18n.t("toolkit.window.closeA11y"),"xmark",s0,"fa-regular"),b.push({el:D,key:"toolkit.window.closeA11y"}),D.style.display=J.mounted.entry.shell.closeable===!1?"none":"inline-block";else{let Q=document.createElement("button");Q.type="button",Q.className="pie-tool-shell__close",Q.setAttribute("aria-label",J.i18n.t("toolkit.window.closeA11y")),b.push({el:Q,key:"toolkit.window.closeA11y"});let M="http://www.w3.org/2000/svg",q=document.createElementNS(M,"svg");q.setAttribute("xmlns",M),q.setAttribute("viewBox","0 0 16 16"),q.setAttribute("aria-hidden","true");let y=document.createElementNS(M,"path");y.setAttribute("d","M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5"),y.setAttribute("stroke","currentColor"),y.setAttribute("stroke-width","1.8"),y.setAttribute("stroke-linecap","round"),q.appendChild(y),Q.appendChild(q);let s=q.style;s.width="16px",s.height="16px",s.display="block",s.flexShrink="0",s.pointerEvents="none";let ZL="color-mix(in srgb, var(--pie-white, #fff) 8%, transparent)",n="color-mix(in srgb, var(--pie-white, #fff) 18%, transparent)";Q.style.border="1px solid transparent",Q.style.background=ZL,Q.style.color="inherit",Q.style.cursor="pointer",Q.style.display="inline-flex",Q.style.alignItems="center",Q.style.justifyItems="center",Q.style.width="28px",Q.style.height="28px",Q.style.padding="0",Q.style.borderRadius="8px",Q.style.lineHeight="0",Q.style.transition="background-color 0.15s ease, border-color 0.15s ease",Q.style.display=J.mounted.entry.shell.closeable===!1?"none":"inline-flex",Q.onmouseenter=()=>{Q.style.background=n},Q.onmouseleave=()=>{Q.style.background=ZL},Q.onfocus=()=>{Q.style.outline="2px solid var(--pie-button-focus-outline, var(--pie-primary, #4A90E2))",Q.style.outlineOffset="2px"},Q.onblur=()=>{Q.style.outline="none",Q.style.outlineOffset="0"},Q.onclick=s0,D=Q}if(Y)Y.appendChild(D);else V.appendChild(D);if(V.tabIndex=0,V.onkeydown=(Q)=>{if(Q.key==="Home"){Q.preventDefault(),P0();return}let M=J.mounted.entry.shell;if(Q.shiftKey&&M?.resizable!==!1){if(Q.key==="ArrowRight"||Q.key==="ArrowDown"){Q.preventDefault(),F0(40,40);return}if(Q.key==="ArrowLeft"||Q.key==="ArrowUp"){Q.preventDefault(),F0(-40,-40);return}}if(M?.draggable!==!1){if(Q.key==="ArrowLeft")Q.preventDefault(),TL(-24,0);else if(Q.key==="ArrowRight")Q.preventDefault(),TL(24,0);else if(Q.key==="ArrowUp")Q.preventDefault(),TL(0,-24);else if(Q.key==="ArrowDown")Q.preventDefault(),TL(0,24)}},N=document.createElement("div"),N.className="pie-tool-shell__content",N.style.position="relative",N.style.width="100%",N.style.flex="1 1 auto",N.style.minHeight="0",N.style.overflowX="hidden",N.style.overflowY=Fj(),N.style.borderRadius="0 0 12px 12px",_()){let Q=(M)=>{let q=document.createElement("div");return q.tabIndex=0,q.setAttribute("aria-hidden","true"),q.setAttribute("data-pie-tool-shell-focus-guard",M),q.style.position="absolute",q.style.width="1px",q.style.height="1px",q.style.padding="0",q.style.margin="-1px",q.style.overflow="hidden",q.style.clipPath="inset(50%)",q.style.whiteSpace="nowrap",q.style.border="0",q};JL=Q("start"),i=Q("end"),JL.addEventListener("focus",(M)=>{if(a)return;a=!0;try{if(M.stopPropagation(),T?.isConnected)try{T.focus()}catch{}}finally{queueMicrotask(()=>{a=!1})}}),i.addEventListener("focus",(M)=>{if(a)return;a=!0;try{M.stopPropagation();let q=h0();if(q)try{q.focus()}catch{}}finally{queueMicrotask(()=>{a=!1})}}),K.appendChild(JL)}if(K.appendChild(V),K.appendChild(N),_()&&i)K.appendChild(i);if(J.mounted.entry.shell.resizable!==!1){let Q=(M,q,y,s,ZL,n,DL)=>{let m=document.createElement("div");if(m.className="pie-tool-shell__resize",m.style.position="absolute",m.style.width="24px",m.style.height="24px",m.style.cursor=n,m.style.zIndex="10",m.style.touchAction="none",m.setAttribute("draggable","false"),q!==null)m.style.top=q;if(y!==null)m.style.right=y;if(s!==null)m.style.bottom=s;if(ZL!==null)m.style.left=ZL;if(DL!==null)m.style.background=`linear-gradient(${DL}, transparent 0%, transparent 40%, rgba(0,0,0,0.35) 40%, rgba(0,0,0,0.35) 60%, transparent 60%, transparent 100%)`;let J0=xJ(M);m.addEventListener("pointerdown",J0),K.appendChild(m),gL.push({el:m,handler:J0})};Q("se",null,"0","0",null,"nwse-resize",null),Q("nw","0",null,null,"0","nwse-resize","135deg"),Q("ne","0","0",null,null,"nesw-resize",null),Q("sw",null,null,"0","0","nesw-resize",null)}if(V.addEventListener("pointerdown",xj),K.addEventListener("pointermove",Bj),K.addEventListener("pointerup",Sj),K.addEventListener("pointerdown",iL),window.addEventListener("resize",Tj),document.body.appendChild(K),F=new CJ(K,{context:hj,initialValue:J.runtime}),F.connect(),P0(),j0(),Wj(),wj(),R0(),J.active)fj();c=J.active}return{update(Z){if(J=Z,!K||!N||!e||!D)return;F?.setValue(J.runtime),Wj(),zJ();let X=D.tagName.toLowerCase()==="nds-icon-button"?"inline-block":"inline-flex";if(D.style.display=J.mounted.entry.shell?.closeable===!1?"none":X,j0(),wj(),R0(),!c&&J.active)fj();else if(c&&!J.active)Hj(),T=null;c=J.active},destroy(){if(kJ(),F?.disconnect(),F=null,b.length=0,qL)Hj();if(S)document.removeEventListener("keydown",c0,!0),S=!1;for(let{el:Z,handler:X}of gL)Z.removeEventListener("pointerdown",X);if(T=null,gL.length=0,V)V.removeEventListener("pointerdown",xj),V.onkeydown=null;if(K)K.removeEventListener("pointermove",Bj),K.removeEventListener("pointerup",Sj),K.removeEventListener("pointerdown",iL);if(window.removeEventListener("resize",Tj),P&&N&&P.parentNode===N)qj(P),N.removeChild(P);if(P=null,K&&K.parentElement)K.remove()}}}var RJ={get level(){return $L()},set level(j){$L(j),d()},get scopeId(){return Q0()},set scopeId(j){Q0(j),d()},get itemId(){return B0()},set itemId(j){B0(j),d()},get sectionId(){return S0()},set sectionId(j){S0(j),d()},get catalogId(){return T0()},set catalogId(j){T0(j),d()},get tools(){return A0()},set tools(j){A0(j),d()},get contentKind(){return C0()},set contentKind(j){C0(j),d()},get position(){return xL()},set position(j){xL(j),d()},get scopeElement(){return dL()},set scopeElement(j){dL(j),d()},get toolRegistry(){return I0()},set toolRegistry(j){I0(j),d()},get item(){return y0()},set item(j){y0(j),d()},get hostButtons(){return V0()},set hostButtons(j){V0(j),d()},get class(){return p0()},set class(j){p0(j),d()},get size(){return rL()},set size(j){rL(j),d()},get language(){return X0()},set language(j){X0(j),d()}},Rj=QL(),qJ=UL(Rj);{var FJ=(j)=>{var U=mJ();let J;var K=aL(U),F=aL(K);U0(F,17,()=>L(XJ),(z)=>z.key,(z,D)=>{var NL=QL(),JL=UL(NL);{var i=(S)=>{var g=QL(),_=UL(g);H0(_,()=>L(lL),(P)=>{var u=w0();fL(u,(I,w)=>g0?.(I,w),()=>({mounted:L(D),active:L(L0)[L(D).toolId]??!1,runtime:L(x),i18n:L(oL)})),f(P,u)}),f(S,g)},a=(S)=>{var g=w0();fL(g,(_,P)=>v0?.(_,P),()=>L(D).entry),f(S,g)};VL(JL,(S)=>{if(L(D).entry.shell)S(i);else S(a,-1)})}f(z,NL)});var b=f0(F,2);U0(b,17,()=>L(Vj),(z)=>z.id,(z,D,NL,JL)=>{let i=O(()=>L(lL)&&!i0(L(D))?t0(L(D)):null);var a=QL(),S=UL(a);{var g=(I)=>{var w=EJ(),A=aL(w);CL(A,1,"item-toolbar__nds-button svelte-rnx3ie"),IL(A,"type","circle"),IL(A,"size","small"),IL(A,"variant","tertiary"),KL(()=>IL(A,"icon-name",L(i))),KL(()=>IL(A,"button-aria-label",L(D).ariaLabel||L(D).label)),KL(()=>IL(A,"title",L(D).tooltip||L(D).label)),KL(()=>IL(A,"disabled",L(D).disabled)),fL(A,($)=>oj?.($)),fL(A,($,o)=>nj?.($,o),()=>N0(L(D))),OL(w),Z0("click",A,function(...$){L(D).onClick?.apply(this,$)}),f(I,w)},_=(I)=>{var w=vJ();let A;var $=aL(w);{var o=(h)=>{var RL=QL(),EL=UL(RL);{var vL=(k)=>{var W=z0();K0(W,()=>W0(L(D).icon),!0),OL(W),f(k,W)},wL=O(()=>a0(L(D).icon)),gL=(k)=>{var W=yj();KL(()=>jL(W,"src",L(D).icon)),f(k,W)},E=O(()=>d0(L(D).icon)),v=(k)=>{let W=O(()=>Nj(L(D).icon));var SL=QL(),sL=UL(SL);{var zL=(T)=>{var c=z0();K0(c,()=>W0(L(W)),!0),OL(c),f(T,c)},qL=(T)=>{var c=pj();KL(()=>CL(c,1,`icon icon-${L(D).icon}`,"svelte-rnx3ie")),f(T,c)};VL(sL,(T)=>{if(L(W))T(zL);else T(qL,-1)})}f(k,SL)};VL(EL,(k)=>{if(L(wL))k(vL);else if(L(E))k(gL,1);else k(v,-1)})}f(h,RL)};VL($,(h)=>{if(L(D).icon)h(o)})}OL(w),KL((h)=>{A=CL(w,1,"item-toolbar__button svelte-rnx3ie",null,A,{"item-toolbar__button--active":h}),jL(w,"href",L(D).disabled?void 0:L(D).href),jL(w,"target",L(D).target),jL(w,"rel",L(D).rel),jL(w,"aria-label",L(D).ariaLabel||L(D).label),jL(w,"title",L(D).tooltip||L(D).label),jL(w,"aria-disabled",L(D).disabled?"true":void 0)},[()=>N0(L(D))]),Z0("click",w,(h)=>{if(L(D).disabled)h.preventDefault()}),f(I,w)},P=O(()=>i0(L(D))),u=(I)=>{var w=gJ();let A;var $=aL(w);{var o=(h)=>{var RL=QL(),EL=UL(RL);{var vL=(k)=>{var W=z0();K0(W,()=>W0(L(D).icon),!0),OL(W),f(k,W)},wL=O(()=>a0(L(D).icon)),gL=(k)=>{var W=yj();KL(()=>jL(W,"src",L(D).icon)),f(k,W)},E=O(()=>d0(L(D).icon)),v=(k)=>{let W=O(()=>Nj(L(D).icon));var SL=QL(),sL=UL(SL);{var zL=(T)=>{var c=z0();K0(c,()=>W0(L(W)),!0),OL(c),f(T,c)},qL=(T)=>{var c=pj();KL(()=>CL(c,1,`icon icon-${L(D).icon}`,"svelte-rnx3ie")),f(T,c)};VL(sL,(T)=>{if(L(W))T(zL);else T(qL,-1)})}f(k,SL)};VL(EL,(k)=>{if(L(wL))k(vL);else if(L(E))k(gL,1);else k(v,-1)})}f(h,RL)};VL($,(h)=>{if(L(D).icon)h(o)})}OL(w),KL((h,RL)=>{A=CL(w,1,"item-toolbar__button svelte-rnx3ie",null,A,{"item-toolbar__button--active":h}),jL(w,"aria-label",L(D).ariaLabel||L(D).label),jL(w,"aria-pressed",RL),jL(w,"title",L(D).tooltip||L(D).label),w.disabled=L(D).disabled},[()=>N0(L(D)),()=>N0(L(D))]),Z0("click",w,function(...h){L(D).onClick?.apply(this,h)}),f(I,w)};VL(S,(I)=>{if(L(i))I(g);else if(L(P))I(_,1);else I(u,-1)})}f(z,a)});var V=f0(b,2);U0(V,17,()=>L(YJ),(z)=>z.key,(z,D)=>{var NL=QL(),JL=UL(NL);{var i=(S)=>{var g=QL(),_=UL(g);H0(_,()=>L(lL),(P)=>{var u=w0();fL(u,(I,w)=>g0?.(I,w),()=>({mounted:L(D),active:L(L0)[L(D).toolId]??!1,runtime:L(x),i18n:L(oL)})),f(P,u)}),f(S,g)},a=(S)=>{var g=w0();fL(g,(_,P)=>v0?.(_,P),()=>L(D).entry),f(S,g)};VL(JL,(S)=>{if(L(D).entry.shell)S(i);else S(a,-1)})}f(z,NL)}),OL(K);var N=f0(K,2);{var e=(z)=>{var D=$J();let NL;U0(D,21,()=>L(Xj),(JL)=>JL.key,(JL,i)=>{var a=QL(),S=UL(a);{var g=(P)=>{var u=QL(),I=UL(u);H0(I,()=>L(lL),(w)=>{var A=bj();fL(A,($,o)=>g0?.($,o),()=>({mounted:L(i),active:L(L0)[L(i).toolId]??!1,runtime:L(x),i18n:L(oL)})),f(w,A)}),f(P,u)},_=(P)=>{var u=bj();fL(u,(I,w)=>v0?.(I,w),()=>L(i).entry),f(P,u)};VL(S,(P)=>{if(L(i).entry.shell)P(g);else P(_,-1)})}f(JL,a)}),OL(D),KL(()=>NL=CL(D,1,"item-toolbar__controls-row svelte-rnx3ie",null,NL,{"item-toolbar__controls-row--reserve":L(Oj),"item-toolbar__controls-row--active":L(Gj),"item-toolbar__controls-row--align-start":L(DJ)})),f(z,D)};VL(N,(z)=>{if(L(OJ))z(e)})}OL(U),mj(U,(z)=>FL(ML,z),()=>L(ML)),KL(()=>{J=CL(U,1,`item-toolbar ${p0()??""} item-toolbar--${rL()??""}`,"svelte-rnx3ie",J,{"item-toolbar--top":xL()==="top","item-toolbar--right":xL()==="right","item-toolbar--bottom":xL()==="bottom","item-toolbar--left":xL()==="left","item-toolbar--header-overlay-active":L(Mj)}),jL(U,"data-content-kind",L(uL)),jL(U,"data-level",L(C))}),Z0("focusin",K,(z)=>{if(L(C)==="section"&&z.target instanceof HTMLElement)z.target.scrollIntoView({block:"nearest",inline:"nearest"})}),f(j,U)};VL(qJ,(j)=>{if(p)j(FJ)})}return f(H,Rj),Ej(RJ)}gj(["focusin","click"]);AJ("pie-item-toolbar",uj(dj,{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"}));
|
|
40
|
-
export{dj as a};
|