crmbonus-component-wake 0.0.15 → 0.0.16

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