triiiceratops 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4,21 +4,20 @@ var qe = (i) => {
4
4
  };
5
5
  var ut = (i, t, r) => t in i ? ft(i, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : i[t] = r;
6
6
  var Ne = (i, t, r) => ut(i, typeof t != "symbol" ? t + "" : t, r), gt = (i, t, r) => t.has(i) || qe("Cannot " + r);
7
- var k = (i, t, r) => (gt(i, t, "read from private field"), r ? r.call(i) : t.get(i)), U = (i, t, r) => t.has(i) ? qe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, r);
7
+ var M = (i, t, r) => (gt(i, t, "read from private field"), r ? r.call(i) : t.get(i)), K = (i, t, r) => t.has(i) ? qe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, r);
8
8
  import "svelte/internal/disclose-version";
9
9
  import * as e from "svelte/internal/client";
10
- import { onMount as ht, getContext as fe, setContext as vt, onDestroy as pt } from "svelte";
10
+ import { onMount as vt, getContext as fe, setContext as ht, onDestroy as pt } from "svelte";
11
11
  import * as mt from "manifesto.js";
12
12
  import Qe from "openseadragon";
13
13
  import bt from "phosphor-svelte/lib/CaretLeft";
14
14
  import _t from "phosphor-svelte/lib/CaretRight";
15
- import { m as V, l as yt } from "./plugin-DMqSBxJD.js";
16
- import { B as zi } from "./plugin-DMqSBxJD.js";
15
+ import { m as E, l as yt } from "./plugin-DMqSBxJD.js";
16
+ import { B as $i } from "./plugin-DMqSBxJD.js";
17
17
  import wt from "phosphor-svelte/lib/CaretDown";
18
18
  import We from "phosphor-svelte/lib/Eye";
19
19
  import Ue from "phosphor-svelte/lib/EyeSlash";
20
- import Be from "phosphor-svelte/lib/X";
21
- import "svelte/internal/flags/legacy";
20
+ import Fe from "phosphor-svelte/lib/X";
22
21
  import xt from "phosphor-svelte/lib/ChatCenteredText";
23
22
  import St from "phosphor-svelte/lib/CornersIn";
24
23
  import At from "phosphor-svelte/lib/CornersOut";
@@ -31,13 +30,13 @@ import "phosphor-svelte/lib/Spinner";
31
30
  var ge;
