@usecapsule/core-components 3.1.0 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. package/dist/capsule/capsule.esm.js +1 -1
  2. package/dist/capsule/capsule.esm.js.map +1 -1
  3. package/dist/capsule/index.esm.js.map +1 -1
  4. package/dist/capsule/p-48bb5cfe.js +3 -0
  5. package/dist/capsule/p-48bb5cfe.js.map +1 -0
  6. package/dist/capsule/{p-f9351426.entry.js → p-62118adb.entry.js} +2 -2
  7. package/dist/capsule/{p-f9351426.entry.js.map → p-62118adb.entry.js.map} +1 -1
  8. package/dist/capsule/{p-5ed5e96c.entry.js → p-65c8f8cd.entry.js} +2 -2
  9. package/dist/capsule/{p-5ed5e96c.entry.js.map → p-65c8f8cd.entry.js.map} +1 -1
  10. package/dist/capsule/{p-52d6ebee.entry.js → p-89a4e92e.entry.js} +2 -2
  11. package/dist/capsule/{p-52d6ebee.entry.js.map → p-89a4e92e.entry.js.map} +1 -1
  12. package/dist/capsule/p-8a920cb7.entry.js +2 -0
  13. package/dist/capsule/{p-397edab5.entry.js.map → p-8a920cb7.entry.js.map} +1 -1
  14. package/dist/capsule/{p-70f95c93.entry.js → p-b0a84b18.entry.js} +2 -2
  15. package/dist/capsule/{p-70f95c93.entry.js.map → p-b0a84b18.entry.js.map} +1 -1
  16. package/dist/capsule/p-edd0c1f9.entry.js +10 -0
  17. package/dist/capsule/{p-86e6cba5.entry.js.map → p-edd0c1f9.entry.js.map} +1 -1
  18. package/dist/capsule/p-efd2de80.entry.js +29 -0
  19. package/dist/capsule/{p-6e900654.entry.js.map → p-efd2de80.entry.js.map} +1 -1
  20. package/dist/cjs/capsule.cjs.js +9 -9
  21. package/dist/cjs/capsule.cjs.js.map +1 -1
  22. package/dist/cjs/cpsl-alert_33.cjs.entry.js +46 -40
  23. package/dist/cjs/cpsl-alert_33.cjs.entry.js.map +1 -1
  24. package/dist/cjs/cpsl-animation.cjs.entry.js +2 -2
  25. package/dist/cjs/cpsl-col.cjs.entry.js +2 -2
  26. package/dist/cjs/cpsl-grid.cjs.entry.js +3 -3
  27. package/dist/cjs/cpsl-info-box.cjs.entry.js +2 -2
  28. package/dist/cjs/cpsl-modal-v2.cjs.entry.js +2 -2
  29. package/dist/cjs/cpsl-modal-v2.cjs.entry.js.map +1 -1
  30. package/dist/cjs/cpsl-row.cjs.entry.js +2 -2
  31. package/dist/cjs/index-15f80342.js +2103 -0
  32. package/dist/cjs/index-15f80342.js.map +1 -0
  33. package/dist/cjs/loader.cjs.js +1 -1
  34. package/dist/collection/collection-manifest.json +2 -2
  35. package/dist/collection/components/cpsl-alert/cpsl-alert.js +1 -1
  36. package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
  37. package/dist/collection/components/cpsl-animation/cpsl-animation.js +1 -1
  38. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js +2 -2
  39. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js.map +1 -1
  40. package/dist/collection/components/cpsl-avatar/cpsl-avatar.js +1 -1
  41. package/dist/collection/components/cpsl-button/cpsl-button.js +2 -2
  42. package/dist/collection/components/cpsl-button-group/cpsl-button-group.js +1 -1
  43. package/dist/collection/components/cpsl-card/cpsl-card.js +1 -1
  44. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js +1 -1
  45. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +2 -2
  46. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
  47. package/dist/collection/components/cpsl-col/cpsl-col.js +1 -1
  48. package/dist/collection/components/cpsl-divider/cpsl-divider.js +1 -1
  49. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +2 -2
  50. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -1
  51. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +1 -1
  52. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -1
  53. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js +1 -1
  54. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js.map +1 -1
  55. package/dist/collection/components/cpsl-grid/cpsl-grid.js +2 -2
  56. package/dist/collection/components/cpsl-icon/cpsl-icon.js +1 -1
  57. package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
  58. package/dist/collection/components/cpsl-input/cpsl-input.js +1 -1
  59. package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
  60. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js +1 -1
  61. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js.map +1 -1
  62. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +1 -1
  63. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +1 -1
  64. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +1 -1
  65. package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
  66. package/dist/collection/components/cpsl-popover/cpsl-popover.js +2 -2
  67. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +1 -1
  68. package/dist/collection/components/cpsl-radio/cpsl-radio.js +1 -1
  69. package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
  70. package/dist/collection/components/cpsl-select/cpsl-select.js +1 -1
  71. package/dist/collection/components/cpsl-select/cpsl-select.js.map +1 -1
  72. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js +1 -1
  73. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +1 -1
  74. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +2 -2
  75. package/dist/collection/components/cpsl-switch/cpsl-switch.js +1 -1
  76. package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
  77. package/dist/collection/components/cpsl-table/cpsl-table.css +1 -9
  78. package/dist/collection/components/cpsl-table/cpsl-table.js +7 -1
  79. package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -1
  80. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +1 -1
  81. package/dist/collection/components/cpsl-text/cpsl-text.js +1 -1
  82. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +0 -1
  83. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +1 -1
  84. package/dist/esm/capsule.js +10 -10
  85. package/dist/esm/capsule.js.map +1 -1
  86. package/dist/esm/cpsl-alert_33.entry.js +46 -40
  87. package/dist/esm/cpsl-alert_33.entry.js.map +1 -1
  88. package/dist/esm/cpsl-animation.entry.js +2 -2
  89. package/dist/esm/cpsl-col.entry.js +2 -2
  90. package/dist/esm/cpsl-grid.entry.js +3 -3
  91. package/dist/esm/cpsl-info-box.entry.js +2 -2
  92. package/dist/esm/cpsl-modal-v2.entry.js +2 -2
  93. package/dist/esm/cpsl-modal-v2.entry.js.map +1 -1
  94. package/dist/esm/cpsl-row.entry.js +2 -2
  95. package/dist/esm/index-2c447f86.js +2072 -0
  96. package/dist/esm/index-2c447f86.js.map +1 -0
  97. package/dist/esm/loader.js +2 -2
  98. package/dist/esm/polyfills/core-js.js +11 -0
  99. package/dist/esm/polyfills/dom.js +79 -0
  100. package/dist/esm/polyfills/es5-html-element.js +1 -0
  101. package/dist/esm/polyfills/index.js +34 -0
  102. package/dist/esm/polyfills/system.js +6 -0
  103. package/dist/loader/cdn.js +3 -1
  104. package/dist/loader/index.cjs.js +3 -1
  105. package/dist/loader/index.es2017.js +3 -1
  106. package/dist/loader/index.js +3 -1
  107. package/dist/types/components/cpsl-table/cpsl-table.d.ts +2 -0
  108. package/dist/types/stencil-public-runtime.d.ts +8 -3
  109. package/package.json +2 -2
  110. package/dist/capsule/p-397edab5.entry.js +0 -2
  111. package/dist/capsule/p-6e71539d.js +0 -3
  112. package/dist/capsule/p-6e71539d.js.map +0 -1
  113. package/dist/capsule/p-6e900654.entry.js +0 -29
  114. package/dist/capsule/p-86e6cba5.entry.js +0 -10
  115. package/dist/cjs/index-85125285.js +0 -1414
  116. package/dist/cjs/index-85125285.js.map +0 -1
  117. package/dist/esm/index-b9a060b3.js +0 -1383
  118. package/dist/esm/index-b9a060b3.js.map +0 -1
