@everymatrix/general-footer-template 1.16.1

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