/*! * (C) Ionic http://ionicframework.com - MIT License */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var stream = require('stream'); function hydrateFactory($stencilWindow, $stencilHydrateOpts, $stencilHydrateResults, $stencilAfterHydrate, $stencilHydrateResolve) { var globalThis = $stencilWindow; var self = $stencilWindow; var top = $stencilWindow; var parent = $stencilWindow; var addEventListener = $stencilWindow.addEventListener.bind($stencilWindow); var alert = $stencilWindow.alert.bind($stencilWindow); var blur = $stencilWindow.blur.bind($stencilWindow); var cancelAnimationFrame = $stencilWindow.cancelAnimationFrame.bind($stencilWindow); var cancelIdleCallback = $stencilWindow.cancelIdleCallback.bind($stencilWindow); var clearInterval = $stencilWindow.clearInterval.bind($stencilWindow); var clearTimeout = $stencilWindow.clearTimeout.bind($stencilWindow); var close = () => {}; var confirm = $stencilWindow.confirm.bind($stencilWindow); var dispatchEvent = $stencilWindow.dispatchEvent.bind($stencilWindow); var focus = $stencilWindow.focus.bind($stencilWindow); var getComputedStyle = $stencilWindow.getComputedStyle.bind($stencilWindow); var matchMedia = $stencilWindow.matchMedia.bind($stencilWindow); var open = $stencilWindow.open.bind($stencilWindow); var prompt = $stencilWindow.prompt.bind($stencilWindow); var removeEventListener = $stencilWindow.removeEventListener.bind($stencilWindow); var requestAnimationFrame = $stencilWindow.requestAnimationFrame.bind($stencilWindow); var requestIdleCallback = $stencilWindow.requestIdleCallback.bind($stencilWindow); var setInterval = $stencilWindow.setInterval.bind($stencilWindow); var setTimeout = $stencilWindow.setTimeout.bind($stencilWindow); var CharacterData = $stencilWindow.CharacterData; var CSS = $stencilWindow.CSS; var CustomEvent = $stencilWindow.CustomEvent; var Document = $stencilWindow.Document; var DocumentFragment = $stencilWindow.DocumentFragment; var DocumentType = $stencilWindow.DocumentType; var DOMTokenList = $stencilWindow.DOMTokenList; var Element = $stencilWindow.Element; var Event = $stencilWindow.Event; var HTMLAnchorElement = $stencilWindow.HTMLAnchorElement; var HTMLBaseElement = $stencilWindow.HTMLBaseElement; var HTMLButtonElement = $stencilWindow.HTMLButtonElement; var HTMLCanvasElement = $stencilWindow.HTMLCanvasElement; var HTMLElement = $stencilWindow.HTMLElement; var HTMLFormElement = $stencilWindow.HTMLFormElement; var HTMLImageElement = $stencilWindow.HTMLImageElement; var HTMLInputElement = $stencilWindow.HTMLInputElement; var HTMLLinkElement = $stencilWindow.HTMLLinkElement; var HTMLMetaElement = $stencilWindow.HTMLMetaElement; var HTMLScriptElement = $stencilWindow.HTMLScriptElement; var HTMLStyleElement = $stencilWindow.HTMLStyleElement; var HTMLTemplateElement = $stencilWindow.HTMLTemplateElement; var HTMLTitleElement = $stencilWindow.HTMLTitleElement; var IntersectionObserver = $stencilWindow.IntersectionObserver; var KeyboardEvent = $stencilWindow.KeyboardEvent; var MouseEvent = $stencilWindow.MouseEvent; var Node = $stencilWindow.Node; var NodeList = $stencilWindow.NodeList; var URL = $stencilWindow.URL; var console = $stencilWindow.console; var customElements = $stencilWindow.customElements; var history = $stencilWindow.history; var localStorage = $stencilWindow.localStorage; var location = $stencilWindow.location; var navigator = $stencilWindow.navigator; var performance = $stencilWindow.performance; var sessionStorage = $stencilWindow.sessionStorage; var devicePixelRatio = $stencilWindow.devicePixelRatio; var innerHeight = $stencilWindow.innerHeight; var innerWidth = $stencilWindow.innerWidth; var origin = $stencilWindow.origin; var pageXOffset = $stencilWindow.pageXOffset; var pageYOffset = $stencilWindow.pageYOffset; var screen = $stencilWindow.screen; var screenLeft = $stencilWindow.screenLeft; var screenTop = $stencilWindow.screenTop; var screenX = $stencilWindow.screenX; var screenY = $stencilWindow.screenY; var scrollX = $stencilWindow.scrollX; var scrollY = $stencilWindow.scrollY; var exports = {}; var fetch, FetchError, Headers, Request, Response; if (typeof $stencilWindow.fetch === 'function') { fetch = $stencilWindow.fetch; } else { fetch = $stencilWindow.fetch = function() { throw new Error('fetch() is not implemented'); }; } if (typeof $stencilWindow.FetchError === 'function') { FetchError = $stencilWindow.FetchError; } else { FetchError = $stencilWindow.FetchError = class FetchError { constructor() { throw new Error('FetchError is not implemented'); } }; } if (typeof $stencilWindow.Headers === 'function') { Headers = $stencilWindow.Headers; } else { Headers = $stencilWindow.Headers = class Headers { constructor() { throw new Error('Headers is not implemented'); } }; } if (typeof $stencilWindow.Request === 'function') { Request = $stencilWindow.Request; } else { Request = $stencilWindow.Request = class Request { constructor() { throw new Error('Request is not implemented'); } }; } if (typeof $stencilWindow.Response === 'function') { Response = $stencilWindow.Response; } else { Response = $stencilWindow.Response = class Response { constructor() { throw new Error('Response is not implemented'); } }; } function hydrateAppClosure($stencilWindow) { const window = $stencilWindow; const document = $stencilWindow.document; /*hydrateAppClosure start*/ const NAMESPACE = 'ionic'; const BUILD = /* ionic */ { allRenderFn: false, appendChildSlotFix: false, asyncLoading: true, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: true, constructableCSS: false, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: true, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: true, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: true, scopedSlotTextContentFix: true, scriptDataOpts: false, shadowDelegatesFocus: true, shadowDom: true, shadowDomShim: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true }; /* Stencil Hydrate Platform v4.20.0 | MIT Licensed | https://stenciljs.com */ var __defProp = Object.defineProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; // src/utils/constants.ts var EMPTY_OBJ = {}; var SVG_NS = "http://www.w3.org/2000/svg"; var HTML_NS = "http://www.w3.org/1999/xhtml"; // src/utils/helpers.ts var isDef = (v) => v != null; var isComplexType = (o) => { o = typeof o; return o === "object" || o === "function"; }; // src/utils/query-nonce-meta-tag-content.ts function queryNonceMetaTagContent(doc2) { var _a, _b, _c; 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; } // src/utils/result.ts var result_exports = {}; __export(result_exports, { err: () => err, map: () => map, ok: () => ok, unwrap: () => unwrap, unwrapErr: () => unwrapErr }); var ok = (value) => ({ isOk: true, isErr: false, value }); var err = (value) => ({ isOk: false, isErr: true, value }); function map(result, fn) { if (result.isOk) { const val = fn(result.value); if (val instanceof Promise) { return val.then((newVal) => ok(newVal)); } else { return ok(val); } } if (result.isErr) { const value = result.value; return err(value); } throw "should never get here"; } var unwrap = (result) => { if (result.isOk) { return result.value; } else { throw result.value; } }; var unwrapErr = (result) => { if (result.isErr) { return result.value; } else { throw result.value; } }; var createTime = (fnName, tagName = "") => { { return () => { return; }; } }; var uniqueTime = (key, measureText) => { { return () => { return; }; } }; // src/runtime/runtime-constants.ts var CONTENT_REF_ID = "r"; var ORG_LOCATION_ID = "o"; var SLOT_NODE_ID = "s"; var TEXT_NODE_ID = "t"; var HYDRATE_ID = "s-id"; var HYDRATED_STYLE_ID = "sty-id"; var HYDRATE_CHILD_ID = "c-id"; var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}"; var XLINK_NS = "http://www.w3.org/1999/xlink"; var h = (nodeName, vnodeData, ...children) => { let child = null; let key = null; let slotName = null; let simple = false; let lastSimple = false; const vNodeChildren = []; const walk = (c) => { for (let i2 = 0; i2 < c.length; i2++) { child = c[i2]; if (Array.isArray(child)) { walk(child); } else if (child != null && typeof child !== "boolean") { if (simple = typeof nodeName !== "function" && !isComplexType(child)) { child = String(child); } if (simple && lastSimple) { vNodeChildren[vNodeChildren.length - 1].$text$ += child; } else { vNodeChildren.push(simple ? newVNode(null, child) : child); } lastSimple = simple; } } }; walk(children); if (vnodeData) { if (vnodeData.key) { key = vnodeData.key; } if (vnodeData.name) { slotName = vnodeData.name; } { const classData = vnodeData.className || vnodeData.class; if (classData) { vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" "); } } } if (typeof nodeName === "function") { return nodeName( vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils ); } const vnode = newVNode(nodeName, null); vnode.$attrs$ = vnodeData; if (vNodeChildren.length > 0) { vnode.$children$ = vNodeChildren; } { vnode.$key$ = key; } { vnode.$name$ = slotName; } return vnode; }; var newVNode = (tag, text) => { const vnode = { $flags$: 0, $tag$: tag, $text$: text, $elm$: null, $children$: null }; { vnode.$attrs$ = null; } { vnode.$key$ = null; } { vnode.$name$ = null; } return vnode; }; var Host = {}; var isHost = (node) => node && node.$tag$ === Host; var vdomFnUtils = { forEach: (children, cb) => children.map(convertToPublic).forEach(cb), map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate) }; var convertToPublic = (node) => ({ vattrs: node.$attrs$, vchildren: node.$children$, vkey: node.$key$, vname: node.$name$, vtag: node.$tag$, vtext: node.$text$ }); var convertToPrivate = (node) => { if (typeof node.vtag === "function") { const vnodeData = { ...node.vattrs }; if (node.vkey) { vnodeData.key = node.vkey; } if (node.vname) { vnodeData.name = node.vname; } return h(node.vtag, vnodeData, ...node.vchildren || []); } const vnode = newVNode(node.vtag, node.vtext); vnode.$attrs$ = node.vattrs; vnode.$children$ = node.vchildren; vnode.$key$ = node.vkey; vnode.$name$ = node.vname; return vnode; }; // src/runtime/client-hydrate.ts var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => { const endHydrate = createTime("hydrateClient", tagName); const shadowRoot = hostElm.shadowRoot; const childRenderNodes = []; const slotNodes = []; const shadowRootNodes = shadowRoot ? [] : null; const vnode = hostRef.$vnode$ = newVNode(tagName, null); if (!plt.$orgLocNodes$) { initializeDocumentHydrate(doc$1.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map()); } hostElm[HYDRATE_ID] = hostId; hostElm.removeAttribute(HYDRATE_ID); clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId); childRenderNodes.map((c) => { const orgLocationId = c.$hostId$ + "." + c.$nodeId$; const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId); const node = c.$elm$; if (orgLocationNode && supportsShadow && orgLocationNode["s-en"] === "") { orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling); } if (!shadowRoot) { node["s-hn"] = tagName; if (orgLocationNode) { node["s-ol"] = orgLocationNode; node["s-ol"]["s-nr"] = node; } } plt.$orgLocNodes$.delete(orgLocationId); }); if (shadowRoot) { shadowRootNodes.map((shadowRootNode) => { if (shadowRootNode) { shadowRoot.appendChild(shadowRootNode); } }); } endHydrate(); }; var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => { let childNodeType; let childIdSplt; let childVNode; let i2; if (node.nodeType === 1 /* ElementNode */) { childNodeType = node.getAttribute(HYDRATE_CHILD_ID); if (childNodeType) { childIdSplt = childNodeType.split("."); if (childIdSplt[0] === hostId || childIdSplt[0] === "0") { childVNode = { $flags$: 0, $hostId$: childIdSplt[0], $nodeId$: childIdSplt[1], $depth$: childIdSplt[2], $index$: childIdSplt[3], $tag$: node.tagName.toLowerCase(), $elm$: node, $attrs$: null, $children$: null, $key$: null, $name$: null, $text$: null }; childRenderNodes.push(childVNode); node.removeAttribute(HYDRATE_CHILD_ID); if (!parentVNode.$children$) { parentVNode.$children$ = []; } parentVNode.$children$[childVNode.$index$] = childVNode; parentVNode = childVNode; if (shadowRootNodes && childVNode.$depth$ === "0") { shadowRootNodes[childVNode.$index$] = childVNode.$elm$; } } } if (node.shadowRoot) { for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) { clientHydrate( parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i2], hostId ); } } for (i2 = node.childNodes.length - 1; i2 >= 0; i2--) { clientHydrate( parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i2], hostId ); } } else if (node.nodeType === 8 /* CommentNode */) { childIdSplt = node.nodeValue.split("."); if (childIdSplt[1] === hostId || childIdSplt[1] === "0") { childNodeType = childIdSplt[0]; childVNode = { $flags$: 0, $hostId$: childIdSplt[1], $nodeId$: childIdSplt[2], $depth$: childIdSplt[3], $index$: childIdSplt[4], $elm$: node, $attrs$: null, $children$: null, $key$: null, $name$: null, $tag$: null, $text$: null }; if (childNodeType === TEXT_NODE_ID) { childVNode.$elm$ = node.nextSibling; if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) { childVNode.$text$ = childVNode.$elm$.textContent; childRenderNodes.push(childVNode); node.remove(); if (!parentVNode.$children$) { parentVNode.$children$ = []; } parentVNode.$children$[childVNode.$index$] = childVNode; if (shadowRootNodes && childVNode.$depth$ === "0") { shadowRootNodes[childVNode.$index$] = childVNode.$elm$; } } } else if (childVNode.$hostId$ === hostId) { if (childNodeType === SLOT_NODE_ID) { childVNode.$tag$ = "slot"; if (childIdSplt[5]) { node["s-sn"] = childVNode.$name$ = childIdSplt[5]; } else { node["s-sn"] = ""; } node["s-sr"] = true; if (shadowRootNodes) { childVNode.$elm$ = doc$1.createElement(childVNode.$tag$); if (childVNode.$name$) { childVNode.$elm$.setAttribute("name", childVNode.$name$); } node.parentNode.insertBefore(childVNode.$elm$, node); node.remove(); if (childVNode.$depth$ === "0") { shadowRootNodes[childVNode.$index$] = childVNode.$elm$; } } slotNodes.push(childVNode); if (!parentVNode.$children$) { parentVNode.$children$ = []; } parentVNode.$children$[childVNode.$index$] = childVNode; } else if (childNodeType === CONTENT_REF_ID) { if (shadowRootNodes) { node.remove(); } else { hostElm["s-cr"] = node; node["s-cn"] = true; } } } } } else if (parentVNode && parentVNode.$tag$ === "style") { const vnode = newVNode(null, node.textContent); vnode.$elm$ = node; vnode.$index$ = "0"; parentVNode.$children$ = [vnode]; } }; var initializeDocumentHydrate = (node, orgLocNodes) => { if (node.nodeType === 1 /* ElementNode */) { let i2 = 0; if (node.shadowRoot) { for (; i2 < node.shadowRoot.childNodes.length; i2++) { initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes); } } for (i2 = 0; i2 < node.childNodes.length; i2++) { initializeDocumentHydrate(node.childNodes[i2], orgLocNodes); } } else if (node.nodeType === 8 /* CommentNode */) { const childIdSplt = node.nodeValue.split("."); if (childIdSplt[0] === ORG_LOCATION_ID) { orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node); node.nodeValue = ""; node["s-en"] = childIdSplt[3]; } } }; // src/runtime/mode.ts var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m); var getMode = (ref) => getHostRef(ref).$modeName$; var parsePropertyValue = (propValue, propType) => { if (propValue != null && !isComplexType(propValue)) { if (propType & 4 /* Boolean */) { return propValue === "false" ? false : propValue === "" || !!propValue; } if (propType & 2 /* Number */) { return parseFloat(propValue); } if (propType & 1 /* String */) { return String(propValue); } return propValue; } return propValue; }; var getElement = (ref) => getHostRef(ref).$hostElement$ ; // src/runtime/event-emitter.ts var createEvent = (ref, name, flags) => { const elm = getElement(ref); return { emit: (detail) => { return emitEvent(elm, name, { bubbles: !!(flags & 4 /* Bubbles */), composed: !!(flags & 2 /* Composed */), cancelable: !!(flags & 1 /* Cancellable */), detail }); } }; }; var emitEvent = (elm, name, opts) => { const ev = plt.ce(name, opts); elm.dispatchEvent(ev); return ev; }; var rootAppliedStyles = /* @__PURE__ */ new WeakMap(); var registerStyle = (scopeId2, cssText, allowCS) => { let style = styles.get(scopeId2); { style = cssText; } styles.set(scopeId2, style); }; var addStyle = (styleContainerNode, cmpMeta, mode) => { var _a; const scopeId2 = getScopeId(cmpMeta, mode); const style = styles.get(scopeId2); styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc$1; if (style) { if (typeof style === "string") { styleContainerNode = styleContainerNode.head || styleContainerNode; let appliedStyles = rootAppliedStyles.get(styleContainerNode); let styleElm; if (!appliedStyles) { rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set()); } if (!appliedStyles.has(scopeId2)) { if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) { styleElm.innerHTML = style; } else { styleElm = doc$1.createElement("style"); styleElm.innerHTML = style; const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc$1); if (nonce != null) { styleElm.setAttribute("nonce", nonce); } if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) { styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2); } const injectStyle = ( /** * we render a scoped component */ !(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) || /** * we are using shadow dom and render the style tag within the shadowRoot */ cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD" ); if (injectStyle) { styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link")); } } if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) { styleElm.innerHTML += SLOT_FB_CSS; } if (appliedStyles) { appliedStyles.add(scopeId2); } } } } return scopeId2; }; var attachStyles = (hostRef) => { const cmpMeta = hostRef.$cmpMeta$; const elm = hostRef.$hostElement$; const flags = cmpMeta.$flags$; const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$); const scopeId2 = addStyle( elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$ ); if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) { elm["s-sc"] = scopeId2; elm.classList.add(scopeId2 + "-h"); if (flags & 2 /* scopedCssEncapsulation */) { elm.classList.add(scopeId2 + "-s"); } } endAttachStyles(); }; var getScopeId = (cmp, mode) => "sc-" + (mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$); var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => { if (oldValue !== newValue) { let isProp = isMemberInElement(elm, memberName); let ln = memberName.toLowerCase(); if (memberName === "class") { const classList = elm.classList; const oldClasses = parseClassList(oldValue); const newClasses = parseClassList(newValue); classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c))); classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c))); } else if (memberName === "style") { { for (const prop in oldValue) { if (!newValue || newValue[prop] == null) { { elm.style[prop] = ""; } } } } for (const prop in newValue) { if (!oldValue || newValue[prop] !== oldValue[prop]) { { elm.style[prop] = newValue[prop]; } } } } else if (memberName === "key") ; else if (memberName === "ref") { if (newValue) { newValue(elm); } } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") { if (memberName[2] === "-") { memberName = memberName.slice(3); } else if (isMemberInElement(win$2, ln)) { memberName = ln.slice(2); } else { memberName = ln[2] + memberName.slice(3); } if (oldValue || newValue) { const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX); memberName = memberName.replace(CAPTURE_EVENT_REGEX, ""); if (oldValue) { plt.rel(elm, memberName, oldValue, capture); } if (newValue) { plt.ael(elm, memberName, newValue, capture); } } } else { const isComplex = isComplexType(newValue); if ((isProp || isComplex && newValue !== null) && !isSvg) { try { if (!elm.tagName.includes("-")) { const n = newValue == null ? "" : newValue; if (memberName === "list") { isProp = false; } else if (oldValue == null || elm[memberName] != n) { elm[memberName] = n; } } else { elm[memberName] = newValue; } } catch (e) { } } let xlink = false; { if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) { memberName = ln; xlink = true; } } if (newValue == null || newValue === false) { if (newValue !== false || elm.getAttribute(memberName) === "") { if (xlink) { elm.removeAttributeNS(XLINK_NS, memberName); } else { elm.removeAttribute(memberName); } } } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) { newValue = newValue === true ? "" : newValue; if (xlink) { elm.setAttributeNS(XLINK_NS, memberName, newValue); } else { elm.setAttribute(memberName, newValue); } } } } }; var parseClassListRegex = /\s/; var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex); var CAPTURE_EVENT_SUFFIX = "Capture"; var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$"); // src/runtime/vdom/update-element.ts var updateElement = (oldVnode, newVnode, isSvgMode2) => { const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$; const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ; const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ; { for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) { if (!(memberName in newVnodeAttrs)) { setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$); } } } for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) { setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$); } }; function sortedAttrNames(attrNames) { return attrNames.includes("ref") ? ( // we need to sort these to ensure that `'ref'` is the last attr [...attrNames.filter((attr) => attr !== "ref"), "ref"] ) : ( // no need to sort, return the original array attrNames ); } // src/runtime/vdom/vdom-render.ts var scopeId; var contentRef; var hostTagName; var useNativeShadowDom = false; var checkSlotFallbackVisibility = false; var checkSlotRelocate = false; var isSvgMode = false; var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => { var _a; const newVNode2 = newParentVNode.$children$[childIndex]; let i2 = 0; let elm; let childNode; let oldVNode; if (!useNativeShadowDom) { checkSlotRelocate = true; if (newVNode2.$tag$ === "slot") { if (scopeId) { parentElm.classList.add(scopeId + "-s"); } newVNode2.$flags$ |= newVNode2.$children$ ? ( // slot element has fallback content // still create an element that "mocks" the slot element 2 /* isSlotFallback */ ) : ( // slot element does not have fallback content // create an html comment we'll use to always reference // where actual slot content should sit next to 1 /* isSlotReference */ ); } } if (newVNode2.$text$ !== null) { elm = newVNode2.$elm$ = doc$1.createTextNode(newVNode2.$text$); } else if (newVNode2.$flags$ & 1 /* isSlotReference */) { elm = newVNode2.$elm$ = slotReferenceDebugNode(newVNode2) ; } else { if (!isSvgMode) { isSvgMode = newVNode2.$tag$ === "svg"; } elm = newVNode2.$elm$ = doc$1.createElementNS( isSvgMode ? SVG_NS : HTML_NS, !useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$ ) ; if (isSvgMode && newVNode2.$tag$ === "foreignObject") { isSvgMode = false; } { updateElement(null, newVNode2, isSvgMode); } const rootNode = elm.getRootNode(); const isElementWithinShadowRoot = !rootNode.querySelector("body"); if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) { elm.classList.add(elm["s-si"] = scopeId); } { updateElementScopeIds(elm, parentElm); } if (newVNode2.$children$) { for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) { childNode = createElm(oldParentVNode, newVNode2, i2, elm); if (childNode) { elm.appendChild(childNode); } } } { if (newVNode2.$tag$ === "svg") { isSvgMode = false; } else if (elm.tagName === "foreignObject") { isSvgMode = true; } } } elm["s-hn"] = hostTagName; { if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) { elm["s-sr"] = true; elm["s-cr"] = contentRef; elm["s-sn"] = newVNode2.$name$ || ""; elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref; oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex]; if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) { { putBackInOriginalLocation(oldParentVNode.$elm$, false); } } } } return elm; }; var putBackInOriginalLocation = (parentElm, recursive) => { plt.$flags$ |= 1 /* isTmpDisconnected */; const oldSlotChildNodes = Array.from(parentElm.childNodes); if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) { let node = parentElm; while (node = node.nextSibling) { if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) { oldSlotChildNodes.push(node); } } } for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) { const childNode = oldSlotChildNodes[i2]; if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) { insertBefore(parentReferenceNode(childNode), childNode, referenceNode(childNode)); childNode["s-ol"].remove(); childNode["s-ol"] = void 0; childNode["s-sh"] = void 0; checkSlotRelocate = true; } if (recursive) { putBackInOriginalLocation(childNode, recursive); } } plt.$flags$ &= ~1 /* isTmpDisconnected */; }; var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => { let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm; let childNode; if (containerElm.shadowRoot && containerElm.tagName === hostTagName) { containerElm = containerElm.shadowRoot; } for (; startIdx <= endIdx; ++startIdx) { if (vnodes[startIdx]) { childNode = createElm(null, parentVNode, startIdx, parentElm); if (childNode) { vnodes[startIdx].$elm$ = childNode; insertBefore(containerElm, childNode, referenceNode(before) ); } } } }; var removeVnodes = (vnodes, startIdx, endIdx) => { for (let index = startIdx; index <= endIdx; ++index) { const vnode = vnodes[index]; if (vnode) { const elm = vnode.$elm$; nullifyVNodeRefs(vnode); if (elm) { { checkSlotFallbackVisibility = true; if (elm["s-ol"]) { elm["s-ol"].remove(); } else { putBackInOriginalLocation(elm, true); } } elm.remove(); } } } }; var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => { let oldStartIdx = 0; let newStartIdx = 0; let idxInOld = 0; let i2 = 0; let oldEndIdx = oldCh.length - 1; let oldStartVnode = oldCh[0]; let oldEndVnode = oldCh[oldEndIdx]; let newEndIdx = newCh.length - 1; let newStartVnode = newCh[0]; let newEndVnode = newCh[newEndIdx]; let node; let elmToMove; while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { if (oldStartVnode == null) { oldStartVnode = oldCh[++oldStartIdx]; } else if (oldEndVnode == null) { oldEndVnode = oldCh[--oldEndIdx]; } else if (newStartVnode == null) { newStartVnode = newCh[++newStartIdx]; } else if (newEndVnode == null) { newEndVnode = newCh[--newEndIdx]; } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) { patch(oldStartVnode, newStartVnode, isInitialRender); oldStartVnode = oldCh[++oldStartIdx]; newStartVnode = newCh[++newStartIdx]; } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) { patch(oldEndVnode, newEndVnode, isInitialRender); oldEndVnode = oldCh[--oldEndIdx]; newEndVnode = newCh[--newEndIdx]; } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) { if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) { putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false); } patch(oldStartVnode, newEndVnode, isInitialRender); insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling); oldStartVnode = oldCh[++oldStartIdx]; newEndVnode = newCh[--newEndIdx]; } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) { if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) { putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false); } patch(oldEndVnode, newStartVnode, isInitialRender); insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$); oldEndVnode = oldCh[--oldEndIdx]; newStartVnode = newCh[++newStartIdx]; } else { idxInOld = -1; { for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) { if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) { idxInOld = i2; break; } } } if (idxInOld >= 0) { elmToMove = oldCh[idxInOld]; if (elmToMove.$tag$ !== newStartVnode.$tag$) { node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm); } else { patch(elmToMove, newStartVnode, isInitialRender); oldCh[idxInOld] = void 0; node = elmToMove.$elm$; } newStartVnode = newCh[++newStartIdx]; } else { node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx, parentElm); newStartVnode = newCh[++newStartIdx]; } if (node) { { insertBefore(parentReferenceNode(oldStartVnode.$elm$), node, referenceNode(oldStartVnode.$elm$)); } } } } if (oldStartIdx > oldEndIdx) { addVnodes( parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode2, newCh, newStartIdx, newEndIdx ); } else if (newStartIdx > newEndIdx) { removeVnodes(oldCh, oldStartIdx, oldEndIdx); } }; var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => { if (leftVNode.$tag$ === rightVNode.$tag$) { if (leftVNode.$tag$ === "slot") { if ( // The component gets hydrated and no VDOM has been initialized. // Here the comparison can't happen as $name$ property is not set for `leftNode`. "$nodeId$" in leftVNode && isInitialRender && // `leftNode` is not from type HTMLComment which would cause many // hydration comments to be removed leftVNode.$elm$.nodeType !== 8 ) { return false; } return leftVNode.$name$ === rightVNode.$name$; } if (!isInitialRender) { return leftVNode.$key$ === rightVNode.$key$; } return true; } return false; }; var referenceNode = (node) => { return node && node["s-ol"] || node; }; var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode; var patch = (oldVNode, newVNode2, isInitialRender = false) => { const elm = newVNode2.$elm$ = oldVNode.$elm$; const oldChildren = oldVNode.$children$; const newChildren = newVNode2.$children$; const tag = newVNode2.$tag$; const text = newVNode2.$text$; let defaultHolder; if (text === null) { { isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode; } { if (tag === "slot" && !useNativeShadowDom) ; else { updateElement(oldVNode, newVNode2, isSvgMode); } } if (oldChildren !== null && newChildren !== null) { updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender); } else if (newChildren !== null) { if (oldVNode.$text$ !== null) { elm.textContent = ""; } addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1); } else if ( // don't do this on initial render as it can cause non-hydrated content to be removed !isInitialRender && BUILD.updatable && oldChildren !== null ) { removeVnodes(oldChildren, 0, oldChildren.length - 1); } if (isSvgMode && tag === "svg") { isSvgMode = false; } } else if ((defaultHolder = elm["s-cr"])) { defaultHolder.parentNode.textContent = text; } else if (oldVNode.$text$ !== text) { elm.data = text; } }; var updateFallbackSlotVisibility = (elm) => { const childNodes = elm.childNodes; for (const childNode of childNodes) { if (childNode.nodeType === 1 /* ElementNode */) { if (childNode["s-sr"]) { const slotName = childNode["s-sn"]; childNode.hidden = false; for (const siblingNode of childNodes) { if (siblingNode !== childNode) { if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") { if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) { childNode.hidden = true; break; } } else { if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") { childNode.hidden = true; break; } } } } } updateFallbackSlotVisibility(childNode); } } }; var relocateNodes = []; var markSlotContentForRelocation = (elm) => { let node; let hostContentNodes; let j; for (const childNode of elm.childNodes) { if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) { hostContentNodes = node.parentNode.childNodes; const slotName = childNode["s-sn"]; for (j = hostContentNodes.length - 1; j >= 0; j--) { node = hostContentNodes[j]; if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD.experimentalSlotFixes )) { if (isNodeLocatedInSlot(node, slotName)) { let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node); checkSlotFallbackVisibility = true; node["s-sn"] = node["s-sn"] || slotName; if (relocateNodeData) { relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"]; relocateNodeData.$slotRefNode$ = childNode; } else { node["s-sh"] = childNode["s-hn"]; relocateNodes.push({ $slotRefNode$: childNode, $nodeToRelocate$: node }); } if (node["s-sr"]) { relocateNodes.map((relocateNode) => { if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) { relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node); if (relocateNodeData && !relocateNode.$slotRefNode$) { relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$; } } }); } } else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) { relocateNodes.push({ $nodeToRelocate$: node }); } } } } if (childNode.nodeType === 1 /* ElementNode */) { markSlotContentForRelocation(childNode); } } }; var isNodeLocatedInSlot = (nodeToRelocate, slotName) => { if (nodeToRelocate.nodeType === 1 /* ElementNode */) { if (nodeToRelocate.getAttribute("slot") === null && slotName === "") { return true; } if (nodeToRelocate.getAttribute("slot") === slotName) { return true; } return false; } if (nodeToRelocate["s-sn"] === slotName) { return true; } return slotName === ""; }; var nullifyVNodeRefs = (vNode) => { { vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null); vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs); } }; var insertBefore = (parent, newNode, reference) => { const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference); { updateElementScopeIds(newNode, parent); } return inserted; }; var findScopeIds = (element) => { const scopeIds = []; if (element) { scopeIds.push( ...element["s-scs"] || [], element["s-si"], element["s-sc"], ...findScopeIds(element.parentElement) ); } return scopeIds; }; var updateElementScopeIds = (element, parent, iterateChildNodes = false) => { var _a; if (element && parent && element.nodeType === 1 /* ElementNode */) { const scopeIds = new Set(findScopeIds(parent).filter(Boolean)); if (scopeIds.size) { (_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = [...scopeIds]); if (element["s-ol"] || iterateChildNodes) { for (const childNode of Array.from(element.childNodes)) { updateElementScopeIds(childNode, element, true); } } } } }; var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => { var _a, _b, _c, _d; const hostElm = hostRef.$hostElement$; const cmpMeta = hostRef.$cmpMeta$; const oldVNode = hostRef.$vnode$ || newVNode(null, null); const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults); hostTagName = hostElm.tagName; if (cmpMeta.$attrsToReflect$) { rootVnode.$attrs$ = rootVnode.$attrs$ || {}; cmpMeta.$attrsToReflect$.map( ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName] ); } if (isInitialLoad && rootVnode.$attrs$) { for (const key of Object.keys(rootVnode.$attrs$)) { if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) { rootVnode.$attrs$[key] = hostElm[key]; } } } rootVnode.$tag$ = null; rootVnode.$flags$ |= 4 /* isHost */; hostRef.$vnode$ = rootVnode; rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ; { scopeId = hostElm["s-sc"]; } useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0; { contentRef = hostElm["s-cr"]; checkSlotFallbackVisibility = false; } patch(oldVNode, rootVnode, isInitialLoad); { plt.$flags$ |= 1 /* isTmpDisconnected */; if (checkSlotRelocate) { markSlotContentForRelocation(rootVnode.$elm$); for (const relocateData of relocateNodes) { const nodeToRelocate = relocateData.$nodeToRelocate$; if (!nodeToRelocate["s-ol"]) { const orgLocationNode = originalLocationDebugNode(nodeToRelocate) ; orgLocationNode["s-nr"] = nodeToRelocate; insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate); } } for (const relocateData of relocateNodes) { const nodeToRelocate = relocateData.$nodeToRelocate$; const slotRefNode = relocateData.$slotRefNode$; if (slotRefNode) { const parentNodeRef = slotRefNode.parentNode; let insertBeforeNode = slotRefNode.nextSibling; { let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling; while (orgLocationNode) { let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null; if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === refNode.parentNode) { refNode = refNode.nextSibling; while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) { refNode = refNode == null ? void 0 : refNode.nextSibling; } if (!refNode || !refNode["s-nr"]) { insertBeforeNode = refNode; break; } } orgLocationNode = orgLocationNode.previousSibling; } } if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) { if (nodeToRelocate !== insertBeforeNode) { if (!nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) { nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName; } insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode); if (nodeToRelocate.nodeType === 1 /* ElementNode */) { nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false; } } } nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](nodeToRelocate); } else { if (nodeToRelocate.nodeType === 1 /* ElementNode */) { if (isInitialLoad) { nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false; } nodeToRelocate.hidden = true; } } } } if (checkSlotFallbackVisibility) { updateFallbackSlotVisibility(rootVnode.$elm$); } plt.$flags$ &= ~1 /* isTmpDisconnected */; relocateNodes.length = 0; } contentRef = void 0; }; var slotReferenceDebugNode = (slotVNode) => doc$1.createComment( ` (host=${hostTagName.toLowerCase()})` ); var originalLocationDebugNode = (nodeToRelocate) => doc$1.createComment( `org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`) ); // src/runtime/update-component.ts var attachToAncestor = (hostRef, ancestorComponent) => { if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) { ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r)); } }; var scheduleUpdate = (hostRef, isInitialLoad) => { { hostRef.$flags$ |= 16 /* isQueuedForUpdate */; } if (hostRef.$flags$ & 4 /* isWaitingForChildren */) { hostRef.$flags$ |= 512 /* needsRerender */; return; } attachToAncestor(hostRef, hostRef.$ancestorComponent$); const dispatch = () => dispatchHooks(hostRef, isInitialLoad); return writeTask(dispatch) ; }; var dispatchHooks = (hostRef, isInitialLoad) => { const elm = hostRef.$hostElement$; const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$); const instance = hostRef.$lazyInstance$ ; if (!instance) { throw new Error( `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` ); } let maybePromise; if (isInitialLoad) { { hostRef.$flags$ |= 256 /* isListenReady */; if (hostRef.$queuedListeners$) { hostRef.$queuedListeners$.map(([methodName, event]) => safeCall$1(instance, methodName, event)); hostRef.$queuedListeners$ = void 0; } } { maybePromise = safeCall$1(instance, "componentWillLoad"); } } { maybePromise = enqueue(maybePromise, () => safeCall$1(instance, "componentWillRender")); } endSchedule(); return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad)); }; var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => { console.error(err2); fn(); }) : fn(); var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function"; var updateComponent = async (hostRef, instance, isInitialLoad) => { var _a; const elm = hostRef.$hostElement$; const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$); const rc = elm["s-rc"]; if (isInitialLoad) { attachStyles(hostRef); } const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$); { await callRender(hostRef, instance, elm, isInitialLoad); } { try { serverSideConnected(elm); if (isInitialLoad) { if (hostRef.$cmpMeta$.$flags$ & 1 /* shadowDomEncapsulation */) { elm["s-en"] = ""; } else if (hostRef.$cmpMeta$.$flags$ & 2 /* scopedCssEncapsulation */) { elm["s-en"] = "c"; } } } catch (e) { consoleError(e, elm); } } if (rc) { rc.map((cb) => cb()); elm["s-rc"] = void 0; } endRender(); endUpdate(); { const childrenPromises = (_a = elm["s-p"]) != null ? _a : []; const postUpdate = () => postUpdateComponent(hostRef); if (childrenPromises.length === 0) { postUpdate(); } else { Promise.all(childrenPromises).then(postUpdate); hostRef.$flags$ |= 4 /* isWaitingForChildren */; childrenPromises.length = 0; } } }; var callRender = (hostRef, instance, elm, isInitialLoad) => { try { instance = instance.render && instance.render(); { hostRef.$flags$ &= ~16 /* isQueuedForUpdate */; } { hostRef.$flags$ |= 2 /* hasRendered */; } { { { return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad)); } } } } catch (e) { consoleError(e, hostRef.$hostElement$); } return null; }; var postUpdateComponent = (hostRef) => { const tagName = hostRef.$cmpMeta$.$tagName$; const elm = hostRef.$hostElement$; const endPostUpdate = createTime("postUpdate", tagName); const instance = hostRef.$lazyInstance$ ; const ancestorComponent = hostRef.$ancestorComponent$; { safeCall$1(instance, "componentDidRender"); } if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) { hostRef.$flags$ |= 64 /* hasLoadedComponent */; { addHydratedFlag(elm); } { safeCall$1(instance, "componentDidLoad"); } endPostUpdate(); { hostRef.$onReadyResolve$(elm); if (!ancestorComponent) { appDidLoad(); } } } else { { safeCall$1(instance, "componentDidUpdate"); } endPostUpdate(); } { hostRef.$onInstanceResolve$(elm); } { if (hostRef.$onRenderResolve$) { hostRef.$onRenderResolve$(); hostRef.$onRenderResolve$ = void 0; } if (hostRef.$flags$ & 512 /* needsRerender */) { nextTick(() => scheduleUpdate(hostRef, false)); } hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */); } }; var forceUpdate = (ref) => { return false; }; var appDidLoad = (who) => { { addHydratedFlag(doc$1.documentElement); } nextTick(() => emitEvent(win$2, "appload", { detail: { namespace: NAMESPACE } })); }; var safeCall$1 = (instance, method, arg) => { if (instance && instance[method]) { try { return instance[method](arg); } catch (e) { consoleError(e); } } return void 0; }; var addHydratedFlag = (elm) => { var _a; return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ; }; var serverSideConnected = (elm) => { const children = elm.children; if (children != null) { for (let i2 = 0, ii = children.length; i2 < ii; i2++) { const childElm = children[i2]; if (typeof childElm.connectedCallback === "function") { childElm.connectedCallback(); } serverSideConnected(childElm); } } }; // src/runtime/set-value.ts var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName); var setValue = (ref, propName, newVal, cmpMeta) => { const hostRef = getHostRef(ref); if (!hostRef) { throw new Error( `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).` ); } const elm = hostRef.$hostElement$ ; const oldVal = hostRef.$instanceValues$.get(propName); const flags = hostRef.$flags$; const instance = hostRef.$lazyInstance$ ; newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]); const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal); const didValueChange = newVal !== oldVal && !areBothNaN; if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) { hostRef.$instanceValues$.set(propName, newVal); if (instance) { if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) { const watchMethods = cmpMeta.$watchers$[propName]; if (watchMethods) { watchMethods.map((watchMethodName) => { try { instance[watchMethodName](newVal, oldVal, propName); } catch (e) { consoleError(e, elm); } }); } } if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { scheduleUpdate(hostRef, false); } } } }; // src/runtime/proxy-component.ts var proxyComponent = (Cstr, cmpMeta, flags) => { var _a, _b; const prototype = Cstr.prototype; if (cmpMeta.$members$ || (cmpMeta.$watchers$ || Cstr.watchers)) { if (Cstr.watchers && !cmpMeta.$watchers$) { cmpMeta.$watchers$ = Cstr.watchers; } const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {}); members.map(([memberName, [memberFlags]]) => { if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) { Object.defineProperty(prototype, memberName, { get() { return getValue(this, memberName); }, set(newValue) { setValue(this, memberName, newValue, cmpMeta); }, configurable: true, enumerable: true }); } else if (flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) { Object.defineProperty(prototype, memberName, { value(...args) { var _a2; const ref = getHostRef(this); return (_a2 = ref == null ? void 0 : ref.$onInstancePromise$) == null ? void 0 : _a2.then(() => { var _a3; return (_a3 = ref.$lazyInstance$) == null ? void 0 : _a3[memberName](...args); }); } }); } }); if ((flags & 1 /* isElementConstructor */)) { const attrNameToPropName = /* @__PURE__ */ new Map(); prototype.attributeChangedCallback = function(attrName, oldValue, newValue) { plt.jmp(() => { var _a2; const propName = attrNameToPropName.get(attrName); if (this.hasOwnProperty(propName)) { newValue = this[propName]; delete this[propName]; } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues this[propName] == newValue) { return; } else if (propName == null) { const hostRef = getHostRef(this); const flags2 = hostRef == null ? void 0 : hostRef.$flags$; if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) { const instance = hostRef.$lazyInstance$ ; const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName]; entry == null ? void 0 : entry.forEach((callbackName) => { if (instance[callbackName] != null) { instance[callbackName].call(instance, newValue, oldValue, attrName); } }); } return; } this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue; }); }; Cstr.observedAttributes = Array.from( /* @__PURE__ */ new Set([ ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}), ...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => { var _a2; const attrName = m[1] || propName; attrNameToPropName.set(attrName, propName); if (m[0] & 512 /* ReflectAttr */) { (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]); } return attrName; }) ]) ); } } return Cstr; }; // src/runtime/initialize-component.ts var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => { let Cstr; if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) { hostRef.$flags$ |= 32 /* hasInitializedComponent */; const bundleId = cmpMeta.$lazyBundleId$; if (bundleId) { const CstrImport = loadModule(cmpMeta); if (CstrImport && "then" in CstrImport) { const endLoad = uniqueTime(); Cstr = await CstrImport; endLoad(); } else { Cstr = CstrImport; } if (!Cstr) { throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`); } if (!Cstr.isProxied) { { cmpMeta.$watchers$ = Cstr.watchers; } proxyComponent(Cstr, cmpMeta, 2 /* proxyState */); Cstr.isProxied = true; } const endNewInstance = createTime("createInstance", cmpMeta.$tagName$); { hostRef.$flags$ |= 8 /* isConstructingInstance */; } try { new Cstr(hostRef); } catch (e) { consoleError(e); } { hostRef.$flags$ &= ~8 /* isConstructingInstance */; } { hostRef.$flags$ |= 128 /* isWatchReady */; } endNewInstance(); fireConnectedCallback(hostRef.$lazyInstance$); } else { Cstr = elm.constructor; const cmpTag = elm.localName; customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */); } if (Cstr && Cstr.style) { let style; if (typeof Cstr.style === "string") { style = Cstr.style; } else if (typeof Cstr.style !== "string") { hostRef.$modeName$ = computeMode(elm); if (hostRef.$modeName$) { style = Cstr.style[hostRef.$modeName$]; } if (hostRef.$modeName$) { elm.setAttribute("s-mode", hostRef.$modeName$); } } const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$); if (!styles.has(scopeId2)) { const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$); registerStyle(scopeId2, style); endRegisterStyles(); } } } const ancestorComponent = hostRef.$ancestorComponent$; const schedule = () => scheduleUpdate(hostRef, true); if (ancestorComponent && ancestorComponent["s-rc"]) { ancestorComponent["s-rc"].push(schedule); } else { schedule(); } }; var fireConnectedCallback = (instance) => { { safeCall$1(instance, "connectedCallback"); } }; // src/runtime/connected-callback.ts var connectedCallback = (elm) => { if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { const hostRef = getHostRef(elm); const cmpMeta = hostRef.$cmpMeta$; const endConnected = createTime("connectedCallback", cmpMeta.$tagName$); if (!(hostRef.$flags$ & 1 /* hasConnected */)) { hostRef.$flags$ |= 1 /* hasConnected */; let hostId; { hostId = elm.getAttribute(HYDRATE_ID); if (hostId) { if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { const scopeId2 = addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) ; elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s"); } initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef); } } if (!hostId) { { setContentReference(elm); } } { let ancestorComponent = elm; while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) { if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) { attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent); break; } } } { initializeComponent(elm, hostRef, cmpMeta); } } else { addHostEventListeners(elm, hostRef, cmpMeta.$listeners$); if (hostRef == null ? void 0 : hostRef.$lazyInstance$) { fireConnectedCallback(hostRef.$lazyInstance$); } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) { hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$)); } } endConnected(); } }; var setContentReference = (elm) => { const contentRefElm = elm["s-cr"] = doc$1.createComment( "" ); contentRefElm["s-cn"] = true; insertBefore(elm, contentRefElm, elm.firstChild); }; var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => { if (listeners) { listeners.map(([flags, name, method]) => { const target = getHostListenerTarget(elm, flags) ; const handler = hostListenerProxy(hostRef, method); const opts = hostListenerOpts(flags); plt.ael(target, name, handler, opts); (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts)); }); } }; var hostListenerProxy = (hostRef, methodName) => (ev) => { var _a; try { { if (hostRef.$flags$ & 256 /* isListenReady */) { (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev); } else { (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]); } } } catch (e) { consoleError(e); } }; var getHostListenerTarget = (elm, flags) => { if (flags & 4 /* TargetDocument */) return doc$1; if (flags & 8 /* TargetWindow */) return win$2; if (flags & 16 /* TargetBody */) return doc$1.body; return elm; }; var hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0; // src/runtime/vdom/vdom-annotations.ts var insertVdomAnnotations = (doc2, staticComponents) => { if (doc2 != null) { const docData = { hostIds: 0, rootLevelIds: 0, staticComponents: new Set(staticComponents) }; const orgLocationNodes = []; parseVNodeAnnotations(doc2, doc2.body, docData, orgLocationNodes); orgLocationNodes.forEach((orgLocationNode) => { var _a; if (orgLocationNode != null && orgLocationNode["s-nr"]) { const nodeRef = orgLocationNode["s-nr"]; let hostId = nodeRef["s-host-id"]; let nodeId = nodeRef["s-node-id"]; let childId = `${hostId}.${nodeId}`; if (hostId == null) { hostId = 0; docData.rootLevelIds++; nodeId = docData.rootLevelIds; childId = `${hostId}.${nodeId}`; if (nodeRef.nodeType === 1 /* ElementNode */) { nodeRef.setAttribute(HYDRATE_CHILD_ID, childId); } else if (nodeRef.nodeType === 3 /* TextNode */) { if (hostId === 0) { const textContent = (_a = nodeRef.nodeValue) == null ? void 0 : _a.trim(); if (textContent === "") { orgLocationNode.remove(); return; } } const commentBeforeTextNode = doc2.createComment(childId); commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`; insertBefore(nodeRef.parentNode, commentBeforeTextNode, nodeRef); } } let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`; const orgLocationParentNode = orgLocationNode.parentElement; if (orgLocationParentNode) { if (orgLocationParentNode["s-en"] === "") { orgLocationNodeId += `.`; } else if (orgLocationParentNode["s-en"] === "c") { orgLocationNodeId += `.c`; } } orgLocationNode.nodeValue = orgLocationNodeId; } }); } }; var parseVNodeAnnotations = (doc2, node, docData, orgLocationNodes) => { var _a; if (node == null) { return; } if (node["s-nr"] != null) { orgLocationNodes.push(node); } if (node.nodeType === 1 /* ElementNode */) { const childNodes = [...Array.from(node.childNodes), ...Array.from(((_a = node.shadowRoot) == null ? void 0 : _a.childNodes) || [])]; childNodes.forEach((childNode) => { const hostRef = getHostRef(childNode); if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) { const cmpData = { nodeIds: 0 }; insertVNodeAnnotations(doc2, childNode, hostRef.$vnode$, docData, cmpData); } parseVNodeAnnotations(doc2, childNode, docData, orgLocationNodes); }); } }; var insertVNodeAnnotations = (doc2, hostElm, vnode, docData, cmpData) => { if (vnode != null) { const hostId = ++docData.hostIds; hostElm.setAttribute(HYDRATE_ID, hostId); if (hostElm["s-cr"] != null) { hostElm["s-cr"].nodeValue = `${CONTENT_REF_ID}.${hostId}`; } if (vnode.$children$ != null) { const depth = 0; vnode.$children$.forEach((vnodeChild, index) => { insertChildVNodeAnnotations(doc2, vnodeChild, cmpData, hostId, depth, index); }); } if (hostElm && vnode && vnode.$elm$ && !hostElm.hasAttribute(HYDRATE_CHILD_ID)) { const parent = hostElm.parentElement; if (parent && parent.childNodes) { const parentChildNodes = Array.from(parent.childNodes); const comment = parentChildNodes.find( (node) => node.nodeType === 8 /* CommentNode */ && node["s-sr"] ); if (comment) { const index = parentChildNodes.indexOf(hostElm) - 1; vnode.$elm$.setAttribute( HYDRATE_CHILD_ID, `${comment["s-host-id"]}.${comment["s-node-id"]}.0.${index}` ); } } } } }; var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, index) => { const childElm = vnodeChild.$elm$; if (childElm == null) { return; } const nodeId = cmpData.nodeIds++; const childId = `${hostId}.${nodeId}.${depth}.${index}`; childElm["s-host-id"] = hostId; childElm["s-node-id"] = nodeId; if (childElm.nodeType === 1 /* ElementNode */) { childElm.setAttribute(HYDRATE_CHILD_ID, childId); } else if (childElm.nodeType === 3 /* TextNode */) { const parentNode = childElm.parentNode; const nodeName = parentNode == null ? void 0 : parentNode.nodeName; if (nodeName !== "STYLE" && nodeName !== "SCRIPT") { const textNodeId = `${TEXT_NODE_ID}.${childId}`; const commentBeforeTextNode = doc2.createComment(textNodeId); insertBefore(parentNode, commentBeforeTextNode, childElm); } } else if (childElm.nodeType === 8 /* CommentNode */) { if (childElm["s-sr"]) { const slotName = childElm["s-sn"] || ""; const slotNodeId = `${SLOT_NODE_ID}.${childId}.${slotName}`; childElm.nodeValue = slotNodeId; } } if (vnodeChild.$children$ != null) { const childDepth = depth + 1; vnodeChild.$children$.forEach((vnode, index2) => { insertChildVNodeAnnotations(doc2, vnode, cmpData, hostId, childDepth, index2); }); } }; // src/hydrate/platform/h-async.ts var hAsync = (nodeName, vnodeData, ...children) => { if (Array.isArray(children) && children.length > 0) { const flatChildren = children.flat(Infinity); if (flatChildren.some((child) => child instanceof Promise)) { return Promise.all(flatChildren).then((resolvedChildren) => { return h(nodeName, vnodeData, ...resolvedChildren); }).catch((err2) => { return h(nodeName, vnodeData); }); } return h(nodeName, vnodeData, ...flatChildren); } return h(nodeName, vnodeData); }; function proxyHostElement(elm, cmpMeta) { if (typeof elm.componentOnReady !== "function") { elm.componentOnReady = componentOnReady$1; } if (typeof elm.forceUpdate !== "function") { elm.forceUpdate = forceUpdate2; } if (!elm.shadowRoot && !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) { { elm.attachShadow({ mode: "open", delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */) }); } } if (cmpMeta.$members$ != null) { const hostRef = getHostRef(elm); const members = Object.entries(cmpMeta.$members$); members.forEach(([memberName, m]) => { var _a, _b; const memberFlags = m[0]; if (memberFlags & 31 /* Prop */) { const attributeName = m[1] || memberName; let attrValue = elm.getAttribute(attributeName); if ((attrValue == null ? void 0 : attrValue.startsWith("{")) && attrValue.endsWith("}") || (attrValue == null ? void 0 : attrValue.startsWith("[")) && attrValue.endsWith("]")) { try { attrValue = JSON.parse(attrValue); } catch (e) { } } if (attrValue != null) { const parsedAttrValue = parsePropertyValue(attrValue, memberFlags); (_a = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _a.set(memberName, parsedAttrValue); } const ownValue = elm[memberName]; if (ownValue !== void 0) { (_b = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b.set(memberName, ownValue); delete elm[memberName]; } Object.defineProperty(elm, memberName, { get() { return getValue(this, memberName); }, set(newValue) { setValue(this, memberName, newValue, cmpMeta); }, configurable: true, enumerable: true }); } else if (memberFlags & 64 /* Method */) { Object.defineProperty(elm, memberName, { value(...args) { var _a2; const ref = getHostRef(this); return (_a2 = ref == null ? void 0 : ref.$onInstancePromise$) == null ? void 0 : _a2.then(() => { var _a3; return (_a3 = ref == null ? void 0 : ref.$lazyInstance$) == null ? void 0 : _a3[memberName](...args); }).catch(consoleError); } }); } }); } } function componentOnReady$1() { var _a; return (_a = getHostRef(this)) == null ? void 0 : _a.$onReadyPromise$; } function forceUpdate2() { } // src/hydrate/platform/hydrate-app.ts function hydrateApp(win2, opts, results, afterHydrate, resolve) { const connectedElements = /* @__PURE__ */ new Set(); const createdElements = /* @__PURE__ */ new Set(); const waitingElements = /* @__PURE__ */ new Set(); const orgDocumentCreateElement = win2.document.createElement; const orgDocumentCreateElementNS = win2.document.createElementNS; const resolved2 = Promise.resolve(); let tmrId; let ranCompleted = false; function hydratedComplete() { globalThis.clearTimeout(tmrId); createdElements.clear(); connectedElements.clear(); if (!ranCompleted) { ranCompleted = true; try { if (opts.clientHydrateAnnotations) { insertVdomAnnotations(win2.document, opts.staticComponents); } win2.dispatchEvent(new win2.Event("DOMContentLoaded")); win2.document.createElement = orgDocumentCreateElement; win2.document.createElementNS = orgDocumentCreateElementNS; } catch (e) { renderCatchError(opts, results, e); } } afterHydrate(win2, opts, results, resolve); } function hydratedError(err2) { renderCatchError(opts, results, err2); hydratedComplete(); } function timeoutExceeded() { hydratedError(`Hydrate exceeded timeout${waitingOnElementsMsg(waitingElements)}`); } try { let patchedConnectedCallback2 = function() { return connectElement2(this); }, patchElement2 = function(elm) { if (isValidComponent(elm, opts)) { const hostRef = getHostRef(elm); if (!hostRef) { const Cstr = loadModule( { $tagName$: elm.nodeName.toLowerCase(), $flags$: null }); if (Cstr != null && Cstr.cmpMeta != null) { createdElements.add(elm); elm.connectedCallback = patchedConnectedCallback2; registerHost(elm, Cstr.cmpMeta); proxyHostElement(elm, Cstr.cmpMeta); } } } }, patchChild2 = function(elm) { if (elm != null && elm.nodeType === 1) { patchElement2(elm); const children = elm.children; for (let i2 = 0, ii = children.length; i2 < ii; i2++) { patchChild2(children[i2]); } } }, connectElement2 = function(elm) { createdElements.delete(elm); if (isValidComponent(elm, opts) && results.hydratedCount < opts.maxHydrateCount) { if (!connectedElements.has(elm) && shouldHydrate(elm)) { connectedElements.add(elm); return hydrateComponent.call(elm, win2, results, elm.nodeName, elm, waitingElements); } } return resolved2; }, waitLoop2 = function() { const toConnect = Array.from(createdElements).filter((elm) => elm.parentElement); if (toConnect.length > 0) { return Promise.all(toConnect.map(connectElement2)).then(waitLoop2); } return resolved2; }; win2.document.createElement = function patchedCreateElement(tagName) { const elm = orgDocumentCreateElement.call(win2.document, tagName); patchElement2(elm); return elm; }; win2.document.createElementNS = function patchedCreateElement(namespaceURI, tagName) { const elm = orgDocumentCreateElementNS.call(win2.document, namespaceURI, tagName); patchElement2(elm); return elm; }; tmrId = globalThis.setTimeout(timeoutExceeded, opts.timeout); plt.$resourcesUrl$ = new URL(opts.resourcesUrl || "./", doc$1.baseURI).href; patchChild2(win2.document.body); waitLoop2().then(hydratedComplete).catch(hydratedError); } catch (e) { hydratedError(e); } } async function hydrateComponent(win2, results, tagName, elm, waitingElements) { tagName = tagName.toLowerCase(); const Cstr = loadModule( { $tagName$: tagName, $flags$: null }); if (Cstr != null) { const cmpMeta = Cstr.cmpMeta; if (cmpMeta != null) { waitingElements.add(elm); const hostRef = getHostRef(this); addHostEventListeners(this, hostRef, cmpMeta.$listeners$); try { connectedCallback(elm); await elm.componentOnReady(); results.hydratedCount++; const ref = getHostRef(elm); const modeName = !ref.$modeName$ ? "$" : ref.$modeName$; if (!results.components.some((c) => c.tag === tagName && c.mode === modeName)) { results.components.push({ tag: tagName, mode: modeName, count: 0, depth: -1 }); } } catch (e) { win2.console.error(e); } waitingElements.delete(elm); } } } function isValidComponent(elm, opts) { if (elm != null && elm.nodeType === 1) { const tagName = elm.nodeName; if (typeof tagName === "string" && tagName.includes("-")) { if (opts.excludeComponents.includes(tagName.toLowerCase())) { return false; } return true; } } return false; } function shouldHydrate(elm) { if (elm.nodeType === 9) { return true; } if (NO_HYDRATE_TAGS.has(elm.nodeName)) { return false; } if (elm.hasAttribute("no-prerender")) { return false; } const parentNode = elm.parentNode; if (parentNode == null) { return true; } return shouldHydrate(parentNode); } var NO_HYDRATE_TAGS = /* @__PURE__ */ new Set([ "CODE", "HEAD", "IFRAME", "INPUT", "OBJECT", "OUTPUT", "NOSCRIPT", "PRE", "SCRIPT", "SELECT", "STYLE", "TEMPLATE", "TEXTAREA" ]); function renderCatchError(opts, results, err2) { const diagnostic = { level: "error", type: "build", header: "Hydrate Error", messageText: "", relFilePath: void 0, absFilePath: void 0, lines: [] }; if (opts.url) { try { const u = new URL(opts.url); if (u.pathname !== "/") { diagnostic.header += ": " + u.pathname; } } catch (e) { } } if (err2 != null) { if (err2.stack != null) { diagnostic.messageText = err2.stack.toString(); } else if (err2.message != null) { diagnostic.messageText = err2.message.toString(); } else { diagnostic.messageText = err2.toString(); } } results.diagnostics.push(diagnostic); } function printTag(elm) { let tag = `<${elm.nodeName.toLowerCase()}`; if (Array.isArray(elm.attributes)) { for (let i2 = 0; i2 < elm.attributes.length; i2++) { const attr = elm.attributes[i2]; tag += ` ${attr.name}`; if (attr.value !== "") { tag += `="${attr.value}"`; } } } tag += `>`; return tag; } function waitingOnElementMsg(waitingElement) { let msg = ""; if (waitingElement) { const lines = []; msg = " - waiting on:"; let elm = waitingElement; while (elm && elm.nodeType !== 9 && elm.nodeName !== "BODY") { lines.unshift(printTag(elm)); elm = elm.parentElement; } let indent = ""; for (const ln of lines) { indent += " "; msg += ` ${indent}${ln}`; } } return msg; } function waitingOnElementsMsg(waitingElements) { return Array.from(waitingElements).map(waitingOnElementMsg); } var cmpModules = /* @__PURE__ */ new Map(); var getModule = (tagName) => { if (typeof tagName === "string") { tagName = tagName.toLowerCase(); const cmpModule = cmpModules.get(tagName); if (cmpModule != null) { return cmpModule[tagName]; } } return null; }; var loadModule = (cmpMeta, _hostRef, _hmrVersionId) => { return getModule(cmpMeta.$tagName$); }; var isMemberInElement = (elm, memberName) => { if (elm != null) { if (memberName in elm) { return true; } const cstr = getModule(elm.nodeName); if (cstr != null) { const hostRef = cstr; if (hostRef != null && hostRef.cmpMeta != null && hostRef.cmpMeta.$members$ != null) { return memberName in hostRef.cmpMeta.$members$; } } } return false; }; var registerComponents = (Cstrs) => { for (const Cstr of Cstrs) { const exportName = Cstr.cmpMeta.$tagName$; cmpModules.set(exportName, { [exportName]: Cstr }); } }; var win$2 = window; var doc$1 = win$2.document; var readTask = (cb) => { nextTick(() => { try { cb(); } catch (e) { consoleError(e); } }); }; var writeTask = (cb) => { nextTick(() => { try { cb(); } catch (e) { consoleError(e); } }); }; var resolved = /* @__PURE__ */ Promise.resolve(); var nextTick = (cb) => resolved.then(cb); var defaultConsoleError = (e) => { if (e != null) { console.error(e.stack || e.message || e); } }; var consoleError = (e, el) => (defaultConsoleError)(e, el); var plt = { $flags$: 0, $resourcesUrl$: "", jmp: (h2) => h2(), raf: (h2) => requestAnimationFrame(h2), ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts), rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts), ce: (eventName, opts) => new win$2.CustomEvent(eventName, opts) }; var supportsShadow = BUILD.shadowDom; var hostRefs = /* @__PURE__ */ new WeakMap(); var getHostRef = (ref) => hostRefs.get(ref); var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef); var registerHost = (elm, cmpMeta) => { const hostRef = { $flags$: 0, $cmpMeta$: cmpMeta, $hostElement$: elm, $instanceValues$: /* @__PURE__ */ new Map(), $renderCount$: 0 }; hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r); hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r); elm["s-p"] = []; elm["s-rc"] = []; return hostRefs.set(elm, hostRef); }; var Build = { isDev: false, isBrowser: false, isServer: true, isTesting: false }; var styles = /* @__PURE__ */ new Map(); var modeResolutionChain = []; // TODO(FW-2832): types class Config { constructor() { this.m = new Map(); } reset(configObj) { this.m = new Map(Object.entries(configObj)); } get(key, fallback) { const value = this.m.get(key); return value !== undefined ? value : fallback; } getBoolean(key, fallback = false) { const val = this.m.get(key); if (val === undefined) { return fallback; } if (typeof val === 'string') { return val === 'true'; } return !!val; } getNumber(key, fallback) { const val = parseFloat(this.m.get(key)); return isNaN(val) ? (fallback !== undefined ? fallback : NaN) : val; } set(key, value) { this.m.set(key, value); } } const config = /*@__PURE__*/ new Config(); var LogLevel; (function (LogLevel) { LogLevel["OFF"] = "OFF"; LogLevel["ERROR"] = "ERROR"; LogLevel["WARN"] = "WARN"; })(LogLevel || (LogLevel = {})); /** * Logs a warning to the console with an Ionic prefix * to indicate the library that is warning the developer. * * @param message - The string message to be logged to the console. */ const printIonWarning = (message, ...params) => { const logLevel = config.get('logLevel', LogLevel.WARN); if ([LogLevel.WARN].includes(logLevel)) { return console.warn(`[Ionic Warning]: ${message}`, ...params); } }; /** * Logs an error to the console with an Ionic prefix * to indicate the library that is warning the developer. * * @param message - The string message to be logged to the console. * @param params - Additional arguments to supply to the console.error. */ const printIonError = (message, ...params) => { const logLevel = config.get('logLevel', LogLevel.ERROR); if ([LogLevel.ERROR, LogLevel.WARN].includes(logLevel)) { return console.error(`[Ionic Error]: ${message}`, ...params); } }; /** * Prints an error informing developers that an implementation requires an element to be used * within a specific selector. * * @param el The web component element this is requiring the element. * @param targetSelectors The selector or selectors that were not found. */ const printRequiredElementError = (el, ...targetSelectors) => { return console.error(`<${el.tagName.toLowerCase()}> must be used inside ${targetSelectors.join(' or ')}.`); }; const transitionEndAsync = (el, expectedDuration = 0) => { return new Promise((resolve) => { transitionEnd(el, expectedDuration, resolve); }); }; /** * Allows developer to wait for a transition * to finish and fallback to a timer if the * transition is cancelled or otherwise * never finishes. Also see transitionEndAsync * which is an await-able version of this. */ const transitionEnd = (el, expectedDuration = 0, callback) => { let unRegTrans; let animationTimeout; const opts = { passive: true }; const ANIMATION_FALLBACK_TIMEOUT = 500; const unregister = () => { if (unRegTrans) { unRegTrans(); } }; const onTransitionEnd = (ev) => { if (ev === undefined || el === ev.target) { unregister(); callback(ev); } }; if (el) { el.addEventListener('webkitTransitionEnd', onTransitionEnd, opts); el.addEventListener('transitionend', onTransitionEnd, opts); animationTimeout = setTimeout(onTransitionEnd, expectedDuration + ANIMATION_FALLBACK_TIMEOUT); unRegTrans = () => { if (animationTimeout !== undefined) { clearTimeout(animationTimeout); animationTimeout = undefined; } el.removeEventListener('webkitTransitionEnd', onTransitionEnd, opts); el.removeEventListener('transitionend', onTransitionEnd, opts); }; } return unregister; }; /** * Waits for a component to be ready for * both custom element and non-custom element builds. * If non-custom element build, el.componentOnReady * will be used. * For custom element builds, we wait a frame * so that the inner contents of the component * have a chance to render. * * Use this utility rather than calling * el.componentOnReady yourself. */ const componentOnReady = (el, callback) => { if (el.componentOnReady) { // eslint-disable-next-line custom-rules/no-component-on-ready-method el.componentOnReady().then((resolvedEl) => callback(resolvedEl)); } else { raf(() => callback(el)); } }; /** * This functions checks if a Stencil component is using * the lazy loaded build of Stencil. Returns `true` if * the component is lazy loaded. Returns `false` otherwise. */ const hasLazyBuild = (stencilEl) => { return stencilEl.componentOnReady !== undefined; }; /** * Elements inside of web components sometimes need to inherit global attributes * set on the host. For example, the inner input in `ion-input` should inherit * the `title` attribute that developers set directly on `ion-input`. This * helper function should be called in componentWillLoad and assigned to a variable * that is later used in the render function. * * This does not need to be reactive as changing attributes on the host element * does not trigger a re-render. */ const inheritAttributes$1 = (el, attributes = []) => { const attributeObject = {}; attributes.forEach((attr) => { if (el.hasAttribute(attr)) { const value = el.getAttribute(attr); if (value !== null) { attributeObject[attr] = el.getAttribute(attr); } el.removeAttribute(attr); } }); return attributeObject; }; /** * List of available ARIA attributes + `role`. * Removed deprecated attributes. * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes */ const ariaAttributes = [ 'role', 'aria-activedescendant', 'aria-atomic', 'aria-autocomplete', 'aria-braillelabel', 'aria-brailleroledescription', 'aria-busy', 'aria-checked', 'aria-colcount', 'aria-colindex', 'aria-colindextext', 'aria-colspan', 'aria-controls', 'aria-current', 'aria-describedby', 'aria-description', 'aria-details', 'aria-disabled', 'aria-errormessage', 'aria-expanded', 'aria-flowto', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-level', 'aria-live', 'aria-multiline', 'aria-multiselectable', 'aria-orientation', 'aria-owns', 'aria-placeholder', 'aria-posinset', 'aria-pressed', 'aria-readonly', 'aria-relevant', 'aria-required', 'aria-roledescription', 'aria-rowcount', 'aria-rowindex', 'aria-rowindextext', 'aria-rowspan', 'aria-selected', 'aria-setsize', 'aria-sort', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext', ]; /** * Returns an array of aria attributes that should be copied from * the shadow host element to a target within the light DOM. * @param el The element that the attributes should be copied from. * @param ignoreList The list of aria-attributes to ignore reflecting and removing from the host. * Use this in instances where we manually specify aria attributes on the `` element. */ const inheritAriaAttributes = (el, ignoreList) => { let attributesToInherit = ariaAttributes; if (ignoreList && ignoreList.length > 0) { attributesToInherit = attributesToInherit.filter((attr) => !ignoreList.includes(attr)); } return inheritAttributes$1(el, attributesToInherit); }; const addEventListener$1 = (el, eventName, callback, opts) => { return el.addEventListener(eventName, callback, opts); }; const removeEventListener = (el, eventName, callback, opts) => { return el.removeEventListener(eventName, callback, opts); }; /** * Gets the root context of a shadow dom element * On newer browsers this will be the shadowRoot, * but for older browser this may just be the * element itself. * * Useful for whenever you need to explicitly * do "myElement.shadowRoot!.querySelector(...)". */ const getElementRoot = (el, fallback = el) => { return el.shadowRoot || fallback; }; /** * Patched version of requestAnimationFrame that avoids ngzone * Use only when you know ngzone should not run */ const raf = (h) => { if (typeof __zone_symbol__requestAnimationFrame === 'function') { return __zone_symbol__requestAnimationFrame(h); } if (typeof requestAnimationFrame === 'function') { return requestAnimationFrame(h); } return setTimeout(h); }; const hasShadowDom = (el) => { return !!el.shadowRoot && !!el.attachShadow; }; const focusVisibleElement = (el) => { el.focus(); /** * When programmatically focusing an element, * the focus-visible utility will not run because * it is expecting a keyboard event to have triggered this; * however, there are times when we need to manually control * this behavior so we call the `setFocus` method on ion-app * which will let us explicitly set the elements to focus. */ if (el.classList.contains('ion-focusable')) { const app = el.closest('ion-app'); if (app) { app.setFocus([el]); } } }; /** * This method is used to add a hidden input to a host element that contains * a Shadow DOM. It does not add the input inside of the Shadow root which * allows it to be picked up inside of forms. It should contain the same * values as the host element. * * @param always Add a hidden input even if the container does not use Shadow * @param container The element where the input will be added * @param name The name of the input * @param value The value of the input * @param disabled If true, the input is disabled */ const renderHiddenInput = (always, container, name, value, disabled) => { if (always || hasShadowDom(container)) { let input = container.querySelector('input.aux-input'); if (!input) { input = container.ownerDocument.createElement('input'); input.type = 'hidden'; input.classList.add('aux-input'); container.appendChild(input); } input.disabled = disabled; input.name = name; input.value = value || ''; } }; const clamp = (min, n, max) => { return Math.max(min, Math.min(n, max)); }; const assert = (actual, reason) => { if (!actual) { const message = 'ASSERT: ' + reason; printIonError(message); debugger; // eslint-disable-line throw new Error(message); } }; /** * @hidden * Given a side, return if it should be on the end * based on the value of dir * @param side the side * @param isRTL whether the application dir is rtl */ const isEndSide = (side) => { const isRTL = document.dir === 'rtl'; switch (side) { case 'start': return isRTL; case 'end': return !isRTL; default: throw new Error(`"${side}" is not a valid value for [side]. Use "start" or "end" instead.`); } }; const debounceEvent = (event, wait) => { const original = event._original || event; return { _original: event, emit: debounce(original.emit.bind(original), wait), }; }; const debounce = (func, wait = 0) => { let timer; return (...args) => { clearTimeout(timer); timer = setTimeout(func, wait, ...args); }; }; /** * Check whether the two string maps are shallow equal. * * undefined is treated as an empty map. * * @returns whether the keys are the same and the values are shallow equal. */ const shallowEqualStringMap = (map1, map2) => { map1 !== null && map1 !== void 0 ? map1 : (map1 = {}); map2 !== null && map2 !== void 0 ? map2 : (map2 = {}); if (map1 === map2) { return true; } const keys1 = Object.keys(map1); if (keys1.length !== Object.keys(map2).length) { return false; } for (const k1 of keys1) { if (!(k1 in map2)) { return false; } if (map1[k1] !== map2[k1]) { return false; } } return true; }; /** * Checks input for usable number. Not NaN and not Infinite. */ const isSafeNumber = (input) => { return typeof input === 'number' && !isNaN(input) && isFinite(input); }; /* Ionicons v7.2.2, ES Modules */ const arrowBackSharp = "data:image/svg+xml;utf8,"; const arrowDown = "data:image/svg+xml;utf8,"; const caretBackSharp = "data:image/svg+xml;utf8,"; const caretDownSharp = "data:image/svg+xml;utf8,"; const caretUpSharp = "data:image/svg+xml;utf8,"; const checkmarkOutline = "data:image/svg+xml;utf8,"; const chevronBack = "data:image/svg+xml;utf8,"; const chevronDown = "data:image/svg+xml;utf8,"; const chevronExpand = "data:image/svg+xml;utf8,"; const chevronForward = "data:image/svg+xml;utf8,"; const chevronForwardOutline = "data:image/svg+xml;utf8,"; const close = "data:image/svg+xml;utf8,"; const closeCircle = "data:image/svg+xml;utf8,"; const closeSharp = "data:image/svg+xml;utf8,"; const ellipseOutline = "data:image/svg+xml;utf8,"; const ellipsisHorizontal = "data:image/svg+xml;utf8,"; const eye = "data:image/svg+xml;utf8,"; const eyeOff = "data:image/svg+xml;utf8,"; const menuOutline = "data:image/svg+xml;utf8,"; const menuSharp = "data:image/svg+xml;utf8,"; const removeOutline = "data:image/svg+xml;utf8,"; const reorderThreeOutline = "data:image/svg+xml;utf8,"; const reorderTwoSharp = "data:image/svg+xml;utf8,"; const searchOutline = "data:image/svg+xml;utf8,"; const searchSharp = "data:image/svg+xml;utf8,"; const getPlatforms = (win) => setupPlatforms(win); const isPlatform = (winOrPlatform, platform) => { if (typeof winOrPlatform === 'string') { platform = winOrPlatform; winOrPlatform = undefined; } return getPlatforms(winOrPlatform).includes(platform); }; const setupPlatforms = (win = window) => { if (typeof win === 'undefined') { return []; } win.Ionic = win.Ionic || {}; let platforms = win.Ionic.platforms; if (platforms == null) { platforms = win.Ionic.platforms = detectPlatforms(win); platforms.forEach((p) => win.document.documentElement.classList.add(`plt-${p}`)); } return platforms; }; const detectPlatforms = (win) => { const customPlatformMethods = config.get('platform'); return Object.keys(PLATFORMS_MAP).filter((p) => { const customMethod = customPlatformMethods === null || customPlatformMethods === void 0 ? void 0 : customPlatformMethods[p]; return typeof customMethod === 'function' ? customMethod(win) : PLATFORMS_MAP[p](win); }); }; const isMobileWeb = (win) => isMobile(win) && !isHybrid(win); const isIpad = (win) => { // iOS 12 and below if (testUserAgent(win, /iPad/i)) { return true; } // iOS 13+ if (testUserAgent(win, /Macintosh/i) && isMobile(win)) { return true; } return false; }; const isIphone = (win) => testUserAgent(win, /iPhone/i); const isIOS = (win) => testUserAgent(win, /iPhone|iPod/i) || isIpad(win); const isAndroid = (win) => testUserAgent(win, /android|sink/i); const isAndroidTablet = (win) => { return isAndroid(win) && !testUserAgent(win, /mobile/i); }; const isPhablet = (win) => { const width = win.innerWidth; const height = win.innerHeight; const smallest = Math.min(width, height); const largest = Math.max(width, height); return smallest > 390 && smallest < 520 && largest > 620 && largest < 800; }; const isTablet = (win) => { const width = win.innerWidth; const height = win.innerHeight; const smallest = Math.min(width, height); const largest = Math.max(width, height); return isIpad(win) || isAndroidTablet(win) || (smallest > 460 && smallest < 820 && largest > 780 && largest < 1400); }; const isMobile = (win) => matchMedia$1(win, '(any-pointer:coarse)'); const isDesktop = (win) => !isMobile(win); const isHybrid = (win) => isCordova(win) || isCapacitorNative(win); const isCordova = (win) => !!(win['cordova'] || win['phonegap'] || win['PhoneGap']); const isCapacitorNative = (win) => { const capacitor = win['Capacitor']; // TODO(ROU-11693): Remove when we no longer support Capacitor 2, which does not have isNativePlatform return !!((capacitor === null || capacitor === void 0 ? void 0 : capacitor.isNative) || ((capacitor === null || capacitor === void 0 ? void 0 : capacitor.isNativePlatform) && !!capacitor.isNativePlatform())); }; const isElectron = (win) => testUserAgent(win, /electron/i); const isPWA = (win) => { var _a; return !!(((_a = win.matchMedia) === null || _a === void 0 ? void 0 : _a.call(win, '(display-mode: standalone)').matches) || win.navigator.standalone); }; const testUserAgent = (win, expr) => expr.test(win.navigator.userAgent); const matchMedia$1 = (win, query) => { var _a; return (_a = win.matchMedia) === null || _a === void 0 ? void 0 : _a.call(win, query).matches; }; const PLATFORMS_MAP = { ipad: isIpad, iphone: isIphone, ios: isIOS, android: isAndroid, phablet: isPhablet, tablet: isTablet, cordova: isCordova, capacitor: isCapacitorNative, electron: isElectron, pwa: isPWA, mobile: isMobile, mobileweb: isMobileWeb, desktop: isDesktop, hybrid: isHybrid, }; // TODO(FW-2832): types let defaultMode; const getIonMode$1 = (ref) => { return (ref && getMode(ref)) || defaultMode; }; const accordionIosCss = ":host{display:block;position:relative;width:100%;background-color:var(--ion-background-color, #ffffff);overflow:hidden;z-index:0}:host(.accordion-expanding) ::slotted(ion-item[slot=header]),:host(.accordion-expanded) ::slotted(ion-item[slot=header]){--border-width:0px}:host(.accordion-animated){-webkit-transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}:host(.accordion-animated) #content{-webkit-transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}#content{overflow:hidden;will-change:max-height}:host(.accordion-collapsing) #content{max-height:0 !important}:host(.accordion-collapsed) #content{display:none}:host(.accordion-expanding) #content{max-height:0}:host(.accordion-expanding) #content-wrapper{overflow:auto}:host(.accordion-disabled) #header,:host(.accordion-readonly) #header,:host(.accordion-disabled) #content,:host(.accordion-readonly) #content{pointer-events:none}:host(.accordion-disabled) #header,:host(.accordion-disabled) #content{opacity:0.4}@media (prefers-reduced-motion: reduce){:host,#content{-webkit-transition:none !important;transition:none !important}}:host(.accordion-next) ::slotted(ion-item[slot=header]){--border-width:0.55px 0px 0.55px 0px}"; var IonAccordionIosStyle0 = accordionIosCss; const accordionMdCss = ":host{display:block;position:relative;width:100%;background-color:var(--ion-background-color, #ffffff);overflow:hidden;z-index:0}:host(.accordion-expanding) ::slotted(ion-item[slot=header]),:host(.accordion-expanded) ::slotted(ion-item[slot=header]){--border-width:0px}:host(.accordion-animated){-webkit-transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}:host(.accordion-animated) #content{-webkit-transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}#content{overflow:hidden;will-change:max-height}:host(.accordion-collapsing) #content{max-height:0 !important}:host(.accordion-collapsed) #content{display:none}:host(.accordion-expanding) #content{max-height:0}:host(.accordion-expanding) #content-wrapper{overflow:auto}:host(.accordion-disabled) #header,:host(.accordion-readonly) #header,:host(.accordion-disabled) #content,:host(.accordion-readonly) #content{pointer-events:none}:host(.accordion-disabled) #header,:host(.accordion-disabled) #content{opacity:0.4}@media (prefers-reduced-motion: reduce){:host,#content{-webkit-transition:none !important;transition:none !important}}"; var IonAccordionMdStyle0 = accordionMdCss; /** * @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use. * * @slot header - Content is placed at the top and is used to * expand or collapse the accordion item. * @slot content - Content is placed below the header and is * shown or hidden based on expanded state. * * @part header - The wrapper element for the header slot. * @part content - The wrapper element for the content slot. * @part expanded - The expanded element. Can be used in combination * with the `header` and `content` parts (i.e. `::part(header expanded)`). */ class Accordion { constructor(hostRef) { registerInstance(this, hostRef); this.updateListener = () => this.updateState(false); this.setItemDefaults = () => { const ionItem = this.getSlottedHeaderIonItem(); if (!ionItem) { return; } /** * For a11y purposes, we make * the ion-item a button so users * can tab to it and use keyboard * navigation to get around. */ ionItem.button = true; ionItem.detail = false; /** * By default, the lines in an * item should be full here, but * only do that if a user has * not explicitly overridden them */ if (ionItem.lines === undefined) { ionItem.lines = 'full'; } }; this.getSlottedHeaderIonItem = () => { const { headerEl } = this; if (!headerEl) { return; } /** * Get the first ion-item * slotted in the header slot */ const slot = headerEl.querySelector('slot'); if (!slot) { return; } // This is not defined in unit tests if (slot.assignedElements === undefined) return; return slot.assignedElements().find((el) => el.tagName === 'ION-ITEM'); }; this.setAria = (expanded = false) => { const ionItem = this.getSlottedHeaderIonItem(); if (!ionItem) { return; } /** * Get the native