@everymatrix/casino-engagement-suite-modal-container 1.44.0 → 1.45.0

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