32
31
  class Mt {
33
32
  constructor() {
34
- U(this, ge, e.state(e.proxy({})));
33
+ K(this, ge, e.state(e.proxy({})));
35
34
  }
36
35
  get manifests() {
37
- return e.get(k(this, ge));
36
+ return e.get(M(this, ge));
38
37
  }
39
38
  set manifests(t) {
40
- e.set(k(this, ge), t, !0);
39
+ e.set(M(this, ge), t, !0);
41
40
  }
42
41
  async fetchManifest(t) {
43
42
  if (!this.manifests[t]) {
@@ -46,8 +45,8 @@ class Mt {
46
45
  const r = await fetch(t);
47
46
  if (!r.ok)
48
47
  throw new Error(`HTTP error! status: ${r.status}`);
49
- const s = await r.json(), n = mt.parseManifest(s);
50
- this.manifests[t] = { json: s, manifesto: n, isFetching: !1 };
48
+ const s = await r.json(), a = mt.parseManifest(s);
49
+ this.manifests[t] = { json: s, manifesto: a, isFetching: !1 };
51
50
  } catch (r) {
52
51
  this.manifests[t] = { error: r.message, isFetching: !1 };
53
52
  }
@@ -85,151 +84,151 @@ class Mt {
85
84
  manualGetAnnotations(t, r) {
86
85
  const s = this.getManifest(t);
87
86
  if (!s) return [];
88
- const n = s.getSequences()[0].getCanvasById(r);
89
- if (!n) return [];
90
- const a = n.__jsonld;
91
- let S = [];
92
- const P = (_) => _.resources || _.items || [];
93
- return a.otherContent && a.otherContent.forEach((_) => {
94
- const I = _["@id"] || _.id;
95
- if (I && !_.resources) {
96
- const u = this.manifests[I];
97
- if (u) {
98
- if (u.json) {
99
- const R = P(u.json);
100
- S.push(...R);
87
+ const a = s.getSequences()[0].getCanvasById(r);
88
+ if (!a) return [];
89
+ const o = a.__jsonld;
90
+ let I = [];
91
+ const b = (w) => w.resources || w.items || [];
92
+ return o.otherContent && o.otherContent.forEach((w) => {
93
+ const P = w["@id"] || w.id;
94
+ if (P && !w.resources) {
95
+ const g = this.manifests[P];
96
+ if (g) {
97
+ if (g.json) {
98
+ const O = b(g.json);
99
+ I.push(...O);
101
100
  }
102
101
  } else
103
- this.fetchAnnotationList(I);
104
- } else _.resources && S.push(..._.resources);
105
- }), a.annotations && a.annotations.forEach((_) => {
106
- const I = _.id || _["@id"];
107
- if (I && !_.items) {
108
- const u = this.manifests[I];
109
- if (u) {
110
- if (u.json) {
111
- const R = P(u.json);
112
- S.push(...R);
102
+ this.fetchAnnotationList(P);
103
+ } else w.resources && I.push(...w.resources);
104
+ }), o.annotations && o.annotations.forEach((w) => {
105
+ const P = w.id || w["@id"];
106
+ if (P && !w.items) {
107
+ const g = this.manifests[P];
108
+ if (g) {
109
+ if (g.json) {
110
+ const O = b(g.json);
111
+ I.push(...O);
113
112
  }
114
113
  } else
115
- this.fetchAnnotationList(I);
116
- } else _.items && S.push(..._.items);
117
- }), S;
114
+ this.fetchAnnotationList(P);
115
+ } else w.items && I.push(...w.items);
116
+ }), I;
118
117
  }
119
118
  }
120
119
  ge = new WeakMap();
121
120
  const le = new Mt();
122
- var he, ve, pe, me, be, _e, ye, we, xe, Se, Ae, Ie, Ce, ke, Pe, Me, Te, ze, je, Le, Re, De, Ee, Oe, Ge, Ve;
121
+ var ve, he, pe, me, be, _e, ye, we, xe, Se, Ae, Ie, Ce, ke, Pe, Me, Te, ze, je, Le, Re, De, Ee, Ge, Oe, Be;
123
122
  class Tt {
124
123
  constructor(t = null, r = null, s = []) {
125
- U(this, he, e.state(null));
126
- U(this, ve, e.state(null));
127
- U(this, pe, e.state(!1));
128
- U(this, me, e.state(!1));
129
- U(this, be, e.state(!1));
130
- U(this, _e, e.state(!1));
131
- U(this, ye, e.state(!1));
132
- U(this, we, e.state(!1));
133
- U(this, xe, e.state("bottom"));
134
- U(this, Se, e.state(e.proxy(/* @__PURE__ */ new Set())));
135
- U(this, Ae, e.state(e.proxy({})));
136
- U(
124
+ K(this, ve, e.state(null));
125
+ K(this, he, e.state(null));
126
+ K(this, pe, e.state(!1));
127
+ K(this, me, e.state(!1));
128
+ K(this, be, e.state(!1));
129
+ K(this, _e, e.state(!1));
130
+ K(this, ye, e.state(!1));
131
+ K(this, we, e.state(!1));
132
+ K(this, xe, e.state("bottom"));
133
+ K(this, Se, e.state(e.proxy(/* @__PURE__ */ new Set())));
134
+ K(this, Ae, e.state(e.proxy({})));
135
+ K(
137
136
  this,
138
137
  Ie,
139
138
  // Gallery State (Lifted for persistence during re-docking)
140
139
  e.state(e.proxy({ x: 20, y: 100 }))
141
140
  );
142
- U(this, Ce, e.state(e.proxy({ width: 300, height: 400 })));
143
- U(this, ke, e.state(!1));
144
- U(this, Pe, e.state(e.proxy({ x: 0, y: 0 })));
145
- U(this, Me, e.state(null));
146
- U(this, Te, e.state(null));
141
+ K(this, Ce, e.state(e.proxy({ width: 300, height: 400 })));
142
+ K(this, ke, e.state(!1));
143
+ K(this, Pe, e.state(e.proxy({ x: 0, y: 0 })));
144
+ K(this, Me, e.state(null));
145
+ K(this, Te, e.state(null));
147
146
  Ne(this, "eventTarget", null);
148
- U(this, ze, e.state(""));
149
- U(this, je, e.state(e.proxy([])));
150
- U(this, Le, e.state(!1));
151
- U(this, Re, e.state(!1));
152
- U(this, De, e.state(e.proxy([])));
153
- U(
147
+ K(this, ze, e.state(""));
148
+ K(this, je, e.state(e.proxy([])));
149
+ K(this, Le, e.state(!1));
150
+ K(this, Re, e.state(!1));
151
+ K(this, De, e.state(e.proxy([])));
152
+ K(
154
153
  this,
155
154
  Ee,
156
155
  // ==================== PLUGIN STATE ====================
157
156
  /** Registered plugins */
158
157
  e.state(e.proxy([]))
159
158
  );
160
- U(this, Oe, e.state(e.proxy([])));
161
- U(this, Ge, e.state(e.proxy([])));
162
- U(this, Ve, e.state(null));
159
+ K(this, Ge, e.state(e.proxy([])));
160
+ K(this, Oe, e.state(e.proxy([])));
161
+ K(this, Be, e.state(null));
163
162
  Ne(this, "pluginEventHandlers", /* @__PURE__ */ new Map());
164
163
  this.manifestId = t || null, this.canvasId = r || null, this.manifestId && le.fetchManifest(this.manifestId);
165
- for (const n of s)
166
- this.registerPlugin(n);
164
+ for (const a of s)
165
+ this.registerPlugin(a);
167
166
  }
168
167
  get manifestId() {
169
- return e.get(k(this, he));
168
+ return e.get(M(this, ve));
170
169
  }
171
170
  set manifestId(t) {
172
- e.set(k(this, he), t, !0);
171
+ e.set(M(this, ve), t, !0);
173
172
  }
174
173
  get canvasId() {
175
- return e.get(k(this, ve));
174
+ return e.get(M(this, he));
176
175
  }
177
176
  set canvasId(t) {
178
- e.set(k(this, ve), t, !0);
177
+ e.set(M(this, he), t, !0);
179
178
  }
180
179
  get showAnnotations() {
181
- return e.get(k(this, pe));
180
+ return e.get(M(this, pe));
182
181
  }
183
182
  set showAnnotations(t) {
184
- e.set(k(this, pe), t, !0);
183
+ e.set(M(this, pe), t, !0);
185
184
  }
186
185
  get showThumbnailGallery() {
187
- return e.get(k(this, me));
186
+ return e.get(M(this, me));
188
187
  }
189
188
  set showThumbnailGallery(t) {
190
- e.set(k(this, me), t, !0);
189
+ e.set(M(this, me), t, !0);
191
190
  }
192
191
  get isGalleryDockedBottom() {
193
- return e.get(k(this, be));
192
+ return e.get(M(this, be));
194
193
  }
195
194
  set isGalleryDockedBottom(t) {
196
- e.set(k(this, be), t, !0);
195
+ e.set(M(this, be), t, !0);
197
196
  }
198
197
  get isGalleryDockedRight() {
199
- return e.get(k(this, _e));
198
+ return e.get(M(this, _e));
200
199
  }
201
200
  set isGalleryDockedRight(t) {
202
- e.set(k(this, _e), t, !0);
201
+ e.set(M(this, _e), t, !0);
203
202
  }
204
203
  get isFullScreen() {
205
- return e.get(k(this, ye));
204
+ return e.get(M(this, ye));
206
205
  }
207
206
  set isFullScreen(t) {
208
- e.set(k(this, ye), t, !0);
207
+ e.set(M(this, ye), t, !0);
209
208
  }
210
209
  get showMetadataDialog() {
211
- return e.get(k(this, we));
210
+ return e.get(M(this, we));
212
211
  }
213
212
  set showMetadataDialog(t) {
214
- e.set(k(this, we), t, !0);
213
+ e.set(M(this, we), t, !0);
215
214
  }
216
215
  get dockSide() {
217
- return e.get(k(this, xe));
216
+ return e.get(M(this, xe));
218
217
  }
219
218
  set dockSide(t) {
220
- e.set(k(this, xe), t, !0);
219
+ e.set(M(this, xe), t, !0);
221
220
  }
222
221
  get visibleAnnotationIds() {
223
- return e.get(k(this, Se));
222
+ return e.get(M(this, Se));
224
223
  }
225
224
  set visibleAnnotationIds(t) {
226
- e.set(k(this, Se), t, !0);
225
+ e.set(M(this, Se), t, !0);
227
226
  }
228
227
  get config() {
229
- return e.get(k(this, Ae));
228
+ return e.get(M(this, Ae));
230
229
  }
231
230
  set config(t) {
232
- e.set(k(this, Ae), t, !0);
231
+ e.set(M(this, Ae), t, !0);
233
232
  }
234
233
  get showRightMenu() {
235
234
  return this.config.showRightMenu ?? !0;
@@ -241,40 +240,40 @@ class Tt {
241
240
  return this.config.showCanvasNav ?? !0;
242
241
  }
243
242
  get galleryPosition() {
244
- return e.get(k(this, Ie));
243
+ return e.get(M(this, Ie));
245
244
  }
246
245
  set galleryPosition(t) {
247
- e.set(k(this, Ie), t, !0);
246
+ e.set(M(this, Ie), t, !0);
248
247
  }
249
248
  get gallerySize() {
250
- return e.get(k(this, Ce));
249
+ return e.get(M(this, Ce));
251
250
  }
252
251
  set gallerySize(t) {
253
- e.set(k(this, Ce), t, !0);
252
+ e.set(M(this, Ce), t, !0);
254
253
  }
255
254
  get isGalleryDragging() {
256
- return e.get(k(this, ke));
255
+ return e.get(M(this, ke));
257
256
  }
258
257
  set isGalleryDragging(t) {
259
- e.set(k(this, ke), t, !0);
258
+ e.set(M(this, ke), t, !0);
260
259
  }
261
260
  get galleryDragOffset() {
262
- return e.get(k(this, Pe));
261
+ return e.get(M(this, Pe));
263
262
  }
264
263
  set galleryDragOffset(t) {
265
- e.set(k(this, Pe), t, !0);
264
+ e.set(M(this, Pe), t, !0);
266
265
  }
267
266
  get dragOverSide() {
268
- return e.get(k(this, Me));
267
+ return e.get(M(this, Me));
269
268
  }
270
269
  set dragOverSide(t) {
271
- e.set(k(this, Me), t, !0);
270
+ e.set(M(this, Me), t, !0);
272
271
  }
273
272
  get galleryCenterPanelRect() {
274
- return e.get(k(this, Te));
273
+ return e.get(M(this, Te));
275
274
  }
276
275
  set galleryCenterPanelRect(t) {
277
- e.set(k(this, Te), t, !0);
276
+ e.set(M(this, Te), t, !0);
278
277
  }
279
278
  setEventTarget(t) {
280
279
  this.eventTarget = t;
@@ -374,37 +373,37 @@ class Tt {
374
373
  this.showMetadataDialog = !this.showMetadataDialog;
375
374
  }
376
375
  get searchQuery() {
377
- return e.get(k(this, ze));
376
+ return e.get(M(this, ze));
378
377
  }
379
378
  set searchQuery(t) {
380
- e.set(k(this, ze), t, !0);
379
+ e.set(M(this, ze), t, !0);
381
380
  }
382
381
  get searchResults() {
383
- return e.get(k(this, je));
382
+ return e.get(M(this, je));
384
383
  }
385
384
  set searchResults(t) {
386
- e.set(k(this, je), t, !0);
385
+ e.set(M(this, je), t, !0);
387
386
  }
388
387
  get isSearching() {
389
- return e.get(k(this, Le));
388
+ return e.get(M(this, Le));
390
389
  }
391
390
  set isSearching(t) {
392
- e.set(k(this, Le), t, !0);
391
+ e.set(M(this, Le), t, !0);
393
392
  }
394
393
  get showSearchPanel() {
395
- return e.get(k(this, Re));
394
+ return e.get(M(this, Re));
396
395
  }
397
396
  set showSearchPanel(t) {
398
- e.set(k(this, Re), t, !0);
397
+ e.set(M(this, Re), t, !0);
399
398
  }
400
399
  toggleSearchPanel() {
401
400
  this.showSearchPanel = !this.showSearchPanel, this.showSearchPanel || (this.searchAnnotations = []), this.dispatchStateChange();
402
401
  }
403
402
  get searchAnnotations() {
404
- return e.get(k(this, De));
403
+ return e.get(M(this, De));
405
404
  }
406
405
  set searchAnnotations(t) {
407
- e.set(k(this, De), t, !0);
406
+ e.set(M(this, De), t, !0);
408
407
  }
409
408
  get currentCanvasSearchAnnotations() {
410
409
  return this.canvasId ? this.searchAnnotations.filter((t) => t.canvasId === this.canvasId) : [];
@@ -414,119 +413,119 @@ class Tt {
414
413
  if (t.trim()) {
415
414
  this.isSearching = !0, this.searchQuery = t, this.searchResults = [];
416
415
  try {
417
- const n = this.manifest;
418
- if (!n) throw new Error("No manifest loaded");
419
- let a = n.getService("http://iiif.io/api/search/1/search") || n.getService("http://iiif.io/api/search/0/search");
420
- if (a || n.__jsonld && n.__jsonld.service && (a = (Array.isArray(n.__jsonld.service) ? n.__jsonld.service : [n.__jsonld.service]).find((C) => C.profile === "http://iiif.io/api/search/1/search" || C.profile === "http://iiif.io/api/search/0/search")), !a) {
416
+ const a = this.manifest;
417
+ if (!a) throw new Error("No manifest loaded");
418
+ let o = a.getService("http://iiif.io/api/search/1/search") || a.getService("http://iiif.io/api/search/0/search");
419
+ if (o || a.__jsonld && a.__jsonld.service && (o = (Array.isArray(a.__jsonld.service) ? a.__jsonld.service : [a.__jsonld.service]).find((C) => C.profile === "http://iiif.io/api/search/1/search" || C.profile === "http://iiif.io/api/search/0/search")), !o) {
421
420
  console.warn("No IIIF search service found in manifest"), this.isSearching = !1;
422
421
  return;
423
422
  }
424
- const P = `${a.id || a["@id"]}?q=${encodeURIComponent(t)}`, _ = await fetch(P);
425
- if (!_.ok) throw new Error("Search request failed");
426
- const I = await _.json(), u = I.resources || [], R = [], g = (v) => {
427
- const C = typeof v == "string" ? v : v["@id"] || v.id;
423
+ const b = `${o.id || o["@id"]}?q=${encodeURIComponent(t)}`, w = await fetch(b);
424
+ if (!w.ok) throw new Error("Search request failed");
425
+ const P = await w.json(), g = P.resources || [], O = [], v = (p) => {
426
+ const C = typeof p == "string" ? p : p["@id"] || p.id;
428
427
  if (!C) return null;
429
428
  const h = C.split("#xywh=");
430
429
  if (h.length < 2) return null;
431
- const c = h[1].split(",").map(Number);
432
- return c.length === 4 ? c : null;
430
+ const l = h[1].split(",").map(Number);
431
+ return l.length === 4 ? l : null;
433
432
  };
434
- if (I.hits)
435
- for (const v of I.hits) {
436
- const C = v.annotations || [];
433
+ if (P.hits)
434
+ for (const p of P.hits) {
435
+ const C = p.annotations || [];
437
436
  for (const h of C) {
438
- const c = u.find((d) => d["@id"] === h || d.id === h);
439
- if (c && c.on) {
440
- const d = typeof c.on == "string" ? c.on : c.on["@id"] || c.on.id, z = d.split("#")[0], B = g(d), E = this.canvases.findIndex((p) => p.id === z);
441
- if (E >= 0) {
442
- const p = this.canvases[E];
443
- let f = "Canvas " + (E + 1);
437
+ const l = g.find((c) => c["@id"] === h || c.id === h);
438
+ if (l && l.on) {
439
+ const c = typeof l.on == "string" ? l.on : l.on["@id"] || l.on.id, R = c.split("#")[0], T = v(c), u = this.canvases.findIndex((A) => A.id === R);
440
+ if (u >= 0) {
441
+ const A = this.canvases[u];
442
+ let $ = "Canvas " + (u + 1);
444
443
  try {
445
- if (p.getLabel) {
446
- const o = p.getLabel();
447
- Array.isArray(o) && o.length > 0 ? f = o[0].value : typeof o == "string" && (f = o);
448
- } else p.label && (typeof p.label == "string" ? f = p.label : Array.isArray(p.label) && (f = (r = p.label[0]) == null ? void 0 : r.value));
444
+ if (A.getLabel) {
445
+ const d = A.getLabel();
446
+ Array.isArray(d) && d.length > 0 ? $ = d[0].value : typeof d == "string" && ($ = d);
447
+ } else A.label && (typeof A.label == "string" ? $ = A.label : Array.isArray(A.label) && ($ = (r = A.label[0]) == null ? void 0 : r.value));
449
448
  } catch {
450
449
  }
451
- R.push({
450
+ O.push({
452
451
  type: "hit",
453
- before: v.before,
454
- match: v.match,
455
- after: v.after,
456
- canvasIndex: E,
457
- canvasLabel: String(f),
458
- bounds: B
452
+ before: p.before,
453
+ match: p.match,
454
+ after: p.after,
455
+ canvasIndex: u,
456
+ canvasLabel: String($),
457
+ bounds: T
459
458
  });
460
459
  }
461
460
  }
462
461
  }
463
462
  }
464
- else if (u.length > 0)
465
- for (const v of u) {
466
- const C = typeof v.on == "string" ? v.on : v.on["@id"] || v.on.id, h = C.split("#")[0], c = g(C), d = this.canvases.findIndex((z) => z.id === h);
467
- if (d >= 0) {
468
- const z = this.canvases[d];
469
- let B = "Canvas " + (d + 1);
463
+ else if (g.length > 0)
464
+ for (const p of g) {
465
+ const C = typeof p.on == "string" ? p.on : p.on["@id"] || p.on.id, h = C.split("#")[0], l = v(C), c = this.canvases.findIndex((R) => R.id === h);
466
+ if (c >= 0) {
467
+ const R = this.canvases[c];
468
+ let T = "Canvas " + (c + 1);
470
469
  try {
471
- if (z.getLabel) {
472
- const E = z.getLabel();
473
- Array.isArray(E) && E.length > 0 ? B = E[0].value : typeof E == "string" && (B = E);
474
- } else z.label && (typeof z.label == "string" ? B = z.label : Array.isArray(z.label) && (B = (s = z.label[0]) == null ? void 0 : s.value));
470
+ if (R.getLabel) {
471
+ const u = R.getLabel();
472
+ Array.isArray(u) && u.length > 0 ? T = u[0].value : typeof u == "string" && (T = u);
473
+ } else R.label && (typeof R.label == "string" ? T = R.label : Array.isArray(R.label) && (T = (s = R.label[0]) == null ? void 0 : s.value));
475
474
  } catch {
476
475
  }
477
- R.push({
476
+ O.push({
478
477
  type: "resource",
479
- match: v.resource && v.resource.chars ? v.resource.chars : v.chars || "",
480
- canvasIndex: d,
481
- canvasLabel: String(B),
482
- bounds: c
478
+ match: p.resource && p.resource.chars ? p.resource.chars : p.chars || "",
479
+ canvasIndex: c,
480
+ canvasLabel: String(T),
481
+ bounds: l
483
482
  });
484
483
  }
485
484
  }
486
- this.searchResults = R, this.searchAnnotations = R.filter((v) => v.bounds).map((v, C) => {
487
- const h = this.canvases[v.canvasIndex], c = `${h.id}#xywh=${v.bounds.join(",")}`;
485
+ this.searchResults = O, this.searchAnnotations = O.filter((p) => p.bounds).map((p, C) => {
486
+ const h = this.canvases[p.canvasIndex], l = `${h.id}#xywh=${p.bounds.join(",")}`;
488
487
  return {
489
488
  "@id": `urn:search-hit:${C}`,
490
489
  "@type": "oa:Annotation",
491
490
  motivation: "sc:painting",
492
- on: c,
491
+ on: l,
493
492
  canvasId: h.id,
494
- resource: { "@type": "cnt:ContentAsText", chars: v.match },
493
+ resource: { "@type": "cnt:ContentAsText", chars: p.match },
495
494
  // Flag to identify styling in Overlay?
496
495
  // Or just standard rendering.
497
496
  isSearchHit: !0
498
497
  };
499
498
  });
500
- } catch (n) {
501
- console.error("Search error:", n);
499
+ } catch (a) {
500
+ console.error("Search error:", a);
502
501
  } finally {
503
502
  this.isSearching = !1;
504
503
  }
505
504
  }
506
505
  }
507
506
  get plugins() {
508
- return e.get(k(this, Ee));
507
+ return e.get(M(this, Ee));
509
508
  }
510
509
  set plugins(t) {
511
- e.set(k(this, Ee), t, !0);
510
+ e.set(M(this, Ee), t, !0);
512
511
  }
513
512
  get pluginMenuButtons() {
514
- return e.get(k(this, Oe));
513
+ return e.get(M(this, Ge));
515
514
  }
516
515
  set pluginMenuButtons(t) {
517
- e.set(k(this, Oe), t, !0);
516
+ e.set(M(this, Ge), t, !0);
518
517
  }
519
518
  get pluginPanels() {
520
- return e.get(k(this, Ge));
519
+ return e.get(M(this, Oe));
521
520
  }
522
521
  set pluginPanels(t) {
523
- e.set(k(this, Ge), t, !0);
522
+ e.set(M(this, Oe), t, !0);
524
523
  }
525
524
  get osdViewer() {
526
- return e.get(k(this, Ve));
525
+ return e.get(M(this, Be));
527
526
  }
528
527
  set osdViewer(t) {
529
- e.set(k(this, Ve), t, !0);
528
+ e.set(M(this, Be), t, !0);
530
529
  }
531
530
  createPluginContext() {
532
531
  const t = this;
@@ -546,13 +545,13 @@ class Tt {
546
545
  t.pluginPanels = t.pluginPanels.filter((s) => s.id !== r);
547
546
  },
548
547
  emit(r, s) {
549
- const n = t.pluginEventHandlers.get(r);
550
- n == null || n.forEach((a) => a(s));
548
+ const a = t.pluginEventHandlers.get(r);
549
+ a == null || a.forEach((o) => o(s));
551
550
  },
552
551
  on(r, s) {
553
552
  return t.pluginEventHandlers.has(r) || t.pluginEventHandlers.set(r, /* @__PURE__ */ new Set()), t.pluginEventHandlers.get(r).add(s), () => {
554
- var n;
555
- (n = t.pluginEventHandlers.get(r)) == null || n.delete(s);
553
+ var a;
554
+ (a = t.pluginEventHandlers.get(r)) == null || a.delete(s);
556
555
  };
557
556
  }
558
557
  };
@@ -572,8 +571,8 @@ class Tt {
572
571
  */
573
572
  unregisterPlugin(t) {
574
573
  var s;
575
- const r = this.plugins.find((n) => n.id === t);
576
- r && ((s = r.onDestroy) == null || s.call(r), this.plugins = this.plugins.filter((n) => n.id !== t), this.pluginMenuButtons = this.pluginMenuButtons.filter((n) => !n.id.startsWith(`${t}:`)), this.pluginPanels = this.pluginPanels.filter((n) => !n.id.startsWith(`${t}:`)));
574
+ const r = this.plugins.find((a) => a.id === t);
575
+ r && ((s = r.onDestroy) == null || s.call(r), this.plugins = this.plugins.filter((a) => a.id !== t), this.pluginMenuButtons = this.pluginMenuButtons.filter((a) => !a.id.startsWith(`${t}:`)), this.pluginPanels = this.pluginPanels.filter((a) => !a.id.startsWith(`${t}:`)));
577
576
  }
578
577
  /**
579
578
  * Called by OSDViewer when OpenSeadragon is ready.
@@ -594,7 +593,7 @@ class Tt {
594
593
  this.plugins = [], this.pluginMenuButtons = [], this.pluginPanels = [], this.pluginEventHandlers.clear();
595
594
  }
596
595
  }
597
- he = new WeakMap(), ve = new WeakMap(), pe = new WeakMap(), me = new WeakMap(), be = new WeakMap(), _e = new WeakMap(), ye = new WeakMap(), we = new WeakMap(), xe = new WeakMap(), Se = new WeakMap(), Ae = new WeakMap(), Ie = new WeakMap(), Ce = new WeakMap(), ke = new WeakMap(), Pe = new WeakMap(), Me = new WeakMap(), Te = new WeakMap(), ze = new WeakMap(), je = new WeakMap(), Le = new WeakMap(), Re = new WeakMap(), De = new WeakMap(), Ee = new WeakMap(), Oe = new WeakMap(), Ge = new WeakMap(), Ve = new WeakMap();
596
+ ve = new WeakMap(), he = new WeakMap(), pe = new WeakMap(), me = new WeakMap(), be = new WeakMap(), _e = new WeakMap(), ye = new WeakMap(), we = new WeakMap(), xe = new WeakMap(), Se = new WeakMap(), Ae = new WeakMap(), Ie = new WeakMap(), Ce = new WeakMap(), ke = new WeakMap(), Pe = new WeakMap(), Me = new WeakMap(), Te = new WeakMap(), ze = new WeakMap(), je = new WeakMap(), Le = new WeakMap(), Re = new WeakMap(), De = new WeakMap(), Ee = new WeakMap(), Ge = new WeakMap(), Oe = new WeakMap(), Be = new WeakMap();
598
597
  const ce = "triiiceratops:viewerState", zt = [
599
598
  "light",
600
599
  "dark",
@@ -648,8 +647,8 @@ function Lt(i) {
648
647
  /rgba?\(\s*(\d+(?:\.\d+)?%?)\s*[,\s]\s*(\d+(?:\.\d+)?%?)\s*[,\s]\s*(\d+(?:\.\d+)?%?)(?:\s*[,/]\s*(\d*\.?\d+%?))?\s*\)/i
649
648
  );
650
649
  if (!t) return null;
651
- const r = (S) => S.endsWith("%") ? parseFloat(S) / 100 * 255 : parseFloat(S), s = r(t[1]), n = r(t[2]), a = r(t[3]);
652
- return isNaN(s) || isNaN(n) || isNaN(a) ? null : { r: s, g: n, b: a };
650
+ const r = (I) => I.endsWith("%") ? parseFloat(I) / 100 * 255 : parseFloat(I), s = r(t[1]), a = r(t[2]), o = r(t[3]);
651
+ return isNaN(s) || isNaN(a) || isNaN(o) ? null : { r: s, g: a, b: o };
653
652
  }
654
653
  function He(i) {
655
654
  const t = i / 255;
@@ -663,54 +662,54 @@ function Rt(i, t, r) {
663
662
  };
664
663
  }
665
664
  function Dt(i, t, r) {
666
- const s = 0.8189330101 * i + 0.3618667424 * t - 0.1288597137 * r, n = 0.0329845436 * i + 0.9293118715 * t + 0.0361456387 * r, a = 0.0482003018 * i + 0.2643662691 * t + 0.633851707 * r, S = Math.cbrt(s), P = Math.cbrt(n), _ = Math.cbrt(a);
665
+ const s = 0.8189330101 * i + 0.3618667424 * t - 0.1288597137 * r, a = 0.0329845436 * i + 0.9293118715 * t + 0.0361456387 * r, o = 0.0482003018 * i + 0.2643662691 * t + 0.633851707 * r, I = Math.cbrt(s), b = Math.cbrt(a), w = Math.cbrt(o);
667
666
  return {
668
- L: 0.2104542553 * S + 0.793617785 * P - 0.0040720468 * _,
669
- a: 1.9779984951 * S - 2.428592205 * P + 0.4505937099 * _,
670
- b: 0.0259040371 * S + 0.7827717662 * P - 0.808675766 * _
667
+ L: 0.2104542553 * I + 0.793617785 * b - 0.0040720468 * w,
668
+ a: 1.9779984951 * I - 2.428592205 * b + 0.4505937099 * w,
669
+ b: 0.0259040371 * I + 0.7827717662 * b - 0.808675766 * w
671
670
  };
672
671
  }
673
672
  function Et(i, t, r) {
674
673
  const s = Math.sqrt(t * t + r * r);
675
- let n = Math.atan2(r, t) * 180 / Math.PI;
676
- return n < 0 && (n += 360), { L: i, C: s, h: n };
674
+ let a = Math.atan2(r, t) * 180 / Math.PI;
675
+ return a < 0 && (a += 360), { L: i, C: s, h: a };
677
676
  }
678
677
  function et(i, t, r) {
679
- const s = He(i), n = He(t), a = He(r), { x: S, y: P, z: _ } = Rt(s, n, a), { L: I, a: u, b: R } = Dt(S, P, _);
680
- return Et(I, u, R);
678
+ const s = He(i), a = He(t), o = He(r), { x: I, y: b, z: w } = Rt(s, a, o), { L: P, a: g, b: O } = Dt(I, b, w);
679
+ return Et(P, g, O);
681
680
  }
682
681
  function tt(i, t, r) {
683
- const s = (i * 100).toFixed(2), n = t.toFixed(4), a = t < 1e-4 ? 0 : r.toFixed(2);
684
- return `oklch(${s}% ${n} ${a})`;
682
+ const s = (i * 100).toFixed(2), a = t.toFixed(4), o = t < 1e-4 ? 0 : r.toFixed(2);
683
+ return `oklch(${s}% ${a} ${o})`;
685
684
  }
686
- function Ot(i) {
685
+ function Gt(i) {
687
686
  return i.trim().toLowerCase().startsWith("oklch(");
688
687
  }
689
- function Gt(i) {
688
+ function Ot(i) {
690
689
  return /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(
691
690
  i.trim()
692
691
  );
693
692
  }
694
- function Vt(i) {
693
+ function Bt(i) {
695
694
  return /^rgba?\s*\(/i.test(i.trim());
696
695
  }
697
- function Ft(i) {
696
+ function $t(i) {
698
697
  const t = jt(i);
699
698
  if (!t)
700
699
  return console.warn(`Invalid hex color: ${i}, returning as-is`), i;
701
- const { L: r, C: s, h: n } = et(t.r, t.g, t.b);
702
- return tt(r, s, n);
700
+ const { L: r, C: s, h: a } = et(t.r, t.g, t.b);
701
+ return tt(r, s, a);
703
702
  }
704
- function Bt(i) {
703
+ function Ft(i) {
705
704
  const t = Lt(i);
706
705
  if (!t)
707
706
  return console.warn(`Invalid rgb color: ${i}, returning as-is`), i;
708
- const { L: r, C: s, h: n } = et(t.r, t.g, t.b);
709
- return tt(r, s, n);
707
+ const { L: r, C: s, h: a } = et(t.r, t.g, t.b);
708
+ return tt(r, s, a);
710
709
  }
711
- function $t(i) {
710
+ function Vt(i) {
712
711
  const t = i.trim();
713
- return Ot(t) ? t : Gt(t) ? Ft(t) : Vt(t) ? Bt(t) : (console.warn(`Unrecognized color format: ${i}, passing through as-is`), i);
712
+ return Gt(t) ? t : Ot(t) ? $t(t) : Bt(t) ? Ft(t) : (console.warn(`Unrecognized color format: ${i}, passing through as-is`), i);
714
713
  }
715
714
  const rt = {
716
715
  // Semantic colors
@@ -772,7 +771,7 @@ const rt = {
772
771
  "error",
773
772
  "errorContent"
774
773
  ]);
775
- function ki(i) {
774
+ function Ei(i) {
776
775
  return zt.includes(i);
777
776
  }
778
777
  function Ht(i, t) {
@@ -781,22 +780,22 @@ function Ht(i, t) {
781
780
  function Yt(i, t) {
782
781
  for (const [r, s] of Object.entries(t)) {
783
782
  if (s == null) continue;
784
- const n = r;
785
- if (n === "colorScheme") {
783
+ const a = r;
784
+ if (a === "colorScheme") {
786
785
  i.style.colorScheme = s;
787
786
  continue;
788
787
  }
789
- const a = rt[n];
790
- if (!a) continue;
791
- let S = String(s);
792
- Nt.has(n) && (S = $t(S)), i.style.setProperty(a, S);
788
+ const o = rt[a];
789
+ if (!o) continue;
790
+ let I = String(s);
791
+ Nt.has(a) && (I = Vt(I)), i.style.setProperty(o, I);
793
792
  }
794
793
  }
795
794
  function Xt(i) {
796
795
  for (const [t, r] of Object.entries(rt))
797
796
  t === "colorScheme" ? i.style.colorScheme = "" : i.style.removeProperty(r);
798
797
  }
799
- function Pi(i) {
798
+ function Gi(i) {
800
799
  try {
801
800
  const t = JSON.parse(i);
802
801
  return typeof t == "object" && t !== null ? t : null;
@@ -836,9 +835,9 @@ function Qt(i) {
836
835
  function Wt(i) {
837
836
  var r, s;
838
837
  if (typeof i.getTarget == "function") {
839
- const n = ((r = i.__jsonld) == null ? void 0 : r.on) || ((s = i.__jsonld) == null ? void 0 : s.target);
840
- if (n)
841
- return Je(n);
838
+ const a = ((r = i.__jsonld) == null ? void 0 : r.on) || ((s = i.__jsonld) == null ? void 0 : s.target);
839
+ if (a)
840
+ return Je(a);
842
841
  }
843
842
  const t = i.target || i.on;
844
843
  return t ? Je(t) : null;
@@ -865,26 +864,26 @@ function Ut(i) {
865
864
  const r = new DOMParser().parseFromString(i, "image/svg+xml");
866
865
  if (r.documentElement.nodeName === "parsererror")
867
866
  return console.warn("Failed to parse SVG selector:", i), null;
868
- const s = [], n = r.querySelectorAll("polygon");
869
- for (const P of n) {
870
- const _ = P.getAttribute("points");
871
- if (_) {
872
- const I = Jt(_);
873
- s.push(...I);
867
+ const s = [], a = r.querySelectorAll("polygon");
868
+ for (const b of a) {
869
+ const w = b.getAttribute("points");
870
+ if (w) {
871
+ const P = Jt(w);
872
+ s.push(...P);
874
873
  }
875
874
  }
876
- const a = r.querySelectorAll("path");
877
- for (const P of a) {
878
- const _ = P.getAttribute("d");
879
- if (_) {
880
- const I = Kt(_);
881
- s.push(...I);
875
+ const o = r.querySelectorAll("path");
876
+ for (const b of o) {
877
+ const w = b.getAttribute("d");
878
+ if (w) {
879
+ const P = Kt(w);
880
+ s.push(...P);
882
881
  }
883
882
  }
884
- const S = r.querySelectorAll("circle");
885
- for (const P of S) {
886
- const _ = parseFloat(P.getAttribute("cx") || "0"), I = parseFloat(P.getAttribute("cy") || "0"), u = parseFloat(P.getAttribute("r") || "0"), R = Zt(_, I, u);
887
- s.push(...R);
883
+ const I = r.querySelectorAll("circle");
884
+ for (const b of I) {
885
+ const w = parseFloat(b.getAttribute("cx") || "0"), P = parseFloat(b.getAttribute("cy") || "0"), g = parseFloat(b.getAttribute("r") || "0"), O = Zt(w, P, g);
886
+ s.push(...O);
888
887
  }
889
888
  return s.length === 0 ? null : {
890
889
  type: "POLYGON",
@@ -897,8 +896,8 @@ function Ut(i) {
897
896
  function Jt(i) {
898
897
  const t = [], r = i.trim().split(/\s+/);
899
898
  for (const s of r) {
900
- const [n, a] = s.split(",").map((S) => parseFloat(S));
901
- !isNaN(n) && !isNaN(a) && t.push([n, a]);
899
+ const [a, o] = s.split(",").map((I) => parseFloat(I));
900
+ !isNaN(a) && !isNaN(o) && t.push([a, o]);
902
901
  }
903
902
  return t;
904
903
  }
@@ -906,18 +905,18 @@ function Kt(i) {
906
905
  const t = [], r = /[ML]\s*([\d.]+)[,\s]+([\d.]+)/g;
907
906
  let s;
908
907
  for (; (s = r.exec(i)) !== null; ) {
909
- const n = parseFloat(s[1]), a = parseFloat(s[2]);
910
- !isNaN(n) && !isNaN(a) && t.push([n, a]);
908
+ const a = parseFloat(s[1]), o = parseFloat(s[2]);
909
+ !isNaN(a) && !isNaN(o) && t.push([a, o]);
911
910
  }
912
911
  return t;
913
912
  }
914
913
  function Zt(i, t, r, s = 8) {
915
- const n = [];
916
- for (let a = 0; a < s; a++) {
917
- const S = a / s * Math.PI * 2, P = i + r * Math.cos(S), _ = t + r * Math.sin(S);
918
- n.push([P, _]);
914
+ const a = [];
915
+ for (let o = 0; o < s; o++) {
916
+ const I = o / s * Math.PI * 2, b = i + r * Math.cos(I), w = t + r * Math.sin(I);
917
+ a.push([b, w]);
919
918
  }
920
- return n;
919
+ return a;
921
920
  }
922
921
  function er(i) {
923
922
  var r;
@@ -925,10 +924,10 @@ function er(i) {
925
924
  const s = i.getTarget();
926
925
  if (typeof s == "string" && s.includes("xywh="))
927
926
  return Ye(s);
928
- const n = (r = i.__jsonld) == null ? void 0 : r.on;
929
- if (n) {
930
- const a = Xe(n);
931
- if (a) return a;
927
+ const a = (r = i.__jsonld) == null ? void 0 : r.on;
928
+ if (a) {
929
+ const o = Xe(a);
930
+ if (o) return o;
932
931
  }
933
932
  }
934
933
  const t = i.target || i.on;
@@ -955,114 +954,114 @@ function tr(i) {
955
954
  if (typeof i.getBody == "function") {
956
955
  const s = i.getBody();
957
956
  if (s && Array.isArray(s)) {
958
- const n = [];
959
- for (const a of s) {
960
- const S = a.getValue ? a.getValue() : "";
961
- if (S) {
962
- n.push(S);
963
- const P = a.getFormat ? a.getFormat() : "";
964
- (P === "text/html" || P === "application/html") && (r = !0);
957
+ const a = [];
958
+ for (const o of s) {
959
+ const I = o.getValue ? o.getValue() : "";
960
+ if (I) {
961
+ a.push(I);
962
+ const b = o.getFormat ? o.getFormat() : "";
963
+ (b === "text/html" || b === "application/html") && (r = !0);
965
964
  }
966
965
  }
967
- t = n.join(" ");
966
+ t = a.join(" ");
968
967
  }
969
968
  } else {
970
- const s = (a) => a && (a.chars || a.value || a["cnt:chars"]) || "", n = (a) => a ? a.format === "text/html" || a.type === "TextualBody" : !1;
969
+ const s = (o) => o && (o.chars || o.value || o["cnt:chars"]) || "", a = (o) => o ? o.format === "text/html" || o.type === "TextualBody" : !1;
971
970
  if (i.resource) {
972
- const a = Array.isArray(i.resource) ? i.resource : [i.resource];
973
- t = a.map(s).filter(Boolean).join(" "), r = a.some(n);
971
+ const o = Array.isArray(i.resource) ? i.resource : [i.resource];
972
+ t = o.map(s).filter(Boolean).join(" "), r = o.some(a);
974
973
  } else if (i.body) {
975
- const a = Array.isArray(i.body) ? i.body : [i.body];
976
- t = a.map(s).filter(Boolean).join(" "), r = a.some(n);
974
+ const o = Array.isArray(i.body) ? i.body : [i.body];
975
+ t = o.map(s).filter(Boolean).join(" "), r = o.some(a);
977
976
  }
978
977
  }
979
978
  return t || (typeof i.getLabel == "function" ? t = i.getLabel() || "" : i.label && (t = Array.isArray(i.label) ? i.label.join(" ") : i.label)), { value: t || "Annotation", isHtml: r };
980
979
  }
981
980
  function rr(i, t, r = !1) {
982
- const s = it(i) || `anno-${t}`, n = Qt(i);
983
- if (!n)
981
+ const s = it(i) || `anno-${t}`, a = Qt(i);
982
+ if (!a)
984
983
  return null;
985
- const a = tr(i);
984
+ const o = tr(i);
986
985
  return {
987
986
  id: s,
988
- geometry: n,
989
- body: a,
987
+ geometry: a,
988
+ body: o,
990
989
  isSearchHit: r
991
990
  };
992
991
  }
993
992
  function ir(i, t = /* @__PURE__ */ new Set()) {
994
993
  return i.map((r, s) => {
995
- const n = t.has(it(r));
996
- return rr(r, s, n);
994
+ const a = t.has(it(r));
995
+ return rr(r, s, a);
997
996
  }).filter((r) => r !== null);
998
997
  }
999
998
  var sr = e.from_html("<div></div>"), nr = e.from_svg('<svg class="absolute pointer-events-auto"><title> </title><polygon stroke-width="2"></polygon></svg>'), ar = e.from_html('<div class="w-full h-full relative"><div class="w-full h-full osd-background bg-base-100"></div> <!></div>');
1000
999
  function st(i, t) {
1001
1000
  e.push(t, !0);
1002
- let r = e.prop(t, "tileSources", 7), s = e.prop(t, "viewerState", 7), n = e.state(void 0), a = e.state(void 0), S = e.state(0), P = e.derived(() => {
1001
+ let r = e.prop(t, "tileSources", 7), s = e.prop(t, "viewerState", 7), a = e.state(void 0), o = e.state(void 0), I = e.state(0), b = e.derived(() => {
1003
1002
  if (!s().manifestId || !s().canvasId)
1004
1003
  return [];
1005
- const h = le.getAnnotations(s().manifestId, s().canvasId), c = s().currentCanvasSearchAnnotations;
1006
- return [...h, ...c];
1007
- }), _ = e.derived(() => {
1004
+ const h = le.getAnnotations(s().manifestId, s().canvasId), l = s().currentCanvasSearchAnnotations;
1005
+ return [...h, ...l];
1006
+ }), w = e.derived(() => {
1008
1007
  const h = /* @__PURE__ */ new Set();
1009
- return s().currentCanvasSearchAnnotations.forEach((c) => {
1010
- const d = c.id || c["@id"];
1011
- d && h.add(d);
1008
+ return s().currentCanvasSearchAnnotations.forEach((l) => {
1009
+ const c = l.id || l["@id"];
1010
+ c && h.add(c);
1012
1011
  }), h;
1013
- }), I = e.derived(() => ir(e.get(P), e.get(_))), u = e.derived(() => {
1014
- if (e.get(S), !e.get(a) || !e.get(I).length)
1012
+ }), P = e.derived(() => ir(e.get(b), e.get(w))), g = e.derived(() => {
1013
+ if (e.get(I), !e.get(o) || !e.get(P).length)
1015
1014
  return [];
1016
- const h = e.get(a).world.getItemAt(0);
1015
+ const h = e.get(o).world.getItemAt(0);
1017
1016
  if (!h)
1018
1017
  return [];
1019
- const c = [];
1020
- for (const d of e.get(I)) {
1021
- if (!d.isSearchHit) if (s().showAnnotations) {
1022
- if (!s().visibleAnnotationIds.has(d.id))
1018
+ const l = [];
1019
+ for (const c of e.get(P)) {
1020
+ if (!c.isSearchHit) if (s().showAnnotations) {
1021
+ if (!s().visibleAnnotationIds.has(c.id))
1023
1022
  continue;
1024
1023
  } else continue;
1025
- if (d.geometry.type === "RECTANGLE") {
1026
- const z = h.imageToViewportRectangle(d.geometry.x, d.geometry.y, d.geometry.w, d.geometry.h), B = e.get(a).viewport.viewportToViewerElementRectangle(z);
1027
- c.push({
1028
- id: d.id,
1024
+ if (c.geometry.type === "RECTANGLE") {
1025
+ const R = h.imageToViewportRectangle(c.geometry.x, c.geometry.y, c.geometry.w, c.geometry.h), T = e.get(o).viewport.viewportToViewerElementRectangle(R);
1026
+ l.push({
1027
+ id: c.id,
1029
1028
  type: "RECTANGLE",
1030
1029
  rect: {
1031
- x: B.x,
1032
- y: B.y,
1033
- width: B.width,
1034
- height: B.height
1030
+ x: T.x,
1031
+ y: T.y,
1032
+ width: T.width,
1033
+ height: T.height
1035
1034
  },
1036
- isSearchHit: d.isSearchHit,
1037
- tooltip: d.body.value
1035
+ isSearchHit: c.isSearchHit,
1036
+ tooltip: c.body.value
1038
1037
  });
1039
- } else if (d.geometry.type === "POLYGON") {
1040
- const z = d.geometry.points.map((M) => {
1041
- const y = h.imageToViewportCoordinates(new Qe.Point(M[0], M[1])), w = e.get(a).viewport.viewportToViewerElementCoordinates(y);
1042
- return [w.x, w.y];
1038
+ } else if (c.geometry.type === "POLYGON") {
1039
+ const R = c.geometry.points.map((z) => {
1040
+ const S = h.imageToViewportCoordinates(new Qe.Point(z[0], z[1])), k = e.get(o).viewport.viewportToViewerElementCoordinates(S);
1041
+ return [k.x, k.y];
1043
1042
  });
1044
- let B = 1 / 0, E = 1 / 0, p = -1 / 0, f = -1 / 0;
1045
- for (const [M, y] of z)
1046
- B = Math.min(B, M), E = Math.min(E, y), p = Math.max(p, M), f = Math.max(f, y);
1047
- const o = z.map(([M, y]) => [M - B, y - E]);
1048
- c.push({
1049
- id: d.id,
1043
+ let T = 1 / 0, u = 1 / 0, A = -1 / 0, $ = -1 / 0;
1044
+ for (const [z, S] of R)
1045
+ T = Math.min(T, z), u = Math.min(u, S), A = Math.max(A, z), $ = Math.max($, S);
1046
+ const d = R.map(([z, S]) => [z - T, S - u]);
1047
+ l.push({
1048
+ id: c.id,
1050
1049
  type: "POLYGON",
1051
- bounds: { x: B, y: E, width: p - B, height: f - E },
1052
- points: o,
1053
- isSearchHit: d.isSearchHit,
1054
- tooltip: d.body.value
1050
+ bounds: { x: T, y: u, width: A - T, height: $ - u },
1051
+ points: d,
1052
+ isSearchHit: c.isSearchHit,
1053
+ tooltip: c.body.value
1055
1054
  });
1056
1055
  }
1057
1056
  }
1058
- return c;
1057
+ return l;
1059
1058
  });
1060
- ht(() => {
1061
- if (e.get(n))
1059
+ vt(() => {
1060
+ if (e.get(a))
1062
1061
  return e.set(
1063
- a,
1062
+ o,
1064
1063
  Qe({
1065
- element: e.get(n),
1064
+ element: e.get(a),
1066
1065
  tileSources: null,
1067
1066
  // Will be set via effect
1068
1067
  prefixUrl: "",
@@ -1078,22 +1077,22 @@ function st(i, t) {
1078
1077
  zoomPerClick: 2
1079
1078
  }),
1080
1079
  !0
1081
- ), s().notifyOSDReady(e.get(a)), () => {
1080
+ ), s().notifyOSDReady(e.get(o)), () => {
1082
1081
  var h;
1083
- (h = e.get(a)) == null || h.destroy(), s().osdViewer = null;
1082
+ (h = e.get(o)) == null || h.destroy(), s().osdViewer = null;
1084
1083
  };
1085
1084
  }), e.user_effect(() => {
1086
- if (!e.get(a)) return;
1085
+ if (!e.get(o)) return;
1087
1086
  const h = () => {
1088
- e.update(S);
1087
+ e.update(I);
1089
1088
  };
1090
- return e.get(a).addHandler("open", h), e.get(a).addHandler("animation", h), e.get(a).addHandler("resize", h), e.get(a).addHandler("rotate", h), e.get(a).world.addHandler("add-item", h), e.get(a).world.addHandler("remove-item", h), () => {
1091
- e.get(a).removeHandler("open", h), e.get(a).removeHandler("animation", h), e.get(a).removeHandler("resize", h), e.get(a).removeHandler("rotate", h), e.get(a).world.removeHandler("add-item", h), e.get(a).world.removeHandler("remove-item", h);
1089
+ return e.get(o).addHandler("open", h), e.get(o).addHandler("animation", h), e.get(o).addHandler("resize", h), e.get(o).addHandler("rotate", h), e.get(o).world.addHandler("add-item", h), e.get(o).world.addHandler("remove-item", h), () => {
1090
+ e.get(o).removeHandler("open", h), e.get(o).removeHandler("animation", h), e.get(o).removeHandler("resize", h), e.get(o).removeHandler("rotate", h), e.get(o).world.removeHandler("add-item", h), e.get(o).world.removeHandler("remove-item", h);
1092
1091
  };
1093
1092
  }), e.user_effect(() => {
1094
- !e.get(a) || !r() || e.get(a).open(r());
1093
+ !e.get(o) || !r() || e.get(o).open(r());
1095
1094
  });
1096
- var R = {
1095
+ var O = {
1097
1096
  get tileSources() {
1098
1097
  return r();
1099
1098
  },
@@ -1106,57 +1105,57 @@ function st(i, t) {
1106
1105
  set viewerState(h) {
1107
1106
  s(h), e.flush();
1108
1107
  }
1109
- }, g = ar(), v = e.child(g);
1110
- e.bind_this(v, (h) => e.set(n, h), () => e.get(n));
1111
- var C = e.sibling(v, 2);
1112
- return e.each(C, 17, () => e.get(u), (h) => h.id, (h, c) => {
1113
- var d = e.comment(), z = e.first_child(d);
1108
+ }, v = ar(), p = e.child(v);
1109
+ e.bind_this(p, (h) => e.set(a, h), () => e.get(a));
1110
+ var C = e.sibling(p, 2);
1111
+ return e.each(C, 17, () => e.get(g), (h) => h.id, (h, l) => {
1112
+ var c = e.comment(), R = e.first_child(c);
1114
1113
  {
1115
- var B = (p) => {
1116
- var f = sr();
1114
+ var T = (A) => {
1115
+ var $ = sr();
1117
1116
  e.template_effect(() => {
1118
- e.set_class(f, 1, `absolute border-2 transition-colors cursor-pointer pointer-events-auto ${e.get(c).isSearchHit ? "border-yellow-400 bg-yellow-400/40 hover:bg-yellow-400/60" : "border-red-500 bg-red-500/20 hover:bg-red-500/40"}`), e.set_style(f, `
1119
- left: ${e.get(c).rect.x ?? ""}px;
1120
- top: ${e.get(c).rect.y ?? ""}px;
1121
- width: ${e.get(c).rect.width ?? ""}px;
1122
- height: ${e.get(c).rect.height ?? ""}px;
1123
- `), e.set_attribute(f, "title", e.get(c).tooltip);
1124
- }), e.append(p, f);
1125
- }, E = (p) => {
1126
- var f = e.comment(), o = e.first_child(f);
1117
+ e.set_class($, 1, `absolute border-2 transition-colors cursor-pointer pointer-events-auto ${e.get(l).isSearchHit ? "border-yellow-400 bg-yellow-400/40 hover:bg-yellow-400/60" : "border-red-500 bg-red-500/20 hover:bg-red-500/40"}`), e.set_style($, `
1118
+ left: ${e.get(l).rect.x ?? ""}px;
1119
+ top: ${e.get(l).rect.y ?? ""}px;
1120
+ width: ${e.get(l).rect.width ?? ""}px;
1121
+ height: ${e.get(l).rect.height ?? ""}px;
1122
+ `), e.set_attribute($, "title", e.get(l).tooltip);
1123
+ }), e.append(A, $);
1124
+ }, u = (A) => {
1125
+ var $ = e.comment(), d = e.first_child($);
1127
1126
  {
1128
- var M = (y) => {
1129
- var w = nr(), T = e.child(w), L = e.child(T, !0);
1130
- e.reset(T);
1131
- var A = e.sibling(T);
1132
- e.reset(w), e.template_effect(
1127
+ var z = (S) => {
1128
+ var k = nr(), D = e.child(k), j = e.child(D, !0);
1129
+ e.reset(D);
1130
+ var x = e.sibling(D);
1131
+ e.reset(k), e.template_effect(
1133
1132
  (m) => {
1134
- e.set_style(w, `
1135
- left: ${e.get(c).bounds.x ?? ""}px;
1136
- top: ${e.get(c).bounds.y ?? ""}px;
1137
- width: ${e.get(c).bounds.width ?? ""}px;
1138
- height: ${e.get(c).bounds.height ?? ""}px;
1139
- `), e.set_text(L, e.get(c).tooltip), e.set_attribute(A, "points", m), e.set_class(A, 0, `cursor-pointer transition-colors ${e.get(c).isSearchHit ? "fill-yellow-400/40 stroke-yellow-400 hover:fill-yellow-400/60" : "fill-red-500/20 stroke-red-500 hover:fill-red-500/40"}`);
1133
+ e.set_style(k, `
1134
+ left: ${e.get(l).bounds.x ?? ""}px;
1135
+ top: ${e.get(l).bounds.y ?? ""}px;
1136
+ width: ${e.get(l).bounds.width ?? ""}px;
1137
+ height: ${e.get(l).bounds.height ?? ""}px;
1138
+ `), e.set_text(j, e.get(l).tooltip), e.set_attribute(x, "points", m), e.set_class(x, 0, `cursor-pointer transition-colors ${e.get(l).isSearchHit ? "fill-yellow-400/40 stroke-yellow-400 hover:fill-yellow-400/60" : "fill-red-500/20 stroke-red-500 hover:fill-red-500/40"}`);
1140
1139
  },
1141
- [() => e.get(c).points.map((m) => m.join(",")).join(" ")]
1142
- ), e.append(y, w);
1140
+ [() => e.get(l).points.map((m) => m.join(",")).join(" ")]
1141
+ ), e.append(S, k);
1143
1142
  };
1144
1143
  e.if(
1145
- o,
1146
- (y) => {
1147
- e.get(c).type === "POLYGON" && y(M);
1144
+ d,
1145
+ (S) => {
1146
+ e.get(l).type === "POLYGON" && S(z);
1148
1147
  },
1149
1148
  !0
1150
1149
  );
1151
1150
  }
1152
- e.append(p, f);
1151
+ e.append(A, $);
1153
1152
  };
1154
- e.if(z, (p) => {
1155
- e.get(c).type === "RECTANGLE" ? p(B) : p(E, !1);
1153
+ e.if(R, (A) => {
1154
+ e.get(l).type === "RECTANGLE" ? A(T) : A(u, !1);
1156
1155
  });
1157
1156
  }
1158
- e.append(h, d);
1159
- }), e.reset(g), e.append(i, g), e.pop(R);
1157
+ e.append(h, c);
1158
+ }), e.reset(v), e.append(i, v), e.pop(O);
1160
1159
  }
1161
1160
  e.create_custom_element(st, { tileSources: {}, viewerState: {} }, [], [], !0);
1162
1161
  var or = e.from_html('<div class="select-none absolute left-1/2 -translate-x-1/2 bg-base-200/90 backdrop-blur rounded-full shadow-lg flex items-center gap-4 z-10 border border-base-300 transition-all duration-200 bottom-4"><button class="btn btn-circle btn-sm btn-ghost"><!></button> <span class="text-sm font-mono tabular-nums text-nowrap"> </span> <button class="btn btn-circle btn-sm btn-ghost"><!></button></div>');
@@ -1167,24 +1166,24 @@ function nt(i, t) {
1167
1166
  get viewerState() {
1168
1167
  return r();
1169
1168
  },
1170
- set viewerState(R) {
1171
- r(R), e.flush();
1169
+ set viewerState(O) {
1170
+ r(O), e.flush();
1172
1171
  }
1173
- }, n = or(), a = e.child(n);
1174
- a.__click = () => r().previousCanvas();
1175
- var S = e.child(a);
1176
- bt(S, { size: 20, weight: "bold" }), e.reset(a);
1177
- var P = e.sibling(a, 2), _ = e.child(P);
1178
- e.reset(P);
1179
- var I = e.sibling(P, 2);
1180
- I.__click = () => r().nextCanvas();
1181
- var u = e.child(I);
1182
- return _t(u, { size: 20, weight: "bold" }), e.reset(I), e.reset(n), e.template_effect(
1183
- (R, g) => {
1184
- a.disabled = !r().hasPrevious, e.set_attribute(a, "aria-label", R), e.set_text(_, `${r().currentCanvasIndex + 1} / ${r().canvases.length ?? ""}`), I.disabled = !r().hasNext, e.set_attribute(I, "aria-label", g);
1172
+ }, a = or(), o = e.child(a);
1173
+ o.__click = () => r().previousCanvas();
1174
+ var I = e.child(o);
1175
+ bt(I, { size: 20, weight: "bold" }), e.reset(o);
1176
+ var b = e.sibling(o, 2), w = e.child(b);
1177
+ e.reset(b);
1178
+ var P = e.sibling(b, 2);
1179
+ P.__click = () => r().nextCanvas();
1180
+ var g = e.child(P);
1181
+ return _t(g, { size: 20, weight: "bold" }), e.reset(P), e.reset(a), e.template_effect(
1182
+ (O, v) => {
1183
+ o.disabled = !r().hasPrevious, e.set_attribute(o, "aria-label", O), e.set_text(w, `${r().currentCanvasIndex + 1} / ${r().canvases.length ?? ""}`), P.disabled = !r().hasNext, e.set_attribute(P, "aria-label", v);
1185
1184
  },
1186
- [() => V.previous_canvas(), () => V.next_canvas()]
1187
- ), e.append(i, n), e.pop(s);
1185
+ [() => E.previous_canvas(), () => E.next_canvas()]
1186
+ ), e.append(i, a), e.pop(s);
1188
1187
  }
1189
1188
  e.delegate(["click"]);
1190
1189
  e.create_custom_element(nt, { viewerState: {} }, [], [], !0);
@@ -1195,1242 +1194,1327 @@ function at(i, t) {
1195
1194
  let s = e.derived(() => {
1196
1195
  if (!r.manifestId || !r.canvasId)
1197
1196
  return [];
1198
- const g = le.getAnnotations(r.manifestId, r.canvasId), v = r.currentCanvasSearchAnnotations;
1199
- return [...g, ...v];
1197
+ const v = le.getAnnotations(r.manifestId, r.canvasId), p = r.currentCanvasSearchAnnotations;
1198
+ return [...v, ...p];
1200
1199
  });
1201
- function n(g) {
1202
- return g.id || g["@id"] || (typeof g.getId == "function" ? g.getId() : "") || "";
1200
+ function a(v) {
1201
+ return v.id || v["@id"] || (typeof v.getId == "function" ? v.getId() : "") || "";
1203
1202
  }
1204
1203
  e.user_effect(() => {
1205
- var g;
1204
+ var v;
1206
1205
  if (e.get(s).length > 0)
1207
- if (((g = r.config.annotations) == null ? void 0 : g.visible) ?? !0) {
1206
+ if (((v = r.config.annotations) == null ? void 0 : v.visible) ?? !0) {
1208
1207
  const C = /* @__PURE__ */ new Set();
1209
1208
  e.get(s).forEach((h) => {
1210
- const c = n(h);
1211
- c && C.add(c);
1209
+ const l = a(h);
1210
+ l && C.add(l);
1212
1211
  }), r.visibleAnnotationIds = C;
1213
1212
  } else
1214
1213
  r.visibleAnnotationIds = /* @__PURE__ */ new Set();
1215
1214
  else
1216
1215
  r.visibleAnnotationIds = /* @__PURE__ */ new Set();
1217
1216
  });
1218
- let a = e.derived(() => e.get(s).length === 0 ? !1 : e.get(s).every((g) => {
1219
- const v = n(g);
1220
- return !v || r.visibleAnnotationIds.has(v);
1217
+ let o = e.derived(() => e.get(s).length === 0 ? !1 : e.get(s).every((v) => {
1218
+ const p = a(v);
1219
+ return !p || r.visibleAnnotationIds.has(p);
1221
1220
  }));
1222
- function S(g) {
1223
- r.visibleAnnotationIds.has(g) ? r.visibleAnnotationIds.delete(g) : r.visibleAnnotationIds.add(g), r.visibleAnnotationIds = new Set(r.visibleAnnotationIds);
1221
+ function I(v) {
1222
+ r.visibleAnnotationIds.has(v) ? r.visibleAnnotationIds.delete(v) : r.visibleAnnotationIds.add(v), r.visibleAnnotationIds = new Set(r.visibleAnnotationIds);
1224
1223
  }
1225
- function P() {
1226
- if (e.get(a))
1224
+ function b() {
1225
+ if (e.get(o))
1227
1226
  r.visibleAnnotationIds = /* @__PURE__ */ new Set();
1228
1227
  else {
1229
- const g = /* @__PURE__ */ new Set();
1230
- e.get(s).forEach((v) => {
1231
- const C = n(v);
1232
- C && g.add(C);
1233
- }), r.visibleAnnotationIds = g;
1228
+ const v = /* @__PURE__ */ new Set();
1229
+ e.get(s).forEach((p) => {
1230
+ const C = a(p);
1231
+ C && v.add(C);
1232
+ }), r.visibleAnnotationIds = v;
1234
1233
  }
1235
1234
  }
1236
- let _ = e.derived(() => e.get(s).length ? e.get(s).map((g) => {
1237
- let v = "", C = !1;
1238
- if (typeof g.getBody == "function") {
1239
- const h = g.getBody();
1235
+ let w = e.derived(() => e.get(s).length ? e.get(s).map((v) => {
1236
+ let p = "", C = !1;
1237
+ if (typeof v.getBody == "function") {
1238
+ const h = v.getBody();
1240
1239
  if (h && h.length) {
1241
- const c = (d) => {
1242
- const z = d.getValue ? d.getValue() : null;
1243
- return z || "";
1240
+ const l = (c) => {
1241
+ const R = c.getValue ? c.getValue() : null;
1242
+ return R || "";
1244
1243
  };
1245
- v = h.map((d) => c(d)).filter(Boolean).join(" "), C = h.some((d) => {
1246
- const z = d.getFormat ? d.getFormat() : "";
1247
- return z === "text/html" || z === "application/html";
1244
+ p = h.map((c) => l(c)).filter(Boolean).join(" "), C = h.some((c) => {
1245
+ const R = c.getFormat ? c.getFormat() : "";
1246
+ return R === "text/html" || R === "application/html";
1248
1247
  });
1249
1248
  }
1250
- if (!v && typeof g.getLabel == "function") {
1251
- const c = g.getLabel();
1252
- c && (v = c);
1249
+ if (!p && typeof v.getLabel == "function") {
1250
+ const l = v.getLabel();
1251
+ l && (p = l);
1253
1252
  }
1254
1253
  } else {
1255
- const h = (d) => d && (d.chars || d.value || d["cnt:chars"]) || "", c = (d) => d ? d.format === "text/html" || d.type === "TextualBody" : !1;
1256
- if (g.resource ? Array.isArray(g.resource) ? (v = g.resource.map((d) => h(d)).join(" "), g.resource.some((d) => c(d)) && (C = !0)) : (v = h(g.resource), c(g.resource) && (C = !0)) : g.body && (Array.isArray(g.body) ? (v = g.body.map((d) => h(d)).join(" "), g.body.some((d) => c(d)) && (C = !0)) : (v = h(g.body), c(g.body) && (C = !0))), !v) {
1257
- const d = g.label || g.name || g.title;
1258
- d && (v = Array.isArray(d) ? d.join(" ") : d);
1254
+ const h = (c) => c && (c.chars || c.value || c["cnt:chars"]) || "", l = (c) => c ? c.format === "text/html" || c.type === "TextualBody" : !1;
1255
+ if (v.resource ? Array.isArray(v.resource) ? (p = v.resource.map((c) => h(c)).join(" "), v.resource.some((c) => l(c)) && (C = !0)) : (p = h(v.resource), l(v.resource) && (C = !0)) : v.body && (Array.isArray(v.body) ? (p = v.body.map((c) => h(c)).join(" "), v.body.some((c) => l(c)) && (C = !0)) : (p = h(v.body), l(v.body) && (C = !0))), !p) {
1256
+ const c = v.label || v.name || v.title;
1257
+ c && (p = Array.isArray(c) ? c.join(" ") : c);
1259
1258
  }
1260
1259
  }
1261
1260
  return {
1262
- id: n(g),
1263
- content: v,
1261
+ id: a(v),
1262
+ content: p,
1264
1263
  isHtml: C,
1265
- label: (typeof g.getLabel == "function" ? g.getLabel() : g.label) || ""
1264
+ label: (typeof v.getLabel == "function" ? v.getLabel() : v.label) || ""
1266
1265
  };
1267
1266
  }) : []);
1268
- var I = e.comment(), u = e.first_child(I);
1267
+ var P = e.comment(), g = e.first_child(P);
1269
1268
  {
1270
- var R = (g) => {
1271
- var v = fr(), C = e.child(v), h = e.child(C), c = e.child(h);
1272
- c.__click = (w) => {
1273
- w.preventDefault(), P();
1269
+ var O = (v) => {
1270
+ var p = fr(), C = e.child(p), h = e.child(C), l = e.child(h);
1271
+ l.__click = (k) => {
1272
+ k.preventDefault(), b();
1274
1273
  };
1275
- var d = e.child(c);
1274
+ var c = e.child(l);
1276
1275
  {
1277
- var z = (w) => {
1278
- We(w, { size: 16, weight: "bold" });
1279
- }, B = (w) => {
1280
- Ue(w, { size: 16, weight: "bold" });
1276
+ var R = (k) => {
1277
+ We(k, { size: 16, weight: "bold" });
1278
+ }, T = (k) => {
1279
+ Ue(k, { size: 16, weight: "bold" });
1281
1280
  };
1282
- e.if(d, (w) => {
1283
- e.get(a) ? w(z) : w(B, !1);
1281
+ e.if(c, (k) => {
1282
+ e.get(o) ? k(R) : k(T, !1);
1284
1283
  });
1285
1284
  }
1286
- e.reset(c);
1287
- var E = e.sibling(c, 2), p = e.child(E), f = e.sibling(p), o = e.child(f, !0);
1288
- e.reset(f), e.reset(E);
1289
- var M = e.sibling(E, 2);
1290
- wt(M, {
1285
+ e.reset(l);
1286
+ var u = e.sibling(l, 2), A = e.child(u), $ = e.sibling(A), d = e.child($, !0);
1287
+ e.reset($), e.reset(u);
1288
+ var z = e.sibling(u, 2);
1289
+ wt(z, {
1291
1290
  size: 16,
1292
1291
  weight: "bold",
1293
1292
  class: "group-open:rotate-180 transition-transform opacity-80"
1294
1293
  }), e.reset(h);
1295
- var y = e.sibling(h, 2);
1294
+ var S = e.sibling(h, 2);
1296
1295
  e.each(
1297
- y,
1296
+ S,
1298
1297
  21,
1299
- () => e.get(_),
1298
+ () => e.get(w),
1300
1299
  e.index,
1301
- (w, T, L) => {
1302
- const A = e.derived(() => r.visibleAnnotationIds.has(e.get(T).id));
1300
+ (k, D, j) => {
1301
+ const x = e.derived(() => r.visibleAnnotationIds.has(e.get(D).id));
1303
1302
  var m = cr();
1304
- m.__click = (l) => {
1305
- l.preventDefault(), S(e.get(T).id);
1303
+ m.__click = (n) => {
1304
+ n.preventDefault(), I(e.get(D).id);
1306
1305
  };
1307
- var O = e.child(m), x = e.child(O);
1306
+ var y = e.child(m), f = e.child(y);
1308
1307
  {
1309
- var $ = (l) => {
1310
- We(l, { size: 16, weight: "bold" });
1311
- }, W = (l) => {
1312
- Ue(l, { size: 16, weight: "bold" });
1308
+ var G = (n) => {
1309
+ We(n, { size: 16, weight: "bold" });
1310
+ }, V = (n) => {
1311
+ Ue(n, { size: 16, weight: "bold" });
1313
1312
  };
1314
- e.if(x, (l) => {
1315
- e.get(A) ? l($) : l(W, !1);
1313
+ e.if(f, (n) => {
1314
+ e.get(x) ? n(G) : n(V, !1);
1316
1315
  });
1317
1316
  }
1318
- e.reset(O);
1319
- var Q = e.sibling(O, 2), j = e.child(Q), G = e.child(j);
1320
- G.textContent = `#${L + 1}`;
1321
- var q = e.sibling(G, 2);
1317
+ e.reset(y);
1318
+ var U = e.sibling(y, 2), L = e.child(U), B = e.child(L);
1319
+ B.textContent = `#${j + 1}`;
1320
+ var q = e.sibling(B, 2);
1322
1321
  {
1323
- var te = (l) => {
1324
- var b = lr(), N = e.child(b, !0);
1325
- e.reset(b), e.template_effect(() => e.set_text(N, e.get(T).label)), e.append(l, b);
1322
+ var re = (n) => {
1323
+ var _ = lr(), Y = e.child(_, !0);
1324
+ e.reset(_), e.template_effect(() => e.set_text(Y, e.get(D).label)), e.append(n, _);
1326
1325
  };
1327
- e.if(q, (l) => {
1328
- e.get(T).label && e.get(T).label !== e.get(T).content && l(te);
1326
+ e.if(q, (n) => {
1327
+ e.get(D).label && e.get(D).label !== e.get(D).content && n(re);
1329
1328
  });
1330
1329
  }
1331
- e.reset(j);
1332
- var se = e.sibling(j, 2), ne = e.child(se);
1330
+ e.reset(L);
1331
+ var se = e.sibling(L, 2), oe = e.child(se);
1333
1332
  {
1334
- var ae = (l) => {
1335
- var b = e.comment(), N = e.first_child(b);
1336
- e.html(N, () => e.get(T).content), e.append(l, b);
1337
- }, oe = (l) => {
1338
- var b = e.text();
1339
- e.template_effect(() => e.set_text(b, e.get(T).content || "(No content)")), e.append(l, b);
1333
+ var Q = (n) => {
1334
+ var _ = e.comment(), Y = e.first_child(_);
1335
+ e.html(Y, () => e.get(D).content), e.append(n, _);
1336
+ }, H = (n) => {
1337
+ var _ = e.text();
1338
+ e.template_effect(() => e.set_text(_, e.get(D).content || "(No content)")), e.append(n, _);
1340
1339
  };
1341
- e.if(ne, (l) => {
1342
- e.get(T).isHtml ? l(ae) : l(oe, !1);
1340
+ e.if(oe, (n) => {
1341
+ e.get(D).isHtml ? n(Q) : n(H, !1);
1343
1342
  });
1344
1343
  }
1345
- e.reset(se), e.reset(Q), e.reset(m), e.template_effect(() => e.set_class(se, 1, `text-sm prose prose-sm max-w-none prose-p:my-0 prose-a:text-blue-500 wrap-break-word text-left ${e.get(A) ? "" : "opacity-50"}`)), e.append(w, m);
1344
+ e.reset(se), e.reset(U), e.reset(m), e.template_effect(() => e.set_class(se, 1, `text-sm prose prose-sm max-w-none prose-p:my-0 prose-a:text-blue-500 wrap-break-word text-left ${e.get(x) ? "" : "opacity-50"}`)), e.append(k, m);
1346
1345
  },
1347
- (w) => {
1348
- var T = dr();
1349
- e.append(w, T);
1346
+ (k) => {
1347
+ var D = dr();
1348
+ e.append(k, D);
1350
1349
  }
1351
- ), e.reset(y), e.reset(C), e.reset(v), e.template_effect(
1352
- (w, T, L) => {
1353
- e.set_attribute(c, "title", w), e.set_text(p, `${T ?? ""} `), e.set_text(o, L);
1350
+ ), e.reset(S), e.reset(C), e.reset(p), e.template_effect(
1351
+ (k, D, j) => {
1352
+ e.set_attribute(l, "title", k), e.set_text(A, `${D ?? ""} `), e.set_text(d, j);
1354
1353
  },
1355
1354
  [
1356
- () => e.get(a) ? V.hide_all_annotations() : V.show_all_annotations(),
1357
- () => V.annotations_count({ count: e.get(s).length }),
1358
- () => V.visible_count({ count: r.visibleAnnotationIds.size })
1355
+ () => e.get(o) ? E.hide_all_annotations() : E.show_all_annotations(),
1356
+ () => E.annotations_count({ count: e.get(s).length }),
1357
+ () => E.visible_count({ count: r.visibleAnnotationIds.size })
1359
1358
  ]
1360
- ), e.append(g, v);
1359
+ ), e.append(v, p);
1361
1360
  };
1362
- e.if(u, (g) => {
1363
- r.showAnnotations && g(R);
1361
+ e.if(g, (v) => {
1362
+ r.showAnnotations && v(O);
1364
1363
  });
1365
1364
  }
1366
- e.append(i, I), e.pop();
1365
+ e.append(i, P), e.pop();
1367
1366
  }
1368
1367
  e.delegate(["click"]);
1369
1368
  e.create_custom_element(at, {}, [], [], !0);
1370
- var ur = e.from_html('<button class="absolute top-1 right-1 btn btn-error btn-xs btn-circle z-20" aria-label="Close Gallery"><!></button>'), gr = e.from_html('<div><div role="button" tabindex="0" aria-label="Drag Gallery"><div></div></div></div>'), hr = e.from_html('<img class="object-contain w-full h-full" loading="lazy" draggable="false"/>'), vr = e.from_html('<span class="opacity-20 text-4xl">?</span>'), pr = e.from_html('<button><div class="aspect-4/3 bg-base-300 rounded overflow-hidden relative w-full flex items-center justify-center"><!></div> <div class="text-xs font-medium truncate w-full opacity-70 group-hover:opacity-100"><span class="font-bold mr-1"> </span> </div></button>'), mr = e.from_html('<div class="absolute bottom-0 right-0 w-6 h-6 cursor-se-resize resize-handle bg-accent hover:bg-accent-focus transition-colors z-50" style="clip-path: polygon(100% 0, 0 100%, 100% 100%);" role="button" tabindex="0" aria-label="Resize"></div>'), br = e.from_html('<div role="group"><span class="font-bold text-primary opacity-50">Dock Top</span></div> <div role="group"><span class="font-bold text-primary opacity-50">Dock Bottom</span></div> <div role="group"><span class="font-bold text-primary opacity-50 vertical-rl rotate-180" style="writing-mode: vertical-rl;">Dock Left</span></div> <div role="group"><span class="font-bold text-primary opacity-50 vertical-rl rotate-180" style="writing-mode: vertical-rl;">Dock Right</span></div>', 1), _r = e.from_html("<div><!> <!> <div><div></div></div> <!></div> <!>", 1);
1369
+ var ur = e.from_html('<button class="absolute top-1 right-1 btn btn-error btn-xs btn-circle z-20" aria-label="Close Gallery"><!></button>'), gr = e.from_html('<div><div role="button" tabindex="0" aria-label="Drag Gallery"><div></div></div></div>'), vr = e.from_html('<img class="object-contain w-full h-full" loading="lazy" draggable="false"/>'), hr = e.from_html('<span class="opacity-20 text-4xl">?</span>'), pr = e.from_html('<button><div class="aspect-4/3 bg-base-300 rounded overflow-hidden relative w-full flex items-center justify-center"><!></div> <div class="text-xs font-medium truncate w-full opacity-70 group-hover:opacity-100"><span class="font-bold mr-1"> </span> </div></button>'), mr = e.from_html('<div class="absolute bottom-0 right-0 w-6 h-6 cursor-se-resize resize-handle bg-accent hover:bg-accent-focus transition-colors z-50" style="clip-path: polygon(100% 0, 0 100%, 100% 100%);" role="button" tabindex="0" aria-label="Resize"></div>'), br = e.from_html('<div role="group"><span class="font-bold text-primary opacity-50">Dock Top</span></div> <div role="group"><span class="font-bold text-primary opacity-50">Dock Bottom</span></div> <div role="group"><span class="font-bold text-primary opacity-50 vertical-rl rotate-180" style="writing-mode: vertical-rl;">Dock Left</span></div> <div role="group"><span class="font-bold text-primary opacity-50 vertical-rl rotate-180" style="writing-mode: vertical-rl;">Dock Right</span></div>', 1), _r = e.from_html("<div><!> <!> <div><div></div></div> <!></div> <!>", 1);
1371
1370
  function de(i, t) {
1372
1371
  e.push(t, !0);
1373
1372
  const r = fe(ce);
1374
1373
  let s = e.derived(() => {
1375
- var o;
1376
- return ((o = r.config.gallery) == null ? void 0 : o.draggable) ?? !0;
1377
- }), n = e.derived(() => {
1378
- var o;
1379
- return ((o = r.config.gallery) == null ? void 0 : o.showCloseButton) ?? !0;
1380
- }), a = e.prop(t, "canvases", 7), S = e.state(!1), P = { x: 0, y: 0, w: 0, h: 0 }, _ = e.state(null), I = e.derived(() => !a() || !Array.isArray(a()) ? [] : a().map((o, M) => {
1381
- let y = "";
1374
+ var d;
1375
+ return ((d = r.config.gallery) == null ? void 0 : d.draggable) ?? !0;
1376
+ }), a = e.derived(() => {
1377
+ var d;
1378
+ return ((d = r.config.gallery) == null ? void 0 : d.showCloseButton) ?? !0;
1379
+ }), o = e.prop(t, "canvases", 7), I = e.state(!1), b = { x: 0, y: 0, w: 0, h: 0 }, w = e.state(null), P = e.derived(() => !o() || !Array.isArray(o()) ? [] : o().map((d, z) => {
1380
+ let S = "";
1382
1381
  try {
1383
- if (o.getThumbnail) {
1384
- const w = o.getThumbnail();
1385
- w && (y = typeof w == "string" ? w : w.id || w["@id"]);
1382
+ if (d.getThumbnail) {
1383
+ const k = d.getThumbnail();
1384
+ k && (S = typeof k == "string" ? k : k.id || k["@id"]);
1386
1385
  }
1387
- } catch (w) {
1388
- console.warn("Error getting thumbnail", w);
1386
+ } catch (k) {
1387
+ console.warn("Error getting thumbnail", k);
1389
1388
  }
1390
- if (!y) {
1391
- let w = o.getImages();
1392
- if ((!w || !w.length) && o.getContent && (w = o.getContent()), w && w.length > 0) {
1393
- const T = w[0];
1394
- let L = T.getResource ? T.getResource() : null;
1395
- if (!L && T.getBody) {
1396
- const A = T.getBody();
1397
- Array.isArray(A) && A.length > 0 ? L = A[0] : A && (L = A);
1389
+ if (!S) {
1390
+ let k = d.getImages();
1391
+ if ((!k || !k.length) && d.getContent && (k = d.getContent()), k && k.length > 0) {
1392
+ const D = k[0];
1393
+ let j = D.getResource ? D.getResource() : null;
1394
+ if (!j && D.getBody) {
1395
+ const x = D.getBody();
1396
+ Array.isArray(x) && x.length > 0 ? j = x[0] : x && (j = x);
1398
1397
  }
1399
- if (L && !L.id && !L.__jsonld && (!L.getServices || L.getServices().length === 0) && (L = null), !L) {
1400
- const A = T.__jsonld || T;
1401
- A.body && (L = Array.isArray(A.body) ? A.body[0] : A.body);
1398
+ if (j && !j.id && !j.__jsonld && (!j.getServices || j.getServices().length === 0) && (j = null), !j) {
1399
+ const x = D.__jsonld || D;
1400
+ x.body && (j = Array.isArray(x.body) ? x.body[0] : x.body);
1402
1401
  }
1403
- if (L) {
1402
+ if (j) {
1404
1403
  const m = (() => {
1405
- let x = [];
1406
- if (L.getServices && (x = L.getServices()), !x || x.length === 0) {
1407
- const $ = L.__jsonld || L;
1408
- $.service && (x = Array.isArray($.service) ? $.service : [$.service]);
1404
+ let f = [];
1405
+ if (j.getServices && (f = j.getServices()), !f || f.length === 0) {
1406
+ const G = j.__jsonld || j;
1407
+ G.service && (f = Array.isArray(G.service) ? G.service : [G.service]);
1409
1408
  }
1410
- return x;
1409
+ return f;
1411
1410
  })();
1412
- let O = !1;
1411
+ let y = !1;
1413
1412
  if (m.length > 0) {
1414
- const x = m[0];
1415
- let $ = "";
1413
+ const f = m[0];
1414
+ let G = "";
1416
1415
  try {
1417
- if ($ = x.getProfile ? x.getProfile() : x.profile || "", typeof $ == "object" && $) {
1418
- const j = $;
1419
- $ = j.value || j.id || j["@id"] || JSON.stringify(j);
1416
+ if (G = f.getProfile ? f.getProfile() : f.profile || "", typeof G == "object" && G) {
1417
+ const L = G;
1418
+ G = L.value || L.id || L["@id"] || JSON.stringify(L);
1420
1419
  }
1421
1420
  } catch {
1422
1421
  }
1423
- const W = String($ ?? "").toLowerCase();
1424
- (W.includes("level0") || W.includes("level-0")) && (O = !0);
1425
- const Q = x.id || x["@id"];
1426
- O || (y = `${Q}/full/200,/0/default.jpg`);
1422
+ const V = String(G ?? "").toLowerCase();
1423
+ (V.includes("level0") || V.includes("level-0")) && (y = !0);
1424
+ const U = f.id || f["@id"];
1425
+ y || (S = `${U}/full/200,/0/default.jpg`);
1427
1426
  }
1428
- if (!y && (y = L.id || L["@id"], !y)) {
1429
- let x = null;
1430
- if (T.__jsonld && T.__jsonld.body ? x = T.__jsonld.body : T.body && (x = T.body), x) {
1431
- const $ = Array.isArray(x) ? x[0] : x;
1432
- y = $.id || $["@id"];
1427
+ if (!S && (S = j.id || j["@id"], !S)) {
1428
+ let f = null;
1429
+ if (D.__jsonld && D.__jsonld.body ? f = D.__jsonld.body : D.body && (f = D.body), f) {
1430
+ const G = Array.isArray(f) ? f[0] : f;
1431
+ S = G.id || G["@id"];
1433
1432
  }
1434
1433
  }
1435
1434
  }
1436
1435
  }
1437
1436
  }
1438
1437
  return {
1439
- id: o.id,
1440
- label: o.getLabel().length ? o.getLabel()[0].value : `Canvas ${M + 1}`,
1441
- src: y,
1442
- index: M
1438
+ id: d.id,
1439
+ label: d.getLabel().length ? d.getLabel()[0].value : `Canvas ${z + 1}`,
1440
+ src: S,
1441
+ index: z
1443
1442
  };
1444
1443
  }));
1445
- function u(o) {
1444
+ function g(d) {
1446
1445
  if (!r.isGalleryDragging) return;
1447
- let M = o.clientX - r.galleryDragOffset.x, y = o.clientY - r.galleryDragOffset.y;
1448
- const w = Math.max(0, window.innerWidth - r.gallerySize.width), T = Math.max(0, window.innerHeight - r.gallerySize.height);
1449
- M = Math.max(0, Math.min(M, w)), y = Math.max(0, Math.min(y, T)), r.galleryPosition = { x: M, y };
1450
- const L = r.galleryCenterPanelRect;
1451
- if (!L) {
1446
+ let z = d.clientX - r.galleryDragOffset.x, S = d.clientY - r.galleryDragOffset.y;
1447
+ const k = Math.max(0, window.innerWidth - r.gallerySize.width), D = Math.max(0, window.innerHeight - r.gallerySize.height);
1448
+ z = Math.max(0, Math.min(z, k)), S = Math.max(0, Math.min(S, D)), r.galleryPosition = { x: z, y: S };
1449
+ const j = r.galleryCenterPanelRect;
1450
+ if (!j) {
1452
1451
  console.warn("[Gallery] No center panel rect available");
1453
1452
  return;
1454
1453
  }
1455
- const A = o.clientX, m = o.clientY, O = 60;
1456
- r.dragOverSide = null, A >= L.left && A <= L.left + O ? r.dragOverSide = "left" : A <= L.right && A >= L.right - O ? r.dragOverSide = "right" : m >= L.top && m <= L.top + O ? r.dragOverSide = "top" : m <= L.bottom && m >= L.bottom - O && (r.dragOverSide = "bottom");
1454
+ const x = d.clientX, m = d.clientY, y = 60;
1455
+ r.dragOverSide = null, x >= j.left && x <= j.left + y ? r.dragOverSide = "left" : x <= j.right && x >= j.right - y ? r.dragOverSide = "right" : m >= j.top && m <= j.top + y ? r.dragOverSide = "top" : m <= j.bottom && m >= j.bottom - y && (r.dragOverSide = "bottom");
1457
1456
  }
1458
- function R() {
1459
- const o = r.dragOverSide;
1460
- console.log("[Gallery] stopDrag. dropTarget:", o), r.isGalleryDragging = !1, r.dragOverSide = null, window.removeEventListener("mousemove", u), window.removeEventListener("mouseup", R), o && (r.dockSide = o);
1457
+ function O() {
1458
+ const d = r.dragOverSide;
1459
+ console.log("[Gallery] stopDrag. dropTarget:", d), r.isGalleryDragging = !1, r.dragOverSide = null, window.removeEventListener("mousemove", g), window.removeEventListener("mouseup", O), d && (r.dockSide = d);
1461
1460
  }
1462
- function g(o) {
1463
- o.stopPropagation(), e.set(S, !0), P = {
1464
- x: o.clientX,
1465
- y: o.clientY,
1461
+ function v(d) {
1462
+ d.stopPropagation(), e.set(I, !0), b = {
1463
+ x: d.clientX,
1464
+ y: d.clientY,
1466
1465
  w: r.gallerySize.width,
1467
1466
  h: r.gallerySize.height
1468
- }, window.addEventListener("mousemove", v), window.addEventListener("mouseup", C);
1467
+ }, window.addEventListener("mousemove", p), window.addEventListener("mouseup", C);
1469
1468
  }
1470
- function v(o) {
1471
- if (!e.get(S)) return;
1472
- const M = o.clientX - P.x, y = o.clientY - P.y;
1469
+ function p(d) {
1470
+ if (!e.get(I)) return;
1471
+ const z = d.clientX - b.x, S = d.clientY - b.y;
1473
1472
  r.gallerySize = {
1474
- width: Math.max(200, P.w + M),
1475
- height: Math.max(200, P.h + y)
1473
+ width: Math.max(200, b.w + z),
1474
+ height: Math.max(200, b.h + S)
1476
1475
  };
1477
1476
  }
1478
1477
  function C() {
1479
- e.set(S, !1), window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", C);
1478
+ e.set(I, !1), window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", C);
1480
1479
  }
1481
- function h(o) {
1482
- r.canvasId = o;
1480
+ function h(d) {
1481
+ r.canvasId = d;
1483
1482
  }
1484
- let c = e.state(e.proxy(r.dockSide));
1483
+ let l = e.state(e.proxy(r.dockSide));
1485
1484
  e.user_effect(() => {
1486
- const o = r.dockSide;
1487
- e.set(c, o === "none" || o === "top" || o === "bottom" || o === "left" || o === "right" ? o : "none", !0);
1485
+ const d = r.dockSide;
1486
+ e.set(l, d === "none" || d === "top" || d === "bottom" || d === "left" || d === "right" ? d : "none", !0);
1488
1487
  }), e.user_effect(() => {
1489
- r.dockSide !== e.get(c) && (r.dockSide = e.get(c), r.isGalleryDockedBottom = e.get(c) === "bottom", r.isGalleryDockedRight = e.get(c) === "right");
1488
+ r.dockSide !== e.get(l) && (r.dockSide = e.get(l), r.isGalleryDockedBottom = e.get(l) === "bottom", r.isGalleryDockedRight = e.get(l) === "right");
1490
1489
  });
1491
- let d = e.derived(() => e.get(c) === "top" || e.get(c) === "bottom" || e.get(c) === "none" && r.gallerySize.height < 320);
1492
- function z(o) {
1493
- var T, L;
1490
+ let c = e.derived(() => e.get(l) === "top" || e.get(l) === "bottom" || e.get(l) === "none" && r.gallerySize.height < 320);
1491
+ function R(d) {
1492
+ var D, j;
1494
1493
  if (!e.get(
1495
1494
  s
1496
1495
  // Dragging disabled in config
1497
- ) || o.target.closest(".resize-handle")) return;
1498
- const M = e.get(c) !== "none";
1499
- if (M) {
1500
- let A = Math.max(0, o.clientX - 150), m = Math.max(0, o.clientY - 20);
1501
- const O = Math.max(0, window.innerWidth - 300), x = Math.max(0, window.innerHeight - 400);
1502
- A = Math.min(A, O), m = Math.min(m, x), r.galleryPosition = { x: A, y: m }, r.galleryDragOffset = { x: o.clientX - A, y: o.clientY - m };
1496
+ ) || d.target.closest(".resize-handle")) return;
1497
+ const z = e.get(l) !== "none";
1498
+ if (z) {
1499
+ let x = Math.max(0, d.clientX - 150), m = Math.max(0, d.clientY - 20);
1500
+ const y = Math.max(0, window.innerWidth - 300), f = Math.max(0, window.innerHeight - 400);
1501
+ x = Math.min(x, y), m = Math.min(m, f), r.galleryPosition = { x, y: m }, r.galleryDragOffset = { x: d.clientX - x, y: d.clientY - m };
1503
1502
  } else
1504
1503
  r.galleryDragOffset = {
1505
- x: o.clientX - r.galleryPosition.x,
1506
- y: o.clientY - r.galleryPosition.y
1504
+ x: d.clientX - r.galleryPosition.x,
1505
+ y: d.clientY - r.galleryPosition.y
1507
1506
  };
1508
- const y = (T = e.get(_)) == null ? void 0 : T.getRootNode(), w = ((L = y == null ? void 0 : y.getElementById) == null ? void 0 : L.call(y, "triiiceratops-center-panel")) ?? document.getElementById("triiiceratops-center-panel");
1509
- w ? (r.galleryCenterPanelRect = w.getBoundingClientRect(), console.log("[Gallery] Captured center panel rect:", r.galleryCenterPanelRect)) : console.warn("[Gallery] Could not find center panel in startDrag"), r.isGalleryDragging = !0, window.addEventListener("mousemove", u), window.addEventListener("mouseup", R), M && e.set(c, "none");
1507
+ const S = (D = e.get(w)) == null ? void 0 : D.getRootNode(), k = ((j = S == null ? void 0 : S.getElementById) == null ? void 0 : j.call(S, "triiiceratops-center-panel")) ?? document.getElementById("triiiceratops-center-panel");
1508
+ k ? (r.galleryCenterPanelRect = k.getBoundingClientRect(), console.log("[Gallery] Captured center panel rect:", r.galleryCenterPanelRect)) : console.warn("[Gallery] Could not find center panel in startDrag"), r.isGalleryDragging = !0, window.addEventListener("mousemove", g), window.addEventListener("mouseup", O), z && e.set(l, "none");
1510
1509
  }
1511
- var B = {
1510
+ var T = {
1512
1511
  get canvases() {
1513
- return a();
1512
+ return o();
1514
1513
  },
1515
- set canvases(o) {
1516
- a(o), e.flush();
1514
+ set canvases(d) {
1515
+ o(d), e.flush();
1517
1516
  }
1518
- }, E = e.comment(), p = e.first_child(E);
1517
+ }, u = e.comment(), A = e.first_child(u);
1519
1518
  {
1520
- var f = (o) => {
1521
- var M = _r(), y = e.first_child(M), w = e.child(y);
1519
+ var $ = (d) => {
1520
+ var z = _r(), S = e.first_child(z), k = e.child(S);
1522
1521
  {
1523
- var T = (j) => {
1524
- var G = ur();
1525
- G.__click = () => r.toggleThumbnailGallery();
1526
- var q = e.child(G);
1527
- Be(q, { size: 16, weight: "bold" }), e.reset(G), e.append(j, G);
1522
+ var D = (L) => {
1523
+ var B = ur();
1524
+ B.__click = () => r.toggleThumbnailGallery();
1525
+ var q = e.child(B);
1526
+ Fe(q, { size: 16, weight: "bold" }), e.reset(B), e.append(L, B);
1528
1527
  };
1529
- e.if(w, (j) => {
1530
- e.get(n) && j(T);
1528
+ e.if(k, (L) => {
1529
+ e.get(a) && L(D);
1531
1530
  });
1532
1531
  }
1533
- var L = e.sibling(w, 2);
1532
+ var j = e.sibling(k, 2);
1534
1533
  {
1535
- var A = (j) => {
1536
- var G = gr(), q = e.child(G);
1537
- q.__mousedown = z;
1538
- var te = e.child(q);
1539
- e.reset(q), e.reset(G), e.template_effect(() => {
1540
- e.set_class(G, 1, "bg-base-100 flex shrink-0 select-none relative " + (e.get(c) === "bottom" || e.get(c) === "top" ? "flex-row h-full items-center border-r border-base-200" : "flex-col w-full border-b border-base-200")), e.set_class(q, 1, "cursor-move flex items-center justify-center hover:bg-base-200/50 active:bg-base-200 transition-colors " + (e.get(c) === "bottom" || e.get(c) === "top" ? "w-8 h-full" : "h-6 w-full")), e.set_class(te, 1, "bg-base-300 rounded-full " + (e.get(c) === "bottom" || e.get(c) === "top" ? "w-1.5 h-12" : "w-12 h-1.5"));
1541
- }), e.append(j, G);
1534
+ var x = (L) => {
1535
+ var B = gr(), q = e.child(B);
1536
+ q.__mousedown = R;
1537
+ var re = e.child(q);
1538
+ e.reset(q), e.reset(B), e.template_effect(() => {
1539
+ e.set_class(B, 1, "bg-base-100 flex shrink-0 select-none relative " + (e.get(l) === "bottom" || e.get(l) === "top" ? "flex-row h-full items-center border-r border-base-200" : "flex-col w-full border-b border-base-200")), e.set_class(q, 1, "cursor-move flex items-center justify-center hover:bg-base-200/50 active:bg-base-200 transition-colors " + (e.get(l) === "bottom" || e.get(l) === "top" ? "w-8 h-full" : "h-6 w-full")), e.set_class(re, 1, "bg-base-300 rounded-full " + (e.get(l) === "bottom" || e.get(l) === "top" ? "w-1.5 h-12" : "w-12 h-1.5"));
1540
+ }), e.append(L, B);
1542
1541
  };
1543
- e.if(L, (j) => {
1544
- (e.get(s) || e.get(c) === "none") && j(A);
1542
+ e.if(j, (L) => {
1543
+ (e.get(s) || e.get(l) === "none") && L(x);
1545
1544
  });
1546
1545
  }
1547
- var m = e.sibling(L, 2), O = e.child(m);
1548
- e.each(O, 21, () => e.get(I), e.index, (j, G) => {
1546
+ var m = e.sibling(j, 2), y = e.child(m);
1547
+ e.each(y, 21, () => e.get(P), e.index, (L, B) => {
1549
1548
  var q = pr();
1550
- q.__click = () => h(e.get(G).id);
1551
- var te = e.child(q), se = e.child(te);
1549
+ q.__click = () => h(e.get(B).id);
1550
+ var re = e.child(q), se = e.child(re);
1552
1551
  {
1553
- var ne = (F) => {
1554
- var ee = hr();
1552
+ var oe = (N) => {
1553
+ var ie = vr();
1555
1554
  e.template_effect(() => {
1556
- e.set_attribute(ee, "src", e.get(G).src), e.set_attribute(ee, "alt", e.get(G).label);
1557
- }), e.append(F, ee);
1558
- }, ae = (F) => {
1559
- var ee = vr();
1560
- e.append(F, ee);
1555
+ e.set_attribute(ie, "src", e.get(B).src), e.set_attribute(ie, "alt", e.get(B).label);
1556
+ }), e.append(N, ie);
1557
+ }, Q = (N) => {
1558
+ var ie = hr();
1559
+ e.append(N, ie);
1561
1560
  };
1562
- e.if(se, (F) => {
1563
- e.get(G).src ? F(ne) : F(ae, !1);
1561
+ e.if(se, (N) => {
1562
+ e.get(B).src ? N(oe) : N(Q, !1);
1564
1563
  });
1565
1564
  }
1566
- e.reset(te);
1567
- var oe = e.sibling(te, 2), l = e.child(oe), b = e.child(l);
1568
- e.reset(l);
1569
- var N = e.sibling(l);
1570
- e.reset(oe), e.reset(q), e.template_effect(() => {
1571
- e.set_class(q, 1, `group flex flex-col gap-1 p-1 rounded hover:bg-base-200 transition-colors text-left relative shrink-0 ${e.get(d) ? "w-[140px]" : ""} ${r.canvasId === e.get(G).id ? "ring-2 ring-primary bg-primary/5" : ""}`), e.set_attribute(q, "aria-label", `Select canvas ${e.get(G).label ?? ""}`), e.set_text(b, `${e.get(G).index + 1}.`), e.set_text(N, ` ${e.get(G).label ?? ""}`);
1572
- }), e.append(j, q);
1573
- }), e.reset(O), e.reset(m);
1574
- var x = e.sibling(m, 2);
1565
+ e.reset(re);
1566
+ var H = e.sibling(re, 2), n = e.child(H), _ = e.child(n);
1567
+ e.reset(n);
1568
+ var Y = e.sibling(n);
1569
+ e.reset(H), e.reset(q), e.template_effect(() => {
1570
+ e.set_class(q, 1, `group flex flex-col gap-1 p-1 rounded hover:bg-base-200 transition-colors text-left relative shrink-0 ${e.get(c) ? "w-[140px]" : ""} ${r.canvasId === e.get(B).id ? "ring-2 ring-primary bg-primary/5" : ""}`), e.set_attribute(q, "aria-label", `Select canvas ${e.get(B).label ?? ""}`), e.set_text(_, `${e.get(B).index + 1}.`), e.set_text(Y, ` ${e.get(B).label ?? ""}`);
1571
+ }), e.append(L, q);
1572
+ }), e.reset(y), e.reset(m);
1573
+ var f = e.sibling(m, 2);
1575
1574
  {
1576
- var $ = (j) => {
1577
- var G = mr();
1578
- G.__mousedown = g, e.append(j, G);
1575
+ var G = (L) => {
1576
+ var B = mr();
1577
+ B.__mousedown = v, e.append(L, B);
1579
1578
  };
1580
- e.if(x, (j) => {
1581
- e.get(c) === "none" && j($);
1579
+ e.if(f, (L) => {
1580
+ e.get(l) === "none" && L(G);
1582
1581
  });
1583
1582
  }
1584
- e.reset(y), e.bind_this(y, (j) => e.set(_, j), () => e.get(_));
1585
- var W = e.sibling(y, 2);
1583
+ e.reset(S), e.bind_this(S, (L) => e.set(w, L), () => e.get(w));
1584
+ var V = e.sibling(S, 2);
1586
1585
  {
1587
- var Q = (j) => {
1588
- var G = br(), q = e.first_child(G), te = e.sibling(q, 2), se = e.sibling(te, 2), ne = e.sibling(se, 2);
1586
+ var U = (L) => {
1587
+ var B = br(), q = e.first_child(B), re = e.sibling(q, 2), se = e.sibling(re, 2), oe = e.sibling(se, 2);
1589
1588
  e.template_effect(() => {
1590
- e.set_class(q, 1, `absolute top-2 left-2 right-2 h-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-200 ${r.dragOverSide === "top" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(te, 1, `absolute bottom-2 left-2 right-2 h-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-200 ${r.dragOverSide === "bottom" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(se, 1, `absolute top-2 bottom-2 left-2 w-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-200 ${r.dragOverSide === "left" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(ne, 1, `absolute top-2 bottom-2 right-2 w-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-300 ${r.dragOverSide === "right" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`);
1591
- }), e.append(j, G);
1589
+ e.set_class(q, 1, `absolute top-2 left-2 right-2 h-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-200 ${r.dragOverSide === "top" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(re, 1, `absolute bottom-2 left-2 right-2 h-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-200 ${r.dragOverSide === "bottom" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(se, 1, `absolute top-2 bottom-2 left-2 w-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-200 ${r.dragOverSide === "left" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(oe, 1, `absolute top-2 bottom-2 right-2 w-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-300 ${r.dragOverSide === "right" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`);
1590
+ }), e.append(L, B);
1592
1591
  };
1593
- e.if(W, (j) => {
1594
- r.isGalleryDragging && j(Q);
1592
+ e.if(V, (L) => {
1593
+ r.isGalleryDragging && L(U);
1595
1594
  });
1596
1595
  }
1597
1596
  e.template_effect(() => {
1598
- e.set_class(y, 1, (e.get(c) !== "none" ? `relative z-50 bg-base-100 shadow-xl border-base-300 flex transition-all duration-200 select-none w-full h-full
1599
- ${e.get(c) === "bottom" || e.get(c) === "top" ? "flex-row border-t" : ""}
1600
- ${e.get(c) === "left" || e.get(c) === "right" ? "flex-col border-x" : ""}` : "fixed z-900 bg-base-100 shadow-2xl rounded-lg flex flex-col border border-base-300 overflow-hidden select-none") + (r.isGalleryDragging ? " pointer-events-none opacity-80" : "")), e.set_style(y, e.get(c) !== "none" ? "" : `left: ${r.galleryPosition.x}px; top: ${r.galleryPosition.y}px; width: ${r.gallerySize.width}px; height: ${r.gallerySize.height}px;`), e.set_class(m, 1, `flex-1 p-1 bg-base-100 ${e.get(d) ? "overflow-x-auto overflow-y-hidden h-full" : "overflow-y-auto overflow-x-hidden"}`), e.set_class(O, 1, e.clsx(e.get(d) ? "flex flex-row gap-2 h-full items-center" : "grid gap-2")), e.set_style(O, e.get(d) ? "" : "grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));");
1601
- }), e.append(o, M);
1597
+ e.set_class(S, 1, (e.get(l) !== "none" ? `relative z-50 bg-base-100 shadow-xl border-base-300 flex transition-all duration-200 select-none w-full h-full
1598
+ ${e.get(l) === "bottom" || e.get(l) === "top" ? "flex-row border-t" : ""}
1599
+ ${e.get(l) === "left" || e.get(l) === "right" ? "flex-col border-x" : ""}` : "fixed z-900 bg-base-100 shadow-2xl rounded-lg flex flex-col border border-base-300 overflow-hidden select-none") + (r.isGalleryDragging ? " pointer-events-none opacity-80" : "")), e.set_style(S, e.get(l) !== "none" ? "" : `left: ${r.galleryPosition.x}px; top: ${r.galleryPosition.y}px; width: ${r.gallerySize.width}px; height: ${r.gallerySize.height}px;`), e.set_class(m, 1, `flex-1 p-1 bg-base-100 ${e.get(c) ? "overflow-x-auto overflow-y-hidden h-full" : "overflow-y-auto overflow-x-hidden"}`), e.set_class(y, 1, e.clsx(e.get(c) ? "flex flex-row gap-2 h-full items-center" : "grid gap-2")), e.set_style(y, e.get(c) ? "" : "grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));");
1600
+ }), e.append(d, z);
1602
1601
  };
1603
- e.if(p, (o) => {
1604
- r.showThumbnailGallery && o(f);
1602
+ e.if(A, (d) => {
1603
+ r.showThumbnailGallery && d($);
1605
1604
  });
1606
1605
  }
1607
- return e.append(i, E), e.pop(B);
1606
+ return e.append(i, u), e.pop(T);
1608
1607
  }
1609
1608
  e.delegate(["click", "mousedown"]);
1610
1609
  e.create_custom_element(de, { canvases: {} }, [], [], !0);
1611
- var yr = e.from_html("<button><!></button>"), wr = e.from_html('<button class="btn btn-circle btn-lg btn-neutral shadow-lg"><!></button>'), xr = e.from_html('<div class="tooltip tooltip-left"><button><!></button></div>'), Sr = e.from_html('<div class="tooltip tooltip-left"><button><!></button></div>'), Ar = e.from_html('<div class="tooltip tooltip-top"><button><!></button></div>'), Ir = e.from_html('<div class="tooltip tooltip-top"><button><!></button></div>'), Cr = e.from_html('<div class="fab fab-flower fab-top-left absolute z-600 pointer-events-auto flex-col items-end transition-all duration-300 bottom-6 right-6"><div class="tooltip tooltip-left"><div tabindex="0" role="button" class="btn btn-lg btn-primary btn-circle shadow-xl"><span class="sr-only"> </span> <!></div></div> <div class="fab-close tooltip tooltip-top"><!></div> <!> <!> <!> <!></div>');
1610
+ var yr = e.from_html("<button><!></button>"), wr = e.from_html("<button><!></button>"), xr = e.from_html("<button><!></button>"), Sr = e.from_html("<button><!></button>"), Ar = e.from_html("<button><!></button>"), Ir = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Cr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), kr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Pr = e.from_html('<div class="tooltip tooltip-top"><!></div>'), Mr = e.from_html('<div class="tooltip tooltip-top"><!></div>'), Tr = e.from_html('<div class="absolute z-600 bottom-6 right-6"><!> <!> <!> <!> <!></div>'), zr = e.from_html('<button class="btn btn-circle btn-lg btn-neutral shadow-lg"><!></button>'), jr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Lr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Rr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Dr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Er = e.from_html('<div class="fab fab-flower fab-top-left absolute z-600 pointer-events-auto flex-col items-end transition-all duration-300 bottom-6 right-6"><div class="tooltip tooltip-left"><div tabindex="0" role="button" class="btn btn-lg btn-primary btn-circle shadow-xl"><span class="sr-only"> </span> <!></div></div> <div class="fab-close tooltip tooltip-top"><!></div> <!> <!> <!> <!></div>');
1612
1611
  function ot(i, t) {
1613
- e.push(t, !1);
1614
- const r = fe(ce);
1615
- e.init();
1616
- var s = Cr(), n = e.child(s), a = e.child(n), S = e.child(a), P = e.child(S, !0);
1617
- e.reset(S);
1618
- var _ = e.sibling(S, 2);
1619
- Ct(_, { size: 32, weight: "bold" }), e.reset(a), e.reset(n);
1620
- var I = e.sibling(n, 2), u = e.child(I);
1621
- {
1622
- var R = (p) => {
1623
- var f = yr();
1624
- f.__click = () => r.toggleSearchPanel();
1625
- var o = e.child(f);
1626
- Ze(o, { size: 28, weight: "bold" }), e.reset(f), e.template_effect(
1627
- (M) => {
1628
- e.set_attribute(f, "aria-label", M), e.set_class(f, 1, e.clsx([
1629
- "btn btn-circle btn-lg shadow-lg",
1630
- r.showSearchPanel && "btn-primary",
1631
- !r.showSearchPanel && "btn-neutral"
1632
- ]));
1633
- },
1634
- [() => V.toggle_search()]
1635
- ), e.append(p, f);
1636
- }, g = (p) => {
1637
- var f = wr();
1638
- f.__click = (M) => {
1639
- document.activeElement instanceof HTMLElement && document.activeElement.blur();
1612
+ e.push(t, !0);
1613
+ const r = (T) => {
1614
+ var u = yr();
1615
+ u.__click = () => b.toggleSearchPanel();
1616
+ var A = e.child(u);
1617
+ Ze(A, { size: 28, weight: "bold" }), e.reset(u), e.template_effect(
1618
+ ($) => {
1619
+ e.set_attribute(u, "aria-label", $), e.set_class(u, 1, e.clsx([
1620
+ "btn btn-circle btn-lg shadow-lg",
1621
+ b.showSearchPanel ? "btn-primary" : "btn-neutral"
1622
+ ]));
1623
+ },
1624
+ [() => E.toggle_search()]
1625
+ ), e.append(T, u);
1626
+ }, s = (T) => {
1627
+ var u = wr();
1628
+ u.__click = () => b.toggleThumbnailGallery();
1629
+ var A = e.child(u);
1630
+ kt(A, { size: 28, weight: "bold" }), e.reset(u), e.template_effect(
1631
+ ($) => {
1632
+ e.set_attribute(u, "aria-label", $), e.set_class(u, 1, `btn btn-lg btn-circle shadow-lg ${b.showThumbnailGallery ? "btn-info" : "btn-neutral"}`);
1633
+ },
1634
+ [
1635
+ () => b.showThumbnailGallery ? E.hide_gallery() : E.show_gallery()
1636
+ ]
1637
+ ), e.append(T, u);
1638
+ }, a = (T) => {
1639
+ var u = xr();
1640
+ u.__click = () => b.toggleFullScreen();
1641
+ var A = e.child(u);
1642
+ {
1643
+ var $ = (z) => {
1644
+ St(z, { size: 28, weight: "bold" });
1645
+ }, d = (z) => {
1646
+ At(z, { size: 28, weight: "bold" });
1640
1647
  };
1641
- var o = e.child(f);
1642
- Be(o, { size: 28, weight: "bold" }), e.reset(f), e.template_effect((M) => e.set_attribute(f, "aria-label", M), [() => V.close_menu()]), e.append(p, f);
1643
- };
1644
- e.if(u, (p) => {
1645
- var f;
1646
- ((f = r.config.rightMenu) == null ? void 0 : f.showSearch) !== !1 ? p(R) : p(g, !1);
1647
- });
1648
- }
1649
- e.reset(I);
1650
- var v = e.sibling(I, 2);
1651
- {
1652
- var C = (p) => {
1653
- var f = xr(), o = e.child(f);
1654
- o.__click = () => r.toggleThumbnailGallery();
1655
- var M = e.child(o);
1656
- kt(M, { size: 28, weight: "bold" }), e.reset(o), e.reset(f), e.template_effect(
1657
- (y, w) => {
1658
- e.set_attribute(f, "data-tip", y), e.set_attribute(o, "aria-label", w), e.set_class(o, 1, `btn btn-lg btn-circle shadow-lg ${r.showThumbnailGallery ? "btn-info" : "btn-neutral"}`);
1659
- },
1660
- [
1661
- () => r.showThumbnailGallery ? V.hide_gallery() : V.show_gallery(),
1662
- () => r.showThumbnailGallery ? V.hide_gallery() : V.show_gallery()
1663
- ]
1664
- ), e.append(p, f);
1665
- };
1666
- e.if(v, (p) => {
1667
- var f;
1668
- ((f = r.config.rightMenu) == null ? void 0 : f.showGallery) !== !1 && p(C);
1669
- });
1670
- }
1671
- var h = e.sibling(v, 2);
1648
+ e.if(A, (z) => {
1649
+ b.isFullScreen ? z($) : z(d, !1);
1650
+ });
1651
+ }
1652
+ e.reset(u), e.template_effect(() => e.set_class(u, 1, `btn btn-circle btn-lg shadow-lg transition-all duration-300 ease-out ${b.isFullScreen ? "btn-warning" : "btn-neutral"}`)), e.append(T, u);
1653
+ }, o = (T) => {
1654
+ var u = Sr();
1655
+ u.__click = () => b.toggleAnnotations();
1656
+ var A = e.child(u);
1657
+ xt(A, { size: 28, weight: "bold" }), e.reset(u), e.template_effect(
1658
+ ($) => {
1659
+ e.set_attribute(u, "aria-label", $), e.set_class(u, 1, `btn btn-lg btn-circle shadow-lg ${b.showAnnotations ? "btn-error" : "btn-neutral"}`);
1660
+ },
1661
+ [() => E.toggle_annotations()]
1662
+ ), e.append(T, u);
1663
+ }, I = (T) => {
1664
+ var u = Ar();
1665
+ u.__click = () => b.toggleMetadataDialog();
1666
+ var A = e.child(u);
1667
+ It(A, { size: 28, weight: "bold" }), e.reset(u), e.template_effect(
1668
+ ($) => {
1669
+ e.set_attribute(u, "aria-label", $), e.set_class(u, 1, `btn btn-lg btn-circle shadow-lg ${b.showMetadataDialog ? "btn-info" : "btn-neutral"}`);
1670
+ },
1671
+ [() => E.toggle_metadata()]
1672
+ ), e.append(T, u);
1673
+ }, b = fe(ce), w = e.derived(() => b.config.rightMenu || {}), P = e.derived(() => e.get(w).showSearch !== !1), g = e.derived(() => e.get(w).showGallery !== !1), O = e.derived(() => e.get(w).showFullscreen !== !1), v = e.derived(() => e.get(w).showAnnotations !== !1), p = e.derived(() => e.get(w).showInfo !== !1), C = e.derived(() => [
1674
+ e.get(P) ? "search" : null,
1675
+ e.get(g) ? "gallery" : null,
1676
+ e.get(O) ? "fullscreen" : null,
1677
+ e.get(v) ? "annotations" : null,
1678
+ e.get(p) ? "info" : null
1679
+ ].filter((T) => T !== null));
1680
+ var h = e.comment(), l = e.first_child(h);
1672
1681
  {
1673
- var c = (p) => {
1674
- var f = Sr(), o = e.child(f);
1675
- o.__click = () => r.toggleFullScreen();
1676
- var M = e.child(o);
1682
+ var c = (T) => {
1683
+ var u = Tr(), A = e.child(u);
1677
1684
  {
1678
- var y = (T) => {
1679
- St(T, { size: 28, weight: "bold" });
1680
- }, w = (T) => {
1681
- At(T, { size: 28, weight: "bold" });
1685
+ var $ = (y) => {
1686
+ var f = Ir(), G = e.child(f);
1687
+ r(G), e.reset(f), e.template_effect((V) => e.set_attribute(f, "data-tip", V), [() => E.search()]), e.append(y, f);
1682
1688
  };
1683
- e.if(M, (T) => {
1684
- r.isFullScreen ? T(y) : T(w, !1);
1689
+ e.if(A, (y) => {
1690
+ e.get(P) && y($);
1685
1691
  });
1686
1692
  }
1687
- e.reset(o), e.reset(f), e.template_effect(
1688
- (T) => {
1689
- e.set_attribute(f, "data-tip", T), e.set_class(o, 1, `btn btn-circle btn-lg shadow-lg transition-all duration-300 ease-out ${r.isFullScreen ? "btn-warning" : "btn-neutral"}`);
1690
- },
1691
- [
1692
- () => r.isFullScreen ? V.exit_full_screen() : V.enter_full_screen()
1693
- ]
1694
- ), e.append(p, f);
1695
- };
1696
- e.if(h, (p) => {
1697
- var f;
1698
- ((f = r.config.rightMenu) == null ? void 0 : f.showFullscreen) !== !1 && p(c);
1699
- });
1700
- }
1701
- var d = e.sibling(h, 2);
1702
- {
1703
- var z = (p) => {
1704
- var f = Ar(), o = e.child(f);
1705
- o.__click = () => r.toggleAnnotations();
1706
- var M = e.child(o);
1707
- xt(M, { size: 28, weight: "bold" }), e.reset(o), e.reset(f), e.template_effect(
1708
- (y, w) => {
1709
- e.set_attribute(f, "data-tip", y), e.set_attribute(o, "aria-label", w), e.set_class(o, 1, `btn btn-lg btn-circle shadow-lg ${r.showAnnotations ? "btn-error" : "btn-neutral"}`);
1710
- },
1711
- [
1712
- () => r.showAnnotations ? V.hide_annotations() : V.show_annotations(),
1713
- () => V.toggle_annotations()
1714
- ]
1715
- ), e.append(p, f);
1716
- };
1717
- e.if(d, (p) => {
1718
- var f;
1719
- ((f = r.config.rightMenu) == null ? void 0 : f.showAnnotations) !== !1 && p(z);
1720
- });
1721
- }
1722
- var B = e.sibling(d, 2);
1723
- {
1724
- var E = (p) => {
1725
- var f = Ir(), o = e.child(f);
1726
- o.__click = () => r.toggleMetadataDialog();
1727
- var M = e.child(o);
1728
- It(M, { size: 28, weight: "bold" }), e.reset(o), e.reset(f), e.template_effect(
1729
- (y, w) => {
1730
- e.set_attribute(f, "data-tip", y), e.set_attribute(o, "aria-label", w), e.set_class(o, 1, `btn btn-lg btn-circle shadow-lg ${r.showMetadataDialog ? "btn-info" : "btn-neutral"}`);
1731
- },
1732
- [() => V.metadata(), () => V.toggle_metadata()]
1733
- ), e.append(p, f);
1693
+ var d = e.sibling(A, 2);
1694
+ {
1695
+ var z = (y) => {
1696
+ var f = Cr(), G = e.child(f);
1697
+ s(G), e.reset(f), e.template_effect((V) => e.set_attribute(f, "data-tip", V), [
1698
+ () => b.showThumbnailGallery ? E.hide_gallery() : E.show_gallery()
1699
+ ]), e.append(y, f);
1700
+ };
1701
+ e.if(d, (y) => {
1702
+ e.get(g) && y(z);
1703
+ });
1704
+ }
1705
+ var S = e.sibling(d, 2);
1706
+ {
1707
+ var k = (y) => {
1708
+ var f = kr(), G = e.child(f);
1709
+ a(G), e.reset(f), e.template_effect((V) => e.set_attribute(f, "data-tip", V), [
1710
+ () => b.isFullScreen ? E.exit_full_screen() : E.enter_full_screen()
1711
+ ]), e.append(y, f);
1712
+ };
1713
+ e.if(S, (y) => {
1714
+ e.get(O) && y(k);
1715
+ });
1716
+ }
1717
+ var D = e.sibling(S, 2);
1718
+ {
1719
+ var j = (y) => {
1720
+ var f = Pr(), G = e.child(f);
1721
+ o(G), e.reset(f), e.template_effect((V) => e.set_attribute(f, "data-tip", V), [
1722
+ () => b.showAnnotations ? E.hide_annotations() : E.show_annotations()
1723
+ ]), e.append(y, f);
1724
+ };
1725
+ e.if(D, (y) => {
1726
+ e.get(v) && y(j);
1727
+ });
1728
+ }
1729
+ var x = e.sibling(D, 2);
1730
+ {
1731
+ var m = (y) => {
1732
+ var f = Mr(), G = e.child(f);
1733
+ I(G), e.reset(f), e.template_effect((V) => e.set_attribute(f, "data-tip", V), [() => E.metadata()]), e.append(y, f);
1734
+ };
1735
+ e.if(x, (y) => {
1736
+ e.get(p) && y(m);
1737
+ });
1738
+ }
1739
+ e.reset(u), e.append(T, u);
1740
+ }, R = (T) => {
1741
+ var u = e.comment(), A = e.first_child(u);
1742
+ {
1743
+ var $ = (d) => {
1744
+ var z = Er(), S = e.child(z), k = e.child(S), D = e.child(k), j = e.child(D, !0);
1745
+ e.reset(D);
1746
+ var x = e.sibling(D, 2);
1747
+ Ct(x, { size: 32, weight: "bold" }), e.reset(k), e.reset(S);
1748
+ var m = e.sibling(S, 2), y = e.child(m);
1749
+ {
1750
+ var f = (Q) => {
1751
+ r(Q);
1752
+ }, G = (Q) => {
1753
+ var H = zr();
1754
+ H.__click = (_) => {
1755
+ document.activeElement instanceof HTMLElement && document.activeElement.blur();
1756
+ };
1757
+ var n = e.child(H);
1758
+ Fe(n, { size: 28, weight: "bold" }), e.reset(H), e.template_effect((_) => e.set_attribute(H, "aria-label", _), [() => E.close_menu()]), e.append(Q, H);
1759
+ };
1760
+ e.if(y, (Q) => {
1761
+ e.get(P) ? Q(f) : Q(G, !1);
1762
+ });
1763
+ }
1764
+ e.reset(m);
1765
+ var V = e.sibling(m, 2);
1766
+ {
1767
+ var U = (Q) => {
1768
+ var H = jr(), n = e.child(H);
1769
+ s(n), e.reset(H), e.template_effect((_) => e.set_attribute(H, "data-tip", _), [
1770
+ () => b.showThumbnailGallery ? E.hide_gallery() : E.show_gallery()
1771
+ ]), e.append(Q, H);
1772
+ };
1773
+ e.if(V, (Q) => {
1774
+ e.get(g) && Q(U);
1775
+ });
1776
+ }
1777
+ var L = e.sibling(V, 2);
1778
+ {
1779
+ var B = (Q) => {
1780
+ var H = Lr(), n = e.child(H);
1781
+ a(n), e.reset(H), e.template_effect((_) => e.set_attribute(H, "data-tip", _), [
1782
+ () => b.isFullScreen ? E.exit_full_screen() : E.enter_full_screen()
1783
+ ]), e.append(Q, H);
1784
+ };
1785
+ e.if(L, (Q) => {
1786
+ e.get(O) && Q(B);
1787
+ });
1788
+ }
1789
+ var q = e.sibling(L, 2);
1790
+ {
1791
+ var re = (Q) => {
1792
+ var H = Rr(), n = e.child(H);
1793
+ o(n), e.reset(H), e.template_effect((_) => e.set_attribute(H, "data-tip", _), [
1794
+ () => b.showAnnotations ? E.hide_annotations() : E.show_annotations()
1795
+ ]), e.append(Q, H);
1796
+ };
1797
+ e.if(q, (Q) => {
1798
+ e.get(v) && Q(re);
1799
+ });
1800
+ }
1801
+ var se = e.sibling(q, 2);
1802
+ {
1803
+ var oe = (Q) => {
1804
+ var H = Dr(), n = e.child(H);
1805
+ I(n), e.reset(H), e.template_effect((_) => e.set_attribute(H, "data-tip", _), [() => E.metadata()]), e.append(Q, H);
1806
+ };
1807
+ e.if(se, (Q) => {
1808
+ e.get(p) && Q(oe);
1809
+ });
1810
+ }
1811
+ e.reset(z), e.template_effect(
1812
+ (Q, H, n) => {
1813
+ e.set_attribute(S, "data-tip", Q), e.set_text(j, H), e.set_attribute(m, "data-tip", n);
1814
+ },
1815
+ [
1816
+ () => E.menu(),
1817
+ () => E.menu(),
1818
+ () => e.get(P) ? E.search() : E.close_menu()
1819
+ ]
1820
+ ), e.append(d, z);
1821
+ };
1822
+ e.if(
1823
+ A,
1824
+ (d) => {
1825
+ e.get(C).length > 1 && d($);
1826
+ },
1827
+ !0
1828
+ );
1829
+ }
1830
+ e.append(T, u);
1734
1831
  };
1735
- e.if(B, (p) => {
1736
- var f;
1737
- ((f = r.config.rightMenu) == null ? void 0 : f.showInfo) !== !1 && p(E);
1832
+ e.if(l, (T) => {
1833
+ e.get(C).length === 1 ? T(c) : T(R, !1);
1738
1834
  });
1739
1835
  }
1740
- e.reset(s), e.template_effect(
1741
- (p, f, o) => {
1742
- e.set_attribute(n, "data-tip", p), e.set_text(P, f), e.set_attribute(I, "data-tip", o);
1743
- },
1744
- [
1745
- () => V.menu(),
1746
- () => V.menu(),
1747
- () => {
1748
- var p;
1749
- return ((p = r.config.rightMenu) == null ? void 0 : p.showSearch) === !1 ? V.close_menu() : V.search();
1750
- }
1751
- ]
1752
- ), e.append(i, s), e.pop();
1836
+ e.append(i, h), e.pop();
1753
1837
  }
1754
1838
  e.delegate(["click"]);
1755
1839
  e.create_custom_element(ot, {}, [], [], !0);
1756
- var kr = e.from_html('<div class="tooltip tooltip-right"><button><!></button></div>'), Pr = e.from_html('<div class="absolute left-6 bottom-6 z-50 pointer-events-auto flex flex-col items-start transition-all duration-300"><div></div> <div class="tooltip tooltip-right"><button><!></button></div></div>');
1840
+ var Gr = e.from_html('<div class="tooltip tooltip-right"><button><!></button></div>'), Or = e.from_html('<div class="absolute left-6 bottom-6 z-50 pointer-events-auto flex flex-col items-start transition-all duration-300"><div></div> <div class="tooltip tooltip-right"><button><!></button></div></div>');
1757
1841
  function lt(i, t) {
1758
1842
  e.push(t, !0);
1759
1843
  const r = fe(ce);
1760
- let s = e.derived(() => [...r.pluginMenuButtons].sort((I, u) => (I.order ?? 100) - (u.order ?? 100))), n = e.state(!1);
1761
- function a() {
1762
- e.set(n, !e.get(n));
1844
+ let s = e.derived(() => [...r.pluginMenuButtons].sort((P, g) => (P.order ?? 100) - (g.order ?? 100))), a = e.state(!1);
1845
+ function o() {
1846
+ e.set(a, !e.get(a));
1763
1847
  }
1764
- var S = e.comment(), P = e.first_child(S);
1848
+ var I = e.comment(), b = e.first_child(I);
1765
1849
  {
1766
- var _ = (I) => {
1767
- var u = Pr(), R = e.child(u);
1768
- e.each(R, 21, () => e.get(s), (d) => d.id, (d, z) => {
1769
- const B = e.derived(() => e.get(z).icon);
1770
- var E = kr(), p = e.child(E);
1771
- p.__click = () => {
1772
- e.get(z).onClick(), e.set(n, !1);
1850
+ var w = (P) => {
1851
+ var g = Or(), O = e.child(g);
1852
+ e.each(O, 21, () => e.get(s), (c) => c.id, (c, R) => {
1853
+ const T = e.derived(() => e.get(R).icon);
1854
+ var u = Gr(), A = e.child(u);
1855
+ A.__click = () => {
1856
+ e.get(R).onClick(), e.set(a, !1);
1773
1857
  };
1774
- var f = e.child(p);
1775
- e.component(f, () => e.get(B), (o, M) => {
1776
- M(o, { size: 28, weight: "bold" });
1777
- }), e.reset(p), e.reset(E), e.template_effect(
1778
- (o) => {
1779
- e.set_attribute(E, "data-tip", e.get(z).tooltip), e.set_attribute(p, "aria-label", e.get(z).tooltip), e.set_class(p, 1, `btn btn-lg btn-circle shadow-lg ${o ?? ""}`);
1858
+ var $ = e.child(A);
1859
+ e.component($, () => e.get(T), (d, z) => {
1860
+ z(d, { size: 28, weight: "bold" });
1861
+ }), e.reset(A), e.reset(u), e.template_effect(
1862
+ (d) => {
1863
+ e.set_attribute(u, "data-tip", e.get(R).tooltip), e.set_attribute(A, "aria-label", e.get(R).tooltip), e.set_class(A, 1, `btn btn-lg btn-circle shadow-lg ${d ?? ""}`);
1780
1864
  },
1781
1865
  [
1782
1866
  () => {
1783
- var o, M;
1784
- return (M = (o = e.get(z)).isActive) != null && M.call(o) ? e.get(z).activeClass ?? "btn-primary" : "btn-neutral";
1867
+ var d, z;
1868
+ return (z = (d = e.get(R)).isActive) != null && z.call(d) ? e.get(R).activeClass ?? "btn-primary" : "btn-neutral";
1785
1869
  }
1786
1870
  ]
1787
- ), e.append(d, E);
1788
- }), e.reset(R);
1789
- var g = e.sibling(R, 2), v = e.child(g);
1790
- v.__click = a;
1791
- var C = e.child(v);
1871
+ ), e.append(c, u);
1872
+ }), e.reset(O);
1873
+ var v = e.sibling(O, 2), p = e.child(v);
1874
+ p.__click = o;
1875
+ var C = e.child(p);
1792
1876
  {
1793
- var h = (d) => {
1794
- Be(d, { size: 28, weight: "bold" });
1795
- }, c = (d) => {
1796
- Pt(d, { size: 28, weight: "bold" });
1877
+ var h = (c) => {
1878
+ Fe(c, { size: 28, weight: "bold" });
1879
+ }, l = (c) => {
1880
+ Pt(c, { size: 28, weight: "bold" });
1797
1881
  };
1798
- e.if(C, (d) => {
1799
- e.get(n) ? d(h) : d(c, !1);
1882
+ e.if(C, (c) => {
1883
+ e.get(a) ? c(h) : c(l, !1);
1800
1884
  });
1801
1885
  }
1802
- e.reset(v), e.reset(g), e.reset(u), e.template_effect(
1803
- (d, z) => {
1804
- e.set_class(R, 1, `flex flex-col-reverse gap-3 mb-3 transition-all duration-300 origin-bottom ${e.get(n) ? "opacity-100 translate-y-0 scale-100" : "opacity-0 translate-y-4 scale-90 pointer-events-none"}`), e.set_attribute(g, "data-tip", d), e.set_class(v, 1, `btn btn-lg btn-secondary btn-circle shadow-xl transition-transform duration-300 ${e.get(n) ? "rotate-90" : ""}`), e.set_attribute(v, "aria-label", z);
1886
+ e.reset(p), e.reset(v), e.reset(g), e.template_effect(
1887
+ (c, R) => {
1888
+ e.set_class(O, 1, `flex flex-col-reverse gap-3 mb-3 transition-all duration-300 origin-bottom ${e.get(a) ? "opacity-100 translate-y-0 scale-100" : "opacity-0 translate-y-4 scale-90 pointer-events-none"}`), e.set_attribute(v, "data-tip", c), e.set_class(p, 1, `btn btn-lg btn-secondary btn-circle shadow-xl transition-transform duration-300 ${e.get(a) ? "rotate-90" : ""}`), e.set_attribute(p, "aria-label", R);
1805
1889
  },
1806
- [() => V.plugins_tooltip(), () => V.plugins_tooltip()]
1807
- ), e.append(I, u);
1890
+ [() => E.plugins_tooltip(), () => E.plugins_tooltip()]
1891
+ ), e.append(P, g);
1808
1892
  };
1809
- e.if(P, (I) => {
1810
- e.get(s).length > 0 && I(_);
1893
+ e.if(b, (P) => {
1894
+ e.get(s).length > 0 && P(w);
1811
1895
  });
1812
1896
  }
1813
- e.append(i, S), e.pop();
1897
+ e.append(i, I), e.pop();
1814
1898
  }
1815
1899
  e.delegate(["click"]);
1816
1900
  e.create_custom_element(lt, {}, [], [], !0);
1817
- var Mr = e.from_html('<div class="mb-6 prose"><p><!></p></div>'), Tr = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><!></dd>', 1), zr = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><a target="_blank" rel="noreferrer" class="link link-primary break-all"> </a></dd>', 1), jr = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><!></dd>', 1), Lr = e.from_html('<dialog class="modal"><div class="modal-box w-11/12 max-w-5xl"><form method="dialog"><button class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2">✕</button></form> <h3 class="font-bold text-lg mb-4"> </h3> <div class="py-4 overflow-y-auto max-h-[70vh]"><!> <dl class="grid grid-cols-1 md:grid-cols-[200px_1fr]"><!> <!> <!></dl></div> <div class="modal-action"><form method="dialog"><button class="btn"> </button></form></div></div> <form method="dialog" class="modal-backdrop"><button> </button></form></dialog>');
1901
+ var Br = e.from_html('<div class="mb-6 prose"><p><!></p></div>'), $r = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><!></dd>', 1), Fr = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><a target="_blank" rel="noreferrer" class="link link-primary break-all"> </a></dd>', 1), Vr = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><!></dd>', 1), Nr = e.from_html('<dialog class="modal"><div class="modal-box w-11/12 max-w-5xl"><form method="dialog"><button class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2">✕</button></form> <h3 class="font-bold text-lg mb-4"> </h3> <div class="py-4 overflow-y-auto max-h-[70vh]"><!> <dl class="grid grid-cols-1 md:grid-cols-[200px_1fr]"><!> <!> <!></dl></div> <div class="modal-action"><form method="dialog"><button class="btn"> </button></form></div></div> <form method="dialog" class="modal-backdrop"><button> </button></form></dialog>');
1818
1902
  function ct(i, t) {
1819
1903
  e.push(t, !0);
1820
1904
  const r = fe(ce);
1821
- let s = e.derived(() => r.manifest), n = e.derived(() => {
1905
+ let s = e.derived(() => r.manifest), a = e.derived(() => {
1822
1906
  const m = yt.current;
1823
1907
  if (!e.get(s)) return [];
1824
- const O = e.get(s).getMetadata();
1825
- return O ? O.map((x) => {
1826
- let $ = "", W = "";
1827
- const Q = (j) => {
1828
- if (typeof j == "string") return j;
1829
- if (Array.isArray(j)) {
1830
- let G = j.find((q) => q.locale === m || q.language === m);
1831
- return G || (G = j.find((q) => q.locale === "en" || q.language === "en")), G || (G = j.find((q) => !q.locale && !q.language)), G || (G = j[0]), G ? G.value : "";
1908
+ const y = e.get(s).getMetadata();
1909
+ return y ? y.map((f) => {
1910
+ let G = "", V = "";
1911
+ const U = (L) => {
1912
+ if (typeof L == "string") return L;
1913
+ if (Array.isArray(L)) {
1914
+ let B = L.find((q) => q.locale === m || q.language === m);
1915
+ return B || (B = L.find((q) => q.locale === "en" || q.language === "en")), B || (B = L.find((q) => !q.locale && !q.language)), B || (B = L[0]), B ? B.value : "";
1832
1916
  }
1833
- return String(j);
1917
+ return String(L);
1834
1918
  };
1835
- return x.getLabel ? $ = Q(x.getLabel()) : x.label && ($ = Q(x.label)), x.getValue ? W = Q(x.getValue()) : x.value && (W = Q(x.value)), { label: $, value: W };
1919
+ return f.getLabel ? G = U(f.getLabel()) : f.label && (G = U(f.label)), f.getValue ? V = U(f.getValue()) : f.value && (V = U(f.value)), { label: G, value: V };
1836
1920
  }) : [];
1837
- }), a = e.derived(() => e.get(s) ? e.get(s).getDescription() : ""), S = e.derived(() => {
1921
+ }), o = e.derived(() => e.get(s) ? e.get(s).getDescription() : ""), I = e.derived(() => {
1838
1922
  var m;
1839
1923
  return e.get(s) ? (m = e.get(s).getRequiredStatement()) == null ? void 0 : m.getValue() : "";
1840
- }), P = e.derived(() => e.get(s) ? e.get(s).getLicense() : "");
1841
- var _ = Lr(), I = e.child(_), u = e.child(I), R = e.child(u);
1842
- R.__click = () => r.toggleMetadataDialog(), e.reset(u);
1843
- var g = e.sibling(u, 2), v = e.child(g, !0);
1844
- e.reset(g);
1845
- var C = e.sibling(g, 2), h = e.child(C);
1924
+ }), b = e.derived(() => e.get(s) ? e.get(s).getLicense() : "");
1925
+ var w = Nr(), P = e.child(w), g = e.child(P), O = e.child(g);
1926
+ O.__click = () => r.toggleMetadataDialog(), e.reset(g);
1927
+ var v = e.sibling(g, 2), p = e.child(v, !0);
1928
+ e.reset(v);
1929
+ var C = e.sibling(v, 2), h = e.child(C);
1846
1930
  {
1847
- var c = (m) => {
1848
- var O = Mr(), x = e.child(O), $ = e.child(x);
1849
- e.html($, () => e.get(a)), e.reset(x), e.reset(O), e.append(m, O);
1931
+ var l = (m) => {
1932
+ var y = Br(), f = e.child(y), G = e.child(f);
1933
+ e.html(G, () => e.get(o)), e.reset(f), e.reset(y), e.append(m, y);
1850
1934
  };
1851
1935
  e.if(h, (m) => {
1852
- e.get(a) && m(c);
1936
+ e.get(o) && m(l);
1853
1937
  });
1854
1938
  }
1855
- var d = e.sibling(h, 2), z = e.child(d);
1939
+ var c = e.sibling(h, 2), R = e.child(c);
1856
1940
  {
1857
- var B = (m) => {
1858
- var O = Tr(), x = e.first_child(O), $ = e.child(x, !0);
1859
- e.reset(x);
1860
- var W = e.sibling(x, 2), Q = e.child(W);
1861
- e.html(Q, () => e.get(S)), e.reset(W), e.template_effect((j) => e.set_text($, j), [() => V.attribution()]), e.append(m, O);
1941
+ var T = (m) => {
1942
+ var y = $r(), f = e.first_child(y), G = e.child(f, !0);
1943
+ e.reset(f);
1944
+ var V = e.sibling(f, 2), U = e.child(V);
1945
+ e.html(U, () => e.get(I)), e.reset(V), e.template_effect((L) => e.set_text(G, L), [() => E.attribution()]), e.append(m, y);
1862
1946
  };
1863
- e.if(z, (m) => {
1864
- e.get(S) && m(B);
1947
+ e.if(R, (m) => {
1948
+ e.get(I) && m(T);
1865
1949
  });
1866
1950
  }
1867
- var E = e.sibling(z, 2);
1951
+ var u = e.sibling(R, 2);
1868
1952
  {
1869
- var p = (m) => {
1870
- var O = zr(), x = e.first_child(O), $ = e.child(x, !0);
1871
- e.reset(x);
1872
- var W = e.sibling(x, 2), Q = e.child(W), j = e.child(Q, !0);
1873
- e.reset(Q), e.reset(W), e.template_effect(
1874
- (G) => {
1875
- e.set_text($, G), e.set_attribute(Q, "href", e.get(P)), e.set_text(j, e.get(P));
1953
+ var A = (m) => {
1954
+ var y = Fr(), f = e.first_child(y), G = e.child(f, !0);
1955
+ e.reset(f);
1956
+ var V = e.sibling(f, 2), U = e.child(V), L = e.child(U, !0);
1957
+ e.reset(U), e.reset(V), e.template_effect(
1958
+ (B) => {
1959
+ e.set_text(G, B), e.set_attribute(U, "href", e.get(b)), e.set_text(L, e.get(b));
1876
1960
  },
1877
- [() => V.license()]
1878
- ), e.append(m, O);
1961
+ [() => E.license()]
1962
+ ), e.append(m, y);
1879
1963
  };
1880
- e.if(E, (m) => {
1881
- e.get(P) && m(p);
1964
+ e.if(u, (m) => {
1965
+ e.get(b) && m(A);
1882
1966
  });
1883
1967
  }
1884
- var f = e.sibling(E, 2);
1885
- e.each(f, 17, () => e.get(n), e.index, (m, O) => {
1886
- var x = jr(), $ = e.first_child(x), W = e.child($, !0);
1887
- e.reset($);
1888
- var Q = e.sibling($, 2), j = e.child(Q);
1889
- e.html(j, () => e.get(O).value), e.reset(Q), e.template_effect(() => e.set_text(W, e.get(O).label)), e.append(m, x);
1890
- }), e.reset(d), e.reset(C);
1891
- var o = e.sibling(C, 2), M = e.child(o), y = e.child(M);
1892
- y.__click = () => r.toggleMetadataDialog();
1893
- var w = e.child(y, !0);
1894
- e.reset(y), e.reset(M), e.reset(o), e.reset(I);
1895
- var T = e.sibling(I, 2), L = e.child(T);
1896
- L.__click = () => r.toggleMetadataDialog();
1897
- var A = e.child(L, !0);
1898
- e.reset(L), e.reset(T), e.reset(_), e.template_effect(
1899
- (m, O, x) => {
1900
- _.open = r.showMetadataDialog, e.set_text(v, m), e.set_text(w, O), e.set_text(A, x);
1968
+ var $ = e.sibling(u, 2);
1969
+ e.each($, 17, () => e.get(a), e.index, (m, y) => {
1970
+ var f = Vr(), G = e.first_child(f), V = e.child(G, !0);
1971
+ e.reset(G);
1972
+ var U = e.sibling(G, 2), L = e.child(U);
1973
+ e.html(L, () => e.get(y).value), e.reset(U), e.template_effect(() => e.set_text(V, e.get(y).label)), e.append(m, f);
1974
+ }), e.reset(c), e.reset(C);
1975
+ var d = e.sibling(C, 2), z = e.child(d), S = e.child(z);
1976
+ S.__click = () => r.toggleMetadataDialog();
1977
+ var k = e.child(S, !0);
1978
+ e.reset(S), e.reset(z), e.reset(d), e.reset(P);
1979
+ var D = e.sibling(P, 2), j = e.child(D);
1980
+ j.__click = () => r.toggleMetadataDialog();
1981
+ var x = e.child(j, !0);
1982
+ e.reset(j), e.reset(D), e.reset(w), e.template_effect(
1983
+ (m, y, f) => {
1984
+ w.open = r.showMetadataDialog, e.set_text(p, m), e.set_text(k, y), e.set_text(x, f);
1901
1985
  },
1902
1986
  [
1903
- () => e.get(s) ? e.get(s).getLabel().length && e.get(s).getLabel()[0] ? e.get(s).getLabel()[0].value : V.metadata_label_fallback() : V.loading(),
1904
- () => V.close(),
1905
- () => V.close()
1987
+ () => e.get(s) ? e.get(s).getLabel().length && e.get(s).getLabel()[0] ? e.get(s).getLabel()[0].value : E.metadata_label_fallback() : E.loading(),
1988
+ () => E.close(),
1989
+ () => E.close()
1906
1990
  ]
1907
- ), e.append(i, _), e.pop();
1991
+ ), e.append(i, w), e.pop();
1908
1992
  }
1909
1993
  e.delegate(["click"]);
1910
1994
  e.create_custom_element(ct, {}, [], [], !0);
1911
- var Rr = e.from_html('<button class="btn btn-sm btn-circle btn-ghost"><!></button>'), Dr = e.from_html('<span class="loading loading-spinner loading-xs"></span>'), Er = e.from_html('<div class="flex justify-center p-8"><span class="loading loading-spinner loading-lg text-primary"></span></div>'), Or = e.from_html('<div class="text-center opacity-50 p-4"> </div>'), Gr = e.from_html('<div class="text-center opacity-50 p-4 text-sm"> </div>'), Vr = e.from_html('<div class="leading-relaxed"><span><!></span> <span class="bg-yellow-200 text-yellow-900 font-bold px-0.5 rounded"><!></span> <span><!></span></div>'), Fr = e.from_html('<div class="leading-relaxed"> </div>'), Br = e.from_html('<button class="w-full text-left card bg-base-100 shadow hover:shadow-md transition-all p-4 text-sm group border border-transparent hover:border-primary focus:outline-none focus:ring-2 focus:ring-primary"><div class="flex justify-between items-baseline mb-1"><span class="font-bold text-xs opacity-70 bg-base-200 px-1.5 py-0.5 rounded"> </span></div> <!></button>'), $r = e.from_html('<div class="text-xs font-bold opacity-50 uppercase tracking-wider pb-2"> </div> <!>', 1), Nr = e.from_html('<div class="h-full w-80 bg-base-200 shadow-2xl z-100 flex flex-col border-l border-base-300" role="dialog"><div class="flex items-center justify-between p-4 border-b border-base-300"><h2 class="font-bold text-lg"> </h2> <!></div> <div class="p-4 border-b border-base-300 shrink-0"><div class="relative w-full"><input type="text" class="input input-bordered w-full pr-12"/> <button class="btn btn-primary absolute right-0 top-0 h-full rounded-l-none"><!></button></div></div> <div class="flex-1 overflow-y-auto p-4 space-y-4"><!></div></div>');
1995
+ var Hr = e.from_html('<button class="btn btn-sm btn-circle btn-ghost"><!></button>'), Yr = e.from_html('<span class="loading loading-spinner loading-xs"></span>'), Xr = e.from_html('<div class="flex justify-center p-8"><span class="loading loading-spinner loading-lg text-primary"></span></div>'), qr = e.from_html('<div class="text-center opacity-50 p-4"> </div>'), Qr = e.from_html('<div class="text-center opacity-50 p-4 text-sm"> </div>'), Wr = e.from_html('<div class="leading-relaxed"><span><!></span> <span class="bg-yellow-200 text-yellow-900 font-bold px-0.5 rounded"><!></span> <span><!></span></div>'), Ur = e.from_html('<div class="leading-relaxed"> </div>'), Jr = e.from_html('<button class="w-full text-left card bg-base-100 shadow hover:shadow-md transition-all p-4 text-sm group border border-transparent hover:border-primary focus:outline-none focus:ring-2 focus:ring-primary"><div class="flex justify-between items-baseline mb-1"><span class="font-bold text-xs opacity-70 bg-base-200 px-1.5 py-0.5 rounded"> </span></div> <!></button>'), Kr = e.from_html('<div class="text-xs font-bold opacity-50 uppercase tracking-wider pb-2"> </div> <!>', 1), Zr = e.from_html('<div class="h-full w-80 bg-base-200 shadow-2xl z-100 flex flex-col border-l border-base-300" role="dialog"><div class="flex items-center justify-between p-4 border-b border-base-300"><h2 class="font-bold text-lg"> </h2> <!></div> <div class="p-4 border-b border-base-300 shrink-0"><div class="relative w-full"><input type="text" class="input input-bordered w-full pr-12"/> <button class="btn btn-primary absolute right-0 top-0 h-full rounded-l-none"><!></button></div></div> <div class="flex-1 overflow-y-auto p-4 space-y-4"><!></div></div>');
1912
1996
  function dt(i, t) {
1913
1997
  e.push(t, !0);
1914
1998
  const r = fe(ce);
1915
- let s = e.state(""), n = e.derived(() => {
1916
- var R;
1917
- return ((R = r.config.search) == null ? void 0 : R.showCloseButton) ?? !0;
1999
+ let s = e.state(""), a = e.derived(() => {
2000
+ var O;
2001
+ return ((O = r.config.search) == null ? void 0 : O.showCloseButton) ?? !0;
1918
2002
  });
1919
- function a() {
2003
+ function o() {
1920
2004
  r.search(e.get(s));
1921
2005
  }
1922
- function S(R) {
1923
- R.key === "Enter" && a();
2006
+ function I(O) {
2007
+ O.key === "Enter" && o();
1924
2008
  }
1925
- function P(R) {
1926
- const g = r.canvases[R.canvasIndex];
1927
- g && (r.canvasId = g.id);
2009
+ function b(O) {
2010
+ const v = r.canvases[O.canvasIndex];
2011
+ v && (r.canvasId = v.id);
1928
2012
  }
1929
- var _ = e.comment(), I = e.first_child(_);
2013
+ var w = e.comment(), P = e.first_child(w);
1930
2014
  {
1931
- var u = (R) => {
1932
- var g = Nr(), v = e.child(g), C = e.child(v), h = e.child(C, !0);
2015
+ var g = (O) => {
2016
+ var v = Zr(), p = e.child(v), C = e.child(p), h = e.child(C, !0);
1933
2017
  e.reset(C);
1934
- var c = e.sibling(C, 2);
2018
+ var l = e.sibling(C, 2);
1935
2019
  {
1936
- var d = (A) => {
1937
- var m = Rr();
2020
+ var c = (x) => {
2021
+ var m = Hr();
1938
2022
  m.__click = () => r.toggleSearchPanel();
1939
- var O = e.child(m);
1940
- Be(O, { size: 20, weight: "bold" }), e.reset(m), e.template_effect((x) => e.set_attribute(m, "aria-label", x), [() => V.close_search()]), e.append(A, m);
2023
+ var y = e.child(m);
2024
+ Fe(y, { size: 20, weight: "bold" }), e.reset(m), e.template_effect((f) => e.set_attribute(m, "aria-label", f), [() => E.close_search()]), e.append(x, m);
1941
2025
  };
1942
- e.if(c, (A) => {
1943
- e.get(n) && A(d);
2026
+ e.if(l, (x) => {
2027
+ e.get(a) && x(c);
1944
2028
  });
1945
2029
  }
1946
- e.reset(v);
1947
- var z = e.sibling(v, 2), B = e.child(z), E = e.child(B);
1948
- e.remove_input_defaults(E), E.__keydown = S;
1949
- var p = e.sibling(E, 2);
1950
- p.__click = a;
1951
- var f = e.child(p);
2030
+ e.reset(p);
2031
+ var R = e.sibling(p, 2), T = e.child(R), u = e.child(T);
2032
+ e.remove_input_defaults(u), u.__keydown = I;
2033
+ var A = e.sibling(u, 2);
2034
+ A.__click = o;
2035
+ var $ = e.child(A);
1952
2036
  {
1953
- var o = (A) => {
1954
- var m = Dr();
1955
- e.append(A, m);
1956
- }, M = (A) => {
1957
- Ze(A, { size: 20, weight: "bold" });
2037
+ var d = (x) => {
2038
+ var m = Yr();
2039
+ e.append(x, m);
2040
+ }, z = (x) => {
2041
+ Ze(x, { size: 20, weight: "bold" });
1958
2042
  };
1959
- e.if(f, (A) => {
1960
- r.isSearching ? A(o) : A(M, !1);
2043
+ e.if($, (x) => {
2044
+ r.isSearching ? x(d) : x(z, !1);
1961
2045
  });
1962
2046
  }
1963
- e.reset(p), e.reset(B), e.reset(z);
1964
- var y = e.sibling(z, 2), w = e.child(y);
2047
+ e.reset(A), e.reset(T), e.reset(R);
2048
+ var S = e.sibling(R, 2), k = e.child(S);
1965
2049
  {
1966
- var T = (A) => {
1967
- var m = Er();
1968
- e.append(A, m);
1969
- }, L = (A) => {
1970
- var m = e.comment(), O = e.first_child(m);
2050
+ var D = (x) => {
2051
+ var m = Xr();
2052
+ e.append(x, m);
2053
+ }, j = (x) => {
2054
+ var m = e.comment(), y = e.first_child(m);
1971
2055
  {
1972
- var x = (W) => {
1973
- var Q = Or(), j = e.child(Q, !0);
1974
- e.reset(Q), e.template_effect((G) => e.set_text(j, G), [
1975
- () => V.search_panel_no_results({ query: r.searchQuery })
1976
- ]), e.append(W, Q);
1977
- }, $ = (W) => {
1978
- var Q = e.comment(), j = e.first_child(Q);
2056
+ var f = (V) => {
2057
+ var U = qr(), L = e.child(U, !0);
2058
+ e.reset(U), e.template_effect((B) => e.set_text(L, B), [
2059
+ () => E.search_panel_no_results({ query: r.searchQuery })
2060
+ ]), e.append(V, U);
2061
+ }, G = (V) => {
2062
+ var U = e.comment(), L = e.first_child(U);
1979
2063
  {
1980
- var G = (te) => {
1981
- var se = Gr(), ne = e.child(se, !0);
1982
- e.reset(se), e.template_effect((ae) => e.set_text(ne, ae), [() => V.search_panel_instruction()]), e.append(te, se);
1983
- }, q = (te) => {
1984
- var se = $r(), ne = e.first_child(se), ae = e.child(ne, !0);
1985
- e.reset(ne);
1986
- var oe = e.sibling(ne, 2);
1987
- e.each(oe, 17, () => r.searchResults, e.index, (l, b) => {
1988
- var N = Br();
1989
- N.__click = () => P(e.get(b));
1990
- var F = e.child(N), ee = e.child(F), X = e.child(ee, !0);
1991
- e.reset(ee), e.reset(F);
1992
- var H = e.sibling(F, 2);
2064
+ var B = (re) => {
2065
+ var se = Qr(), oe = e.child(se, !0);
2066
+ e.reset(se), e.template_effect((Q) => e.set_text(oe, Q), [() => E.search_panel_instruction()]), e.append(re, se);
2067
+ }, q = (re) => {
2068
+ var se = Kr(), oe = e.first_child(se), Q = e.child(oe, !0);
2069
+ e.reset(oe);
2070
+ var H = e.sibling(oe, 2);
2071
+ e.each(H, 17, () => r.searchResults, e.index, (n, _) => {
2072
+ var Y = Jr();
2073
+ Y.__click = () => b(e.get(_));
2074
+ var N = e.child(Y), ie = e.child(N), J = e.child(ie, !0);
2075
+ e.reset(ie), e.reset(N);
2076
+ var X = e.sibling(N, 2);
1993
2077
  {
1994
- var J = (Z) => {
1995
- var D = Vr(), Y = e.child(D), re = e.child(Y);
1996
- e.html(re, () => e.get(b).before), e.reset(Y);
1997
- var ie = e.sibling(Y, 2), ue = e.child(ie);
1998
- e.html(ue, () => e.get(b).match), e.reset(ie);
1999
- var Fe = e.sibling(ie, 2), $e = e.child(Fe);
2000
- e.html($e, () => e.get(b).after), e.reset(Fe), e.reset(D), e.append(Z, D);
2001
- }, K = (Z) => {
2002
- var D = Fr(), Y = e.child(D, !0);
2003
- e.reset(D), e.template_effect(() => e.set_text(Y, e.get(b).match)), e.append(Z, D);
2078
+ var Z = (te) => {
2079
+ var F = Wr(), W = e.child(F), ne = e.child(W);
2080
+ e.html(ne, () => e.get(_).before), e.reset(W);
2081
+ var ae = e.sibling(W, 2), ue = e.child(ae);
2082
+ e.html(ue, () => e.get(_).match), e.reset(ae);
2083
+ var $e = e.sibling(ae, 2), Ve = e.child($e);
2084
+ e.html(Ve, () => e.get(_).after), e.reset($e), e.reset(F), e.append(te, F);
2085
+ }, ee = (te) => {
2086
+ var F = Ur(), W = e.child(F, !0);
2087
+ e.reset(F), e.template_effect(() => e.set_text(W, e.get(_).match)), e.append(te, F);
2004
2088
  };
2005
- e.if(H, (Z) => {
2006
- e.get(b).type === "hit" ? Z(J) : Z(K, !1);
2089
+ e.if(X, (te) => {
2090
+ e.get(_).type === "hit" ? te(Z) : te(ee, !1);
2007
2091
  });
2008
2092
  }
2009
- e.reset(N), e.template_effect(() => e.set_text(X, e.get(b).canvasLabel)), e.append(l, N);
2010
- }), e.template_effect((l) => e.set_text(ae, l), [
2011
- () => V.search_panel_results_count({ count: r.searchResults.length })
2012
- ]), e.append(te, se);
2093
+ e.reset(Y), e.template_effect(() => e.set_text(J, e.get(_).canvasLabel)), e.append(n, Y);
2094
+ }), e.template_effect((n) => e.set_text(Q, n), [
2095
+ () => E.search_panel_results_count({ count: r.searchResults.length })
2096
+ ]), e.append(re, se);
2013
2097
  };
2014
2098
  e.if(
2015
- j,
2016
- (te) => {
2017
- r.searchResults.length === 0 && !r.searchQuery ? te(G) : te(q, !1);
2099
+ L,
2100
+ (re) => {
2101
+ r.searchResults.length === 0 && !r.searchQuery ? re(B) : re(q, !1);
2018
2102
  },
2019
2103
  !0
2020
2104
  );
2021
2105
  }
2022
- e.append(W, Q);
2106
+ e.append(V, U);
2023
2107
  };
2024
2108
  e.if(
2025
- O,
2026
- (W) => {
2027
- r.searchResults.length === 0 && r.searchQuery ? W(x) : W($, !1);
2109
+ y,
2110
+ (V) => {
2111
+ r.searchResults.length === 0 && r.searchQuery ? V(f) : V(G, !1);
2028
2112
  },
2029
2113
  !0
2030
2114
  );
2031
2115
  }
2032
- e.append(A, m);
2116
+ e.append(x, m);
2033
2117
  };
2034
- e.if(w, (A) => {
2035
- r.isSearching ? A(T) : A(L, !1);
2118
+ e.if(k, (x) => {
2119
+ r.isSearching ? x(D) : x(j, !1);
2036
2120
  });
2037
2121
  }
2038
- e.reset(y), e.reset(g), e.template_effect(
2039
- (A, m, O, x) => {
2040
- e.set_attribute(g, "aria-label", A), e.set_text(h, m), e.set_attribute(E, "placeholder", O), e.set_attribute(p, "aria-label", x);
2122
+ e.reset(S), e.reset(v), e.template_effect(
2123
+ (x, m, y, f) => {
2124
+ e.set_attribute(v, "aria-label", x), e.set_text(h, m), e.set_attribute(u, "placeholder", y), e.set_attribute(A, "aria-label", f);
2041
2125
  },
2042
2126
  [
2043
- () => V.search_panel_title(),
2044
- () => V.search(),
2045
- () => V.search_panel_placeholder(),
2046
- () => V.search_panel_title()
2127
+ () => E.search_panel_title(),
2128
+ () => E.search(),
2129
+ () => E.search_panel_placeholder(),
2130
+ () => E.search_panel_title()
2047
2131
  ]
2048
- ), e.bind_value(E, () => e.get(s), (A) => e.set(s, A)), e.append(R, g);
2132
+ ), e.bind_value(u, () => e.get(s), (x) => e.set(s, x)), e.append(O, v);
2049
2133
  };
2050
- e.if(I, (R) => {
2051
- r.showSearchPanel && R(u);
2134
+ e.if(P, (O) => {
2135
+ r.showSearchPanel && O(g);
2052
2136
  });
2053
2137
  }
2054
- e.append(i, _), e.pop();
2138
+ e.append(i, w), e.pop();
2055
2139
  }
2056
2140
  e.delegate(["click", "keydown"]);
2057
2141
  e.create_custom_element(dt, {}, [], [], !0);
2058
- var Hr = e.from_html('<div class="h-full w-[200px] pointer-events-auto relative"><!></div>'), Yr = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), Xr = e.from_html('<div class="flex-none flex flex-row z-20 bg-base-200 border-r border-base-300 transition-all"><!> <!></div>'), qr = e.from_html('<div class="flex-none h-[140px] w-full pointer-events-auto relative z-20"><!></div>'), Qr = e.from_html('<div class="w-full h-full flex items-center justify-center"><span class="loading loading-spinner loading-lg text-primary"></span></div>'), Wr = e.from_html('<div class="w-full h-full flex items-center justify-center text-error"> </div>'), Ur = e.from_html('<div class="w-full h-full flex items-center justify-center text-base-content/50"> </div>'), Jr = e.from_html('<div class="absolute inset-0 z-40 pointer-events-none"><!></div>'), Kr = e.from_html('<div class="flex-none h-[140px] w-full pointer-events-auto relative z-20"><!></div>'), Zr = e.from_html('<div class="relative w-full z-40 pointer-events-auto"><!></div>'), ei = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), ti = e.from_html('<div class="h-full w-[200px] pointer-events-auto relative"><!></div>'), ri = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), ii = e.from_html('<div class="flex-none flex flex-row z-20 bg-base-200 border-l border-base-300 transition-all"><!> <!> <!></div>'), si = e.from_html('<div id="triiiceratops-viewer" class="flex w-full h-full relative bg-base-100 overflow-hidden"><!> <div id="triiiceratops-center-panel" class="flex-1 relative min-w-0 flex flex-col"><!> <div class="flex-1 relative min-h-0 w-full h-full bg-base-100"><!> <!> <!> <!> <!> <!> <!> <!></div> <!> <!></div> <!></div>');
2059
- function ni(i, t) {
2142
+ var ei = e.from_html('<div class="h-full w-[200px] pointer-events-auto relative"><!></div>'), ti = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), ri = e.from_html('<div class="flex-none flex flex-row z-20 bg-base-200 border-r border-base-300 transition-all"><!> <!></div>'), ii = e.from_html('<div class="flex-none h-[140px] w-full pointer-events-auto relative z-20"><!></div>'), si = e.from_html('<div class="w-full h-full flex items-center justify-center"><span class="loading loading-spinner loading-lg text-primary"></span></div>'), ni = e.from_html('<div class="w-full h-full flex items-center justify-center text-error"> </div>'), ai = e.from_html('<div class="w-full h-full flex items-center justify-center text-base-content/50"> </div>'), oi = e.from_html('<div class="absolute inset-0 z-40 pointer-events-none"><!></div>'), li = e.from_html('<div class="flex-none h-[140px] w-full pointer-events-auto relative z-20"><!></div>'), ci = e.from_html('<div class="relative w-full z-40 pointer-events-auto"><!></div>'), di = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), fi = e.from_html('<div class="h-full w-[200px] pointer-events-auto relative"><!></div>'), ui = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), gi = e.from_html('<div class="flex-none flex flex-row z-20 bg-base-200 border-l border-base-300 transition-all"><!> <!> <!></div>'), vi = e.from_html('<div id="triiiceratops-viewer" class="flex w-full h-full relative bg-base-100 overflow-hidden"><!> <div id="triiiceratops-center-panel" class="flex-1 relative min-w-0 flex flex-col"><!> <div class="flex-1 relative min-h-0 w-full h-full bg-base-100"><!> <!> <!> <!> <!> <!> <!> <!></div> <!> <!></div> <!></div>');
2143
+ function hi(i, t) {
2060
2144
  e.push(t, !0);
2061
- let r = e.prop(t, "manifestId", 7), s = e.prop(t, "canvasId", 7), n = e.prop(t, "plugins", 23, () => []), a = e.prop(t, "theme", 7), S = e.prop(t, "themeConfig", 7), P = e.prop(t, "config", 23, () => ({})), _ = e.prop(t, "viewerState", 15), I = e.state(void 0);
2145
+ let r = e.prop(t, "manifestId", 7), s = e.prop(t, "canvasId", 7), a = e.prop(t, "plugins", 23, () => []), o = e.prop(t, "theme", 7), I = e.prop(t, "themeConfig", 7), b = e.prop(t, "config", 23, () => ({})), w = e.prop(t, "viewerState", 15), P = e.state(void 0);
2062
2146
  e.user_effect(() => {
2063
- e.get(I) && qt(e.get(I), a(), S());
2147
+ e.get(P) && qt(e.get(P), o(), I());
2064
2148
  });
2065
- const u = new Tt(null, void 0, []);
2066
- _(
2067
- u
2149
+ const g = new Tt(null, void 0, []);
2150
+ w(
2151
+ g
2068
2152
  // Expose via bindable prop
2069
- ), vt(ce, u), pt(() => {
2070
- u.destroyAllPlugins();
2153
+ ), ht(ce, g), pt(() => {
2154
+ g.destroyAllPlugins();
2071
2155
  }), e.user_effect(() => {
2072
- r() && u.setManifest(r());
2156
+ r() && g.setManifest(r());
2073
2157
  }), e.user_effect(() => {
2074
- s() && u.setCanvas(s());
2158
+ s() && g.setCanvas(s());
2075
2159
  }), e.user_effect(() => {
2076
- P() && (console.log("[Viewer] updateConfig called with:", P()), u.updateConfig(P()));
2160
+ b() && (console.log("[Viewer] updateConfig called with:", b()), g.updateConfig(b()));
2077
2161
  }), e.user_effect(() => {
2078
- for (const l of n())
2079
- u.registerPlugin(l);
2162
+ for (const n of a())
2163
+ g.registerPlugin(n);
2080
2164
  }), e.user_effect(() => {
2081
- const l = () => {
2082
- u.isFullScreen = !!document.fullscreenElement;
2165
+ const n = () => {
2166
+ g.isFullScreen = !!document.fullscreenElement;
2083
2167
  };
2084
- return document.addEventListener("fullscreenchange", l), () => {
2085
- document.removeEventListener("fullscreenchange", l);
2168
+ return document.addEventListener("fullscreenchange", n), () => {
2169
+ document.removeEventListener("fullscreenchange", n);
2086
2170
  };
2087
2171
  });
2088
- let R = e.derived(() => u.showThumbnailGallery && u.dockSide === "left" || u.pluginPanels.some((l) => l.position === "left" && l.isVisible())), g = e.derived(() => u.showSearchPanel || u.showThumbnailGallery && u.dockSide === "right" || u.pluginPanels.some((l) => l.position === "right" && l.isVisible())), v = e.derived(() => u.manifest), C = e.derived(() => u.canvases), h = e.derived(() => u.currentCanvasIndex), c = e.derived(() => {
2089
- var K, Z;
2172
+ let O = e.derived(() => g.showThumbnailGallery && g.dockSide === "left" || g.pluginPanels.some((n) => n.position === "left" && n.isVisible())), v = e.derived(() => g.showSearchPanel || g.showThumbnailGallery && g.dockSide === "right" || g.pluginPanels.some((n) => n.position === "right" && n.isVisible())), p = e.derived(() => g.manifest), C = e.derived(() => g.canvases), h = e.derived(() => g.currentCanvasIndex), l = e.derived(() => {
2173
+ var ee, te;
2090
2174
  if (!e.get(C) || e.get(h) === -1 || !e.get(C)[e.get(h)])
2091
- return (K = e.get(v)) != null && K.isFetching || console.log("TriiiceratopsViewer: No canvas found"), null;
2092
- const l = e.get(C)[e.get(h)];
2093
- let b = l.getImages();
2094
- if ((!b || !b.length) && l.getContent && (b = l.getContent()), !b || !b.length)
2095
- return l.__jsonld && l.__jsonld.items, (Z = e.get(v)) != null && Z.isFetching || console.log("TriiiceratopsViewer: No images/content in canvas"), null;
2096
- const N = b[0];
2097
- let F = N.getResource ? N.getResource() : null;
2098
- if (!F && N.getBody) {
2099
- const D = N.getBody();
2100
- Array.isArray(D) && D.length > 0 ? F = D[0] : D && (F = D);
2175
+ return (ee = e.get(p)) != null && ee.isFetching || console.log("TriiiceratopsViewer: No canvas found"), null;
2176
+ const n = e.get(C)[e.get(h)];
2177
+ let _ = n.getImages();
2178
+ if ((!_ || !_.length) && n.getContent && (_ = n.getContent()), !_ || !_.length)
2179
+ return n.__jsonld && n.__jsonld.items, (te = e.get(p)) != null && te.isFetching || console.log("TriiiceratopsViewer: No images/content in canvas"), null;
2180
+ const Y = _[0];
2181
+ let N = Y.getResource ? Y.getResource() : null;
2182
+ if (!N && Y.getBody) {
2183
+ const F = Y.getBody();
2184
+ Array.isArray(F) && F.length > 0 ? N = F[0] : F && (N = F);
2101
2185
  }
2102
- if (F && !F.id && !F.__jsonld && (!F.getServices || F.getServices().length === 0) && (F = null), !F) {
2103
- const D = N.__jsonld || N;
2104
- D.body && (F = Array.isArray(D.body) ? D.body[0] : D.body);
2186
+ if (N && !N.id && !N.__jsonld && (!N.getServices || N.getServices().length === 0) && (N = null), !N) {
2187
+ const F = Y.__jsonld || Y;
2188
+ F.body && (N = Array.isArray(F.body) ? F.body[0] : F.body);
2105
2189
  }
2106
- if (!F)
2190
+ if (!N)
2107
2191
  return null;
2108
- const ee = (D) => D.id || D["@id"];
2109
- let X = [];
2110
- if (F.getServices && (X = F.getServices()), !X.length) {
2111
- const D = F.__jsonld || F;
2112
- D.service && (X = Array.isArray(D.service) ? D.service : [D.service]);
2192
+ const ie = (F) => F.id || F["@id"];
2193
+ let J = [];
2194
+ if (N.getServices && (J = N.getServices()), !J.length) {
2195
+ const F = N.__jsonld || N;
2196
+ F.service && (J = Array.isArray(F.service) ? F.service : [F.service]);
2113
2197
  }
2114
- if (X.length > 0) {
2115
- const D = X.find((Y) => {
2116
- const re = Y.getType ? Y.getType() : Y.type || "", ie = Y.getProfile ? Y.getProfile() : Y.profile || "";
2117
- return re === "ImageService1" || re === "ImageService2" || re === "ImageService3" || typeof ie == "string" && ie.includes("http://iiif.io/api/image") || typeof ie == "string" && ie === "level0";
2198
+ if (J.length > 0) {
2199
+ const F = J.find((W) => {
2200
+ const ne = W.getType ? W.getType() : W.type || "", ae = W.getProfile ? W.getProfile() : W.profile || "";
2201
+ return ne === "ImageService1" || ne === "ImageService2" || ne === "ImageService3" || typeof ae == "string" && ae.includes("http://iiif.io/api/image") || typeof ae == "string" && ae === "level0";
2118
2202
  });
2119
- if (D) {
2120
- let Y = ee(D);
2121
- return Y && !Y.endsWith("/info.json") && (Y = `${Y}/info.json`), Y;
2203
+ if (F) {
2204
+ let W = ie(F);
2205
+ return W && !W.endsWith("/info.json") && (W = `${W}/info.json`), W;
2122
2206
  }
2123
2207
  }
2124
- const H = ee(F);
2125
- if (H && H.includes("/iiif/")) {
2126
- const D = H.split("/"), Y = D.findIndex((re) => re === "full" || re.match(/^\d+,\d+,\d+,\d+$/));
2127
- if (Y > 0)
2128
- return `${D.slice(0, Y).join("/")}/info.json`;
2208
+ const X = ie(N);
2209
+ if (X && X.includes("/iiif/")) {
2210
+ const F = X.split("/"), W = F.findIndex((ne) => ne === "full" || ne.match(/^\d+,\d+,\d+,\d+$/));
2211
+ if (W > 0)
2212
+ return `${F.slice(0, W).join("/")}/info.json`;
2129
2213
  }
2130
- return console.log("TriiiceratopsViewer: No service or ID found, returning raw URL"), { type: "image", url: H };
2214
+ return console.log("TriiiceratopsViewer: No service or ID found, returning raw URL"), { type: "image", url: X };
2131
2215
  });
2132
- var d = {
2216
+ var c = {
2133
2217
  get manifestId() {
2134
2218
  return r();
2135
2219
  },
2136
- set manifestId(l) {
2137
- r(l), e.flush();
2220
+ set manifestId(n) {
2221
+ r(n), e.flush();
2138
2222
  },
2139
2223
  get canvasId() {
2140
2224
  return s();
2141
2225
  },
2142
- set canvasId(l) {
2143
- s(l), e.flush();
2226
+ set canvasId(n) {
2227
+ s(n), e.flush();
2144
2228
  },
2145
2229
  get plugins() {
2146
- return n();
2230
+ return a();
2147
2231
  },
2148
- set plugins(l = []) {
2149
- n(l), e.flush();
2232
+ set plugins(n = []) {
2233
+ a(n), e.flush();
2150
2234
  },
2151
2235
  get theme() {
2152
- return a();
2236
+ return o();
2153
2237
  },
2154
- set theme(l) {
2155
- a(l), e.flush();
2238
+ set theme(n) {
2239
+ o(n), e.flush();
2156
2240
  },
2157
2241
  get themeConfig() {
2158
- return S();
2242
+ return I();
2159
2243
  },
2160
- set themeConfig(l) {
2161
- S(l), e.flush();
2244
+ set themeConfig(n) {
2245
+ I(n), e.flush();
2162
2246
  },
2163
2247
  get config() {
2164
- return P();
2248
+ return b();
2165
2249
  },
2166
- set config(l = {}) {
2167
- P(l), e.flush();
2250
+ set config(n = {}) {
2251
+ b(n), e.flush();
2168
2252
  },
2169
2253
  get viewerState() {
2170
- return _();
2254
+ return w();
2171
2255
  },
2172
- set viewerState(l) {
2173
- _(l), e.flush();
2256
+ set viewerState(n) {
2257
+ w(n), e.flush();
2174
2258
  }
2175
- }, z = si(), B = e.child(z);
2259
+ }, R = vi(), T = e.child(R);
2176
2260
  {
2177
- var E = (l) => {
2178
- var b = Xr(), N = e.child(b);
2261
+ var u = (n) => {
2262
+ var _ = ri(), Y = e.child(_);
2179
2263
  {
2180
- var F = (X) => {
2181
- var H = Hr(), J = e.child(H);
2182
- de(J, {
2264
+ var N = (J) => {
2265
+ var X = ei(), Z = e.child(X);
2266
+ de(Z, {
2183
2267
  get canvases() {
2184
2268
  return e.get(C);
2185
2269
  }
2186
- }), e.reset(H), e.append(X, H);
2270
+ }), e.reset(X), e.append(J, X);
2187
2271
  };
2188
- e.if(N, (X) => {
2189
- u.showThumbnailGallery && u.dockSide === "left" && X(F);
2272
+ e.if(Y, (J) => {
2273
+ g.showThumbnailGallery && g.dockSide === "left" && J(N);
2190
2274
  });
2191
2275
  }
2192
- var ee = e.sibling(N, 2);
2193
- e.each(ee, 17, () => u.pluginPanels, (X) => X.id, (X, H) => {
2194
- var J = e.comment(), K = e.first_child(J);
2276
+ var ie = e.sibling(Y, 2);
2277
+ e.each(ie, 17, () => g.pluginPanels, (J) => J.id, (J, X) => {
2278
+ var Z = e.comment(), ee = e.first_child(Z);
2195
2279
  {
2196
- var Z = (D) => {
2197
- var Y = Yr(), re = e.child(Y);
2198
- e.component(re, () => e.get(H).component, (ie, ue) => {
2199
- ue(ie, e.spread_props(() => e.get(H).props ?? {}));
2200
- }), e.reset(Y), e.append(D, Y);
2280
+ var te = (F) => {
2281
+ var W = ti(), ne = e.child(W);
2282
+ e.component(ne, () => e.get(X).component, (ae, ue) => {
2283
+ ue(ae, e.spread_props(() => e.get(X).props ?? {}));
2284
+ }), e.reset(W), e.append(F, W);
2201
2285
  };
2202
- e.if(K, (D) => {
2203
- e.get(H).isVisible() && e.get(H).position === "left" && D(Z);
2286
+ e.if(ee, (F) => {
2287
+ e.get(X).isVisible() && e.get(X).position === "left" && F(te);
2204
2288
  });
2205
2289
  }
2206
- e.append(X, J);
2207
- }), e.reset(b), e.append(l, b);
2290
+ e.append(J, Z);
2291
+ }), e.reset(_), e.append(n, _);
2208
2292
  };
2209
- e.if(B, (l) => {
2210
- e.get(R) && l(E);
2293
+ e.if(T, (n) => {
2294
+ e.get(O) && n(u);
2211
2295
  });
2212
2296
  }
2213
- var p = e.sibling(B, 2), f = e.child(p);
2297
+ var A = e.sibling(T, 2), $ = e.child(A);
2214
2298
  {
2215
- var o = (l) => {
2216
- var b = qr(), N = e.child(b);
2217
- de(N, {
2299
+ var d = (n) => {
2300
+ var _ = ii(), Y = e.child(_);
2301
+ de(Y, {
2218
2302
  get canvases() {
2219
2303
  return e.get(C);
2220
2304
  }
2221
- }), e.reset(b), e.append(l, b);
2305
+ }), e.reset(_), e.append(n, _);
2222
2306
  };
2223
- e.if(f, (l) => {
2224
- u.showThumbnailGallery && u.dockSide === "top" && l(o);
2307
+ e.if($, (n) => {
2308
+ g.showThumbnailGallery && g.dockSide === "top" && n(d);
2225
2309
  });
2226
2310
  }
2227
- var M = e.sibling(f, 2), y = e.child(M);
2311
+ var z = e.sibling($, 2), S = e.child(z);
2228
2312
  {
2229
- var w = (l) => {
2230
- var b = Qr();
2231
- e.append(l, b);
2232
- }, T = (l) => {
2233
- var b = e.comment(), N = e.first_child(b);
2313
+ var k = (n) => {
2314
+ var _ = si();
2315
+ e.append(n, _);
2316
+ }, D = (n) => {
2317
+ var _ = e.comment(), Y = e.first_child(_);
2234
2318
  {
2235
- var F = (X) => {
2236
- var H = Wr(), J = e.child(H);
2237
- e.reset(H), e.template_effect(
2238
- (K) => e.set_text(J, `${K ?? ""}
2239
- ${e.get(v).error ?? ""}`),
2240
- [() => V.error_prefix()]
2241
- ), e.append(X, H);
2242
- }, ee = (X) => {
2243
- var H = e.comment(), J = e.first_child(H);
2319
+ var N = (J) => {
2320
+ var X = ni(), Z = e.child(X);
2321
+ e.reset(X), e.template_effect(
2322
+ (ee) => e.set_text(Z, `${ee ?? ""}
2323
+ ${e.get(p).error ?? ""}`),
2324
+ [() => E.error_prefix()]
2325
+ ), e.append(J, X);
2326
+ }, ie = (J) => {
2327
+ var X = e.comment(), Z = e.first_child(X);
2244
2328
  {
2245
- var K = (D) => {
2246
- var Y = e.comment(), re = e.first_child(Y);
2247
- e.key(re, () => e.get(c), (ie) => {
2248
- st(ie, {
2329
+ var ee = (F) => {
2330
+ var W = e.comment(), ne = e.first_child(W);
2331
+ e.key(ne, () => e.get(l), (ae) => {
2332
+ st(ae, {
2249
2333
  get tileSources() {
2250
- return e.get(c);
2334
+ return e.get(l);
2251
2335
  },
2252
2336
  get viewerState() {
2253
- return u;
2337
+ return g;
2254
2338
  }
2255
2339
  });
2256
- }), e.append(D, Y);
2257
- }, Z = (D) => {
2258
- var Y = Ur(), re = e.child(Y, !0);
2259
- e.reset(Y), e.template_effect((ie) => e.set_text(re, ie), [() => V.no_image_found()]), e.append(D, Y);
2340
+ }), e.append(F, W);
2341
+ }, te = (F) => {
2342
+ var W = ai(), ne = e.child(W, !0);
2343
+ e.reset(W), e.template_effect((ae) => e.set_text(ne, ae), [() => E.no_image_found()]), e.append(F, W);
2260
2344
  };
2261
2345
  e.if(
2262
- J,
2263
- (D) => {
2264
- e.get(c) ? D(K) : D(Z, !1);
2346
+ Z,
2347
+ (F) => {
2348
+ e.get(l) ? F(ee) : F(te, !1);
2265
2349
  },
2266
2350
  !0
2267
2351
  );
2268
2352
  }
2269
- e.append(X, H);
2353
+ e.append(J, X);
2270
2354
  };
2271
2355
  e.if(
2272
- N,
2273
- (X) => {
2274
- var H;
2275
- (H = e.get(v)) != null && H.error ? X(F) : X(ee, !1);
2356
+ Y,
2357
+ (J) => {
2358
+ var X;
2359
+ (X = e.get(p)) != null && X.error ? J(N) : J(ie, !1);
2276
2360
  },
2277
2361
  !0
2278
2362
  );
2279
2363
  }
2280
- e.append(l, b);
2364
+ e.append(n, _);
2281
2365
  };
2282
- e.if(y, (l) => {
2283
- var b;
2284
- (b = e.get(v)) != null && b.isFetching ? l(w) : l(T, !1);
2366
+ e.if(S, (n) => {
2367
+ var _;
2368
+ (_ = e.get(p)) != null && _.isFetching ? n(k) : n(D, !1);
2285
2369
  });
2286
2370
  }
2287
- var L = e.sibling(y, 2);
2288
- at(L, {});
2289
- var A = e.sibling(L, 2);
2290
- ct(A, {});
2291
- var m = e.sibling(A, 2);
2371
+ var j = e.sibling(S, 2);
2372
+ at(j, {});
2373
+ var x = e.sibling(j, 2);
2374
+ ct(x, {});
2375
+ var m = e.sibling(x, 2);
2292
2376
  {
2293
- var O = (l) => {
2294
- ot(l, {});
2377
+ var y = (n) => {
2378
+ ot(n, {});
2295
2379
  };
2296
- e.if(m, (l) => {
2297
- u.showRightMenu && l(O);
2380
+ e.if(m, (n) => {
2381
+ g.showRightMenu && n(y);
2298
2382
  });
2299
2383
  }
2300
- var x = e.sibling(m, 2);
2384
+ var f = e.sibling(m, 2);
2301
2385
  {
2302
- var $ = (l) => {
2303
- lt(l, {});
2386
+ var G = (n) => {
2387
+ lt(n, {});
2304
2388
  };
2305
- e.if(x, (l) => {
2306
- u.showLeftMenu && l($);
2389
+ e.if(f, (n) => {
2390
+ g.showLeftMenu && n(G);
2307
2391
  });
2308
2392
  }
2309
- var W = e.sibling(x, 2);
2310
- e.each(W, 17, () => u.pluginPanels, (l) => l.id, (l, b) => {
2311
- var N = e.comment(), F = e.first_child(N);
2393
+ var V = e.sibling(f, 2);
2394
+ e.each(V, 17, () => g.pluginPanels, (n) => n.id, (n, _) => {
2395
+ var Y = e.comment(), N = e.first_child(Y);
2312
2396
  {
2313
- var ee = (X) => {
2314
- var H = Jr(), J = e.child(H);
2315
- e.component(J, () => e.get(b).component, (K, Z) => {
2316
- Z(K, e.spread_props(() => e.get(b).props ?? {}));
2317
- }), e.reset(H), e.append(X, H);
2397
+ var ie = (J) => {
2398
+ var X = oi(), Z = e.child(X);
2399
+ e.component(Z, () => e.get(_).component, (ee, te) => {
2400
+ te(ee, e.spread_props(() => e.get(_).props ?? {}));
2401
+ }), e.reset(X), e.append(J, X);
2318
2402
  };
2319
- e.if(F, (X) => {
2320
- e.get(b).isVisible() && e.get(b).position === "overlay" && X(ee);
2403
+ e.if(N, (J) => {
2404
+ e.get(_).isVisible() && e.get(_).position === "overlay" && J(ie);
2321
2405
  });
2322
2406
  }
2323
- e.append(l, N);
2407
+ e.append(n, Y);
2324
2408
  });
2325
- var Q = e.sibling(W, 2);
2409
+ var U = e.sibling(V, 2);
2326
2410
  {
2327
- var j = (l) => {
2328
- nt(l, {
2411
+ var L = (n) => {
2412
+ nt(n, {
2329
2413
  get viewerState() {
2330
- return u;
2414
+ return g;
2331
2415
  }
2332
2416
  });
2333
2417
  };
2334
- e.if(Q, (l) => {
2335
- e.get(C).length > 1 && u.showCanvasNav && l(j);
2418
+ e.if(U, (n) => {
2419
+ e.get(C).length > 1 && g.showCanvasNav && n(L);
2336
2420
  });
2337
2421
  }
2338
- var G = e.sibling(Q, 2);
2422
+ var B = e.sibling(U, 2);
2339
2423
  {
2340
- var q = (l) => {
2341
- de(l, {
2424
+ var q = (n) => {
2425
+ de(n, {
2342
2426
  get canvases() {
2343
2427
  return e.get(C);
2344
2428
  }
2345
2429
  });
2346
2430
  };
2347
- e.if(G, (l) => {
2348
- u.showThumbnailGallery && u.dockSide === "none" && l(q);
2431
+ e.if(B, (n) => {
2432
+ g.showThumbnailGallery && g.dockSide === "none" && n(q);
2349
2433
  });
2350
2434
  }
2351
- e.reset(M);
2352
- var te = e.sibling(M, 2);
2435
+ e.reset(z);
2436
+ var re = e.sibling(z, 2);
2353
2437
  {
2354
- var se = (l) => {
2355
- var b = Kr(), N = e.child(b);
2356
- de(N, {
2438
+ var se = (n) => {
2439
+ var _ = li(), Y = e.child(_);
2440
+ de(Y, {
2357
2441
  get canvases() {
2358
2442
  return e.get(C);
2359
2443
  }
2360
- }), e.reset(b), e.append(l, b);
2444
+ }), e.reset(_), e.append(n, _);
2361
2445
  };
2362
- e.if(te, (l) => {
2363
- u.showThumbnailGallery && u.dockSide === "bottom" && l(se);
2446
+ e.if(re, (n) => {
2447
+ g.showThumbnailGallery && g.dockSide === "bottom" && n(se);
2364
2448
  });
2365
2449
  }
2366
- var ne = e.sibling(te, 2);
2367
- e.each(ne, 17, () => u.pluginPanels, (l) => l.id, (l, b) => {
2368
- var N = e.comment(), F = e.first_child(N);
2450
+ var oe = e.sibling(re, 2);
2451
+ e.each(oe, 17, () => g.pluginPanels, (n) => n.id, (n, _) => {
2452
+ var Y = e.comment(), N = e.first_child(Y);
2369
2453
  {
2370
- var ee = (X) => {
2371
- var H = Zr(), J = e.child(H);
2372
- e.component(J, () => e.get(b).component, (K, Z) => {
2373
- Z(K, e.spread_props(() => e.get(b).props ?? {}));
2374
- }), e.reset(H), e.append(X, H);
2454
+ var ie = (J) => {
2455
+ var X = ci(), Z = e.child(X);
2456
+ e.component(Z, () => e.get(_).component, (ee, te) => {
2457
+ te(ee, e.spread_props(() => e.get(_).props ?? {}));
2458
+ }), e.reset(X), e.append(J, X);
2375
2459
  };
2376
- e.if(F, (X) => {
2377
- e.get(b).isVisible() && e.get(b).position === "bottom" && X(ee);
2460
+ e.if(N, (J) => {
2461
+ e.get(_).isVisible() && e.get(_).position === "bottom" && J(ie);
2378
2462
  });
2379
2463
  }
2380
- e.append(l, N);
2381
- }), e.reset(p);
2382
- var ae = e.sibling(p, 2);
2464
+ e.append(n, Y);
2465
+ }), e.reset(A);
2466
+ var Q = e.sibling(A, 2);
2383
2467
  {
2384
- var oe = (l) => {
2385
- var b = ii(), N = e.child(b);
2468
+ var H = (n) => {
2469
+ var _ = gi(), Y = e.child(_);
2386
2470
  {
2387
- var F = (J) => {
2388
- var K = ei(), Z = e.child(K);
2389
- dt(Z, {}), e.reset(K), e.append(J, K);
2471
+ var N = (Z) => {
2472
+ var ee = di(), te = e.child(ee);
2473
+ dt(te, {}), e.reset(ee), e.append(Z, ee);
2390
2474
  };
2391
- e.if(N, (J) => {
2392
- u.showSearchPanel && J(F);
2475
+ e.if(Y, (Z) => {
2476
+ g.showSearchPanel && Z(N);
2393
2477
  });
2394
2478
  }
2395
- var ee = e.sibling(N, 2);
2479
+ var ie = e.sibling(Y, 2);
2396
2480
  {
2397
- var X = (J) => {
2398
- var K = ti(), Z = e.child(K);
2399
- de(Z, {
2481
+ var J = (Z) => {
2482
+ var ee = fi(), te = e.child(ee);
2483
+ de(te, {
2400
2484
  get canvases() {
2401
2485
  return e.get(C);
2402
2486
  }
2403
- }), e.reset(K), e.append(J, K);
2487
+ }), e.reset(ee), e.append(Z, ee);
2404
2488
  };
2405
- e.if(ee, (J) => {
2406
- u.showThumbnailGallery && u.dockSide === "right" && J(X);
2489
+ e.if(ie, (Z) => {
2490
+ g.showThumbnailGallery && g.dockSide === "right" && Z(J);
2407
2491
  });
2408
2492
  }
2409
- var H = e.sibling(ee, 2);
2410
- e.each(H, 17, () => u.pluginPanels, (J) => J.id, (J, K) => {
2411
- var Z = e.comment(), D = e.first_child(Z);
2493
+ var X = e.sibling(ie, 2);
2494
+ e.each(X, 17, () => g.pluginPanels, (Z) => Z.id, (Z, ee) => {
2495
+ var te = e.comment(), F = e.first_child(te);
2412
2496
  {
2413
- var Y = (re) => {
2414
- var ie = ri(), ue = e.child(ie);
2415
- e.component(ue, () => e.get(K).component, (Fe, $e) => {
2416
- $e(Fe, e.spread_props(() => e.get(K).props ?? {}));
2417
- }), e.reset(ie), e.append(re, ie);
2497
+ var W = (ne) => {
2498
+ var ae = ui(), ue = e.child(ae);
2499
+ e.component(ue, () => e.get(ee).component, ($e, Ve) => {
2500
+ Ve($e, e.spread_props(() => e.get(ee).props ?? {}));
2501
+ }), e.reset(ae), e.append(ne, ae);
2418
2502
  };
2419
- e.if(D, (re) => {
2420
- e.get(K).isVisible() && e.get(K).position === "right" && re(Y);
2503
+ e.if(F, (ne) => {
2504
+ e.get(ee).isVisible() && e.get(ee).position === "right" && ne(W);
2421
2505
  });
2422
2506
  }
2423
- e.append(J, Z);
2424
- }), e.reset(b), e.append(l, b);
2507
+ e.append(Z, te);
2508
+ }), e.reset(_), e.append(n, _);
2425
2509
  };
2426
- e.if(ae, (l) => {
2427
- e.get(g) && l(oe);
2510
+ e.if(Q, (n) => {
2511
+ e.get(v) && n(H);
2428
2512
  });
2429
2513
  }
2430
- return e.reset(z), e.bind_this(z, (l) => e.set(I, l), () => e.get(I)), e.append(i, z), e.pop(d);
2514
+ return e.reset(R), e.bind_this(R, (n) => e.set(P, n), () => e.get(P)), e.append(i, R), e.pop(c);
2431
2515
  }
2432
2516
  e.create_custom_element(
2433
- ni,
2517
+ hi,
2434
2518
  {
2435
2519
  manifestId: {},
2436
2520
  canvasId: {},
@@ -2445,18 +2529,18 @@ e.create_custom_element(
2445
2529
  !0
2446
2530
  );
2447
2531
  export {
2448
- zi as BasePlugin,
2532
+ $i as BasePlugin,
2449
2533
  zt as DAISYUI_THEMES,
2450
2534
  Mt as ManifestsState,
2451
- ni as TriiiceratopsViewer,
2535
+ hi as TriiiceratopsViewer,
2452
2536
  ce as VIEWER_STATE_KEY,
2453
2537
  Tt as ViewerState,
2454
2538
  Ht as applyBuiltInTheme,
2455
2539
  qt as applyTheme,
2456
2540
  Yt as applyThemeConfig,
2457
2541
  Xt as clearThemeConfig,
2458
- Ft as hexToOklch,
2459
- ki as isBuiltInTheme,
2460
- $t as normalizeColor,
2461
- Pi as parseThemeConfig
2542
+ $t as hexToOklch,
2543
+ Ei as isBuiltInTheme,
2544
+ Vt as normalizeColor,
2545
+ Gi as parseThemeConfig
2462
2546
  };