@@ -1,1383 +0,0 @@
1
- const NAMESPACE = 'capsule';
2
- const BUILD = /* capsule */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
3
-
4
- /*
5
- Stencil Client Platform v4.18.3 | MIT Licensed | https://stenciljs.com
6
- */
7
- var __defProp = Object.defineProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
-
13
- // src/utils/constants.ts
14
- var EMPTY_OBJ = {};
15
- var SVG_NS = "http://www.w3.org/2000/svg";
16
- var HTML_NS = "http://www.w3.org/1999/xhtml";
17
-
18
- // src/utils/helpers.ts
19
- var isDef = (v) => v != null;
20
- var isComplexType = (o) => {
21
- o = typeof o;
22
- return o === "object" || o === "function";
23
- };
24
-
25
- // src/utils/query-nonce-meta-tag-content.ts
26
- function queryNonceMetaTagContent(doc2) {
27
- var _a, _b, _c;
28
- return (_c = (_b = (_a = doc2.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
29
- }
30
-
31
- // src/utils/result.ts
32
- var result_exports = {};
33
- __export(result_exports, {
34
- err: () => err,
35
- map: () => map,
36
- ok: () => ok,
37
- unwrap: () => unwrap,
38
- unwrapErr: () => unwrapErr
39
- });
40
- var ok = (value) => ({
41
- isOk: true,
42
- isErr: false,
43
- value
44
- });
45
- var err = (value) => ({
46
- isOk: false,
47
- isErr: true,
48
- value
49
- });
50
- function map(result, fn) {
51
- if (result.isOk) {
52
- const val = fn(result.value);
53
- if (val instanceof Promise) {
54
- return val.then((newVal) => ok(newVal));
55
- } else {
56
- return ok(val);
57
- }
58
- }
59
- if (result.isErr) {
60
- const value = result.value;
61
- return err(value);
62
- }
63
- throw "should never get here";
64
- }
65
- var unwrap = (result) => {
66
- if (result.isOk) {
67
- return result.value;
68
- } else {
69
- throw result.value;
70
- }
71
- };
72
- var unwrapErr = (result) => {
73
- if (result.isErr) {
74
- return result.value;
75
- } else {
76
- throw result.value;
77
- }
78
- };
79
- var createTime = (fnName, tagName = "") => {
80
- {
81
- return () => {
82
- return;
83
- };
84
- }
85
- };
86
- var uniqueTime = (key, measureText) => {
87
- {
88
- return () => {
89
- return;
90
- };
91
- }
92
- };
93
- var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
94
- var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
95
- var h = (nodeName, vnodeData, ...children) => {
96
- let child = null;
97
- let key = null;
98
- let simple = false;
99
- let lastSimple = false;
100
- const vNodeChildren = [];
101
- const walk = (c) => {
102
- for (let i2 = 0; i2 < c.length; i2++) {
103
- child = c[i2];
104
- if (Array.isArray(child)) {
105
- walk(child);
106
- } else if (child != null && typeof child !== "boolean") {
107
- if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
108
- child = String(child);
109
- }
110
- if (simple && lastSimple) {
111
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
112
- } else {
113
- vNodeChildren.push(simple ? newVNode(null, child) : child);
114
- }
115
- lastSimple = simple;
116
- }
117
- }
118
- };
119
- walk(children);
120
- if (vnodeData) {
121
- if (vnodeData.key) {
122
- key = vnodeData.key;
123
- }
124
- {
125
- const classData = vnodeData.className || vnodeData.class;
126
- if (classData) {
127
- vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
128
- }
129
- }
130
- }
131
- if (typeof nodeName === "function") {
132
- return nodeName(
133
- vnodeData === null ? {} : vnodeData,
134
- vNodeChildren,
135
- vdomFnUtils
136
- );
137
- }
138
- const vnode = newVNode(nodeName, null);
139
- vnode.$attrs$ = vnodeData;
140
- if (vNodeChildren.length > 0) {
141
- vnode.$children$ = vNodeChildren;
142
- }
143
- {
144
- vnode.$key$ = key;
145
- }
146
- return vnode;
147
- };
148
- var newVNode = (tag, text) => {
149
- const vnode = {
150
- $flags$: 0,
151
- $tag$: tag,
152
- $text$: text,
153
- $elm$: null,
154
- $children$: null
155
- };
156
- {
157
- vnode.$attrs$ = null;
158
- }
159
- {
160
- vnode.$key$ = null;
161
- }
162
- return vnode;
163
- };
164
- var Host = {};
165
- var isHost = (node) => node && node.$tag$ === Host;
166
- var vdomFnUtils = {
167
- forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
168
- map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate)
169
- };
170
- var convertToPublic = (node) => ({
171
- vattrs: node.$attrs$,
172
- vchildren: node.$children$,
173
- vkey: node.$key$,
174
- vname: node.$name$,
175
- vtag: node.$tag$,
176
- vtext: node.$text$
177
- });
178
- var convertToPrivate = (node) => {
179
- if (typeof node.vtag === "function") {
180
- const vnodeData = { ...node.vattrs };
181
- if (node.vkey) {
182
- vnodeData.key = node.vkey;
183
- }
184
- if (node.vname) {
185
- vnodeData.name = node.vname;
186
- }
187
- return h(node.vtag, vnodeData, ...node.vchildren || []);
188
- }
189
- const vnode = newVNode(node.vtag, node.vtext);
190
- vnode.$attrs$ = node.vattrs;
191
- vnode.$children$ = node.vchildren;
192
- vnode.$key$ = node.vkey;
193
- vnode.$name$ = node.vname;
194
- return vnode;
195
- };
196
- var parsePropertyValue = (propValue, propType) => {
197
- if (propValue != null && !isComplexType(propValue)) {
198
- if (propType & 4 /* Boolean */) {
199
- return propValue === "false" ? false : propValue === "" || !!propValue;
200
- }
201
- if (propType & 2 /* Number */) {
202
- return parseFloat(propValue);
203
- }
204
- if (propType & 1 /* String */) {
205
- return String(propValue);
206
- }
207
- return propValue;
208
- }
209
- return propValue;
210
- };
211
- var getElement = (ref) => getHostRef(ref).$hostElement$ ;
212
-
213
- // src/runtime/event-emitter.ts
214
- var createEvent = (ref, name, flags) => {
215
- const elm = getElement(ref);
216
- return {
217
- emit: (detail) => {
218
- return emitEvent(elm, name, {
219
- bubbles: !!(flags & 4 /* Bubbles */),
220
- composed: !!(flags & 2 /* Composed */),
221
- cancelable: !!(flags & 1 /* Cancellable */),
222
- detail
223
- });
224
- }
225
- };
226
- };
227
- var emitEvent = (elm, name, opts) => {
228
- const ev = plt.ce(name, opts);
229
- elm.dispatchEvent(ev);
230
- return ev;
231
- };
232
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
233
- var registerStyle = (scopeId2, cssText, allowCS) => {
234
- let style = styles.get(scopeId2);
235
- if (supportsConstructableStylesheets && allowCS) {
236
- style = style || new CSSStyleSheet();
237
- if (typeof style === "string") {
238
- style = cssText;
239
- } else {
240
- style.replaceSync(cssText);
241
- }
242
- } else {
243
- style = cssText;
244
- }
245
- styles.set(scopeId2, style);
246
- };
247
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
248
- var _a;
249
- const scopeId2 = getScopeId(cmpMeta);
250
- const style = styles.get(scopeId2);
251
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
252
- if (style) {
253
- if (typeof style === "string") {
254
- styleContainerNode = styleContainerNode.head || styleContainerNode;
255
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
256
- let styleElm;
257
- if (!appliedStyles) {
258
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
259
- }
260
- if (!appliedStyles.has(scopeId2)) {
261
- {
262
- styleElm = doc.createElement("style");
263
- styleElm.innerHTML = style;
264
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
265
- if (nonce != null) {
266
- styleElm.setAttribute("nonce", nonce);
267
- }
268
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
269
- }
270
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
271
- styleElm.innerHTML += SLOT_FB_CSS;
272
- }
273
- if (appliedStyles) {
274
- appliedStyles.add(scopeId2);
275
- }
276
- }
277
- } else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
278
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
279
- }
280
- }
281
- return scopeId2;
282
- };
283
- var attachStyles = (hostRef) => {
284
- const cmpMeta = hostRef.$cmpMeta$;
285
- const elm = hostRef.$hostElement$;
286
- const flags = cmpMeta.$flags$;
287
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
288
- const scopeId2 = addStyle(
289
- elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
290
- cmpMeta);
291
- if (flags & 10 /* needsScopedEncapsulation */) {
292
- elm["s-sc"] = scopeId2;
293
- elm.classList.add(scopeId2 + "-h");
294
- }
295
- endAttachStyles();
296
- };
297
- var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
298
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
299
- if (oldValue !== newValue) {
300
- let isProp = isMemberInElement(elm, memberName);
301
- let ln = memberName.toLowerCase();
302
- if (memberName === "class") {
303
- const classList = elm.classList;
304
- const oldClasses = parseClassList(oldValue);
305
- const newClasses = parseClassList(newValue);
306
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
307
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
308
- } else if (memberName === "style") {
309
- {
310
- for (const prop in oldValue) {
311
- if (!newValue || newValue[prop] == null) {
312
- if (prop.includes("-")) {
313
- elm.style.removeProperty(prop);
314
- } else {
315
- elm.style[prop] = "";
316
- }
317
- }
318
- }
319
- }
320
- for (const prop in newValue) {
321
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
322
- if (prop.includes("-")) {
323
- elm.style.setProperty(prop, newValue[prop]);
324
- } else {
325
- elm.style[prop] = newValue[prop];
326
- }
327
- }
328
- }
329
- } else if (memberName === "key") ; else if (memberName === "ref") {
330
- if (newValue) {
331
- newValue(elm);
332
- }
333
- } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
334
- if (memberName[2] === "-") {
335
- memberName = memberName.slice(3);
336
- } else if (isMemberInElement(win, ln)) {
337
- memberName = ln.slice(2);
338
- } else {
339
- memberName = ln[2] + memberName.slice(3);
340
- }
341
- if (oldValue || newValue) {
342
- const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
343
- memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
344
- if (oldValue) {
345
- plt.rel(elm, memberName, oldValue, capture);
346
- }
347
- if (newValue) {
348
- plt.ael(elm, memberName, newValue, capture);
349
- }
350
- }
351
- } else {
352
- const isComplex = isComplexType(newValue);
353
- if ((isProp || isComplex && newValue !== null) && !isSvg) {
354
- try {
355
- if (!elm.tagName.includes("-")) {
356
- const n = newValue == null ? "" : newValue;
357
- if (memberName === "list") {
358
- isProp = false;
359
- } else if (oldValue == null || elm[memberName] != n) {
360
- elm[memberName] = n;
361
- }
362
- } else {
363
- elm[memberName] = newValue;
364
- }
365
- } catch (e) {
366
- }
367
- }
368
- if (newValue == null || newValue === false) {
369
- if (newValue !== false || elm.getAttribute(memberName) === "") {
370
- {
371
- elm.removeAttribute(memberName);
372
- }
373
- }
374
- } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
375
- newValue = newValue === true ? "" : newValue;
376
- {
377
- elm.setAttribute(memberName, newValue);
378
- }
379
- }
380
- }
381
- }
382
- };
383
- var parseClassListRegex = /\s/;
384
- var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
385
- var CAPTURE_EVENT_SUFFIX = "Capture";
386
- var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
387
-
388
- // src/runtime/vdom/update-element.ts
389
- var updateElement = (oldVnode, newVnode, isSvgMode2) => {
390
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
391
- const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
392
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
393
- {
394
- for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
395
- if (!(memberName in newVnodeAttrs)) {
396
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
397
- }
398
- }
399
- }
400
- for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
401
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
402
- }
403
- };
404
- function sortedAttrNames(attrNames) {
405
- return attrNames.includes("ref") ? (
406
- // we need to sort these to ensure that `'ref'` is the last attr
407
- [...attrNames.filter((attr) => attr !== "ref"), "ref"]
408
- ) : (
409
- // no need to sort, return the original array
410
- attrNames
411
- );
412
- }
413
-
414
- // src/runtime/vdom/vdom-render.ts
415
- var scopeId;
416
- var hostTagName;
417
- var useNativeShadowDom = false;
418
- var isSvgMode = false;
419
- var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
420
- const newVNode2 = newParentVNode.$children$[childIndex];
421
- let i2 = 0;
422
- let elm;
423
- let childNode;
424
- if (newVNode2.$text$ !== null) {
425
- elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
426
- } else {
427
- if (!isSvgMode) {
428
- isSvgMode = newVNode2.$tag$ === "svg";
429
- }
430
- elm = newVNode2.$elm$ = doc.createElementNS(
431
- isSvgMode ? SVG_NS : HTML_NS,
432
- newVNode2.$tag$
433
- ) ;
434
- if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
435
- isSvgMode = false;
436
- }
437
- {
438
- updateElement(null, newVNode2, isSvgMode);
439
- }
440
- if (isDef(scopeId) && elm["s-si"] !== scopeId) {
441
- elm.classList.add(elm["s-si"] = scopeId);
442
- }
443
- if (newVNode2.$children$) {
444
- for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
445
- childNode = createElm(oldParentVNode, newVNode2, i2);
446
- if (childNode) {
447
- elm.appendChild(childNode);
448
- }
449
- }
450
- }
451
- {
452
- if (newVNode2.$tag$ === "svg") {
453
- isSvgMode = false;
454
- } else if (elm.tagName === "foreignObject") {
455
- isSvgMode = true;
456
- }
457
- }
458
- }
459
- elm["s-hn"] = hostTagName;
460
- return elm;
461
- };
462
- var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
463
- let containerElm = parentElm;
464
- let childNode;
465
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
466
- containerElm = containerElm.shadowRoot;
467
- }
468
- for (; startIdx <= endIdx; ++startIdx) {
469
- if (vnodes[startIdx]) {
470
- childNode = createElm(null, parentVNode, startIdx);
471
- if (childNode) {
472
- vnodes[startIdx].$elm$ = childNode;
473
- insertBefore(containerElm, childNode, before);
474
- }
475
- }
476
- }
477
- };
478
- var removeVnodes = (vnodes, startIdx, endIdx) => {
479
- for (let index = startIdx; index <= endIdx; ++index) {
480
- const vnode = vnodes[index];
481
- if (vnode) {
482
- const elm = vnode.$elm$;
483
- nullifyVNodeRefs(vnode);
484
- if (elm) {
485
- elm.remove();
486
- }
487
- }
488
- }
489
- };
490
- var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
491
- let oldStartIdx = 0;
492
- let newStartIdx = 0;
493
- let idxInOld = 0;
494
- let i2 = 0;
495
- let oldEndIdx = oldCh.length - 1;
496
- let oldStartVnode = oldCh[0];
497
- let oldEndVnode = oldCh[oldEndIdx];
498
- let newEndIdx = newCh.length - 1;
499
- let newStartVnode = newCh[0];
500
- let newEndVnode = newCh[newEndIdx];
501
- let node;
502
- let elmToMove;
503
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
504
- if (oldStartVnode == null) {
505
- oldStartVnode = oldCh[++oldStartIdx];
506
- } else if (oldEndVnode == null) {
507
- oldEndVnode = oldCh[--oldEndIdx];
508
- } else if (newStartVnode == null) {
509
- newStartVnode = newCh[++newStartIdx];
510
- } else if (newEndVnode == null) {
511
- newEndVnode = newCh[--newEndIdx];
512
- } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
513
- patch(oldStartVnode, newStartVnode, isInitialRender);
514
- oldStartVnode = oldCh[++oldStartIdx];
515
- newStartVnode = newCh[++newStartIdx];
516
- } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
517
- patch(oldEndVnode, newEndVnode, isInitialRender);
518
- oldEndVnode = oldCh[--oldEndIdx];
519
- newEndVnode = newCh[--newEndIdx];
520
- } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
521
- patch(oldStartVnode, newEndVnode, isInitialRender);
522
- insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
523
- oldStartVnode = oldCh[++oldStartIdx];
524
- newEndVnode = newCh[--newEndIdx];
525
- } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
526
- patch(oldEndVnode, newStartVnode, isInitialRender);
527
- insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
528
- oldEndVnode = oldCh[--oldEndIdx];
529
- newStartVnode = newCh[++newStartIdx];
530
- } else {
531
- idxInOld = -1;
532
- {
533
- for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
534
- if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
535
- idxInOld = i2;
536
- break;
537
- }
538
- }
539
- }
540
- if (idxInOld >= 0) {
541
- elmToMove = oldCh[idxInOld];
542
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
543
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
544
- } else {
545
- patch(elmToMove, newStartVnode, isInitialRender);
546
- oldCh[idxInOld] = void 0;
547
- node = elmToMove.$elm$;
548
- }
549
- newStartVnode = newCh[++newStartIdx];
550
- } else {
551
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
552
- newStartVnode = newCh[++newStartIdx];
553
- }
554
- if (node) {
555
- {
556
- insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
557
- }
558
- }
559
- }
560
- }
561
- if (oldStartIdx > oldEndIdx) {
562
- addVnodes(
563
- parentElm,
564
- newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
565
- newVNode2,
566
- newCh,
567
- newStartIdx,
568
- newEndIdx
569
- );
570
- } else if (newStartIdx > newEndIdx) {
571
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
572
- }
573
- };
574
- var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
575
- if (leftVNode.$tag$ === rightVNode.$tag$) {
576
- if (!isInitialRender) {
577
- return leftVNode.$key$ === rightVNode.$key$;
578
- }
579
- return true;
580
- }
581
- return false;
582
- };
583
- var patch = (oldVNode, newVNode2, isInitialRender = false) => {
584
- const elm = newVNode2.$elm$ = oldVNode.$elm$;
585
- const oldChildren = oldVNode.$children$;
586
- const newChildren = newVNode2.$children$;
587
- const tag = newVNode2.$tag$;
588
- const text = newVNode2.$text$;
589
- if (text === null) {
590
- {
591
- isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
592
- }
593
- {
594
- if (tag === "slot" && !useNativeShadowDom) ; else {
595
- updateElement(oldVNode, newVNode2, isSvgMode);
596
- }
597
- }
598
- if (oldChildren !== null && newChildren !== null) {
599
- updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
600
- } else if (newChildren !== null) {
601
- if (oldVNode.$text$ !== null) {
602
- elm.textContent = "";
603
- }
604
- addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
605
- } else if (oldChildren !== null) {
606
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
607
- }
608
- if (isSvgMode && tag === "svg") {
609
- isSvgMode = false;
610
- }
611
- } else if (oldVNode.$text$ !== text) {
612
- elm.data = text;
613
- }
614
- };
615
- var nullifyVNodeRefs = (vNode) => {
616
- {
617
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
618
- vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
619
- }
620
- };
621
- var insertBefore = (parent, newNode, reference) => {
622
- const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
623
- return inserted;
624
- };
625
- var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
626
- const hostElm = hostRef.$hostElement$;
627
- const cmpMeta = hostRef.$cmpMeta$;
628
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
629
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
630
- hostTagName = hostElm.tagName;
631
- if (cmpMeta.$attrsToReflect$) {
632
- rootVnode.$attrs$ = rootVnode.$attrs$ || {};
633
- cmpMeta.$attrsToReflect$.map(
634
- ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
635
- );
636
- }
637
- if (isInitialLoad && rootVnode.$attrs$) {
638
- for (const key of Object.keys(rootVnode.$attrs$)) {
639
- if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
640
- rootVnode.$attrs$[key] = hostElm[key];
641
- }
642
- }
643
- }
644
- rootVnode.$tag$ = null;
645
- rootVnode.$flags$ |= 4 /* isHost */;
646
- hostRef.$vnode$ = rootVnode;
647
- rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
648
- {
649
- scopeId = hostElm["s-sc"];
650
- }
651
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
652
- patch(oldVNode, rootVnode, isInitialLoad);
653
- };
654
-
655
- // src/runtime/update-component.ts
656
- var attachToAncestor = (hostRef, ancestorComponent) => {
657
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
658
- ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
659
- }
660
- };
661
- var scheduleUpdate = (hostRef, isInitialLoad) => {
662
- {
663
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
664
- }
665
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
666
- hostRef.$flags$ |= 512 /* needsRerender */;
667
- return;
668
- }
669
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
670
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
671
- return writeTask(dispatch) ;
672
- };
673
- var dispatchHooks = (hostRef, isInitialLoad) => {
674
- const elm = hostRef.$hostElement$;
675
- const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
676
- const instance = hostRef.$lazyInstance$ ;
677
- if (!instance) {
678
- throw new Error(
679
- `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
680
- );
681
- }
682
- let maybePromise;
683
- if (isInitialLoad) {
684
- {
685
- hostRef.$flags$ |= 256 /* isListenReady */;
686
- if (hostRef.$queuedListeners$) {
687
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
688
- hostRef.$queuedListeners$ = void 0;
689
- }
690
- }
691
- {
692
- maybePromise = safeCall(instance, "componentWillLoad");
693
- }
694
- }
695
- {
696
- maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
697
- }
698
- endSchedule();
699
- return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
700
- };
701
- var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
702
- var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
703
- var updateComponent = async (hostRef, instance, isInitialLoad) => {
704
- var _a;
705
- const elm = hostRef.$hostElement$;
706
- const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
707
- const rc = elm["s-rc"];
708
- if (isInitialLoad) {
709
- attachStyles(hostRef);
710
- }
711
- const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
712
- {
713
- callRender(hostRef, instance, elm, isInitialLoad);
714
- }
715
- if (rc) {
716
- rc.map((cb) => cb());
717
- elm["s-rc"] = void 0;
718
- }
719
- endRender();
720
- endUpdate();
721
- {
722
- const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
723
- const postUpdate = () => postUpdateComponent(hostRef);
724
- if (childrenPromises.length === 0) {
725
- postUpdate();
726
- } else {
727
- Promise.all(childrenPromises).then(postUpdate);
728
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
729
- childrenPromises.length = 0;
730
- }
731
- }
732
- };
733
- var callRender = (hostRef, instance, elm, isInitialLoad) => {
734
- try {
735
- instance = instance.render() ;
736
- {
737
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
738
- }
739
- {
740
- hostRef.$flags$ |= 2 /* hasRendered */;
741
- }
742
- {
743
- {
744
- {
745
- renderVdom(hostRef, instance, isInitialLoad);
746
- }
747
- }
748
- }
749
- } catch (e) {
750
- consoleError(e, hostRef.$hostElement$);
751
- }
752
- return null;
753
- };
754
- var postUpdateComponent = (hostRef) => {
755
- const tagName = hostRef.$cmpMeta$.$tagName$;
756
- const elm = hostRef.$hostElement$;
757
- const endPostUpdate = createTime("postUpdate", tagName);
758
- const instance = hostRef.$lazyInstance$ ;
759
- const ancestorComponent = hostRef.$ancestorComponent$;
760
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
761
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
762
- {
763
- addHydratedFlag(elm);
764
- }
765
- {
766
- safeCall(instance, "componentDidLoad");
767
- }
768
- endPostUpdate();
769
- {
770
- hostRef.$onReadyResolve$(elm);
771
- if (!ancestorComponent) {
772
- appDidLoad();
773
- }
774
- }
775
- } else {
776
- endPostUpdate();
777
- }
778
- {
779
- hostRef.$onInstanceResolve$(elm);
780
- }
781
- {
782
- if (hostRef.$onRenderResolve$) {
783
- hostRef.$onRenderResolve$();
784
- hostRef.$onRenderResolve$ = void 0;
785
- }
786
- if (hostRef.$flags$ & 512 /* needsRerender */) {
787
- nextTick(() => scheduleUpdate(hostRef, false));
788
- }
789
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
790
- }
791
- };
792
- var forceUpdate = (ref) => {
793
- {
794
- const hostRef = getHostRef(ref);
795
- const isConnected = hostRef.$hostElement$.isConnected;
796
- if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
797
- scheduleUpdate(hostRef, false);
798
- }
799
- return isConnected;
800
- }
801
- };
802
- var appDidLoad = (who) => {
803
- {
804
- addHydratedFlag(doc.documentElement);
805
- }
806
- nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
807
- };
808
- var safeCall = (instance, method, arg) => {
809
- if (instance && instance[method]) {
810
- try {
811
- return instance[method](arg);
812
- } catch (e) {
813
- consoleError(e);
814
- }
815
- }
816
- return void 0;
817
- };
818
- var addHydratedFlag = (elm) => {
819
- var _a;
820
- return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
821
- };
822
-
823
- // src/runtime/set-value.ts
824
- var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
825
- var setValue = (ref, propName, newVal, cmpMeta) => {
826
- const hostRef = getHostRef(ref);
827
- if (!hostRef) {
828
- throw new Error(
829
- `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`
830
- );
831
- }
832
- const elm = hostRef.$hostElement$ ;
833
- const oldVal = hostRef.$instanceValues$.get(propName);
834
- const flags = hostRef.$flags$;
835
- const instance = hostRef.$lazyInstance$ ;
836
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
837
- const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
838
- const didValueChange = newVal !== oldVal && !areBothNaN;
839
- if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
840
- hostRef.$instanceValues$.set(propName, newVal);
841
- if (instance) {
842
- if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
843
- const watchMethods = cmpMeta.$watchers$[propName];
844
- if (watchMethods) {
845
- watchMethods.map((watchMethodName) => {
846
- try {
847
- instance[watchMethodName](newVal, oldVal, propName);
848
- } catch (e) {
849
- consoleError(e, elm);
850
- }
851
- });
852
- }
853
- }
854
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
855
- scheduleUpdate(hostRef, false);
856
- }
857
- }
858
- }
859
- };
860
-
861
- // src/runtime/proxy-component.ts
862
- var proxyComponent = (Cstr, cmpMeta, flags) => {
863
- var _a;
864
- const prototype = Cstr.prototype;
865
- if (cmpMeta.$members$) {
866
- if (Cstr.watchers) {
867
- cmpMeta.$watchers$ = Cstr.watchers;
868
- }
869
- const members = Object.entries(cmpMeta.$members$);
870
- members.map(([memberName, [memberFlags]]) => {
871
- if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
872
- Object.defineProperty(prototype, memberName, {
873
- get() {
874
- return getValue(this, memberName);
875
- },
876
- set(newValue) {
877
- setValue(this, memberName, newValue, cmpMeta);
878
- },
879
- configurable: true,
880
- enumerable: true
881
- });
882
- } else if (flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
883
- Object.defineProperty(prototype, memberName, {
884
- value(...args) {
885
- var _a2;
886
- const ref = getHostRef(this);
887
- return (_a2 = ref == null ? void 0 : ref.$onInstancePromise$) == null ? void 0 : _a2.then(() => {
888
- var _a3;
889
- return (_a3 = ref.$lazyInstance$) == null ? void 0 : _a3[memberName](...args);
890
- });
891
- }
892
- });
893
- }
894
- });
895
- if ((flags & 1 /* isElementConstructor */)) {
896
- const attrNameToPropName = /* @__PURE__ */ new Map();
897
- prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
898
- plt.jmp(() => {
899
- var _a2;
900
- const propName = attrNameToPropName.get(attrName);
901
- if (this.hasOwnProperty(propName)) {
902
- newValue = this[propName];
903
- delete this[propName];
904
- } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && this[propName] == newValue) {
905
- return;
906
- } else if (propName == null) {
907
- const hostRef = getHostRef(this);
908
- const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
909
- if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
910
- const instance = hostRef.$lazyInstance$ ;
911
- const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
912
- entry == null ? void 0 : entry.forEach((callbackName) => {
913
- if (instance[callbackName] != null) {
914
- instance[callbackName].call(instance, newValue, oldValue, attrName);
915
- }
916
- });
917
- }
918
- return;
919
- }
920
- this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
921
- });
922
- };
923
- Cstr.observedAttributes = Array.from(
924
- /* @__PURE__ */ new Set([
925
- ...Object.keys((_a = cmpMeta.$watchers$) != null ? _a : {}),
926
- ...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
927
- var _a2;
928
- const attrName = m[1] || propName;
929
- attrNameToPropName.set(attrName, propName);
930
- if (m[0] & 512 /* ReflectAttr */) {
931
- (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
932
- }
933
- return attrName;
934
- })
935
- ])
936
- );
937
- }
938
- }
939
- return Cstr;
940
- };
941
-
942
- // src/runtime/initialize-component.ts
943
- var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
944
- let Cstr;
945
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
946
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
947
- const bundleId = cmpMeta.$lazyBundleId$;
948
- if (bundleId) {
949
- const CstrImport = loadModule(cmpMeta);
950
- if (CstrImport && "then" in CstrImport) {
951
- const endLoad = uniqueTime();
952
- Cstr = await CstrImport;
953
- endLoad();
954
- } else {
955
- Cstr = CstrImport;
956
- }
957
- if (!Cstr) {
958
- throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
959
- }
960
- if (!Cstr.isProxied) {
961
- {
962
- cmpMeta.$watchers$ = Cstr.watchers;
963
- }
964
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
965
- Cstr.isProxied = true;
966
- }
967
- const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
968
- {
969
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
970
- }
971
- try {
972
- new Cstr(hostRef);
973
- } catch (e) {
974
- consoleError(e);
975
- }
976
- {
977
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
978
- }
979
- {
980
- hostRef.$flags$ |= 128 /* isWatchReady */;
981
- }
982
- endNewInstance();
983
- } else {
984
- Cstr = elm.constructor;
985
- const cmpTag = elm.localName;
986
- customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
987
- }
988
- if (Cstr && Cstr.style) {
989
- let style = Cstr.style;
990
- const scopeId2 = getScopeId(cmpMeta);
991
- if (!styles.has(scopeId2)) {
992
- const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
993
- registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
994
- endRegisterStyles();
995
- }
996
- }
997
- }
998
- const ancestorComponent = hostRef.$ancestorComponent$;
999
- const schedule = () => scheduleUpdate(hostRef, true);
1000
- if (ancestorComponent && ancestorComponent["s-rc"]) {
1001
- ancestorComponent["s-rc"].push(schedule);
1002
- } else {
1003
- schedule();
1004
- }
1005
- };
1006
- var fireConnectedCallback = (instance) => {
1007
- };
1008
-
1009
- // src/runtime/connected-callback.ts
1010
- var connectedCallback = (elm) => {
1011
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1012
- const hostRef = getHostRef(elm);
1013
- const cmpMeta = hostRef.$cmpMeta$;
1014
- const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
1015
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1016
- hostRef.$flags$ |= 1 /* hasConnected */;
1017
- {
1018
- let ancestorComponent = elm;
1019
- while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
1020
- if (ancestorComponent["s-p"]) {
1021
- attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
1022
- break;
1023
- }
1024
- }
1025
- }
1026
- if (cmpMeta.$members$) {
1027
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1028
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1029
- const value = elm[memberName];
1030
- delete elm[memberName];
1031
- elm[memberName] = value;
1032
- }
1033
- });
1034
- }
1035
- {
1036
- initializeComponent(elm, hostRef, cmpMeta);
1037
- }
1038
- } else {
1039
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1040
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1041
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
1042
- }
1043
- }
1044
- endConnected();
1045
- }
1046
- };
1047
- var disconnectInstance = (instance) => {
1048
- {
1049
- safeCall(instance, "disconnectedCallback");
1050
- }
1051
- };
1052
- var disconnectedCallback = async (elm) => {
1053
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1054
- const hostRef = getHostRef(elm);
1055
- {
1056
- if (hostRef.$rmListeners$) {
1057
- hostRef.$rmListeners$.map((rmListener) => rmListener());
1058
- hostRef.$rmListeners$ = void 0;
1059
- }
1060
- }
1061
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1062
- disconnectInstance(hostRef.$lazyInstance$);
1063
- } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1064
- hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
1065
- }
1066
- }
1067
- };
1068
-
1069
- // src/runtime/bootstrap-lazy.ts
1070
- var bootstrapLazy = (lazyBundles, options = {}) => {
1071
- var _a;
1072
- const endBootstrap = createTime();
1073
- const cmpTags = [];
1074
- const exclude = options.exclude || [];
1075
- const customElements2 = win.customElements;
1076
- const head = doc.head;
1077
- const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
1078
- const dataStyles = /* @__PURE__ */ doc.createElement("style");
1079
- const deferredConnectedCallbacks = [];
1080
- let appLoadFallback;
1081
- let isBootstrapping = true;
1082
- Object.assign(plt, options);
1083
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
1084
- let hasSlotRelocation = false;
1085
- lazyBundles.map((lazyBundle) => {
1086
- lazyBundle[1].map((compactMeta) => {
1087
- var _a2;
1088
- const cmpMeta = {
1089
- $flags$: compactMeta[0],
1090
- $tagName$: compactMeta[1],
1091
- $members$: compactMeta[2],
1092
- $listeners$: compactMeta[3]
1093
- };
1094
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1095
- hasSlotRelocation = true;
1096
- }
1097
- {
1098
- cmpMeta.$members$ = compactMeta[2];
1099
- }
1100
- {
1101
- cmpMeta.$listeners$ = compactMeta[3];
1102
- }
1103
- {
1104
- cmpMeta.$attrsToReflect$ = [];
1105
- }
1106
- {
1107
- cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
1108
- }
1109
- const tagName = cmpMeta.$tagName$;
1110
- const HostElement = class extends HTMLElement {
1111
- // StencilLazyHost
1112
- constructor(self) {
1113
- super(self);
1114
- self = this;
1115
- registerHost(self, cmpMeta);
1116
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1117
- {
1118
- {
1119
- self.attachShadow({ mode: "open" });
1120
- }
1121
- }
1122
- }
1123
- }
1124
- connectedCallback() {
1125
- if (appLoadFallback) {
1126
- clearTimeout(appLoadFallback);
1127
- appLoadFallback = null;
1128
- }
1129
- if (isBootstrapping) {
1130
- deferredConnectedCallbacks.push(this);
1131
- } else {
1132
- plt.jmp(() => connectedCallback(this));
1133
- }
1134
- }
1135
- disconnectedCallback() {
1136
- plt.jmp(() => disconnectedCallback(this));
1137
- }
1138
- componentOnReady() {
1139
- return getHostRef(this).$onReadyPromise$;
1140
- }
1141
- };
1142
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
1143
- if (!exclude.includes(tagName) && !customElements2.get(tagName)) {
1144
- cmpTags.push(tagName);
1145
- customElements2.define(
1146
- tagName,
1147
- proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */)
1148
- );
1149
- }
1150
- });
1151
- });
1152
- if (cmpTags.length > 0) {
1153
- if (hasSlotRelocation) {
1154
- dataStyles.textContent += SLOT_FB_CSS;
1155
- }
1156
- {
1157
- dataStyles.textContent += cmpTags + HYDRATED_CSS;
1158
- }
1159
- if (dataStyles.innerHTML.length) {
1160
- dataStyles.setAttribute("data-styles", "");
1161
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
1162
- if (nonce != null) {
1163
- dataStyles.setAttribute("nonce", nonce);
1164
- }
1165
- head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
1166
- }
1167
- }
1168
- isBootstrapping = false;
1169
- if (deferredConnectedCallbacks.length) {
1170
- deferredConnectedCallbacks.map((host) => host.connectedCallback());
1171
- } else {
1172
- {
1173
- plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
1174
- }
1175
- }
1176
- endBootstrap();
1177
- };
1178
-
1179
- // src/runtime/fragment.ts
1180
- var Fragment = (_, children) => children;
1181
- var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1182
- if (listeners) {
1183
- listeners.map(([flags, name, method]) => {
1184
- const target = getHostListenerTarget(elm, flags) ;
1185
- const handler = hostListenerProxy(hostRef, method);
1186
- const opts = hostListenerOpts(flags);
1187
- plt.ael(target, name, handler, opts);
1188
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
1189
- });
1190
- }
1191
- };
1192
- var hostListenerProxy = (hostRef, methodName) => (ev) => {
1193
- var _a;
1194
- try {
1195
- {
1196
- if (hostRef.$flags$ & 256 /* isListenReady */) {
1197
- (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
1198
- } else {
1199
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
1200
- }
1201
- }
1202
- } catch (e) {
1203
- consoleError(e);
1204
- }
1205
- };
1206
- var getHostListenerTarget = (elm, flags) => {
1207
- if (flags & 8 /* TargetWindow */) return win;
1208
- return elm;
1209
- };
1210
- var hostListenerOpts = (flags) => supportsListenerOptions ? {
1211
- passive: (flags & 1 /* Passive */) !== 0,
1212
- capture: (flags & 2 /* Capture */) !== 0
1213
- } : (flags & 2 /* Capture */) !== 0;
1214
-
1215
- // src/runtime/nonce.ts
1216
- var setNonce = (nonce) => plt.$nonce$ = nonce;
1217
-
1218
- // src/client/client-host-ref.ts
1219
- var hostRefs = /* @__PURE__ */ new WeakMap();
1220
- var getHostRef = (ref) => hostRefs.get(ref);
1221
- var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
1222
- var registerHost = (hostElement, cmpMeta) => {
1223
- const hostRef = {
1224
- $flags$: 0,
1225
- $hostElement$: hostElement,
1226
- $cmpMeta$: cmpMeta,
1227
- $instanceValues$: /* @__PURE__ */ new Map()
1228
- };
1229
- {
1230
- hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r);
1231
- }
1232
- {
1233
- hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
1234
- hostElement["s-p"] = [];
1235
- hostElement["s-rc"] = [];
1236
- }
1237
- addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$);
1238
- return hostRefs.set(hostElement, hostRef);
1239
- };
1240
- var isMemberInElement = (elm, memberName) => memberName in elm;
1241
- var consoleError = (e, el) => (0, console.error)(e, el);
1242
-
1243
- // src/client/client-load-module.ts
1244
- var cmpModules = /* @__PURE__ */ new Map();
1245
- var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1246
- const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
1247
- const bundleId = cmpMeta.$lazyBundleId$;
1248
- if (!bundleId) {
1249
- return void 0;
1250
- }
1251
- const module = cmpModules.get(bundleId) ;
1252
- if (module) {
1253
- return module[exportName];
1254
- }
1255
-
1256
- if (!hmrVersionId || !BUILD.hotModuleReplacement) {
1257
- const processMod = importedModule => {
1258
- cmpModules.set(bundleId, importedModule);
1259
- return importedModule[exportName];
1260
- }
1261
- switch(bundleId) {
1262
-
1263
- case 'cpsl-alert_33':
1264
- return import(
1265
- /* webpackMode: "lazy" */
1266
- './cpsl-alert_33.entry.js').then(processMod, consoleError);
1267
- case 'cpsl-animation':
1268
- return import(
1269
- /* webpackMode: "lazy" */
1270
- './cpsl-animation.entry.js').then(processMod, consoleError);
1271
- case 'cpsl-col':
1272
- return import(
1273
- /* webpackMode: "lazy" */
1274
- './cpsl-col.entry.js').then(processMod, consoleError);
1275
- case 'cpsl-grid':
1276
- return import(
1277
- /* webpackMode: "lazy" */
1278
- './cpsl-grid.entry.js').then(processMod, consoleError);
1279
- case 'cpsl-info-box':
1280
- return import(
1281
- /* webpackMode: "lazy" */
1282
- './cpsl-info-box.entry.js').then(processMod, consoleError);
1283
- case 'cpsl-modal-v2':
1284
- return import(
1285
- /* webpackMode: "lazy" */
1286
- './cpsl-modal-v2.entry.js').then(processMod, consoleError);
1287
- case 'cpsl-row':
1288
- return import(
1289
- /* webpackMode: "lazy" */
1290
- './cpsl-row.entry.js').then(processMod, consoleError);
1291
- }
1292
- }
1293
- return import(
1294
- /* @vite-ignore */
1295
- /* webpackInclude: /\.entry\.js$/ */
1296
- /* webpackExclude: /\.system\.entry\.js$/ */
1297
- /* webpackMode: "lazy" */
1298
- `./${bundleId}.entry.js${""}`
1299
- ).then((importedModule) => {
1300
- {
1301
- cmpModules.set(bundleId, importedModule);
1302
- }
1303
- return importedModule[exportName];
1304
- }, consoleError);
1305
- };
1306
-
1307
- // src/client/client-style.ts
1308
- var styles = /* @__PURE__ */ new Map();
1309
- var win = typeof window !== "undefined" ? window : {};
1310
- var doc = win.document || { head: {} };
1311
- var plt = {
1312
- $flags$: 0,
1313
- $resourcesUrl$: "",
1314
- jmp: (h2) => h2(),
1315
- raf: (h2) => requestAnimationFrame(h2),
1316
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
1317
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
1318
- ce: (eventName, opts) => new CustomEvent(eventName, opts)
1319
- };
1320
- var supportsListenerOptions = /* @__PURE__ */ (() => {
1321
- let supportsListenerOptions2 = false;
1322
- try {
1323
- doc.addEventListener(
1324
- "e",
1325
- null,
1326
- Object.defineProperty({}, "passive", {
1327
- get() {
1328
- supportsListenerOptions2 = true;
1329
- }
1330
- })
1331
- );
1332
- } catch (e) {
1333
- }
1334
- return supportsListenerOptions2;
1335
- })();
1336
- var promiseResolve = (v) => Promise.resolve(v);
1337
- var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
1338
- try {
1339
- new CSSStyleSheet();
1340
- return typeof new CSSStyleSheet().replaceSync === "function";
1341
- } catch (e) {
1342
- }
1343
- return false;
1344
- })() ;
1345
- var queuePending = false;
1346
- var queueDomReads = [];
1347
- var queueDomWrites = [];
1348
- var queueTask = (queue, write) => (cb) => {
1349
- queue.push(cb);
1350
- if (!queuePending) {
1351
- queuePending = true;
1352
- if (write && plt.$flags$ & 4 /* queueSync */) {
1353
- nextTick(flush);
1354
- } else {
1355
- plt.raf(flush);
1356
- }
1357
- }
1358
- };
1359
- var consume = (queue) => {
1360
- for (let i2 = 0; i2 < queue.length; i2++) {
1361
- try {
1362
- queue[i2](performance.now());
1363
- } catch (e) {
1364
- consoleError(e);
1365
- }
1366
- }
1367
- queue.length = 0;
1368
- };
1369
- var flush = () => {
1370
- consume(queueDomReads);
1371
- {
1372
- consume(queueDomWrites);
1373
- if (queuePending = queueDomReads.length > 0) {
1374
- plt.raf(flush);
1375
- }
1376
- }
1377
- };
1378
- var nextTick = (cb) => promiseResolve().then(cb);
1379
- var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
1380
-
1381
- export { Fragment as F, Host as H, bootstrapLazy as b, createEvent as c, forceUpdate as f, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
1382
-
1383
- //# sourceMappingURL=index-b9a060b3.js.map