index.js 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093
  1. function writeTask(e) {
  2. queuedWriteTasks.push(e);
  3. }
  4. function readTask(e) {
  5. queuedReadTasks.push(e);
  6. }
  7. function flushQueue() {
  8. return new Promise(((e, t) => {
  9. process.nextTick((async function a() {
  10. try {
  11. if (queuedReadTasks.length > 0) {
  12. const e = queuedReadTasks.slice();
  13. let t;
  14. for (queuedReadTasks.length = 0; t = e.shift(); ) {
  15. const e = t(Date.now());
  16. null != e && "function" == typeof e.then && await e;
  17. }
  18. }
  19. if (queuedWriteTasks.length > 0) {
  20. const e = queuedWriteTasks.slice();
  21. let t;
  22. for (queuedWriteTasks.length = 0; t = e.shift(); ) {
  23. const e = t(Date.now());
  24. null != e && "function" == typeof e.then && await e;
  25. }
  26. }
  27. queuedReadTasks.length + queuedWriteTasks.length > 0 ? process.nextTick(a) : e();
  28. } catch (e) {
  29. t(`flushQueue: ${e}`);
  30. }
  31. }));
  32. }));
  33. }
  34. async function flushAll() {
  35. for (;queuedTicks.length + queuedLoadModules.length + queuedWriteTasks.length + queuedReadTasks.length > 0; ) await new Promise(((e, t) => {
  36. process.nextTick((function a() {
  37. try {
  38. if (queuedTicks.length > 0) {
  39. const e = queuedTicks.slice();
  40. let t;
  41. for (queuedTicks.length = 0; t = e.shift(); ) t(Date.now());
  42. }
  43. queuedTicks.length > 0 ? process.nextTick(a) : e();
  44. } catch (e) {
  45. t(`flushTicks: ${e}`);
  46. }
  47. }));
  48. })), await flushLoadModule(), await flushQueue();
  49. if (caughtErrors.length > 0) {
  50. const e = caughtErrors[0];
  51. if (null == e) throw new Error("Error!");
  52. if ("string" == typeof e) throw new Error(e);
  53. throw e;
  54. }
  55. return new Promise((e => process.nextTick(e)));
  56. }
  57. function loadModule(e, t, a) {
  58. return new Promise((t => {
  59. queuedLoadModules.push({
  60. bundleId: e.$lazyBundleId$,
  61. resolve: () => t(moduleLoaded.get(e.$lazyBundleId$))
  62. });
  63. }));
  64. }
  65. function flushLoadModule(e) {
  66. return new Promise(((t, a) => {
  67. try {
  68. process.nextTick((() => {
  69. if (null != e) for (let t = 0; t < queuedLoadModules.length; t++) queuedLoadModules[t].bundleId === e && (queuedLoadModules[t].resolve(),
  70. queuedLoadModules.splice(t, 1), t--); else {
  71. let e;
  72. for (;e = queuedLoadModules.shift(); ) e.resolve();
  73. }
  74. t();
  75. }));
  76. } catch (e) {
  77. a(`flushLoadModule: ${e}`);
  78. }
  79. }));
  80. }
  81. function stopAutoApplyChanges() {
  82. isAutoApplyingChanges = !1, autoApplyTimer && (clearTimeout(autoApplyTimer), autoApplyTimer = void 0);
  83. }
  84. const mockDoc = require("@stencil/core/mock-doc"), appData = require("@stencil/core/internal/app-data"), styles = new Map, modeResolutionChain = [], cstrs = new Map, queuedTicks = [], queuedWriteTasks = [], queuedReadTasks = [], moduleLoaded = new Map, queuedLoadModules = [], caughtErrors = [], hostRefs = new Map, getAssetPath = e => {
  85. const t = new URL(e, plt.$resourcesUrl$);
  86. return t.origin !== win.location.origin ? t.href : t.pathname;
  87. };
  88. let i = 0;
  89. const createTime = (e, t = "") => {
  90. if (appData.BUILD.profile && performance.mark) {
  91. const a = `st:${e}:${t}:${i++}`;
  92. return performance.mark(a), () => performance.measure(`[Stencil] ${e}() <${t}>`, a);
  93. }
  94. return () => {};
  95. }, XLINK_NS = "http://www.w3.org/1999/xlink", EMPTY_OBJ = {}, isComplexType = e => "object" == (e = typeof e) || "function" === e, h = (e, t, ...a) => {
  96. let o = null, s = null, n = null, l = !1, r = !1;
  97. const p = [], i = t => {
  98. for (let a = 0; a < t.length; a++) o = t[a], Array.isArray(o) ? i(o) : null != o && "boolean" != typeof o && ((l = "function" != typeof e && !isComplexType(o)) ? o = String(o) : appData.BUILD.isDev && "function" != typeof e && void 0 === o.$flags$ && consoleDevError("vNode passed as children has unexpected type.\nMake sure it's using the correct h() function.\nEmpty objects can also be the cause, look for JSX comments that became objects."),
  99. l && r ? p[p.length - 1].$text$ += o : p.push(l ? newVNode(null, o) : o), r = l);
  100. };
  101. if (i(a), t && (appData.BUILD.isDev && "input" === e && validateInputProperties(t),
  102. appData.BUILD.vdomKey && t.key && (s = t.key), appData.BUILD.slotRelocation && t.name && (n = t.name),
  103. appData.BUILD.vdomClass)) {
  104. const e = t.className || t.class;
  105. e && (t.class = "object" != typeof e ? e : Object.keys(e).filter((t => e[t])).join(" "));
  106. }
  107. if (appData.BUILD.isDev && p.some(isHost) && consoleDevError("The <Host> must be the single root component. Make sure:\n- You are NOT using hostData() and <Host> in the same component.\n- <Host> is used once, and it's the single root component of the render() function."),
  108. appData.BUILD.vdomFunctional && "function" == typeof e) return e(null === t ? {} : t, p, vdomFnUtils);
  109. const d = newVNode(e, null);
  110. return d.$attrs$ = t, p.length > 0 && (d.$children$ = p), appData.BUILD.vdomKey && (d.$key$ = s),
  111. appData.BUILD.slotRelocation && (d.$name$ = n), d;
  112. }, newVNode = (e, t) => {
  113. const a = {
  114. $flags$: 0,
  115. $tag$: e,
  116. $text$: t,
  117. $elm$: null,
  118. $children$: null
  119. };
  120. return appData.BUILD.vdomAttribute && (a.$attrs$ = null), appData.BUILD.vdomKey && (a.$key$ = null),
  121. appData.BUILD.slotRelocation && (a.$name$ = null), a;
  122. }, Host = {}, isHost = e => e && e.$tag$ === Host, vdomFnUtils = {
  123. forEach: (e, t) => e.map(convertToPublic).forEach(t),
  124. map: (e, t) => e.map(convertToPublic).map(t).map(convertToPrivate)
  125. }, convertToPublic = e => ({
  126. vattrs: e.$attrs$,
  127. vchildren: e.$children$,
  128. vkey: e.$key$,
  129. vname: e.$name$,
  130. vtag: e.$tag$,
  131. vtext: e.$text$
  132. }), convertToPrivate = e => {
  133. if ("function" == typeof e.vtag) {
  134. const t = {
  135. ...e.vattrs
  136. };
  137. return e.vkey && (t.key = e.vkey), e.vname && (t.name = e.vname), h(e.vtag, t, ...e.vchildren || []);
  138. }
  139. const t = newVNode(e.vtag, e.vtext);
  140. return t.$attrs$ = e.vattrs, t.$children$ = e.vchildren, t.$key$ = e.vkey, t.$name$ = e.vname,
  141. t;
  142. }, validateInputProperties = e => {
  143. const t = Object.keys(e), a = t.indexOf("value");
  144. if (-1 === a) return;
  145. const o = t.indexOf("type"), s = t.indexOf("min"), n = t.indexOf("max"), l = t.indexOf("step");
  146. (a < o || a < s || a < n || a < l) && consoleDevWarn('The "value" prop of <input> should be set after "min", "max", "type" and "step"');
  147. }, clientHydrate = (e, t, a, o, s, n, l) => {
  148. let r, p, i, d;
  149. if (1 === n.nodeType) {
  150. for (r = n.getAttribute("c-id"), r && (p = r.split("."), p[0] !== l && "0" !== p[0] || (i = {
  151. $flags$: 0,
  152. $hostId$: p[0],
  153. $nodeId$: p[1],
  154. $depth$: p[2],
  155. $index$: p[3],
  156. $tag$: n.tagName.toLowerCase(),
  157. $elm$: n,
  158. $attrs$: null,
  159. $children$: null,
  160. $key$: null,
  161. $name$: null,
  162. $text$: null
  163. }, t.push(i), n.removeAttribute("c-id"), e.$children$ || (e.$children$ = []), e.$children$[i.$index$] = i,
  164. e = i, o && "0" === i.$depth$ && (o[i.$index$] = i.$elm$))), d = n.childNodes.length - 1; d >= 0; d--) clientHydrate(e, t, a, o, s, n.childNodes[d], l);
  165. if (n.shadowRoot) for (d = n.shadowRoot.childNodes.length - 1; d >= 0; d--) clientHydrate(e, t, a, o, s, n.shadowRoot.childNodes[d], l);
  166. } else if (8 === n.nodeType) p = n.nodeValue.split("."), p[1] !== l && "0" !== p[1] || (r = p[0],
  167. i = {
  168. $flags$: 0,
  169. $hostId$: p[1],
  170. $nodeId$: p[2],
  171. $depth$: p[3],
  172. $index$: p[4],
  173. $elm$: n,
  174. $attrs$: null,
  175. $children$: null,
  176. $key$: null,
  177. $name$: null,
  178. $tag$: null,
  179. $text$: null
  180. }, "t" === r ? (i.$elm$ = n.nextSibling, i.$elm$ && 3 === i.$elm$.nodeType && (i.$text$ = i.$elm$.textContent,
  181. t.push(i), n.remove(), e.$children$ || (e.$children$ = []), e.$children$[i.$index$] = i,
  182. o && "0" === i.$depth$ && (o[i.$index$] = i.$elm$))) : i.$hostId$ === l && ("s" === r ? (i.$tag$ = "slot",
  183. p[5] ? n["s-sn"] = i.$name$ = p[5] : n["s-sn"] = "", n["s-sr"] = !0, appData.BUILD.shadowDom && o && (i.$elm$ = doc.createElement(i.$tag$),
  184. i.$name$ && i.$elm$.setAttribute("name", i.$name$), n.parentNode.insertBefore(i.$elm$, n),
  185. n.remove(), "0" === i.$depth$ && (o[i.$index$] = i.$elm$)), a.push(i), e.$children$ || (e.$children$ = []),
  186. e.$children$[i.$index$] = i) : "r" === r && (appData.BUILD.shadowDom && o ? n.remove() : appData.BUILD.slotRelocation && (s["s-cr"] = n,
  187. n["s-cn"] = !0)))); else if (e && "style" === e.$tag$) {
  188. const t = newVNode(null, n.textContent);
  189. t.$elm$ = n, t.$index$ = "0", e.$children$ = [ t ];
  190. }
  191. }, initializeDocumentHydrate = (e, t) => {
  192. if (1 === e.nodeType) {
  193. let a = 0;
  194. for (;a < e.childNodes.length; a++) initializeDocumentHydrate(e.childNodes[a], t);
  195. if (e.shadowRoot) for (a = 0; a < e.shadowRoot.childNodes.length; a++) initializeDocumentHydrate(e.shadowRoot.childNodes[a], t);
  196. } else if (8 === e.nodeType) {
  197. const a = e.nodeValue.split(".");
  198. "o" === a[0] && (t.set(a[1] + "." + a[2], e), e.nodeValue = "", e["s-en"] = a[3]);
  199. }
  200. }, computeMode = e => modeResolutionChain.map((t => t(e))).find((e => !!e)), parsePropertyValue = (e, t) => null == e || isComplexType(e) ? e : appData.BUILD.propBoolean && 4 & t ? "false" !== e && ("" === e || !!e) : appData.BUILD.propNumber && 2 & t ? parseFloat(e) : appData.BUILD.propString && 1 & t ? String(e) : e, getElement = e => appData.BUILD.lazyLoad ? getHostRef(e).$hostElement$ : e, emitEvent = (e, t, a) => {
  201. const o = plt.ce(t, a);
  202. return e.dispatchEvent(o), o;
  203. }, rootAppliedStyles = new WeakMap, registerStyle = (e, t, a) => {
  204. let o = styles.get(e);
  205. o = t, styles.set(e, o);
  206. }, addStyle = (e, t, a, o) => {
  207. let s = getScopeId(t, a);
  208. const n = styles.get(s);
  209. if (!appData.BUILD.attachStyles) return s;
  210. if (e = 11 === e.nodeType ? e : doc, n) if ("string" == typeof n) {
  211. e = e.head || e;
  212. let a, l = rootAppliedStyles.get(e);
  213. if (l || rootAppliedStyles.set(e, l = new Set), !l.has(s)) {
  214. if (appData.BUILD.hydrateClientSide && e.host && (a = e.querySelector(`[sty-id="${s}"]`))) a.innerHTML = n; else {
  215. if (appData.BUILD.cssVarShim && plt.$cssShim$) {
  216. a = plt.$cssShim$.createHostStyle(o, s, n, !!(10 & t.$flags$));
  217. const e = a["s-sc"];
  218. e && (s = e, l = null);
  219. } else a = doc.createElement("style"), a.innerHTML = n;
  220. (appData.BUILD.hydrateServerSide || appData.BUILD.hotModuleReplacement) && a.setAttribute("sty-id", s),
  221. e.insertBefore(a, e.querySelector("link"));
  222. }
  223. l && l.add(s);
  224. }
  225. } else appData.BUILD.constructableCSS && !e.adoptedStyleSheets.includes(n) && (e.adoptedStyleSheets = [ ...e.adoptedStyleSheets, n ]);
  226. return s;
  227. }, attachStyles = e => {
  228. const t = e.$cmpMeta$, a = e.$hostElement$, o = t.$flags$, s = createTime("attachStyles", t.$tagName$), n = addStyle(appData.BUILD.shadowDom && exports.supportsShadow && a.shadowRoot ? a.shadowRoot : a.getRootNode(), t, e.$modeName$, a);
  229. (appData.BUILD.shadowDom || appData.BUILD.scoped) && appData.BUILD.cssAnnotations && 10 & o && (a["s-sc"] = n,
  230. a.classList.add(n + "-h"), appData.BUILD.scoped && 2 & o && a.classList.add(n + "-s")),
  231. s();
  232. }, getScopeId = (e, t) => "sc-" + (appData.BUILD.mode && t && 32 & e.$flags$ ? e.$tagName$ + "-" + t : e.$tagName$), setAccessor = (e, t, a, o, s, n) => {
  233. if (a !== o) {
  234. let l = isMemberInElement(e, t), r = t.toLowerCase();
  235. if (appData.BUILD.vdomClass && "class" === t) {
  236. const t = e.classList, s = parseClassList(a), n = parseClassList(o);
  237. t.remove(...s.filter((e => e && !n.includes(e)))), t.add(...n.filter((e => e && !s.includes(e))));
  238. } else if (appData.BUILD.vdomStyle && "style" === t) {
  239. if (appData.BUILD.updatable) for (const t in a) o && null != o[t] || (!appData.BUILD.hydrateServerSide && t.includes("-") ? e.style.removeProperty(t) : e.style[t] = "");
  240. for (const t in o) a && o[t] === a[t] || (!appData.BUILD.hydrateServerSide && t.includes("-") ? e.style.setProperty(t, o[t]) : e.style[t] = o[t]);
  241. } else if (appData.BUILD.vdomKey && "key" === t) ; else if (appData.BUILD.vdomRef && "ref" === t) o && o(e); else if (!appData.BUILD.vdomListener || (appData.BUILD.lazyLoad ? l : e.__lookupSetter__(t)) || "o" !== t[0] || "n" !== t[1]) {
  242. if (appData.BUILD.vdomPropOrAttr) {
  243. const p = isComplexType(o);
  244. if ((l || p && null !== o) && !s) try {
  245. if (e.tagName.includes("-")) e[t] = o; else {
  246. const s = null == o ? "" : o;
  247. "list" === t ? l = !1 : null != a && e[t] == s || (e[t] = s);
  248. }
  249. } catch (e) {}
  250. let i = !1;
  251. appData.BUILD.vdomXlink && r !== (r = r.replace(/^xlink\:?/, "")) && (t = r, i = !0),
  252. null == o || !1 === o ? !1 === o && "" !== e.getAttribute(t) || (appData.BUILD.vdomXlink && i ? e.removeAttributeNS(XLINK_NS, t) : e.removeAttribute(t)) : (!l || 4 & n || s) && !p && (o = !0 === o ? "" : o,
  253. appData.BUILD.vdomXlink && i ? e.setAttributeNS(XLINK_NS, t, o) : e.setAttribute(t, o));
  254. }
  255. } else t = "-" === t[2] ? t.slice(3) : isMemberInElement(win, r) ? r.slice(2) : r[2] + t.slice(3),
  256. a && plt.rel(e, t, a, !1), o && plt.ael(e, t, o, !1);
  257. }
  258. }, parseClassListRegex = /\s/, parseClassList = e => e ? e.split(parseClassListRegex) : [], updateElement = (e, t, a, o) => {
  259. const s = 11 === t.$elm$.nodeType && t.$elm$.host ? t.$elm$.host : t.$elm$, n = e && e.$attrs$ || EMPTY_OBJ, l = t.$attrs$ || EMPTY_OBJ;
  260. if (appData.BUILD.updatable) for (o in n) o in l || setAccessor(s, o, n[o], void 0, a, t.$flags$);
  261. for (o in l) setAccessor(s, o, n[o], l[o], a, t.$flags$);
  262. };
  263. let scopeId, contentRef, hostTagName, useNativeShadowDom = !1, checkSlotFallbackVisibility = !1, checkSlotRelocate = !1, isSvgMode = !1;
  264. const createElm = (e, t, a, o) => {
  265. const s = t.$children$[a];
  266. let n, l, r, p = 0;
  267. if (appData.BUILD.slotRelocation && !useNativeShadowDom && (checkSlotRelocate = !0,
  268. "slot" === s.$tag$ && (scopeId && o.classList.add(scopeId + "-s"), s.$flags$ |= s.$children$ ? 2 : 1)),
  269. appData.BUILD.isDev && s.$elm$ && consoleDevError(`The JSX ${null !== s.$text$ ? `"${s.$text$}" text` : `"${s.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`),
  270. appData.BUILD.vdomText && null !== s.$text$) n = s.$elm$ = doc.createTextNode(s.$text$); else if (appData.BUILD.slotRelocation && 1 & s.$flags$) n = s.$elm$ = appData.BUILD.isDebug || appData.BUILD.hydrateServerSide ? slotReferenceDebugNode(s) : doc.createTextNode(""); else {
  271. if (appData.BUILD.svg && !isSvgMode && (isSvgMode = "svg" === s.$tag$), n = s.$elm$ = appData.BUILD.svg ? doc.createElementNS(isSvgMode ? "http://www.w3.org/2000/svg" : "http://www.w3.org/1999/xhtml", appData.BUILD.slotRelocation && 2 & s.$flags$ ? "slot-fb" : s.$tag$) : doc.createElement(appData.BUILD.slotRelocation && 2 & s.$flags$ ? "slot-fb" : s.$tag$),
  272. appData.BUILD.svg && isSvgMode && "foreignObject" === s.$tag$ && (isSvgMode = !1),
  273. appData.BUILD.vdomAttribute && updateElement(null, s, isSvgMode), (appData.BUILD.shadowDom || appData.BUILD.scoped) && null != scopeId && n["s-si"] !== scopeId && n.classList.add(n["s-si"] = scopeId),
  274. s.$children$) for (p = 0; p < s.$children$.length; ++p) l = createElm(e, s, p, n),
  275. l && n.appendChild(l);
  276. appData.BUILD.svg && ("svg" === s.$tag$ ? isSvgMode = !1 : "foreignObject" === n.tagName && (isSvgMode = !0));
  277. }
  278. return appData.BUILD.slotRelocation && (n["s-hn"] = hostTagName, 3 & s.$flags$ && (n["s-sr"] = !0,
  279. n["s-cr"] = contentRef, n["s-sn"] = s.$name$ || "", r = e && e.$children$ && e.$children$[a],
  280. r && r.$tag$ === s.$tag$ && e.$elm$ && putBackInOriginalLocation(e.$elm$, !1))),
  281. n;
  282. }, putBackInOriginalLocation = (e, t) => {
  283. plt.$flags$ |= 1;
  284. const a = e.childNodes;
  285. for (let e = a.length - 1; e >= 0; e--) {
  286. const o = a[e];
  287. o["s-hn"] !== hostTagName && o["s-ol"] && (parentReferenceNode(o).insertBefore(o, referenceNode(o)),
  288. o["s-ol"].remove(), o["s-ol"] = void 0, checkSlotRelocate = !0), t && putBackInOriginalLocation(o, t);
  289. }
  290. plt.$flags$ &= -2;
  291. }, addVnodes = (e, t, a, o, s, n) => {
  292. let l, r = appData.BUILD.slotRelocation && e["s-cr"] && e["s-cr"].parentNode || e;
  293. for (appData.BUILD.shadowDom && r.shadowRoot && r.tagName === hostTagName && (r = r.shadowRoot); s <= n; ++s) o[s] && (l = createElm(null, a, s, e),
  294. l && (o[s].$elm$ = l, r.insertBefore(l, appData.BUILD.slotRelocation ? referenceNode(t) : t)));
  295. }, removeVnodes = (e, t, a, o, s) => {
  296. for (;t <= a; ++t) (o = e[t]) && (s = o.$elm$, callNodeRefs(o), appData.BUILD.slotRelocation && (checkSlotFallbackVisibility = !0,
  297. s["s-ol"] ? s["s-ol"].remove() : putBackInOriginalLocation(s, !0)), s.remove());
  298. }, isSameVnode = (e, t) => e.$tag$ === t.$tag$ && (appData.BUILD.slotRelocation && "slot" === e.$tag$ ? e.$name$ === t.$name$ : !appData.BUILD.vdomKey || e.$key$ === t.$key$), referenceNode = e => e && e["s-ol"] || e, parentReferenceNode = e => (e["s-ol"] ? e["s-ol"] : e).parentNode, patch = (e, t) => {
  299. const a = t.$elm$ = e.$elm$, o = e.$children$, s = t.$children$, n = t.$tag$, l = t.$text$;
  300. let r;
  301. appData.BUILD.vdomText && null !== l ? appData.BUILD.vdomText && appData.BUILD.slotRelocation && (r = a["s-cr"]) ? r.parentNode.textContent = l : appData.BUILD.vdomText && e.$text$ !== l && (a.data = l) : (appData.BUILD.svg && (isSvgMode = "svg" === n || "foreignObject" !== n && isSvgMode),
  302. (appData.BUILD.vdomAttribute || appData.BUILD.reflect) && (appData.BUILD.slot && "slot" === n || updateElement(e, t, isSvgMode)),
  303. appData.BUILD.updatable && null !== o && null !== s ? ((e, t, a, o) => {
  304. let s, n, l = 0, r = 0, p = 0, i = 0, d = t.length - 1, c = t[0], $ = t[d], u = o.length - 1, m = o[0], h = o[u];
  305. for (;l <= d && r <= u; ) if (null == c) c = t[++l]; else if (null == $) $ = t[--d]; else if (null == m) m = o[++r]; else if (null == h) h = o[--u]; else if (isSameVnode(c, m)) patch(c, m),
  306. c = t[++l], m = o[++r]; else if (isSameVnode($, h)) patch($, h), $ = t[--d], h = o[--u]; else if (isSameVnode(c, h)) !appData.BUILD.slotRelocation || "slot" !== c.$tag$ && "slot" !== h.$tag$ || putBackInOriginalLocation(c.$elm$.parentNode, !1),
  307. patch(c, h), e.insertBefore(c.$elm$, $.$elm$.nextSibling), c = t[++l], h = o[--u]; else if (isSameVnode($, m)) !appData.BUILD.slotRelocation || "slot" !== c.$tag$ && "slot" !== h.$tag$ || putBackInOriginalLocation($.$elm$.parentNode, !1),
  308. patch($, m), e.insertBefore($.$elm$, c.$elm$), $ = t[--d], m = o[++r]; else {
  309. if (p = -1, appData.BUILD.vdomKey) for (i = l; i <= d; ++i) if (t[i] && null !== t[i].$key$ && t[i].$key$ === m.$key$) {
  310. p = i;
  311. break;
  312. }
  313. appData.BUILD.vdomKey && p >= 0 ? (n = t[p], n.$tag$ !== m.$tag$ ? s = createElm(t && t[r], a, p, e) : (patch(n, m),
  314. t[p] = void 0, s = n.$elm$), m = o[++r]) : (s = createElm(t && t[r], a, r, e), m = o[++r]),
  315. s && (appData.BUILD.slotRelocation ? parentReferenceNode(c.$elm$).insertBefore(s, referenceNode(c.$elm$)) : c.$elm$.parentNode.insertBefore(s, c.$elm$));
  316. }
  317. l > d ? addVnodes(e, null == o[u + 1] ? null : o[u + 1].$elm$, a, o, r, u) : appData.BUILD.updatable && r > u && removeVnodes(t, l, d);
  318. })(a, o, t, s) : null !== s ? (appData.BUILD.updatable && appData.BUILD.vdomText && null !== e.$text$ && (a.textContent = ""),
  319. addVnodes(a, null, t, s, 0, s.length - 1)) : appData.BUILD.updatable && null !== o && removeVnodes(o, 0, o.length - 1),
  320. appData.BUILD.svg && isSvgMode && "svg" === n && (isSvgMode = !1));
  321. }, updateFallbackSlotVisibility = e => {
  322. const t = e.childNodes;
  323. let a, o, s, n, l, r;
  324. for (o = 0, s = t.length; o < s; o++) if (a = t[o], 1 === a.nodeType) {
  325. if (a["s-sr"]) for (l = a["s-sn"], a.hidden = !1, n = 0; n < s; n++) if (r = t[n].nodeType,
  326. t[n]["s-hn"] !== a["s-hn"] || "" !== l) {
  327. if (1 === r && l === t[n].getAttribute("slot")) {
  328. a.hidden = !0;
  329. break;
  330. }
  331. } else if (1 === r || 3 === r && "" !== t[n].textContent.trim()) {
  332. a.hidden = !0;
  333. break;
  334. }
  335. updateFallbackSlotVisibility(a);
  336. }
  337. }, relocateNodes = [], relocateSlotContent = e => {
  338. let t, a, o, s, n, l, r = 0;
  339. const p = e.childNodes, i = p.length;
  340. for (;r < i; r++) {
  341. if (t = p[r], t["s-sr"] && (a = t["s-cr"]) && a.parentNode) for (o = a.parentNode.childNodes,
  342. s = t["s-sn"], l = o.length - 1; l >= 0; l--) a = o[l], a["s-cn"] || a["s-nr"] || a["s-hn"] === t["s-hn"] || (isNodeLocatedInSlot(a, s) ? (n = relocateNodes.find((e => e.$nodeToRelocate$ === a)),
  343. checkSlotFallbackVisibility = !0, a["s-sn"] = a["s-sn"] || s, n ? n.$slotRefNode$ = t : relocateNodes.push({
  344. $slotRefNode$: t,
  345. $nodeToRelocate$: a
  346. }), a["s-sr"] && relocateNodes.map((e => {
  347. isNodeLocatedInSlot(e.$nodeToRelocate$, a["s-sn"]) && (n = relocateNodes.find((e => e.$nodeToRelocate$ === a)),
  348. n && !e.$slotRefNode$ && (e.$slotRefNode$ = n.$slotRefNode$));
  349. }))) : relocateNodes.some((e => e.$nodeToRelocate$ === a)) || relocateNodes.push({
  350. $nodeToRelocate$: a
  351. }));
  352. 1 === t.nodeType && relocateSlotContent(t);
  353. }
  354. }, isNodeLocatedInSlot = (e, t) => 1 === e.nodeType ? null === e.getAttribute("slot") && "" === t || e.getAttribute("slot") === t : e["s-sn"] === t || "" === t, callNodeRefs = e => {
  355. appData.BUILD.vdomRef && (e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(callNodeRefs));
  356. }, renderVdom = (e, t) => {
  357. const a = e.$hostElement$, o = e.$cmpMeta$, s = e.$vnode$ || newVNode(null, null), n = isHost(t) ? t : h(null, null, t);
  358. if (hostTagName = a.tagName, appData.BUILD.isDev && Array.isArray(t) && t.some(isHost)) throw new Error(`The <Host> must be the single root component.\nLooks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.\n\nThe render() function should look like this instead:\n\nrender() {\n // Do not return an array\n return (\n <Host>{content}</Host>\n );\n}\n `);
  359. if (appData.BUILD.reflect && o.$attrsToReflect$ && (n.$attrs$ = n.$attrs$ || {},
  360. o.$attrsToReflect$.map((([e, t]) => n.$attrs$[t] = a[e]))), n.$tag$ = null, n.$flags$ |= 4,
  361. e.$vnode$ = n, n.$elm$ = s.$elm$ = appData.BUILD.shadowDom && a.shadowRoot || a,
  362. (appData.BUILD.scoped || appData.BUILD.shadowDom) && (scopeId = a["s-sc"]), appData.BUILD.slotRelocation && (contentRef = a["s-cr"],
  363. useNativeShadowDom = exports.supportsShadow && 0 != (1 & o.$flags$), checkSlotFallbackVisibility = !1),
  364. patch(s, n), appData.BUILD.slotRelocation) {
  365. if (plt.$flags$ |= 1, checkSlotRelocate) {
  366. let e, t, a, o, s, l;
  367. relocateSlotContent(n.$elm$);
  368. let r = 0;
  369. for (;r < relocateNodes.length; r++) e = relocateNodes[r], t = e.$nodeToRelocate$,
  370. t["s-ol"] || (a = appData.BUILD.isDebug || appData.BUILD.hydrateServerSide ? originalLocationDebugNode(t) : doc.createTextNode(""),
  371. a["s-nr"] = t, t.parentNode.insertBefore(t["s-ol"] = a, t));
  372. for (r = 0; r < relocateNodes.length; r++) if (e = relocateNodes[r], t = e.$nodeToRelocate$,
  373. e.$slotRefNode$) {
  374. for (o = e.$slotRefNode$.parentNode, s = e.$slotRefNode$.nextSibling, a = t["s-ol"]; a = a.previousSibling; ) if (l = a["s-nr"],
  375. l && l["s-sn"] === t["s-sn"] && o === l.parentNode && (l = l.nextSibling, !l || !l["s-nr"])) {
  376. s = l;
  377. break;
  378. }
  379. (!s && o !== t.parentNode || t.nextSibling !== s) && t !== s && (!t["s-hn"] && t["s-ol"] && (t["s-hn"] = t["s-ol"].parentNode.nodeName),
  380. o.insertBefore(t, s));
  381. } else 1 === t.nodeType && (t.hidden = !0);
  382. }
  383. checkSlotFallbackVisibility && updateFallbackSlotVisibility(n.$elm$), plt.$flags$ &= -2,
  384. relocateNodes.length = 0;
  385. }
  386. }, slotReferenceDebugNode = e => doc.createComment(`<slot${e.$name$ ? ' name="' + e.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`), originalLocationDebugNode = e => doc.createComment("org-location for " + (e.localName ? `<${e.localName}> (host=${e["s-hn"]})` : `[${e.textContent}]`)), attachToAncestor = (e, t) => {
  387. appData.BUILD.asyncLoading && t && !e.$onRenderResolve$ && t["s-p"] && t["s-p"].push(new Promise((t => e.$onRenderResolve$ = t)));
  388. }, scheduleUpdate = (e, t) => {
  389. if (appData.BUILD.taskQueue && appData.BUILD.updatable && (e.$flags$ |= 16), appData.BUILD.asyncLoading && 4 & e.$flags$) return void (e.$flags$ |= 512);
  390. attachToAncestor(e, e.$ancestorComponent$);
  391. const a = () => dispatchHooks(e, t);
  392. return appData.BUILD.taskQueue ? writeTask(a) : a();
  393. }, dispatchHooks = (e, t) => {
  394. const a = e.$hostElement$, o = createTime("scheduleUpdate", e.$cmpMeta$.$tagName$), s = appData.BUILD.lazyLoad ? e.$lazyInstance$ : a;
  395. let n;
  396. return t ? (appData.BUILD.lazyLoad && appData.BUILD.hostListener && (e.$flags$ |= 256,
  397. e.$queuedListeners$ && (e.$queuedListeners$.map((([e, t]) => safeCall(s, e, t))),
  398. e.$queuedListeners$ = null)), emitLifecycleEvent(a, "componentWillLoad"), appData.BUILD.cmpWillLoad && (n = safeCall(s, "componentWillLoad"))) : (emitLifecycleEvent(a, "componentWillUpdate"),
  399. appData.BUILD.cmpWillUpdate && (n = safeCall(s, "componentWillUpdate"))), emitLifecycleEvent(a, "componentWillRender"),
  400. appData.BUILD.cmpWillRender && (n = then(n, (() => safeCall(s, "componentWillRender")))),
  401. o(), then(n, (() => updateComponent(e, s, t)));
  402. }, updateComponent = async (e, t, a) => {
  403. const o = e.$hostElement$, s = createTime("update", e.$cmpMeta$.$tagName$), n = o["s-rc"];
  404. appData.BUILD.style && a && attachStyles(e);
  405. const l = createTime("render", e.$cmpMeta$.$tagName$);
  406. if (appData.BUILD.isDev && (e.$flags$ |= 1024), appData.BUILD.hydrateServerSide ? await callRender(e, t, o) : callRender(e, t, o),
  407. appData.BUILD.cssVarShim && plt.$cssShim$ && plt.$cssShim$.updateHost(o), appData.BUILD.isDev && (e.$renderCount$++,
  408. e.$flags$ &= -1025), appData.BUILD.hydrateServerSide) try {
  409. serverSideConnected(o), a && (1 & e.$cmpMeta$.$flags$ ? o["s-en"] = "" : 2 & e.$cmpMeta$.$flags$ && (o["s-en"] = "c"));
  410. } catch (e) {
  411. consoleError(e, o);
  412. }
  413. if (appData.BUILD.asyncLoading && n && (n.map((e => e())), o["s-rc"] = void 0),
  414. l(), s(), appData.BUILD.asyncLoading) {
  415. const t = o["s-p"], a = () => postUpdateComponent(e);
  416. 0 === t.length ? a() : (Promise.all(t).then(a), e.$flags$ |= 4, t.length = 0);
  417. } else postUpdateComponent(e);
  418. };
  419. let renderingRef = null;
  420. const callRender = (e, t, a) => {
  421. const o = !!appData.BUILD.allRenderFn, s = !!appData.BUILD.lazyLoad, n = !!appData.BUILD.taskQueue, l = !!appData.BUILD.updatable;
  422. try {
  423. if (renderingRef = t, t = (o || t.render) && t.render(), l && n && (e.$flags$ &= -17),
  424. (l || s) && (e.$flags$ |= 2), appData.BUILD.hasRenderFn || appData.BUILD.reflect) if (appData.BUILD.vdomRender || appData.BUILD.reflect) {
  425. if (appData.BUILD.hydrateServerSide) return Promise.resolve(t).then((t => renderVdom(e, t)));
  426. renderVdom(e, t);
  427. } else a.textContent = t;
  428. } catch (t) {
  429. consoleError(t, e.$hostElement$);
  430. }
  431. return renderingRef = null, null;
  432. }, postUpdateComponent = e => {
  433. const t = e.$cmpMeta$.$tagName$, a = e.$hostElement$, o = createTime("postUpdate", t), s = appData.BUILD.lazyLoad ? e.$lazyInstance$ : a, n = e.$ancestorComponent$;
  434. appData.BUILD.cmpDidRender && (appData.BUILD.isDev && (e.$flags$ |= 1024), safeCall(s, "componentDidRender"),
  435. appData.BUILD.isDev && (e.$flags$ &= -1025)), emitLifecycleEvent(a, "componentDidRender"),
  436. 64 & e.$flags$ ? (appData.BUILD.cmpDidUpdate && (appData.BUILD.isDev && (e.$flags$ |= 1024),
  437. safeCall(s, "componentDidUpdate"), appData.BUILD.isDev && (e.$flags$ &= -1025)),
  438. emitLifecycleEvent(a, "componentDidUpdate"), o()) : (e.$flags$ |= 64, appData.BUILD.asyncLoading && appData.BUILD.cssAnnotations && addHydratedFlag(a),
  439. appData.BUILD.cmpDidLoad && (appData.BUILD.isDev && (e.$flags$ |= 2048), safeCall(s, "componentDidLoad"),
  440. appData.BUILD.isDev && (e.$flags$ &= -2049)), emitLifecycleEvent(a, "componentDidLoad"),
  441. o(), appData.BUILD.asyncLoading && (e.$onReadyResolve$(a), n || appDidLoad(t))),
  442. appData.BUILD.hotModuleReplacement && a["s-hmr-load"] && a["s-hmr-load"](), appData.BUILD.method && appData.BUILD.lazyLoad && e.$onInstanceResolve$(a),
  443. appData.BUILD.asyncLoading && (e.$onRenderResolve$ && (e.$onRenderResolve$(), e.$onRenderResolve$ = void 0),
  444. 512 & e.$flags$ && nextTick((() => scheduleUpdate(e, !1))), e.$flags$ &= -517);
  445. }, forceUpdate = e => {
  446. if (appData.BUILD.updatable) {
  447. const t = getHostRef(e), a = t.$hostElement$.isConnected;
  448. return a && 2 == (18 & t.$flags$) && scheduleUpdate(t, !1), a;
  449. }
  450. return !1;
  451. }, appDidLoad = e => {
  452. appData.BUILD.cssAnnotations && addHydratedFlag(doc.documentElement), appData.BUILD.asyncQueue && (plt.$flags$ |= 2),
  453. nextTick((() => emitEvent(win, "appload", {
  454. detail: {
  455. namespace: appData.NAMESPACE
  456. }
  457. }))), appData.BUILD.profile && performance.measure && performance.measure(`[Stencil] ${appData.NAMESPACE} initial load (by ${e})`, "st:app:start");
  458. }, safeCall = (e, t, a) => {
  459. if (e && e[t]) try {
  460. return e[t](a);
  461. } catch (e) {
  462. consoleError(e);
  463. }
  464. }, then = (e, t) => e && e.then ? e.then(t) : t(), emitLifecycleEvent = (e, t) => {
  465. appData.BUILD.lifecycleDOMEvents && emitEvent(e, "stencil_" + t, {
  466. bubbles: !0,
  467. composed: !0,
  468. detail: {
  469. namespace: appData.NAMESPACE
  470. }
  471. });
  472. }, addHydratedFlag = e => appData.BUILD.hydratedClass ? e.classList.add("hydrated") : appData.BUILD.hydratedAttribute ? e.setAttribute("hydrated", "") : void 0, serverSideConnected = e => {
  473. const t = e.children;
  474. if (null != t) for (let e = 0, a = t.length; e < a; e++) {
  475. const a = t[e];
  476. "function" == typeof a.connectedCallback && a.connectedCallback(), serverSideConnected(a);
  477. }
  478. }, getValue = (e, t) => getHostRef(e).$instanceValues$.get(t), setValue = (e, t, a, o) => {
  479. const s = getHostRef(e), n = appData.BUILD.lazyLoad ? s.$hostElement$ : e, l = s.$instanceValues$.get(t), r = s.$flags$, p = appData.BUILD.lazyLoad ? s.$lazyInstance$ : n;
  480. a = parsePropertyValue(a, o.$members$[t][0]);
  481. const i = Number.isNaN(l) && Number.isNaN(a), d = a !== l && !i;
  482. if ((!appData.BUILD.lazyLoad || !(8 & r) || void 0 === l) && d && (s.$instanceValues$.set(t, a),
  483. appData.BUILD.isDev && (1024 & s.$flags$ ? consoleDevWarn(`The state/prop "${t}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`, "\nElement", n, "\nNew value", a, "\nOld value", l) : 2048 & s.$flags$ && consoleDevWarn(`The state/prop "${t}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`, "\nElement", n, "\nNew value", a, "\nOld value", l)),
  484. !appData.BUILD.lazyLoad || p)) {
  485. if (appData.BUILD.watchCallback && o.$watchers$ && 128 & r) {
  486. const e = o.$watchers$[t];
  487. e && e.map((e => {
  488. try {
  489. p[e](a, l, t);
  490. } catch (e) {
  491. consoleError(e, n);
  492. }
  493. }));
  494. }
  495. if (appData.BUILD.updatable && 2 == (18 & r)) {
  496. if (appData.BUILD.cmpShouldUpdate && p.componentShouldUpdate && !1 === p.componentShouldUpdate(a, l, t)) return;
  497. scheduleUpdate(s, !1);
  498. }
  499. }
  500. }, proxyComponent = (e, t, a) => {
  501. if (appData.BUILD.member && t.$members$) {
  502. appData.BUILD.watchCallback && e.watchers && (t.$watchers$ = e.watchers);
  503. const o = Object.entries(t.$members$), s = e.prototype;
  504. if (o.map((([e, [o]]) => {
  505. (appData.BUILD.prop || appData.BUILD.state) && (31 & o || (!appData.BUILD.lazyLoad || 2 & a) && 32 & o) ? Object.defineProperty(s, e, {
  506. get() {
  507. return getValue(this, e);
  508. },
  509. set(s) {
  510. if (appData.BUILD.isDev) {
  511. const s = getHostRef(this);
  512. 0 == (1 & a) && 0 == (8 & s.$flags$) && 0 != (31 & o) && 0 == (1024 & o) && consoleDevWarn(`@Prop() "${e}" on <${t.$tagName$}> is immutable but was modified from within the component.\nMore information: https://stenciljs.com/docs/properties#prop-mutability`);
  513. }
  514. setValue(this, e, s, t);
  515. },
  516. configurable: !0,
  517. enumerable: !0
  518. }) : appData.BUILD.lazyLoad && appData.BUILD.method && 1 & a && 64 & o && Object.defineProperty(s, e, {
  519. value(...t) {
  520. const a = getHostRef(this);
  521. return a.$onInstancePromise$.then((() => a.$lazyInstance$[e](...t)));
  522. }
  523. });
  524. })), appData.BUILD.observeAttribute && (!appData.BUILD.lazyLoad || 1 & a)) {
  525. const a = new Map;
  526. s.attributeChangedCallback = function(e, t, o) {
  527. plt.jmp((() => {
  528. const t = a.get(e);
  529. if (this.hasOwnProperty(t)) o = this[t], delete this[t]; else if (s.hasOwnProperty(t) && "number" == typeof this[t] && this[t] == o) return;
  530. this[t] = (null !== o || "boolean" != typeof this[t]) && o;
  531. }));
  532. }, e.observedAttributes = o.filter((([e, t]) => 15 & t[0])).map((([e, o]) => {
  533. const s = o[1] || e;
  534. return a.set(s, e), appData.BUILD.reflect && 512 & o[0] && t.$attrsToReflect$.push([ e, s ]),
  535. s;
  536. }));
  537. }
  538. }
  539. return e;
  540. }, initializeComponent = async (e, t, a, o, s) => {
  541. if ((appData.BUILD.lazyLoad || appData.BUILD.hydrateServerSide || appData.BUILD.style) && 0 == (32 & t.$flags$)) {
  542. if (appData.BUILD.lazyLoad || appData.BUILD.hydrateClientSide) {
  543. if (t.$flags$ |= 32, (s = loadModule(a)).then) {
  544. const e = (n = `st:load:${a.$tagName$}:${t.$modeName$}`, l = `[Stencil] Load module for <${a.$tagName$}>`,
  545. appData.BUILD.profile && performance.mark ? (0 === performance.getEntriesByName(n).length && performance.mark(n),
  546. () => {
  547. 0 === performance.getEntriesByName(l).length && performance.measure(l, n);
  548. }) : () => {});
  549. s = await s, e();
  550. }
  551. if ((appData.BUILD.isDev || appData.BUILD.isDebug) && !s) throw new Error(`Constructor for "${a.$tagName$}#${t.$modeName$}" was not found`);
  552. appData.BUILD.member && !s.isProxied && (appData.BUILD.watchCallback && (a.$watchers$ = s.watchers),
  553. proxyComponent(s, a, 2), s.isProxied = !0);
  554. const e = createTime("createInstance", a.$tagName$);
  555. appData.BUILD.member && (t.$flags$ |= 8);
  556. try {
  557. new s(t);
  558. } catch (e) {
  559. consoleError(e);
  560. }
  561. appData.BUILD.member && (t.$flags$ &= -9), appData.BUILD.watchCallback && (t.$flags$ |= 128),
  562. e(), fireConnectedCallback(t.$lazyInstance$);
  563. } else s = e.constructor, t.$flags$ |= 32, customElements.whenDefined(a.$tagName$).then((() => t.$flags$ |= 128));
  564. if (appData.BUILD.style && s.style) {
  565. let o = s.style;
  566. appData.BUILD.mode && "string" != typeof o && (o = o[t.$modeName$ = computeMode(e)],
  567. appData.BUILD.hydrateServerSide && t.$modeName$ && e.setAttribute("s-mode", t.$modeName$));
  568. const n = getScopeId(a, t.$modeName$);
  569. if (!styles.has(n)) {
  570. const e = createTime("registerStyles", a.$tagName$);
  571. !appData.BUILD.hydrateServerSide && appData.BUILD.shadowDom && appData.BUILD.shadowDomShim && 8 & a.$flags$ && (o = await Promise.resolve().then((function() {
  572. return require("./shadow-css.js");
  573. })).then((e => e.scopeCss(o, n, !1)))), registerStyle(n, o, a.$flags$), e();
  574. }
  575. }
  576. }
  577. var n, l;
  578. const r = t.$ancestorComponent$, p = () => scheduleUpdate(t, !0);
  579. appData.BUILD.asyncLoading && r && r["s-rc"] ? r["s-rc"].push(p) : p();
  580. }, fireConnectedCallback = e => {
  581. appData.BUILD.lazyLoad && appData.BUILD.connectedCallback && safeCall(e, "connectedCallback");
  582. }, connectedCallback = e => {
  583. if (0 == (1 & plt.$flags$)) {
  584. const t = getHostRef(e), a = t.$cmpMeta$, o = createTime("connectedCallback", a.$tagName$);
  585. if (appData.BUILD.hostListenerTargetParent && addHostEventListeners(e, t, a.$listeners$, !0),
  586. 1 & t.$flags$) addHostEventListeners(e, t, a.$listeners$, !1), fireConnectedCallback(t.$lazyInstance$); else {
  587. let o;
  588. if (t.$flags$ |= 1, appData.BUILD.hydrateClientSide && (o = e.getAttribute("s-id"),
  589. o)) {
  590. if (appData.BUILD.shadowDom && exports.supportsShadow && 1 & a.$flags$) {
  591. const t = appData.BUILD.mode ? addStyle(e.shadowRoot, a, e.getAttribute("s-mode")) : addStyle(e.shadowRoot, a);
  592. e.classList.remove(t + "-h", t + "-s");
  593. }
  594. ((e, t, a, o) => {
  595. const s = createTime("hydrateClient", t), n = e.shadowRoot, l = [], r = appData.BUILD.shadowDom && n ? [] : null, p = o.$vnode$ = newVNode(t, null);
  596. plt.$orgLocNodes$ || initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = new Map),
  597. e["s-id"] = a, e.removeAttribute("s-id"), clientHydrate(p, l, [], r, e, e, a), l.map((e => {
  598. const a = e.$hostId$ + "." + e.$nodeId$, o = plt.$orgLocNodes$.get(a), s = e.$elm$;
  599. o && exports.supportsShadow && "" === o["s-en"] && o.parentNode.insertBefore(s, o.nextSibling),
  600. n || (s["s-hn"] = t, o && (s["s-ol"] = o, s["s-ol"]["s-nr"] = s)), plt.$orgLocNodes$.delete(a);
  601. })), appData.BUILD.shadowDom && n && r.map((e => {
  602. e && n.appendChild(e);
  603. })), s();
  604. })(e, a.$tagName$, o, t);
  605. }
  606. if (appData.BUILD.slotRelocation && !o && (appData.BUILD.hydrateServerSide || (appData.BUILD.slot || appData.BUILD.shadowDom) && 12 & a.$flags$) && setContentReference(e),
  607. appData.BUILD.asyncLoading) {
  608. let a = e;
  609. for (;a = a.parentNode || a.host; ) if (appData.BUILD.hydrateClientSide && 1 === a.nodeType && a.hasAttribute("s-id") && a["s-p"] || a["s-p"]) {
  610. attachToAncestor(t, t.$ancestorComponent$ = a);
  611. break;
  612. }
  613. }
  614. appData.BUILD.prop && !appData.BUILD.hydrateServerSide && a.$members$ && Object.entries(a.$members$).map((([t, [a]]) => {
  615. if (31 & a && e.hasOwnProperty(t)) {
  616. const a = e[t];
  617. delete e[t], e[t] = a;
  618. }
  619. })), appData.BUILD.initializeNextTick ? nextTick((() => initializeComponent(e, t, a))) : initializeComponent(e, t, a);
  620. }
  621. o();
  622. }
  623. }, setContentReference = e => {
  624. const t = e["s-cr"] = doc.createComment(appData.BUILD.isDebug ? `content-ref (host=${e.localName})` : "");
  625. t["s-cn"] = !0, e.insertBefore(t, e.firstChild);
  626. }, disconnectedCallback = e => {
  627. if (0 == (1 & plt.$flags$)) {
  628. const t = getHostRef(e), a = appData.BUILD.lazyLoad ? t.$lazyInstance$ : e;
  629. appData.BUILD.hostListener && t.$rmListeners$ && (t.$rmListeners$.map((e => e())),
  630. t.$rmListeners$ = void 0), appData.BUILD.cssVarShim && plt.$cssShim$ && plt.$cssShim$.removeHost(e),
  631. appData.BUILD.lazyLoad && appData.BUILD.disconnectedCallback && safeCall(a, "disconnectedCallback"),
  632. appData.BUILD.cmpDidUnload && safeCall(a, "componentDidUnload");
  633. }
  634. }, proxyCustomElement = (e, t) => {
  635. const a = {
  636. $flags$: t[0],
  637. $tagName$: t[1]
  638. };
  639. appData.BUILD.member && (a.$members$ = t[2]), appData.BUILD.hostListener && (a.$listeners$ = t[3]),
  640. appData.BUILD.watchCallback && (a.$watchers$ = e.$watchers$), appData.BUILD.reflect && (a.$attrsToReflect$ = []),
  641. appData.BUILD.shadowDom && !exports.supportsShadow && 1 & a.$flags$ && (a.$flags$ |= 8);
  642. const o = e.prototype.connectedCallback, s = e.prototype.disconnectedCallback;
  643. return Object.assign(e.prototype, {
  644. __registerHost() {
  645. registerHost(this, a);
  646. },
  647. connectedCallback() {
  648. connectedCallback(this), appData.BUILD.connectedCallback && o && o.call(this);
  649. },
  650. disconnectedCallback() {
  651. disconnectedCallback(this), appData.BUILD.disconnectedCallback && s && s.call(this);
  652. },
  653. __attachShadow() {
  654. exports.supportsShadow ? appData.BUILD.shadowDelegatesFocus ? this.attachShadow({
  655. mode: "open",
  656. delegatesFocus: !!(16 & a.$flags$)
  657. }) : this.attachShadow({
  658. mode: "open"
  659. }) : this.shadowRoot = this;
  660. }
  661. }), e.is = a.$tagName$, proxyComponent(e, a, 3);
  662. }, patchCloneNode = e => {
  663. const t = e.cloneNode;
  664. e.cloneNode = function(e) {
  665. const a = this, o = !!appData.BUILD.shadowDom && a.shadowRoot && exports.supportsShadow, s = t.call(a, !!o && e);
  666. if (appData.BUILD.slot && !o && e) {
  667. let e, t, o = 0;
  668. const n = [ "s-id", "s-cr", "s-lr", "s-rc", "s-sc", "s-p", "s-cn", "s-sr", "s-sn", "s-hn", "s-ol", "s-nr", "s-si" ];
  669. for (;o < a.childNodes.length; o++) e = a.childNodes[o]["s-nr"], t = n.every((e => !a.childNodes[o][e])),
  670. e && (appData.BUILD.appendChildSlotFix && s.__appendChild ? s.__appendChild(e.cloneNode(!0)) : s.appendChild(e.cloneNode(!0))),
  671. t && s.appendChild(a.childNodes[o].cloneNode(!0));
  672. }
  673. return s;
  674. };
  675. }, patchSlotAppendChild = e => {
  676. e.__appendChild = e.appendChild, e.appendChild = function(e) {
  677. const t = e["s-sn"] = getSlotName(e), a = getHostSlotNode(this.childNodes, t);
  678. if (a) {
  679. const o = getHostSlotChildNodes(a, t), s = o[o.length - 1];
  680. return s.parentNode.insertBefore(e, s.nextSibling);
  681. }
  682. return this.__appendChild(e);
  683. };
  684. }, patchTextContent = (e, t) => {
  685. if (appData.BUILD.scoped && 2 & t.$flags$) {
  686. const t = Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
  687. Object.defineProperty(e, "__textContent", t), Object.defineProperty(e, "textContent", {
  688. get() {
  689. var e;
  690. const t = getHostSlotNode(this.childNodes, "");
  691. return 3 === (null === (e = null == t ? void 0 : t.nextSibling) || void 0 === e ? void 0 : e.nodeType) ? t.nextSibling.textContent : t ? t.textContent : this.__textContent;
  692. },
  693. set(e) {
  694. var t;
  695. const a = getHostSlotNode(this.childNodes, "");
  696. if (3 === (null === (t = null == a ? void 0 : a.nextSibling) || void 0 === t ? void 0 : t.nodeType)) a.nextSibling.textContent = e; else if (a) a.textContent = e; else {
  697. this.__textContent = e;
  698. const t = this["s-cr"];
  699. t && this.insertBefore(t, this.firstChild);
  700. }
  701. }
  702. });
  703. }
  704. }, patchChildSlotNodes = (e, t) => {
  705. class a extends Array {
  706. item(e) {
  707. return this[e];
  708. }
  709. }
  710. if (8 & t.$flags$) {
  711. const t = e.__lookupGetter__("childNodes");
  712. Object.defineProperty(e, "children", {
  713. get() {
  714. return this.childNodes.map((e => 1 === e.nodeType));
  715. }
  716. }), Object.defineProperty(e, "childElementCount", {
  717. get: () => e.children.length
  718. }), Object.defineProperty(e, "childNodes", {
  719. get() {
  720. const e = t.call(this);
  721. if (0 == (1 & plt.$flags$) && 2 & getHostRef(this).$flags$) {
  722. const t = new a;
  723. for (let a = 0; a < e.length; a++) {
  724. const o = e[a]["s-nr"];
  725. o && t.push(o);
  726. }
  727. return t;
  728. }
  729. return a.from(e);
  730. }
  731. });
  732. }
  733. }, getSlotName = e => e["s-sn"] || 1 === e.nodeType && e.getAttribute("slot") || "", getHostSlotNode = (e, t) => {
  734. let a, o = 0;
  735. for (;o < e.length; o++) {
  736. if (a = e[o], a["s-sr"] && a["s-sn"] === t) return a;
  737. if (a = getHostSlotNode(a.childNodes, t), a) return a;
  738. }
  739. return null;
  740. }, getHostSlotChildNodes = (e, t) => {
  741. const a = [ e ];
  742. for (;(e = e.nextSibling) && e["s-sn"] === t; ) a.push(e);
  743. return a;
  744. }, addHostEventListeners = (e, t, a, o) => {
  745. appData.BUILD.hostListener && a && (appData.BUILD.hostListenerTargetParent && (a = o ? a.filter((([e]) => 32 & e)) : a.filter((([e]) => !(32 & e)))),
  746. a.map((([a, o, s]) => {
  747. const n = appData.BUILD.hostListenerTarget ? getHostListenerTarget(e, a) : e, l = hostListenerProxy(t, s), r = hostListenerOpts(a);
  748. plt.ael(n, o, l, r), (t.$rmListeners$ = t.$rmListeners$ || []).push((() => plt.rel(n, o, l, r)));
  749. })));
  750. }, hostListenerProxy = (e, t) => a => {
  751. try {
  752. appData.BUILD.lazyLoad ? 256 & e.$flags$ ? e.$lazyInstance$[t](a) : (e.$queuedListeners$ = e.$queuedListeners$ || []).push([ t, a ]) : e.$hostElement$[t](a);
  753. } catch (e) {
  754. consoleError(e);
  755. }
  756. }, getHostListenerTarget = (e, t) => appData.BUILD.hostListenerTargetDocument && 4 & t ? doc : appData.BUILD.hostListenerTargetWindow && 8 & t ? win : appData.BUILD.hostListenerTargetBody && 16 & t ? doc.body : appData.BUILD.hostListenerTargetParent && 32 & t ? e.parentElement : e, hostListenerOpts = e => ({
  757. passive: 0 != (1 & e),
  758. capture: 0 != (2 & e)
  759. }), parseVNodeAnnotations = (e, t, a, o) => {
  760. null != t && (null != t["s-nr"] && o.push(t), 1 === t.nodeType && t.childNodes.forEach((t => {
  761. const s = getHostRef(t);
  762. if (null != s && !a.staticComponents.has(t.nodeName.toLowerCase())) {
  763. const o = {
  764. nodeIds: 0
  765. };
  766. insertVNodeAnnotations(e, t, s.$vnode$, a, o);
  767. }
  768. parseVNodeAnnotations(e, t, a, o);
  769. })));
  770. }, insertVNodeAnnotations = (e, t, a, o, s) => {
  771. if (null != a) {
  772. const n = ++o.hostIds;
  773. if (t.setAttribute("s-id", n), null != t["s-cr"] && (t["s-cr"].nodeValue = `r.${n}`),
  774. null != a.$children$) {
  775. const t = 0;
  776. a.$children$.forEach(((a, o) => {
  777. insertChildVNodeAnnotations(e, a, s, n, t, o);
  778. }));
  779. }
  780. if (t && a && a.$elm$ && !t.hasAttribute("c-id")) {
  781. const e = t.parentElement;
  782. if (e && e.childNodes) {
  783. const o = Array.from(e.childNodes), s = o.find((e => 8 === e.nodeType && e["s-sr"]));
  784. if (s) {
  785. const e = o.indexOf(t) - 1;
  786. a.$elm$.setAttribute("c-id", `${s["s-host-id"]}.${s["s-node-id"]}.0.${e}`);
  787. }
  788. }
  789. }
  790. }
  791. }, insertChildVNodeAnnotations = (e, t, a, o, s, n) => {
  792. const l = t.$elm$;
  793. if (null == l) return;
  794. const r = a.nodeIds++, p = `${o}.${r}.${s}.${n}`;
  795. if (l["s-host-id"] = o, l["s-node-id"] = r, 1 === l.nodeType) l.setAttribute("c-id", p); else if (3 === l.nodeType) {
  796. const t = l.parentNode, a = t.nodeName;
  797. if ("STYLE" !== a && "SCRIPT" !== a) {
  798. const a = `t.${p}`, o = e.createComment(a);
  799. t.insertBefore(o, l);
  800. }
  801. } else if (8 === l.nodeType && l["s-sr"]) {
  802. const e = `s.${p}.${l["s-sn"] || ""}`;
  803. l.nodeValue = e;
  804. }
  805. if (null != t.$children$) {
  806. const n = s + 1;
  807. t.$children$.forEach(((t, s) => {
  808. insertChildVNodeAnnotations(e, t, a, o, n, s);
  809. }));
  810. }
  811. }, getHostRef = e => hostRefs.get(e), registerHost = (e, t) => {
  812. const a = {
  813. $flags$: 0,
  814. $hostElement$: e,
  815. $cmpMeta$: t,
  816. $instanceValues$: new Map,
  817. $renderCount$: 0
  818. };
  819. a.$onInstancePromise$ = new Promise((e => a.$onInstanceResolve$ = e)), a.$onReadyPromise$ = new Promise((e => a.$onReadyResolve$ = e)),
  820. e["s-p"] = [], e["s-rc"] = [], addHostEventListeners(e, a, t.$listeners$, !1), hostRefs.set(e, a);
  821. };
  822. let customError;
  823. const defaultConsoleError = e => {
  824. caughtErrors.push(e);
  825. }, consoleError = (e, t) => (customError || defaultConsoleError)(e, t), consoleDevError = (...e) => {
  826. caughtErrors.push(new Error(e.join(", ")));
  827. }, consoleDevWarn = (...e) => {
  828. const t = e.filter((e => "string" == typeof e || "number" == typeof e || "boolean" == typeof e));
  829. console.warn(...t);
  830. }, nextTick = e => {
  831. queuedTicks.push(e);
  832. }, win = mockDoc.setupGlobal(global), doc = win.document;
  833. exports.supportsShadow = !0;
  834. const plt = {
  835. $flags$: 0,
  836. $resourcesUrl$: "",
  837. jmp: e => e(),
  838. raf: e => requestAnimationFrame(e),
  839. ael: (e, t, a, o) => e.addEventListener(t, a, o),
  840. rel: (e, t, a, o) => e.removeEventListener(t, a, o),
  841. ce: (e, t) => new win.CustomEvent(e, t)
  842. }, Context = {};
  843. let autoApplyTimer, isAutoApplyingChanges = !1;
  844. const isMemberInElement = (e, t) => {
  845. if (null != e) {
  846. if (t in e) return !0;
  847. const a = e.nodeName;
  848. if (a) {
  849. const e = cstrs.get(a.toLowerCase());
  850. if (null != e && null != e.COMPILER_META && null != e.COMPILER_META.properties) return e.COMPILER_META.properties.some((e => e.name === t));
  851. }
  852. }
  853. return !1;
  854. };
  855. Object.defineProperty(exports, "Env", {
  856. enumerable: !0,
  857. get: function() {
  858. return appData.Env;
  859. }
  860. }), exports.Build = {
  861. isDev: !0,
  862. isBrowser: !1,
  863. isServer: !0,
  864. isTesting: !0
  865. }, exports.Context = Context, exports.Fragment = (e, t) => t, exports.Host = Host,
  866. exports.addHostEventListeners = addHostEventListeners, exports.bootstrapLazy = (e, t = {}) => {
  867. appData.BUILD.profile && performance.mark && performance.mark("st:app:start"), (() => {
  868. if (appData.BUILD.devTools) {
  869. const e = win.stencil = win.stencil || {}, t = e.inspect;
  870. e.inspect = e => {
  871. let a = (e => {
  872. const t = getHostRef(e);
  873. if (!t) return;
  874. const a = t.$flags$, o = t.$hostElement$;
  875. return {
  876. renderCount: t.$renderCount$,
  877. flags: {
  878. hasRendered: !!(2 & a),
  879. hasConnected: !!(1 & a),
  880. isWaitingForChildren: !!(4 & a),
  881. isConstructingInstance: !!(8 & a),
  882. isQueuedForUpdate: !!(16 & a),
  883. hasInitializedComponent: !!(32 & a),
  884. hasLoadedComponent: !!(64 & a),
  885. isWatchReady: !!(128 & a),
  886. isListenReady: !!(256 & a),
  887. needsRerender: !!(512 & a)
  888. },
  889. instanceValues: t.$instanceValues$,
  890. ancestorComponent: t.$ancestorComponent$,
  891. hostElement: o,
  892. lazyInstance: t.$lazyInstance$,
  893. vnode: t.$vnode$,
  894. modeName: t.$modeName$,
  895. onReadyPromise: t.$onReadyPromise$,
  896. onReadyResolve: t.$onReadyResolve$,
  897. onInstancePromise: t.$onInstancePromise$,
  898. onInstanceResolve: t.$onInstanceResolve$,
  899. onRenderResolve: t.$onRenderResolve$,
  900. queuedListeners: t.$queuedListeners$,
  901. rmListeners: t.$rmListeners$,
  902. "s-id": o["s-id"],
  903. "s-cr": o["s-cr"],
  904. "s-lr": o["s-lr"],
  905. "s-p": o["s-p"],
  906. "s-rc": o["s-rc"],
  907. "s-sc": o["s-sc"]
  908. };
  909. })(e);
  910. return a || "function" != typeof t || (a = t(e)), a;
  911. };
  912. }
  913. })();
  914. const a = createTime("bootstrapLazy"), o = [], s = t.exclude || [], n = win.customElements, l = doc.head, r = l.querySelector("meta[charset]"), p = doc.createElement("style"), i = [], d = doc.querySelectorAll("[sty-id]");
  915. let c, $ = !0, u = 0;
  916. if (Object.assign(plt, t), plt.$resourcesUrl$ = new URL(t.resourcesUrl || "./", doc.baseURI).href,
  917. appData.BUILD.asyncQueue && t.syncQueue && (plt.$flags$ |= 4), appData.BUILD.hydrateClientSide && (plt.$flags$ |= 2),
  918. appData.BUILD.hydrateClientSide && appData.BUILD.shadowDom) for (;u < d.length; u++) registerStyle(d[u].getAttribute("sty-id"), d[u].innerHTML.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{"));
  919. e.map((e => {
  920. e[1].map((a => {
  921. const l = {
  922. $flags$: a[0],
  923. $tagName$: a[1],
  924. $members$: a[2],
  925. $listeners$: a[3]
  926. };
  927. appData.BUILD.member && (l.$members$ = a[2]), appData.BUILD.hostListener && (l.$listeners$ = a[3]),
  928. appData.BUILD.reflect && (l.$attrsToReflect$ = []), appData.BUILD.watchCallback && (l.$watchers$ = {}),
  929. appData.BUILD.shadowDom && !exports.supportsShadow && 1 & l.$flags$ && (l.$flags$ |= 8);
  930. const r = appData.BUILD.transformTagName && t.transformTagName ? t.transformTagName(l.$tagName$) : l.$tagName$, p = class extends HTMLElement {
  931. constructor(e) {
  932. super(e), registerHost(e = this, l), appData.BUILD.shadowDom && 1 & l.$flags$ && (exports.supportsShadow ? appData.BUILD.shadowDelegatesFocus ? e.attachShadow({
  933. mode: "open",
  934. delegatesFocus: !!(16 & l.$flags$)
  935. }) : e.attachShadow({
  936. mode: "open"
  937. }) : appData.BUILD.hydrateServerSide || "shadowRoot" in e || (e.shadowRoot = e)),
  938. appData.BUILD.slotChildNodesFix && patchChildSlotNodes(e, l);
  939. }
  940. connectedCallback() {
  941. c && (clearTimeout(c), c = null), $ ? i.push(this) : plt.jmp((() => connectedCallback(this)));
  942. }
  943. disconnectedCallback() {
  944. plt.jmp((() => disconnectedCallback(this)));
  945. }
  946. componentOnReady() {
  947. return getHostRef(this).$onReadyPromise$;
  948. }
  949. };
  950. appData.BUILD.cloneNodeFix && patchCloneNode(p.prototype), appData.BUILD.appendChildSlotFix && patchSlotAppendChild(p.prototype),
  951. appData.BUILD.hotModuleReplacement && (p.prototype["s-hmr"] = function(e) {
  952. ((e, t, a) => {
  953. const o = getHostRef(e);
  954. o.$flags$ = 1, e["s-hmr-load"] = () => {
  955. delete e["s-hmr-load"];
  956. }, initializeComponent(e, o, t);
  957. })(this, l);
  958. }), appData.BUILD.scopedSlotTextContentFix && patchTextContent(p.prototype, l),
  959. l.$lazyBundleId$ = e[0], s.includes(r) || n.get(r) || (o.push(r), n.define(r, proxyComponent(p, l, 1)));
  960. }));
  961. })), appData.BUILD.invisiblePrehydration && (appData.BUILD.hydratedClass || appData.BUILD.hydratedAttribute) && (p.innerHTML = o + "{visibility:hidden}.hydrated{visibility:inherit}",
  962. p.setAttribute("data-styles", ""), l.insertBefore(p, r ? r.nextSibling : l.firstChild)),
  963. $ = !1, i.length ? i.map((e => e.connectedCallback())) : appData.BUILD.profile ? plt.jmp((() => c = setTimeout(appDidLoad, 30, "timeout"))) : plt.jmp((() => c = setTimeout(appDidLoad, 30))),
  964. a();
  965. }, exports.connectedCallback = connectedCallback, exports.consoleDevError = consoleDevError,
  966. exports.consoleDevInfo = (...e) => {}, exports.consoleDevWarn = consoleDevWarn,
  967. exports.consoleError = consoleError, exports.createEvent = (e, t, a) => {
  968. const o = getElement(e);
  969. return {
  970. emit: e => (appData.BUILD.isDev && !o.isConnected && consoleDevWarn(`The "${t}" event was emitted, but the dispatcher node is no longer connected to the dom.`),
  971. emitEvent(o, t, {
  972. bubbles: !!(4 & a),
  973. composed: !!(2 & a),
  974. cancelable: !!(1 & a),
  975. detail: e
  976. }))
  977. };
  978. }, exports.defineCustomElement = (e, t) => {
  979. customElements.define(t[1], proxyCustomElement(e, t));
  980. }, exports.disconnectedCallback = disconnectedCallback, exports.doc = doc, exports.flushAll = flushAll,
  981. exports.flushLoadModule = flushLoadModule, exports.flushQueue = flushQueue, exports.forceModeUpdate = e => {
  982. if (appData.BUILD.style && appData.BUILD.mode && !appData.BUILD.lazyLoad) {
  983. const t = computeMode(e), a = getHostRef(e);
  984. if (a.$modeName$ !== t) {
  985. const o = a.$cmpMeta$, s = e["s-sc"], n = getScopeId(o, t), l = e.constructor.style[t];
  986. o.$flags$, l && (styles.has(n) || registerStyle(n, l), a.$modeName$ = t, e.classList.remove(s + "-h", s + "-s"),
  987. attachStyles(a), forceUpdate(e));
  988. }
  989. }
  990. }, exports.forceUpdate = forceUpdate, exports.getAssetPath = getAssetPath, exports.getConnect = (e, t) => {
  991. const a = () => {
  992. let e = doc.querySelector(t);
  993. return e || (e = doc.createElement(t), doc.body.appendChild(e)), "function" == typeof e.componentOnReady ? e.componentOnReady() : Promise.resolve(e);
  994. };
  995. return {
  996. create: (...e) => a().then((t => t.create(...e))),
  997. componentOnReady: a
  998. };
  999. }, exports.getContext = (e, t) => t in Context ? Context[t] : "window" === t ? win : "document" === t ? doc : "isServer" === t || "isPrerender" === t ? !!appData.BUILD.hydrateServerSide : "isClient" === t ? !appData.BUILD.hydrateServerSide : "resourcesUrl" === t || "publicPath" === t ? getAssetPath(".") : "queue" === t ? {
  1000. write: writeTask,
  1001. read: readTask,
  1002. tick: {
  1003. then: e => nextTick(e)
  1004. }
  1005. } : void 0, exports.getElement = getElement, exports.getHostRef = getHostRef, exports.getMode = e => getHostRef(e).$modeName$,
  1006. exports.getRenderingRef = () => renderingRef, exports.getValue = getValue, exports.h = h,
  1007. exports.insertVdomAnnotations = (e, t) => {
  1008. if (null != e) {
  1009. const a = {
  1010. hostIds: 0,
  1011. rootLevelIds: 0,
  1012. staticComponents: new Set(t)
  1013. }, o = [];
  1014. parseVNodeAnnotations(e, e.body, a, o), o.forEach((t => {
  1015. if (null != t) {
  1016. const o = t["s-nr"];
  1017. let s = o["s-host-id"], n = o["s-node-id"], l = `${s}.${n}`;
  1018. if (null == s) if (s = 0, a.rootLevelIds++, n = a.rootLevelIds, l = `${s}.${n}`,
  1019. 1 === o.nodeType) o.setAttribute("c-id", l); else if (3 === o.nodeType) {
  1020. if (0 === s && "" === o.nodeValue.trim()) return void t.remove();
  1021. const a = e.createComment(l);
  1022. a.nodeValue = `t.${l}`, o.parentNode.insertBefore(a, o);
  1023. }
  1024. let r = `o.${l}`;
  1025. const p = t.parentElement;
  1026. p && ("" === p["s-en"] ? r += "." : "c" === p["s-en"] && (r += ".c")), t.nodeValue = r;
  1027. }
  1028. }));
  1029. }
  1030. }, exports.isMemberInElement = isMemberInElement, exports.loadModule = loadModule,
  1031. exports.modeResolutionChain = modeResolutionChain, exports.nextTick = nextTick,
  1032. exports.parsePropertyValue = parsePropertyValue, exports.plt = plt, exports.postUpdateComponent = postUpdateComponent,
  1033. exports.proxyComponent = proxyComponent, exports.proxyCustomElement = proxyCustomElement,
  1034. exports.readTask = readTask, exports.registerComponents = e => {
  1035. e.forEach((e => {
  1036. cstrs.set(e.COMPILER_META.tagName, e);
  1037. }));
  1038. }, exports.registerContext = function registerContext(e) {
  1039. e && Object.assign(Context, e);
  1040. }, exports.registerHost = registerHost, exports.registerInstance = (e, t) => {
  1041. if (null == e || null == e.constructor) throw new Error("Invalid component constructor");
  1042. if (null == t) {
  1043. const a = e.constructor, o = a.COMPILER_META && a.COMPILER_META.tagName ? a.COMPILER_META.tagName : "div", s = document.createElement(o);
  1044. registerHost(s, {
  1045. $flags$: 0,
  1046. $tagName$: o
  1047. }), t = getHostRef(s);
  1048. }
  1049. return t.$lazyInstance$ = e, hostRefs.set(e, t);
  1050. }, exports.registerModule = function registerModule(e, t) {
  1051. moduleLoaded.set(e, t);
  1052. }, exports.renderVdom = renderVdom, exports.resetPlatform = function resetPlatform() {
  1053. win && "function" == typeof win.close && win.close(), hostRefs.clear(), styles.clear(),
  1054. plt.$flags$ = 0, Object.keys(Context).forEach((e => delete Context[e])), null != plt.$orgLocNodes$ && (plt.$orgLocNodes$.clear(),
  1055. plt.$orgLocNodes$ = void 0), win.location.href = plt.$resourcesUrl$ = "http://testing.stenciljs.com/",
  1056. function e() {
  1057. queuedTicks.length = 0, queuedWriteTasks.length = 0, queuedReadTasks.length = 0,
  1058. moduleLoaded.clear(), queuedLoadModules.length = 0, caughtErrors.length = 0;
  1059. }(), stopAutoApplyChanges(), cstrs.clear();
  1060. }, exports.setAssetPath = e => plt.$resourcesUrl$ = e, exports.setErrorHandler = e => customError = e,
  1061. exports.setMode = e => modeResolutionChain.push(e), exports.setPlatformHelpers = e => {
  1062. Object.assign(plt, e);
  1063. }, exports.setPlatformOptions = e => Object.assign(plt, e), exports.setSupportsShadowDom = e => {
  1064. exports.supportsShadow = e;
  1065. }, exports.setValue = setValue, exports.startAutoApplyChanges = async function e() {
  1066. isAutoApplyingChanges = !0, flushAll().then((() => {
  1067. isAutoApplyingChanges && (autoApplyTimer = setTimeout((() => {
  1068. e();
  1069. }), 100));
  1070. }));
  1071. }, exports.stopAutoApplyChanges = stopAutoApplyChanges, exports.styles = styles,
  1072. exports.supportsConstructableStylesheets = !1, exports.supportsListenerOptions = !0,
  1073. exports.win = win, exports.writeTask = writeTask;