@pie-qti/player-elements 0.1.20 → 0.1.21

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.
Files changed (50) hide show
  1. package/dist/{define-BwFVHv-A.js → define-XpbOHJoz.js} +29 -19
  2. package/dist/define-XpbOHJoz.js.map +1 -0
  3. package/dist/{dist-oe9UH-A2.js → dist-4hIHy9-L.js} +583 -628
  4. package/dist/dist-4hIHy9-L.js.map +1 -0
  5. package/dist/dist-Nkkk25AH.js +1275 -0
  6. package/dist/dist-Nkkk25AH.js.map +1 -0
  7. package/dist/{element-BiInkn5Q.js → element-DNnKo2Uk.js} +2 -2
  8. package/dist/{element-BiInkn5Q.js.map → element-DNnKo2Uk.js.map} +1 -1
  9. package/dist/{element-class-CILJ4Ls7-rJWb-Gwb.js → element-class-iN9MRyjF-D6u8ACFm.js} +1829 -1811
  10. package/dist/{element-class-CILJ4Ls7-rJWb-Gwb.js.map → element-class-iN9MRyjF-D6u8ACFm.js.map} +1 -1
  11. package/dist/elements.js +3 -3
  12. package/dist/index.js +2 -2
  13. package/dist/item-toolbar-element-3k36WOlC.js +6086 -0
  14. package/dist/item-toolbar-element-3k36WOlC.js.map +1 -0
  15. package/dist/{mathlive.min-DeR46YTX-D-KAmiue.js → mathlive.min-DeR46YTX-DamfKay_.js} +1 -1
  16. package/dist/{mathlive.min-DeR46YTX-D-KAmiue.js.map → mathlive.min-DeR46YTX-DamfKay_.js.map} +1 -1
  17. package/dist/pie-assessment-toolkit-element-CP-OMtE6.js +28516 -0
  18. package/dist/pie-assessment-toolkit-element-CP-OMtE6.js.map +1 -0
  19. package/dist/pie-tool-calculator-VzYEjxiY.js +2309 -0
  20. package/dist/pie-tool-calculator-VzYEjxiY.js.map +1 -0
  21. package/dist/register-players.js +1 -1
  22. package/dist/register.js +7 -6
  23. package/dist/register.js.map +1 -1
  24. package/dist/{resolveItems-DHNyVysE.js → resolveItems-hMDtJOXa.js} +2 -2
  25. package/dist/{resolveItems-DHNyVysE.js.map → resolveItems-hMDtJOXa.js.map} +1 -1
  26. package/dist/{root-CYGgRw16.js → root--0fyaoNu.js} +3 -3
  27. package/dist/root--0fyaoNu.js.map +1 -0
  28. package/dist/{sre-CgK32OcY.js → sre-CFPLI6BY.js} +1 -1
  29. package/dist/{sre-CgK32OcY.js.map → sre-CFPLI6BY.js.map} +1 -1
  30. package/dist/{tag-names-OgMDHLpx.js → tag-names-ClLtKtXt.js} +2 -2
  31. package/dist/tag-names-ClLtKtXt.js.map +1 -0
  32. package/dist/tool-tts-inline-B-xT_sdY.js +2641 -0
  33. package/dist/tool-tts-inline-B-xT_sdY.js.map +1 -0
  34. package/package.json +6 -6
  35. package/dist/define-BwFVHv-A.js.map +0 -1
  36. package/dist/dist-DswyTalX.js +0 -6731
  37. package/dist/dist-DswyTalX.js.map +0 -1
  38. package/dist/dist-oe9UH-A2.js.map +0 -1
  39. package/dist/item-toolbar-element-t_zI1vE6.js +0 -1892
  40. package/dist/item-toolbar-element-t_zI1vE6.js.map +0 -1
  41. package/dist/pie-assessment-toolkit-element-RzBk8WVs.js +0 -7113
  42. package/dist/pie-assessment-toolkit-element-RzBk8WVs.js.map +0 -1
  43. package/dist/pie-tool-calculator-GW-LhvB_.js +0 -6905
  44. package/dist/pie-tool-calculator-GW-LhvB_.js.map +0 -1
  45. package/dist/root-CYGgRw16.js.map +0 -1
  46. package/dist/sre-Dz5gsR-A.js +0 -17220
  47. package/dist/sre-Dz5gsR-A.js.map +0 -1
  48. package/dist/tag-names-OgMDHLpx.js.map +0 -1
  49. package/dist/tool-tts-inline-drDEIti_.js +0 -3724
  50. package/dist/tool-tts-inline-drDEIti_.js.map +0 -1
