@whereby.com/browser-sdk 2.0.0-alpha9 → 2.0.0-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -29
- package/dist/LocalMedia.d.ts +70 -0
- package/dist/LocalMedia.js +208 -0
- package/dist/RoomConnection.d.ts +190 -0
- package/dist/RoomConnection.js +646 -0
- package/dist/RoomParticipant.d.ts +50 -0
- package/dist/RoomParticipant.js +48 -0
- package/dist/api/ApiClient.d.ts +26 -0
- package/dist/api/ApiClient.js +61 -0
- package/dist/api/Credentials.d.ts +17 -0
- package/dist/api/Credentials.js +16 -0
- package/dist/api/HttpClient.d.ts +16 -0
- package/dist/api/HttpClient.js +52 -0
- package/dist/api/MultipartHttpClient.d.ts +10 -0
- package/dist/api/MultipartHttpClient.js +25 -0
- package/dist/api/OrganizationApiClient.d.ts +16 -0
- package/dist/api/OrganizationApiClient.js +28 -0
- package/dist/api/Response.d.ts +29 -0
- package/dist/api/Response.js +9 -0
- package/dist/api/credentialsService/index.d.ts +27 -0
- package/dist/api/credentialsService/index.js +89 -0
- package/dist/api/deviceService/index.d.ts +9 -0
- package/dist/api/deviceService/index.js +23 -0
- package/dist/api/extractUtils.d.ts +16 -0
- package/dist/api/extractUtils.js +51 -0
- package/dist/api/index.d.ts +7 -0
- package/dist/api/index.js +7 -0
- package/dist/api/localStorageWrapper/index.d.ts +2 -0
- package/dist/api/localStorageWrapper/index.js +15 -0
- package/dist/api/models/Account.d.ts +20 -0
- package/dist/api/models/Account.js +24 -0
- package/dist/api/models/Meeting.d.ts +12 -0
- package/dist/api/models/Meeting.js +29 -0
- package/dist/api/models/Organization.d.ts +102 -0
- package/dist/api/models/Organization.js +81 -0
- package/dist/api/models/Room.d.ts +4 -0
- package/dist/api/models/Room.js +38 -0
- package/dist/api/models/account/EmbeddedFreeTierStatus.d.ts +13 -0
- package/dist/api/models/account/EmbeddedFreeTierStatus.js +17 -0
- package/dist/api/modules/AbstractStore.d.ts +5 -0
- package/dist/api/modules/AbstractStore.js +1 -0
- package/dist/api/modules/ChromeStorageStore.d.ts +10 -0
- package/dist/api/modules/ChromeStorageStore.js +21 -0
- package/dist/api/modules/LocalStorageStore.d.ts +9 -0
- package/dist/api/modules/LocalStorageStore.js +35 -0
- package/dist/api/modules/tests/__mocks__/storage.d.ts +10 -0
- package/dist/api/modules/tests/__mocks__/storage.js +19 -0
- package/dist/api/organizationService/index.d.ts +46 -0
- package/dist/api/organizationService/index.js +158 -0
- package/dist/api/organizationServiceCache/index.d.ts +13 -0
- package/dist/api/organizationServiceCache/index.js +16 -0
- package/dist/api/parameterAssertUtils.d.ts +13 -0
- package/dist/api/parameterAssertUtils.js +64 -0
- package/dist/api/roomService/index.d.ts +54 -0
- package/dist/api/roomService/index.js +160 -0
- package/dist/api/test/helpers.d.ts +7 -0
- package/dist/api/test/helpers.js +32 -0
- package/dist/api/types.d.ts +5 -0
- package/dist/api/types.js +1 -0
- package/dist/embed/index.d.ts +32 -0
- package/dist/embed/index.js +124 -0
- package/dist/react/VideoView.d.ts +15 -0
- package/dist/react/VideoView.js +37 -0
- package/dist/react/index.d.ts +6 -0
- package/dist/react/index.js +4 -0
- package/dist/react/useLocalMedia.d.ts +29 -0
- package/dist/react/useLocalMedia.js +109 -0
- package/dist/react/useRoomConnection.d.ts +57 -0
- package/dist/react/useRoomConnection.js +340 -0
- package/dist/utils/debounce.d.ts +9 -0
- package/dist/utils/debounce.js +18 -0
- package/dist/utils/fakeAudioStream.d.ts +1 -0
- package/dist/utils/fakeAudioStream.js +18 -0
- package/dist/utils/fakeWebcamFrame.d.ts +1 -0
- package/dist/utils/fakeWebcamFrame.js +49 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/v2-beta2.js +2000 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +110 -81
- package/dist/lib.cjs.js +0 -5868
- package/dist/lib.esm.js +0 -5850
- package/dist/types.d.ts +0 -308
- package/dist/v2-alpha9.js +0 -43
package/dist/v2-beta2.js
ADDED
|
@@ -0,0 +1,2000 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
|
|
21
|
+
// node_modules/@ungap/weakmap/esm/index.js
|
|
22
|
+
var self = {};
|
|
23
|
+
try {
|
|
24
|
+
self.WeakMap = WeakMap;
|
|
25
|
+
} catch (WeakMap2) {
|
|
26
|
+
self.WeakMap = function(id, Object2) {
|
|
27
|
+
"use strict";
|
|
28
|
+
var dP = Object2.defineProperty;
|
|
29
|
+
var hOP = Object2.hasOwnProperty;
|
|
30
|
+
var proto = WeakMap3.prototype;
|
|
31
|
+
proto.delete = function(key) {
|
|
32
|
+
return this.has(key) && delete key[this._];
|
|
33
|
+
};
|
|
34
|
+
proto.get = function(key) {
|
|
35
|
+
return this.has(key) ? key[this._] : void 0;
|
|
36
|
+
};
|
|
37
|
+
proto.has = function(key) {
|
|
38
|
+
return hOP.call(key, this._);
|
|
39
|
+
};
|
|
40
|
+
proto.set = function(key, value) {
|
|
41
|
+
dP(key, this._, { configurable: true, value });
|
|
42
|
+
return this;
|
|
43
|
+
};
|
|
44
|
+
return WeakMap3;
|
|
45
|
+
function WeakMap3(iterable) {
|
|
46
|
+
dP(this, "_", { value: "_@ungap/weakmap" + id++ });
|
|
47
|
+
if (iterable)
|
|
48
|
+
iterable.forEach(add, this);
|
|
49
|
+
}
|
|
50
|
+
function add(pair) {
|
|
51
|
+
this.set(pair[0], pair[1]);
|
|
52
|
+
}
|
|
53
|
+
}(Math.random(), Object);
|
|
54
|
+
}
|
|
55
|
+
var esm_default = self.WeakMap;
|
|
56
|
+
|
|
57
|
+
// node_modules/uhyphen/esm/index.js
|
|
58
|
+
var esm_default2 = (camel) => camel.replace(/(([A-Z0-9])([A-Z0-9][a-z]))|(([a-z])([A-Z]))/g, "$2$5-$3$6").toLowerCase();
|
|
59
|
+
|
|
60
|
+
// node_modules/@ungap/event/esm/index.js
|
|
61
|
+
var self2 = {};
|
|
62
|
+
try {
|
|
63
|
+
self2.Event = new Event(".").constructor;
|
|
64
|
+
} catch (Event2) {
|
|
65
|
+
try {
|
|
66
|
+
self2.Event = new CustomEvent(".").constructor;
|
|
67
|
+
} catch (Event3) {
|
|
68
|
+
self2.Event = function Event4(type, init2) {
|
|
69
|
+
if (!init2)
|
|
70
|
+
init2 = {};
|
|
71
|
+
var e = document.createEvent("Event");
|
|
72
|
+
var bubbles = !!init2.bubbles;
|
|
73
|
+
var cancelable = !!init2.cancelable;
|
|
74
|
+
e.initEvent(type, bubbles, cancelable);
|
|
75
|
+
try {
|
|
76
|
+
e.bubbles = bubbles;
|
|
77
|
+
e.cancelable = cancelable;
|
|
78
|
+
} catch (e2) {
|
|
79
|
+
}
|
|
80
|
+
return e;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
var esm_default3 = self2.Event;
|
|
85
|
+
|
|
86
|
+
// node_modules/@ungap/weakset/esm/index.js
|
|
87
|
+
var self3 = {};
|
|
88
|
+
try {
|
|
89
|
+
self3.WeakSet = WeakSet;
|
|
90
|
+
} catch (WeakSet2) {
|
|
91
|
+
(function(WeakMap2) {
|
|
92
|
+
var all = new WeakMap2();
|
|
93
|
+
var proto = WeakSet3.prototype;
|
|
94
|
+
proto.add = function(value) {
|
|
95
|
+
return all.get(this).set(value, 1), this;
|
|
96
|
+
};
|
|
97
|
+
proto.delete = function(value) {
|
|
98
|
+
return all.get(this).delete(value);
|
|
99
|
+
};
|
|
100
|
+
proto.has = function(value) {
|
|
101
|
+
return all.get(this).has(value);
|
|
102
|
+
};
|
|
103
|
+
self3.WeakSet = WeakSet3;
|
|
104
|
+
function WeakSet3(iterable) {
|
|
105
|
+
"use strict";
|
|
106
|
+
all.set(this, new WeakMap2());
|
|
107
|
+
if (iterable)
|
|
108
|
+
iterable.forEach(this.add, this);
|
|
109
|
+
}
|
|
110
|
+
})(WeakMap);
|
|
111
|
+
}
|
|
112
|
+
var esm_default4 = self3.WeakSet;
|
|
113
|
+
|
|
114
|
+
// node_modules/domconstants/esm/index.js
|
|
115
|
+
var UID = "-" + Math.random().toFixed(6) + "%";
|
|
116
|
+
var UID_IE = false;
|
|
117
|
+
try {
|
|
118
|
+
if (!function(template, content, tabindex) {
|
|
119
|
+
return content in template && (template.innerHTML = "<p " + tabindex + '="' + UID + '"></p>', template[content].childNodes[0].getAttribute(tabindex) == UID);
|
|
120
|
+
}(document.createElement("template"), "content", "tabindex")) {
|
|
121
|
+
UID = "_dt: " + UID.slice(1, -1) + ";";
|
|
122
|
+
UID_IE = true;
|
|
123
|
+
}
|
|
124
|
+
} catch (meh) {
|
|
125
|
+
}
|
|
126
|
+
var UIDC = "<!--" + UID + "-->";
|
|
127
|
+
var COMMENT_NODE = 8;
|
|
128
|
+
var DOCUMENT_FRAGMENT_NODE = 11;
|
|
129
|
+
var ELEMENT_NODE = 1;
|
|
130
|
+
var TEXT_NODE = 3;
|
|
131
|
+
var SHOULD_USE_TEXT_CONTENT = /^(?:plaintext|script|style|textarea|title|xmp)$/i;
|
|
132
|
+
var VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
|
|
133
|
+
|
|
134
|
+
// node_modules/domsanitizer/esm/index.js
|
|
135
|
+
function esm_default5(template) {
|
|
136
|
+
return template.join(UIDC).replace(selfClosing, fullClosing).replace(attrSeeker, attrReplacer);
|
|
137
|
+
}
|
|
138
|
+
var spaces = " \\f\\n\\r\\t";
|
|
139
|
+
var almostEverything = "[^" + spaces + `\\/>"'=]+`;
|
|
140
|
+
var attrName = "[" + spaces + "]+" + almostEverything;
|
|
141
|
+
var tagName = "<([A-Za-z]+[A-Za-z0-9:._-]*)((?:";
|
|
142
|
+
var attrPartials = `(?:\\s*=\\s*(?:'[^']*?'|"[^"]*?"|<[^>]*?>|` + almostEverything.replace("\\/", "") + "))?)";
|
|
143
|
+
var attrSeeker = new RegExp(tagName + attrName + attrPartials + "+)([" + spaces + "]*/?>)", "g");
|
|
144
|
+
var selfClosing = new RegExp(tagName + attrName + attrPartials + "*)([" + spaces + "]*/>)", "g");
|
|
145
|
+
var findAttributes = new RegExp("(" + attrName + `\\s*=\\s*)(['"]?)` + UIDC + "\\2", "gi");
|
|
146
|
+
function attrReplacer($0, $1, $2, $3) {
|
|
147
|
+
return "<" + $1 + $2.replace(findAttributes, replaceAttributes) + $3;
|
|
148
|
+
}
|
|
149
|
+
function replaceAttributes($0, $1, $2) {
|
|
150
|
+
return $1 + ($2 || '"') + UID + ($2 || '"');
|
|
151
|
+
}
|
|
152
|
+
function fullClosing($0, $1, $2) {
|
|
153
|
+
return VOID_ELEMENTS.test($1) ? $0 : "<" + $1 + $2 + "></" + $1 + ">";
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// node_modules/uarray/esm/index.js
|
|
157
|
+
var { isArray } = Array;
|
|
158
|
+
var { indexOf, slice } = [];
|
|
159
|
+
|
|
160
|
+
// node_modules/umap/esm/index.js
|
|
161
|
+
var esm_default6 = (_) => ({
|
|
162
|
+
// About: get: _.get.bind(_)
|
|
163
|
+
// It looks like WebKit/Safari didn't optimize bind at all,
|
|
164
|
+
// so that using bind slows it down by 60%.
|
|
165
|
+
// Firefox and Chrome are just fine in both cases,
|
|
166
|
+
// so let's use the approach that works fast everywhere 👍
|
|
167
|
+
get: (key) => _.get(key),
|
|
168
|
+
set: (key, value) => (_.set(key, value), value)
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
// node_modules/uwire/esm/index.js
|
|
172
|
+
var ELEMENT_NODE2 = 1;
|
|
173
|
+
var nodeType = 111;
|
|
174
|
+
var remove = ({ firstChild, lastChild }) => {
|
|
175
|
+
const range = document.createRange();
|
|
176
|
+
range.setStartAfter(firstChild);
|
|
177
|
+
range.setEndAfter(lastChild);
|
|
178
|
+
range.deleteContents();
|
|
179
|
+
return firstChild;
|
|
180
|
+
};
|
|
181
|
+
var diffable = (node, operation) => node.nodeType === nodeType ? 1 / operation < 0 ? operation ? remove(node) : node.lastChild : operation ? node.valueOf() : node.firstChild : node;
|
|
182
|
+
var persistent = (fragment) => {
|
|
183
|
+
const { childNodes } = fragment;
|
|
184
|
+
const { length } = childNodes;
|
|
185
|
+
if (length < 2)
|
|
186
|
+
return length ? childNodes[0] : fragment;
|
|
187
|
+
const nodes = slice.call(childNodes, 0);
|
|
188
|
+
const firstChild = nodes[0];
|
|
189
|
+
const lastChild = nodes[length - 1];
|
|
190
|
+
return {
|
|
191
|
+
ELEMENT_NODE: ELEMENT_NODE2,
|
|
192
|
+
nodeType,
|
|
193
|
+
firstChild,
|
|
194
|
+
lastChild,
|
|
195
|
+
valueOf() {
|
|
196
|
+
if (childNodes.length !== length) {
|
|
197
|
+
let i = 0;
|
|
198
|
+
while (i < length)
|
|
199
|
+
fragment.appendChild(nodes[i++]);
|
|
200
|
+
}
|
|
201
|
+
return fragment;
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
// node_modules/@ungap/create-content/esm/index.js
|
|
207
|
+
var createContent = function(document2) {
|
|
208
|
+
"use strict";
|
|
209
|
+
var FRAGMENT = "fragment";
|
|
210
|
+
var TEMPLATE = "template";
|
|
211
|
+
var HAS_CONTENT = "content" in create3(TEMPLATE);
|
|
212
|
+
var createHTML = HAS_CONTENT ? function(html3) {
|
|
213
|
+
var template = create3(TEMPLATE);
|
|
214
|
+
template.innerHTML = html3;
|
|
215
|
+
return template.content;
|
|
216
|
+
} : function(html3) {
|
|
217
|
+
var content = create3(FRAGMENT);
|
|
218
|
+
var template = create3(TEMPLATE);
|
|
219
|
+
var childNodes = null;
|
|
220
|
+
if (/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(html3)) {
|
|
221
|
+
var selector2 = RegExp.$1;
|
|
222
|
+
template.innerHTML = "<table>" + html3 + "</table>";
|
|
223
|
+
childNodes = template.querySelectorAll(selector2);
|
|
224
|
+
} else {
|
|
225
|
+
template.innerHTML = html3;
|
|
226
|
+
childNodes = template.childNodes;
|
|
227
|
+
}
|
|
228
|
+
append(content, childNodes);
|
|
229
|
+
return content;
|
|
230
|
+
};
|
|
231
|
+
return function createContent2(markup, type) {
|
|
232
|
+
return (type === "svg" ? createSVG : createHTML)(markup);
|
|
233
|
+
};
|
|
234
|
+
function append(root, childNodes) {
|
|
235
|
+
var length = childNodes.length;
|
|
236
|
+
while (length--)
|
|
237
|
+
root.appendChild(childNodes[0]);
|
|
238
|
+
}
|
|
239
|
+
function create3(element) {
|
|
240
|
+
return element === FRAGMENT ? document2.createDocumentFragment() : document2.createElementNS("http://www.w3.org/1999/xhtml", element);
|
|
241
|
+
}
|
|
242
|
+
function createSVG(svg3) {
|
|
243
|
+
var content = create3(FRAGMENT);
|
|
244
|
+
var template = create3("div");
|
|
245
|
+
template.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg">' + svg3 + "</svg>";
|
|
246
|
+
append(content, template.firstChild.childNodes);
|
|
247
|
+
return content;
|
|
248
|
+
}
|
|
249
|
+
}(document);
|
|
250
|
+
var esm_default7 = createContent;
|
|
251
|
+
|
|
252
|
+
// node_modules/udomdiff/esm/index.js
|
|
253
|
+
var esm_default8 = (parentNode, a, b, get, before) => {
|
|
254
|
+
const bLength = b.length;
|
|
255
|
+
let aEnd = a.length;
|
|
256
|
+
let bEnd = bLength;
|
|
257
|
+
let aStart = 0;
|
|
258
|
+
let bStart = 0;
|
|
259
|
+
let map = null;
|
|
260
|
+
while (aStart < aEnd || bStart < bEnd) {
|
|
261
|
+
if (aEnd === aStart) {
|
|
262
|
+
const node = bEnd < bLength ? bStart ? get(b[bStart - 1], -0).nextSibling : get(b[bEnd - bStart], 0) : before;
|
|
263
|
+
while (bStart < bEnd)
|
|
264
|
+
parentNode.insertBefore(get(b[bStart++], 1), node);
|
|
265
|
+
} else if (bEnd === bStart) {
|
|
266
|
+
while (aStart < aEnd) {
|
|
267
|
+
if (!map || !map.has(a[aStart]))
|
|
268
|
+
parentNode.removeChild(get(a[aStart], -1));
|
|
269
|
+
aStart++;
|
|
270
|
+
}
|
|
271
|
+
} else if (a[aStart] === b[bStart]) {
|
|
272
|
+
aStart++;
|
|
273
|
+
bStart++;
|
|
274
|
+
} else if (a[aEnd - 1] === b[bEnd - 1]) {
|
|
275
|
+
aEnd--;
|
|
276
|
+
bEnd--;
|
|
277
|
+
} else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
|
|
278
|
+
const node = get(a[--aEnd], -1).nextSibling;
|
|
279
|
+
parentNode.insertBefore(
|
|
280
|
+
get(b[bStart++], 1),
|
|
281
|
+
get(a[aStart++], -1).nextSibling
|
|
282
|
+
);
|
|
283
|
+
parentNode.insertBefore(get(b[--bEnd], 1), node);
|
|
284
|
+
a[aEnd] = b[bEnd];
|
|
285
|
+
} else {
|
|
286
|
+
if (!map) {
|
|
287
|
+
map = /* @__PURE__ */ new Map();
|
|
288
|
+
let i = bStart;
|
|
289
|
+
while (i < bEnd)
|
|
290
|
+
map.set(b[i], i++);
|
|
291
|
+
}
|
|
292
|
+
if (map.has(a[aStart])) {
|
|
293
|
+
const index = map.get(a[aStart]);
|
|
294
|
+
if (bStart < index && index < bEnd) {
|
|
295
|
+
let i = aStart;
|
|
296
|
+
let sequence = 1;
|
|
297
|
+
while (++i < aEnd && i < bEnd && map.get(a[i]) === index + sequence)
|
|
298
|
+
sequence++;
|
|
299
|
+
if (sequence > index - bStart) {
|
|
300
|
+
const node = get(a[aStart], 0);
|
|
301
|
+
while (bStart < index)
|
|
302
|
+
parentNode.insertBefore(get(b[bStart++], 1), node);
|
|
303
|
+
} else {
|
|
304
|
+
parentNode.replaceChild(
|
|
305
|
+
get(b[bStart++], 1),
|
|
306
|
+
get(a[aStart++], -1)
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
} else
|
|
310
|
+
aStart++;
|
|
311
|
+
} else
|
|
312
|
+
parentNode.removeChild(get(a[aStart++], -1));
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return b;
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
// node_modules/@ungap/import-node/esm/index.js
|
|
319
|
+
var importNode = function(document2, appendChild, cloneNode, createTextNode, importNode2) {
|
|
320
|
+
var native = importNode2 in document2;
|
|
321
|
+
var fragment = document2.createDocumentFragment();
|
|
322
|
+
fragment[appendChild](document2[createTextNode]("g"));
|
|
323
|
+
fragment[appendChild](document2[createTextNode](""));
|
|
324
|
+
var content = native ? document2[importNode2](fragment, true) : fragment[cloneNode](true);
|
|
325
|
+
return content.childNodes.length < 2 ? function importNode3(node, deep) {
|
|
326
|
+
var clone = node[cloneNode]();
|
|
327
|
+
for (var childNodes = node.childNodes || [], length = childNodes.length, i = 0; deep && i < length; i++) {
|
|
328
|
+
clone[appendChild](importNode3(childNodes[i], deep));
|
|
329
|
+
}
|
|
330
|
+
return clone;
|
|
331
|
+
} : (
|
|
332
|
+
/* istanbul ignore next */
|
|
333
|
+
native ? document2[importNode2] : function(node, deep) {
|
|
334
|
+
return node[cloneNode](!!deep);
|
|
335
|
+
}
|
|
336
|
+
);
|
|
337
|
+
}(
|
|
338
|
+
document,
|
|
339
|
+
"appendChild",
|
|
340
|
+
"cloneNode",
|
|
341
|
+
"createTextNode",
|
|
342
|
+
"importNode"
|
|
343
|
+
);
|
|
344
|
+
var esm_default9 = importNode;
|
|
345
|
+
|
|
346
|
+
// node_modules/@ungap/trim/esm/index.js
|
|
347
|
+
var trim = "".trim || /* istanbul ignore next */
|
|
348
|
+
function() {
|
|
349
|
+
return String(this).replace(/^\s+|\s+/g, "");
|
|
350
|
+
};
|
|
351
|
+
var esm_default10 = trim;
|
|
352
|
+
|
|
353
|
+
// node_modules/domtagger/esm/walker.js
|
|
354
|
+
var normalizeAttributes = UID_IE ? function(attributes, parts) {
|
|
355
|
+
var html3 = parts.join(" ");
|
|
356
|
+
return parts.slice.call(attributes, 0).sort(function(left, right) {
|
|
357
|
+
return html3.indexOf(left.name) <= html3.indexOf(right.name) ? -1 : 1;
|
|
358
|
+
});
|
|
359
|
+
} : function(attributes, parts) {
|
|
360
|
+
return parts.slice.call(attributes, 0);
|
|
361
|
+
};
|
|
362
|
+
function find(node, path) {
|
|
363
|
+
var length = path.length;
|
|
364
|
+
var i = 0;
|
|
365
|
+
while (i < length)
|
|
366
|
+
node = node.childNodes[path[i++]];
|
|
367
|
+
return node;
|
|
368
|
+
}
|
|
369
|
+
function parse(node, holes, parts, path) {
|
|
370
|
+
var childNodes = node.childNodes;
|
|
371
|
+
var length = childNodes.length;
|
|
372
|
+
var i = 0;
|
|
373
|
+
while (i < length) {
|
|
374
|
+
var child = childNodes[i];
|
|
375
|
+
switch (child.nodeType) {
|
|
376
|
+
case ELEMENT_NODE:
|
|
377
|
+
var childPath = path.concat(i);
|
|
378
|
+
parseAttributes(child, holes, parts, childPath);
|
|
379
|
+
parse(child, holes, parts, childPath);
|
|
380
|
+
break;
|
|
381
|
+
case COMMENT_NODE:
|
|
382
|
+
var textContent = child.textContent;
|
|
383
|
+
if (textContent === UID) {
|
|
384
|
+
parts.shift();
|
|
385
|
+
holes.push(
|
|
386
|
+
// basicHTML or other non standard engines
|
|
387
|
+
// might end up having comments in nodes
|
|
388
|
+
// where they shouldn't, hence this check.
|
|
389
|
+
SHOULD_USE_TEXT_CONTENT.test(node.nodeName) ? Text(node, path) : Any(child, path.concat(i))
|
|
390
|
+
);
|
|
391
|
+
} else {
|
|
392
|
+
switch (textContent.slice(0, 2)) {
|
|
393
|
+
case "/*":
|
|
394
|
+
if (textContent.slice(-2) !== "*/")
|
|
395
|
+
break;
|
|
396
|
+
case "\u{1F47B}":
|
|
397
|
+
node.removeChild(child);
|
|
398
|
+
i--;
|
|
399
|
+
length--;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
break;
|
|
403
|
+
case TEXT_NODE:
|
|
404
|
+
if (SHOULD_USE_TEXT_CONTENT.test(node.nodeName) && esm_default10.call(child.textContent) === UIDC) {
|
|
405
|
+
parts.shift();
|
|
406
|
+
holes.push(Text(node, path));
|
|
407
|
+
}
|
|
408
|
+
break;
|
|
409
|
+
}
|
|
410
|
+
i++;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
function parseAttributes(node, holes, parts, path) {
|
|
414
|
+
var attributes = node.attributes;
|
|
415
|
+
var cache2 = [];
|
|
416
|
+
var remove2 = [];
|
|
417
|
+
var array = normalizeAttributes(attributes, parts);
|
|
418
|
+
var length = array.length;
|
|
419
|
+
var i = 0;
|
|
420
|
+
while (i < length) {
|
|
421
|
+
var attribute2 = array[i++];
|
|
422
|
+
var direct = attribute2.value === UID;
|
|
423
|
+
var sparse;
|
|
424
|
+
if (direct || 1 < (sparse = attribute2.value.split(UIDC)).length) {
|
|
425
|
+
var name = attribute2.name;
|
|
426
|
+
if (cache2.indexOf(name) < 0) {
|
|
427
|
+
cache2.push(name);
|
|
428
|
+
var realName = parts.shift().replace(
|
|
429
|
+
direct ? /^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/ : new RegExp(
|
|
430
|
+
"^(?:|[\\S\\s]*?\\s)(" + name + `)\\s*=\\s*('|")[\\S\\s]*`,
|
|
431
|
+
"i"
|
|
432
|
+
),
|
|
433
|
+
"$1"
|
|
434
|
+
);
|
|
435
|
+
var value = attributes[realName] || // the following ignore is covered by browsers
|
|
436
|
+
// while basicHTML is already case-sensitive
|
|
437
|
+
/* istanbul ignore next */
|
|
438
|
+
attributes[realName.toLowerCase()];
|
|
439
|
+
if (direct)
|
|
440
|
+
holes.push(Attr(value, path, realName, null));
|
|
441
|
+
else {
|
|
442
|
+
var skip = sparse.length - 2;
|
|
443
|
+
while (skip--)
|
|
444
|
+
parts.shift();
|
|
445
|
+
holes.push(Attr(value, path, realName, sparse));
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
remove2.push(attribute2);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
length = remove2.length;
|
|
452
|
+
i = 0;
|
|
453
|
+
var cleanValue = 0 < length && UID_IE && !("ownerSVGElement" in node);
|
|
454
|
+
while (i < length) {
|
|
455
|
+
var attr = remove2[i++];
|
|
456
|
+
if (cleanValue)
|
|
457
|
+
attr.value = "";
|
|
458
|
+
node.removeAttribute(attr.name);
|
|
459
|
+
}
|
|
460
|
+
var nodeName = node.nodeName;
|
|
461
|
+
if (/^script$/i.test(nodeName)) {
|
|
462
|
+
var script = document.createElement(nodeName);
|
|
463
|
+
length = attributes.length;
|
|
464
|
+
i = 0;
|
|
465
|
+
while (i < length)
|
|
466
|
+
script.setAttributeNode(attributes[i++].cloneNode(true));
|
|
467
|
+
script.textContent = node.textContent;
|
|
468
|
+
node.parentNode.replaceChild(script, node);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
function Any(node, path) {
|
|
472
|
+
return {
|
|
473
|
+
type: "any",
|
|
474
|
+
node,
|
|
475
|
+
path
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
function Attr(node, path, name, sparse) {
|
|
479
|
+
return {
|
|
480
|
+
type: "attr",
|
|
481
|
+
node,
|
|
482
|
+
path,
|
|
483
|
+
name,
|
|
484
|
+
sparse
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
function Text(node, path) {
|
|
488
|
+
return {
|
|
489
|
+
type: "text",
|
|
490
|
+
node,
|
|
491
|
+
path
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// node_modules/domtagger/esm/index.js
|
|
496
|
+
var esm_default11 = domtagger;
|
|
497
|
+
var parsed = esm_default6(new esm_default());
|
|
498
|
+
function createInfo(options, template) {
|
|
499
|
+
var markup = (options.convert || esm_default5)(template);
|
|
500
|
+
var transform = options.transform;
|
|
501
|
+
if (transform)
|
|
502
|
+
markup = transform(markup);
|
|
503
|
+
var content = esm_default7(markup, options.type);
|
|
504
|
+
cleanContent(content);
|
|
505
|
+
var holes = [];
|
|
506
|
+
parse(content, holes, template.slice(0), []);
|
|
507
|
+
return {
|
|
508
|
+
content,
|
|
509
|
+
updates: function(content2) {
|
|
510
|
+
var updates2 = [];
|
|
511
|
+
var len = holes.length;
|
|
512
|
+
var i = 0;
|
|
513
|
+
var off = 0;
|
|
514
|
+
while (i < len) {
|
|
515
|
+
var info2 = holes[i++];
|
|
516
|
+
var node = find(content2, info2.path);
|
|
517
|
+
switch (info2.type) {
|
|
518
|
+
case "any":
|
|
519
|
+
updates2.push({ fn: options.any(node, []), sparse: false });
|
|
520
|
+
break;
|
|
521
|
+
case "attr":
|
|
522
|
+
var sparse = info2.sparse;
|
|
523
|
+
var fn = options.attribute(node, info2.name, info2.node);
|
|
524
|
+
if (sparse === null)
|
|
525
|
+
updates2.push({ fn, sparse: false });
|
|
526
|
+
else {
|
|
527
|
+
off += sparse.length - 2;
|
|
528
|
+
updates2.push({ fn, sparse: true, values: sparse });
|
|
529
|
+
}
|
|
530
|
+
break;
|
|
531
|
+
case "text":
|
|
532
|
+
updates2.push({ fn: options.text(node), sparse: false });
|
|
533
|
+
node.textContent = "";
|
|
534
|
+
break;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
len += off;
|
|
538
|
+
return function() {
|
|
539
|
+
var length = arguments.length;
|
|
540
|
+
if (len !== length - 1) {
|
|
541
|
+
throw new Error(
|
|
542
|
+
length - 1 + " values instead of " + len + "\n" + template.join("${value}")
|
|
543
|
+
);
|
|
544
|
+
}
|
|
545
|
+
var i2 = 1;
|
|
546
|
+
var off2 = 1;
|
|
547
|
+
while (i2 < length) {
|
|
548
|
+
var update2 = updates2[i2 - off2];
|
|
549
|
+
if (update2.sparse) {
|
|
550
|
+
var values = update2.values;
|
|
551
|
+
var value = values[0];
|
|
552
|
+
var j = 1;
|
|
553
|
+
var l = values.length;
|
|
554
|
+
off2 += l - 2;
|
|
555
|
+
while (j < l)
|
|
556
|
+
value += arguments[i2++] + values[j++];
|
|
557
|
+
update2.fn(value);
|
|
558
|
+
} else
|
|
559
|
+
update2.fn(arguments[i2++]);
|
|
560
|
+
}
|
|
561
|
+
return content2;
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
function createDetails(options, template) {
|
|
567
|
+
var info2 = parsed.get(template) || parsed.set(template, createInfo(options, template));
|
|
568
|
+
return info2.updates(esm_default9.call(document, info2.content, true));
|
|
569
|
+
}
|
|
570
|
+
var empty = [];
|
|
571
|
+
function domtagger(options) {
|
|
572
|
+
var previous = empty;
|
|
573
|
+
var updates2 = cleanContent;
|
|
574
|
+
return function(template) {
|
|
575
|
+
if (previous !== template)
|
|
576
|
+
updates2 = createDetails(options, previous = template);
|
|
577
|
+
return updates2.apply(null, arguments);
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
function cleanContent(fragment) {
|
|
581
|
+
var childNodes = fragment.childNodes;
|
|
582
|
+
var i = childNodes.length;
|
|
583
|
+
while (i--) {
|
|
584
|
+
var child = childNodes[i];
|
|
585
|
+
if (child.nodeType !== 1 && esm_default10.call(child.textContent).length === 0) {
|
|
586
|
+
fragment.removeChild(child);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
// node_modules/hyperhtml-style/esm/index.js
|
|
592
|
+
var hyperStyle = function() {
|
|
593
|
+
"use strict";
|
|
594
|
+
var IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;
|
|
595
|
+
var hyphen = /([^A-Z])([A-Z]+)/g;
|
|
596
|
+
return function hyperStyle2(node, original) {
|
|
597
|
+
return "ownerSVGElement" in node ? svg3(node, original) : update2(node.style, false);
|
|
598
|
+
};
|
|
599
|
+
function ized($0, $1, $2) {
|
|
600
|
+
return $1 + "-" + $2.toLowerCase();
|
|
601
|
+
}
|
|
602
|
+
function svg3(node, original) {
|
|
603
|
+
var style;
|
|
604
|
+
if (original)
|
|
605
|
+
style = original.cloneNode(true);
|
|
606
|
+
else {
|
|
607
|
+
node.setAttribute("style", "--hyper:style;");
|
|
608
|
+
style = node.getAttributeNode("style");
|
|
609
|
+
}
|
|
610
|
+
style.value = "";
|
|
611
|
+
node.setAttributeNode(style);
|
|
612
|
+
return update2(style, true);
|
|
613
|
+
}
|
|
614
|
+
function toStyle(object) {
|
|
615
|
+
var key, css = [];
|
|
616
|
+
for (key in object)
|
|
617
|
+
css.push(key.replace(hyphen, ized), ":", object[key], ";");
|
|
618
|
+
return css.join("");
|
|
619
|
+
}
|
|
620
|
+
function update2(style, isSVG) {
|
|
621
|
+
var oldType, oldValue;
|
|
622
|
+
return function(newValue) {
|
|
623
|
+
var info2, key, styleValue, value;
|
|
624
|
+
switch (typeof newValue) {
|
|
625
|
+
case "object":
|
|
626
|
+
if (newValue) {
|
|
627
|
+
if (oldType === "object") {
|
|
628
|
+
if (!isSVG) {
|
|
629
|
+
if (oldValue !== newValue) {
|
|
630
|
+
for (key in oldValue) {
|
|
631
|
+
if (!(key in newValue)) {
|
|
632
|
+
style[key] = "";
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
} else {
|
|
638
|
+
if (isSVG)
|
|
639
|
+
style.value = "";
|
|
640
|
+
else
|
|
641
|
+
style.cssText = "";
|
|
642
|
+
}
|
|
643
|
+
info2 = isSVG ? {} : style;
|
|
644
|
+
for (key in newValue) {
|
|
645
|
+
value = newValue[key];
|
|
646
|
+
styleValue = typeof value === "number" && !IS_NON_DIMENSIONAL.test(key) ? value + "px" : value;
|
|
647
|
+
if (!isSVG && /^--/.test(key))
|
|
648
|
+
info2.setProperty(key, styleValue);
|
|
649
|
+
else
|
|
650
|
+
info2[key] = styleValue;
|
|
651
|
+
}
|
|
652
|
+
oldType = "object";
|
|
653
|
+
if (isSVG)
|
|
654
|
+
style.value = toStyle(oldValue = info2);
|
|
655
|
+
else
|
|
656
|
+
oldValue = newValue;
|
|
657
|
+
break;
|
|
658
|
+
}
|
|
659
|
+
default:
|
|
660
|
+
if (oldValue != newValue) {
|
|
661
|
+
oldType = "string";
|
|
662
|
+
oldValue = newValue;
|
|
663
|
+
if (isSVG)
|
|
664
|
+
style.value = newValue || "";
|
|
665
|
+
else
|
|
666
|
+
style.cssText = newValue || "";
|
|
667
|
+
}
|
|
668
|
+
break;
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
}();
|
|
673
|
+
var esm_default12 = hyperStyle;
|
|
674
|
+
|
|
675
|
+
// node_modules/uhandlers/esm/index.js
|
|
676
|
+
var aria = (node) => (values) => {
|
|
677
|
+
for (const key in values) {
|
|
678
|
+
const name = key === "role" ? key : `aria-${key}`;
|
|
679
|
+
const value = values[key];
|
|
680
|
+
if (value == null)
|
|
681
|
+
node.removeAttribute(name);
|
|
682
|
+
else
|
|
683
|
+
node.setAttribute(name, value);
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
var attribute = (node, name) => {
|
|
687
|
+
let oldValue, orphan = true;
|
|
688
|
+
const attributeNode = document.createAttributeNS(null, name);
|
|
689
|
+
return (newValue) => {
|
|
690
|
+
if (oldValue !== newValue) {
|
|
691
|
+
oldValue = newValue;
|
|
692
|
+
if (oldValue == null) {
|
|
693
|
+
if (!orphan) {
|
|
694
|
+
node.removeAttributeNode(attributeNode);
|
|
695
|
+
orphan = true;
|
|
696
|
+
}
|
|
697
|
+
} else {
|
|
698
|
+
attributeNode.value = newValue;
|
|
699
|
+
if (orphan) {
|
|
700
|
+
node.setAttributeNodeNS(attributeNode);
|
|
701
|
+
orphan = false;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
};
|
|
707
|
+
var boolean = (node, key, oldValue) => (newValue) => {
|
|
708
|
+
if (oldValue !== !!newValue) {
|
|
709
|
+
if (oldValue = !!newValue)
|
|
710
|
+
node.setAttribute(key, "");
|
|
711
|
+
else
|
|
712
|
+
node.removeAttribute(key);
|
|
713
|
+
}
|
|
714
|
+
};
|
|
715
|
+
var data = ({ dataset }) => (values) => {
|
|
716
|
+
for (const key in values) {
|
|
717
|
+
const value = values[key];
|
|
718
|
+
if (value == null)
|
|
719
|
+
delete dataset[key];
|
|
720
|
+
else
|
|
721
|
+
dataset[key] = value;
|
|
722
|
+
}
|
|
723
|
+
};
|
|
724
|
+
var event = (node, name) => {
|
|
725
|
+
let oldValue, type = name.slice(2);
|
|
726
|
+
if (!(name in node) && name.toLowerCase() in node)
|
|
727
|
+
type = type.toLowerCase();
|
|
728
|
+
return (newValue) => {
|
|
729
|
+
const info2 = isArray(newValue) ? newValue : [newValue, false];
|
|
730
|
+
if (oldValue !== info2[0]) {
|
|
731
|
+
if (oldValue)
|
|
732
|
+
node.removeEventListener(type, oldValue, info2[1]);
|
|
733
|
+
if (oldValue = info2[0])
|
|
734
|
+
node.addEventListener(type, oldValue, info2[1]);
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
var ref = (node) => (value) => {
|
|
739
|
+
if (typeof value === "function")
|
|
740
|
+
value(node);
|
|
741
|
+
else
|
|
742
|
+
value.current = node;
|
|
743
|
+
};
|
|
744
|
+
var setter = (node, key) => key === "dataset" ? data(node) : (value) => {
|
|
745
|
+
node[key] = value;
|
|
746
|
+
};
|
|
747
|
+
var text = (node) => {
|
|
748
|
+
let oldValue;
|
|
749
|
+
return (newValue) => {
|
|
750
|
+
if (oldValue != newValue) {
|
|
751
|
+
oldValue = newValue;
|
|
752
|
+
node.textContent = newValue == null ? "" : newValue;
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
// node_modules/lighterhtml/esm/tagger.js
|
|
758
|
+
var hyperProperty = (node, name) => {
|
|
759
|
+
let oldValue;
|
|
760
|
+
return (newValue) => {
|
|
761
|
+
if (oldValue !== newValue) {
|
|
762
|
+
oldValue = newValue;
|
|
763
|
+
if (node[name] !== newValue) {
|
|
764
|
+
if (newValue == null) {
|
|
765
|
+
node[name] = "";
|
|
766
|
+
node.removeAttribute(name);
|
|
767
|
+
} else
|
|
768
|
+
node[name] = newValue;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
};
|
|
773
|
+
var readOnly = /^(?:form|list)$/i;
|
|
774
|
+
var text2 = (node, text3) => node.ownerDocument.createTextNode(text3);
|
|
775
|
+
function Tagger(type) {
|
|
776
|
+
this.type = type;
|
|
777
|
+
return esm_default11(this);
|
|
778
|
+
}
|
|
779
|
+
;
|
|
780
|
+
Tagger.prototype = {
|
|
781
|
+
// there are four kind of attributes, and related behavior:
|
|
782
|
+
// * events, with a name starting with `on`, to add/remove event listeners
|
|
783
|
+
// * special, with a name present in their inherited prototype, accessed directly
|
|
784
|
+
// * regular, accessed through get/setAttribute standard DOM methods
|
|
785
|
+
// * style, the only regular attribute that also accepts an object as value
|
|
786
|
+
// so that you can style=${{width: 120}}. In this case, the behavior has been
|
|
787
|
+
// fully inspired by Preact library and its simplicity.
|
|
788
|
+
attribute(node, name, original) {
|
|
789
|
+
const isSVG = this.type === "svg";
|
|
790
|
+
switch (name) {
|
|
791
|
+
case "class":
|
|
792
|
+
if (isSVG)
|
|
793
|
+
return attribute(node, name, isSVG);
|
|
794
|
+
name = "className";
|
|
795
|
+
case "props":
|
|
796
|
+
return setter(node, name);
|
|
797
|
+
case "aria":
|
|
798
|
+
return aria(node);
|
|
799
|
+
case "style":
|
|
800
|
+
return esm_default12(node, original, isSVG);
|
|
801
|
+
case "ref":
|
|
802
|
+
return ref(node);
|
|
803
|
+
case ".dataset":
|
|
804
|
+
return data(node);
|
|
805
|
+
default:
|
|
806
|
+
if (name.slice(0, 1) === ".")
|
|
807
|
+
return setter(node, name.slice(1));
|
|
808
|
+
if (name.slice(0, 1) === "?")
|
|
809
|
+
return boolean(node, name.slice(1));
|
|
810
|
+
if (name.slice(0, 2) === "on")
|
|
811
|
+
return event(node, name);
|
|
812
|
+
if (name in node && !(isSVG || readOnly.test(name)))
|
|
813
|
+
return hyperProperty(node, name);
|
|
814
|
+
return attribute(node, name, isSVG);
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
// in a hyper(node)`<div>${content}</div>` case
|
|
818
|
+
// everything could happen:
|
|
819
|
+
// * it's a JS primitive, stored as text
|
|
820
|
+
// * it's null or undefined, the node should be cleaned
|
|
821
|
+
// * it's a promise, update the content once resolved
|
|
822
|
+
// * it's an explicit intent, perform the desired operation
|
|
823
|
+
// * it's an Array, resolve all values if Promises and/or
|
|
824
|
+
// update the node with the resulting list of content
|
|
825
|
+
any(node, childNodes) {
|
|
826
|
+
const { type } = this;
|
|
827
|
+
let fastPath = false;
|
|
828
|
+
let oldValue;
|
|
829
|
+
const anyContent = (value) => {
|
|
830
|
+
switch (typeof value) {
|
|
831
|
+
case "string":
|
|
832
|
+
case "number":
|
|
833
|
+
case "boolean":
|
|
834
|
+
if (fastPath) {
|
|
835
|
+
if (oldValue !== value) {
|
|
836
|
+
oldValue = value;
|
|
837
|
+
childNodes[0].textContent = value;
|
|
838
|
+
}
|
|
839
|
+
} else {
|
|
840
|
+
fastPath = true;
|
|
841
|
+
oldValue = value;
|
|
842
|
+
childNodes = esm_default8(
|
|
843
|
+
node.parentNode,
|
|
844
|
+
childNodes,
|
|
845
|
+
[text2(node, value)],
|
|
846
|
+
diffable,
|
|
847
|
+
node
|
|
848
|
+
);
|
|
849
|
+
}
|
|
850
|
+
break;
|
|
851
|
+
case "function":
|
|
852
|
+
anyContent(value(node));
|
|
853
|
+
break;
|
|
854
|
+
case "object":
|
|
855
|
+
case "undefined":
|
|
856
|
+
if (value == null) {
|
|
857
|
+
fastPath = false;
|
|
858
|
+
childNodes = esm_default8(
|
|
859
|
+
node.parentNode,
|
|
860
|
+
childNodes,
|
|
861
|
+
[],
|
|
862
|
+
diffable,
|
|
863
|
+
node
|
|
864
|
+
);
|
|
865
|
+
break;
|
|
866
|
+
}
|
|
867
|
+
default:
|
|
868
|
+
fastPath = false;
|
|
869
|
+
oldValue = value;
|
|
870
|
+
if (isArray(value)) {
|
|
871
|
+
if (value.length === 0) {
|
|
872
|
+
if (childNodes.length) {
|
|
873
|
+
childNodes = esm_default8(
|
|
874
|
+
node.parentNode,
|
|
875
|
+
childNodes,
|
|
876
|
+
[],
|
|
877
|
+
diffable,
|
|
878
|
+
node
|
|
879
|
+
);
|
|
880
|
+
}
|
|
881
|
+
} else {
|
|
882
|
+
switch (typeof value[0]) {
|
|
883
|
+
case "string":
|
|
884
|
+
case "number":
|
|
885
|
+
case "boolean":
|
|
886
|
+
anyContent(String(value));
|
|
887
|
+
break;
|
|
888
|
+
case "function":
|
|
889
|
+
anyContent(value.map(invoke, node));
|
|
890
|
+
break;
|
|
891
|
+
case "object":
|
|
892
|
+
if (isArray(value[0])) {
|
|
893
|
+
value = value.concat.apply([], value);
|
|
894
|
+
}
|
|
895
|
+
default:
|
|
896
|
+
childNodes = esm_default8(
|
|
897
|
+
node.parentNode,
|
|
898
|
+
childNodes,
|
|
899
|
+
value,
|
|
900
|
+
diffable,
|
|
901
|
+
node
|
|
902
|
+
);
|
|
903
|
+
break;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
} else if ("ELEMENT_NODE" in value) {
|
|
907
|
+
childNodes = esm_default8(
|
|
908
|
+
node.parentNode,
|
|
909
|
+
childNodes,
|
|
910
|
+
value.nodeType === 11 ? slice.call(value.childNodes) : [value],
|
|
911
|
+
diffable,
|
|
912
|
+
node
|
|
913
|
+
);
|
|
914
|
+
} else if ("text" in value) {
|
|
915
|
+
anyContent(String(value.text));
|
|
916
|
+
} else if ("any" in value) {
|
|
917
|
+
anyContent(value.any);
|
|
918
|
+
} else if ("html" in value) {
|
|
919
|
+
childNodes = esm_default8(
|
|
920
|
+
node.parentNode,
|
|
921
|
+
childNodes,
|
|
922
|
+
slice.call(
|
|
923
|
+
esm_default7(
|
|
924
|
+
[].concat(value.html).join(""),
|
|
925
|
+
type
|
|
926
|
+
).childNodes
|
|
927
|
+
),
|
|
928
|
+
diffable,
|
|
929
|
+
node
|
|
930
|
+
);
|
|
931
|
+
} else if ("length" in value) {
|
|
932
|
+
anyContent(slice.call(value));
|
|
933
|
+
}
|
|
934
|
+
break;
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
return anyContent;
|
|
938
|
+
},
|
|
939
|
+
// style or textareas don't accept HTML as content
|
|
940
|
+
// it's pointless to transform or analyze anything
|
|
941
|
+
// different from text there but it's worth checking
|
|
942
|
+
// for possible defined intents.
|
|
943
|
+
text(node) {
|
|
944
|
+
let oldValue;
|
|
945
|
+
const textContent = (value) => {
|
|
946
|
+
if (oldValue !== value) {
|
|
947
|
+
oldValue = value;
|
|
948
|
+
const type = typeof value;
|
|
949
|
+
if (type === "object" && value) {
|
|
950
|
+
if ("text" in value) {
|
|
951
|
+
textContent(String(value.text));
|
|
952
|
+
} else if ("any" in value) {
|
|
953
|
+
textContent(value.any);
|
|
954
|
+
} else if ("html" in value) {
|
|
955
|
+
textContent([].concat(value.html).join(""));
|
|
956
|
+
} else if ("length" in value) {
|
|
957
|
+
textContent(slice.call(value).join(""));
|
|
958
|
+
}
|
|
959
|
+
} else if (type === "function") {
|
|
960
|
+
textContent(value(node));
|
|
961
|
+
} else {
|
|
962
|
+
node.textContent = value == null ? "" : value;
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
};
|
|
966
|
+
return textContent;
|
|
967
|
+
}
|
|
968
|
+
};
|
|
969
|
+
function invoke(callback) {
|
|
970
|
+
return callback(this);
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
// node_modules/lighterhtml/esm/index.js
|
|
974
|
+
var { create, freeze, keys } = Object;
|
|
975
|
+
var tProto = Tagger.prototype;
|
|
976
|
+
var cache = esm_default6(new esm_default());
|
|
977
|
+
var createRender = (Tagger2) => ({
|
|
978
|
+
html: outer("html", Tagger2),
|
|
979
|
+
svg: outer("svg", Tagger2),
|
|
980
|
+
render(where, what) {
|
|
981
|
+
const hole = typeof what === "function" ? what() : what;
|
|
982
|
+
const info2 = cache.get(where) || cache.set(where, createCache());
|
|
983
|
+
const wire = hole instanceof LighterHole ? unroll(Tagger2, info2, hole) : hole;
|
|
984
|
+
if (wire !== info2.wire) {
|
|
985
|
+
info2.wire = wire;
|
|
986
|
+
where.textContent = "";
|
|
987
|
+
where.appendChild(wire.valueOf());
|
|
988
|
+
}
|
|
989
|
+
return where;
|
|
990
|
+
}
|
|
991
|
+
});
|
|
992
|
+
var createCache = () => ({ stack: [], entry: null, wire: null });
|
|
993
|
+
var outer = (type, Tagger2) => {
|
|
994
|
+
const cache2 = esm_default6(new esm_default());
|
|
995
|
+
const fixed = (info2) => function() {
|
|
996
|
+
return unroll(Tagger2, info2, hole.apply(null, arguments));
|
|
997
|
+
};
|
|
998
|
+
hole.for = (ref3, id) => {
|
|
999
|
+
const memo = cache2.get(ref3) || cache2.set(ref3, create(null));
|
|
1000
|
+
return memo[id] || (memo[id] = fixed(createCache()));
|
|
1001
|
+
};
|
|
1002
|
+
hole.node = function() {
|
|
1003
|
+
return unroll(
|
|
1004
|
+
Tagger2,
|
|
1005
|
+
createCache(),
|
|
1006
|
+
hole.apply(null, arguments)
|
|
1007
|
+
).valueOf();
|
|
1008
|
+
};
|
|
1009
|
+
return hole;
|
|
1010
|
+
function hole() {
|
|
1011
|
+
return new LighterHole(type, tta.apply(null, arguments));
|
|
1012
|
+
}
|
|
1013
|
+
};
|
|
1014
|
+
var unroll = (Tagger2, info2, { type, template, values }) => {
|
|
1015
|
+
const { length } = values;
|
|
1016
|
+
unrollValues(Tagger2, info2, values, length);
|
|
1017
|
+
let { entry } = info2;
|
|
1018
|
+
if (!entry || (entry.template !== template || entry.type !== type)) {
|
|
1019
|
+
const tag = new Tagger2(type);
|
|
1020
|
+
info2.entry = entry = {
|
|
1021
|
+
type,
|
|
1022
|
+
template,
|
|
1023
|
+
tag,
|
|
1024
|
+
wire: persistent(tag(template, ...values))
|
|
1025
|
+
};
|
|
1026
|
+
} else
|
|
1027
|
+
entry.tag(template, ...values);
|
|
1028
|
+
return entry.wire;
|
|
1029
|
+
};
|
|
1030
|
+
var unrollValues = (Tagger2, { stack }, values, length) => {
|
|
1031
|
+
for (let i = 0; i < length; i++) {
|
|
1032
|
+
const hole = values[i];
|
|
1033
|
+
if (hole instanceof Hole)
|
|
1034
|
+
values[i] = unroll(
|
|
1035
|
+
Tagger2,
|
|
1036
|
+
stack[i] || (stack[i] = createCache()),
|
|
1037
|
+
hole
|
|
1038
|
+
);
|
|
1039
|
+
else if (isArray(hole))
|
|
1040
|
+
unrollValues(
|
|
1041
|
+
Tagger2,
|
|
1042
|
+
stack[i] || (stack[i] = createCache()),
|
|
1043
|
+
hole,
|
|
1044
|
+
hole.length
|
|
1045
|
+
);
|
|
1046
|
+
else
|
|
1047
|
+
stack[i] = null;
|
|
1048
|
+
}
|
|
1049
|
+
if (length < stack.length)
|
|
1050
|
+
stack.splice(length);
|
|
1051
|
+
};
|
|
1052
|
+
freeze(LighterHole);
|
|
1053
|
+
function LighterHole(type, args) {
|
|
1054
|
+
this.type = type;
|
|
1055
|
+
this.template = args.shift();
|
|
1056
|
+
this.values = args;
|
|
1057
|
+
}
|
|
1058
|
+
;
|
|
1059
|
+
var Hole = LighterHole;
|
|
1060
|
+
var custom = (overrides) => {
|
|
1061
|
+
const prototype = create(tProto);
|
|
1062
|
+
keys(overrides).forEach((key) => {
|
|
1063
|
+
prototype[key] = overrides[key](
|
|
1064
|
+
prototype[key] || (key === "convert" ? esm_default5 : String)
|
|
1065
|
+
);
|
|
1066
|
+
});
|
|
1067
|
+
CustomTagger.prototype = prototype;
|
|
1068
|
+
return createRender(CustomTagger);
|
|
1069
|
+
function CustomTagger() {
|
|
1070
|
+
return Tagger.apply(this, arguments);
|
|
1071
|
+
}
|
|
1072
|
+
};
|
|
1073
|
+
var { render, html, svg } = createRender(Tagger);
|
|
1074
|
+
function tta() {
|
|
1075
|
+
let out = [], i = 0, { length } = arguments;
|
|
1076
|
+
while (i < length)
|
|
1077
|
+
out.push(arguments[i++]);
|
|
1078
|
+
return out;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
// node_modules/reraf/esm/index.js
|
|
1082
|
+
var compat = typeof cancelAnimationFrame === "function";
|
|
1083
|
+
var cAF = compat ? cancelAnimationFrame : clearTimeout;
|
|
1084
|
+
var rAF = compat ? requestAnimationFrame : setTimeout;
|
|
1085
|
+
function reraf(limit) {
|
|
1086
|
+
var force, timer, callback, self4, args;
|
|
1087
|
+
reset();
|
|
1088
|
+
return function reschedule(_callback, _self, _args) {
|
|
1089
|
+
callback = _callback;
|
|
1090
|
+
self4 = _self;
|
|
1091
|
+
args = _args;
|
|
1092
|
+
if (!timer)
|
|
1093
|
+
timer = rAF(invoke3);
|
|
1094
|
+
if (--force < 0)
|
|
1095
|
+
stop2(true);
|
|
1096
|
+
return stop2;
|
|
1097
|
+
};
|
|
1098
|
+
function invoke3() {
|
|
1099
|
+
reset();
|
|
1100
|
+
callback.apply(self4, args || []);
|
|
1101
|
+
}
|
|
1102
|
+
function reset() {
|
|
1103
|
+
force = limit || Infinity;
|
|
1104
|
+
timer = compat ? 0 : null;
|
|
1105
|
+
}
|
|
1106
|
+
function stop2(flush) {
|
|
1107
|
+
var didStop = !!timer;
|
|
1108
|
+
if (didStop) {
|
|
1109
|
+
cAF(timer);
|
|
1110
|
+
if (flush)
|
|
1111
|
+
invoke3();
|
|
1112
|
+
}
|
|
1113
|
+
return didStop;
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
;
|
|
1117
|
+
|
|
1118
|
+
// node_modules/augmentor/esm/index.js
|
|
1119
|
+
var state = null;
|
|
1120
|
+
var augmentor = (fn) => {
|
|
1121
|
+
const stack = [];
|
|
1122
|
+
return function hook() {
|
|
1123
|
+
const prev = state;
|
|
1124
|
+
const after = [];
|
|
1125
|
+
state = {
|
|
1126
|
+
hook,
|
|
1127
|
+
args: arguments,
|
|
1128
|
+
stack,
|
|
1129
|
+
i: 0,
|
|
1130
|
+
length: stack.length,
|
|
1131
|
+
after
|
|
1132
|
+
};
|
|
1133
|
+
try {
|
|
1134
|
+
return fn.apply(null, arguments);
|
|
1135
|
+
} finally {
|
|
1136
|
+
state = prev;
|
|
1137
|
+
for (let i = 0, { length } = after; i < length; i++)
|
|
1138
|
+
after[i]();
|
|
1139
|
+
}
|
|
1140
|
+
};
|
|
1141
|
+
};
|
|
1142
|
+
var contextual = (fn) => {
|
|
1143
|
+
let check = true;
|
|
1144
|
+
let context = null;
|
|
1145
|
+
const augmented2 = augmentor(function() {
|
|
1146
|
+
return fn.apply(context, arguments);
|
|
1147
|
+
});
|
|
1148
|
+
return function hook() {
|
|
1149
|
+
const result = augmented2.apply(context = this, arguments);
|
|
1150
|
+
if (check) {
|
|
1151
|
+
check = !check;
|
|
1152
|
+
if (hasEffect(augmented2))
|
|
1153
|
+
effects.set(hook, effects.get(augmented2));
|
|
1154
|
+
}
|
|
1155
|
+
return result;
|
|
1156
|
+
};
|
|
1157
|
+
};
|
|
1158
|
+
var updates = esm_default6(/* @__PURE__ */ new WeakMap());
|
|
1159
|
+
var hookdate = (hook, ctx, args) => {
|
|
1160
|
+
hook.apply(ctx, args);
|
|
1161
|
+
};
|
|
1162
|
+
var defaults = { async: false, always: false };
|
|
1163
|
+
var getValue = (value, f) => typeof f == "function" ? f(value) : f;
|
|
1164
|
+
var useReducer = (reducer, value, init2, options) => {
|
|
1165
|
+
const i = state.i++;
|
|
1166
|
+
const { hook, args, stack, length } = state;
|
|
1167
|
+
if (i === length)
|
|
1168
|
+
state.length = stack.push({});
|
|
1169
|
+
const ref3 = stack[i];
|
|
1170
|
+
ref3.args = args;
|
|
1171
|
+
if (i === length) {
|
|
1172
|
+
const fn = typeof init2 === "function";
|
|
1173
|
+
const { async: asy, always } = (fn ? options : init2) || options || defaults;
|
|
1174
|
+
ref3.$ = fn ? init2(value) : getValue(void 0, value);
|
|
1175
|
+
ref3._ = asy ? updates.get(hook) || updates.set(hook, reraf()) : hookdate;
|
|
1176
|
+
ref3.f = (value2) => {
|
|
1177
|
+
const $value = reducer(ref3.$, value2);
|
|
1178
|
+
if (always || ref3.$ !== $value) {
|
|
1179
|
+
ref3.$ = $value;
|
|
1180
|
+
ref3._(hook, null, ref3.args);
|
|
1181
|
+
}
|
|
1182
|
+
};
|
|
1183
|
+
}
|
|
1184
|
+
return [ref3.$, ref3.f];
|
|
1185
|
+
};
|
|
1186
|
+
var useState = (value, options) => useReducer(getValue, value, void 0, options);
|
|
1187
|
+
var hooks = /* @__PURE__ */ new WeakMap();
|
|
1188
|
+
var invoke2 = ({ hook, args }) => {
|
|
1189
|
+
hook.apply(null, args);
|
|
1190
|
+
};
|
|
1191
|
+
var createContext = (value) => {
|
|
1192
|
+
const context = { value, provide };
|
|
1193
|
+
hooks.set(context, []);
|
|
1194
|
+
return context;
|
|
1195
|
+
};
|
|
1196
|
+
var useContext = (context) => {
|
|
1197
|
+
const { hook, args } = state;
|
|
1198
|
+
const stack = hooks.get(context);
|
|
1199
|
+
const info2 = { hook, args };
|
|
1200
|
+
if (!stack.some(update, info2))
|
|
1201
|
+
stack.push(info2);
|
|
1202
|
+
return context.value;
|
|
1203
|
+
};
|
|
1204
|
+
function provide(value) {
|
|
1205
|
+
if (this.value !== value) {
|
|
1206
|
+
this.value = value;
|
|
1207
|
+
hooks.get(this).forEach(invoke2);
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
function update({ hook }) {
|
|
1211
|
+
return hook === this.hook;
|
|
1212
|
+
}
|
|
1213
|
+
var effects = /* @__PURE__ */ new WeakMap();
|
|
1214
|
+
var fx = esm_default6(effects);
|
|
1215
|
+
var stop = () => {
|
|
1216
|
+
};
|
|
1217
|
+
var createEffect = (asy) => (effect, guards) => {
|
|
1218
|
+
const i = state.i++;
|
|
1219
|
+
const { hook, after, stack, length } = state;
|
|
1220
|
+
if (i < length) {
|
|
1221
|
+
const info2 = stack[i];
|
|
1222
|
+
const { update: update2, values, stop: stop2 } = info2;
|
|
1223
|
+
if (!guards || guards.some(different, values)) {
|
|
1224
|
+
info2.values = guards;
|
|
1225
|
+
if (asy)
|
|
1226
|
+
stop2(asy);
|
|
1227
|
+
const { clean } = info2;
|
|
1228
|
+
if (clean) {
|
|
1229
|
+
info2.clean = null;
|
|
1230
|
+
clean();
|
|
1231
|
+
}
|
|
1232
|
+
const invoke3 = () => {
|
|
1233
|
+
info2.clean = effect();
|
|
1234
|
+
};
|
|
1235
|
+
if (asy)
|
|
1236
|
+
update2(invoke3);
|
|
1237
|
+
else
|
|
1238
|
+
after.push(invoke3);
|
|
1239
|
+
}
|
|
1240
|
+
} else {
|
|
1241
|
+
const update2 = asy ? reraf() : stop;
|
|
1242
|
+
const info2 = { clean: null, update: update2, values: guards, stop };
|
|
1243
|
+
state.length = stack.push(info2);
|
|
1244
|
+
(fx.get(hook) || fx.set(hook, [])).push(info2);
|
|
1245
|
+
const invoke3 = () => {
|
|
1246
|
+
info2.clean = effect();
|
|
1247
|
+
};
|
|
1248
|
+
if (asy)
|
|
1249
|
+
info2.stop = update2(invoke3);
|
|
1250
|
+
else
|
|
1251
|
+
after.push(invoke3);
|
|
1252
|
+
}
|
|
1253
|
+
};
|
|
1254
|
+
var dropEffect = (hook) => {
|
|
1255
|
+
(effects.get(hook) || []).forEach((info2) => {
|
|
1256
|
+
const { clean, stop: stop2 } = info2;
|
|
1257
|
+
stop2();
|
|
1258
|
+
if (clean) {
|
|
1259
|
+
info2.clean = null;
|
|
1260
|
+
clean();
|
|
1261
|
+
}
|
|
1262
|
+
});
|
|
1263
|
+
};
|
|
1264
|
+
var hasEffect = effects.has.bind(effects);
|
|
1265
|
+
var useEffect = createEffect(true);
|
|
1266
|
+
var useLayoutEffect = createEffect(false);
|
|
1267
|
+
var useMemo = (memo, guards) => {
|
|
1268
|
+
const i = state.i++;
|
|
1269
|
+
const { stack, length } = state;
|
|
1270
|
+
if (i === length)
|
|
1271
|
+
state.length = stack.push({ $: memo(), _: guards });
|
|
1272
|
+
else if (!guards || guards.some(different, stack[i]._))
|
|
1273
|
+
stack[i] = { $: memo(), _: guards };
|
|
1274
|
+
return stack[i].$;
|
|
1275
|
+
};
|
|
1276
|
+
var useCallback = (fn, guards) => useMemo(() => fn, guards);
|
|
1277
|
+
var useRef = (value) => {
|
|
1278
|
+
const i = state.i++;
|
|
1279
|
+
const { stack, length } = state;
|
|
1280
|
+
if (i === length)
|
|
1281
|
+
state.length = stack.push({ current: value });
|
|
1282
|
+
return stack[i];
|
|
1283
|
+
};
|
|
1284
|
+
function different(value, i) {
|
|
1285
|
+
return value !== this[i];
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
// node_modules/heresy/esm/utils.js
|
|
1289
|
+
var transpiled = null;
|
|
1290
|
+
try {
|
|
1291
|
+
transpiled = new { o() {
|
|
1292
|
+
} }.o();
|
|
1293
|
+
} catch ($) {
|
|
1294
|
+
}
|
|
1295
|
+
var extend = (Super) => class extends Super {
|
|
1296
|
+
};
|
|
1297
|
+
if (transpiled) {
|
|
1298
|
+
const { getPrototypeOf, setPrototypeOf } = Object;
|
|
1299
|
+
const { construct } = typeof Reflect === "object" ? Reflect : {
|
|
1300
|
+
construct(Super, args, Target) {
|
|
1301
|
+
const a = [null];
|
|
1302
|
+
for (let i = 0; i < args.length; i++)
|
|
1303
|
+
a.push(args[i]);
|
|
1304
|
+
const Parent = Super.bind.apply(Super, a);
|
|
1305
|
+
return setPrototypeOf(new Parent(), Target.prototype);
|
|
1306
|
+
}
|
|
1307
|
+
};
|
|
1308
|
+
extend = function(Super, cutTheMiddleMan) {
|
|
1309
|
+
function Class() {
|
|
1310
|
+
return construct(
|
|
1311
|
+
cutTheMiddleMan ? getPrototypeOf(Super) : Super,
|
|
1312
|
+
arguments,
|
|
1313
|
+
Class
|
|
1314
|
+
);
|
|
1315
|
+
}
|
|
1316
|
+
setPrototypeOf(Class.prototype, Super.prototype);
|
|
1317
|
+
return setPrototypeOf(Class, Super);
|
|
1318
|
+
};
|
|
1319
|
+
}
|
|
1320
|
+
var hash = (s) => {
|
|
1321
|
+
const { length } = s;
|
|
1322
|
+
let t = 0;
|
|
1323
|
+
let i = 0;
|
|
1324
|
+
while (i < length) {
|
|
1325
|
+
t = (t << 5) - t + s.charCodeAt(i++);
|
|
1326
|
+
t = t & t;
|
|
1327
|
+
}
|
|
1328
|
+
return t.toString(36);
|
|
1329
|
+
};
|
|
1330
|
+
var registry = {
|
|
1331
|
+
map: {},
|
|
1332
|
+
re: null
|
|
1333
|
+
};
|
|
1334
|
+
var regExp = (keys3) => new RegExp(
|
|
1335
|
+
`<(/)?(${keys3.join("|")})([^A-Za-z0-9:._-])`,
|
|
1336
|
+
"g"
|
|
1337
|
+
);
|
|
1338
|
+
var tmp = null;
|
|
1339
|
+
var replace = (markup, info2) => {
|
|
1340
|
+
const { map, re } = tmp || info2;
|
|
1341
|
+
return markup.replace(re, (_, close, name, after) => {
|
|
1342
|
+
const { tagName: tagName2, is, element } = map[name];
|
|
1343
|
+
return element ? close ? `</${is}>` : `<${is}${after}` : close ? `</${tagName2}>` : `<${tagName2} is="${is}"${after}`;
|
|
1344
|
+
});
|
|
1345
|
+
};
|
|
1346
|
+
var selector = ({ tagName: tagName2, is, element }) => element ? is : `${tagName2}[is="${is}"]`;
|
|
1347
|
+
var getInfo = () => tmp;
|
|
1348
|
+
var setInfo = (info2) => {
|
|
1349
|
+
tmp = info2;
|
|
1350
|
+
};
|
|
1351
|
+
|
|
1352
|
+
// node_modules/heresy/esm/augmented.js
|
|
1353
|
+
var hooks2 = {
|
|
1354
|
+
useCallback,
|
|
1355
|
+
useContext,
|
|
1356
|
+
useEffect,
|
|
1357
|
+
useLayoutEffect,
|
|
1358
|
+
useMemo,
|
|
1359
|
+
useReducer,
|
|
1360
|
+
useRef,
|
|
1361
|
+
useState
|
|
1362
|
+
};
|
|
1363
|
+
var {
|
|
1364
|
+
render: lighterRender,
|
|
1365
|
+
html: lighterHTML,
|
|
1366
|
+
svg: lighterSVG
|
|
1367
|
+
} = custom({
|
|
1368
|
+
transform: () => (markup) => replace(markup, registry)
|
|
1369
|
+
});
|
|
1370
|
+
var secret = "_\u{1F525}";
|
|
1371
|
+
var { defineProperties } = Object;
|
|
1372
|
+
var $html = new esm_default();
|
|
1373
|
+
var $svg = new esm_default();
|
|
1374
|
+
var $mappedAttributes = new esm_default();
|
|
1375
|
+
var ws = new esm_default4();
|
|
1376
|
+
var configurable = true;
|
|
1377
|
+
var attributeChangedCallback = "attributeChangedCallback";
|
|
1378
|
+
var connectedCallback = "connectedCallback";
|
|
1379
|
+
var disconnectedCallback = `dis${connectedCallback}`;
|
|
1380
|
+
var addInit = (prototype, properties, method) => {
|
|
1381
|
+
if (method in prototype) {
|
|
1382
|
+
const original = prototype[method];
|
|
1383
|
+
properties[method] = {
|
|
1384
|
+
configurable,
|
|
1385
|
+
value() {
|
|
1386
|
+
init.call(this);
|
|
1387
|
+
return original.apply(this, arguments);
|
|
1388
|
+
}
|
|
1389
|
+
};
|
|
1390
|
+
} else
|
|
1391
|
+
properties[method] = {
|
|
1392
|
+
configurable,
|
|
1393
|
+
value: init
|
|
1394
|
+
};
|
|
1395
|
+
};
|
|
1396
|
+
var augmented = (Class) => {
|
|
1397
|
+
const { prototype } = Class;
|
|
1398
|
+
const events = [];
|
|
1399
|
+
const properties = {
|
|
1400
|
+
html: {
|
|
1401
|
+
configurable,
|
|
1402
|
+
get: getHTML
|
|
1403
|
+
},
|
|
1404
|
+
svg: {
|
|
1405
|
+
configurable,
|
|
1406
|
+
get: getSVG
|
|
1407
|
+
}
|
|
1408
|
+
};
|
|
1409
|
+
properties[secret] = {
|
|
1410
|
+
value: {
|
|
1411
|
+
events,
|
|
1412
|
+
info: null
|
|
1413
|
+
}
|
|
1414
|
+
};
|
|
1415
|
+
if (!("handleEvent" in prototype))
|
|
1416
|
+
properties.handleEvent = {
|
|
1417
|
+
configurable,
|
|
1418
|
+
value: handleEvent
|
|
1419
|
+
};
|
|
1420
|
+
if ("render" in prototype && prototype.render.length) {
|
|
1421
|
+
const { oninit } = prototype;
|
|
1422
|
+
defineProperties(prototype, {
|
|
1423
|
+
oninit: {
|
|
1424
|
+
configurable,
|
|
1425
|
+
value() {
|
|
1426
|
+
const hook = augmentor(this.render.bind(this, hooks2));
|
|
1427
|
+
defineProperties(this, {
|
|
1428
|
+
render: {
|
|
1429
|
+
configurable,
|
|
1430
|
+
value: hook
|
|
1431
|
+
}
|
|
1432
|
+
});
|
|
1433
|
+
this.addEventListener(
|
|
1434
|
+
"disconnected",
|
|
1435
|
+
dropEffect.bind(null, hook),
|
|
1436
|
+
false
|
|
1437
|
+
);
|
|
1438
|
+
if (oninit)
|
|
1439
|
+
oninit.apply(this, arguments);
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
});
|
|
1443
|
+
}
|
|
1444
|
+
if ("oninit" in prototype) {
|
|
1445
|
+
events.push("init");
|
|
1446
|
+
addInit(prototype, properties, "render");
|
|
1447
|
+
}
|
|
1448
|
+
addInit(prototype, properties, attributeChangedCallback);
|
|
1449
|
+
addInit(prototype, properties, connectedCallback);
|
|
1450
|
+
addInit(prototype, properties, disconnectedCallback);
|
|
1451
|
+
[
|
|
1452
|
+
[
|
|
1453
|
+
attributeChangedCallback,
|
|
1454
|
+
"onattributechanged",
|
|
1455
|
+
onattributechanged
|
|
1456
|
+
],
|
|
1457
|
+
[
|
|
1458
|
+
connectedCallback,
|
|
1459
|
+
"onconnected",
|
|
1460
|
+
onconnected
|
|
1461
|
+
],
|
|
1462
|
+
[
|
|
1463
|
+
disconnectedCallback,
|
|
1464
|
+
"ondisconnected",
|
|
1465
|
+
ondisconnected
|
|
1466
|
+
],
|
|
1467
|
+
[
|
|
1468
|
+
connectedCallback,
|
|
1469
|
+
"render",
|
|
1470
|
+
onconnectedrender
|
|
1471
|
+
]
|
|
1472
|
+
].forEach(([ce, he, value]) => {
|
|
1473
|
+
if (!(ce in prototype) && he in prototype) {
|
|
1474
|
+
if (he !== "render")
|
|
1475
|
+
events.push(he.slice(2));
|
|
1476
|
+
if (ce in properties) {
|
|
1477
|
+
const original = properties[ce].value;
|
|
1478
|
+
properties[ce] = {
|
|
1479
|
+
configurable,
|
|
1480
|
+
value() {
|
|
1481
|
+
original.apply(this, arguments);
|
|
1482
|
+
return value.apply(this, arguments);
|
|
1483
|
+
}
|
|
1484
|
+
};
|
|
1485
|
+
} else
|
|
1486
|
+
properties[ce] = { configurable, value };
|
|
1487
|
+
}
|
|
1488
|
+
});
|
|
1489
|
+
const booleanAttributes = Class.booleanAttributes || [];
|
|
1490
|
+
booleanAttributes.forEach((name) => {
|
|
1491
|
+
if (!(name in prototype))
|
|
1492
|
+
properties[name] = {
|
|
1493
|
+
configurable,
|
|
1494
|
+
get() {
|
|
1495
|
+
return this.hasAttribute(name);
|
|
1496
|
+
},
|
|
1497
|
+
set(value) {
|
|
1498
|
+
if (!value || value === "false")
|
|
1499
|
+
this.removeAttribute(name);
|
|
1500
|
+
else
|
|
1501
|
+
this.setAttribute(name, value);
|
|
1502
|
+
}
|
|
1503
|
+
};
|
|
1504
|
+
});
|
|
1505
|
+
const observedAttributes = Class.observedAttributes || [];
|
|
1506
|
+
observedAttributes.forEach((name) => {
|
|
1507
|
+
if (!(name in prototype))
|
|
1508
|
+
properties[name] = {
|
|
1509
|
+
configurable,
|
|
1510
|
+
get() {
|
|
1511
|
+
return this.getAttribute(name);
|
|
1512
|
+
},
|
|
1513
|
+
set(value) {
|
|
1514
|
+
if (value == null)
|
|
1515
|
+
this.removeAttribute(name);
|
|
1516
|
+
else
|
|
1517
|
+
this.setAttribute(name, value);
|
|
1518
|
+
}
|
|
1519
|
+
};
|
|
1520
|
+
});
|
|
1521
|
+
const mappedAttributes = Class.mappedAttributes || [];
|
|
1522
|
+
mappedAttributes.forEach((name) => {
|
|
1523
|
+
const _ = new esm_default();
|
|
1524
|
+
const listening = "on" + name in prototype;
|
|
1525
|
+
if (listening)
|
|
1526
|
+
events.push(name);
|
|
1527
|
+
properties[name] = {
|
|
1528
|
+
configurable,
|
|
1529
|
+
get() {
|
|
1530
|
+
return _.get(this);
|
|
1531
|
+
},
|
|
1532
|
+
set(detail) {
|
|
1533
|
+
_.set(this, detail);
|
|
1534
|
+
if (listening) {
|
|
1535
|
+
const e = evt(name);
|
|
1536
|
+
e.detail = detail;
|
|
1537
|
+
if (ws.has(this))
|
|
1538
|
+
this.dispatchEvent(e);
|
|
1539
|
+
else {
|
|
1540
|
+
const dispatch = $mappedAttributes.get(this);
|
|
1541
|
+
if (dispatch)
|
|
1542
|
+
dispatch.push(e);
|
|
1543
|
+
else
|
|
1544
|
+
$mappedAttributes.set(this, [e]);
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
};
|
|
1549
|
+
});
|
|
1550
|
+
defineProperties(prototype, properties);
|
|
1551
|
+
const attributes = booleanAttributes.concat(observedAttributes);
|
|
1552
|
+
return attributes.length ? defineProperties(Class, {
|
|
1553
|
+
observedAttributes: {
|
|
1554
|
+
configurable,
|
|
1555
|
+
get: () => attributes
|
|
1556
|
+
}
|
|
1557
|
+
}) : Class;
|
|
1558
|
+
};
|
|
1559
|
+
var defineHook = (name, hook) => {
|
|
1560
|
+
if (name in hooks2)
|
|
1561
|
+
throw new Error("duplicated hook " + name);
|
|
1562
|
+
hooks2[name] = hook(hooks2);
|
|
1563
|
+
};
|
|
1564
|
+
var evt = (type) => new esm_default3(type);
|
|
1565
|
+
var html2 = (...args) => new Hole("html", args);
|
|
1566
|
+
html2.for = lighterHTML.for;
|
|
1567
|
+
var svg2 = (...args) => new Hole("svg", args);
|
|
1568
|
+
svg2.for = lighterSVG.for;
|
|
1569
|
+
var setParsed = (wm, template, { info: info2 }) => {
|
|
1570
|
+
const value = info2 ? replace(template.join(secret), info2).split(secret) : template;
|
|
1571
|
+
wm.set(template, value);
|
|
1572
|
+
return value;
|
|
1573
|
+
};
|
|
1574
|
+
var setWrap = (self4, type, wm) => {
|
|
1575
|
+
const fn = wrap(self4, type, new esm_default());
|
|
1576
|
+
wm.set(self4, fn);
|
|
1577
|
+
return fn;
|
|
1578
|
+
};
|
|
1579
|
+
var wrap = (self4, type, wm) => (template, ...values) => {
|
|
1580
|
+
const local = wm.get(template) || setParsed(wm, template, self4[secret]);
|
|
1581
|
+
return lighterRender(self4, () => type(local, ...values));
|
|
1582
|
+
};
|
|
1583
|
+
function addListener(type) {
|
|
1584
|
+
this.addEventListener(type, this);
|
|
1585
|
+
}
|
|
1586
|
+
function dispatchEvent(event2) {
|
|
1587
|
+
this.dispatchEvent(event2);
|
|
1588
|
+
}
|
|
1589
|
+
function getHTML() {
|
|
1590
|
+
return $html.get(this) || setWrap(this, html2, $html);
|
|
1591
|
+
}
|
|
1592
|
+
function getSVG() {
|
|
1593
|
+
return $svg.get(this) || setWrap(this, svg2, $svg);
|
|
1594
|
+
}
|
|
1595
|
+
function handleEvent(event2) {
|
|
1596
|
+
this[`on${event2.type}`](event2);
|
|
1597
|
+
}
|
|
1598
|
+
function init() {
|
|
1599
|
+
if (!ws.has(this)) {
|
|
1600
|
+
ws.add(this);
|
|
1601
|
+
this[secret].events.forEach(addListener, this);
|
|
1602
|
+
this.dispatchEvent(evt("init"));
|
|
1603
|
+
const events = $mappedAttributes.get(this);
|
|
1604
|
+
if (events) {
|
|
1605
|
+
$mappedAttributes.delete(this);
|
|
1606
|
+
events.forEach(dispatchEvent, this);
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
function onattributechanged(attributeName, oldValue, newValue) {
|
|
1611
|
+
const event2 = evt("attributechanged");
|
|
1612
|
+
event2.attributeName = attributeName;
|
|
1613
|
+
event2.oldValue = oldValue;
|
|
1614
|
+
event2.newValue = newValue;
|
|
1615
|
+
this.dispatchEvent(event2);
|
|
1616
|
+
}
|
|
1617
|
+
function onconnected() {
|
|
1618
|
+
this.dispatchEvent(evt("connected"));
|
|
1619
|
+
}
|
|
1620
|
+
function onconnectedrender() {
|
|
1621
|
+
this.render();
|
|
1622
|
+
}
|
|
1623
|
+
function ondisconnected() {
|
|
1624
|
+
this.dispatchEvent(evt("disconnected"));
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
// node_modules/heresy/esm/index.js
|
|
1628
|
+
var {
|
|
1629
|
+
create: create2,
|
|
1630
|
+
defineProperty,
|
|
1631
|
+
defineProperties: defineProperties2,
|
|
1632
|
+
getOwnPropertyNames,
|
|
1633
|
+
getOwnPropertySymbols,
|
|
1634
|
+
getOwnPropertyDescriptor,
|
|
1635
|
+
keys: keys2
|
|
1636
|
+
} = Object;
|
|
1637
|
+
var HTML = {
|
|
1638
|
+
element: HTMLElement
|
|
1639
|
+
};
|
|
1640
|
+
var cc = new esm_default();
|
|
1641
|
+
var dc = new esm_default();
|
|
1642
|
+
var oc = new esm_default();
|
|
1643
|
+
var fragments = new esm_default();
|
|
1644
|
+
var info = (tagName2, is) => ({ tagName: tagName2, is, element: tagName2 === "element" });
|
|
1645
|
+
var define = ($, definition) => (typeof $ === "string" ? register($, definition, "") : register($.name, $, "")).Class;
|
|
1646
|
+
var fromClass = (constructor) => {
|
|
1647
|
+
const Class = extend(constructor, false);
|
|
1648
|
+
cc.set(constructor, augmented(Class));
|
|
1649
|
+
return Class;
|
|
1650
|
+
};
|
|
1651
|
+
var fromObject = (object, tag) => {
|
|
1652
|
+
const { statics, prototype } = grabInfo(object);
|
|
1653
|
+
const Class = extend(
|
|
1654
|
+
HTML[tag] || (HTML[tag] = document.createElement(tag).constructor),
|
|
1655
|
+
false
|
|
1656
|
+
);
|
|
1657
|
+
defineProperties2(Class.prototype, prototype);
|
|
1658
|
+
defineProperties2(Class, statics);
|
|
1659
|
+
oc.set(object, augmented(Class));
|
|
1660
|
+
return Class;
|
|
1661
|
+
};
|
|
1662
|
+
var grabInfo = (object) => {
|
|
1663
|
+
const statics = create2(null);
|
|
1664
|
+
const prototype = create2(null);
|
|
1665
|
+
const info2 = { prototype, statics };
|
|
1666
|
+
getOwnPropertyNames(object).concat(
|
|
1667
|
+
getOwnPropertySymbols(object)
|
|
1668
|
+
).forEach((name) => {
|
|
1669
|
+
const descriptor = getOwnPropertyDescriptor(object, name);
|
|
1670
|
+
descriptor.enumerable = false;
|
|
1671
|
+
switch (name) {
|
|
1672
|
+
case "extends":
|
|
1673
|
+
name = "tagName";
|
|
1674
|
+
case "contains":
|
|
1675
|
+
case "includes":
|
|
1676
|
+
case "name":
|
|
1677
|
+
case "booleanAttributes":
|
|
1678
|
+
case "mappedAttributes":
|
|
1679
|
+
case "observedAttributes":
|
|
1680
|
+
case "style":
|
|
1681
|
+
case "tagName":
|
|
1682
|
+
statics[name] = descriptor;
|
|
1683
|
+
break;
|
|
1684
|
+
default:
|
|
1685
|
+
prototype[name] = descriptor;
|
|
1686
|
+
}
|
|
1687
|
+
});
|
|
1688
|
+
return info2;
|
|
1689
|
+
};
|
|
1690
|
+
var injectStyle = (cssText) => {
|
|
1691
|
+
if ((cssText || "").length) {
|
|
1692
|
+
const style = document.createElement("style");
|
|
1693
|
+
style.type = "text/css";
|
|
1694
|
+
if (style.styleSheet)
|
|
1695
|
+
style.styleSheet.cssText = cssText;
|
|
1696
|
+
else
|
|
1697
|
+
style.appendChild(document.createTextNode(cssText));
|
|
1698
|
+
const head = document.head || document.querySelector("head");
|
|
1699
|
+
head.insertBefore(style, head.lastChild);
|
|
1700
|
+
}
|
|
1701
|
+
};
|
|
1702
|
+
var ref2 = (self4, name) => self4 ? self4[name] || (self4[name] = { current: null }) : { current: null };
|
|
1703
|
+
var register = ($, definition, uid) => {
|
|
1704
|
+
const validName = /^([A-Z][A-Za-z0-9_]*)(<([A-Za-z0-9:._-]+)>|:([A-Za-z0-9:._-]+))?$/;
|
|
1705
|
+
if (!validName.test($))
|
|
1706
|
+
throw "Invalid name";
|
|
1707
|
+
const { $1: name, $3: asTag, $4: asColon } = RegExp;
|
|
1708
|
+
let tagName2 = asTag || asColon || definition.tagName || definition.extends || "element";
|
|
1709
|
+
const isFragment = tagName2 === "fragment";
|
|
1710
|
+
if (isFragment)
|
|
1711
|
+
tagName2 = "element";
|
|
1712
|
+
else if (!/^[A-Za-z0-9:._-]+$/.test(tagName2))
|
|
1713
|
+
throw "Invalid tag";
|
|
1714
|
+
let hyphenizedName = "";
|
|
1715
|
+
let suffix = "";
|
|
1716
|
+
if (tagName2.indexOf("-") < 0) {
|
|
1717
|
+
hyphenizedName = esm_default2(name) + uid;
|
|
1718
|
+
if (hyphenizedName.indexOf("-") < 0)
|
|
1719
|
+
suffix = "-heresy";
|
|
1720
|
+
} else {
|
|
1721
|
+
hyphenizedName = tagName2 + uid;
|
|
1722
|
+
tagName2 = "element";
|
|
1723
|
+
}
|
|
1724
|
+
const is = hyphenizedName + suffix;
|
|
1725
|
+
if (customElements.get(is))
|
|
1726
|
+
throw `Duplicated ${is} definition`;
|
|
1727
|
+
const Class = extend(
|
|
1728
|
+
typeof definition === "object" ? oc.get(definition) || fromObject(definition, tagName2) : cc.get(definition) || fromClass(definition),
|
|
1729
|
+
true
|
|
1730
|
+
);
|
|
1731
|
+
const element = tagName2 === "element";
|
|
1732
|
+
defineProperty(Class, "new", {
|
|
1733
|
+
value: element ? () => document.createElement(is) : () => document.createElement(tagName2, { is })
|
|
1734
|
+
});
|
|
1735
|
+
defineProperty(Class.prototype, "is", { value: is });
|
|
1736
|
+
if (uid === "") {
|
|
1737
|
+
const id = hash(hyphenizedName.toUpperCase());
|
|
1738
|
+
registry.map[name] = setupIncludes(Class, tagName2, is, { id, i: 0 });
|
|
1739
|
+
registry.re = regExp(keys2(registry.map));
|
|
1740
|
+
}
|
|
1741
|
+
if (isFragment) {
|
|
1742
|
+
const { render: render3 } = Class.prototype;
|
|
1743
|
+
defineProperty(
|
|
1744
|
+
Class.prototype,
|
|
1745
|
+
"render",
|
|
1746
|
+
{
|
|
1747
|
+
configurable: true,
|
|
1748
|
+
value() {
|
|
1749
|
+
if (render3)
|
|
1750
|
+
render3.apply(this, arguments);
|
|
1751
|
+
if (this.parentNode) {
|
|
1752
|
+
const { firstChild } = this;
|
|
1753
|
+
let contents = null;
|
|
1754
|
+
if (firstChild) {
|
|
1755
|
+
const range = document.createRange();
|
|
1756
|
+
range.setStartBefore(firstChild);
|
|
1757
|
+
range.setEndAfter(this.lastChild);
|
|
1758
|
+
contents = range.extractContents();
|
|
1759
|
+
this.parentNode.replaceChild(contents, this);
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
);
|
|
1765
|
+
}
|
|
1766
|
+
const args = [is, Class];
|
|
1767
|
+
if (!element)
|
|
1768
|
+
args.push({ extends: tagName2 });
|
|
1769
|
+
customElements.define(...args);
|
|
1770
|
+
return { Class, is, name, tagName: tagName2 };
|
|
1771
|
+
};
|
|
1772
|
+
var render2 = (where, what) => lighterRender(
|
|
1773
|
+
where,
|
|
1774
|
+
typeof what === "function" ? what : what instanceof Hole ? () => what : runtime(what)
|
|
1775
|
+
);
|
|
1776
|
+
var dcid = Math.random();
|
|
1777
|
+
var runtime = (Component) => {
|
|
1778
|
+
let Class = dc.get(Component);
|
|
1779
|
+
if (!Class) {
|
|
1780
|
+
const name = ("Heresy" + ++dcid).replace(/[^He-y0-9]/g, "");
|
|
1781
|
+
dc.set(Component, Class = define(name, Component));
|
|
1782
|
+
}
|
|
1783
|
+
return () => Class.new();
|
|
1784
|
+
};
|
|
1785
|
+
var setupIncludes = (Class, tagName2, is, u) => {
|
|
1786
|
+
const { prototype } = Class;
|
|
1787
|
+
const details = info(tagName2, is);
|
|
1788
|
+
const styles = [selector(details)];
|
|
1789
|
+
const includes = Class.includes || Class.contains;
|
|
1790
|
+
if (includes) {
|
|
1791
|
+
const map = {};
|
|
1792
|
+
keys2(includes).forEach(($) => {
|
|
1793
|
+
const uid = `-${u.id}-${u.i++}`;
|
|
1794
|
+
const { Class: Class2, is: is2, name, tagName: tagName3 } = register($, includes[$], uid);
|
|
1795
|
+
styles.push(selector(map[name] = setupIncludes(Class2, tagName3, is2, u)));
|
|
1796
|
+
});
|
|
1797
|
+
const re = regExp(keys2(map));
|
|
1798
|
+
const { events } = prototype[secret];
|
|
1799
|
+
const value = {
|
|
1800
|
+
events,
|
|
1801
|
+
info: { map, re }
|
|
1802
|
+
};
|
|
1803
|
+
defineProperty(prototype, secret, { value });
|
|
1804
|
+
if ("render" in prototype) {
|
|
1805
|
+
const { render: render3 } = prototype;
|
|
1806
|
+
const { info: info2 } = value;
|
|
1807
|
+
defineProperty(prototype, "render", {
|
|
1808
|
+
configurable: true,
|
|
1809
|
+
value() {
|
|
1810
|
+
const tmp2 = getInfo();
|
|
1811
|
+
setInfo(info2);
|
|
1812
|
+
const out = render3.apply(this, arguments);
|
|
1813
|
+
setInfo(tmp2);
|
|
1814
|
+
return out;
|
|
1815
|
+
}
|
|
1816
|
+
});
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
if ("style" in Class)
|
|
1820
|
+
injectStyle(Class.style(...styles));
|
|
1821
|
+
return details;
|
|
1822
|
+
};
|
|
1823
|
+
|
|
1824
|
+
// src/lib/version.ts
|
|
1825
|
+
var sdkVersion = "2.0.0-beta2";
|
|
1826
|
+
|
|
1827
|
+
// src/lib/embed/index.ts
|
|
1828
|
+
var boolAttrs = [
|
|
1829
|
+
"audio",
|
|
1830
|
+
"background",
|
|
1831
|
+
"cameraaccess",
|
|
1832
|
+
"chat",
|
|
1833
|
+
"people",
|
|
1834
|
+
"embed",
|
|
1835
|
+
"emptyRoomInvitation",
|
|
1836
|
+
"help",
|
|
1837
|
+
"leaveButton",
|
|
1838
|
+
"precallReview",
|
|
1839
|
+
"screenshare",
|
|
1840
|
+
"video",
|
|
1841
|
+
"floatSelf",
|
|
1842
|
+
"recording",
|
|
1843
|
+
"logo",
|
|
1844
|
+
"locking",
|
|
1845
|
+
"participantCount",
|
|
1846
|
+
"settingsButton",
|
|
1847
|
+
"pipButton",
|
|
1848
|
+
"moreButton",
|
|
1849
|
+
"personality",
|
|
1850
|
+
"subgridLabels",
|
|
1851
|
+
"lowData",
|
|
1852
|
+
"breakout"
|
|
1853
|
+
];
|
|
1854
|
+
define("WherebyEmbed", {
|
|
1855
|
+
oninit() {
|
|
1856
|
+
this.iframe = ref2();
|
|
1857
|
+
},
|
|
1858
|
+
onconnected() {
|
|
1859
|
+
window.addEventListener("message", this.onmessage.bind(this));
|
|
1860
|
+
},
|
|
1861
|
+
ondisconnected() {
|
|
1862
|
+
window.removeEventListener("message", this.onmessage.bind(this));
|
|
1863
|
+
},
|
|
1864
|
+
observedAttributes: [
|
|
1865
|
+
"displayName",
|
|
1866
|
+
"minimal",
|
|
1867
|
+
"room",
|
|
1868
|
+
"subdomain",
|
|
1869
|
+
"lang",
|
|
1870
|
+
"metadata",
|
|
1871
|
+
"groups",
|
|
1872
|
+
"virtualBackgroundUrl",
|
|
1873
|
+
"avatarUrl",
|
|
1874
|
+
"externalId",
|
|
1875
|
+
...boolAttrs
|
|
1876
|
+
].map((a) => a.toLowerCase()),
|
|
1877
|
+
onattributechanged({ attributeName, oldValue }) {
|
|
1878
|
+
if (["room", "subdomain"].includes(attributeName) && oldValue == null)
|
|
1879
|
+
return;
|
|
1880
|
+
this.render();
|
|
1881
|
+
},
|
|
1882
|
+
style(self4) {
|
|
1883
|
+
return `
|
|
1884
|
+
${self4} {
|
|
1885
|
+
display: block;
|
|
1886
|
+
}
|
|
1887
|
+
${self4} iframe {
|
|
1888
|
+
border: none;
|
|
1889
|
+
height: 100%;
|
|
1890
|
+
width: 100%;
|
|
1891
|
+
}
|
|
1892
|
+
`;
|
|
1893
|
+
},
|
|
1894
|
+
// Commands
|
|
1895
|
+
_postCommand(command, args = []) {
|
|
1896
|
+
if (this.iframe.current) {
|
|
1897
|
+
this.iframe.current.contentWindow.postMessage({ command, args }, this.url.origin);
|
|
1898
|
+
}
|
|
1899
|
+
},
|
|
1900
|
+
startRecording() {
|
|
1901
|
+
this._postCommand("start_recording");
|
|
1902
|
+
},
|
|
1903
|
+
stopRecording() {
|
|
1904
|
+
this._postCommand("stop_recording");
|
|
1905
|
+
},
|
|
1906
|
+
toggleCamera(enabled) {
|
|
1907
|
+
this._postCommand("toggle_camera", [enabled]);
|
|
1908
|
+
},
|
|
1909
|
+
toggleMicrophone(enabled) {
|
|
1910
|
+
this._postCommand("toggle_microphone", [enabled]);
|
|
1911
|
+
},
|
|
1912
|
+
toggleScreenshare(enabled) {
|
|
1913
|
+
this._postCommand("toggle_screenshare", [enabled]);
|
|
1914
|
+
},
|
|
1915
|
+
onmessage({ origin, data: data2 }) {
|
|
1916
|
+
if (origin !== this.url.origin)
|
|
1917
|
+
return;
|
|
1918
|
+
const { type, payload: detail } = data2;
|
|
1919
|
+
this.dispatchEvent(new CustomEvent(type, { detail }));
|
|
1920
|
+
},
|
|
1921
|
+
render() {
|
|
1922
|
+
const {
|
|
1923
|
+
avatarurl: avatarUrl,
|
|
1924
|
+
displayname: displayName,
|
|
1925
|
+
externalId,
|
|
1926
|
+
lang,
|
|
1927
|
+
metadata,
|
|
1928
|
+
minimal,
|
|
1929
|
+
room,
|
|
1930
|
+
groups,
|
|
1931
|
+
virtualbackgroundurl: virtualBackgroundUrl
|
|
1932
|
+
} = this;
|
|
1933
|
+
if (!room)
|
|
1934
|
+
return this.html`Whereby: Missing room attribute.`;
|
|
1935
|
+
const m = /https:\/\/([^.]+)(\.whereby.com|-ip-\d+-\d+-\d+-\d+.hereby.dev:4443)\/.+/.exec(room);
|
|
1936
|
+
const subdomain = m && m[1] || this.subdomain;
|
|
1937
|
+
if (!subdomain)
|
|
1938
|
+
return this.html`Whereby: Missing subdomain attr.`;
|
|
1939
|
+
if (!m) {
|
|
1940
|
+
return this.html`could not parse URL.`;
|
|
1941
|
+
}
|
|
1942
|
+
const baseURL = m[2] || `.whereby.com`;
|
|
1943
|
+
this.url = new URL(room, `https://${subdomain}${baseURL}`);
|
|
1944
|
+
const roomUrl = new URL(room);
|
|
1945
|
+
if (roomUrl.searchParams.get("roomKey")) {
|
|
1946
|
+
this.url.searchParams.append("roomKey", roomUrl.searchParams.get("roomKey"));
|
|
1947
|
+
}
|
|
1948
|
+
Object.entries(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
1949
|
+
jsApi: true,
|
|
1950
|
+
we: "2.0.0-beta2",
|
|
1951
|
+
iframeSource: subdomain
|
|
1952
|
+
}, displayName && { displayName }), lang && { lang }), metadata && { metadata }), externalId && { externalId }), groups && { groups }), virtualBackgroundUrl && { virtualBackgroundUrl }), avatarUrl && { avatarUrl }), minimal != null && { embed: minimal }), boolAttrs.reduce(
|
|
1953
|
+
// add to URL if set in any way
|
|
1954
|
+
(o, v) => this[v.toLowerCase()] != null ? __spreadProps(__spreadValues({}, o), { [v]: this[v.toLowerCase()] }) : o,
|
|
1955
|
+
{}
|
|
1956
|
+
))).forEach(([k, v]) => {
|
|
1957
|
+
if (!this.url.searchParams.has(k) && typeof v === "string") {
|
|
1958
|
+
this.url.searchParams.set(k, v);
|
|
1959
|
+
}
|
|
1960
|
+
});
|
|
1961
|
+
return this.html`
|
|
1962
|
+
<iframe
|
|
1963
|
+
ref=${this.iframe}
|
|
1964
|
+
src=${this.url}
|
|
1965
|
+
allow="autoplay; camera; microphone; fullscreen; speaker; display-capture" />
|
|
1966
|
+
`;
|
|
1967
|
+
}
|
|
1968
|
+
});
|
|
1969
|
+
export {
|
|
1970
|
+
sdkVersion
|
|
1971
|
+
};
|
|
1972
|
+
/*! Bundled license information:
|
|
1973
|
+
|
|
1974
|
+
@ungap/weakmap/esm/index.js:
|
|
1975
|
+
(*! (c) Andrea Giammarchi - ISC *)
|
|
1976
|
+
|
|
1977
|
+
@ungap/event/esm/index.js:
|
|
1978
|
+
(*! (c) Andrea Giammarchi - ISC *)
|
|
1979
|
+
|
|
1980
|
+
@ungap/weakset/esm/index.js:
|
|
1981
|
+
(*! (c) Andrea Giammarchi - ISC *)
|
|
1982
|
+
|
|
1983
|
+
domconstants/esm/index.js:
|
|
1984
|
+
(*! (c) Andrea Giammarchi - ISC *)
|
|
1985
|
+
|
|
1986
|
+
domsanitizer/esm/index.js:
|
|
1987
|
+
(*! (c) Andrea Giammarchi - ISC *)
|
|
1988
|
+
|
|
1989
|
+
@ungap/create-content/esm/index.js:
|
|
1990
|
+
(*! (c) Andrea Giammarchi - ISC *)
|
|
1991
|
+
|
|
1992
|
+
@ungap/import-node/esm/index.js:
|
|
1993
|
+
(*! (c) Andrea Giammarchi - ISC *)
|
|
1994
|
+
|
|
1995
|
+
hyperhtml-style/esm/index.js:
|
|
1996
|
+
(*! (c) Andrea Giammarchi - ISC *)
|
|
1997
|
+
|
|
1998
|
+
augmentor/esm/index.js:
|
|
1999
|
+
(*! (c) Andrea Giammarchi - ISC *)
|
|
2000
|
+
*/
|