triiiceratops 0.9.13 → 0.10.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/ArrowCounterClockwise-C6n_F9YZ.js +136 -0
- package/dist/X-BUzsFa3u.js +886 -0
- package/dist/annotation_tool_point-CCJi2I8J.js +290 -0
- package/dist/components/AnnotationOverlay.svelte +179 -86
- package/dist/components/LeftFab.svelte +21 -9
- package/dist/components/OSDViewer.svelte +20 -3
- package/dist/components/ThumbnailGallery.svelte +4 -4
- package/dist/components/TriiiceratopsViewer.svelte +167 -49
- package/dist/components/TriiiceratopsViewer.svelte.d.ts +5 -5
- package/dist/components/TriiiceratopsViewerElement.svelte +2 -2
- package/dist/components/TriiiceratopsViewerElement.svelte.d.ts +2 -2
- package/dist/custom-element.d.ts +10 -0
- package/dist/custom-element.js +13 -0
- package/dist/image_filters_reset-CWe7vTJU.js +108 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +0 -1
- package/dist/paraglide/messages/_index.d.ts +30 -0
- package/dist/paraglide/messages/_index.js +31 -1
- package/dist/paraglide/messages/annotation_editor_add_content.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_add_content.js +34 -0
- package/dist/paraglide/messages/annotation_editor_cancel.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_cancel.js +34 -0
- package/dist/paraglide/messages/annotation_editor_create_mode.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_create_mode.js +34 -0
- package/dist/paraglide/messages/annotation_editor_delete.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_delete.js +34 -0
- package/dist/paraglide/messages/annotation_editor_delete_message.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_delete_message.js +34 -0
- package/dist/paraglide/messages/annotation_editor_delete_title.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_delete_title.js +34 -0
- package/dist/paraglide/messages/annotation_editor_delete_tooltip.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_delete_tooltip.js +34 -0
- package/dist/paraglide/messages/annotation_editor_edit_mode.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_edit_mode.js +34 -0
- package/dist/paraglide/messages/annotation_editor_edit_section.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_edit_section.js +34 -0
- package/dist/paraglide/messages/annotation_editor_instruction_create.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_instruction_create.js +34 -0
- package/dist/paraglide/messages/annotation_editor_instruction_edit.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_instruction_edit.js +34 -0
- package/dist/paraglide/messages/annotation_editor_link_placeholder.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_link_placeholder.js +34 -0
- package/dist/paraglide/messages/annotation_editor_redo.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_redo.js +34 -0
- package/dist/paraglide/messages/annotation_editor_save.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_save.js +34 -0
- package/dist/paraglide/messages/annotation_editor_tag_placeholder.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_tag_placeholder.js +34 -0
- package/dist/paraglide/messages/annotation_editor_text_placeholder.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_text_placeholder.js +34 -0
- package/dist/paraglide/messages/annotation_editor_title.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_title.js +34 -0
- package/dist/paraglide/messages/annotation_editor_tool_label.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_tool_label.js +34 -0
- package/dist/paraglide/messages/annotation_editor_undo.d.ts +4 -0
- package/dist/paraglide/messages/annotation_editor_undo.js +34 -0
- package/dist/paraglide/messages/annotation_tool_point.d.ts +4 -0
- package/dist/paraglide/messages/annotation_tool_point.js +34 -0
- package/dist/paraglide/messages/annotation_tool_polygon.d.ts +4 -0
- package/dist/paraglide/messages/annotation_tool_polygon.js +34 -0
- package/dist/paraglide/messages/annotation_tool_rectangle.d.ts +4 -0
- package/dist/paraglide/messages/annotation_tool_rectangle.js +34 -0
- package/dist/paraglide/messages/image_adjustments_title.d.ts +4 -0
- package/dist/paraglide/messages/image_adjustments_title.js +34 -0
- package/dist/paraglide/messages/image_filters_brightness.d.ts +4 -0
- package/dist/paraglide/messages/image_filters_brightness.js +34 -0
- package/dist/paraglide/messages/image_filters_contrast.d.ts +4 -0
- package/dist/paraglide/messages/image_filters_contrast.js +34 -0
- package/dist/paraglide/messages/image_filters_effects.d.ts +4 -0
- package/dist/paraglide/messages/image_filters_effects.js +34 -0
- package/dist/paraglide/messages/image_filters_grayscale.d.ts +4 -0
- package/dist/paraglide/messages/image_filters_grayscale.js +34 -0
- package/dist/paraglide/messages/image_filters_invert.d.ts +4 -0
- package/dist/paraglide/messages/image_filters_invert.js +34 -0
- package/dist/paraglide/messages/image_filters_reset.d.ts +4 -0
- package/dist/paraglide/messages/image_filters_reset.js +34 -0
- package/dist/paraglide/messages/image_filters_saturation.d.ts +4 -0
- package/dist/paraglide/messages/image_filters_saturation.js +34 -0
- package/dist/paraglide/messages/plugins_tooltip.js +1 -1
- package/dist/plugins/annotation-editor/AnnotationEditorController.svelte +166 -0
- package/dist/plugins/annotation-editor/AnnotationEditorController.svelte.d.ts +9 -0
- package/dist/plugins/annotation-editor/AnnotationEditorPanel.svelte +315 -0
- package/dist/plugins/annotation-editor/AnnotationEditorPanel.svelte.d.ts +24 -0
- package/dist/plugins/annotation-editor/AnnotationManager.svelte.d.ts +39 -0
- package/dist/plugins/annotation-editor/AnnotationManager.svelte.js +433 -0
- package/dist/plugins/annotation-editor/adapters/LocalStorageAdapter.d.ts +20 -0
- package/dist/plugins/annotation-editor/adapters/LocalStorageAdapter.js +67 -0
- package/dist/plugins/annotation-editor/adapters/index.d.ts +2 -0
- package/dist/plugins/annotation-editor/adapters/index.js +1 -0
- package/dist/plugins/annotation-editor/adapters/types.d.ts +23 -0
- package/dist/plugins/annotation-editor/adapters/types.js +1 -0
- package/dist/plugins/annotation-editor/iife-entry.d.ts +15 -0
- package/dist/plugins/annotation-editor/iife-entry.js +35 -0
- package/dist/plugins/annotation-editor/index.d.ts +41 -0
- package/dist/plugins/annotation-editor/index.js +57 -0
- package/dist/plugins/annotation-editor/loader.svelte.d.ts +7 -0
- package/dist/plugins/annotation-editor/loader.svelte.js +32 -0
- package/dist/plugins/annotation-editor/types.d.ts +41 -0
- package/dist/plugins/annotation-editor/types.js +13 -0
- package/dist/plugins/annotation-editor.js +32824 -0
- package/dist/plugins/image-manipulation/ImageManipulationController.svelte +54 -0
- package/dist/plugins/image-manipulation/ImageManipulationController.svelte.d.ts +6 -0
- package/dist/plugins/image-manipulation/ImageManipulationPanel.svelte +19 -9
- package/dist/plugins/image-manipulation/ImageManipulationPanel.svelte.d.ts +1 -0
- package/dist/plugins/image-manipulation/iife-entry.d.ts +13 -0
- package/dist/plugins/image-manipulation/iife-entry.js +17 -0
- package/dist/plugins/image-manipulation/index.d.ts +15 -1
- package/dist/plugins/image-manipulation/index.js +21 -1
- package/dist/plugins/image-manipulation.js +265 -0
- package/dist/state/i18n.svelte.js +4 -2
- package/dist/state/manifests.svelte.d.ts +7 -2
- package/dist/state/manifests.svelte.js +45 -13
- package/dist/state/viewer.svelte.d.ts +16 -13
- package/dist/state/viewer.svelte.js +75 -84
- package/dist/triiiceratops-bundle.js +3260 -3155
- package/dist/triiiceratops-element.css +1 -0
- package/dist/triiiceratops-element.iife.js +99 -0
- package/dist/triiiceratops.css +1 -1
- package/dist/types/plugin.d.ts +21 -62
- package/dist/types/plugin.js +1 -23
- package/dist/utils/annotationAdapter.d.ts +12 -1
- package/dist/utils/annotationAdapter.js +98 -39
- package/package.json +13 -6
- package/dist/chunks/TriiiceratopsViewer-EViTQO_n.js +0 -10437
- package/dist/chunks/openseadragon-CHvATAD9.js +0 -12427
- package/dist/components/TriiiceratopsViewerElementImage.svelte +0 -143
- package/dist/components/TriiiceratopsViewerElementImage.svelte.d.ts +0 -27
- package/dist/custom-element-image.d.ts +0 -1
- package/dist/custom-element-image.js +0 -2
- package/dist/plugins/image-manipulation/ImageManipulationPlugin.svelte.d.ts +0 -19
- package/dist/plugins/image-manipulation/ImageManipulationPlugin.svelte.js +0 -87
- package/dist/triiiceratops-element-image.js +0 -555
- package/dist/triiiceratops-element.js +0 -114
|
@@ -0,0 +1,886 @@
|
|
|
1
|
+
var Dt = Object.defineProperty;
|
|
2
|
+
var pt = (a) => {
|
|
3
|
+
throw TypeError(a);
|
|
4
|
+
};
|
|
5
|
+
var Rt = (a, t, s) => t in a ? Dt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[t] = s;
|
|
6
|
+
var ft = (a, t, s) => Rt(a, typeof t != "symbol" ? t + "" : t, s), Gt = (a, t, s) => t.has(a) || pt("Cannot " + s);
|
|
7
|
+
var n = (a, t, s) => (Gt(a, t, "read from private field"), s ? s.call(a) : t.get(a)), l = (a, t, s) => t.has(a) ? pt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(a) : t.set(a, s);
|
|
8
|
+
import * as e from "svelte/internal/client";
|
|
9
|
+
import * as Bt from "manifesto.js";
|
|
10
|
+
import "svelte/internal/disclose-version";
|
|
11
|
+
import { hasContext as Tt, getContext as jt } from "svelte";
|
|
12
|
+
var E, D;
|
|
13
|
+
class Vt {
|
|
14
|
+
constructor() {
|
|
15
|
+
l(this, E, e.state(e.proxy({})));
|
|
16
|
+
l(this, D, e.state(e.proxy(/* @__PURE__ */ new Map())));
|
|
17
|
+
}
|
|
18
|
+
get manifests() {
|
|
19
|
+
return e.get(n(this, E));
|
|
20
|
+
}
|
|
21
|
+
set manifests(t) {
|
|
22
|
+
e.set(n(this, E), t, !0);
|
|
23
|
+
}
|
|
24
|
+
get userAnnotations() {
|
|
25
|
+
return e.get(n(this, D));
|
|
26
|
+
}
|
|
27
|
+
set userAnnotations(t) {
|
|
28
|
+
e.set(n(this, D), t, !0);
|
|
29
|
+
}
|
|
30
|
+
// === User Annotations API ===
|
|
31
|
+
userAnnotationKey(t, s) {
|
|
32
|
+
return `${t}::${s}`;
|
|
33
|
+
}
|
|
34
|
+
setUserAnnotations(t, s, i) {
|
|
35
|
+
const r = this.userAnnotationKey(t, s), u = new Map(this.userAnnotations);
|
|
36
|
+
u.set(r, i), this.userAnnotations = u;
|
|
37
|
+
}
|
|
38
|
+
clearUserAnnotations(t, s) {
|
|
39
|
+
const i = this.userAnnotationKey(t, s);
|
|
40
|
+
if (this.userAnnotations.has(i)) {
|
|
41
|
+
const r = new Map(this.userAnnotations);
|
|
42
|
+
r.delete(i), this.userAnnotations = r;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
getUserAnnotations(t, s) {
|
|
46
|
+
const i = this.userAnnotationKey(t, s);
|
|
47
|
+
return this.userAnnotations.get(i) ?? [];
|
|
48
|
+
}
|
|
49
|
+
// === Manifest Fetching ===
|
|
50
|
+
async fetchManifest(t) {
|
|
51
|
+
if (!this.manifests[t]) {
|
|
52
|
+
this.manifests[t] = { isFetching: !0 };
|
|
53
|
+
try {
|
|
54
|
+
const s = await fetch(t);
|
|
55
|
+
if (!s.ok)
|
|
56
|
+
throw new Error(`HTTP error! status: ${s.status}`);
|
|
57
|
+
const i = await s.json(), r = Bt.parseManifest(i);
|
|
58
|
+
this.manifests[t] = { json: i, manifesto: r, isFetching: !1 };
|
|
59
|
+
} catch (s) {
|
|
60
|
+
this.manifests[t] = { error: s.message, isFetching: !1 };
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
getManifest(t) {
|
|
65
|
+
const s = this.manifests[t];
|
|
66
|
+
return s == null ? void 0 : s.manifesto;
|
|
67
|
+
}
|
|
68
|
+
getManifestEntry(t) {
|
|
69
|
+
return this.manifests[t];
|
|
70
|
+
}
|
|
71
|
+
async fetchAnnotationList(t) {
|
|
72
|
+
if (!this.manifests[t])
|
|
73
|
+
try {
|
|
74
|
+
const s = await fetch(t);
|
|
75
|
+
if (s.ok) {
|
|
76
|
+
const i = await s.json();
|
|
77
|
+
this.manifests[t] = { json: i };
|
|
78
|
+
} else
|
|
79
|
+
console.error(`Failed to fetch annotation list: ${t}`);
|
|
80
|
+
} catch (s) {
|
|
81
|
+
console.error(`Error fetching annotation list: ${t}`, s);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
getCanvases(t) {
|
|
85
|
+
const s = this.getManifest(t);
|
|
86
|
+
if (!s)
|
|
87
|
+
return [];
|
|
88
|
+
const i = s.getSequences();
|
|
89
|
+
return !i || !i.length ? [] : i[0].getCanvases();
|
|
90
|
+
}
|
|
91
|
+
getAnnotations(t, s) {
|
|
92
|
+
const i = this.manualGetAnnotations(t, s), r = this.getUserAnnotations(t, s);
|
|
93
|
+
return [...i, ...r];
|
|
94
|
+
}
|
|
95
|
+
// We can refactor this to use Manifesto's resource handling later if needed.
|
|
96
|
+
manualGetAnnotations(t, s) {
|
|
97
|
+
const i = this.getManifest(t);
|
|
98
|
+
if (!i) return [];
|
|
99
|
+
const r = i.getSequences()[0].getCanvasById(s);
|
|
100
|
+
if (!r) return [];
|
|
101
|
+
const u = r.__jsonld;
|
|
102
|
+
let v = [];
|
|
103
|
+
const A = (c) => c.resources || c.items || [];
|
|
104
|
+
return u.otherContent && u.otherContent.forEach((c) => {
|
|
105
|
+
const d = c["@id"] || c.id;
|
|
106
|
+
if (d && !c.resources) {
|
|
107
|
+
const w = this.manifests[d];
|
|
108
|
+
if (w) {
|
|
109
|
+
if (w.json) {
|
|
110
|
+
const _ = A(w.json);
|
|
111
|
+
v.push(..._);
|
|
112
|
+
}
|
|
113
|
+
} else
|
|
114
|
+
this.fetchAnnotationList(d);
|
|
115
|
+
} else c.resources && v.push(...c.resources);
|
|
116
|
+
}), u.annotations && u.annotations.forEach((c) => {
|
|
117
|
+
const d = c.id || c["@id"];
|
|
118
|
+
if (d && !c.items) {
|
|
119
|
+
const w = this.manifests[d];
|
|
120
|
+
if (w) {
|
|
121
|
+
if (w.json) {
|
|
122
|
+
const _ = A(w.json);
|
|
123
|
+
v.push(..._);
|
|
124
|
+
}
|
|
125
|
+
} else
|
|
126
|
+
this.fetchAnnotationList(d);
|
|
127
|
+
} else c.items && v.push(...c.items);
|
|
128
|
+
}), v;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
E = new WeakMap(), D = new WeakMap();
|
|
132
|
+
const k = new Vt();
|
|
133
|
+
var R, G, B, T, j, V, O, F, Q, Z, z, H, N, U, q, K, $, W, J, X, Y, tt, et, st, nt, at;
|
|
134
|
+
class ae {
|
|
135
|
+
constructor(t = null, s = null, i = []) {
|
|
136
|
+
l(this, R, e.state(null));
|
|
137
|
+
l(this, G, e.state(null));
|
|
138
|
+
l(this, B, e.state(!1));
|
|
139
|
+
l(this, T, e.state(!1));
|
|
140
|
+
l(this, j, e.state(!1));
|
|
141
|
+
l(this, V, e.state(!1));
|
|
142
|
+
l(this, O, e.state(!1));
|
|
143
|
+
l(this, F, e.state(!1));
|
|
144
|
+
l(this, Q, e.state("bottom"));
|
|
145
|
+
l(this, Z, e.state(e.proxy(/* @__PURE__ */ new Set())));
|
|
146
|
+
l(this, z, e.state(e.proxy({})));
|
|
147
|
+
l(
|
|
148
|
+
this,
|
|
149
|
+
H,
|
|
150
|
+
// Gallery State (Lifted for persistence during re-docking)
|
|
151
|
+
e.state(e.proxy({ x: 20, y: 100 }))
|
|
152
|
+
);
|
|
153
|
+
l(this, N, e.state(e.proxy({ width: 300, height: 400 })));
|
|
154
|
+
l(this, U, e.state(!1));
|
|
155
|
+
l(this, q, e.state(e.proxy({ x: 0, y: 0 })));
|
|
156
|
+
l(this, K, e.state(null));
|
|
157
|
+
l(this, $, e.state(null));
|
|
158
|
+
ft(this, "eventTarget", null);
|
|
159
|
+
l(this, W, e.state(""));
|
|
160
|
+
l(this, J, e.state(null));
|
|
161
|
+
l(this, X, e.state(e.proxy([])));
|
|
162
|
+
l(this, Y, e.state(!1));
|
|
163
|
+
l(this, tt, e.state(!1));
|
|
164
|
+
l(this, et, e.state(e.proxy([])));
|
|
165
|
+
l(
|
|
166
|
+
this,
|
|
167
|
+
st,
|
|
168
|
+
// ==================== PLUGIN STATE ====================
|
|
169
|
+
/** Plugin-registered menu buttons */
|
|
170
|
+
e.state(e.proxy([]))
|
|
171
|
+
);
|
|
172
|
+
l(this, nt, e.state(e.proxy([])));
|
|
173
|
+
l(this, at, e.state(null));
|
|
174
|
+
ft(this, "pluginEventHandlers", /* @__PURE__ */ new Map());
|
|
175
|
+
this.manifestId = t || null, this.canvasId = s || null, this.manifestId && k.fetchManifest(this.manifestId);
|
|
176
|
+
for (const r of i)
|
|
177
|
+
this.registerPlugin(r);
|
|
178
|
+
}
|
|
179
|
+
get manifestId() {
|
|
180
|
+
return e.get(n(this, R));
|
|
181
|
+
}
|
|
182
|
+
set manifestId(t) {
|
|
183
|
+
e.set(n(this, R), t, !0);
|
|
184
|
+
}
|
|
185
|
+
get canvasId() {
|
|
186
|
+
return e.get(n(this, G));
|
|
187
|
+
}
|
|
188
|
+
set canvasId(t) {
|
|
189
|
+
e.set(n(this, G), t, !0);
|
|
190
|
+
}
|
|
191
|
+
get showAnnotations() {
|
|
192
|
+
return e.get(n(this, B));
|
|
193
|
+
}
|
|
194
|
+
set showAnnotations(t) {
|
|
195
|
+
e.set(n(this, B), t, !0);
|
|
196
|
+
}
|
|
197
|
+
get showThumbnailGallery() {
|
|
198
|
+
return e.get(n(this, T));
|
|
199
|
+
}
|
|
200
|
+
set showThumbnailGallery(t) {
|
|
201
|
+
e.set(n(this, T), t, !0);
|
|
202
|
+
}
|
|
203
|
+
get isGalleryDockedBottom() {
|
|
204
|
+
return e.get(n(this, j));
|
|
205
|
+
}
|
|
206
|
+
set isGalleryDockedBottom(t) {
|
|
207
|
+
e.set(n(this, j), t, !0);
|
|
208
|
+
}
|
|
209
|
+
get isGalleryDockedRight() {
|
|
210
|
+
return e.get(n(this, V));
|
|
211
|
+
}
|
|
212
|
+
set isGalleryDockedRight(t) {
|
|
213
|
+
e.set(n(this, V), t, !0);
|
|
214
|
+
}
|
|
215
|
+
get isFullScreen() {
|
|
216
|
+
return e.get(n(this, O));
|
|
217
|
+
}
|
|
218
|
+
set isFullScreen(t) {
|
|
219
|
+
e.set(n(this, O), t, !0);
|
|
220
|
+
}
|
|
221
|
+
get showMetadataDialog() {
|
|
222
|
+
return e.get(n(this, F));
|
|
223
|
+
}
|
|
224
|
+
set showMetadataDialog(t) {
|
|
225
|
+
e.set(n(this, F), t, !0);
|
|
226
|
+
}
|
|
227
|
+
get dockSide() {
|
|
228
|
+
return e.get(n(this, Q));
|
|
229
|
+
}
|
|
230
|
+
set dockSide(t) {
|
|
231
|
+
e.set(n(this, Q), t, !0);
|
|
232
|
+
}
|
|
233
|
+
get visibleAnnotationIds() {
|
|
234
|
+
return e.get(n(this, Z));
|
|
235
|
+
}
|
|
236
|
+
set visibleAnnotationIds(t) {
|
|
237
|
+
e.set(n(this, Z), t, !0);
|
|
238
|
+
}
|
|
239
|
+
get config() {
|
|
240
|
+
return e.get(n(this, z));
|
|
241
|
+
}
|
|
242
|
+
set config(t) {
|
|
243
|
+
e.set(n(this, z), t, !0);
|
|
244
|
+
}
|
|
245
|
+
get showRightMenu() {
|
|
246
|
+
return this.config.showRightMenu ?? !0;
|
|
247
|
+
}
|
|
248
|
+
get showLeftMenu() {
|
|
249
|
+
return this.config.showLeftMenu ?? !0;
|
|
250
|
+
}
|
|
251
|
+
get showCanvasNav() {
|
|
252
|
+
return this.config.showCanvasNav ?? !0;
|
|
253
|
+
}
|
|
254
|
+
get galleryPosition() {
|
|
255
|
+
return e.get(n(this, H));
|
|
256
|
+
}
|
|
257
|
+
set galleryPosition(t) {
|
|
258
|
+
e.set(n(this, H), t, !0);
|
|
259
|
+
}
|
|
260
|
+
get gallerySize() {
|
|
261
|
+
return e.get(n(this, N));
|
|
262
|
+
}
|
|
263
|
+
set gallerySize(t) {
|
|
264
|
+
e.set(n(this, N), t, !0);
|
|
265
|
+
}
|
|
266
|
+
get isGalleryDragging() {
|
|
267
|
+
return e.get(n(this, U));
|
|
268
|
+
}
|
|
269
|
+
set isGalleryDragging(t) {
|
|
270
|
+
e.set(n(this, U), t, !0);
|
|
271
|
+
}
|
|
272
|
+
get galleryDragOffset() {
|
|
273
|
+
return e.get(n(this, q));
|
|
274
|
+
}
|
|
275
|
+
set galleryDragOffset(t) {
|
|
276
|
+
e.set(n(this, q), t, !0);
|
|
277
|
+
}
|
|
278
|
+
get dragOverSide() {
|
|
279
|
+
return e.get(n(this, K));
|
|
280
|
+
}
|
|
281
|
+
set dragOverSide(t) {
|
|
282
|
+
e.set(n(this, K), t, !0);
|
|
283
|
+
}
|
|
284
|
+
get galleryCenterPanelRect() {
|
|
285
|
+
return e.get(n(this, $));
|
|
286
|
+
}
|
|
287
|
+
set galleryCenterPanelRect(t) {
|
|
288
|
+
e.set(n(this, $), t, !0);
|
|
289
|
+
}
|
|
290
|
+
setEventTarget(t) {
|
|
291
|
+
this.eventTarget = t;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Get current state as a plain object snapshot.
|
|
295
|
+
* Safe to use outside Svelte's reactive system.
|
|
296
|
+
* NOTE: We calculate currentCanvasIndex inline to avoid triggering the canvases getter
|
|
297
|
+
* which can cause infinite loops when it auto-sets canvasId.
|
|
298
|
+
*/
|
|
299
|
+
getSnapshot() {
|
|
300
|
+
let t = -1;
|
|
301
|
+
return this.manifestId && this.canvasId && (t = k.getCanvases(this.manifestId).findIndex((i) => (i.id || i["@id"] || (i.getCanvasId ? i.getCanvasId() : null) || (i.getId ? i.getId() : null)) === this.canvasId)), {
|
|
302
|
+
manifestId: this.manifestId,
|
|
303
|
+
canvasId: this.canvasId,
|
|
304
|
+
currentCanvasIndex: t,
|
|
305
|
+
showAnnotations: this.showAnnotations,
|
|
306
|
+
showThumbnailGallery: this.showThumbnailGallery,
|
|
307
|
+
showSearchPanel: this.showSearchPanel,
|
|
308
|
+
searchQuery: this.searchQuery,
|
|
309
|
+
isFullScreen: this.isFullScreen,
|
|
310
|
+
dockSide: this.dockSide
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Dispatch a state change event to the web component.
|
|
315
|
+
* No-op if eventTarget is null (Svelte component usage).
|
|
316
|
+
*
|
|
317
|
+
* Uses queueMicrotask to dispatch asynchronously AFTER the current
|
|
318
|
+
* reactive cycle completes, preventing infinite update loops.
|
|
319
|
+
*/
|
|
320
|
+
dispatchStateChange(t = "statechange") {
|
|
321
|
+
console.log(`[ViewerState] Dispatching ${t}`, JSON.stringify(this.getSnapshot())), this.eventTarget && queueMicrotask(() => {
|
|
322
|
+
var s;
|
|
323
|
+
(s = this.eventTarget) == null || s.dispatchEvent(new CustomEvent(t, { detail: this.getSnapshot(), bubbles: !0, composed: !0 }));
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
get manifest() {
|
|
327
|
+
return this.manifestId ? k.getManifest(this.manifestId) : null;
|
|
328
|
+
}
|
|
329
|
+
get manifestEntry() {
|
|
330
|
+
return this.manifestId ? k.getManifestEntry(this.manifestId) : null;
|
|
331
|
+
}
|
|
332
|
+
get canvases() {
|
|
333
|
+
return this.manifestId ? k.getCanvases(this.manifestId) : [];
|
|
334
|
+
}
|
|
335
|
+
get currentCanvasIndex() {
|
|
336
|
+
return this.canvasId ? this.canvases.findIndex((t) => (t.id || t["@id"] || (t.getCanvasId ? t.getCanvasId() : null) || (t.getId ? t.getId() : null)) === this.canvasId) : this.canvases.length > 0 ? 0 : -1;
|
|
337
|
+
}
|
|
338
|
+
get hasNext() {
|
|
339
|
+
return this.currentCanvasIndex < this.canvases.length - 1;
|
|
340
|
+
}
|
|
341
|
+
get hasPrevious() {
|
|
342
|
+
return this.currentCanvasIndex > 0;
|
|
343
|
+
}
|
|
344
|
+
nextCanvas() {
|
|
345
|
+
if (this.hasNext) {
|
|
346
|
+
const t = this.currentCanvasIndex + 1, s = this.canvases[t];
|
|
347
|
+
this.setCanvas(s.id);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
previousCanvas() {
|
|
351
|
+
if (this.hasPrevious) {
|
|
352
|
+
const t = this.currentCanvasIndex - 1, s = this.canvases[t];
|
|
353
|
+
this.setCanvas(s.id);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
setManifest(t) {
|
|
357
|
+
this.manifestId = t, this.canvasId = null, k.fetchManifest(t), this.dispatchStateChange("manifestchange");
|
|
358
|
+
}
|
|
359
|
+
setCanvas(t) {
|
|
360
|
+
this.canvasId = t, this.dispatchStateChange("canvaschange");
|
|
361
|
+
}
|
|
362
|
+
updateConfig(t) {
|
|
363
|
+
var i;
|
|
364
|
+
const s = this.config;
|
|
365
|
+
if (this.config = t, t.gallery && (t.gallery.open !== void 0 && (this.showThumbnailGallery = t.gallery.open), t.gallery.dockPosition !== void 0 && (this.dockSide = t.gallery.dockPosition)), t.search) {
|
|
366
|
+
t.search.open !== void 0 && (this.showSearchPanel = t.search.open);
|
|
367
|
+
const r = t.search.query, u = (i = s.search) == null ? void 0 : i.query;
|
|
368
|
+
r !== void 0 && r !== u && r !== this.searchQuery && this._performSearch(r);
|
|
369
|
+
}
|
|
370
|
+
t.annotations && t.annotations.open !== void 0 && (this.showAnnotations = t.annotations.open);
|
|
371
|
+
}
|
|
372
|
+
toggleAnnotations() {
|
|
373
|
+
this.showAnnotations = !this.showAnnotations, this.dispatchStateChange();
|
|
374
|
+
}
|
|
375
|
+
toggleThumbnailGallery() {
|
|
376
|
+
this.showThumbnailGallery = !this.showThumbnailGallery, this.dispatchStateChange();
|
|
377
|
+
}
|
|
378
|
+
toggleFullScreen() {
|
|
379
|
+
if (document.fullscreenElement)
|
|
380
|
+
document.exitFullscreen();
|
|
381
|
+
else {
|
|
382
|
+
const t = document.getElementById("triiiceratops-viewer");
|
|
383
|
+
t && t.requestFullscreen().catch((s) => {
|
|
384
|
+
console.warn("Fullscreen request failed", s);
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
toggleMetadataDialog() {
|
|
389
|
+
this.showMetadataDialog = !this.showMetadataDialog;
|
|
390
|
+
}
|
|
391
|
+
get searchQuery() {
|
|
392
|
+
return e.get(n(this, W));
|
|
393
|
+
}
|
|
394
|
+
set searchQuery(t) {
|
|
395
|
+
e.set(n(this, W), t, !0);
|
|
396
|
+
}
|
|
397
|
+
get pendingSearchQuery() {
|
|
398
|
+
return e.get(n(this, J));
|
|
399
|
+
}
|
|
400
|
+
set pendingSearchQuery(t) {
|
|
401
|
+
e.set(n(this, J), t, !0);
|
|
402
|
+
}
|
|
403
|
+
get searchResults() {
|
|
404
|
+
return e.get(n(this, X));
|
|
405
|
+
}
|
|
406
|
+
set searchResults(t) {
|
|
407
|
+
e.set(n(this, X), t, !0);
|
|
408
|
+
}
|
|
409
|
+
get isSearching() {
|
|
410
|
+
return e.get(n(this, Y));
|
|
411
|
+
}
|
|
412
|
+
set isSearching(t) {
|
|
413
|
+
e.set(n(this, Y), t, !0);
|
|
414
|
+
}
|
|
415
|
+
get showSearchPanel() {
|
|
416
|
+
return e.get(n(this, tt));
|
|
417
|
+
}
|
|
418
|
+
set showSearchPanel(t) {
|
|
419
|
+
e.set(n(this, tt), t, !0);
|
|
420
|
+
}
|
|
421
|
+
toggleSearchPanel() {
|
|
422
|
+
this.showSearchPanel = !this.showSearchPanel, this.showSearchPanel || (this.searchAnnotations = []), this.dispatchStateChange();
|
|
423
|
+
}
|
|
424
|
+
get searchAnnotations() {
|
|
425
|
+
return e.get(n(this, et));
|
|
426
|
+
}
|
|
427
|
+
set searchAnnotations(t) {
|
|
428
|
+
e.set(n(this, et), t, !0);
|
|
429
|
+
}
|
|
430
|
+
get currentCanvasSearchAnnotations() {
|
|
431
|
+
return this.canvasId ? this.searchAnnotations.filter((t) => t.canvasId === this.canvasId) : [];
|
|
432
|
+
}
|
|
433
|
+
async search(t) {
|
|
434
|
+
this.dispatchStateChange(), await this._performSearch(t), this.dispatchStateChange();
|
|
435
|
+
}
|
|
436
|
+
async _performSearch(t) {
|
|
437
|
+
var s, i;
|
|
438
|
+
if (t.trim()) {
|
|
439
|
+
this.isSearching = !0, this.searchQuery = t, this.searchResults = [];
|
|
440
|
+
try {
|
|
441
|
+
const r = this.manifest;
|
|
442
|
+
if (!r) {
|
|
443
|
+
console.log("[ViewerState] Manifest not loaded, deferring search:", t), this.pendingSearchQuery = t;
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
let u = r.getService("http://iiif.io/api/search/1/search") || r.getService("http://iiif.io/api/search/0/search");
|
|
447
|
+
if (u || r.__jsonld && r.__jsonld.service && (u = (Array.isArray(r.__jsonld.service) ? r.__jsonld.service : [r.__jsonld.service]).find((h) => h.profile === "http://iiif.io/api/search/1/search" || h.profile === "http://iiif.io/api/search/0/search")), !u) {
|
|
448
|
+
console.warn("No IIIF search service found in manifest"), this.isSearching = !1;
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
const A = `${u.id || u["@id"]}?q=${encodeURIComponent(t)}`, c = await fetch(A);
|
|
452
|
+
if (!c.ok) throw new Error("Search request failed");
|
|
453
|
+
const d = await c.json(), w = d.resources || [], _ = [], it = (o) => {
|
|
454
|
+
const h = typeof o == "string" ? o : o["@id"] || o.id;
|
|
455
|
+
if (!h) return null;
|
|
456
|
+
const g = h.split("#xywh=");
|
|
457
|
+
if (g.length < 2) return null;
|
|
458
|
+
const m = g[1].split(",").map(Number);
|
|
459
|
+
return m.length === 4 ? m : null;
|
|
460
|
+
};
|
|
461
|
+
if (d.hits)
|
|
462
|
+
for (const o of d.hits) {
|
|
463
|
+
const h = o.annotations || [], g = /* @__PURE__ */ new Map();
|
|
464
|
+
for (const m of h) {
|
|
465
|
+
const f = w.find((p) => p["@id"] === m || p.id === m);
|
|
466
|
+
if (f && f.on) {
|
|
467
|
+
const p = typeof f.on == "string" ? f.on : f.on["@id"] || f.on.id, y = p.split("#")[0], S = it(p), L = this.canvases.findIndex((I) => I.id === y);
|
|
468
|
+
if (L >= 0) {
|
|
469
|
+
if (!g.has(L)) {
|
|
470
|
+
const I = this.canvases[L];
|
|
471
|
+
let x = "Canvas " + (L + 1);
|
|
472
|
+
try {
|
|
473
|
+
if (I.getLabel) {
|
|
474
|
+
const b = I.getLabel();
|
|
475
|
+
Array.isArray(b) && b.length > 0 ? x = b[0].value : typeof b == "string" && (x = b);
|
|
476
|
+
} else I.label && (typeof I.label == "string" ? x = I.label : Array.isArray(I.label) && (x = (s = I.label[0]) == null ? void 0 : s.value));
|
|
477
|
+
} catch {
|
|
478
|
+
}
|
|
479
|
+
g.set(L, { label: String(x), bounds: [] });
|
|
480
|
+
}
|
|
481
|
+
S && g.get(L).bounds.push(S);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
for (const [m, f] of g)
|
|
486
|
+
_.push({
|
|
487
|
+
type: "hit",
|
|
488
|
+
before: o.before,
|
|
489
|
+
match: o.match,
|
|
490
|
+
after: o.after,
|
|
491
|
+
canvasIndex: m,
|
|
492
|
+
canvasLabel: f.label,
|
|
493
|
+
// Store all bounds for this hit on this canvas
|
|
494
|
+
allBounds: f.bounds,
|
|
495
|
+
// Keep first bounds for backwards compatibility
|
|
496
|
+
bounds: f.bounds.length > 0 ? f.bounds[0] : null
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
else if (w.length > 0)
|
|
500
|
+
for (const o of w) {
|
|
501
|
+
const h = typeof o.on == "string" ? o.on : o.on["@id"] || o.on.id, g = h.split("#")[0], m = it(h), f = this.canvases.findIndex((p) => p.id === g);
|
|
502
|
+
if (f >= 0) {
|
|
503
|
+
const p = this.canvases[f];
|
|
504
|
+
let y = "Canvas " + (f + 1);
|
|
505
|
+
try {
|
|
506
|
+
if (p.getLabel) {
|
|
507
|
+
const S = p.getLabel();
|
|
508
|
+
Array.isArray(S) && S.length > 0 ? y = S[0].value : typeof S == "string" && (y = S);
|
|
509
|
+
} else p.label && (typeof p.label == "string" ? y = p.label : Array.isArray(p.label) && (y = (i = p.label[0]) == null ? void 0 : i.value));
|
|
510
|
+
} catch {
|
|
511
|
+
}
|
|
512
|
+
_.push({
|
|
513
|
+
type: "resource",
|
|
514
|
+
match: o.resource && o.resource.chars ? o.resource.chars : o.chars || "",
|
|
515
|
+
canvasIndex: f,
|
|
516
|
+
canvasLabel: String(y),
|
|
517
|
+
bounds: m
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
this.searchResults = _;
|
|
522
|
+
let gt = 0;
|
|
523
|
+
this.searchAnnotations = _.flatMap((o) => {
|
|
524
|
+
const h = this.canvases[o.canvasIndex];
|
|
525
|
+
return (o.allBounds && o.allBounds.length > 0 ? o.allBounds : o.bounds ? [o.bounds] : []).map((m) => {
|
|
526
|
+
const f = `${h.id}#xywh=${m.join(",")}`;
|
|
527
|
+
return {
|
|
528
|
+
"@id": `urn:search-hit:${gt++}`,
|
|
529
|
+
"@type": "oa:Annotation",
|
|
530
|
+
motivation: "sc:painting",
|
|
531
|
+
on: f,
|
|
532
|
+
canvasId: h.id,
|
|
533
|
+
resource: { "@type": "cnt:ContentAsText", chars: o.match },
|
|
534
|
+
// Flag to identify styling in Overlay?
|
|
535
|
+
// Or just standard rendering.
|
|
536
|
+
isSearchHit: !0
|
|
537
|
+
};
|
|
538
|
+
});
|
|
539
|
+
});
|
|
540
|
+
} catch (r) {
|
|
541
|
+
console.error("Search error:", r);
|
|
542
|
+
} finally {
|
|
543
|
+
this.isSearching = !1;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
get pluginMenuButtons() {
|
|
548
|
+
return e.get(n(this, st));
|
|
549
|
+
}
|
|
550
|
+
set pluginMenuButtons(t) {
|
|
551
|
+
e.set(n(this, st), t, !0);
|
|
552
|
+
}
|
|
553
|
+
get pluginPanels() {
|
|
554
|
+
return e.get(n(this, nt));
|
|
555
|
+
}
|
|
556
|
+
set pluginPanels(t) {
|
|
557
|
+
e.set(n(this, nt), t, !0);
|
|
558
|
+
}
|
|
559
|
+
get osdViewer() {
|
|
560
|
+
return e.get(n(this, at));
|
|
561
|
+
}
|
|
562
|
+
set osdViewer(t) {
|
|
563
|
+
e.set(n(this, at), t);
|
|
564
|
+
}
|
|
565
|
+
registerPlugin(t) {
|
|
566
|
+
const s = t.id || `plugin-${Math.random().toString(36).substr(2, 9)}`;
|
|
567
|
+
let i = e.state(!1);
|
|
568
|
+
const r = {
|
|
569
|
+
id: `${s}:toggle`,
|
|
570
|
+
icon: t.icon,
|
|
571
|
+
tooltip: t.name,
|
|
572
|
+
onClick: () => {
|
|
573
|
+
e.set(i, !e.get(i));
|
|
574
|
+
},
|
|
575
|
+
isActive: () => e.get(i),
|
|
576
|
+
order: 200
|
|
577
|
+
// Default order for simple plugins
|
|
578
|
+
}, u = {
|
|
579
|
+
id: `${s}:panel`,
|
|
580
|
+
component: t.panel,
|
|
581
|
+
position: t.position || "left",
|
|
582
|
+
isVisible: () => e.get(i),
|
|
583
|
+
props: {
|
|
584
|
+
...t.props,
|
|
585
|
+
// Pass isOpen state and closer to component
|
|
586
|
+
isOpen: e.get(i),
|
|
587
|
+
close: () => {
|
|
588
|
+
e.set(i, !1);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
this.pluginMenuButtons = [...this.pluginMenuButtons, r], this.pluginPanels = [...this.pluginPanels, u], t.onInit && t.onInit(this);
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Unregister a plugin's UI components by ID prefix.
|
|
596
|
+
* Note: This cleans up the menu button and panel, but doesn't remove listeners attached by the plugin itself
|
|
597
|
+
* since we don't have a handle on the plugin instance or its cleanup function anymore.
|
|
598
|
+
* Plugins should manage their own cleanup via component lifecycle (onDestroy) if possible.
|
|
599
|
+
*/
|
|
600
|
+
unregisterPlugin(t) {
|
|
601
|
+
this.pluginMenuButtons = this.pluginMenuButtons.filter((s) => !s.id.startsWith(`${t}:`)), this.pluginPanels = this.pluginPanels.filter((s) => !s.id.startsWith(`${t}:`));
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Notify that OSD viewer is ready.
|
|
605
|
+
* With the component-based system, we don't notify plugins individually.
|
|
606
|
+
* Instead, plugins should use the OSDViewer instance from context or listen for 'osd-ready' event (if we emitted one).
|
|
607
|
+
* But since we have direct access to osdViewer in this state, components can just react to it.
|
|
608
|
+
*/
|
|
609
|
+
notifyOSDReady(t) {
|
|
610
|
+
this.osdViewer = t;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Cleanup everything.
|
|
614
|
+
*/
|
|
615
|
+
destroyAllPlugins() {
|
|
616
|
+
this.pluginMenuButtons = [], this.pluginPanels = [], this.pluginEventHandlers.clear();
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
R = new WeakMap(), G = new WeakMap(), B = new WeakMap(), T = new WeakMap(), j = new WeakMap(), V = new WeakMap(), O = new WeakMap(), F = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), z = new WeakMap(), H = new WeakMap(), N = new WeakMap(), U = new WeakMap(), q = new WeakMap(), K = new WeakMap(), $ = new WeakMap(), W = new WeakMap(), J = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), st = new WeakMap(), nt = new WeakMap(), at = new WeakMap();
|
|
620
|
+
const ie = "triiiceratops:viewerState";
|
|
621
|
+
let vt = Symbol("phosphor-svelte");
|
|
622
|
+
function Ot() {
|
|
623
|
+
return Tt(vt) ? jt(vt) : {};
|
|
624
|
+
}
|
|
625
|
+
const Ft = "en", dt = (
|
|
626
|
+
/** @type {const} */
|
|
627
|
+
["en", "de"]
|
|
628
|
+
), yt = "PARAGLIDE_LOCALE", Qt = 3456e4, wt = [
|
|
629
|
+
"cookie",
|
|
630
|
+
"globalVariable",
|
|
631
|
+
"baseLocale"
|
|
632
|
+
];
|
|
633
|
+
globalThis.__paraglide = {};
|
|
634
|
+
let ct, mt = !1, St = () => {
|
|
635
|
+
let a;
|
|
636
|
+
for (const t of wt) {
|
|
637
|
+
if (t === "cookie")
|
|
638
|
+
a = Nt();
|
|
639
|
+
else if (t === "baseLocale")
|
|
640
|
+
a = Ft;
|
|
641
|
+
else if (t === "globalVariable" && ct !== void 0)
|
|
642
|
+
a = ct;
|
|
643
|
+
else if (At(t) && ut.has(t)) {
|
|
644
|
+
const s = ut.get(t);
|
|
645
|
+
if (s) {
|
|
646
|
+
const i = s.getLocale();
|
|
647
|
+
if (i instanceof Promise)
|
|
648
|
+
continue;
|
|
649
|
+
a = i;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
if (a !== void 0) {
|
|
653
|
+
const s = Ht(a);
|
|
654
|
+
return mt || (ct = s, mt = !0, bt(s, { reload: !1 })), s;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
throw new Error("No locale found. Read the docs https://inlang.com/m/gerre34r/library-inlang-paraglideJs/errors#no-locale-found");
|
|
658
|
+
};
|
|
659
|
+
const Zt = (a) => {
|
|
660
|
+
window.location.reload();
|
|
661
|
+
};
|
|
662
|
+
let bt = (a, t) => {
|
|
663
|
+
const s = {
|
|
664
|
+
reload: !0,
|
|
665
|
+
...t
|
|
666
|
+
};
|
|
667
|
+
let i;
|
|
668
|
+
try {
|
|
669
|
+
i = St();
|
|
670
|
+
} catch {
|
|
671
|
+
}
|
|
672
|
+
const r = [];
|
|
673
|
+
for (const v of wt)
|
|
674
|
+
if (v === "globalVariable")
|
|
675
|
+
ct = a;
|
|
676
|
+
else if (v === "cookie") {
|
|
677
|
+
if (typeof document > "u" || typeof window > "u")
|
|
678
|
+
continue;
|
|
679
|
+
const A = `${yt}=${a}; path=/; max-age=${Qt}`;
|
|
680
|
+
document.cookie = A;
|
|
681
|
+
} else {
|
|
682
|
+
if (v === "baseLocale")
|
|
683
|
+
continue;
|
|
684
|
+
if (At(v) && ut.has(v)) {
|
|
685
|
+
const A = ut.get(v);
|
|
686
|
+
if (A) {
|
|
687
|
+
let c = A.setLocale(a);
|
|
688
|
+
c instanceof Promise && (c = c.catch((d) => {
|
|
689
|
+
throw new Error(`Custom strategy "${v}" setLocale failed.`, {
|
|
690
|
+
cause: d
|
|
691
|
+
});
|
|
692
|
+
}), r.push(c));
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
const u = () => {
|
|
697
|
+
s.reload && window.location && a !== i && Zt();
|
|
698
|
+
};
|
|
699
|
+
if (r.length)
|
|
700
|
+
return Promise.all(r).then(() => {
|
|
701
|
+
u();
|
|
702
|
+
});
|
|
703
|
+
u();
|
|
704
|
+
};
|
|
705
|
+
const re = (a) => {
|
|
706
|
+
bt = /** @type {SetLocaleFn} */
|
|
707
|
+
a;
|
|
708
|
+
};
|
|
709
|
+
function zt(a) {
|
|
710
|
+
return typeof a != "string" ? !1 : a ? dt.some((t) => t.toLowerCase() === a.toLowerCase()) : !1;
|
|
711
|
+
}
|
|
712
|
+
function Ht(a) {
|
|
713
|
+
if (typeof a != "string")
|
|
714
|
+
throw new Error(`Invalid locale: ${a}. Expected a string.`);
|
|
715
|
+
const t = a.toLowerCase(), s = dt.find((i) => i.toLowerCase() === t);
|
|
716
|
+
if (!s)
|
|
717
|
+
throw new Error(`Invalid locale: ${a}. Expected one of: ${dt.join(", ")}`);
|
|
718
|
+
return s;
|
|
719
|
+
}
|
|
720
|
+
function Nt() {
|
|
721
|
+
if (typeof document > "u" || !document.cookie)
|
|
722
|
+
return;
|
|
723
|
+
const a = document.cookie.match(new RegExp(`(^| )${yt}=([^;]+)`)), t = a == null ? void 0 : a[2];
|
|
724
|
+
if (zt(t))
|
|
725
|
+
return t;
|
|
726
|
+
}
|
|
727
|
+
const ut = /* @__PURE__ */ new Map();
|
|
728
|
+
function At(a) {
|
|
729
|
+
return typeof a == "string" && /^custom-[A-Za-z0-9_-]+$/.test(a);
|
|
730
|
+
}
|
|
731
|
+
const Ut = (
|
|
732
|
+
/** @type {(inputs: {}) => LocalizedString} */
|
|
733
|
+
() => (
|
|
734
|
+
/** @type {LocalizedString} */
|
|
735
|
+
"Close"
|
|
736
|
+
)
|
|
737
|
+
), qt = (
|
|
738
|
+
/** @type {(inputs: {}) => LocalizedString} */
|
|
739
|
+
() => (
|
|
740
|
+
/** @type {LocalizedString} */
|
|
741
|
+
"Schließen"
|
|
742
|
+
)
|
|
743
|
+
), oe = /* @__NO_SIDE_EFFECTS__ */ (a = {}, t = {}) => (t.locale ?? St()) === "en" ? Ut() : qt();
|
|
744
|
+
var Kt = e.from_svg('<path d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"></path>'), $t = e.from_svg('<path d="M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z" opacity="0.2"></path><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>', 1), Wt = e.from_svg('<path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>'), Jt = e.from_svg('<path d="M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"></path>'), Xt = e.from_svg('<path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>'), Yt = e.from_svg('<path d="M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"></path>'), te = e.from_svg('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');
|
|
745
|
+
function le(a, t) {
|
|
746
|
+
e.push(t, !0);
|
|
747
|
+
const s = Ot();
|
|
748
|
+
let i = e.rest_props(t, ["$$slots", "$$events", "$$legacy", "children"]), r = e.derived(() => t.weight ?? s.weight ?? "regular"), u = e.derived(() => t.color ?? s.color ?? "currentColor"), v = e.derived(() => t.size ?? s.size ?? "1em"), A = e.derived(() => t.mirrored ?? s.mirrored ?? !1);
|
|
749
|
+
function c(h) {
|
|
750
|
+
let { weight: g, color: m, size: f, mirrored: p, ...y } = h;
|
|
751
|
+
return y;
|
|
752
|
+
}
|
|
753
|
+
var d = te();
|
|
754
|
+
e.attribute_effect(
|
|
755
|
+
d,
|
|
756
|
+
(h, g) => ({
|
|
757
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
758
|
+
role: "img",
|
|
759
|
+
width: e.get(v),
|
|
760
|
+
height: e.get(v),
|
|
761
|
+
fill: e.get(u),
|
|
762
|
+
transform: e.get(A) ? "scale(-1, 1)" : void 0,
|
|
763
|
+
viewBox: "0 0 256 256",
|
|
764
|
+
...h,
|
|
765
|
+
...g
|
|
766
|
+
}),
|
|
767
|
+
[() => c(s), () => c(i)]
|
|
768
|
+
);
|
|
769
|
+
var w = e.child(d);
|
|
770
|
+
{
|
|
771
|
+
var _ = (h) => {
|
|
772
|
+
var g = e.comment(), m = e.first_child(g);
|
|
773
|
+
e.snippet(m, () => t.children), e.append(h, g);
|
|
774
|
+
};
|
|
775
|
+
e.if(w, (h) => {
|
|
776
|
+
t.children && h(_);
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
var it = e.sibling(w, 2);
|
|
780
|
+
{
|
|
781
|
+
var gt = (h) => {
|
|
782
|
+
var g = Kt();
|
|
783
|
+
e.append(h, g);
|
|
784
|
+
}, o = (h) => {
|
|
785
|
+
var g = e.comment(), m = e.first_child(g);
|
|
786
|
+
{
|
|
787
|
+
var f = (y) => {
|
|
788
|
+
var S = $t();
|
|
789
|
+
e.next(), e.append(y, S);
|
|
790
|
+
}, p = (y) => {
|
|
791
|
+
var S = e.comment(), L = e.first_child(S);
|
|
792
|
+
{
|
|
793
|
+
var I = (b) => {
|
|
794
|
+
var rt = Wt();
|
|
795
|
+
e.append(b, rt);
|
|
796
|
+
}, x = (b) => {
|
|
797
|
+
var rt = e.comment(), It = e.first_child(rt);
|
|
798
|
+
{
|
|
799
|
+
var _t = (M) => {
|
|
800
|
+
var ot = Jt();
|
|
801
|
+
e.append(M, ot);
|
|
802
|
+
}, Lt = (M) => {
|
|
803
|
+
var ot = e.comment(), xt = e.first_child(ot);
|
|
804
|
+
{
|
|
805
|
+
var Mt = (C) => {
|
|
806
|
+
var lt = Xt();
|
|
807
|
+
e.append(C, lt);
|
|
808
|
+
}, Ct = (C) => {
|
|
809
|
+
var lt = e.comment(), Pt = e.first_child(lt);
|
|
810
|
+
{
|
|
811
|
+
var kt = (P) => {
|
|
812
|
+
var ht = Yt();
|
|
813
|
+
e.append(P, ht);
|
|
814
|
+
}, Et = (P) => {
|
|
815
|
+
var ht = e.text();
|
|
816
|
+
ht.nodeValue = (console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'), ""), e.append(P, ht);
|
|
817
|
+
};
|
|
818
|
+
e.if(
|
|
819
|
+
Pt,
|
|
820
|
+
(P) => {
|
|
821
|
+
e.get(r) === "thin" ? P(kt) : P(Et, !1);
|
|
822
|
+
},
|
|
823
|
+
!0
|
|
824
|
+
);
|
|
825
|
+
}
|
|
826
|
+
e.append(C, lt);
|
|
827
|
+
};
|
|
828
|
+
e.if(
|
|
829
|
+
xt,
|
|
830
|
+
(C) => {
|
|
831
|
+
e.get(r) === "regular" ? C(Mt) : C(Ct, !1);
|
|
832
|
+
},
|
|
833
|
+
!0
|
|
834
|
+
);
|
|
835
|
+
}
|
|
836
|
+
e.append(M, ot);
|
|
837
|
+
};
|
|
838
|
+
e.if(
|
|
839
|
+
It,
|
|
840
|
+
(M) => {
|
|
841
|
+
e.get(r) === "light" ? M(_t) : M(Lt, !1);
|
|
842
|
+
},
|
|
843
|
+
!0
|
|
844
|
+
);
|
|
845
|
+
}
|
|
846
|
+
e.append(b, rt);
|
|
847
|
+
};
|
|
848
|
+
e.if(
|
|
849
|
+
L,
|
|
850
|
+
(b) => {
|
|
851
|
+
e.get(r) === "fill" ? b(I) : b(x, !1);
|
|
852
|
+
},
|
|
853
|
+
!0
|
|
854
|
+
);
|
|
855
|
+
}
|
|
856
|
+
e.append(y, S);
|
|
857
|
+
};
|
|
858
|
+
e.if(
|
|
859
|
+
m,
|
|
860
|
+
(y) => {
|
|
861
|
+
e.get(r) === "duotone" ? y(f) : y(p, !1);
|
|
862
|
+
},
|
|
863
|
+
!0
|
|
864
|
+
);
|
|
865
|
+
}
|
|
866
|
+
e.append(h, g);
|
|
867
|
+
};
|
|
868
|
+
e.if(it, (h) => {
|
|
869
|
+
e.get(r) === "bold" ? h(gt) : h(o, !1);
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
e.reset(d), e.append(a, d), e.pop();
|
|
873
|
+
}
|
|
874
|
+
export {
|
|
875
|
+
Vt as M,
|
|
876
|
+
ie as V,
|
|
877
|
+
le as X,
|
|
878
|
+
St as a,
|
|
879
|
+
ae as b,
|
|
880
|
+
oe as c,
|
|
881
|
+
Ot as g,
|
|
882
|
+
dt as l,
|
|
883
|
+
k as m,
|
|
884
|
+
re as o,
|
|
885
|
+
bt as s
|
|
886
|
+
};
|