@everymatrix/lottery-game-details 0.0.3

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 (45) hide show
  1. package/dist/cjs/index-94a620d7.js +763 -0
  2. package/dist/cjs/index.cjs.js +2 -0
  3. package/dist/cjs/loader.cjs.js +21 -0
  4. package/dist/cjs/lottery-game-details.cjs.entry.js +21 -0
  5. package/dist/cjs/lottery-game-details.cjs.js +19 -0
  6. package/dist/collection/collection-manifest.json +12 -0
  7. package/dist/collection/components/lottery-game-details/lottery-game-details.css +3 -0
  8. package/dist/collection/components/lottery-game-details/lottery-game-details.js +19 -0
  9. package/dist/collection/index.js +1 -0
  10. package/dist/collection/utils/utils.js +3 -0
  11. package/dist/components/index.d.ts +22 -0
  12. package/dist/components/index.js +2 -0
  13. package/dist/components/lottery-game-details.d.ts +11 -0
  14. package/dist/components/lottery-game-details.js +35 -0
  15. package/dist/esm/index-215cc33d.js +738 -0
  16. package/dist/esm/index.js +1 -0
  17. package/dist/esm/loader.js +17 -0
  18. package/dist/esm/lottery-game-details.entry.js +17 -0
  19. package/dist/esm/lottery-game-details.js +17 -0
  20. package/dist/esm/polyfills/core-js.js +11 -0
  21. package/dist/esm/polyfills/css-shim.js +1 -0
  22. package/dist/esm/polyfills/dom.js +79 -0
  23. package/dist/esm/polyfills/es5-html-element.js +1 -0
  24. package/dist/esm/polyfills/index.js +34 -0
  25. package/dist/esm/polyfills/system.js +6 -0
  26. package/dist/index.cjs.js +1 -0
  27. package/dist/index.js +1 -0
  28. package/dist/lottery-game-details/index.esm.js +0 -0
  29. package/dist/lottery-game-details/lottery-game-details.esm.js +1 -0
  30. package/dist/lottery-game-details/p-3c694375.js +2 -0
  31. package/dist/lottery-game-details/p-9a006ef9.entry.js +1 -0
  32. package/dist/stencil.config.js +22 -0
  33. package/dist/types/Users/user/workspace/everymatrix/widgets-stencil/packages/lottery-game-details/.stencil/packages/lottery-game-details/stencil.config.d.ts +2 -0
  34. package/dist/types/components/lottery-game-details/lottery-game-details.d.ts +5 -0
  35. package/dist/types/components.d.ts +37 -0
  36. package/dist/types/index.d.ts +1 -0
  37. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  38. package/dist/types/utils/utils.d.ts +1 -0
  39. package/loader/cdn.js +3 -0
  40. package/loader/index.cjs.js +3 -0
  41. package/loader/index.d.ts +12 -0
  42. package/loader/index.es2017.js +3 -0
  43. package/loader/index.js +4 -0
  44. package/loader/package.json +10 -0
  45. package/package.json +19 -0
