123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953 |
- // node_modules/@stencil/core/internal/app-data/index.js
- var BUILD = {
- allRenderFn: false,
- cmpDidLoad: true,
- cmpDidUnload: false,
- cmpDidUpdate: true,
- cmpDidRender: true,
- cmpWillLoad: true,
- cmpWillUpdate: true,
- cmpWillRender: true,
- connectedCallback: true,
- disconnectedCallback: true,
- element: true,
- event: true,
- hasRenderFn: true,
- lifecycle: true,
- hostListener: true,
- hostListenerTargetWindow: true,
- hostListenerTargetDocument: true,
- hostListenerTargetBody: true,
- hostListenerTargetParent: false,
- hostListenerTarget: true,
- member: true,
- method: true,
- mode: true,
- observeAttribute: true,
- prop: true,
- propMutable: true,
- reflect: true,
- scoped: true,
- shadowDom: true,
- slot: true,
- cssAnnotations: true,
- state: true,
- style: true,
- svg: true,
- updatable: true,
- vdomAttribute: true,
- vdomXlink: true,
- vdomClass: true,
- vdomFunctional: true,
- vdomKey: true,
- vdomListener: true,
- vdomRef: true,
- vdomPropOrAttr: true,
- vdomRender: true,
- vdomStyle: true,
- vdomText: true,
- watchCallback: true,
- taskQueue: true,
- hotModuleReplacement: false,
- isDebug: false,
- isDev: false,
- isTesting: false,
- hydrateServerSide: false,
- hydrateClientSide: false,
- lifecycleDOMEvents: false,
- lazyLoad: false,
- profile: false,
- slotRelocation: true,
- appendChildSlotFix: false,
- cloneNodeFix: false,
- hydratedAttribute: false,
- hydratedClass: true,
- safari10: false,
- scriptDataOpts: false,
- scopedSlotTextContentFix: false,
- shadowDomShim: false,
- slotChildNodesFix: false,
- invisiblePrehydration: true,
- propBoolean: true,
- propNumber: true,
- propString: true,
- cssVarShim: false,
- constructableCSS: true,
- cmpShouldUpdate: true,
- devTools: false,
- dynamicImportShim: false,
- shadowDelegatesFocus: true,
- initializeNextTick: false,
- asyncLoading: false,
- asyncQueue: false,
- transformTagName: false,
- attachStyles: true
- };
- var NAMESPACE = "app";
- // node_modules/@stencil/core/internal/client/index.js
- var scopeId;
- var contentRef;
- var hostTagName;
- var customError;
- var i = 0;
- var useNativeShadowDom = false;
- var checkSlotFallbackVisibility = false;
- var checkSlotRelocate = false;
- var isSvgMode = false;
- var renderingRef = null;
- var queueCongestion = 0;
- var queuePending = false;
- var Build = {
- isDev: BUILD.isDev ? true : false,
- isBrowser: true,
- isServer: false,
- isTesting: BUILD.isTesting ? true : false
- };
- var getAssetPath = (path) => {
- const assetUrl = new URL(path, plt.$resourcesUrl$);
- return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
- };
- var setAssetPath = (path) => plt.$resourcesUrl$ = path;
- var createTime = (fnName, tagName = "") => {
- if (BUILD.profile && performance.mark) {
- const key = `st:${fnName}:${tagName}:${i++}`;
- performance.mark(key);
- return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
- } else {
- return () => {
- return;
- };
- }
- };
- var uniqueTime = (key, measureText) => {
- if (BUILD.profile && performance.mark) {
- if (performance.getEntriesByName(key).length === 0) {
- performance.mark(key);
- }
- return () => {
- if (performance.getEntriesByName(measureText).length === 0) {
- performance.measure(measureText, key);
- }
- };
- } else {
- return () => {
- return;
- };
- }
- };
- 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 XLINK_NS = "http://www.w3.org/1999/xlink";
- var EMPTY_OBJ = {};
- var SVG_NS = "http://www.w3.org/2000/svg";
- var HTML_NS = "http://www.w3.org/1999/xhtml";
- var isDef = (v) => v != null;
- var isComplexType = (o) => {
- o = typeof o;
- return o === "object" || o === "function";
- };
- 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);
- } else if (BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
- consoleDevError(`vNode passed as children has unexpected type.
- Make sure it's using the correct h() function.
- Empty objects can also be the cause, look for JSX comments that became objects.`);
- }
- if (simple && lastSimple) {
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
- } else {
- vNodeChildren.push(simple ? newVNode(null, child) : child);
- }
- lastSimple = simple;
- }
- }
- };
- walk(children);
- if (vnodeData) {
- if (BUILD.isDev && nodeName === "input") {
- validateInputProperties(vnodeData);
- }
- if (BUILD.vdomKey && vnodeData.key) {
- key = vnodeData.key;
- }
- if (BUILD.slotRelocation && vnodeData.name) {
- slotName = vnodeData.name;
- }
- if (BUILD.vdomClass) {
- const classData = vnodeData.className || vnodeData.class;
- if (classData) {
- vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
- }
- }
- }
- if (BUILD.isDev && vNodeChildren.some(isHost)) {
- consoleDevError(`The <Host> must be the single root component. Make sure:
- - You are NOT using hostData() and <Host> in the same component.
- - <Host> is used once, and it's the single root component of the render() function.`);
- }
- if (BUILD.vdomFunctional && 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;
- }
- if (BUILD.vdomKey) {
- vnode.$key$ = key;
- }
- if (BUILD.slotRelocation) {
- vnode.$name$ = slotName;
- }
- return vnode;
- };
- var newVNode = (tag, text) => {
- const vnode = {
- $flags$: 0,
- $tag$: tag,
- $text$: text,
- $elm$: null,
- $children$: null
- };
- if (BUILD.vdomAttribute) {
- vnode.$attrs$ = null;
- }
- if (BUILD.vdomKey) {
- vnode.$key$ = null;
- }
- if (BUILD.slotRelocation) {
- 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 = Object.assign({}, 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;
- };
- var validateInputProperties = (inputElm) => {
- const props = Object.keys(inputElm);
- const value = props.indexOf("value");
- if (value === -1) {
- return;
- }
- const typeIndex = props.indexOf("type");
- const minIndex = props.indexOf("min");
- const maxIndex = props.indexOf("max");
- const stepIndex = props.indexOf("step");
- if (value < typeIndex || value < minIndex || value < maxIndex || value < stepIndex) {
- consoleDevWarn(`The "value" prop of <input> should be set after "min", "max", "type" and "step"`);
- }
- };
- var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
- const endHydrate = createTime("hydrateClient", tagName);
- const shadowRoot = hostElm.shadowRoot;
- const childRenderNodes = [];
- const slotNodes = [];
- const shadowRootNodes = BUILD.shadowDom && shadowRoot ? [] : null;
- const vnode = hostRef.$vnode$ = newVNode(tagName, null);
- if (!plt.$orgLocNodes$) {
- initializeDocumentHydrate(doc.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 (BUILD.shadowDom && 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) {
- 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$;
- }
- }
- }
- for (i2 = node.childNodes.length - 1; i2 >= 0; i2--) {
- clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i2], hostId);
- }
- if (node.shadowRoot) {
- for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
- clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i2], hostId);
- }
- }
- } else if (node.nodeType === 8) {
- 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) {
- 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 (BUILD.shadowDom && shadowRootNodes) {
- childVNode.$elm$ = doc.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 (BUILD.shadowDom && shadowRootNodes) {
- node.remove();
- } else if (BUILD.slotRelocation) {
- 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) {
- let i2 = 0;
- for (; i2 < node.childNodes.length; i2++) {
- initializeDocumentHydrate(node.childNodes[i2], orgLocNodes);
- }
- if (node.shadowRoot) {
- for (i2 = 0; i2 < node.shadowRoot.childNodes.length; i2++) {
- initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
- }
- }
- } else if (node.nodeType === 8) {
- 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];
- }
- }
- };
- var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
- var parsePropertyValue = (propValue, propType) => {
- if (propValue != null && !isComplexType(propValue)) {
- if (BUILD.propBoolean && propType & 4) {
- return propValue === "false" ? false : propValue === "" || !!propValue;
- }
- if (BUILD.propNumber && propType & 2) {
- return parseFloat(propValue);
- }
- if (BUILD.propString && propType & 1) {
- return String(propValue);
- }
- return propValue;
- }
- return propValue;
- };
- var getElement = (ref) => BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
- var createEvent = (ref, name, flags) => {
- const elm = getElement(ref);
- return {
- emit: (detail) => {
- if (BUILD.isDev && !elm.isConnected) {
- consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
- }
- return emitEvent(elm, name, {
- bubbles: !!(flags & 4),
- composed: !!(flags & 2),
- cancelable: !!(flags & 1),
- 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);
- if (supportsConstructableStylesheets && allowCS) {
- style = style || new CSSStyleSheet();
- if (typeof style === "string") {
- style = cssText;
- } else {
- style.replaceSync(cssText);
- }
- } else {
- style = cssText;
- }
- styles.set(scopeId2, style);
- };
- var addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
- let scopeId2 = getScopeId(cmpMeta, mode);
- const style = styles.get(scopeId2);
- if (!BUILD.attachStyles) {
- return scopeId2;
- }
- styleContainerNode = styleContainerNode.nodeType === 11 ? styleContainerNode : doc;
- 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 (BUILD.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
- styleElm.innerHTML = style;
- } else {
- if (BUILD.cssVarShim && plt.$cssShim$) {
- styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId2, style, !!(cmpMeta.$flags$ & 10));
- const newScopeId = styleElm["s-sc"];
- if (newScopeId) {
- scopeId2 = newScopeId;
- appliedStyles = null;
- }
- } else {
- styleElm = doc.createElement("style");
- styleElm.innerHTML = style;
- }
- if (BUILD.hydrateServerSide || BUILD.hotModuleReplacement) {
- styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
- }
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
- }
- if (appliedStyles) {
- appliedStyles.add(scopeId2);
- }
- }
- } else if (BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
- }
- }
- 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(BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$, elm);
- if ((BUILD.shadowDom || BUILD.scoped) && BUILD.cssAnnotations && flags & 10) {
- elm["s-sc"] = scopeId2;
- elm.classList.add(scopeId2 + "-h");
- if (BUILD.scoped && flags & 2) {
- elm.classList.add(scopeId2 + "-s");
- }
- }
- endAttachStyles();
- };
- var getScopeId = (cmp, mode) => "sc-" + (BUILD.mode && mode && cmp.$flags$ & 32 ? 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 (BUILD.vdomClass && 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 (BUILD.vdomStyle && memberName === "style") {
- if (BUILD.updatable) {
- for (const prop in oldValue) {
- if (!newValue || newValue[prop] == null) {
- if (!BUILD.hydrateServerSide && prop.includes("-")) {
- elm.style.removeProperty(prop);
- } else {
- elm.style[prop] = "";
- }
- }
- }
- }
- for (const prop in newValue) {
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
- if (!BUILD.hydrateServerSide && prop.includes("-")) {
- elm.style.setProperty(prop, newValue[prop]);
- } else {
- elm.style[prop] = newValue[prop];
- }
- }
- }
- } else if (BUILD.vdomKey && memberName === "key")
- ;
- else if (BUILD.vdomRef && memberName === "ref") {
- if (newValue) {
- newValue(elm);
- }
- } else if (BUILD.vdomListener && (BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
- if (memberName[2] === "-") {
- memberName = memberName.slice(3);
- } else if (isMemberInElement(win, ln)) {
- memberName = ln.slice(2);
- } else {
- memberName = ln[2] + memberName.slice(3);
- }
- if (oldValue) {
- plt.rel(elm, memberName, oldValue, false);
- }
- if (newValue) {
- plt.ael(elm, memberName, newValue, false);
- }
- } else if (BUILD.vdomPropOrAttr) {
- 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 (BUILD.vdomXlink) {
- if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
- memberName = ln;
- xlink = true;
- }
- }
- if (newValue == null || newValue === false) {
- if (newValue !== false || elm.getAttribute(memberName) === "") {
- if (BUILD.vdomXlink && xlink) {
- elm.removeAttributeNS(XLINK_NS, memberName);
- } else {
- elm.removeAttribute(memberName);
- }
- }
- } else if ((!isProp || flags & 4 || isSvg) && !isComplex) {
- newValue = newValue === true ? "" : newValue;
- if (BUILD.vdomXlink && xlink) {
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
- } else {
- elm.setAttribute(memberName, newValue);
- }
- }
- }
- }
- };
- var parseClassListRegex = /\s/;
- var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
- var updateElement = (oldVnode, newVnode, isSvgMode2, memberName) => {
- const elm = newVnode.$elm$.nodeType === 11 && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
- const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
- if (BUILD.updatable) {
- for (memberName in oldVnodeAttrs) {
- if (!(memberName in newVnodeAttrs)) {
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
- }
- }
- }
- for (memberName in newVnodeAttrs) {
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
- }
- };
- var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
- const newVNode2 = newParentVNode.$children$[childIndex];
- let i2 = 0;
- let elm;
- let childNode;
- let oldVNode;
- if (BUILD.slotRelocation && !useNativeShadowDom) {
- checkSlotRelocate = true;
- if (newVNode2.$tag$ === "slot") {
- if (scopeId) {
- parentElm.classList.add(scopeId + "-s");
- }
- newVNode2.$flags$ |= newVNode2.$children$ ? 2 : 1;
- }
- }
- if (BUILD.isDev && newVNode2.$elm$) {
- consoleDevError(`The JSX ${newVNode2.$text$ !== null ? `"${newVNode2.$text$}" text` : `"${newVNode2.$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`);
- }
- if (BUILD.vdomText && newVNode2.$text$ !== null) {
- elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
- } else if (BUILD.slotRelocation && newVNode2.$flags$ & 1) {
- elm = newVNode2.$elm$ = BUILD.isDebug || BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
- } else {
- if (BUILD.svg && !isSvgMode) {
- isSvgMode = newVNode2.$tag$ === "svg";
- }
- elm = newVNode2.$elm$ = BUILD.svg ? doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, BUILD.slotRelocation && newVNode2.$flags$ & 2 ? "slot-fb" : newVNode2.$tag$) : doc.createElement(BUILD.slotRelocation && newVNode2.$flags$ & 2 ? "slot-fb" : newVNode2.$tag$);
- if (BUILD.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
- isSvgMode = false;
- }
- if (BUILD.vdomAttribute) {
- updateElement(null, newVNode2, isSvgMode);
- }
- if ((BUILD.shadowDom || BUILD.scoped) && isDef(scopeId) && elm["s-si"] !== scopeId) {
- elm.classList.add(elm["s-si"] = scopeId);
- }
- if (newVNode2.$children$) {
- for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
- childNode = createElm(oldParentVNode, newVNode2, i2, elm);
- if (childNode) {
- elm.appendChild(childNode);
- }
- }
- }
- if (BUILD.svg) {
- if (newVNode2.$tag$ === "svg") {
- isSvgMode = false;
- } else if (elm.tagName === "foreignObject") {
- isSvgMode = true;
- }
- }
- }
- if (BUILD.slotRelocation) {
- elm["s-hn"] = hostTagName;
- if (newVNode2.$flags$ & (2 | 1)) {
- elm["s-sr"] = true;
- elm["s-cr"] = contentRef;
- elm["s-sn"] = newVNode2.$name$ || "";
- 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;
- const oldSlotChildNodes = parentElm.childNodes;
- for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
- const childNode = oldSlotChildNodes[i2];
- if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
- parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
- childNode["s-ol"].remove();
- childNode["s-ol"] = void 0;
- checkSlotRelocate = true;
- }
- if (recursive) {
- putBackInOriginalLocation(childNode, recursive);
- }
- }
- plt.$flags$ &= ~1;
- };
- var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
- let containerElm = BUILD.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
- let childNode;
- if (BUILD.shadowDom && 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;
- containerElm.insertBefore(childNode, BUILD.slotRelocation ? referenceNode(before) : before);
- }
- }
- }
- };
- var removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
- for (; startIdx <= endIdx; ++startIdx) {
- if (vnode = vnodes[startIdx]) {
- elm = vnode.$elm$;
- callNodeRefs(vnode);
- if (BUILD.slotRelocation) {
- checkSlotFallbackVisibility = true;
- if (elm["s-ol"]) {
- elm["s-ol"].remove();
- } else {
- putBackInOriginalLocation(elm, true);
- }
- }
- elm.remove();
- }
- }
- };
- var updateChildren = (parentElm, oldCh, newVNode2, newCh) => {
- 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)) {
- patch(oldStartVnode, newStartVnode);
- oldStartVnode = oldCh[++oldStartIdx];
- newStartVnode = newCh[++newStartIdx];
- } else if (isSameVnode(oldEndVnode, newEndVnode)) {
- patch(oldEndVnode, newEndVnode);
- oldEndVnode = oldCh[--oldEndIdx];
- newEndVnode = newCh[--newEndIdx];
- } else if (isSameVnode(oldStartVnode, newEndVnode)) {
- if (BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
- putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
- }
- patch(oldStartVnode, newEndVnode);
- parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
- oldStartVnode = oldCh[++oldStartIdx];
- newEndVnode = newCh[--newEndIdx];
- } else if (isSameVnode(oldEndVnode, newStartVnode)) {
- if (BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
- putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
- }
- patch(oldEndVnode, newStartVnode);
- parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
- oldEndVnode = oldCh[--oldEndIdx];
- newStartVnode = newCh[++newStartIdx];
- } else {
- idxInOld = -1;
- if (BUILD.vdomKey) {
- for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
- if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
- idxInOld = i2;
- break;
- }
- }
- }
- if (BUILD.vdomKey && idxInOld >= 0) {
- elmToMove = oldCh[idxInOld];
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm);
- } else {
- patch(elmToMove, newStartVnode);
- oldCh[idxInOld] = void 0;
- node = elmToMove.$elm$;
- }
- newStartVnode = newCh[++newStartIdx];
- } else {
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx, parentElm);
- newStartVnode = newCh[++newStartIdx];
- }
- if (node) {
- if (BUILD.slotRelocation) {
- parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
- } else {
- oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
- }
- }
- }
- }
- if (oldStartIdx > oldEndIdx) {
- addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode2, newCh, newStartIdx, newEndIdx);
- } else if (BUILD.updatable && newStartIdx > newEndIdx) {
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
- }
- };
- var isSameVnode = (leftVNode, rightVNode) => {
- if (leftVNode.$tag$ === rightVNode.$tag$) {
- if (BUILD.slotRelocation && leftVNode.$tag$ === "slot") {
- return leftVNode.$name$ === rightVNode.$name$;
- }
- if (BUILD.vdomKey) {
- 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) => {
- 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 (!BUILD.vdomText || text === null) {
- if (BUILD.svg) {
- isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
- }
- if (BUILD.vdomAttribute || BUILD.reflect) {
- if (BUILD.slot && tag === "slot")
- ;
- else {
- updateElement(oldVNode, newVNode2, isSvgMode);
- }
- }
- if (BUILD.updatable && oldChildren !== null && newChildren !== null) {
- updateChildren(elm, oldChildren, newVNode2, newChildren);
- } else if (newChildren !== null) {
- if (BUILD.updatable && BUILD.vdomText && oldVNode.$text$ !== null) {
- elm.textContent = "";
- }
- addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
- } else if (BUILD.updatable && oldChildren !== null) {
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
- }
- if (BUILD.svg && isSvgMode && tag === "svg") {
- isSvgMode = false;
- }
- } else if (BUILD.vdomText && BUILD.slotRelocation && (defaultHolder = elm["s-cr"])) {
- defaultHolder.parentNode.textContent = text;
- } else if (BUILD.vdomText && oldVNode.$text$ !== text) {
- elm.data = text;
- }
- };
- var updateFallbackSlotVisibility = (elm) => {
- const childNodes = elm.childNodes;
- let childNode;
- let i2;
- let ilen;
- let j;
- let slotNameAttr;
- let nodeType;
- for (i2 = 0, ilen = childNodes.length; i2 < ilen; i2++) {
- childNode = childNodes[i2];
- if (childNode.nodeType === 1) {
- if (childNode["s-sr"]) {
- slotNameAttr = childNode["s-sn"];
- childNode.hidden = false;
- for (j = 0; j < ilen; j++) {
- nodeType = childNodes[j].nodeType;
- if (childNodes[j]["s-hn"] !== childNode["s-hn"] || slotNameAttr !== "") {
- if (nodeType === 1 && slotNameAttr === childNodes[j].getAttribute("slot")) {
- childNode.hidden = true;
- break;
- }
- } else {
- if (nodeType === 1 || nodeType === 3 && childNodes[j].textContent.trim() !== "") {
- childNode.hidden = true;
- break;
- }
- }
- }
- }
- updateFallbackSlotVisibility(childNode);
- }
- }
- };
- var relocateNodes = [];
- var relocateSlotContent = (elm) => {
- let childNode;
- let node;
- let hostContentNodes;
- let slotNameAttr;
- let relocateNodeData;
- let j;
- let i2 = 0;
- const childNodes = elm.childNodes;
- const ilen = childNodes.length;
- for (; i2 < ilen; i2++) {
- childNode = childNodes[i2];
- if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
- hostContentNodes = node.parentNode.childNodes;
- slotNameAttr = 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"]) {
- if (isNodeLocatedInSlot(node, slotNameAttr)) {
- relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
- checkSlotFallbackVisibility = true;
- node["s-sn"] = node["s-sn"] || slotNameAttr;
- if (relocateNodeData) {
- relocateNodeData.$slotRefNode$ = childNode;
- } else {
- 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) {
- relocateSlotContent(childNode);
- }
- }
- };
- var isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
- if (nodeToRelocate.nodeType === 1) {
- if (nodeToRelocate.getAttribute("slot") === null && slotNameAttr === "") {
- return true;
- }
- if (nodeToRelocate.getAttribute("slot") === slotNameAttr) {
- return true;
- }
- return false;
- }
- if (nodeToRelocate["s-sn"] === slotNameAttr) {
- return true;
- }
- return slotNameAttr === "";
- };
- var callNodeRefs = (vNode) => {
- if (BUILD.vdomRef) {
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
- vNode.$children$ && vNode.$children$.map(callNodeRefs);
- }
- };
- var renderVdom = (hostRef, renderFnResults) => {
- 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 (BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
- throw new Error(`The <Host> must be the single root component.
- Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
- The render() function should look like this instead:
- render() {
- // Do not return an array
- return (
- <Host>{content}</Host>
- );
- }
- `);
- }
- if (BUILD.reflect && cmpMeta.$attrsToReflect$) {
- rootVnode.$attrs$ = rootVnode.$attrs$ || {};
- cmpMeta.$attrsToReflect$.map(([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]);
- }
- rootVnode.$tag$ = null;
- rootVnode.$flags$ |= 4;
- hostRef.$vnode$ = rootVnode;
- rootVnode.$elm$ = oldVNode.$elm$ = BUILD.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
- if (BUILD.scoped || BUILD.shadowDom) {
- scopeId = hostElm["s-sc"];
- }
- if (BUILD.slotRelocation) {
- contentRef = hostElm["s-cr"];
- useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1) !== 0;
- checkSlotFallbackVisibility = false;
- }
- patch(oldVNode, rootVnode);
- if (BUILD.slotRelocation) {
- plt.$flags$ |= 1;
- if (checkSlotRelocate) {
- relocateSlotContent(rootVnode.$elm$);
- let relocateData;
- let nodeToRelocate;
- let orgLocationNode;
- let parentNodeRef;
- let insertBeforeNode;
- let refNode;
- let i2 = 0;
- for (; i2 < relocateNodes.length; i2++) {
- relocateData = relocateNodes[i2];
- nodeToRelocate = relocateData.$nodeToRelocate$;
- if (!nodeToRelocate["s-ol"]) {
- orgLocationNode = BUILD.isDebug || BUILD.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
- orgLocationNode["s-nr"] = nodeToRelocate;
- nodeToRelocate.parentNode.insertBefore(nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
- }
- }
- for (i2 = 0; i2 < relocateNodes.length; i2++) {
- relocateData = relocateNodes[i2];
- nodeToRelocate = relocateData.$nodeToRelocate$;
- if (relocateData.$slotRefNode$) {
- parentNodeRef = relocateData.$slotRefNode$.parentNode;
- insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
- orgLocationNode = nodeToRelocate["s-ol"];
- while (orgLocationNode = orgLocationNode.previousSibling) {
- refNode = orgLocationNode["s-nr"];
- if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === refNode.parentNode) {
- refNode = refNode.nextSibling;
- if (!refNode || !refNode["s-nr"]) {
- insertBeforeNode = refNode;
- break;
- }
- }
- }
- 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;
- }
- parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
- }
- }
- } else {
- if (nodeToRelocate.nodeType === 1) {
- nodeToRelocate.hidden = true;
- }
- }
- }
- }
- if (checkSlotFallbackVisibility) {
- updateFallbackSlotVisibility(rootVnode.$elm$);
- }
- plt.$flags$ &= ~1;
- relocateNodes.length = 0;
- }
- };
- var slotReferenceDebugNode = (slotVNode) => doc.createComment(`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`);
- var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(`org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`));
- var attachToAncestor = (hostRef, ancestorComponent) => {
- if (BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
- ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
- }
- };
- var scheduleUpdate = (hostRef, isInitialLoad) => {
- if (BUILD.taskQueue && BUILD.updatable) {
- hostRef.$flags$ |= 16;
- }
- if (BUILD.asyncLoading && hostRef.$flags$ & 4) {
- hostRef.$flags$ |= 512;
- return;
- }
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
- return BUILD.taskQueue ? writeTask(dispatch) : dispatch();
- };
- var dispatchHooks = (hostRef, isInitialLoad) => {
- const elm = hostRef.$hostElement$;
- const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
- const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
- let promise;
- if (isInitialLoad) {
- if (BUILD.lazyLoad && BUILD.hostListener) {
- hostRef.$flags$ |= 256;
- if (hostRef.$queuedListeners$) {
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
- hostRef.$queuedListeners$ = null;
- }
- }
- emitLifecycleEvent(elm, "componentWillLoad");
- if (BUILD.cmpWillLoad) {
- promise = safeCall(instance, "componentWillLoad");
- }
- } else {
- emitLifecycleEvent(elm, "componentWillUpdate");
- if (BUILD.cmpWillUpdate) {
- promise = safeCall(instance, "componentWillUpdate");
- }
- }
- emitLifecycleEvent(elm, "componentWillRender");
- if (BUILD.cmpWillRender) {
- promise = then(promise, () => safeCall(instance, "componentWillRender"));
- }
- endSchedule();
- return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
- };
- var updateComponent = async (hostRef, instance, isInitialLoad) => {
- const elm = hostRef.$hostElement$;
- const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
- const rc = elm["s-rc"];
- if (BUILD.style && isInitialLoad) {
- attachStyles(hostRef);
- }
- const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
- if (BUILD.isDev) {
- hostRef.$flags$ |= 1024;
- }
- if (BUILD.hydrateServerSide) {
- await callRender(hostRef, instance, elm);
- } else {
- callRender(hostRef, instance, elm);
- }
- if (BUILD.cssVarShim && plt.$cssShim$) {
- plt.$cssShim$.updateHost(elm);
- }
- if (BUILD.isDev) {
- hostRef.$renderCount$++;
- hostRef.$flags$ &= ~1024;
- }
- if (BUILD.hydrateServerSide) {
- try {
- serverSideConnected(elm);
- if (isInitialLoad) {
- if (hostRef.$cmpMeta$.$flags$ & 1) {
- elm["s-en"] = "";
- } else if (hostRef.$cmpMeta$.$flags$ & 2) {
- elm["s-en"] = "c";
- }
- }
- } catch (e) {
- consoleError(e, elm);
- }
- }
- if (BUILD.asyncLoading && rc) {
- rc.map((cb) => cb());
- elm["s-rc"] = void 0;
- }
- endRender();
- endUpdate();
- if (BUILD.asyncLoading) {
- const childrenPromises = elm["s-p"];
- const postUpdate = () => postUpdateComponent(hostRef);
- if (childrenPromises.length === 0) {
- postUpdate();
- } else {
- Promise.all(childrenPromises).then(postUpdate);
- hostRef.$flags$ |= 4;
- childrenPromises.length = 0;
- }
- } else {
- postUpdateComponent(hostRef);
- }
- };
- var callRender = (hostRef, instance, elm) => {
- const allRenderFn = BUILD.allRenderFn ? true : false;
- const lazyLoad = BUILD.lazyLoad ? true : false;
- const taskQueue = BUILD.taskQueue ? true : false;
- const updatable = BUILD.updatable ? true : false;
- try {
- renderingRef = instance;
- instance = allRenderFn ? instance.render() : instance.render && instance.render();
- if (updatable && taskQueue) {
- hostRef.$flags$ &= ~16;
- }
- if (updatable || lazyLoad) {
- hostRef.$flags$ |= 2;
- }
- if (BUILD.hasRenderFn || BUILD.reflect) {
- if (BUILD.vdomRender || BUILD.reflect) {
- if (BUILD.hydrateServerSide) {
- return Promise.resolve(instance).then((value) => renderVdom(hostRef, value));
- } else {
- renderVdom(hostRef, instance);
- }
- } else {
- elm.textContent = instance;
- }
- }
- } catch (e) {
- consoleError(e, hostRef.$hostElement$);
- }
- renderingRef = null;
- return null;
- };
- var postUpdateComponent = (hostRef) => {
- const tagName = hostRef.$cmpMeta$.$tagName$;
- const elm = hostRef.$hostElement$;
- const endPostUpdate = createTime("postUpdate", tagName);
- const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
- const ancestorComponent = hostRef.$ancestorComponent$;
- if (BUILD.cmpDidRender) {
- if (BUILD.isDev) {
- hostRef.$flags$ |= 1024;
- }
- safeCall(instance, "componentDidRender");
- if (BUILD.isDev) {
- hostRef.$flags$ &= ~1024;
- }
- }
- emitLifecycleEvent(elm, "componentDidRender");
- if (!(hostRef.$flags$ & 64)) {
- hostRef.$flags$ |= 64;
- if (BUILD.asyncLoading && BUILD.cssAnnotations) {
- addHydratedFlag(elm);
- }
- if (BUILD.cmpDidLoad) {
- if (BUILD.isDev) {
- hostRef.$flags$ |= 2048;
- }
- safeCall(instance, "componentDidLoad");
- if (BUILD.isDev) {
- hostRef.$flags$ &= ~2048;
- }
- }
- emitLifecycleEvent(elm, "componentDidLoad");
- endPostUpdate();
- if (BUILD.asyncLoading) {
- hostRef.$onReadyResolve$(elm);
- if (!ancestorComponent) {
- appDidLoad(tagName);
- }
- }
- } else {
- if (BUILD.cmpDidUpdate) {
- if (BUILD.isDev) {
- hostRef.$flags$ |= 1024;
- }
- safeCall(instance, "componentDidUpdate");
- if (BUILD.isDev) {
- hostRef.$flags$ &= ~1024;
- }
- }
- emitLifecycleEvent(elm, "componentDidUpdate");
- endPostUpdate();
- }
- if (BUILD.hotModuleReplacement) {
- elm["s-hmr-load"] && elm["s-hmr-load"]();
- }
- if (BUILD.method && BUILD.lazyLoad) {
- hostRef.$onInstanceResolve$(elm);
- }
- if (BUILD.asyncLoading) {
- if (hostRef.$onRenderResolve$) {
- hostRef.$onRenderResolve$();
- hostRef.$onRenderResolve$ = void 0;
- }
- if (hostRef.$flags$ & 512) {
- nextTick(() => scheduleUpdate(hostRef, false));
- }
- hostRef.$flags$ &= ~(4 | 512);
- }
- };
- var forceUpdate = (ref) => {
- if (BUILD.updatable) {
- const hostRef = getHostRef(ref);
- const isConnected = hostRef.$hostElement$.isConnected;
- if (isConnected && (hostRef.$flags$ & (2 | 16)) === 2) {
- scheduleUpdate(hostRef, false);
- }
- return isConnected;
- }
- return false;
- };
- var appDidLoad = (who) => {
- if (BUILD.cssAnnotations) {
- addHydratedFlag(doc.documentElement);
- }
- if (BUILD.asyncQueue) {
- plt.$flags$ |= 2;
- }
- nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
- if (BUILD.profile && performance.measure) {
- performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
- }
- };
- var safeCall = (instance, method, arg) => {
- if (instance && instance[method]) {
- try {
- return instance[method](arg);
- } catch (e) {
- consoleError(e);
- }
- }
- return void 0;
- };
- var then = (promise, thenFn) => {
- return promise && promise.then ? promise.then(thenFn) : thenFn();
- };
- var emitLifecycleEvent = (elm, lifecycleName) => {
- if (BUILD.lifecycleDOMEvents) {
- emitEvent(elm, "stencil_" + lifecycleName, {
- bubbles: true,
- composed: true,
- detail: {
- namespace: NAMESPACE
- }
- });
- }
- };
- var addHydratedFlag = (elm) => BUILD.hydratedClass ? elm.classList.add("hydrated") : BUILD.hydratedAttribute ? elm.setAttribute("hydrated", "") : void 0;
- 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);
- }
- }
- };
- var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
- var setValue = (ref, propName, newVal, cmpMeta) => {
- const hostRef = getHostRef(ref);
- const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : ref;
- const oldVal = hostRef.$instanceValues$.get(propName);
- const flags = hostRef.$flags$;
- const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
- const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
- const didValueChange = newVal !== oldVal && !areBothNaN;
- if ((!BUILD.lazyLoad || !(flags & 8) || oldVal === void 0) && didValueChange) {
- hostRef.$instanceValues$.set(propName, newVal);
- if (BUILD.isDev) {
- if (hostRef.$flags$ & 1024) {
- consoleDevWarn(`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`, "\nElement", elm, "\nNew value", newVal, "\nOld value", oldVal);
- } else if (hostRef.$flags$ & 2048) {
- consoleDevWarn(`The state/prop "${propName}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`, "\nElement", elm, "\nNew value", newVal, "\nOld value", oldVal);
- }
- }
- if (!BUILD.lazyLoad || instance) {
- if (BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128) {
- const watchMethods = cmpMeta.$watchers$[propName];
- if (watchMethods) {
- watchMethods.map((watchMethodName) => {
- try {
- instance[watchMethodName](newVal, oldVal, propName);
- } catch (e) {
- consoleError(e, elm);
- }
- });
- }
- }
- if (BUILD.updatable && (flags & (2 | 16)) === 2) {
- if (BUILD.cmpShouldUpdate && instance.componentShouldUpdate) {
- if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
- return;
- }
- }
- scheduleUpdate(hostRef, false);
- }
- }
- }
- };
- var proxyComponent = (Cstr, cmpMeta, flags) => {
- if (BUILD.member && cmpMeta.$members$) {
- if (BUILD.watchCallback && Cstr.watchers) {
- cmpMeta.$watchers$ = Cstr.watchers;
- }
- const members = Object.entries(cmpMeta.$members$);
- const prototype = Cstr.prototype;
- members.map(([memberName, [memberFlags]]) => {
- if ((BUILD.prop || BUILD.state) && (memberFlags & 31 || (!BUILD.lazyLoad || flags & 2) && memberFlags & 32)) {
- Object.defineProperty(prototype, memberName, {
- get() {
- return getValue(this, memberName);
- },
- set(newValue) {
- if (BUILD.isDev) {
- const ref = getHostRef(this);
- if ((flags & 1) === 0 && (ref.$flags$ & 8) === 0 && (memberFlags & 31) !== 0 && (memberFlags & 1024) === 0) {
- consoleDevWarn(`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.
- More information: https://stenciljs.com/docs/properties#prop-mutability`);
- }
- }
- setValue(this, memberName, newValue, cmpMeta);
- },
- configurable: true,
- enumerable: true
- });
- } else if (BUILD.lazyLoad && BUILD.method && flags & 1 && memberFlags & 64) {
- Object.defineProperty(prototype, memberName, {
- value(...args) {
- const ref = getHostRef(this);
- return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args));
- }
- });
- }
- });
- if (BUILD.observeAttribute && (!BUILD.lazyLoad || flags & 1)) {
- const attrNameToPropName = /* @__PURE__ */ new Map();
- prototype.attributeChangedCallback = function(attrName, _oldValue, newValue) {
- plt.jmp(() => {
- const propName = attrNameToPropName.get(attrName);
- if (this.hasOwnProperty(propName)) {
- newValue = this[propName];
- delete this[propName];
- } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && this[propName] == newValue) {
- return;
- }
- this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
- });
- };
- Cstr.observedAttributes = members.filter(([_, m]) => m[0] & 15).map(([propName, m]) => {
- const attrName = m[1] || propName;
- attrNameToPropName.set(attrName, propName);
- if (BUILD.reflect && m[0] & 512) {
- cmpMeta.$attrsToReflect$.push([propName, attrName]);
- }
- return attrName;
- });
- }
- }
- return Cstr;
- };
- var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
- if ((BUILD.lazyLoad || BUILD.hydrateServerSide || BUILD.style) && (hostRef.$flags$ & 32) === 0) {
- if (BUILD.lazyLoad || BUILD.hydrateClientSide) {
- hostRef.$flags$ |= 32;
- Cstr = loadModule(cmpMeta, hostRef, hmrVersionId);
- if (Cstr.then) {
- const endLoad = uniqueTime(`st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`, `[Stencil] Load module for <${cmpMeta.$tagName$}>`);
- Cstr = await Cstr;
- endLoad();
- }
- if ((BUILD.isDev || BUILD.isDebug) && !Cstr) {
- throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
- }
- if (BUILD.member && !Cstr.isProxied) {
- if (BUILD.watchCallback) {
- cmpMeta.$watchers$ = Cstr.watchers;
- }
- proxyComponent(Cstr, cmpMeta, 2);
- Cstr.isProxied = true;
- }
- const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
- if (BUILD.member) {
- hostRef.$flags$ |= 8;
- }
- try {
- new Cstr(hostRef);
- } catch (e) {
- consoleError(e);
- }
- if (BUILD.member) {
- hostRef.$flags$ &= ~8;
- }
- if (BUILD.watchCallback) {
- hostRef.$flags$ |= 128;
- }
- endNewInstance();
- fireConnectedCallback(hostRef.$lazyInstance$);
- } else {
- Cstr = elm.constructor;
- hostRef.$flags$ |= 32;
- customElements.whenDefined(cmpMeta.$tagName$).then(() => hostRef.$flags$ |= 128);
- }
- if (BUILD.style && Cstr.style) {
- let style = Cstr.style;
- if (BUILD.mode && typeof style !== "string") {
- style = style[hostRef.$modeName$ = computeMode(elm)];
- if (BUILD.hydrateServerSide && hostRef.$modeName$) {
- elm.setAttribute("s-mode", hostRef.$modeName$);
- }
- }
- const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
- if (!styles.has(scopeId2)) {
- const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
- if (!BUILD.hydrateServerSide && BUILD.shadowDom && BUILD.shadowDomShim && cmpMeta.$flags$ & 8) {
- style = await import("./shadow-css-YOETQ6TH.js").then((m) => m.scopeCss(style, scopeId2, false));
- }
- registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1));
- endRegisterStyles();
- }
- }
- }
- const ancestorComponent = hostRef.$ancestorComponent$;
- const schedule = () => scheduleUpdate(hostRef, true);
- if (BUILD.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
- ancestorComponent["s-rc"].push(schedule);
- } else {
- schedule();
- }
- };
- var fireConnectedCallback = (instance) => {
- if (BUILD.lazyLoad && BUILD.connectedCallback) {
- safeCall(instance, "connectedCallback");
- }
- };
- var connectedCallback = (elm) => {
- if ((plt.$flags$ & 1) === 0) {
- const hostRef = getHostRef(elm);
- const cmpMeta = hostRef.$cmpMeta$;
- const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
- if (BUILD.hostListenerTargetParent) {
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
- }
- if (!(hostRef.$flags$ & 1)) {
- hostRef.$flags$ |= 1;
- let hostId;
- if (BUILD.hydrateClientSide) {
- hostId = elm.getAttribute(HYDRATE_ID);
- if (hostId) {
- if (BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1) {
- const scopeId2 = BUILD.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
- elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
- }
- initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
- }
- }
- if (BUILD.slotRelocation && !hostId) {
- if (BUILD.hydrateServerSide || (BUILD.slot || BUILD.shadowDom) && cmpMeta.$flags$ & (4 | 8)) {
- setContentReference(elm);
- }
- }
- if (BUILD.asyncLoading) {
- let ancestorComponent = elm;
- while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
- if (BUILD.hydrateClientSide && ancestorComponent.nodeType === 1 && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
- attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
- break;
- }
- }
- }
- if (BUILD.prop && !BUILD.hydrateServerSide && cmpMeta.$members$) {
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
- if (memberFlags & 31 && elm.hasOwnProperty(memberName)) {
- const value = elm[memberName];
- delete elm[memberName];
- elm[memberName] = value;
- }
- });
- }
- if (BUILD.initializeNextTick) {
- nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
- } else {
- initializeComponent(elm, hostRef, cmpMeta);
- }
- } else {
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
- fireConnectedCallback(hostRef.$lazyInstance$);
- }
- endConnected();
- }
- };
- var setContentReference = (elm) => {
- const contentRefElm = elm["s-cr"] = doc.createComment(BUILD.isDebug ? `content-ref (host=${elm.localName})` : "");
- contentRefElm["s-cn"] = true;
- elm.insertBefore(contentRefElm, elm.firstChild);
- };
- var disconnectedCallback = (elm) => {
- if ((plt.$flags$ & 1) === 0) {
- const hostRef = getHostRef(elm);
- const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
- if (BUILD.hostListener) {
- if (hostRef.$rmListeners$) {
- hostRef.$rmListeners$.map((rmListener) => rmListener());
- hostRef.$rmListeners$ = void 0;
- }
- }
- if (BUILD.cssVarShim && plt.$cssShim$) {
- plt.$cssShim$.removeHost(elm);
- }
- if (BUILD.lazyLoad && BUILD.disconnectedCallback) {
- safeCall(instance, "disconnectedCallback");
- }
- if (BUILD.cmpDidUnload) {
- safeCall(instance, "componentDidUnload");
- }
- }
- };
- var proxyCustomElement = (Cstr, compactMeta) => {
- const cmpMeta = {
- $flags$: compactMeta[0],
- $tagName$: compactMeta[1]
- };
- if (BUILD.member) {
- cmpMeta.$members$ = compactMeta[2];
- }
- if (BUILD.hostListener) {
- cmpMeta.$listeners$ = compactMeta[3];
- }
- if (BUILD.watchCallback) {
- cmpMeta.$watchers$ = Cstr.$watchers$;
- }
- if (BUILD.reflect) {
- cmpMeta.$attrsToReflect$ = [];
- }
- if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1) {
- cmpMeta.$flags$ |= 8;
- }
- const originalConnectedCallback = Cstr.prototype.connectedCallback;
- const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
- Object.assign(Cstr.prototype, {
- __registerHost() {
- registerHost(this, cmpMeta);
- },
- connectedCallback() {
- connectedCallback(this);
- if (BUILD.connectedCallback && originalConnectedCallback) {
- originalConnectedCallback.call(this);
- }
- },
- disconnectedCallback() {
- disconnectedCallback(this);
- if (BUILD.disconnectedCallback && originalDisconnectedCallback) {
- originalDisconnectedCallback.call(this);
- }
- },
- __attachShadow() {
- if (supportsShadow) {
- if (BUILD.shadowDelegatesFocus) {
- this.attachShadow({
- mode: "open",
- delegatesFocus: !!(cmpMeta.$flags$ & 16)
- });
- } else {
- this.attachShadow({ mode: "open" });
- }
- } else {
- this.shadowRoot = this;
- }
- }
- });
- Cstr.is = cmpMeta.$tagName$;
- return proxyComponent(Cstr, cmpMeta, 1 | 2);
- };
- var Fragment = (_, children) => children;
- var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
- if (BUILD.hostListener && listeners) {
- if (BUILD.hostListenerTargetParent) {
- if (attachParentListeners) {
- listeners = listeners.filter(([flags]) => flags & 32);
- } else {
- listeners = listeners.filter(([flags]) => !(flags & 32));
- }
- }
- listeners.map(([flags, name, method]) => {
- const target = BUILD.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
- 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) => {
- try {
- if (BUILD.lazyLoad) {
- if (hostRef.$flags$ & 256) {
- hostRef.$lazyInstance$[methodName](ev);
- } else {
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
- }
- } else {
- hostRef.$hostElement$[methodName](ev);
- }
- } catch (e) {
- consoleError(e);
- }
- };
- var getHostListenerTarget = (elm, flags) => {
- if (BUILD.hostListenerTargetDocument && flags & 4)
- return doc;
- if (BUILD.hostListenerTargetWindow && flags & 8)
- return win;
- if (BUILD.hostListenerTargetBody && flags & 16)
- return doc.body;
- if (BUILD.hostListenerTargetParent && flags & 32)
- return elm.parentElement;
- return elm;
- };
- var hostListenerOpts = (flags) => supportsListenerOptions ? {
- passive: (flags & 1) !== 0,
- capture: (flags & 2) !== 0
- } : (flags & 2) !== 0;
- var hostRefs = /* @__PURE__ */ new WeakMap();
- var getHostRef = (ref) => hostRefs.get(ref);
- var registerHost = (elm, cmpMeta) => {
- const hostRef = {
- $flags$: 0,
- $hostElement$: elm,
- $cmpMeta$: cmpMeta,
- $instanceValues$: /* @__PURE__ */ new Map()
- };
- if (BUILD.isDev) {
- hostRef.$renderCount$ = 0;
- }
- if (BUILD.method && BUILD.lazyLoad) {
- hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r);
- }
- if (BUILD.asyncLoading) {
- hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
- elm["s-p"] = [];
- elm["s-rc"] = [];
- }
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
- return hostRefs.set(elm, hostRef);
- };
- var isMemberInElement = (elm, memberName) => memberName in elm;
- var consoleError = (e, el) => (customError || console.error)(e, el);
- var STENCIL_DEV_MODE = BUILD.isTesting ? ["STENCIL:"] : [
- "%cstencil",
- "color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"
- ];
- var consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);
- var consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
- var cmpModules = /* @__PURE__ */ new Map();
- var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
- const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
- const bundleId = cmpMeta.$lazyBundleId$;
- if (BUILD.isDev && typeof bundleId !== "string") {
- consoleDevError(`Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`);
- return void 0;
- }
- const module = !BUILD.hotModuleReplacement ? cmpModules.get(bundleId) : false;
- if (module) {
- return module[exportName];
- }
- return import(
- /* @vite-ignore */
- /* webpackInclude: /\.entry\.js$/ */
- /* webpackExclude: /\.system\.entry\.js$/ */
- /* webpackMode: "lazy" */
- `./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? "?s-hmr=" + hmrVersionId : ""}`
- ).then((importedModule) => {
- if (!BUILD.hotModuleReplacement) {
- cmpModules.set(bundleId, importedModule);
- }
- return importedModule[exportName];
- }, consoleError);
- };
- var styles = /* @__PURE__ */ new Map();
- var modeResolutionChain = [];
- var win = typeof window !== "undefined" ? window : {};
- var CSS = BUILD.cssVarShim ? win.CSS : null;
- var doc = win.document || { head: {} };
- var H = win.HTMLElement || class {
- };
- 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 CustomEvent(eventName, opts)
- };
- var supportsShadow = BUILD.shadowDomShim && BUILD.shadowDom ? (() => (doc.head.attachShadow + "").indexOf("[native") > -1)() : true;
- var supportsListenerOptions = (() => {
- let supportsListenerOptions2 = false;
- try {
- doc.addEventListener("e", null, Object.defineProperty({}, "passive", {
- get() {
- supportsListenerOptions2 = true;
- }
- }));
- } catch (e) {
- }
- return supportsListenerOptions2;
- })();
- var promiseResolve = (v) => Promise.resolve(v);
- var supportsConstructableStylesheets = BUILD.constructableCSS ? (() => {
- try {
- new CSSStyleSheet();
- return typeof new CSSStyleSheet().replaceSync === "function";
- } catch (e) {
- }
- return false;
- })() : false;
- var queueDomReads = [];
- var queueDomWrites = [];
- var queueDomWritesLow = [];
- var queueTask = (queue, write) => (cb) => {
- queue.push(cb);
- if (!queuePending) {
- queuePending = true;
- if (write && plt.$flags$ & 4) {
- nextTick(flush);
- } else {
- plt.raf(flush);
- }
- }
- };
- var consume = (queue) => {
- for (let i2 = 0; i2 < queue.length; i2++) {
- try {
- queue[i2](performance.now());
- } catch (e) {
- consoleError(e);
- }
- }
- queue.length = 0;
- };
- var consumeTimeout = (queue, timeout) => {
- let i2 = 0;
- let ts = 0;
- while (i2 < queue.length && (ts = performance.now()) < timeout) {
- try {
- queue[i2++](ts);
- } catch (e) {
- consoleError(e);
- }
- }
- if (i2 === queue.length) {
- queue.length = 0;
- } else if (i2 !== 0) {
- queue.splice(0, i2);
- }
- };
- var flush = () => {
- if (BUILD.asyncQueue) {
- queueCongestion++;
- }
- consume(queueDomReads);
- if (BUILD.asyncQueue) {
- const timeout = (plt.$flags$ & 6) === 2 ? performance.now() + 14 * Math.ceil(queueCongestion * (1 / 10)) : Infinity;
- consumeTimeout(queueDomWrites, timeout);
- consumeTimeout(queueDomWritesLow, timeout);
- if (queueDomWrites.length > 0) {
- queueDomWritesLow.push(...queueDomWrites);
- queueDomWrites.length = 0;
- }
- if (queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0) {
- plt.raf(flush);
- } else {
- queueCongestion = 0;
- }
- } else {
- consume(queueDomWrites);
- if (queuePending = queueDomReads.length > 0) {
- plt.raf(flush);
- }
- }
- };
- var nextTick = (cb) => promiseResolve().then(cb);
- var readTask = queueTask(queueDomReads, false);
- var writeTask = queueTask(queueDomWrites, true);
- export {
- Build,
- getAssetPath,
- setAssetPath,
- h,
- Host,
- createEvent,
- forceUpdate,
- proxyCustomElement,
- Fragment,
- H
- };
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
- //# sourceMappingURL=chunk-IOZKU7B2.js.map
|