@everymatrix/player-lugas-limit 1.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/cjs/index-034179c3.js +1193 -0
  2. package/dist/cjs/index.cjs.js +2 -0
  3. package/dist/cjs/loader.cjs.js +21 -0
  4. package/dist/cjs/player-lugas-limit.cjs.entry.js +342 -0
  5. package/dist/cjs/player-lugas-limit.cjs.js +19 -0
  6. package/dist/collection/collection-manifest.json +12 -0
  7. package/dist/collection/components/player-lugas-limit/player-lugas-limit.css +174 -0
  8. package/dist/collection/components/player-lugas-limit/player-lugas-limit.js +529 -0
  9. package/dist/collection/index.js +1 -0
  10. package/dist/collection/utils/locale.utils.js +111 -0
  11. package/dist/collection/utils/utils.js +0 -0
  12. package/dist/components/index.d.ts +26 -0
  13. package/dist/components/index.js +1 -0
  14. package/dist/components/player-lugas-limit.d.ts +11 -0
  15. package/dist/components/player-lugas-limit.js +381 -0
  16. package/dist/esm/index-9b67d402.js +1167 -0
  17. package/dist/esm/index.js +1 -0
  18. package/dist/esm/loader.js +17 -0
  19. package/dist/esm/player-lugas-limit.entry.js +338 -0
  20. package/dist/esm/player-lugas-limit.js +17 -0
  21. package/dist/esm/polyfills/core-js.js +11 -0
  22. package/dist/esm/polyfills/css-shim.js +1 -0
  23. package/dist/esm/polyfills/dom.js +79 -0
  24. package/dist/esm/polyfills/es5-html-element.js +1 -0
  25. package/dist/esm/polyfills/index.js +34 -0
  26. package/dist/esm/polyfills/system.js +6 -0
  27. package/dist/index.cjs.js +1 -0
  28. package/dist/index.js +1 -0
  29. package/dist/player-lugas-limit/index.esm.js +0 -0
  30. package/dist/player-lugas-limit/p-76c6c11d.js +1 -0
  31. package/dist/player-lugas-limit/p-9b67af1c.entry.js +1 -0
  32. package/dist/player-lugas-limit/player-lugas-limit.esm.js +1 -0
  33. package/dist/stencil.config.js +22 -0
  34. package/dist/types/Users/adrian.pripon/Documents/Work/stencil/widgets-stencil/packages/player-lugas-limit/.stencil/packages/player-lugas-limit/stencil.config.d.ts +2 -0
  35. package/dist/types/components/player-lugas-limit/player-lugas-limit.d.ts +73 -0
  36. package/dist/types/components.d.ts +126 -0
  37. package/dist/types/index.d.ts +1 -0
  38. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  39. package/dist/types/utils/locale.utils.d.ts +1 -0
  40. package/dist/types/utils/utils.d.ts +0 -0
  41. package/loader/cdn.js +3 -0
  42. package/loader/index.cjs.js +3 -0
  43. package/loader/index.d.ts +12 -0
  44. package/loader/index.es2017.js +3 -0
  45. package/loader/index.js +4 -0
  46. package/loader/package.json +10 -0
  47. package/package.json +23 -0