@@ -0,0 +1,763 @@
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 = 'lottery-game-details';
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
+ const 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
+ }
127
+ endAttachStyles();
128
+ };
129
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
130
+ /**
131
+ * Default style mode id
132
+ */
133
+ /**
134
+ * Reusable empty obj/array
135
+ * Don't add values to these!!
136
+ */
137
+ const EMPTY_OBJ = {};
138
+ const isDef = (v) => v != null;
139
+ const isComplexType = (o) => {
140
+ // https://jsperf.com/typeof-fn-object/5
141
+ o = typeof o;
142
+ return o === 'object' || o === 'function';
143
+ };
144
+ /**
145
+ * Production h() function based on Preact by
146
+ * Jason Miller (@developit)
147
+ * Licensed under the MIT License
148
+ * https://github.com/developit/preact/blob/master/LICENSE
149
+ *
150
+ * Modified for Stencil's compiler and vdom
151
+ */
152
+ // const stack: any[] = [];
153
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
154
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
155
+ const h = (nodeName, vnodeData, ...children) => {
156
+ let child = null;
157
+ let simple = false;
158
+ let lastSimple = false;
159
+ const vNodeChildren = [];
160
+ const walk = (c) => {
161
+ for (let i = 0; i < c.length; i++) {
162
+ child = c[i];
163
+ if (Array.isArray(child)) {
164
+ walk(child);
165
+ }
166
+ else if (child != null && typeof child !== 'boolean') {
167
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
168
+ child = String(child);
169
+ }
170
+ if (simple && lastSimple) {
171
+ // If the previous child was simple (string), we merge both
172
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
173
+ }
174
+ else {
175
+ // Append a new vNode, if it's text, we create a text vNode
176
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
177
+ }
178
+ lastSimple = simple;
179
+ }
180
+ }
181
+ };
182
+ walk(children);
183
+ const vnode = newVNode(nodeName, null);
184
+ vnode.$attrs$ = vnodeData;
185
+ if (vNodeChildren.length > 0) {
186
+ vnode.$children$ = vNodeChildren;
187
+ }
188
+ return vnode;
189
+ };
190
+ const newVNode = (tag, text) => {
191
+ const vnode = {
192
+ $flags$: 0,
193
+ $tag$: tag,
194
+ $text$: text,
195
+ $elm$: null,
196
+ $children$: null,
197
+ };
198
+ {
199
+ vnode.$attrs$ = null;
200
+ }
201
+ return vnode;
202
+ };
203
+ const Host = {};
204
+ const isHost = (node) => node && node.$tag$ === Host;
205
+ /**
206
+ * Production setAccessor() function based on Preact by
207
+ * Jason Miller (@developit)
208
+ * Licensed under the MIT License
209
+ * https://github.com/developit/preact/blob/master/LICENSE
210
+ *
211
+ * Modified for Stencil's compiler and vdom
212
+ */
213
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
214
+ if (oldValue !== newValue) {
215
+ let isProp = isMemberInElement(elm, memberName);
216
+ memberName.toLowerCase();
217
+ {
218
+ // Set property if it exists and it's not a SVG
219
+ const isComplex = isComplexType(newValue);
220
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
221
+ try {
222
+ if (!elm.tagName.includes('-')) {
223
+ const n = newValue == null ? '' : newValue;
224
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
225
+ if (memberName === 'list') {
226
+ isProp = false;
227
+ }
228
+ else if (oldValue == null || elm[memberName] != n) {
229
+ elm[memberName] = n;
230
+ }
231
+ }
232
+ else {
233
+ elm[memberName] = newValue;
234
+ }
235
+ }
236
+ catch (e) { }
237
+ }
238
+ if (newValue == null || newValue === false) {
239
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
240
+ {
241
+ elm.removeAttribute(memberName);
242
+ }
243
+ }
244
+ }
245
+ else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
246
+ newValue = newValue === true ? '' : newValue;
247
+ {
248
+ elm.setAttribute(memberName, newValue);
249
+ }
250
+ }
251
+ }
252
+ }
253
+ };
254
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
255
+ // if the element passed in is a shadow root, which is a document fragment
256
+ // then we want to be adding attrs/props to the shadow root's "host" element
257
+ // if it's not a shadow root, then we add attrs/props to the same element
258
+ const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
259
+ ? newVnode.$elm$.host
260
+ : newVnode.$elm$;
261
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
262
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
263
+ // add new & update changed attributes
264
+ for (memberName in newVnodeAttrs) {
265
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
266
+ }
267
+ };
268
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
269
+ // tslint:disable-next-line: prefer-const
270
+ const newVNode = newParentVNode.$children$[childIndex];
271
+ let i = 0;
272
+ let elm;
273
+ let childNode;
274
+ {
275
+ // create element
276
+ elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
277
+ // add css classes, attrs, props, listeners, etc.
278
+ {
279
+ updateElement(null, newVNode, isSvgMode);
280
+ }
281
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
282
+ // if there is a scopeId and this is the initial render
283
+ // then let's add the scopeId as a css class
284
+ elm.classList.add((elm['s-si'] = scopeId));
285
+ }
286
+ if (newVNode.$children$) {
287
+ for (i = 0; i < newVNode.$children$.length; ++i) {
288
+ // create the node
289
+ childNode = createElm(oldParentVNode, newVNode, i);
290
+ // return node could have been null
291
+ if (childNode) {
292
+ // append our new node
293
+ elm.appendChild(childNode);
294
+ }
295
+ }
296
+ }
297
+ }
298
+ return elm;
299
+ };
300
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
301
+ let containerElm = (parentElm);
302
+ let childNode;
303
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
304
+ containerElm = containerElm.shadowRoot;
305
+ }
306
+ for (; startIdx <= endIdx; ++startIdx) {
307
+ if (vnodes[startIdx]) {
308
+ childNode = createElm(null, parentVNode, startIdx);
309
+ if (childNode) {
310
+ vnodes[startIdx].$elm$ = childNode;
311
+ containerElm.insertBefore(childNode, before);
312
+ }
313
+ }
314
+ }
315
+ };
316
+ const patch = (oldVNode, newVNode) => {
317
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
318
+ const newChildren = newVNode.$children$;
319
+ {
320
+ // element node
321
+ {
322
+ {
323
+ // either this is the first render of an element OR it's an update
324
+ // AND we already know it's possible it could have changed
325
+ // this updates the element's css classes, attrs, props, listeners, etc.
326
+ updateElement(oldVNode, newVNode, isSvgMode);
327
+ }
328
+ }
329
+ if (newChildren !== null) {
330
+ // add the new vnode children
331
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
332
+ }
333
+ else ;
334
+ }
335
+ };
336
+ const renderVdom = (hostRef, renderFnResults) => {
337
+ const hostElm = hostRef.$hostElement$;
338
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
339
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
340
+ hostTagName = hostElm.tagName;
341
+ rootVnode.$tag$ = null;
342
+ rootVnode.$flags$ |= 4 /* isHost */;
343
+ hostRef.$vnode$ = rootVnode;
344
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
345
+ {
346
+ scopeId = hostElm['s-sc'];
347
+ }
348
+ // synchronous patch
349
+ patch(oldVNode, rootVnode);
350
+ };
351
+ /**
352
+ * Helper function to create & dispatch a custom Event on a provided target
353
+ * @param elm the target of the Event
354
+ * @param name the name to give the custom Event
355
+ * @param opts options for configuring a custom Event
356
+ * @returns the custom Event
357
+ */
358
+ const emitEvent = (elm, name, opts) => {
359
+ const ev = plt.ce(name, opts);
360
+ elm.dispatchEvent(ev);
361
+ return ev;
362
+ };
363
+ const attachToAncestor = (hostRef, ancestorComponent) => {
364
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
365
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
366
+ }
367
+ };
368
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
369
+ if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
370
+ hostRef.$flags$ |= 512 /* needsRerender */;
371
+ return;
372
+ }
373
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
374
+ // there is no ancestor component or the ancestor component
375
+ // has already fired off its lifecycle update then
376
+ // fire off the initial update
377
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
378
+ return writeTask(dispatch) ;
379
+ };
380
+ const dispatchHooks = (hostRef, isInitialLoad) => {
381
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
382
+ const instance = hostRef.$lazyInstance$ ;
383
+ let promise;
384
+ endSchedule();
385
+ return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
386
+ };
387
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
388
+ // updateComponent
389
+ const elm = hostRef.$hostElement$;
390
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
391
+ const rc = elm['s-rc'];
392
+ if (isInitialLoad) {
393
+ // DOM WRITE!
394
+ attachStyles(hostRef);
395
+ }
396
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
397
+ {
398
+ callRender(hostRef, instance);
399
+ }
400
+ if (rc) {
401
+ // ok, so turns out there are some child host elements
402
+ // waiting on this parent element to load
403
+ // let's fire off all update callbacks waiting
404
+ rc.map((cb) => cb());
405
+ elm['s-rc'] = undefined;
406
+ }
407
+ endRender();
408
+ endUpdate();
409
+ {
410
+ const childrenPromises = elm['s-p'];
411
+ const postUpdate = () => postUpdateComponent(hostRef);
412
+ if (childrenPromises.length === 0) {
413
+ postUpdate();
414
+ }
415
+ else {
416
+ Promise.all(childrenPromises).then(postUpdate);
417
+ hostRef.$flags$ |= 4 /* isWaitingForChildren */;
418
+ childrenPromises.length = 0;
419
+ }
420
+ }
421
+ };
422
+ const callRender = (hostRef, instance, elm) => {
423
+ try {
424
+ instance = instance.render() ;
425
+ {
426
+ hostRef.$flags$ |= 2 /* hasRendered */;
427
+ }
428
+ {
429
+ {
430
+ // looks like we've got child nodes to render into this host element
431
+ // or we need to update the css class/attrs on the host element
432
+ // DOM WRITE!
433
+ {
434
+ renderVdom(hostRef, instance);
435
+ }
436
+ }
437
+ }
438
+ }
439
+ catch (e) {
440
+ consoleError(e, hostRef.$hostElement$);
441
+ }
442
+ return null;
443
+ };
444
+ const postUpdateComponent = (hostRef) => {
445
+ const tagName = hostRef.$cmpMeta$.$tagName$;
446
+ const elm = hostRef.$hostElement$;
447
+ const endPostUpdate = createTime('postUpdate', tagName);
448
+ const ancestorComponent = hostRef.$ancestorComponent$;
449
+ if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
450
+ hostRef.$flags$ |= 64 /* hasLoadedComponent */;
451
+ {
452
+ // DOM WRITE!
453
+ addHydratedFlag(elm);
454
+ }
455
+ endPostUpdate();
456
+ {
457
+ hostRef.$onReadyResolve$(elm);
458
+ if (!ancestorComponent) {
459
+ appDidLoad();
460
+ }
461
+ }
462
+ }
463
+ else {
464
+ endPostUpdate();
465
+ }
466
+ // load events fire from bottom to top
467
+ // the deepest elements load first then bubbles up
468
+ {
469
+ if (hostRef.$onRenderResolve$) {
470
+ hostRef.$onRenderResolve$();
471
+ hostRef.$onRenderResolve$ = undefined;
472
+ }
473
+ if (hostRef.$flags$ & 512 /* needsRerender */) {
474
+ nextTick(() => scheduleUpdate(hostRef, false));
475
+ }
476
+ hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
477
+ }
478
+ // ( •_•)
479
+ // ( •_•)>⌐■-■
480
+ // (⌐■_■)
481
+ };
482
+ const appDidLoad = (who) => {
483
+ // on appload
484
+ // we have finish the first big initial render
485
+ {
486
+ addHydratedFlag(doc.documentElement);
487
+ }
488
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
489
+ };
490
+ const then = (promise, thenFn) => {
491
+ return promise && promise.then ? promise.then(thenFn) : thenFn();
492
+ };
493
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
494
+ ;
495
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
496
+ return Cstr;
497
+ };
498
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
499
+ // initializeComponent
500
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
501
+ {
502
+ // we haven't initialized this element yet
503
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
504
+ // lazy loaded components
505
+ // request the component's implementation to be
506
+ // wired up with the host element
507
+ Cstr = loadModule(cmpMeta);
508
+ if (Cstr.then) {
509
+ // Await creates a micro-task avoid if possible
510
+ const endLoad = uniqueTime();
511
+ Cstr = await Cstr;
512
+ endLoad();
513
+ }
514
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
515
+ // construct the lazy-loaded component implementation
516
+ // passing the hostRef is very important during
517
+ // construction in order to directly wire together the
518
+ // host element and the lazy-loaded instance
519
+ try {
520
+ new Cstr(hostRef);
521
+ }
522
+ catch (e) {
523
+ consoleError(e);
524
+ }
525
+ endNewInstance();
526
+ }
527
+ if (Cstr.style) {
528
+ // this component has styles but we haven't registered them yet
529
+ let style = Cstr.style;
530
+ const scopeId = getScopeId(cmpMeta);
531
+ if (!styles.has(scopeId)) {
532
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
533
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
534
+ endRegisterStyles();
535
+ }
536
+ }
537
+ }
538
+ // we've successfully created a lazy instance
539
+ const ancestorComponent = hostRef.$ancestorComponent$;
540
+ const schedule = () => scheduleUpdate(hostRef, true);
541
+ if (ancestorComponent && ancestorComponent['s-rc']) {
542
+ // this is the initial load and this component it has an ancestor component
543
+ // but the ancestor component has NOT fired its will update lifecycle yet
544
+ // so let's just cool our jets and wait for the ancestor to continue first
545
+ // this will get fired off when the ancestor component
546
+ // finally gets around to rendering its lazy self
547
+ // fire off the initial update
548
+ ancestorComponent['s-rc'].push(schedule);
549
+ }
550
+ else {
551
+ schedule();
552
+ }
553
+ };
554
+ const connectedCallback = (elm) => {
555
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
556
+ const hostRef = getHostRef(elm);
557
+ const cmpMeta = hostRef.$cmpMeta$;
558
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
559
+ if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
560
+ // first time this component has connected
561
+ hostRef.$flags$ |= 1 /* hasConnected */;
562
+ {
563
+ // find the first ancestor component (if there is one) and register
564
+ // this component as one of the actively loading child components for its ancestor
565
+ let ancestorComponent = elm;
566
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
567
+ // climb up the ancestors looking for the first
568
+ // component that hasn't finished its lifecycle update yet
569
+ if (ancestorComponent['s-p']) {
570
+ // we found this components first ancestor component
571
+ // keep a reference to this component's ancestor component
572
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
573
+ break;
574
+ }
575
+ }
576
+ }
577
+ {
578
+ initializeComponent(elm, hostRef, cmpMeta);
579
+ }
580
+ }
581
+ endConnected();
582
+ }
583
+ };
584
+ const disconnectedCallback = (elm) => {
585
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
586
+ getHostRef(elm);
587
+ }
588
+ };
589
+ const bootstrapLazy = (lazyBundles, options = {}) => {
590
+ const endBootstrap = createTime();
591
+ const cmpTags = [];
592
+ const exclude = options.exclude || [];
593
+ const customElements = win.customElements;
594
+ const head = doc.head;
595
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
596
+ const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
597
+ const deferredConnectedCallbacks = [];
598
+ let appLoadFallback;
599
+ let isBootstrapping = true;
600
+ Object.assign(plt, options);
601
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
602
+ lazyBundles.map((lazyBundle) => {
603
+ lazyBundle[1].map((compactMeta) => {
604
+ const cmpMeta = {
605
+ $flags$: compactMeta[0],
606
+ $tagName$: compactMeta[1],
607
+ $members$: compactMeta[2],
608
+ $listeners$: compactMeta[3],
609
+ };
610
+ const tagName = cmpMeta.$tagName$;
611
+ const HostElement = class extends HTMLElement {
612
+ // StencilLazyHost
613
+ constructor(self) {
614
+ // @ts-ignore
615
+ super(self);
616
+ self = this;
617
+ registerHost(self, cmpMeta);
618
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
619
+ // this component is using shadow dom
620
+ // and this browser supports shadow dom
621
+ // add the read-only property "shadowRoot" to the host element
622
+ // adding the shadow root build conditionals to minimize runtime
623
+ {
624
+ {
625
+ self.attachShadow({ mode: 'open' });
626
+ }
627
+ }
628
+ }
629
+ }
630
+ connectedCallback() {
631
+ if (appLoadFallback) {
632
+ clearTimeout(appLoadFallback);
633
+ appLoadFallback = null;
634
+ }
635
+ if (isBootstrapping) {
636
+ // connectedCallback will be processed once all components have been registered
637
+ deferredConnectedCallbacks.push(this);
638
+ }
639
+ else {
640
+ plt.jmp(() => connectedCallback(this));
641
+ }
642
+ }
643
+ disconnectedCallback() {
644
+ plt.jmp(() => disconnectedCallback(this));
645
+ }
646
+ componentOnReady() {
647
+ return getHostRef(this).$onReadyPromise$;
648
+ }
649
+ };
650
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
651
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
652
+ cmpTags.push(tagName);
653
+ customElements.define(tagName, proxyComponent(HostElement));
654
+ }
655
+ });
656
+ });
657
+ {
658
+ visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
659
+ visibilityStyle.setAttribute('data-styles', '');
660
+ head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
661
+ }
662
+ // Process deferred connectedCallbacks now all components have been registered
663
+ isBootstrapping = false;
664
+ if (deferredConnectedCallbacks.length) {
665
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
666
+ }
667
+ else {
668
+ {
669
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
670
+ }
671
+ }
672
+ // Fallback appLoad event
673
+ endBootstrap();
674
+ };
675
+ const hostRefs = new WeakMap();
676
+ const getHostRef = (ref) => hostRefs.get(ref);
677
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
678
+ const registerHost = (elm, cmpMeta) => {
679
+ const hostRef = {
680
+ $flags$: 0,
681
+ $hostElement$: elm,
682
+ $cmpMeta$: cmpMeta,
683
+ $instanceValues$: new Map(),
684
+ };
685
+ {
686
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
687
+ elm['s-p'] = [];
688
+ elm['s-rc'] = [];
689
+ }
690
+ return hostRefs.set(elm, hostRef);
691
+ };
692
+ const isMemberInElement = (elm, memberName) => memberName in elm;
693
+ const consoleError = (e, el) => (0, console.error)(e, el);
694
+ const cmpModules = /*@__PURE__*/ new Map();
695
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
696
+ // loadModuleImport
697
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
698
+ const bundleId = cmpMeta.$lazyBundleId$;
699
+ const module = cmpModules.get(bundleId) ;
700
+ if (module) {
701
+ return module[exportName];
702
+ }
703
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
704
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
705
+ /* @vite-ignore */
706
+ /* webpackInclude: /\.entry\.js$/ */
707
+ /* webpackExclude: /\.system\.entry\.js$/ */
708
+ /* webpackMode: "lazy" */
709
+ `./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
710
+ {
711
+ cmpModules.set(bundleId, importedModule);
712
+ }
713
+ return importedModule[exportName];
714
+ }, consoleError);
715
+ };
716
+ const styles = new Map();
717
+ const queueDomReads = [];
718
+ const queueDomWrites = [];
719
+ const queueTask = (queue, write) => (cb) => {
720
+ queue.push(cb);
721
+ if (!queuePending) {
722
+ queuePending = true;
723
+ if (write && plt.$flags$ & 4 /* queueSync */) {
724
+ nextTick(flush);
725
+ }
726
+ else {
727
+ plt.raf(flush);
728
+ }
729
+ }
730
+ };
731
+ const consume = (queue) => {
732
+ for (let i = 0; i < queue.length; i++) {
733
+ try {
734
+ queue[i](performance.now());
735
+ }
736
+ catch (e) {
737
+ consoleError(e);
738
+ }
739
+ }
740
+ queue.length = 0;
741
+ };
742
+ const flush = () => {
743
+ // always force a bunch of medium callbacks to run, but still have
744
+ // a throttle on how many can run in a certain time
745
+ // DOM READS!!!
746
+ consume(queueDomReads);
747
+ // DOM WRITES!!!
748
+ {
749
+ consume(queueDomWrites);
750
+ if ((queuePending = queueDomReads.length > 0)) {
751
+ // still more to do yet, but we've run out of time
752
+ // let's let this thing cool off and try again in the next tick
753
+ plt.raf(flush);
754
+ }
755
+ }
756
+ };
757
+ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
758
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
759
+
760
+ exports.bootstrapLazy = bootstrapLazy;
761
+ exports.h = h;
762
+ exports.promiseResolve = promiseResolve;
763
+ exports.registerInstance = registerInstance;