@@ -1,1892 +0,0 @@
1
- import { $ as e, A as t, B as n, C as r, F as i, G as a, H as o, K as s, L as c, M as l, N as u, O as d, P as f, S as p, U as m, W as h, Y as ee, Z as te, at as g, b as _, ct as v, d as ne, et as re, f as ie, ft as y, h as ae, j as b, l as x, mt as S, n as oe, nt as C, pt as w, r as se, rt as T, st as E, t as ce, tt as D, u as O, ut as k, x as le, y as ue, z as de } from "./dist-DswyTalX.js";
2
- //#region ../../node_modules/.bun/@pie-players+pie-players-shared@0.3.63/node_modules/@pie-players/pie-players-shared/dist/ui/zoom-compensation.js
3
- var fe = {
4
- maxZoom: 2,
5
- minCompensation: .25
6
- };
7
- function A(e, t) {
8
- let n = e / t;
9
- return Number.isFinite(n) && n > 0 ? n : 1;
10
- }
11
- function pe(e, t, n) {
12
- return Math.max(n, Math.min(1, t / e));
13
- }
14
- //#endregion
15
- //#region ../../node_modules/.bun/@pie-players+pie-players-shared@0.3.63/node_modules/@pie-players/pie-players-shared/dist/components/vendor/nds/nds-icon-button.js
16
- var me = globalThis, he = me.ShadowRoot && (me.ShadyCSS === void 0 || me.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ge = Symbol(), _e = /* @__PURE__ */ new WeakMap(), ve = class {
17
- constructor(e, t, n) {
18
- if (this._$cssResult$ = !0, n !== ge) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
19
- this.cssText = e, this.t = t;
20
- }
21
- get styleSheet() {
22
- let e = this.o, t = this.t;
23
- if (he && e === void 0) {
24
- let n = t !== void 0 && t.length === 1;
25
- n && (e = _e.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), n && _e.set(t, e));
26
- }
27
- return e;
28
- }
29
- toString() {
30
- return this.cssText;
31
- }
32
- }, ye = (e) => new ve(typeof e == "string" ? e : e + "", void 0, ge), j = (e, t) => {
33
- if (he) e.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
34
- else for (let n of t) {
35
- let t = document.createElement("style"), r = me.litNonce;
36
- r !== void 0 && t.setAttribute("nonce", r), t.textContent = n.cssText, e.appendChild(t);
37
- }
38
- }, be = he ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((e) => {
39
- let t = "";
40
- for (let n of e.cssRules) t += n.cssText;
41
- return ye(t);
42
- })(e) : e, { is: xe, defineProperty: Se, getOwnPropertyDescriptor: Ce, getOwnPropertyNames: we, getOwnPropertySymbols: M, getPrototypeOf: N } = Object, Te = globalThis, Ee = Te.trustedTypes, De = Ee ? Ee.emptyScript : "", Oe = Te.reactiveElementPolyfillSupport, ke = (e, t) => e, P = {
43
- toAttribute(e, t) {
44
- switch (t) {
45
- case Boolean:
46
- e = e ? De : null;
47
- break;
48
- case Object:
49
- case Array: e = e == null ? e : JSON.stringify(e);
50
- }
51
- return e;
52
- },
53
- fromAttribute(e, t) {
54
- let n = e;
55
- switch (t) {
56
- case Boolean:
57
- n = e !== null;
58
- break;
59
- case Number:
60
- n = e === null ? null : Number(e);
61
- break;
62
- case Object:
63
- case Array: try {
64
- n = JSON.parse(e);
65
- } catch {
66
- n = null;
67
- }
68
- }
69
- return n;
70
- }
71
- }, F = (e, t) => !xe(e, t), I = {
72
- attribute: !0,
73
- type: String,
74
- converter: P,
75
- reflect: !1,
76
- useDefault: !1,
77
- hasChanged: F
78
- };
79
- Symbol.metadata ??= Symbol("metadata"), Te.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
80
- var L = class extends HTMLElement {
81
- static addInitializer(e) {
82
- this._$Ei(), (this.l ??= []).push(e);
83
- }
84
- static get observedAttributes() {
85
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
86
- }
87
- static createProperty(e, t = I) {
88
- if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
89
- let n = Symbol(), r = this.getPropertyDescriptor(e, n, t);
90
- r !== void 0 && Se(this.prototype, e, r);
91
- }
92
- }
93
- static getPropertyDescriptor(e, t, n) {
94
- let { get: r, set: i } = Ce(this.prototype, e) ?? {
95
- get() {
96
- return this[t];
97
- },
98
- set(e) {
99
- this[t] = e;
100
- }
101
- };
102
- return {
103
- get: r,
104
- set(t) {
105
- let a = r?.call(this);
106
- i?.call(this, t), this.requestUpdate(e, a, n);
107
- },
108
- configurable: !0,
109
- enumerable: !0
110
- };
111
- }
112
- static getPropertyOptions(e) {
113
- return this.elementProperties.get(e) ?? I;
114
- }
115
- static _$Ei() {
116
- if (this.hasOwnProperty(ke("elementProperties"))) return;
117
- let e = N(this);
118
- e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
119
- }
120
- static finalize() {
121
- if (this.hasOwnProperty(ke("finalized"))) return;
122
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(ke("properties"))) {
123
- let e = this.properties, t = [...we(e), ...M(e)];
124
- for (let n of t) this.createProperty(n, e[n]);
125
- }
126
- let e = this[Symbol.metadata];
127
- if (e !== null) {
128
- let t = litPropertyMetadata.get(e);
129
- if (t !== void 0) for (let [e, n] of t) this.elementProperties.set(e, n);
130
- }
131
- this._$Eh = /* @__PURE__ */ new Map();
132
- for (let [e, t] of this.elementProperties) {
133
- let n = this._$Eu(e, t);
134
- n !== void 0 && this._$Eh.set(n, e);
135
- }
136
- this.elementStyles = this.finalizeStyles(this.styles);
137
- }
138
- static finalizeStyles(e) {
139
- let t = [];
140
- if (Array.isArray(e)) {
141
- let n = new Set(e.flat(Infinity).reverse());
142
- for (let e of n) t.unshift(be(e));
143
- } else e !== void 0 && t.push(be(e));
144
- return t;
145
- }
146
- static _$Eu(e, t) {
147
- let n = t.attribute;
148
- return n === !1 ? void 0 : typeof n == "string" ? n : typeof e == "string" ? e.toLowerCase() : void 0;
149
- }
150
- constructor() {
151
- super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
152
- }
153
- _$Ev() {
154
- this._$ES = new Promise(((e) => this.enableUpdating = e)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((e) => e(this)));
155
- }
156
- addController(e) {
157
- (this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
158
- }
159
- removeController(e) {
160
- this._$EO?.delete(e);
161
- }
162
- _$E_() {
163
- let e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties;
164
- for (let n of t.keys()) this.hasOwnProperty(n) && (e.set(n, this[n]), delete this[n]);
165
- e.size > 0 && (this._$Ep = e);
166
- }
167
- createRenderRoot() {
168
- let e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
169
- return j(e, this.constructor.elementStyles), e;
170
- }
171
- connectedCallback() {
172
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((e) => e.hostConnected?.()));
173
- }
174
- enableUpdating(e) {}
175
- disconnectedCallback() {
176
- this._$EO?.forEach(((e) => e.hostDisconnected?.()));
177
- }
178
- attributeChangedCallback(e, t, n) {
179
- this._$AK(e, n);
180
- }
181
- _$ET(e, t) {
182
- let n = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, n);
183
- if (r !== void 0 && n.reflect === !0) {
184
- let i = (n.converter?.toAttribute === void 0 ? P : n.converter).toAttribute(t, n.type);
185
- this._$Em = e, i == null ? this.removeAttribute(r) : this.setAttribute(r, i), this._$Em = null;
186
- }
187
- }
188
- _$AK(e, t) {
189
- let n = this.constructor, r = n._$Eh.get(e);
190
- if (r !== void 0 && this._$Em !== r) {
191
- let e = n.getPropertyOptions(r), i = typeof e.converter == "function" ? { fromAttribute: e.converter } : e.converter?.fromAttribute === void 0 ? P : e.converter;
192
- this._$Em = r;
193
- let a = i.fromAttribute(t, e.type);
194
- this[r] = a ?? this._$Ej?.get(r) ?? a, this._$Em = null;
195
- }
196
- }
197
- requestUpdate(e, t, n) {
198
- if (e !== void 0) {
199
- let r = this.constructor, i = this[e];
200
- if (n ??= r.getPropertyOptions(e), !((n.hasChanged ?? F)(i, t) || n.useDefault && n.reflect && i === this._$Ej?.get(e) && !this.hasAttribute(r._$Eu(e, n)))) return;
201
- this.C(e, t, n);
202
- }
203
- this.isUpdatePending === !1 && (this._$ES = this._$EP());
204
- }
205
- C(e, t, { useDefault: n, reflect: r, wrapped: i }, a) {
206
- n && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, a ?? t ?? this[e]), i !== !0 || a !== void 0) || (this._$AL.has(e) || (this.hasUpdated || n || (t = void 0), this._$AL.set(e, t)), r === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
207
- }
208
- async _$EP() {
209
- this.isUpdatePending = !0;
210
- try {
211
- await this._$ES;
212
- } catch (e) {
213
- Promise.reject(e);
214
- }
215
- let e = this.scheduleUpdate();
216
- return e != null && await e, !this.isUpdatePending;
217
- }
218
- scheduleUpdate() {
219
- return this.performUpdate();
220
- }
221
- performUpdate() {
222
- if (!this.isUpdatePending) return;
223
- if (!this.hasUpdated) {
224
- if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
225
- for (let [e, t] of this._$Ep) this[e] = t;
226
- this._$Ep = void 0;
227
- }
228
- let e = this.constructor.elementProperties;
229
- if (e.size > 0) for (let [t, n] of e) {
230
- let { wrapped: e } = n, r = this[t];
231
- e !== !0 || this._$AL.has(t) || r === void 0 || this.C(t, void 0, n, r);
232
- }
233
- }
234
- let e = !1, t = this._$AL;
235
- try {
236
- e = this.shouldUpdate(t), e ? (this.willUpdate(t), this._$EO?.forEach(((e) => e.hostUpdate?.())), this.update(t)) : this._$EM();
237
- } catch (t) {
238
- throw e = !1, this._$EM(), t;
239
- }
240
- e && this._$AE(t);
241
- }
242
- willUpdate(e) {}
243
- _$AE(e) {
244
- this._$EO?.forEach(((e) => e.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
245
- }
246
- _$EM() {
247
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
248
- }
249
- get updateComplete() {
250
- return this.getUpdateComplete();
251
- }
252
- getUpdateComplete() {
253
- return this._$ES;
254
- }
255
- shouldUpdate(e) {
256
- return !0;
257
- }
258
- update(e) {
259
- this._$Eq &&= this._$Eq.forEach(((e) => this._$ET(e, this[e]))), this._$EM();
260
- }
261
- updated(e) {}
262
- firstUpdated(e) {}
263
- };
264
- L.elementStyles = [], L.shadowRootOptions = { mode: "open" }, L[ke("elementProperties")] = /* @__PURE__ */ new Map(), L[ke("finalized")] = /* @__PURE__ */ new Map(), Oe?.({ ReactiveElement: L }), (Te.reactiveElementVersions ??= []).push("2.1.1");
265
- var Ae = globalThis, R = Ae.trustedTypes, je = R ? R.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Me = "$lit$", z = `lit$${Math.random().toFixed(9).slice(2)}$`, B = "?" + z, Ne = `<${B}>`, Pe = document, V = () => Pe.createComment(""), H = (e) => e === null || typeof e != "object" && typeof e != "function", U = Array.isArray, Fe = (e) => U(e) || typeof e?.[Symbol.iterator] == "function", Ie = "[ \n\f\r]", Le = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, W = /-->/g, Re = />/g, G = RegExp(`>|${Ie}(?:([^\\s"'>=/]+)(${Ie}*=${Ie}*(?:[^
266
- \f\r"'\`<>=]|("|')|))|$)`, "g"), ze = /'/g, Be = /"/g, K = /^(?:script|style|textarea|title)$/i, Ve = ((e) => (t, ...n) => ({
267
- _$litType$: e,
268
- strings: t,
269
- values: n
270
- }))(1), q = Symbol.for("lit-noChange"), J = Symbol.for("lit-nothing"), Y = /* @__PURE__ */ new WeakMap(), He = Pe.createTreeWalker(Pe, 129);
271
- function X(e, t) {
272
- if (!U(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
273
- return je === void 0 ? t : je.createHTML(t);
274
- }
275
- var Z = (e, t) => {
276
- let n = e.length - 1, r = [], i, a = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = Le;
277
- for (let t = 0; t < n; t++) {
278
- let n = e[t], s, c, l = -1, u = 0;
279
- for (; u < n.length && (o.lastIndex = u, c = o.exec(n), c !== null);) u = o.lastIndex, o === Le ? c[1] === "!--" ? o = W : c[1] === void 0 ? c[2] === void 0 ? c[3] !== void 0 && (o = G) : (K.test(c[2]) && (i = RegExp("</" + c[2], "g")), o = G) : o = Re : o === G ? c[0] === ">" ? (o = i ?? Le, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, s = c[1], o = c[3] === void 0 ? G : c[3] === "\"" ? Be : ze) : o === Be || o === ze ? o = G : o === W || o === Re ? o = Le : (o = G, i = void 0);
280
- let d = o === G && e[t + 1].startsWith("/>") ? " " : "";
281
- a += o === Le ? n + Ne : l >= 0 ? (r.push(s), n.slice(0, l) + Me + n.slice(l) + z + d) : n + z + (l === -2 ? t : d);
282
- }
283
- return [X(e, a + (e[n] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
284
- }, Ue = class e {
285
- constructor({ strings: t, _$litType$: n }, r) {
286
- let i;
287
- this.parts = [];
288
- let a = 0, o = 0, s = t.length - 1, c = this.parts, [l, u] = Z(t, n);
289
- if (this.el = e.createElement(l, r), He.currentNode = this.el.content, n === 2 || n === 3) {
290
- let e = this.el.content.firstChild;
291
- e.replaceWith(...e.childNodes);
292
- }
293
- for (; (i = He.nextNode()) !== null && c.length < s;) {
294
- if (i.nodeType === 1) {
295
- if (i.hasAttributes()) for (let e of i.getAttributeNames()) if (e.endsWith(Me)) {
296
- let t = u[o++], n = i.getAttribute(e).split(z), r = /([.?@])?(.*)/.exec(t);
297
- c.push({
298
- type: 1,
299
- index: a,
300
- name: r[2],
301
- strings: n,
302
- ctor: r[1] === "." ? Je : r[1] === "?" ? Ye : r[1] === "@" ? Xe : qe
303
- }), i.removeAttribute(e);
304
- } else e.startsWith(z) && (c.push({
305
- type: 6,
306
- index: a
307
- }), i.removeAttribute(e));
308
- if (K.test(i.tagName)) {
309
- let e = i.textContent.split(z), t = e.length - 1;
310
- if (t > 0) {
311
- i.textContent = R ? R.emptyScript : "";
312
- for (let n = 0; n < t; n++) i.append(e[n], V()), He.nextNode(), c.push({
313
- type: 2,
314
- index: ++a
315
- });
316
- i.append(e[t], V());
317
- }
318
- }
319
- } else if (i.nodeType === 8) if (i.data === B) c.push({
320
- type: 2,
321
- index: a
322
- });
323
- else {
324
- let e = -1;
325
- for (; (e = i.data.indexOf(z, e + 1)) !== -1;) c.push({
326
- type: 7,
327
- index: a
328
- }), e += z.length - 1;
329
- }
330
- a++;
331
- }
332
- }
333
- static createElement(e, t) {
334
- let n = Pe.createElement("template");
335
- return n.innerHTML = e, n;
336
- }
337
- };
338
- function We(e, t, n = e, r) {
339
- if (t === q) return t;
340
- let i = r === void 0 ? n._$Cl : n._$Co?.[r], a = H(t) ? void 0 : t._$litDirective$;
341
- return i?.constructor !== a && (i?._$AO?.(!1), a === void 0 ? i = void 0 : (i = new a(e), i._$AT(e, n, r)), r === void 0 ? n._$Cl = i : (n._$Co ??= [])[r] = i), i !== void 0 && (t = We(e, i._$AS(e, t.values), i, r)), t;
342
- }
343
- var Ge = class {
344
- constructor(e, t) {
345
- this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
346
- }
347
- get parentNode() {
348
- return this._$AM.parentNode;
349
- }
350
- get _$AU() {
351
- return this._$AM._$AU;
352
- }
353
- u(e) {
354
- let { el: { content: t }, parts: n } = this._$AD, r = (e?.creationScope ?? Pe).importNode(t, !0);
355
- He.currentNode = r;
356
- let i = He.nextNode(), a = 0, o = 0, s = n[0];
357
- for (; s !== void 0;) {
358
- if (a === s.index) {
359
- let t;
360
- s.type === 2 ? t = new Ke(i, i.nextSibling, this, e) : s.type === 1 ? t = new s.ctor(i, s.name, s.strings, this, e) : s.type === 6 && (t = new Ze(i, this, e)), this._$AV.push(t), s = n[++o];
361
- }
362
- a !== s?.index && (i = He.nextNode(), a++);
363
- }
364
- return He.currentNode = Pe, r;
365
- }
366
- p(e) {
367
- let t = 0;
368
- for (let n of this._$AV) n !== void 0 && (n.strings === void 0 ? n._$AI(e[t]) : (n._$AI(e, n, t), t += n.strings.length - 2)), t++;
369
- }
370
- }, Ke = class e {
371
- get _$AU() {
372
- return this._$AM?._$AU ?? this._$Cv;
373
- }
374
- constructor(e, t, n, r) {
375
- this.type = 2, this._$AH = J, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = n, this.options = r, this._$Cv = r?.isConnected ?? !0;
376
- }
377
- get parentNode() {
378
- let e = this._$AA.parentNode, t = this._$AM;
379
- return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e;
380
- }
381
- get startNode() {
382
- return this._$AA;
383
- }
384
- get endNode() {
385
- return this._$AB;
386
- }
387
- _$AI(e, t = this) {
388
- e = We(this, e, t), H(e) ? e === J || e == null || e === "" ? (this._$AH !== J && this._$AR(), this._$AH = J) : e !== this._$AH && e !== q && this._(e) : e._$litType$ === void 0 ? e.nodeType === void 0 ? Fe(e) ? this.k(e) : this._(e) : this.T(e) : this.$(e);
389
- }
390
- O(e) {
391
- return this._$AA.parentNode.insertBefore(e, this._$AB);
392
- }
393
- T(e) {
394
- this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
395
- }
396
- _(e) {
397
- this._$AH !== J && H(this._$AH) ? this._$AA.nextSibling.data = e : this.T(Pe.createTextNode(e)), this._$AH = e;
398
- }
399
- $(e) {
400
- let { values: t, _$litType$: n } = e, r = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = Ue.createElement(X(n.h, n.h[0]), this.options)), n);
401
- if (this._$AH?._$AD === r) this._$AH.p(t);
402
- else {
403
- let e = new Ge(r, this), n = e.u(this.options);
404
- e.p(t), this.T(n), this._$AH = e;
405
- }
406
- }
407
- _$AC(e) {
408
- let t = Y.get(e.strings);
409
- return t === void 0 && Y.set(e.strings, t = new Ue(e)), t;
410
- }
411
- k(t) {
412
- U(this._$AH) || (this._$AH = [], this._$AR());
413
- let n = this._$AH, r, i = 0;
414
- for (let a of t) i === n.length ? n.push(r = new e(this.O(V()), this.O(V()), this, this.options)) : r = n[i], r._$AI(a), i++;
415
- i < n.length && (this._$AR(r && r._$AB.nextSibling, i), n.length = i);
416
- }
417
- _$AR(e = this._$AA.nextSibling, t) {
418
- for (this._$AP?.(!1, !0, t); e !== this._$AB;) {
419
- let t = e.nextSibling;
420
- e.remove(), e = t;
421
- }
422
- }
423
- setConnected(e) {
424
- this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
425
- }
426
- }, qe = class {
427
- get tagName() {
428
- return this.element.tagName;
429
- }
430
- get _$AU() {
431
- return this._$AM._$AU;
432
- }
433
- constructor(e, t, n, r, i) {
434
- this.type = 1, this._$AH = J, this._$AN = void 0, this.element = e, this.name = t, this._$AM = r, this.options = i, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(/* @__PURE__ */ new String()), this.strings = n) : this._$AH = J;
435
- }
436
- _$AI(e, t = this, n, r) {
437
- let i = this.strings, a = !1;
438
- if (i === void 0) e = We(this, e, t, 0), a = !H(e) || e !== this._$AH && e !== q, a && (this._$AH = e);
439
- else {
440
- let r = e, o, s;
441
- for (e = i[0], o = 0; o < i.length - 1; o++) s = We(this, r[n + o], t, o), s === q && (s = this._$AH[o]), a ||= !H(s) || s !== this._$AH[o], s === J ? e = J : e !== J && (e += (s ?? "") + i[o + 1]), this._$AH[o] = s;
442
- }
443
- a && !r && this.j(e);
444
- }
445
- j(e) {
446
- e === J ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
447
- }
448
- }, Je = class extends qe {
449
- constructor() {
450
- super(...arguments), this.type = 3;
451
- }
452
- j(e) {
453
- this.element[this.name] = e === J ? void 0 : e;
454
- }
455
- }, Ye = class extends qe {
456
- constructor() {
457
- super(...arguments), this.type = 4;
458
- }
459
- j(e) {
460
- this.element.toggleAttribute(this.name, !!e && e !== J);
461
- }
462
- }, Xe = class extends qe {
463
- constructor(e, t, n, r, i) {
464
- super(e, t, n, r, i), this.type = 5;
465
- }
466
- _$AI(e, t = this) {
467
- if ((e = We(this, e, t, 0) ?? J) === q) return;
468
- let n = this._$AH, r = e === J && n !== J || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive, i = e !== J && (n === J || r);
469
- r && this.element.removeEventListener(this.name, this, n), i && this.element.addEventListener(this.name, this, e), this._$AH = e;
470
- }
471
- handleEvent(e) {
472
- typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
473
- }
474
- }, Ze = class {
475
- constructor(e, t, n) {
476
- this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = n;
477
- }
478
- get _$AU() {
479
- return this._$AM._$AU;
480
- }
481
- _$AI(e) {
482
- We(this, e);
483
- }
484
- }, Qe = Ae.litHtmlPolyfillSupport;
485
- Qe?.(Ue, Ke), (Ae.litHtmlVersions ??= []).push("3.3.1");
486
- var $e = (e, t, n) => {
487
- let r = n?.renderBefore ?? t, i = r._$litPart$;
488
- if (i === void 0) {
489
- let e = n?.renderBefore ?? null;
490
- r._$litPart$ = i = new Ke(t.insertBefore(V(), e), e, void 0, n ?? {});
491
- }
492
- return i._$AI(e), i;
493
- }, et = globalThis, tt = class extends L {
494
- constructor() {
495
- super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
496
- }
497
- createRenderRoot() {
498
- let e = super.createRenderRoot();
499
- return this.renderOptions.renderBefore ??= e.firstChild, e;
500
- }
501
- update(e) {
502
- let t = this.render();
503
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = $e(t, this.renderRoot, this.renderOptions);
504
- }
505
- connectedCallback() {
506
- super.connectedCallback(), this._$Do?.setConnected(!0);
507
- }
508
- disconnectedCallback() {
509
- super.disconnectedCallback(), this._$Do?.setConnected(!1);
510
- }
511
- render() {
512
- return q;
513
- }
514
- };
515
- tt._$litElement$ = !0, tt.finalized = !0, et.litElementHydrateSupport?.({ LitElement: tt });
516
- var nt = et.litElementPolyfillSupport;
517
- nt?.({ LitElement: tt }), (et.litElementVersions ??= []).push("4.2.1");
518
- var rt = (e) => (t, n) => {
519
- n === void 0 ? customElements.get(e) || customElements.define(e, t) : n.addInitializer((() => {
520
- customElements.get(e) || customElements.define(e, t);
521
- }));
522
- }, it = {
523
- attribute: !0,
524
- type: String,
525
- converter: P,
526
- reflect: !1,
527
- hasChanged: F
528
- }, at = (e = it, t, n) => {
529
- let { kind: r, metadata: i } = n, a = globalThis.litPropertyMetadata.get(i);
530
- if (a === void 0 && globalThis.litPropertyMetadata.set(i, a = /* @__PURE__ */ new Map()), r === "setter" && ((e = Object.create(e)).wrapped = !0), a.set(n.name, e), r === "accessor") {
531
- let { name: r } = n;
532
- return {
533
- set(n) {
534
- let i = t.get.call(this);
535
- t.set.call(this, n), this.requestUpdate(r, i, e);
536
- },
537
- init(t) {
538
- return t !== void 0 && this.C(r, void 0, e, t), t;
539
- }
540
- };
541
- }
542
- if (r === "setter") {
543
- let { name: r } = n;
544
- return function(n) {
545
- let i = this[r];
546
- t.call(this, n), this.requestUpdate(r, i, e);
547
- };
548
- }
549
- throw Error("Unsupported decorator location: " + r);
550
- };
551
- function ot(e) {
552
- return (t, n) => typeof n == "object" ? at(e, t, n) : ((e, t, n) => {
553
- let r = t.hasOwnProperty(n);
554
- return t.constructor.createProperty(n, e), r ? Object.getOwnPropertyDescriptor(t, n) : void 0;
555
- })(e, t, n);
556
- }
557
- var st = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, ct = (e, t, n, r) => {
558
- for (var i = r > 1 ? void 0 : r ? Q(t, n) : t, a = e.length - 1, o; a >= 0; a--) (o = e[a]) && (i = (r ? o(t, n, i) : o(i)) || i);
559
- return r && i && st(t, n, i), i;
560
- }, $ = class extends tt {
561
- constructor() {
562
- super(...arguments), this.variant = "primary", this.size = "default", this.type = "circle", this.state = "default", this.iconName = "home", this.disabled = !1, this.buttonAriaLabel = "Icon button";
563
- }
564
- createRenderRoot() {
565
- return this;
566
- }
567
- connectedCallback() {
568
- if (super.connectedCallback(), !document.querySelector("link[href*=\"Roboto\"]")) {
569
- let e = document.createElement("link");
570
- e.rel = "stylesheet", e.href = "https://ui.renaissance.com/fonts/Roboto/style.css", document.head.appendChild(e);
571
- }
572
- }
573
- set shape(e) {
574
- this.type = e;
575
- }
576
- get shape() {
577
- return this.type;
578
- }
579
- get buttonClasses() {
580
- return [
581
- "nds-icon-button",
582
- `nds-icon-button--${this.variant}`,
583
- `nds-icon-button--${this.size}`,
584
- `nds-icon-button--${this.type}`,
585
- this.state === "default" ? "" : `nds-icon-button--${this.state}`,
586
- this.disabled ? "nds-icon-button--disabled" : ""
587
- ].filter(Boolean).join(" ");
588
- }
589
- handleClick(e) {
590
- if (this.disabled) {
591
- e.preventDefault(), e.stopPropagation();
592
- return;
593
- }
594
- this.dispatchEvent(new CustomEvent("icon-button-click", {
595
- bubbles: !0,
596
- composed: !0,
597
- detail: { originalEvent: e }
598
- }));
599
- }
600
- render() {
601
- return Ve`
602
- <style>
603
- nds-icon-button {
604
- display: inline-block;
605
- }
606
-
607
- .nds-icon-button {
608
- display: inline-flex;
609
- align-items: center;
610
- justify-content: center;
611
- cursor: pointer;
612
- font-family: var(--font-family-roboto, "Roboto", sans-serif);
613
- font-weight: var(--font-weight-regular, 400);
614
- line-height: 1;
615
- text-decoration: none;
616
- background: none;
617
- position: relative;
618
- box-sizing: border-box;
619
- margin: 0;
620
- padding: 0;
621
- border: none;
622
- transition: background-color 0.2s ease-in-out,
623
- color 0.2s ease-in-out,
624
- box-shadow 0.2s ease-in-out;
625
- }
626
-
627
- /* ── Sizes ── */
628
- .nds-icon-button--small {
629
- width: var(--height-32, 32px);
630
- height: var(--height-32, 32px);
631
- }
632
-
633
- .nds-icon-button--medium {
634
- width: var(--height-36, 36px);
635
- height: var(--height-36, 36px);
636
- }
637
-
638
- .nds-icon-button--default {
639
- width: var(--height-40, 40px);
640
- height: var(--height-40, 40px);
641
- }
642
-
643
- .nds-icon-button--large {
644
- width: var(--height-48, 48px);
645
- height: var(--height-48, 48px);
646
- }
647
-
648
- /* ── Shapes ── */
649
- .nds-icon-button--circle {
650
- border-radius: var(--radius-circle, 50%);
651
- }
652
-
653
- .nds-icon-button--rounded {
654
- border-radius: var(--radius-8, 8px);
655
- }
656
-
657
- /* ── Primary ── */
658
- .nds-icon-button--primary {
659
- background-color: var(--color-interactive-blue, #146eb3);
660
- color: var(--color-primary-white, #ffffff);
661
- }
662
-
663
- .nds-icon-button--primary:hover:not(:disabled):not(.nds-icon-button--disabled) {
664
- box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-black, #000000);
665
- }
666
-
667
- .nds-icon-button--primary:active:not(:disabled):not(.nds-icon-button--disabled) {
668
- box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-black, #000000);
669
- }
670
-
671
- /* ── Secondary ── */
672
- .nds-icon-button--secondary {
673
- background-color: var(--color-primary-white, #ffffff);
674
- color: var(--color-interactive-blue, #146eb3);
675
- box-shadow: inset 0 0 0 var(--stroke-1, 1px) var(--color-interactive-blue, #146eb3);
676
- }
677
-
678
- .nds-icon-button--secondary:hover:not(:disabled):not(.nds-icon-button--disabled) {
679
- background-color: var(--color-interactive-blue, #146eb3);
680
- color: var(--color-primary-white, #ffffff);
681
- box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-black, #000000);
682
- }
683
-
684
- .nds-icon-button--secondary:active:not(:disabled):not(.nds-icon-button--disabled) {
685
- background-color: var(--color-interactive-blue, #146eb3);
686
- color: var(--color-primary-white, #ffffff);
687
- box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-black, #000000);
688
- }
689
-
690
- /* ── Tertiary ── */
691
- .nds-icon-button--tertiary {
692
- background-color: var(--color-new-gray, #f3f5f7);
693
- color: var(--color-interactive-blue, #146eb3);
694
- }
695
-
696
- .nds-icon-button--tertiary:hover:not(:disabled):not(.nds-icon-button--disabled) {
697
- box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-interactive-blue, #146eb3);
698
- }
699
-
700
- .nds-icon-button--tertiary:active:not(:disabled):not(.nds-icon-button--disabled) {
701
- box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-black, #000000);
702
- }
703
-
704
- /* ── Ghost ── */
705
- .nds-icon-button--ghost {
706
- background-color: transparent;
707
- color: var(--color-interactive-blue, #146eb3);
708
- }
709
-
710
- .nds-icon-button--ghost:hover:not(:disabled):not(.nds-icon-button--disabled) {
711
- background-color: var(--color-new-gray, #f3f5f7);
712
- box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-interactive-blue, #146eb3);
713
- }
714
-
715
- .nds-icon-button--ghost:active:not(:disabled):not(.nds-icon-button--disabled) {
716
- background-color: var(--color-new-gray, #f3f5f7);
717
- box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-black, #000000);
718
- }
719
-
720
- /* ── Dark (for dark backgrounds) ── */
721
- .nds-icon-button--dark {
722
- background-color: transparent;
723
- color: var(--color-primary-white, #ffffff);
724
- box-shadow: inset 0 0 0 var(--stroke-1, 1px) var(--color-primary-white, #ffffff);
725
- }
726
-
727
- .nds-icon-button--dark:hover:not(:disabled):not(.nds-icon-button--disabled) {
728
- background-color: var(--color-interactive-blue, #146eb3);
729
- box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-white, #ffffff);
730
- }
731
-
732
- .nds-icon-button--dark:active:not(:disabled):not(.nds-icon-button--disabled) {
733
- background-color: var(--color-interactive-blue, #146eb3);
734
- box-shadow: inset 0 0 0 var(--stroke-2, 2px) var(--color-primary-white, #ffffff);
735
- }
736
-
737
- /* ── Disabled ── */
738
- .nds-icon-button--disabled,
739
- .nds-icon-button:disabled {
740
- opacity: 0.5;
741
- cursor: not-allowed;
742
- }
743
-
744
- /* ── Icon sizing ── */
745
- .nds-icon-button__icon {
746
- line-height: 1;
747
- display: inline-flex;
748
- align-items: center;
749
- justify-content: center;
750
- color: inherit;
751
- }
752
-
753
- .nds-icon-button--small .nds-icon-button__icon {
754
- font-size: var(--nds-icon-small, 12px);
755
- }
756
-
757
- .nds-icon-button--medium .nds-icon-button__icon {
758
- font-size: var(--nds-icon-medium, 14px);
759
- }
760
-
761
- .nds-icon-button--default .nds-icon-button__icon {
762
- font-size: var(--nds-icon-default, 16px);
763
- }
764
-
765
- .nds-icon-button--large .nds-icon-button__icon {
766
- font-size: var(--nds-icon-large, 20px);
767
- }
768
-
769
- /* ── Focus ── */
770
- .nds-icon-button:focus-visible {
771
- outline: 2px solid var(--color-focus-blue, #2b87ff);
772
- outline-offset: 2px;
773
- }
774
-
775
- /* ── Reduced motion ── */
776
- @media (prefers-reduced-motion: reduce) {
777
- .nds-icon-button {
778
- transition: none;
779
- }
780
- }
781
- </style>
782
- <button
783
- type="button"
784
- class="${this.buttonClasses}"
785
- ?disabled="${this.disabled}"
786
- aria-disabled="${this.disabled ? "true" : "false"}"
787
- aria-label="${this.buttonAriaLabel}"
788
- @click="${this.handleClick}"
789
- >
790
- <i class="fa-light fa-${this.iconName} nds-icon-button__icon" aria-hidden="true"></i>
791
- </button>
792
- `;
793
- }
794
- };
795
- ct([ot()], $.prototype, "variant", 2), ct([ot()], $.prototype, "size", 2), ct([ot()], $.prototype, "type", 2), ct([ot()], $.prototype, "state", 2), ct([ot({ attribute: "icon-name" })], $.prototype, "iconName", 2), ct([ot({ type: Boolean })], $.prototype, "disabled", 2), ct([ot({ attribute: "button-aria-label" })], $.prototype, "buttonAriaLabel", 2), ct([ot()], $.prototype, "shape", 1), $ = ct([rt("nds-icon-button")], $);
796
- //#endregion
797
- //#region ../../node_modules/.bun/@pie-players+pie-assessment-toolkit@0.3.63+aad50156ca4f9ae2/node_modules/@pie-players/pie-assessment-toolkit/dist/components/chunks/ItemToolBar-84nv78dy.js
798
- function lt(e) {
799
- return typeof e.href == "string";
800
- }
801
- function ut(e) {
802
- if (!e || typeof e != "object" || Array.isArray(e)) return !1;
803
- let t = e;
804
- if (typeof t.id != "string" || t.id.trim().length === 0 || typeof t.label != "string" || t.label.trim().length === 0 || t.ariaLabel !== void 0 && typeof t.ariaLabel != "string" || t.icon !== void 0 && typeof t.icon != "string" || t.tooltip !== void 0 && typeof t.tooltip != "string" || t.active !== void 0 && typeof t.active != "boolean" || t.disabled !== void 0 && typeof t.disabled != "boolean") return !1;
805
- let n = typeof t.href == "string", r = typeof t.onClick == "function";
806
- return n === r ? !1 : n ? !0 : r;
807
- }
808
- function dt(e) {
809
- return typeof e == "string" && e.trimStart().startsWith("<svg");
810
- }
811
- function ft(e) {
812
- return typeof e == "string" && e.trimStart().startsWith("http");
813
- }
814
- var pt = (e, t) => {
815
- if (!customElements.get(e)) try {
816
- customElements.define(e, t);
817
- } catch (t) {
818
- if (!(t instanceof DOMException && t.name === "NotSupportedError" || t && typeof t == "object" && t.name === "NotSupportedError") || !customElements.get(e)) throw t;
819
- }
820
- }, mt = k("<span class=\"item-toolbar__element-host svelte-rnx3ie\"></span>"), ht = k("<span class=\"item-toolbar__nds-button-zoom svelte-rnx3ie\"><nds-icon-button></nds-icon-button></span>", 2), gt = k("<span aria-hidden=\"true\"></span>"), _t = k("<img class=\"item-toolbar__icon-image svelte-rnx3ie\" alt=\"\"/>"), vt = k("<i aria-hidden=\"true\"></i>"), yt = k("<a><!></a>"), bt = k("<button type=\"button\"><!></button>"), xt = k("<span class=\"item-toolbar__controls-host svelte-rnx3ie\"></span>"), St = k("<div></div>"), Ct = k("<div><div class=\"item-toolbar__tools-row svelte-rnx3ie\"><!> <!> <!></div> <!></div>"), wt = {
821
- hash: "svelte-rnx3ie",
822
- 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;\n /* Cap the gap between toolbar items (e.g. TTS play ↔ calculator) at its\n 200%-zoom size with the same factor the buttons use, so the spacing\n 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,\n .item-toolbar--bottom.svelte-rnx3ie {align-items:flex-end;}.item-toolbar--left.svelte-rnx3ie,\n .item-toolbar--right.svelte-rnx3ie {align-items:stretch;}.item-toolbar--left.svelte-rnx3ie .item-toolbar__tools-row:where(.svelte-rnx3ie),\n .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),\n .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;}\n\n /* Drive the vendored NDS icon button's outer size via its own `--height-32`\n custom property so its light-DOM inner button matches the toolbar's\n md/sm/lg dimensions (32 / 44 / 40 px) without a layout shift. The glyph\n keeps the NDS-native icon size (we render size=\"small\"), so it isn't\n oversized. */\n /* Freeze the calculator's header open/close button at its 200%-zoom size\n (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) {\n /* Host-settable button size per toolbar size (drives the NDS outer button\n via its own --height-32). */--height-32: var(--pie-calculator-button-size, 2rem);\n /* Host-settable accent for the calculator button: the NDS tertiary glyph\n colour derives from --color-interactive-blue, remapped here to a\n 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;}"
823
- };
824
- function Tt(e, O) {
825
- i(O, !0), S(e, wt);
826
- let k = typeof window < "u", me = ["/_fa-pro/fontawesome.min.css", "/_fa-pro/light.min.css"], he = "https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css", ge = /font.?awesome|fa-?pro/i, _e = !1, ve = () => {
827
- if (!(!k || _e)) {
828
- if (_e = !0, !document.querySelector("link[href*=\"Roboto\"]")) {
829
- let e = document.createElement("link");
830
- e.rel = "stylesheet", e.href = "https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap", document.head.appendChild(e);
831
- }
832
- if (!Array.from(document.querySelectorAll("link[rel=\"stylesheet\"][href]")).some((e) => ge.test(e.href))) {
833
- if (!document.querySelector(`link[href="${he}"]`)) {
834
- let e = document.createElement("link");
835
- e.rel = "stylesheet", e.href = he, document.head.appendChild(e);
836
- }
837
- for (let e of me) {
838
- if (document.querySelector(`link[href="${e}"]`)) continue;
839
- let t = document.createElement("link");
840
- t.rel = "stylesheet", t.href = e, document.head.appendChild(t);
841
- }
842
- }
843
- }
844
- }, ye = "__pieFaToolbarShadowInstalled", j = (e) => {
845
- let t = e.getRootNode();
846
- if (!(t instanceof ShadowRoot)) return;
847
- let n = t;
848
- if (n[ye]) return;
849
- n[ye] = !0;
850
- let r = /* @__PURE__ */ new Set(), i = (e) => {
851
- if (!e || r.has(e)) return;
852
- r.add(e);
853
- let n = document.createElement("link");
854
- n.rel = "stylesheet", n.href = e, t.appendChild(n);
855
- }, a = Array.from(document.querySelectorAll("link[rel=\"stylesheet\"][href]")).filter((e) => ge.test(e.href));
856
- for (let e of a) i(e.href);
857
- }, be = (e) => (ve(), j(e), {}), xe = (e, t) => {
858
- let n = t, r = () => {
859
- let t = e.querySelector("button");
860
- t && t.setAttribute("aria-pressed", n ? "true" : "false");
861
- };
862
- r();
863
- let i = new MutationObserver(r);
864
- return i.observe(e, {
865
- childList: !0,
866
- subtree: !0
867
- }), {
868
- update(e) {
869
- n = e, r();
870
- },
871
- destroy() {
872
- i.disconnect();
873
- }
874
- };
875
- }, Se = { calculator: "calculator" }, Ce = (e) => Se[e.id] ?? null, we = ne(), M = m(le({})), N = r(O, "level", 7, "item"), Te = r(O, "scopeId", 7, ""), Ee = r(O, "itemId", 7, ""), De = r(O, "sectionId", 7, ""), Oe = r(O, "catalogId", 7, ""), ke = r(O, "tools", 7, "calculator,textToSpeech,answerEliminator"), P = r(O, "contentKind", 7, "assessment-item"), F = r(O, "position", 7, "bottom"), I = r(O, "scopeElement", 7, null), L = r(O, "toolRegistry", 7, null), Ae = r(O, "item", 7, null), R = r(O, "hostButtons", 23, () => []), je = r(O, "class", 7, ""), Me = r(O, "size", 7, "md"), z = r(O, "language", 7, "en-US"), B = m(null);
876
- function Ne() {
877
- return typeof window > "u" ? 1 : pe(A(window.outerWidth, window.innerWidth), fe.maxZoom, fe.minCompensation);
878
- }
879
- let Pe = m(1);
880
- D(() => {
881
- if (typeof window > "u") return;
882
- let e = () => {
883
- c(Pe, Ne(), !0);
884
- };
885
- return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
886
- });
887
- let V = m(null), H = f(() => p(V)?.ndsIcons === !0), U = m(null), Fe = m(0), Ie = m(0), Le = m(0);
888
- D(() => {
889
- if (p(B)) return ee(p(B), (e) => {
890
- c(V, e, !0);
891
- });
892
- }), D(() => {
893
- if (p(B)) return C(p(B), (e) => {
894
- c(U, e, !0);
895
- });
896
- }), D(() => {
897
- let e = p(V)?.toolkitCoordinator;
898
- if (!e || typeof e.onPolicyChange != "function") return;
899
- let t = e.onPolicyChange(() => {
900
- c(Ie, p(Ie) + 1);
901
- });
902
- return () => {
903
- try {
904
- t?.();
905
- } catch {}
906
- };
907
- }), D(() => {
908
- let e = p(V)?.toolkitCoordinator;
909
- if (!e || typeof e.onToolContextResolverChange != "function") return;
910
- let t = e.onToolContextResolverChange(() => {
911
- c(Le, p(Le) + 1);
912
- });
913
- return () => {
914
- try {
915
- t?.();
916
- } catch {}
917
- };
918
- });
919
- let W = f(() => p(V)?.toolCoordinator), Re = f(() => p(V)?.ttsService), G = f(() => p(V)?.elementToolStateStore), ze = f(() => p(V)?.assessmentId ?? ""), Be = f(() => Ee() || p(U)?.itemId || ""), K = f(() => p(U)?.canonicalItemId || p(Be)), Ve = f(() => De() || p(V)?.sectionId || ""), q = f(() => P() || p(U)?.contentKind || (N() === "section" ? "section" : "assessment-item")), J = f(() => N() && N() !== "item" ? N() : p(q) === "rubric-block-stimulus" ? "passage" : "item"), Y = f(() => Te() ? Te() : p(J) === "section" ? p(Ve) || p(V)?.sectionId || "default-section" : p(J) === "assessment" ? p(V)?.assessmentId || "default-assessment" : p(K) || p(Be) || "default-item"), He = f(() => Oe() || p(Y)), X = f(() => Ae() || p(U)?.item || null), Z = f(() => L() || we), Ue = f(() => E(ke())), We = f(() => p(Z).normalizeToolIds(p(Ue)).filter(Boolean)), Ge = f(() => p(J) === "section" ? "section" : p(J) === "passage" || p(q) === "rubric-block-stimulus" ? "passage" : "item"), Ke = f(() => {
920
- p(Ie);
921
- let e = p(V)?.toolkitCoordinator;
922
- return !e || typeof e.decideToolPolicy != "function" ? null : e.decideToolPolicy({
923
- level: p(Ge),
924
- scope: {
925
- level: p(J),
926
- scopeId: p(Y),
927
- assessmentId: p(V)?.assessmentId,
928
- sectionId: p(Ve) || void 0,
929
- itemId: p(Be) || void 0,
930
- canonicalItemId: p(K) || void 0,
931
- contentKind: p(q)
932
- }
933
- });
934
- }), qe = f(() => {
935
- let e = (e) => Array.from(new Set(e));
936
- return p(Ke) ? e(p(Z).normalizeToolIds(p(Ke).visibleTools.map((e) => e.toolId)).filter(Boolean)) : e(p(We));
937
- }), Je = f(() => {
938
- if (p(J) === "section" || p(J) === "assessment") return !0;
939
- let e = p(X)?.config;
940
- return !!(p(X) && e && typeof e == "object");
941
- }), Ye = f(() => {
942
- p(Ie);
943
- let e = p(V)?.toolkitCoordinator;
944
- return !e || typeof e.getPolicyInputs != "function" ? null : e.getPolicyInputs();
945
- }), Xe = f(() => p(Ye)?.assessment ?? null), Ze = f(() => p(Ye)?.currentItemRef ?? null), Qe = f(() => p(J) === "section" ? {
946
- level: "section",
947
- assessment: p(Xe) || {},
948
- section: {}
949
- } : p(J) === "assessment" ? {
950
- level: "assessment",
951
- assessment: p(Xe) || {}
952
- } : !p(Je) || !p(X) ? null : p(J) === "passage" ? {
953
- level: "passage",
954
- assessment: p(Xe) || {},
955
- itemRef: p(Ze) || { id: p(K) },
956
- passage: p(X)
957
- } : {
958
- level: "item",
959
- assessment: p(Xe) || {},
960
- itemRef: p(Ze) || { id: p(K) },
961
- item: p(X)
962
- }), $e = f(() => p(Qe) ? p(Qe) : {
963
- level: "item",
964
- assessment: p(Xe) || {},
965
- itemRef: p(Ze) || { id: p(K) },
966
- item: p(X) || {
967
- id: p(K),
968
- config: {}
969
- }
970
- }), et = f(() => {
971
- if (p(J) !== "item" && p(J) !== "passage" || !p(Je) || !p(X)) return [];
972
- let e = p(X)?.config?.models;
973
- return (Array.isArray(e) ? e : e && typeof e == "object" ? Object.values(e) : []).filter((e) => e && typeof e == "object" && typeof e.id == "string").map((e) => ({
974
- level: "element",
975
- assessment: p(Xe) || {},
976
- itemRef: p(Ze) || { id: p(K) },
977
- item: p(X),
978
- elementId: e.id
979
- }));
980
- }), tt = f(() => {
981
- let e = p(V)?.toolkitCoordinator || null, t = (e) => u(e) ? e : ue(e, p(J), p(Y));
982
- return {
983
- scope: {
984
- level: p(J),
985
- scopeId: p(Y),
986
- assessmentId: p(V)?.assessmentId,
987
- sectionId: p(Ve),
988
- itemId: p(Be),
989
- canonicalItemId: p(K),
990
- contentKind: p(q)
991
- },
992
- itemId: p(Y),
993
- catalogId: p(He),
994
- language: z(),
995
- ui: { size: Me() },
996
- getScopeElement: () => I() || p(U)?.scopeElement || null,
997
- getGlobalElementId: () => !p(G) || !p(ze) || !p(Ve) || !p(K) ? null : p(G).getGlobalElementId(p(ze), p(Ve), p(K), p(K)),
998
- toolCoordinator: p(W) || null,
999
- toolkitCoordinator: e,
1000
- ttsService: p(Re) || null,
1001
- elementToolStateStore: p(G) || null,
1002
- toggleTool: (e) => {
1003
- if (!p(W)) return;
1004
- let n = t(e);
1005
- p(W).getToolState(n) || p(W).registerTool(n, e), p(W).toggleTool(n);
1006
- },
1007
- isToolVisible: (e) => p(W) ? p(W).isToolVisible(t(e)) : !1,
1008
- subscribeVisibility: p(W) ? (e) => p(W).subscribe(e) : null
1009
- };
1010
- }), nt = f(() => {
1011
- p(Le);
1012
- let e = p(V)?.toolkitCoordinator;
1013
- if (!e || typeof e.hasToolContextResolver != "function" || typeof e.resolveToolContext != "function") return {};
1014
- let t = {};
1015
- for (let n of p(qe)) {
1016
- if (!p(Z).get(n)?.supportedLevels.includes(p(J)) || !e.hasToolContextResolver(n)) continue;
1017
- let r = e.resolveToolContext({
1018
- toolId: n,
1019
- context: p($e),
1020
- toolbarContext: p(tt)
1021
- });
1022
- r && (t[n] = r);
1023
- }
1024
- return t;
1025
- }), rt = f(() => {
1026
- let e = p(qe).filter((e) => {
1027
- let t = p(Z).get(e);
1028
- return t ? t.supportedLevels.includes(p(J)) : !1;
1029
- }), t = Object.values(p(nt)), n = new Set(t.map((e) => e.toolId)), r = new Set(t.filter((e) => e.visible).map((e) => e.toolId)), i = e.filter((e) => !n.has(e));
1030
- if (p(J) === "section" || !p(Je) || !p(Qe) && p(et).length === 0) return i.forEach((e) => r.add(e)), Array.from(r);
1031
- p(Qe) && p(Z).filterVisibleInContext(i, p(Qe)).forEach((e) => r.add(e.toolId));
1032
- for (let e of p(et)) p(Z).filterVisibleInContext(i, e).forEach((e) => r.add(e.toolId));
1033
- return Array.from(r);
1034
- }), it = f(() => p(Z).filterToolIdsByActivation(p(rt), "toolbar-toggle"));
1035
- D(() => {
1036
- if (!k) return;
1037
- let e = !1;
1038
- return p(Z).ensureToolModulesLoaded(p(it)).then(() => {
1039
- e || c(Fe, p(Fe) + 1);
1040
- }).catch((e) => {
1041
- console.error("[ItemToolBar] Failed to load one or more tool modules:", e);
1042
- }), () => {
1043
- e = !0;
1044
- };
1045
- });
1046
- function at() {
1047
- return I() ? I() : p(U)?.scopeElement || null;
1048
- }
1049
- function ot() {
1050
- return !p(G) || !p(ze) || !p(Ve) || !p(K) ? null : p(G).getGlobalElementId(p(ze), p(Ve), p(K), p(K));
1051
- }
1052
- let st = f(() => {
1053
- let e = p(V)?.toolkitCoordinator || null, t = (e) => u(e) ? e : ue(e, p(J), p(Y));
1054
- return {
1055
- scope: {
1056
- level: p(J),
1057
- scopeId: p(Y),
1058
- assessmentId: p(V)?.assessmentId,
1059
- sectionId: p(Ve),
1060
- itemId: p(Be),
1061
- canonicalItemId: p(K),
1062
- contentKind: p(q)
1063
- },
1064
- itemId: p(Y),
1065
- catalogId: p(He),
1066
- language: z(),
1067
- ui: { size: Me() },
1068
- getScopeElement: at,
1069
- getGlobalElementId: ot,
1070
- toolCoordinator: p(W) || null,
1071
- toolkitCoordinator: e,
1072
- ttsService: p(Re) || null,
1073
- elementToolStateStore: p(G) || null,
1074
- toggleTool: (e) => {
1075
- if (!p(W)) return;
1076
- let n = t(e);
1077
- p(W).getToolState(n) || p(W).registerTool(n, e), p(W).toggleTool(n);
1078
- },
1079
- isToolVisible: (e) => p(W) ? p(W).isToolVisible(t(e)) : !1,
1080
- subscribeVisibility: p(W) ? (e) => p(W).subscribe(e) : null,
1081
- getResolvedToolContext: (e) => p(nt)[e] ?? null,
1082
- getToolRenderParams: (e) => p(nt)[e]?.params ?? null
1083
- };
1084
- }), Q = f(() => {
1085
- if (!k) return [];
1086
- p(Fe);
1087
- let e = [];
1088
- for (let t of p(it)) {
1089
- let n = p(Z).renderForToolbar(t, p($e), p(st));
1090
- n && e.push(n);
1091
- }
1092
- return e;
1093
- }), ct = f(() => {
1094
- if (!Array.isArray(R())) return [];
1095
- let e = [];
1096
- return R().forEach((t, n) => {
1097
- if (ut(t)) {
1098
- e.push(t);
1099
- return;
1100
- }
1101
- console.warn(`[ItemToolBar] Ignoring invalid host button at index ${n}. Expected { id, label, href | onClick } with valid types.`);
1102
- }), e;
1103
- }), $ = f(() => p(Q).filter((e) => !!e.button).map((e) => {
1104
- let t = e.button;
1105
- return {
1106
- id: e.toolId,
1107
- label: t.label,
1108
- ariaLabel: t.ariaLabel || t.label,
1109
- icon: t.icon,
1110
- tooltip: t.tooltip || t.label,
1111
- disabled: t.disabled,
1112
- active: p(M)[e.toolId] ?? t.active ?? !1,
1113
- onClick: () => {
1114
- t.onClick(), zt();
1115
- }
1116
- };
1117
- })), pt = f(() => [...p($), ...p(ct)]), Tt = f(() => {
1118
- let e = {};
1119
- for (let t of p(Q)) e[t.toolId] = p(M)[t.toolId] ?? t.button?.active ?? !1;
1120
- return e;
1121
- }), Et = f(() => p(Q).flatMap((e) => (e.elements || []).filter((e) => e.mount === "before-buttons").filter((e) => !!e.element).map((t, n) => ({
1122
- key: `before-${e.toolId}-${n}`,
1123
- toolId: e.toolId,
1124
- entry: t
1125
- })))), Dt = f(() => p(Q).flatMap((e) => (e.elements || []).filter((e) => e.mount === "after-buttons").filter((e) => !!e.element).map((t, n) => ({
1126
- key: `after-${e.toolId}-${n}`,
1127
- toolId: e.toolId,
1128
- entry: t
1129
- })))), Ot = f(() => p(Q).flatMap((e) => (e.elements || []).filter((e) => e.mount === "controls-row").filter((e) => !!e.element).map((t, n) => ({
1130
- key: `controls-row-${e.toolId}-${n}`,
1131
- toolId: e.toolId,
1132
- entry: t
1133
- })))), kt = f(() => p(Q).flatMap((e) => (e.elements || []).map((t) => ({
1134
- toolId: e.toolId,
1135
- hint: t.layoutHints?.controlsRow
1136
- })).filter((e) => !!e.hint))), At = f(() => p(Q).flatMap((e) => (e.elements || []).map((t) => ({
1137
- toolId: e.toolId,
1138
- hint: t.layoutHints?.headerOverlay
1139
- })).filter((e) => !!e.hint))), jt = f(() => p(kt).some((e) => e.hint?.reserveSpace === !0)), Mt = f(() => p(kt).some((e) => e.hint?.showWhenToolActive === !0 && (p(Tt)[e.toolId] ?? !1))), Nt = f(() => F() === "left" || F() === "right"), Pt = f(() => p(At).some((e) => e.hint?.showWhenToolActive === !0 && (p(Tt)[e.toolId] ?? !1))), Ft = f(() => p(Ot).length > 0 || p(jt) || p(Mt));
1140
- function It() {
1141
- if (!p(B)) return null;
1142
- let e = p(B).getRootNode();
1143
- return e instanceof ShadowRoot ? e.host : null;
1144
- }
1145
- D(() => {
1146
- let e = It();
1147
- if (!e) return;
1148
- let t = p(At).length > 0, n = p(Pt);
1149
- return e.setAttribute("data-pie-header-overlay", t ? "true" : "false"), e.setAttribute("data-pie-header-overlay-active", n ? "true" : "false"), () => {
1150
- e.removeAttribute("data-pie-header-overlay"), e.removeAttribute("data-pie-header-overlay-active");
1151
- };
1152
- }), D(() => {
1153
- k && p(pt).some((e) => e.icon === "calculator") && ve();
1154
- });
1155
- function Lt(e) {
1156
- return e.id in p(M) ? p(M)[e.id] === !0 : e.active === !0;
1157
- }
1158
- function Rt(e) {
1159
- return {
1160
- 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>",
1161
- "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>",
1162
- 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>",
1163
- "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>",
1164
- 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>",
1165
- 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>",
1166
- "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>",
1167
- 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>"
1168
- }[e] || null;
1169
- }
1170
- function zt() {
1171
- let e = {};
1172
- for (let t of p(Q)) t.sync?.(), t.button && (e[t.toolId] = t.button.active ?? !1);
1173
- c(M, e, !0);
1174
- }
1175
- D(() => {
1176
- let e = [];
1177
- zt();
1178
- for (let t of p(Q)) if (t.subscribeActive) {
1179
- let n = !1, r = t.subscribeActive((e) => {
1180
- queueMicrotask(() => {
1181
- n || (c(M, {
1182
- ...p(M),
1183
- [t.toolId]: e
1184
- }, !0), t.sync?.());
1185
- });
1186
- });
1187
- e.push(() => {
1188
- n = !0, r();
1189
- });
1190
- }
1191
- return () => {
1192
- e.forEach((e) => e());
1193
- };
1194
- }), D(() => {
1195
- if (!p(st).subscribeVisibility) return;
1196
- let e = !1, t = p(st).subscribeVisibility(() => {
1197
- queueMicrotask(() => {
1198
- e || zt();
1199
- });
1200
- });
1201
- return () => {
1202
- e = !0, t?.();
1203
- };
1204
- }), D(() => {
1205
- let e = p(st).toolkitCoordinator;
1206
- if (typeof e?.subscribeTelemetry != "function") return;
1207
- let t = !1, n = e.subscribeTelemetry(({ eventName: e, payload: n }) => {
1208
- e === "pie-toolkit-tool-config-updated" && (n?.toolId && !p(it).includes(n.toolId) || queueMicrotask(() => {
1209
- t || (c(Fe, p(Fe) + 1), zt());
1210
- }));
1211
- });
1212
- return () => {
1213
- t = !0, n?.();
1214
- };
1215
- });
1216
- function Bt(e, t) {
1217
- let n = null, r = (e) => {
1218
- if (!e) return;
1219
- let t = e.__pieToolElementUnmount;
1220
- typeof t == "function" && t();
1221
- }, i = (t) => {
1222
- n !== t && (n && (r(n), n.parentNode === e && e.removeChild(n)), n = t, n && (n.parentNode && n.parentNode !== e && n.parentNode.removeChild(n), e.appendChild(n)));
1223
- };
1224
- return i(t), {
1225
- update(e) {
1226
- i(e);
1227
- },
1228
- destroy() {
1229
- i(null);
1230
- }
1231
- };
1232
- }
1233
- function Vt(e, t) {
1234
- let n = t, r = null, i = null, a = null, o = null, s = null, c = null, l = null, u = null, d = !1, f = !1, m = null, h = null, ee = null, te = 0, g = 0, _ = 0, v = 0, ne = 0, re = 0, ie = 0, y = 0, ae = null, b = [], x = 0, S = 0, C = n.mounted.entry.shell?.initialWidth ?? 720, w = n.mounted.entry.shell?.initialHeight ?? 560, T = null, E = null, D = !1, O = (e) => {
1235
- if (!e) return;
1236
- let t = e.__pieToolElementUnmount;
1237
- typeof t == "function" && t();
1238
- }, le = () => {
1239
- let e = n.mounted.entry.shell;
1240
- return e ? {
1241
- toolId: n.mounted.toolId,
1242
- toolbarContext: p(st),
1243
- shellConfig: e
1244
- } : null;
1245
- }, ue = (e) => {
1246
- let t = p(Z).get(n.mounted.toolId), r = le();
1247
- !t?.onHostedMount || !r || t.onHostedMount(e, r);
1248
- }, de = () => {
1249
- let e = p(Z).get(n.mounted.toolId), t = le();
1250
- !e?.onHostedResize || !t || e.onHostedResize({
1251
- width: C,
1252
- height: w
1253
- }, n.mounted.entry.element, t);
1254
- }, fe = () => {
1255
- let e = p(Z).get(n.mounted.toolId), t = le();
1256
- !e?.onHostedUnmount || !t || e.onHostedUnmount(n.mounted.entry.element, t);
1257
- }, A = (e, t, n) => Math.max(t, Math.min(e, n)), pe = () => {
1258
- let e = n.mounted.entry.shell;
1259
- return {
1260
- minWidth: e?.minWidth ?? 320,
1261
- minHeight: e?.minHeight ?? 240,
1262
- maxWidth: e?.maxWidth ?? window.innerWidth,
1263
- maxHeight: e?.maxHeight ?? window.innerHeight
1264
- };
1265
- }, me = () => {
1266
- let e = n.mounted.entry.shell?.minWidth, t = typeof e == "number" && e > 0 && C < e, o = t ? `${e}px` : "";
1267
- m && (m.style.minWidth = o), i && (i.style.minWidth = o), a && (a.style.minWidth = o), r && (r.style.overflowX = t ? "auto" : "visible", r.style.overflowY = "visible");
1268
- }, he = () => n.mounted.entry.shell?.content?.overflowY === "auto" ? "auto" : "hidden", ge = () => {
1269
- if (!i) return 0;
1270
- let e = i.getBoundingClientRect().height;
1271
- return e > 0 ? e : i.offsetHeight || 0;
1272
- }, _e = () => {
1273
- if (!a) return;
1274
- let e = n.mounted.entry.shell;
1275
- if (a.style.overflowX = "hidden", a.style.overflowY = he(), m) {
1276
- if (e?.content?.preserveMinHeight === !0) {
1277
- let t = ge(), n = e.minHeight ?? 240, r = Math.max(0, n - t), i = Math.max(0, w - t), a = Math.max(i, r);
1278
- m.style.height = `${a}px`, m.style.minHeight = "0", m.style.flex = `0 0 ${a}px`;
1279
- return;
1280
- }
1281
- m.style.height = "100%", m.style.minHeight = "0", m.style.flex = "1 1 auto";
1282
- }
1283
- }, ye = () => {
1284
- let { minWidth: e, minHeight: t, maxWidth: n, maxHeight: r } = pe(), i = Math.min(e, window.innerWidth), a = Math.min(t, window.innerHeight);
1285
- C = A(C, i, Math.max(i, Math.min(n, window.innerWidth))), w = A(w, a, Math.max(a, Math.min(r, window.innerHeight))), x = A(x, 0, Math.max(0, window.innerWidth - C)), S = A(S, 0, Math.max(0, window.innerHeight - w)), Ce(), me(), _e(), de();
1286
- }, j = (e, t) => {
1287
- x += e, S += t, ye();
1288
- }, be = (e, t) => {
1289
- C += e, w += t, ye();
1290
- }, xe = (e, t, n, r = "fa-regular") => {
1291
- let i = document.createElement("nds-icon-button");
1292
- if (i.setAttribute("variant", "tertiary"), i.setAttribute("size", "small"), i.setAttribute("type", "circle"), i.setAttribute("icon-name", t), i.setAttribute("button-aria-label", e), i.title = e, i.addEventListener("click", (e) => {
1293
- e.stopPropagation(), n(), M();
1294
- }), r !== "fa-light") {
1295
- let e = (e) => {
1296
- e.classList.remove("fa-light"), e.classList.add(r);
1297
- }, t = i.querySelector("i.fa-light");
1298
- if (t) e(t);
1299
- else {
1300
- let t = new MutationObserver(() => {
1301
- let n = i.querySelector("i.fa-light");
1302
- n && (e(n), t.disconnect());
1303
- });
1304
- t.observe(i, {
1305
- childList: !0,
1306
- subtree: !0
1307
- });
1308
- }
1309
- }
1310
- return i;
1311
- }, Se = (e, t, n) => {
1312
- let r = document.createElement("button");
1313
- return r.type = "button", r.className = "pie-tool-shell__control", r.setAttribute("aria-label", e), r.title = e, r.textContent = t, r.style.border = "1px solid transparent", r.style.background = "color-mix(in srgb, var(--pie-white, #fff) 10%, transparent)", r.style.color = "inherit", r.style.cursor = "pointer", r.style.display = "inline-flex", r.style.alignItems = "center", r.style.justifyContent = "center", r.style.width = "28px", r.style.height = "28px", r.style.padding = "0", r.style.fontSize = "14px", r.style.fontWeight = "700", r.style.borderRadius = "8px", r.style.lineHeight = "1", r.onclick = (e) => {
1314
- e.stopPropagation(), n(), M();
1315
- }, r.onfocus = () => {
1316
- r.style.outline = "2px solid var(--pie-button-focus-outline, var(--pie-primary, #4A90E2))", r.style.outlineOffset = "2px";
1317
- }, r.onblur = () => {
1318
- r.style.outline = "none", r.style.outlineOffset = "0";
1319
- }, r;
1320
- }, Ce = () => {
1321
- r && (r.style.left = `${x}px`, r.style.top = `${S}px`, r.style.width = `${C}px`, r.style.height = `${w}px`, r.style.display = n.active ? "flex" : "none", r.style.setProperty("--pie-tool-shell-zoom-comp", String(Ne())));
1322
- }, we = () => {
1323
- if (!a) return;
1324
- let e = n.mounted.entry.element;
1325
- e.style.display = "block", e.style.width = "100%", e.style.height = "100%", e.style.flex = "1 1 auto", e.style.minHeight = "0", m && m !== e && (m.parentNode === a && (O(m), a.removeChild(m)), m = null), e.parentNode && e.parentNode !== a && e.parentNode.removeChild(e), e.parentNode !== a && a.appendChild(e), m = e, me(), _e(), ue(e);
1326
- }, M = () => {
1327
- p(W) && r && p(W).bringToFront(r);
1328
- }, N = () => {
1329
- let { innerWidth: e, innerHeight: t } = window, r = n.mounted.entry.shell, i = r?.initialAlign ?? "center", a = r?.initialMargin ?? 16, o = a + 60;
1330
- switch (i) {
1331
- case "top-left":
1332
- x = a, S = o;
1333
- break;
1334
- case "top-right":
1335
- x = Math.max(0, e - C - a), S = o;
1336
- break;
1337
- case "bottom-left":
1338
- x = a, S = Math.max(0, t - w - o);
1339
- break;
1340
- case "bottom-right":
1341
- x = Math.max(0, e - C - a), S = Math.max(0, t - w - o);
1342
- break;
1343
- default: x = Math.max(0, Math.round((e - C) / 2)), S = Math.max(0, Math.round((t - w) / 2));
1344
- }
1345
- ye();
1346
- }, Te = () => {
1347
- let e = E;
1348
- e && queueMicrotask(() => {
1349
- if (e.isConnected) try {
1350
- e.focus();
1351
- } catch {}
1352
- });
1353
- }, Ee = () => {
1354
- if (typeof document > "u") return null;
1355
- let e = document.activeElement;
1356
- for (; e;) {
1357
- let t = e.shadowRoot;
1358
- if (t && t.activeElement && t.activeElement !== e) e = t.activeElement;
1359
- else break;
1360
- }
1361
- return e ?? null;
1362
- }, De = () => {
1363
- if (!r || T) return;
1364
- let e = Ee();
1365
- !E && e && !r.contains(e) && (E = e);
1366
- let t = n.mounted.toolId === "calculator";
1367
- t && !f && (document.addEventListener("keydown", P, !0), f = !0), T = ce(r, {
1368
- initialFocus: c,
1369
- onEscape: () => {
1370
- I();
1371
- },
1372
- wrap: !t,
1373
- onTabExit: t ? (e, t) => {
1374
- if (e === "backward") {
1375
- if (E?.isConnected) {
1376
- t.preventDefault();
1377
- try {
1378
- E.focus();
1379
- } catch {}
1380
- }
1381
- return;
1382
- }
1383
- let n = Oe();
1384
- if (n) {
1385
- t.preventDefault();
1386
- try {
1387
- n.focus();
1388
- } catch {}
1389
- }
1390
- } : void 0
1391
- });
1392
- }, Oe = () => {
1393
- let e = p(st).getScopeElement?.() ?? null;
1394
- if (!e) return null;
1395
- let t = (e) => !!(p(B) && p(B).contains(e) || r && r.contains(e)), n = (e) => {
1396
- if (e instanceof HTMLElement) {
1397
- if (t(e)) return null;
1398
- if (e.matches?.(oe) && se(e)) return e;
1399
- }
1400
- let r = e.shadowRoot;
1401
- if (r) for (let e = 0; e < r.children.length; e++) {
1402
- let t = n(r.children[e]);
1403
- if (t) return t;
1404
- }
1405
- for (let t = 0; t < e.children.length; t++) {
1406
- let r = n(e.children[t]);
1407
- if (r) return r;
1408
- }
1409
- return null;
1410
- };
1411
- return n(e);
1412
- }, ke = () => r ? Array.from(r.querySelectorAll(oe)).filter((e) => e !== l && e !== u).filter(se) : [], P = (e) => {
1413
- if (e.key !== "Tab" || !r || !n.active) return;
1414
- let t = Ee();
1415
- if (!t || r.contains(t)) return;
1416
- let i = ke();
1417
- if (i.length !== 0) {
1418
- if (e.shiftKey) {
1419
- if (t !== Oe()) return;
1420
- e.preventDefault();
1421
- try {
1422
- i[i.length - 1].focus();
1423
- } catch {}
1424
- return;
1425
- }
1426
- if (t === E) {
1427
- e.preventDefault();
1428
- try {
1429
- i[0].focus();
1430
- } catch {}
1431
- }
1432
- }
1433
- }, F = () => {
1434
- if (f &&= (document.removeEventListener("keydown", P, !0), !1), !T) return;
1435
- let e = T;
1436
- T = null;
1437
- try {
1438
- e();
1439
- } catch {}
1440
- Te();
1441
- }, I = () => {
1442
- p(st).toggleTool(n.mounted.toolId), zt();
1443
- }, L = (e) => {
1444
- n.mounted.entry.shell?.draggable && (e.target.closest("button") || !r || (e.preventDefault(), h = e.pointerId, te = e.clientX - x, g = e.clientY - S, r.setPointerCapture(e.pointerId), M()));
1445
- }, Ae = (e) => (t) => {
1446
- !r || !n.mounted.entry.shell?.resizable || (t.preventDefault(), t.stopPropagation(), ee = t.pointerId, ae = e, _ = C, v = w, ne = t.clientX, re = t.clientY, ie = x, y = S, r.setPointerCapture(t.pointerId), M());
1447
- }, R = (e) => {
1448
- if (r) {
1449
- if (h === e.pointerId) {
1450
- e.preventDefault();
1451
- let t = Math.max(0, window.innerWidth - C), n = Math.max(0, window.innerHeight - w);
1452
- x = A(e.clientX - te, 0, t), S = A(e.clientY - g, 0, n), Ce();
1453
- return;
1454
- }
1455
- if (ee === e.pointerId) {
1456
- e.preventDefault();
1457
- let t = n.mounted.entry.shell, r = t?.minWidth ?? 320, i = t?.minHeight ?? 240, a = Math.min(r, window.innerWidth), o = Math.min(i, window.innerHeight), s = t?.maxWidth ?? window.innerWidth, c = t?.maxHeight ?? window.innerHeight, l = e.clientX - ne, u = e.clientY - re;
1458
- if (ae === "se") C = A(_ + l, a, Math.max(a, Math.min(s, window.innerWidth - x))), w = A(v + u, o, Math.max(o, Math.min(c, window.innerHeight - S)));
1459
- else if (ae === "sw") {
1460
- let e = ie + _, t = A(_ - l, a, Math.min(s, e));
1461
- x = e - t, C = t, w = A(v + u, o, Math.max(o, Math.min(c, window.innerHeight - S)));
1462
- } else if (ae === "ne") {
1463
- let e = y + v;
1464
- C = A(_ + l, a, Math.max(a, Math.min(s, window.innerWidth - x)));
1465
- let t = A(v - u, o, Math.min(c, e));
1466
- S = e - t, w = t;
1467
- } else if (ae === "nw") {
1468
- let e = ie + _, t = y + v, n = A(_ - l, a, Math.min(s, e));
1469
- x = e - n, C = n;
1470
- let r = A(v - u, o, Math.min(c, t));
1471
- S = t - r, w = r;
1472
- }
1473
- Ce(), me(), _e(), de();
1474
- }
1475
- }
1476
- }, je = (e) => {
1477
- r && (h === e.pointerId && (h = null, r.releasePointerCapture(e.pointerId)), ee === e.pointerId && (ee = null, r.releasePointerCapture(e.pointerId)));
1478
- }, Me = () => {
1479
- ye();
1480
- };
1481
- if (k && n.mounted.entry.shell) {
1482
- let e = n.mounted.toolId === "calculator", t = e && p(H);
1483
- t && ve(), r = document.createElement("div"), r.className = "pie-tool-shell", r.setAttribute("data-pie-tool-shell", n.mounted.toolId), r.style.position = "fixed", r.style.zIndex = "2000", r.style.background = "var(--pie-background, #fff)", r.style.border = "1px solid var(--pie-border-light, #d1d5db)", r.style.borderRadius = "12px", r.style.boxShadow = "0 10px 40px color-mix(in srgb, var(--pie-black, #000) 25%, transparent)", r.style.overflow = "visible", r.style.display = n.active ? "flex" : "none", r.style.flexDirection = "column", r.style.userSelect = "none", r.style.webkitUserSelect = "none", r.style.touchAction = "none", r.setAttribute("draggable", "false"), r.addEventListener("dragstart", (e) => e.preventDefault()), i = document.createElement("div"), i.className = "pie-tool-shell__header", i.style.display = "flex", i.style.alignItems = "center", i.style.justifyContent = "space-between", i.style.gap = "6px", i.style.padding = e ? "12px 12px 12px 28px" : "10px 12px", e && (i.style.minHeight = "48px"), e ? (i.style.background = "var(--pie-section-player-card-header-background, #f3f4f6)", i.style.color = "var(--pie-text, #111827)", i.style.borderBottom = "1px solid var(--pie-border-light, #e5e7eb)") : (i.style.background = "var(--pie-primary-dark, #2c3e50)", i.style.color = "var(--pie-white, #fff)"), i.style.cursor = n.mounted.entry.shell.draggable === !1 ? "default" : "move", i.style.flex = "0 0 auto", i.style.borderRadius = "12px 12px 0 0", i.style.overflow = "hidden", i.style.userSelect = "none", i.style.webkitUserSelect = "none", i.style.touchAction = "none", i.setAttribute("draggable", "false"), i.addEventListener("dragstart", (e) => e.preventDefault()), o = document.createElement("span"), o.className = "pie-tool-shell__title", o.textContent = n.mounted.entry.shell.title || n.mounted.toolId, i.appendChild(o), s = document.createElement("div"), s.className = "pie-tool-shell__controls", s.style.display = "inline-flex", s.style.alignItems = "center", s.style.gap = e ? "6px" : "4px";
1484
- let f = n.mounted.entry.shell, m = (e, n, r, i, a = "fa-regular") => {
1485
- s && s.appendChild(t ? xe(e, r, i, a) : Se(e, n, i));
1486
- };
1487
- f?.draggable !== !1 && (m("Move tool left", "←", "chevron-left", () => j(-24, 0)), m("Move tool right", "→", "chevron-right", () => j(24, 0)), m("Move tool up", "↑", "chevron-up", () => j(0, -24)), m("Move tool down", "↓", "chevron-down", () => j(0, 24))), f?.resizable !== !1 && (m("Shrink tool window", "−", "magnifying-glass-minus", () => be(-40, -40)), m("Grow tool window", "+", "magnifying-glass-plus", () => be(40, 40))), e || s.appendChild(Se("Center tool window", "◎", N));
1488
- let h = null;
1489
- if (e ? (h = document.createElement("div"), h.className = "pie-tool-shell__header-right", h.style.display = "inline-flex", h.style.alignItems = "center", h.style.gap = "6px", h.style.setProperty("zoom", "var(--pie-tool-shell-zoom-comp, 1)"), h.appendChild(s), i.appendChild(h)) : i.appendChild(s), t) c = xe("Close tool", "xmark", I, "fa-regular"), c.style.display = n.mounted.entry.shell.closeable === !1 ? "none" : "inline-block";
1490
- else {
1491
- let e = document.createElement("button");
1492
- e.type = "button", e.className = "pie-tool-shell__close", e.setAttribute("aria-label", "Close tool");
1493
- let t = "http://www.w3.org/2000/svg", r = document.createElementNS(t, "svg");
1494
- r.setAttribute("xmlns", t), r.setAttribute("viewBox", "0 0 16 16"), r.setAttribute("aria-hidden", "true");
1495
- let i = document.createElementNS(t, "path");
1496
- i.setAttribute("d", "M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5"), i.setAttribute("stroke", "currentColor"), i.setAttribute("stroke-width", "1.8"), i.setAttribute("stroke-linecap", "round"), r.appendChild(i), e.appendChild(r);
1497
- let a = r.style;
1498
- a.width = "16px", a.height = "16px", a.display = "block", a.flexShrink = "0", a.pointerEvents = "none";
1499
- let o = "color-mix(in srgb, var(--pie-white, #fff) 8%, transparent)";
1500
- e.style.border = "1px solid transparent", e.style.background = o, e.style.color = "inherit", e.style.cursor = "pointer", e.style.display = "inline-flex", e.style.alignItems = "center", e.style.justifyItems = "center", e.style.width = "28px", e.style.height = "28px", e.style.padding = "0", e.style.borderRadius = "8px", e.style.lineHeight = "0", e.style.transition = "background-color 0.15s ease, border-color 0.15s ease", e.style.display = n.mounted.entry.shell.closeable === !1 ? "none" : "inline-flex", e.onmouseenter = () => {
1501
- e.style.background = "color-mix(in srgb, var(--pie-white, #fff) 18%, transparent)";
1502
- }, e.onmouseleave = () => {
1503
- e.style.background = o;
1504
- }, e.onfocus = () => {
1505
- e.style.outline = "2px solid var(--pie-button-focus-outline, var(--pie-primary, #4A90E2))", e.style.outlineOffset = "2px";
1506
- }, e.onblur = () => {
1507
- e.style.outline = "none", e.style.outlineOffset = "0";
1508
- }, e.onclick = I, c = e;
1509
- }
1510
- if (h ? h.appendChild(c) : i.appendChild(c), i.tabIndex = 0, i.onkeydown = (e) => {
1511
- if (e.key === "Home") {
1512
- e.preventDefault(), N();
1513
- return;
1514
- }
1515
- let t = n.mounted.entry.shell;
1516
- if (e.shiftKey && t?.resizable !== !1) {
1517
- if (e.key === "ArrowRight" || e.key === "ArrowDown") {
1518
- e.preventDefault(), be(40, 40);
1519
- return;
1520
- }
1521
- if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
1522
- e.preventDefault(), be(-40, -40);
1523
- return;
1524
- }
1525
- }
1526
- t?.draggable !== !1 && (e.key === "ArrowLeft" ? (e.preventDefault(), j(-24, 0)) : e.key === "ArrowRight" ? (e.preventDefault(), j(24, 0)) : e.key === "ArrowUp" ? (e.preventDefault(), j(0, -24)) : e.key === "ArrowDown" && (e.preventDefault(), j(0, 24)));
1527
- }, a = document.createElement("div"), a.className = "pie-tool-shell__content", a.style.position = "relative", a.style.width = "100%", a.style.flex = "1 1 auto", a.style.minHeight = "0", a.style.overflowX = "hidden", a.style.overflowY = he(), a.style.borderRadius = "0 0 12px 12px", e) {
1528
- let e = (e) => {
1529
- let t = document.createElement("div");
1530
- return t.tabIndex = 0, t.setAttribute("aria-hidden", "true"), t.setAttribute("data-pie-tool-shell-focus-guard", e), t.style.position = "absolute", t.style.width = "1px", t.style.height = "1px", t.style.padding = "0", t.style.margin = "-1px", t.style.overflow = "hidden", t.style.clipPath = "inset(50%)", t.style.whiteSpace = "nowrap", t.style.border = "0", t;
1531
- };
1532
- l = e("start"), u = e("end"), l.addEventListener("focus", (e) => {
1533
- if (!d) {
1534
- d = !0;
1535
- try {
1536
- if (e.stopPropagation(), E?.isConnected) try {
1537
- E.focus();
1538
- } catch {}
1539
- } finally {
1540
- queueMicrotask(() => {
1541
- d = !1;
1542
- });
1543
- }
1544
- }
1545
- }), u.addEventListener("focus", (e) => {
1546
- if (!d) {
1547
- d = !0;
1548
- try {
1549
- e.stopPropagation();
1550
- let t = Oe();
1551
- if (t) try {
1552
- t.focus();
1553
- } catch {}
1554
- } finally {
1555
- queueMicrotask(() => {
1556
- d = !1;
1557
- });
1558
- }
1559
- }
1560
- }), r.appendChild(l);
1561
- }
1562
- if (r.appendChild(i), r.appendChild(a), e && u && r.appendChild(u), n.mounted.entry.shell.resizable !== !1) {
1563
- let e = (e, t, n, i, a, o, s) => {
1564
- let c = document.createElement("div");
1565
- c.className = "pie-tool-shell__resize", c.style.position = "absolute", c.style.width = "24px", c.style.height = "24px", c.style.cursor = o, c.style.zIndex = "10", c.style.touchAction = "none", c.setAttribute("draggable", "false"), t !== null && (c.style.top = t), n !== null && (c.style.right = n), i !== null && (c.style.bottom = i), a !== null && (c.style.left = a), s !== null && (c.style.background = `linear-gradient(${s}, transparent 0%, transparent 40%, rgba(0,0,0,0.35) 40%, rgba(0,0,0,0.35) 60%, transparent 60%, transparent 100%)`);
1566
- let l = Ae(e);
1567
- c.addEventListener("pointerdown", l), r.appendChild(c), b.push({
1568
- el: c,
1569
- handler: l
1570
- });
1571
- };
1572
- e("se", null, "0", "0", null, "nwse-resize", null), e("nw", "0", null, null, "0", "nwse-resize", "135deg"), e("ne", "0", "0", null, null, "nesw-resize", null), e("sw", null, null, "0", "0", "nesw-resize", null);
1573
- }
1574
- i.addEventListener("pointerdown", L), r.addEventListener("pointermove", R), r.addEventListener("pointerup", je), r.addEventListener("pointerdown", M), window.addEventListener("resize", Me), document.body.appendChild(r), N(), Ce(), we(), de(), n.active && De(), D = n.active;
1575
- }
1576
- return {
1577
- update(e) {
1578
- if (n = e, !r || !a || !o || !c) return;
1579
- o.textContent = n.mounted.entry.shell?.title || n.mounted.toolId;
1580
- let t = n.mounted.toolId === "calculator" ? "inline-block" : "inline-flex";
1581
- c.style.display = n.mounted.entry.shell?.closeable === !1 ? "none" : t, Ce(), we(), de(), !D && n.active ? De() : D && !n.active && (F(), E = null), D = n.active;
1582
- },
1583
- destroy() {
1584
- fe(), T && F(), f &&= (document.removeEventListener("keydown", P, !0), !1);
1585
- for (let { el: e, handler: t } of b) e.removeEventListener("pointerdown", t);
1586
- E = null, b.length = 0, i && (i.removeEventListener("pointerdown", L), i.onkeydown = null), r && (r.removeEventListener("pointermove", R), r.removeEventListener("pointerup", je), r.removeEventListener("pointerdown", M)), window.removeEventListener("resize", Me), m && a && m.parentNode === a && (O(m), a.removeChild(m)), m = null, r && r.parentElement && r.remove();
1587
- }
1588
- };
1589
- }
1590
- var Ht = {
1591
- get level() {
1592
- return N();
1593
- },
1594
- set level(e) {
1595
- N(e), o();
1596
- },
1597
- get scopeId() {
1598
- return Te();
1599
- },
1600
- set scopeId(e) {
1601
- Te(e), o();
1602
- },
1603
- get itemId() {
1604
- return Ee();
1605
- },
1606
- set itemId(e) {
1607
- Ee(e), o();
1608
- },
1609
- get sectionId() {
1610
- return De();
1611
- },
1612
- set sectionId(e) {
1613
- De(e), o();
1614
- },
1615
- get catalogId() {
1616
- return Oe();
1617
- },
1618
- set catalogId(e) {
1619
- Oe(e), o();
1620
- },
1621
- get tools() {
1622
- return ke();
1623
- },
1624
- set tools(e) {
1625
- ke(e), o();
1626
- },
1627
- get contentKind() {
1628
- return P();
1629
- },
1630
- set contentKind(e) {
1631
- P(e), o();
1632
- },
1633
- get position() {
1634
- return F();
1635
- },
1636
- set position(e) {
1637
- F(e), o();
1638
- },
1639
- get scopeElement() {
1640
- return I();
1641
- },
1642
- set scopeElement(e) {
1643
- I(e), o();
1644
- },
1645
- get toolRegistry() {
1646
- return L();
1647
- },
1648
- set toolRegistry(e) {
1649
- L(e), o();
1650
- },
1651
- get item() {
1652
- return Ae();
1653
- },
1654
- set item(e) {
1655
- Ae(e), o();
1656
- },
1657
- get hostButtons() {
1658
- return R();
1659
- },
1660
- set hostButtons(e) {
1661
- R(e), o();
1662
- },
1663
- get class() {
1664
- return je();
1665
- },
1666
- set class(e) {
1667
- je(e), o();
1668
- },
1669
- get size() {
1670
- return Me();
1671
- },
1672
- set size(e) {
1673
- Me(e), o();
1674
- },
1675
- get language() {
1676
- return z();
1677
- },
1678
- set language(e) {
1679
- z(e), o();
1680
- }
1681
- }, Ut = v(), Wt = a(Ut), Gt = (e) => {
1682
- var r = Ct();
1683
- let i;
1684
- var o = te(r), u = te(o);
1685
- re(u, 17, () => p(Et), (e) => e.key, (e, t) => {
1686
- var n = v(), r = a(n), i = (e) => {
1687
- var n = v();
1688
- h(a(n), () => p(H), (e) => {
1689
- var n = mt();
1690
- T(n, (e, t) => Vt?.(e, t), () => ({
1691
- mounted: p(t),
1692
- active: p(Tt)[p(t).toolId] ?? !1
1693
- })), _(e, n);
1694
- }), _(e, n);
1695
- }, o = (e) => {
1696
- var n = mt();
1697
- T(n, (e, t) => Bt?.(e, t), () => p(t).entry.element), _(e, n);
1698
- };
1699
- g(r, (e) => {
1700
- p(t).entry.shell ? e(i) : e(o, -1);
1701
- }), _(e, n);
1702
- });
1703
- var m = w(u, 2);
1704
- re(m, 17, () => p(pt), (e) => e.id, (e, r, i, o) => {
1705
- let c = f(() => p(H) && !lt(p(r)) ? Ce(p(r)) : null);
1706
- var l = v(), u = a(l), m = (e) => {
1707
- var n = ht(), i = te(n);
1708
- y(i, 1, "item-toolbar__nds-button svelte-rnx3ie"), t(i, "type", "circle"), t(i, "size", "small"), t(i, "variant", "tertiary"), s(() => t(i, "icon-name", p(c))), s(() => t(i, "button-aria-label", p(r).ariaLabel || p(r).label)), s(() => t(i, "title", p(r).tooltip || p(r).label)), s(() => t(i, "disabled", p(r).disabled)), T(i, (e) => be?.(e)), T(i, (e, t) => xe?.(e, t), () => Lt(p(r))), d(n), de("click", i, function(...e) {
1709
- p(r).onClick?.apply(this, e);
1710
- }), _(e, n);
1711
- }, h = (e) => {
1712
- var t = yt();
1713
- let i;
1714
- var o = te(t), c = (e) => {
1715
- var t = v(), i = a(t), o = (e) => {
1716
- var t = gt();
1717
- n(t, () => x(p(r).icon), !0), d(t), _(e, t);
1718
- }, c = f(() => dt(p(r).icon)), l = (e) => {
1719
- var t = _t();
1720
- s(() => b(t, "src", p(r).icon)), _(e, t);
1721
- }, u = f(() => ft(p(r).icon)), m = (e) => {
1722
- let t = f(() => Rt(p(r).icon));
1723
- var i = v(), o = a(i), c = (e) => {
1724
- var r = gt();
1725
- n(r, () => x(p(t)), !0), d(r), _(e, r);
1726
- }, l = (e) => {
1727
- var t = vt();
1728
- s(() => y(t, 1, `icon icon-${p(r).icon}`, "svelte-rnx3ie")), _(e, t);
1729
- };
1730
- g(o, (e) => {
1731
- p(t) ? e(c) : e(l, -1);
1732
- }), _(e, i);
1733
- };
1734
- g(i, (e) => {
1735
- p(c) ? e(o) : p(u) ? e(l, 1) : e(m, -1);
1736
- }), _(e, t);
1737
- };
1738
- g(o, (e) => {
1739
- p(r).icon && e(c);
1740
- }), d(t), s((e) => {
1741
- i = y(t, 1, "item-toolbar__button svelte-rnx3ie", null, i, e), b(t, "href", p(r).disabled ? void 0 : p(r).href), b(t, "target", p(r).target), b(t, "rel", p(r).rel), b(t, "aria-label", p(r).ariaLabel || p(r).label), b(t, "title", p(r).tooltip || p(r).label), b(t, "aria-disabled", p(r).disabled ? "true" : void 0);
1742
- }, [() => ({ "item-toolbar__button--active": Lt(p(r)) })]), de("click", t, (e) => {
1743
- p(r).disabled && e.preventDefault();
1744
- }), _(e, t);
1745
- }, ee = f(() => lt(p(r))), ne = (e) => {
1746
- var t = bt();
1747
- let i;
1748
- var o = te(t), c = (e) => {
1749
- var t = v(), i = a(t), o = (e) => {
1750
- var t = gt();
1751
- n(t, () => x(p(r).icon), !0), d(t), _(e, t);
1752
- }, c = f(() => dt(p(r).icon)), l = (e) => {
1753
- var t = _t();
1754
- s(() => b(t, "src", p(r).icon)), _(e, t);
1755
- }, u = f(() => ft(p(r).icon)), m = (e) => {
1756
- let t = f(() => Rt(p(r).icon));
1757
- var i = v(), o = a(i), c = (e) => {
1758
- var r = gt();
1759
- n(r, () => x(p(t)), !0), d(r), _(e, r);
1760
- }, l = (e) => {
1761
- var t = vt();
1762
- s(() => y(t, 1, `icon icon-${p(r).icon}`, "svelte-rnx3ie")), _(e, t);
1763
- };
1764
- g(o, (e) => {
1765
- p(t) ? e(c) : e(l, -1);
1766
- }), _(e, i);
1767
- };
1768
- g(i, (e) => {
1769
- p(c) ? e(o) : p(u) ? e(l, 1) : e(m, -1);
1770
- }), _(e, t);
1771
- };
1772
- g(o, (e) => {
1773
- p(r).icon && e(c);
1774
- }), d(t), s((e, n) => {
1775
- i = y(t, 1, "item-toolbar__button svelte-rnx3ie", null, i, e), b(t, "aria-label", p(r).ariaLabel || p(r).label), b(t, "aria-pressed", n), b(t, "title", p(r).tooltip || p(r).label), t.disabled = p(r).disabled;
1776
- }, [() => ({ "item-toolbar__button--active": Lt(p(r)) }), () => Lt(p(r))]), de("click", t, function(...e) {
1777
- p(r).onClick?.apply(this, e);
1778
- }), _(e, t);
1779
- };
1780
- g(u, (e) => {
1781
- p(c) ? e(m) : p(ee) ? e(h, 1) : e(ne, -1);
1782
- }), _(e, l);
1783
- }), re(w(m, 2), 17, () => p(Dt), (e) => e.key, (e, t) => {
1784
- var n = v(), r = a(n), i = (e) => {
1785
- var n = v();
1786
- h(a(n), () => p(H), (e) => {
1787
- var n = mt();
1788
- T(n, (e, t) => Vt?.(e, t), () => ({
1789
- mounted: p(t),
1790
- active: p(Tt)[p(t).toolId] ?? !1
1791
- })), _(e, n);
1792
- }), _(e, n);
1793
- }, o = (e) => {
1794
- var n = mt();
1795
- T(n, (e, t) => Bt?.(e, t), () => p(t).entry.element), _(e, n);
1796
- };
1797
- g(r, (e) => {
1798
- p(t).entry.shell ? e(i) : e(o, -1);
1799
- }), _(e, n);
1800
- }), d(o);
1801
- var ee = w(o, 2), ne = (e) => {
1802
- var t = St();
1803
- let n;
1804
- re(t, 21, () => p(Ot), (e) => e.key, (e, t) => {
1805
- var n = v(), r = a(n), i = (e) => {
1806
- var n = v();
1807
- h(a(n), () => p(H), (e) => {
1808
- var n = xt();
1809
- T(n, (e, t) => Vt?.(e, t), () => ({
1810
- mounted: p(t),
1811
- active: p(Tt)[p(t).toolId] ?? !1
1812
- })), _(e, n);
1813
- }), _(e, n);
1814
- }, o = (e) => {
1815
- var n = xt();
1816
- T(n, (e, t) => Bt?.(e, t), () => p(t).entry.element), _(e, n);
1817
- };
1818
- g(r, (e) => {
1819
- p(t).entry.shell ? e(i) : e(o, -1);
1820
- }), _(e, n);
1821
- }), d(t), s(() => n = y(t, 1, "item-toolbar__controls-row svelte-rnx3ie", null, n, {
1822
- "item-toolbar__controls-row--reserve": p(jt),
1823
- "item-toolbar__controls-row--active": p(Mt),
1824
- "item-toolbar__controls-row--align-start": p(Nt)
1825
- })), _(e, t);
1826
- };
1827
- g(ee, (e) => {
1828
- p(Ft) && e(ne);
1829
- }), d(r), ie(r, (e) => c(B, e), () => p(B)), s(() => {
1830
- i = y(r, 1, `item-toolbar ${je() ?? ""} item-toolbar--${Me() ?? ""}`, "svelte-rnx3ie", i, {
1831
- "item-toolbar--top": F() === "top",
1832
- "item-toolbar--right": F() === "right",
1833
- "item-toolbar--bottom": F() === "bottom",
1834
- "item-toolbar--left": F() === "left",
1835
- "item-toolbar--header-overlay-active": p(Pt)
1836
- }), b(r, "data-content-kind", p(q)), b(r, "data-level", p(J)), l(r, `--pie-toolbar-zoom-comp: ${p(Pe)};`);
1837
- }), _(e, r);
1838
- };
1839
- return g(Wt, (e) => {
1840
- k && e(Gt);
1841
- }), _(e, Ut), ae(Ht);
1842
- }
1843
- O(["click"]), pt("pie-item-toolbar", e(Tt, {
1844
- level: {
1845
- attribute: "level",
1846
- type: "String"
1847
- },
1848
- scopeId: {
1849
- attribute: "scope-id",
1850
- type: "String"
1851
- },
1852
- itemId: {
1853
- attribute: "item-id",
1854
- type: "String"
1855
- },
1856
- sectionId: {
1857
- attribute: "section-id",
1858
- type: "String"
1859
- },
1860
- catalogId: {
1861
- attribute: "catalog-id",
1862
- type: "String"
1863
- },
1864
- tools: {
1865
- attribute: "tools",
1866
- type: "String"
1867
- },
1868
- contentKind: {
1869
- attribute: "content-kind",
1870
- type: "String"
1871
- },
1872
- position: {
1873
- attribute: "position",
1874
- type: "String"
1875
- },
1876
- size: {
1877
- attribute: "size",
1878
- type: "String"
1879
- },
1880
- language: {
1881
- attribute: "language",
1882
- type: "String"
1883
- },
1884
- scopeElement: { type: "Object" },
1885
- toolRegistry: { type: "Object" },
1886
- item: { type: "Object" },
1887
- hostButtons: { type: "Object" },
1888
- class: {}
1889
- }, [], [], { mode: "open" }));
1890
- //#endregion
1891
-
1892
- //# sourceMappingURL=item-toolbar-element-t_zI1vE6.js.map