@@ -0,0 +1,1167 @@
1
+ const NAMESPACE = 'player-lugas-limit';
2
+
3
+ let scopeId;
4
+ let hostTagName;
5
+ let isSvgMode = false;
6
+ let queuePending = false;
7
+ const win = typeof window !== 'undefined' ? window : {};
8
+ const doc = win.document || { head: {} };
9
+ const plt = {
10
+ $flags$: 0,
11
+ $resourcesUrl$: '',
12
+ jmp: (h) => h(),
13
+ raf: (h) => requestAnimationFrame(h),
14
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
15
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
16
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
17
+ };
18
+ const promiseResolve = (v) => Promise.resolve(v);
19
+ const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
20
+ try {
21
+ new CSSStyleSheet();
22
+ return typeof new CSSStyleSheet().replace === 'function';
23
+ }
24
+ catch (e) { }
25
+ return false;
26
+ })()
27
+ ;
28
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
29
+ const createTime = (fnName, tagName = '') => {
30
+ {
31
+ return () => {
32
+ return;
33
+ };
34
+ }
35
+ };
36
+ const uniqueTime = (key, measureText) => {
37
+ {
38
+ return () => {
39
+ return;
40
+ };
41
+ }
42
+ };
43
+ const rootAppliedStyles = new WeakMap();
44
+ const registerStyle = (scopeId, cssText, allowCS) => {
45
+ let style = styles.get(scopeId);
46
+ if (supportsConstructibleStylesheets && allowCS) {
47
+ style = (style || new CSSStyleSheet());
48
+ style.replace(cssText);
49
+ }
50
+ else {
51
+ style = cssText;
52
+ }
53
+ styles.set(scopeId, style);
54
+ };
55
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
56
+ let scopeId = getScopeId(cmpMeta);
57
+ let style = styles.get(scopeId);
58
+ // if an element is NOT connected then getRootNode() will return the wrong root node
59
+ // so the fallback is to always use the document for the root node in those cases
60
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
61
+ if (style) {
62
+ if (typeof style === 'string') {
63
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
64
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
65
+ let styleElm;
66
+ if (!appliedStyles) {
67
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
68
+ }
69
+ if (!appliedStyles.has(scopeId)) {
70
+ {
71
+ {
72
+ styleElm = doc.createElement('style');
73
+ styleElm.innerHTML = style;
74
+ }
75
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
76
+ }
77
+ if (appliedStyles) {
78
+ appliedStyles.add(scopeId);
79
+ }
80
+ }
81
+ }
82
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
83
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
84
+ }
85
+ }
86
+ return scopeId;
87
+ };
88
+ const attachStyles = (hostRef) => {
89
+ const cmpMeta = hostRef.$cmpMeta$;
90
+ const elm = hostRef.$hostElement$;
91
+ const flags = cmpMeta.$flags$;
92
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
93
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
94
+ if (flags & 10 /* needsScopedEncapsulation */) {
95
+ // only required when we're NOT using native shadow dom (slot)
96
+ // or this browser doesn't support native shadow dom
97
+ // and this host element was NOT created with SSR
98
+ // let's pick out the inner content for slot projection
99
+ // create a node to represent where the original
100
+ // content was first placed, which is useful later on
101
+ // DOM WRITE!!
102
+ elm['s-sc'] = scopeId;
103
+ elm.classList.add(scopeId + '-h');
104
+ }
105
+ endAttachStyles();
106
+ };
107
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
108
+ /**
109
+ * Default style mode id
110
+ */
111
+ /**
112
+ * Reusable empty obj/array
113
+ * Don't add values to these!!
114
+ */
115
+ const EMPTY_OBJ = {};
116
+ /**
117
+ * Namespaces
118
+ */
119
+ const SVG_NS = 'http://www.w3.org/2000/svg';
120
+ const HTML_NS = 'http://www.w3.org/1999/xhtml';
121
+ const isDef = (v) => v != null;
122
+ const isComplexType = (o) => {
123
+ // https://jsperf.com/typeof-fn-object/5
124
+ o = typeof o;
125
+ return o === 'object' || o === 'function';
126
+ };
127
+ /**
128
+ * Production h() function based on Preact by
129
+ * Jason Miller (@developit)
130
+ * Licensed under the MIT License
131
+ * https://github.com/developit/preact/blob/master/LICENSE
132
+ *
133
+ * Modified for Stencil's compiler and vdom
134
+ */
135
+ // const stack: any[] = [];
136
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
137
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
138
+ const h = (nodeName, vnodeData, ...children) => {
139
+ let child = null;
140
+ let simple = false;
141
+ let lastSimple = false;
142
+ let vNodeChildren = [];
143
+ const walk = (c) => {
144
+ for (let i = 0; i < c.length; i++) {
145
+ child = c[i];
146
+ if (Array.isArray(child)) {
147
+ walk(child);
148
+ }
149
+ else if (child != null && typeof child !== 'boolean') {
150
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
151
+ child = String(child);
152
+ }
153
+ if (simple && lastSimple) {
154
+ // If the previous child was simple (string), we merge both
155
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
156
+ }
157
+ else {
158
+ // Append a new vNode, if it's text, we create a text vNode
159
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
160
+ }
161
+ lastSimple = simple;
162
+ }
163
+ }
164
+ };
165
+ walk(children);
166
+ if (vnodeData) {
167
+ {
168
+ const classData = vnodeData.className || vnodeData.class;
169
+ if (classData) {
170
+ vnodeData.class =
171
+ typeof classData !== 'object'
172
+ ? classData
173
+ : Object.keys(classData)
174
+ .filter((k) => classData[k])
175
+ .join(' ');
176
+ }
177
+ }
178
+ }
179
+ const vnode = newVNode(nodeName, null);
180
+ vnode.$attrs$ = vnodeData;
181
+ if (vNodeChildren.length > 0) {
182
+ vnode.$children$ = vNodeChildren;
183
+ }
184
+ return vnode;
185
+ };
186
+ const newVNode = (tag, text) => {
187
+ const vnode = {
188
+ $flags$: 0,
189
+ $tag$: tag,
190
+ $text$: text,
191
+ $elm$: null,
192
+ $children$: null,
193
+ };
194
+ {
195
+ vnode.$attrs$ = null;
196
+ }
197
+ return vnode;
198
+ };
199
+ const Host = {};
200
+ const isHost = (node) => node && node.$tag$ === Host;
201
+ /**
202
+ * Production setAccessor() function based on Preact by
203
+ * Jason Miller (@developit)
204
+ * Licensed under the MIT License
205
+ * https://github.com/developit/preact/blob/master/LICENSE
206
+ *
207
+ * Modified for Stencil's compiler and vdom
208
+ */
209
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
210
+ if (oldValue !== newValue) {
211
+ let isProp = isMemberInElement(elm, memberName);
212
+ let ln = memberName.toLowerCase();
213
+ if (memberName === 'class') {
214
+ const classList = elm.classList;
215
+ const oldClasses = parseClassList(oldValue);
216
+ const newClasses = parseClassList(newValue);
217
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
218
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
219
+ }
220
+ else if (memberName === 'ref') {
221
+ // minifier will clean this up
222
+ if (newValue) {
223
+ newValue(elm);
224
+ }
225
+ }
226
+ else if ((!isProp ) &&
227
+ memberName[0] === 'o' &&
228
+ memberName[1] === 'n') {
229
+ // Event Handlers
230
+ // so if the member name starts with "on" and the 3rd characters is
231
+ // a capital letter, and it's not already a member on the element,
232
+ // then we're assuming it's an event listener
233
+ if (memberName[2] === '-') {
234
+ // on- prefixed events
235
+ // allows to be explicit about the dom event to listen without any magic
236
+ // under the hood:
237
+ // <my-cmp on-click> // listens for "click"
238
+ // <my-cmp on-Click> // listens for "Click"
239
+ // <my-cmp on-ionChange> // listens for "ionChange"
240
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
241
+ memberName = memberName.slice(3);
242
+ }
243
+ else if (isMemberInElement(win, ln)) {
244
+ // standard event
245
+ // the JSX attribute could have been "onMouseOver" and the
246
+ // member name "onmouseover" is on the window's prototype
247
+ // so let's add the listener "mouseover", which is all lowercased
248
+ memberName = ln.slice(2);
249
+ }
250
+ else {
251
+ // custom event
252
+ // the JSX attribute could have been "onMyCustomEvent"
253
+ // so let's trim off the "on" prefix and lowercase the first character
254
+ // and add the listener "myCustomEvent"
255
+ // except for the first character, we keep the event name case
256
+ memberName = ln[2] + memberName.slice(3);
257
+ }
258
+ if (oldValue) {
259
+ plt.rel(elm, memberName, oldValue, false);
260
+ }
261
+ if (newValue) {
262
+ plt.ael(elm, memberName, newValue, false);
263
+ }
264
+ }
265
+ else {
266
+ // Set property if it exists and it's not a SVG
267
+ const isComplex = isComplexType(newValue);
268
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
269
+ try {
270
+ if (!elm.tagName.includes('-')) {
271
+ let n = newValue == null ? '' : newValue;
272
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
273
+ if (memberName === 'list') {
274
+ isProp = false;
275
+ }
276
+ else if (oldValue == null || elm[memberName] != n) {
277
+ elm[memberName] = n;
278
+ }
279
+ }
280
+ else {
281
+ elm[memberName] = newValue;
282
+ }
283
+ }
284
+ catch (e) { }
285
+ }
286
+ if (newValue == null || newValue === false) {
287
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
288
+ {
289
+ elm.removeAttribute(memberName);
290
+ }
291
+ }
292
+ }
293
+ else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
294
+ newValue = newValue === true ? '' : newValue;
295
+ {
296
+ elm.setAttribute(memberName, newValue);
297
+ }
298
+ }
299
+ }
300
+ }
301
+ };
302
+ const parseClassListRegex = /\s/;
303
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
304
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
305
+ // if the element passed in is a shadow root, which is a document fragment
306
+ // then we want to be adding attrs/props to the shadow root's "host" element
307
+ // if it's not a shadow root, then we add attrs/props to the same element
308
+ const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
309
+ ? newVnode.$elm$.host
310
+ : newVnode.$elm$;
311
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
312
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
313
+ {
314
+ // remove attributes no longer present on the vnode by setting them to undefined
315
+ for (memberName in oldVnodeAttrs) {
316
+ if (!(memberName in newVnodeAttrs)) {
317
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
318
+ }
319
+ }
320
+ }
321
+ // add new & update changed attributes
322
+ for (memberName in newVnodeAttrs) {
323
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
324
+ }
325
+ };
326
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
327
+ // tslint:disable-next-line: prefer-const
328
+ let newVNode = newParentVNode.$children$[childIndex];
329
+ let i = 0;
330
+ let elm;
331
+ let childNode;
332
+ if (newVNode.$text$ !== null) {
333
+ // create text node
334
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
335
+ }
336
+ else {
337
+ if (!isSvgMode) {
338
+ isSvgMode = newVNode.$tag$ === 'svg';
339
+ }
340
+ // create element
341
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$tag$)
342
+ );
343
+ if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
344
+ isSvgMode = false;
345
+ }
346
+ // add css classes, attrs, props, listeners, etc.
347
+ {
348
+ updateElement(null, newVNode, isSvgMode);
349
+ }
350
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
351
+ // if there is a scopeId and this is the initial render
352
+ // then let's add the scopeId as a css class
353
+ elm.classList.add((elm['s-si'] = scopeId));
354
+ }
355
+ if (newVNode.$children$) {
356
+ for (i = 0; i < newVNode.$children$.length; ++i) {
357
+ // create the node
358
+ childNode = createElm(oldParentVNode, newVNode, i);
359
+ // return node could have been null
360
+ if (childNode) {
361
+ // append our new node
362
+ elm.appendChild(childNode);
363
+ }
364
+ }
365
+ }
366
+ {
367
+ if (newVNode.$tag$ === 'svg') {
368
+ // Only reset the SVG context when we're exiting <svg> element
369
+ isSvgMode = false;
370
+ }
371
+ else if (elm.tagName === 'foreignObject') {
372
+ // Reenter SVG context when we're exiting <foreignObject> element
373
+ isSvgMode = true;
374
+ }
375
+ }
376
+ }
377
+ return elm;
378
+ };
379
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
380
+ let containerElm = (parentElm);
381
+ let childNode;
382
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
383
+ containerElm = containerElm.shadowRoot;
384
+ }
385
+ for (; startIdx <= endIdx; ++startIdx) {
386
+ if (vnodes[startIdx]) {
387
+ childNode = createElm(null, parentVNode, startIdx);
388
+ if (childNode) {
389
+ vnodes[startIdx].$elm$ = childNode;
390
+ containerElm.insertBefore(childNode, before);
391
+ }
392
+ }
393
+ }
394
+ };
395
+ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
396
+ for (; startIdx <= endIdx; ++startIdx) {
397
+ if ((vnode = vnodes[startIdx])) {
398
+ elm = vnode.$elm$;
399
+ callNodeRefs(vnode);
400
+ // remove the vnode's element from the dom
401
+ elm.remove();
402
+ }
403
+ }
404
+ };
405
+ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
406
+ let oldStartIdx = 0;
407
+ let newStartIdx = 0;
408
+ let oldEndIdx = oldCh.length - 1;
409
+ let oldStartVnode = oldCh[0];
410
+ let oldEndVnode = oldCh[oldEndIdx];
411
+ let newEndIdx = newCh.length - 1;
412
+ let newStartVnode = newCh[0];
413
+ let newEndVnode = newCh[newEndIdx];
414
+ let node;
415
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
416
+ if (oldStartVnode == null) {
417
+ // Vnode might have been moved left
418
+ oldStartVnode = oldCh[++oldStartIdx];
419
+ }
420
+ else if (oldEndVnode == null) {
421
+ oldEndVnode = oldCh[--oldEndIdx];
422
+ }
423
+ else if (newStartVnode == null) {
424
+ newStartVnode = newCh[++newStartIdx];
425
+ }
426
+ else if (newEndVnode == null) {
427
+ newEndVnode = newCh[--newEndIdx];
428
+ }
429
+ else if (isSameVnode(oldStartVnode, newStartVnode)) {
430
+ patch(oldStartVnode, newStartVnode);
431
+ oldStartVnode = oldCh[++oldStartIdx];
432
+ newStartVnode = newCh[++newStartIdx];
433
+ }
434
+ else if (isSameVnode(oldEndVnode, newEndVnode)) {
435
+ patch(oldEndVnode, newEndVnode);
436
+ oldEndVnode = oldCh[--oldEndIdx];
437
+ newEndVnode = newCh[--newEndIdx];
438
+ }
439
+ else if (isSameVnode(oldStartVnode, newEndVnode)) {
440
+ patch(oldStartVnode, newEndVnode);
441
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
442
+ oldStartVnode = oldCh[++oldStartIdx];
443
+ newEndVnode = newCh[--newEndIdx];
444
+ }
445
+ else if (isSameVnode(oldEndVnode, newStartVnode)) {
446
+ patch(oldEndVnode, newStartVnode);
447
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
448
+ oldEndVnode = oldCh[--oldEndIdx];
449
+ newStartVnode = newCh[++newStartIdx];
450
+ }
451
+ else {
452
+ {
453
+ // new element
454
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
455
+ newStartVnode = newCh[++newStartIdx];
456
+ }
457
+ if (node) {
458
+ {
459
+ oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
460
+ }
461
+ }
462
+ }
463
+ }
464
+ if (oldStartIdx > oldEndIdx) {
465
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
466
+ }
467
+ else if (newStartIdx > newEndIdx) {
468
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
469
+ }
470
+ };
471
+ const isSameVnode = (vnode1, vnode2) => {
472
+ // compare if two vnode to see if they're "technically" the same
473
+ // need to have the same element tag, and same key to be the same
474
+ if (vnode1.$tag$ === vnode2.$tag$) {
475
+ return true;
476
+ }
477
+ return false;
478
+ };
479
+ const patch = (oldVNode, newVNode) => {
480
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
481
+ const oldChildren = oldVNode.$children$;
482
+ const newChildren = newVNode.$children$;
483
+ const tag = newVNode.$tag$;
484
+ const text = newVNode.$text$;
485
+ if (text === null) {
486
+ {
487
+ // test if we're rendering an svg element, or still rendering nodes inside of one
488
+ // only add this to the when the compiler sees we're using an svg somewhere
489
+ isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
490
+ }
491
+ // element node
492
+ {
493
+ {
494
+ // either this is the first render of an element OR it's an update
495
+ // AND we already know it's possible it could have changed
496
+ // this updates the element's css classes, attrs, props, listeners, etc.
497
+ updateElement(oldVNode, newVNode, isSvgMode);
498
+ }
499
+ }
500
+ if (oldChildren !== null && newChildren !== null) {
501
+ // looks like there's child vnodes for both the old and new vnodes
502
+ updateChildren(elm, oldChildren, newVNode, newChildren);
503
+ }
504
+ else if (newChildren !== null) {
505
+ // no old child vnodes, but there are new child vnodes to add
506
+ if (oldVNode.$text$ !== null) {
507
+ // the old vnode was text, so be sure to clear it out
508
+ elm.textContent = '';
509
+ }
510
+ // add the new vnode children
511
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
512
+ }
513
+ else if (oldChildren !== null) {
514
+ // no new child vnodes, but there are old child vnodes to remove
515
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
516
+ }
517
+ if (isSvgMode && tag === 'svg') {
518
+ isSvgMode = false;
519
+ }
520
+ }
521
+ else if (oldVNode.$text$ !== text) {
522
+ // update the text content for the text only vnode
523
+ // and also only if the text is different than before
524
+ elm.data = text;
525
+ }
526
+ };
527
+ const callNodeRefs = (vNode) => {
528
+ {
529
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
530
+ vNode.$children$ && vNode.$children$.map(callNodeRefs);
531
+ }
532
+ };
533
+ const renderVdom = (hostRef, renderFnResults) => {
534
+ const hostElm = hostRef.$hostElement$;
535
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
536
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
537
+ hostTagName = hostElm.tagName;
538
+ rootVnode.$tag$ = null;
539
+ rootVnode.$flags$ |= 4 /* isHost */;
540
+ hostRef.$vnode$ = rootVnode;
541
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
542
+ {
543
+ scopeId = hostElm['s-sc'];
544
+ }
545
+ // synchronous patch
546
+ patch(oldVNode, rootVnode);
547
+ };
548
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
549
+ const createEvent = (ref, name, flags) => {
550
+ const elm = getElement(ref);
551
+ return {
552
+ emit: (detail) => {
553
+ return emitEvent(elm, name, {
554
+ bubbles: !!(flags & 4 /* Bubbles */),
555
+ composed: !!(flags & 2 /* Composed */),
556
+ cancelable: !!(flags & 1 /* Cancellable */),
557
+ detail,
558
+ });
559
+ },
560
+ };
561
+ };
562
+ /**
563
+ * Helper function to create & dispatch a custom Event on a provided target
564
+ * @param elm the target of the Event
565
+ * @param name the name to give the custom Event
566
+ * @param opts options for configuring a custom Event
567
+ * @returns the custom Event
568
+ */
569
+ const emitEvent = (elm, name, opts) => {
570
+ const ev = plt.ce(name, opts);
571
+ elm.dispatchEvent(ev);
572
+ return ev;
573
+ };
574
+ const attachToAncestor = (hostRef, ancestorComponent) => {
575
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
576
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
577
+ }
578
+ };
579
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
580
+ {
581
+ hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
582
+ }
583
+ if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
584
+ hostRef.$flags$ |= 512 /* needsRerender */;
585
+ return;
586
+ }
587
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
588
+ // there is no ancestor component or the ancestor component
589
+ // has already fired off its lifecycle update then
590
+ // fire off the initial update
591
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
592
+ return writeTask(dispatch) ;
593
+ };
594
+ const dispatchHooks = (hostRef, isInitialLoad) => {
595
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
596
+ const instance = hostRef.$lazyInstance$ ;
597
+ let promise;
598
+ endSchedule();
599
+ return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
600
+ };
601
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
602
+ // updateComponent
603
+ const elm = hostRef.$hostElement$;
604
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
605
+ const rc = elm['s-rc'];
606
+ if (isInitialLoad) {
607
+ // DOM WRITE!
608
+ attachStyles(hostRef);
609
+ }
610
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
611
+ {
612
+ callRender(hostRef, instance);
613
+ }
614
+ if (rc) {
615
+ // ok, so turns out there are some child host elements
616
+ // waiting on this parent element to load
617
+ // let's fire off all update callbacks waiting
618
+ rc.map((cb) => cb());
619
+ elm['s-rc'] = undefined;
620
+ }
621
+ endRender();
622
+ endUpdate();
623
+ {
624
+ const childrenPromises = elm['s-p'];
625
+ const postUpdate = () => postUpdateComponent(hostRef);
626
+ if (childrenPromises.length === 0) {
627
+ postUpdate();
628
+ }
629
+ else {
630
+ Promise.all(childrenPromises).then(postUpdate);
631
+ hostRef.$flags$ |= 4 /* isWaitingForChildren */;
632
+ childrenPromises.length = 0;
633
+ }
634
+ }
635
+ };
636
+ const callRender = (hostRef, instance, elm) => {
637
+ try {
638
+ instance = instance.render() ;
639
+ {
640
+ hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
641
+ }
642
+ {
643
+ hostRef.$flags$ |= 2 /* hasRendered */;
644
+ }
645
+ {
646
+ {
647
+ // looks like we've got child nodes to render into this host element
648
+ // or we need to update the css class/attrs on the host element
649
+ // DOM WRITE!
650
+ {
651
+ renderVdom(hostRef, instance);
652
+ }
653
+ }
654
+ }
655
+ }
656
+ catch (e) {
657
+ consoleError(e, hostRef.$hostElement$);
658
+ }
659
+ return null;
660
+ };
661
+ const postUpdateComponent = (hostRef) => {
662
+ const tagName = hostRef.$cmpMeta$.$tagName$;
663
+ const elm = hostRef.$hostElement$;
664
+ const endPostUpdate = createTime('postUpdate', tagName);
665
+ const instance = hostRef.$lazyInstance$ ;
666
+ const ancestorComponent = hostRef.$ancestorComponent$;
667
+ {
668
+ safeCall(instance, 'componentDidRender');
669
+ }
670
+ if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
671
+ hostRef.$flags$ |= 64 /* hasLoadedComponent */;
672
+ {
673
+ // DOM WRITE!
674
+ addHydratedFlag(elm);
675
+ }
676
+ endPostUpdate();
677
+ {
678
+ hostRef.$onReadyResolve$(elm);
679
+ if (!ancestorComponent) {
680
+ appDidLoad();
681
+ }
682
+ }
683
+ }
684
+ else {
685
+ endPostUpdate();
686
+ }
687
+ // load events fire from bottom to top
688
+ // the deepest elements load first then bubbles up
689
+ {
690
+ if (hostRef.$onRenderResolve$) {
691
+ hostRef.$onRenderResolve$();
692
+ hostRef.$onRenderResolve$ = undefined;
693
+ }
694
+ if (hostRef.$flags$ & 512 /* needsRerender */) {
695
+ nextTick(() => scheduleUpdate(hostRef, false));
696
+ }
697
+ hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
698
+ }
699
+ // ( •_•)
700
+ // ( •_•)>⌐■-■
701
+ // (⌐■_■)
702
+ };
703
+ const appDidLoad = (who) => {
704
+ // on appload
705
+ // we have finish the first big initial render
706
+ {
707
+ addHydratedFlag(doc.documentElement);
708
+ }
709
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
710
+ };
711
+ const safeCall = (instance, method, arg) => {
712
+ if (instance && instance[method]) {
713
+ try {
714
+ return instance[method](arg);
715
+ }
716
+ catch (e) {
717
+ consoleError(e);
718
+ }
719
+ }
720
+ return undefined;
721
+ };
722
+ const then = (promise, thenFn) => {
723
+ return promise && promise.then ? promise.then(thenFn) : thenFn();
724
+ };
725
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
726
+ ;
727
+ /**
728
+ * Parse a new property value for a given property type.
729
+ *
730
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
731
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
732
+ * 1. `any`, the type given to `propValue` in the function signature
733
+ * 2. the type stored from `propType`.
734
+ *
735
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
736
+ *
737
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
738
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
739
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
740
+ * ```tsx
741
+ * <my-cmp prop-val={0}></my-cmp>
742
+ * ```
743
+ *
744
+ * HTML prop values on the other hand, will always a string
745
+ *
746
+ * @param propValue the new value to coerce to some type
747
+ * @param propType the type of the prop, expressed as a binary number
748
+ * @returns the parsed/coerced value
749
+ */
750
+ const parsePropertyValue = (propValue, propType) => {
751
+ // ensure this value is of the correct prop type
752
+ if (propValue != null && !isComplexType(propValue)) {
753
+ if (propType & 1 /* String */) {
754
+ // could have been passed as a number or boolean
755
+ // but we still want it as a string
756
+ return String(propValue);
757
+ }
758
+ // redundant return here for better minification
759
+ return propValue;
760
+ }
761
+ // not sure exactly what type we want
762
+ // so no need to change to a different type
763
+ return propValue;
764
+ };
765
+ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
766
+ const setValue = (ref, propName, newVal, cmpMeta) => {
767
+ // check our new property value against our internal value
768
+ const hostRef = getHostRef(ref);
769
+ const oldVal = hostRef.$instanceValues$.get(propName);
770
+ const flags = hostRef.$flags$;
771
+ const instance = hostRef.$lazyInstance$ ;
772
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
773
+ // explicitly check for NaN on both sides, as `NaN === NaN` is always false
774
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
775
+ const didValueChange = newVal !== oldVal && !areBothNaN;
776
+ if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
777
+ // gadzooks! the property's value has changed!!
778
+ // set our new value!
779
+ hostRef.$instanceValues$.set(propName, newVal);
780
+ if (instance) {
781
+ if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
782
+ // looks like this value actually changed, so we've got work to do!
783
+ // but only if we've already rendered, otherwise just chill out
784
+ // queue that we need to do an update, but don't worry about queuing
785
+ // up millions cuz this function ensures it only runs once
786
+ scheduleUpdate(hostRef, false);
787
+ }
788
+ }
789
+ }
790
+ };
791
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
792
+ if (cmpMeta.$members$) {
793
+ // It's better to have a const than two Object.entries()
794
+ const members = Object.entries(cmpMeta.$members$);
795
+ const prototype = Cstr.prototype;
796
+ members.map(([memberName, [memberFlags]]) => {
797
+ if ((memberFlags & 31 /* Prop */ ||
798
+ ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
799
+ // proxyComponent - prop
800
+ Object.defineProperty(prototype, memberName, {
801
+ get() {
802
+ // proxyComponent, get value
803
+ return getValue(this, memberName);
804
+ },
805
+ set(newValue) {
806
+ // proxyComponent, set value
807
+ setValue(this, memberName, newValue, cmpMeta);
808
+ },
809
+ configurable: true,
810
+ enumerable: true,
811
+ });
812
+ }
813
+ });
814
+ if ((flags & 1 /* isElementConstructor */)) {
815
+ const attrNameToPropName = new Map();
816
+ prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
817
+ plt.jmp(() => {
818
+ const propName = attrNameToPropName.get(attrName);
819
+ // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
820
+ // in the case where an attribute was set inline.
821
+ // ```html
822
+ // <my-component some-attribute="some-value"></my-component>
823
+ // ```
824
+ //
825
+ // There is an edge case where a developer sets the attribute inline on a custom element and then
826
+ // programmatically changes it before it has been upgraded as shown below:
827
+ //
828
+ // ```html
829
+ // <!-- this component has _not_ been upgraded yet -->
830
+ // <my-component id="test" some-attribute="some-value"></my-component>
831
+ // <script>
832
+ // // grab non-upgraded component
833
+ // el = document.querySelector("#test");
834
+ // el.someAttribute = "another-value";
835
+ // // upgrade component
836
+ // customElements.define('my-component', MyComponent);
837
+ // </script>
838
+ // ```
839
+ // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
840
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
841
+ // to the value that was set inline i.e. "some-value" from above example. When
842
+ // the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
843
+ //
844
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
845
+ // by connectedCallback as this attributeChangedCallback will not fire.
846
+ //
847
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
848
+ //
849
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
850
+ // properties here given that this goes against best practices outlined here
851
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
852
+ if (this.hasOwnProperty(propName)) {
853
+ newValue = this[propName];
854
+ delete this[propName];
855
+ }
856
+ else if (prototype.hasOwnProperty(propName) &&
857
+ typeof this[propName] === 'number' &&
858
+ this[propName] == newValue) {
859
+ // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
860
+ // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
861
+ // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
862
+ return;
863
+ }
864
+ this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
865
+ });
866
+ };
867
+ // create an array of attributes to observe
868
+ // and also create a map of html attribute name to js property name
869
+ Cstr.observedAttributes = members
870
+ .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
871
+ .map(([propName, m]) => {
872
+ const attrName = m[1] || propName;
873
+ attrNameToPropName.set(attrName, propName);
874
+ return attrName;
875
+ });
876
+ }
877
+ }
878
+ return Cstr;
879
+ };
880
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
881
+ // initializeComponent
882
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
883
+ {
884
+ // we haven't initialized this element yet
885
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
886
+ // lazy loaded components
887
+ // request the component's implementation to be
888
+ // wired up with the host element
889
+ Cstr = loadModule(cmpMeta);
890
+ if (Cstr.then) {
891
+ // Await creates a micro-task avoid if possible
892
+ const endLoad = uniqueTime();
893
+ Cstr = await Cstr;
894
+ endLoad();
895
+ }
896
+ if (!Cstr.isProxied) {
897
+ proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
898
+ Cstr.isProxied = true;
899
+ }
900
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
901
+ // ok, time to construct the instance
902
+ // but let's keep track of when we start and stop
903
+ // so that the getters/setters don't incorrectly step on data
904
+ {
905
+ hostRef.$flags$ |= 8 /* isConstructingInstance */;
906
+ }
907
+ // construct the lazy-loaded component implementation
908
+ // passing the hostRef is very important during
909
+ // construction in order to directly wire together the
910
+ // host element and the lazy-loaded instance
911
+ try {
912
+ new Cstr(hostRef);
913
+ }
914
+ catch (e) {
915
+ consoleError(e);
916
+ }
917
+ {
918
+ hostRef.$flags$ &= ~8 /* isConstructingInstance */;
919
+ }
920
+ endNewInstance();
921
+ }
922
+ if (Cstr.style) {
923
+ // this component has styles but we haven't registered them yet
924
+ let style = Cstr.style;
925
+ const scopeId = getScopeId(cmpMeta);
926
+ if (!styles.has(scopeId)) {
927
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
928
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
929
+ endRegisterStyles();
930
+ }
931
+ }
932
+ }
933
+ // we've successfully created a lazy instance
934
+ const ancestorComponent = hostRef.$ancestorComponent$;
935
+ const schedule = () => scheduleUpdate(hostRef, true);
936
+ if (ancestorComponent && ancestorComponent['s-rc']) {
937
+ // this is the initial load and this component it has an ancestor component
938
+ // but the ancestor component has NOT fired its will update lifecycle yet
939
+ // so let's just cool our jets and wait for the ancestor to continue first
940
+ // this will get fired off when the ancestor component
941
+ // finally gets around to rendering its lazy self
942
+ // fire off the initial update
943
+ ancestorComponent['s-rc'].push(schedule);
944
+ }
945
+ else {
946
+ schedule();
947
+ }
948
+ };
949
+ const connectedCallback = (elm) => {
950
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
951
+ const hostRef = getHostRef(elm);
952
+ const cmpMeta = hostRef.$cmpMeta$;
953
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
954
+ if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
955
+ // first time this component has connected
956
+ hostRef.$flags$ |= 1 /* hasConnected */;
957
+ {
958
+ // find the first ancestor component (if there is one) and register
959
+ // this component as one of the actively loading child components for its ancestor
960
+ let ancestorComponent = elm;
961
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
962
+ // climb up the ancestors looking for the first
963
+ // component that hasn't finished its lifecycle update yet
964
+ if (ancestorComponent['s-p']) {
965
+ // we found this components first ancestor component
966
+ // keep a reference to this component's ancestor component
967
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
968
+ break;
969
+ }
970
+ }
971
+ }
972
+ // Lazy properties
973
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
974
+ if (cmpMeta.$members$) {
975
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
976
+ if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
977
+ const value = elm[memberName];
978
+ delete elm[memberName];
979
+ elm[memberName] = value;
980
+ }
981
+ });
982
+ }
983
+ {
984
+ initializeComponent(elm, hostRef, cmpMeta);
985
+ }
986
+ }
987
+ endConnected();
988
+ }
989
+ };
990
+ const disconnectedCallback = (elm) => {
991
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
992
+ getHostRef(elm);
993
+ }
994
+ };
995
+ const bootstrapLazy = (lazyBundles, options = {}) => {
996
+ const endBootstrap = createTime();
997
+ const cmpTags = [];
998
+ const exclude = options.exclude || [];
999
+ const customElements = win.customElements;
1000
+ const head = doc.head;
1001
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1002
+ const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1003
+ const deferredConnectedCallbacks = [];
1004
+ let appLoadFallback;
1005
+ let isBootstrapping = true;
1006
+ Object.assign(plt, options);
1007
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1008
+ lazyBundles.map((lazyBundle) => {
1009
+ lazyBundle[1].map((compactMeta) => {
1010
+ const cmpMeta = {
1011
+ $flags$: compactMeta[0],
1012
+ $tagName$: compactMeta[1],
1013
+ $members$: compactMeta[2],
1014
+ $listeners$: compactMeta[3],
1015
+ };
1016
+ {
1017
+ cmpMeta.$members$ = compactMeta[2];
1018
+ }
1019
+ const tagName = cmpMeta.$tagName$;
1020
+ const HostElement = class extends HTMLElement {
1021
+ // StencilLazyHost
1022
+ constructor(self) {
1023
+ // @ts-ignore
1024
+ super(self);
1025
+ self = this;
1026
+ registerHost(self, cmpMeta);
1027
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1028
+ // this component is using shadow dom
1029
+ // and this browser supports shadow dom
1030
+ // add the read-only property "shadowRoot" to the host element
1031
+ // adding the shadow root build conditionals to minimize runtime
1032
+ {
1033
+ {
1034
+ self.attachShadow({ mode: 'open' });
1035
+ }
1036
+ }
1037
+ }
1038
+ }
1039
+ connectedCallback() {
1040
+ if (appLoadFallback) {
1041
+ clearTimeout(appLoadFallback);
1042
+ appLoadFallback = null;
1043
+ }
1044
+ if (isBootstrapping) {
1045
+ // connectedCallback will be processed once all components have been registered
1046
+ deferredConnectedCallbacks.push(this);
1047
+ }
1048
+ else {
1049
+ plt.jmp(() => connectedCallback(this));
1050
+ }
1051
+ }
1052
+ disconnectedCallback() {
1053
+ plt.jmp(() => disconnectedCallback(this));
1054
+ }
1055
+ componentOnReady() {
1056
+ return getHostRef(this).$onReadyPromise$;
1057
+ }
1058
+ };
1059
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
1060
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1061
+ cmpTags.push(tagName);
1062
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1063
+ }
1064
+ });
1065
+ });
1066
+ {
1067
+ visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1068
+ visibilityStyle.setAttribute('data-styles', '');
1069
+ head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1070
+ }
1071
+ // Process deferred connectedCallbacks now all components have been registered
1072
+ isBootstrapping = false;
1073
+ if (deferredConnectedCallbacks.length) {
1074
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
1075
+ }
1076
+ else {
1077
+ {
1078
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
1079
+ }
1080
+ }
1081
+ // Fallback appLoad event
1082
+ endBootstrap();
1083
+ };
1084
+ const hostRefs = new WeakMap();
1085
+ const getHostRef = (ref) => hostRefs.get(ref);
1086
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1087
+ const registerHost = (elm, cmpMeta) => {
1088
+ const hostRef = {
1089
+ $flags$: 0,
1090
+ $hostElement$: elm,
1091
+ $cmpMeta$: cmpMeta,
1092
+ $instanceValues$: new Map(),
1093
+ };
1094
+ {
1095
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
1096
+ elm['s-p'] = [];
1097
+ elm['s-rc'] = [];
1098
+ }
1099
+ return hostRefs.set(elm, hostRef);
1100
+ };
1101
+ const isMemberInElement = (elm, memberName) => memberName in elm;
1102
+ const consoleError = (e, el) => (0, console.error)(e, el);
1103
+ const cmpModules = /*@__PURE__*/ new Map();
1104
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1105
+ // loadModuleImport
1106
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
1107
+ const bundleId = cmpMeta.$lazyBundleId$;
1108
+ const module = cmpModules.get(bundleId) ;
1109
+ if (module) {
1110
+ return module[exportName];
1111
+ }
1112
+ return import(
1113
+ /* webpackInclude: /\.entry\.js$/ */
1114
+ /* webpackExclude: /\.system\.entry\.js$/ */
1115
+ /* webpackMode: "lazy" */
1116
+ `./${bundleId}.entry.js${''}`).then((importedModule) => {
1117
+ {
1118
+ cmpModules.set(bundleId, importedModule);
1119
+ }
1120
+ return importedModule[exportName];
1121
+ }, consoleError);
1122
+ };
1123
+ const styles = new Map();
1124
+ const queueDomReads = [];
1125
+ const queueDomWrites = [];
1126
+ const queueTask = (queue, write) => (cb) => {
1127
+ queue.push(cb);
1128
+ if (!queuePending) {
1129
+ queuePending = true;
1130
+ if (write && plt.$flags$ & 4 /* queueSync */) {
1131
+ nextTick(flush);
1132
+ }
1133
+ else {
1134
+ plt.raf(flush);
1135
+ }
1136
+ }
1137
+ };
1138
+ const consume = (queue) => {
1139
+ for (let i = 0; i < queue.length; i++) {
1140
+ try {
1141
+ queue[i](performance.now());
1142
+ }
1143
+ catch (e) {
1144
+ consoleError(e);
1145
+ }
1146
+ }
1147
+ queue.length = 0;
1148
+ };
1149
+ const flush = () => {
1150
+ // always force a bunch of medium callbacks to run, but still have
1151
+ // a throttle on how many can run in a certain time
1152
+ // DOM READS!!!
1153
+ consume(queueDomReads);
1154
+ // DOM WRITES!!!
1155
+ {
1156
+ consume(queueDomWrites);
1157
+ if ((queuePending = queueDomReads.length > 0)) {
1158
+ // still more to do yet, but we've run out of time
1159
+ // let's let this thing cool off and try again in the next tick
1160
+ plt.raf(flush);
1161
+ }
1162
+ }
1163
+ };
1164
+ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1165
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1166
+
1167
+ export { bootstrapLazy as b, createEvent as c, h, promiseResolve as p, registerInstance as r };