stencil-quill
Version:
Native web component for quill editor
3 lines • 31.3 kB
JavaScript
var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return e(t,r)};return function(t,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function o(e){try{s(n.next(e))}catch(e){a(e)}}function l(e){try{s(n["throw"](e))}catch(e){a(e)}}function s(e){e.done?r(e.value):i(e.value).then(o,l)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(e){return function(t){return s([e,t])}}function s(l){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,l[0]&&(r=0)),r)try{if(n=1,i&&(a=l[0]&2?i["return"]:l[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;if(i=0,a)l=[l[0]&2,a.value];switch(l[0]){case 0:case 1:a=l;break;case 4:r.label++;return{value:l[1],done:false};case 5:r.label++;i=l[1];l=[0];continue;case 7:l=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1];a=l;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(l);break}if(a[2])r.ops.pop();r.trys.pop();continue}l=t.call(e,r)}catch(e){l=[6,e];i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++){if(a||!(n in t)){if(!a)a=Array.prototype.slice.call(t,0,n);a[n]=t[n]}}return e.concat(a||Array.prototype.slice.call(t))};var NAMESPACE="quill-components";var BUILD={allRenderFn:true,appendChildSlotFix:false,asyncLoading:true,asyncQueue:false,attachStyles:true,cloneNodeFix:false,constructableCSS:true,cssAnnotations:true,devTools:false,element:false,event:true,experimentalScopedSlotChanges:false,experimentalSlotFixes:false,formAssociated:false,hasRenderFn:true,hostListener:false,hostListenerTarget:false,hostListenerTargetBody:false,hostListenerTargetDocument:false,hostListenerTargetParent:false,hostListenerTargetWindow:false,hotModuleReplacement:false,hydrateClientSide:false,hydrateServerSide:false,hydratedAttribute:false,hydratedClass:true,hydratedSelectorName:"hydrated",initializeNextTick:false,invisiblePrehydration:true,isDebug:false,isDev:false,isTesting:false,lazyLoad:true,lifecycle:true,lifecycleDOMEvents:false,member:true,method:false,mode:false,modernPropertyDecls:false,observeAttribute:true,profile:false,prop:true,propBoolean:true,propMutable:false,propNumber:false,propString:true,reflect:false,scoped:true,scopedSlotTextContentFix:false,scriptDataOpts:false,shadowDelegatesFocus:false,shadowDom:false,slot:true,slotChildNodesFix:false,slotRelocation:true,state:false,style:true,svg:false,taskQueue:true,transformTagName:false,updatable:true,vdomAttribute:true,vdomClass:true,vdomFunctional:false,vdomKey:true,vdomListener:false,vdomPropOrAttr:true,vdomRef:true,vdomRender:true,vdomStyle:false,vdomText:false,vdomXlink:false,watchCallback:true};var __defProp=Object.defineProperty;var __export=function(e,t){for(var r in t)__defProp(e,r,{get:t[r],enumerable:true})};var getHostRef=function(e){if(e.__stencil__getHostRef){return e.__stencil__getHostRef()}return void 0};var registerInstance=function(e,t){e.__stencil__getHostRef=function(){return t};t.t=e};var registerHost=function(e,t){var r={i:0,$hostElement$:e,o:t,l:new Map};{r.u=new Promise((function(e){return r.v=e}));e["s-p"]=[];e["s-rc"]=[]}var n=r;e.__stencil__getHostRef=function(){return n};return n};var isMemberInElement=function(e,t){return t in e};var consoleError=function(e,t){return(0,console.error)(e,t)};var cmpModules=new Map;var loadModule=function(e,t,r){var n=e.p.replace(/-/g,"_");var i=e.m;if(!i){return void 0}var a=cmpModules.get(i);if(a){return a[n]}
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/return import("./".concat(i,".entry.js").concat("")).then((function(e){{cmpModules.set(i,e)}return e[n]}),(function(e){consoleError(e,t.$hostElement$)}))};var styles=new Map;var HYDRATED_STYLE_ID="sty-id";var HYDRATED_CSS="{visibility:hidden}.hydrated{visibility:inherit}";var SLOT_FB_CSS="slot-fb{display:contents}slot-fb[hidden]{display:none}";var win=typeof window!=="undefined"?window:{};var plt={i:0,h:"",jmp:function(e){return e()},raf:function(e){return requestAnimationFrame(e)},ael:function(e,t,r,n){return e.addEventListener(t,r,n)},rel:function(e,t,r,n){return e.removeEventListener(t,r,n)},ce:function(e,t){return new CustomEvent(e,t)}};var supportsShadow=BUILD.shadowDom;var promiseResolve=function(e){return Promise.resolve(e)};var supportsConstructableStylesheets=function(){try{new CSSStyleSheet;return typeof(new CSSStyleSheet).replaceSync==="function"}catch(e){}return false}();var queuePending=false;var queueDomReads=[];var queueDomWrites=[];var queueTask=function(e,t){return function(r){e.push(r);if(!queuePending){queuePending=true;if(t&&plt.i&4){nextTick(flush)}else{plt.raf(flush)}}}};var consume=function(e){for(var t=0;t<e.length;t++){try{e[t](performance.now())}catch(e){consoleError(e)}}e.length=0};var flush=function(){consume(queueDomReads);{consume(queueDomWrites);if(queuePending=queueDomReads.length>0){plt.raf(flush)}}};var nextTick=function(e){return promiseResolve().then(e)};var writeTask=queueTask(queueDomWrites,true);var isDef=function(e){return e!=null&&e!==void 0};var isComplexType=function(e){e=typeof e;return e==="object"||e==="function"};function queryNonceMetaTagContent(e){var t,r,n;return(n=(r=(t=e.head)==null?void 0:t.querySelector('meta[name="csp-nonce"]'))==null?void 0:r.getAttribute("content"))!=null?n:void 0}var result_exports={};__export(result_exports,{err:function(){return err},map:function(){return map},ok:function(){return ok},unwrap:function(){return unwrap},unwrapErr:function(){return unwrapErr}});var ok=function(e){return{isOk:true,isErr:false,value:e}};var err=function(e){return{isOk:false,isErr:true,value:e}};function map(e,t){if(e.isOk){var r=t(e.value);if(r instanceof Promise){return r.then((function(e){return ok(e)}))}else{return ok(r)}}if(e.isErr){var n=e.value;return err(n)}throw"should never get here"}var unwrap=function(e){if(e.isOk){return e.value}else{throw e.value}};var unwrapErr=function(e){if(e.isErr){return e.value}else{throw e.value}};var updateFallbackSlotVisibility=function(e){var t=internalCall(e,"childNodes");if(e.tagName&&e.tagName.includes("-")&&e["s-cr"]&&e.tagName!=="SLOT-FB"){getHostSlotNodes(t,e.tagName).forEach((function(e){if(e.nodeType===1&&e.tagName==="SLOT-FB"){if(getSlotChildSiblings(e,getSlotName(e),false).length){e.hidden=true}else{e.hidden=false}}}))}var r=0;for(r=0;r<t.length;r++){var n=t[r];if(n.nodeType===1&&internalCall(n,"childNodes").length){updateFallbackSlotVisibility(n)}}};var getSlottedChildNodes=function(e){var t=[];for(var r=0;r<e.length;r++){var n=e[r]["s-nr"]||void 0;if(n&&n.isConnected){t.push(n)}}return t};function getHostSlotNodes(e,t,r){var n=0;var i=[];var a;for(;n<e.length;n++){a=e[n];if(a["s-sr"]&&(!t||a["s-hn"]===t)&&(r===void 0||getSlotName(a)===r)){i.push(a);if(typeof r!=="undefined")return i}i=__spreadArray(__spreadArray([],i,true),getHostSlotNodes(a.childNodes,t,r),true)}return i}var getSlotChildSiblings=function(e,t,r){if(r===void 0){r=true}var n=[];if(r&&e["s-sr"]||!e["s-sr"])n.push(e);var i=e;while(i=i.nextSibling){if(getSlotName(i)===t&&(r||!i["s-sr"]))n.push(i)}return n};var isNodeLocatedInSlot=function(e,t){if(e.nodeType===1){if(e.getAttribute("slot")===null&&t===""){return true}if(e.getAttribute("slot")===t){return true}return false}if(e["s-sn"]===t){return true}return t===""};var getSlotName=function(e){return typeof e["s-sn"]==="string"?e["s-sn"]:e.nodeType===1&&e.getAttribute("slot")||void 0};function patchSlotNode(e){if(e.assignedElements||e.assignedNodes||!e["s-sr"])return;var t=function(t){return function(e){var r=[];var n=this["s-sn"];if(e==null?void 0:e.flatten){console.error("\n Flattening is not supported for Stencil non-shadow slots. \n You can use `.childNodes` to nested slot fallback content.\n If you have a particular use case, please open an issue on the Stencil repo.\n ")}var i=this["s-cr"].parentElement;var a=i.__childNodes?i.childNodes:getSlottedChildNodes(i.childNodes);a.forEach((function(e){if(n===getSlotName(e)){r.push(e)}}));if(t){return r.filter((function(e){return e.nodeType===1}))}return r}.bind(e)};e.assignedElements=t(true);e.assignedNodes=t(false)}function internalCall(e,t){if("__"+t in e){var r=e["__"+t];if(typeof r!=="function")return r;return r.bind(e)}else{if(typeof e[t]!=="function")return e[t];return e[t].bind(e)}}var createTime=function(e,t){if(t===void 0){t=""}{return function(){return}}};var uniqueTime=function(e,t){{return function(){return}}};var h=function(e,t){var r=[];for(var n=2;n<arguments.length;n++){r[n-2]=arguments[n]}var i=null;var a=null;var o=null;var l=false;var s=false;var u=[];var f=function(t){for(var r=0;r<t.length;r++){i=t[r];if(Array.isArray(i)){f(i)}else if(i!=null&&typeof i!=="boolean"){if(l=typeof e!=="function"&&!isComplexType(i)){i=String(i)}if(l&&s){u[u.length-1].S+=i}else{u.push(l?newVNode(null,i):i)}s=l}}};f(r);if(t){if(t.key){a=t.key}if(t.name){o=t.name}{var c=t.className||t.class;if(c){t.class=typeof c!=="object"?c:Object.keys(c).filter((function(e){return c[e]})).join(" ")}}}var v=newVNode(e,null);v.C=t;if(u.length>0){v.k=u}{v.N=a}{v._=o}return v};var newVNode=function(e,t){var r={i:0,T:e,S:t,R:null,k:null};{r.C=null}{r.N=null}{r._=null}return r};var Host={};var isHost=function(e){return e&&e.T===Host};var parsePropertyValue=function(e,t){if(e!=null&&!isComplexType(e)){if(t&4){return e==="false"?false:e===""||!!e}if(t&1){return String(e)}return e}return e};var getElement=function(e){return getHostRef(e).$hostElement$};var createEvent=function(e,t,r){var n=getElement(e);return{emit:function(e){return emitEvent(n,t,{bubbles:!!(r&4),composed:!!(r&2),cancelable:!!(r&1),detail:e})}}};var emitEvent=function(e,t,r){var n=plt.ce(t,r);e.dispatchEvent(n);return n};var rootAppliedStyles=new WeakMap;var registerStyle=function(e,t,r){var n=styles.get(e);if(supportsConstructableStylesheets&&r){n=n||new CSSStyleSheet;if(typeof n==="string"){n=t}else{n.replaceSync(t)}}else{n=t}styles.set(e,n)};var addStyle=function(e,t,r){var n;var i=getScopeId(t);var a=styles.get(i);if(!win.document){return i}e=e.nodeType===11?e:win.document;if(a){if(typeof a==="string"){e=e.head||e;var o=rootAppliedStyles.get(e);var l=void 0;if(!o){rootAppliedStyles.set(e,o=new Set)}if(!o.has(i)){{l=document.querySelector("[".concat(HYDRATED_STYLE_ID,'="').concat(i,'"]'))||win.document.createElement("style");l.innerHTML=a;var s=(n=plt.A)!=null?n:queryNonceMetaTagContent(win.document);if(s!=null){l.setAttribute("nonce",s)}if(!(t.i&1)){if(e.nodeName==="HEAD"){var u=e.querySelectorAll("link[rel=preconnect]");var f=u.length>0?u[u.length-1].nextSibling:e.querySelector("style");e.insertBefore(l,(f==null?void 0:f.parentNode)===e?f:null)}else if("host"in e){if(supportsConstructableStylesheets){var c=new CSSStyleSheet;c.replaceSync(a);e.adoptedStyleSheets=__spreadArray([c],e.adoptedStyleSheets,true)}else{var v=e.querySelector("style");if(v){v.innerHTML=a+v.innerHTML}else{e.prepend(l)}}}else{e.append(l)}}if(t.i&1){e.insertBefore(l,null)}}if(t.i&4){l.innerHTML+=SLOT_FB_CSS}if(o){o.add(i)}}}else if(!e.adoptedStyleSheets.includes(a)){e.adoptedStyleSheets=__spreadArray(__spreadArray([],e.adoptedStyleSheets,true),[a],false)}}return i};var attachStyles=function(e){var t=e.o;var r=e.$hostElement$;var n=t.i;var i=createTime("attachStyles",t.p);var a=addStyle(r.getRootNode(),t);if(n&10&&n&2||n&128){r["s-sc"]=a;r.classList.add(a+"-h")}i()};var getScopeId=function(e,t){return"sc-"+e.p};var setAccessor=function(e,t,r,n,i,a,o){if(r===n){return}var l=isMemberInElement(e,t);t.toLowerCase();if(t==="class"){var s=e.classList;var u=parseClassList(r);var f=parseClassList(n);{s.remove.apply(s,u.filter((function(e){return e&&!f.includes(e)})));s.add.apply(s,f.filter((function(e){return e&&!u.includes(e)})))}}else if(t==="key");else if(t==="ref"){if(n){n(e)}}else{var c=isComplexType(n);if((l||c&&n!==null)&&!i){try{if(!e.tagName.includes("-")){var v=n==null?"":n;if(t==="list"){l=false}else if(r==null||e[t]!=v){if(typeof e.__lookupSetter__(t)==="function"){e[t]=v}else{e.setAttribute(t,v)}}}else if(e[t]!==n){e[t]=n}}catch(e){}}if(n==null||n===false){if(n!==false||e.getAttribute(t)===""){{e.removeAttribute(t)}}}else if((!l||a&4||i)&&!c&&e.nodeType===1){n=n===true?"":n;{e.setAttribute(t,n)}}}};var parseClassListRegex=/\s/;var parseClassList=function(e){if(typeof e==="object"&&e&&"baseVal"in e){e=e.baseVal}if(!e||typeof e!=="string"){return[]}return e.split(parseClassListRegex)};var updateElement=function(e,t,r,n){var i=t.R.nodeType===11&&t.R.host?t.R.host:t.R;var a=e&&e.C||{};var o=t.C||{};{for(var l=0,s=sortedAttrNames(Object.keys(a));l<s.length;l++){var u=s[l];if(!(u in o)){setAccessor(i,u,a[u],void 0,r,t.i)}}}for(var f=0,c=sortedAttrNames(Object.keys(o));f<c.length;f++){var u=c[f];setAccessor(i,u,a[u],o[u],r,t.i)}};function sortedAttrNames(e){return e.includes("ref")?__spreadArray(__spreadArray([],e.filter((function(e){return e!=="ref"})),true),["ref"],false):e}var scopeId;var contentRef;var hostTagName;var useNativeShadowDom=false;var checkSlotFallbackVisibility=false;var checkSlotRelocate=false;var isSvgMode=false;var createElm=function(e,t,r){var n;var i=t.k[r];var a=0;var o;var l;var s;if(!useNativeShadowDom){checkSlotRelocate=true;if(i.T==="slot"){i.i|=i.k?2:1}}if(i.i&1){o=i.R=win.document.createTextNode("");{updateElement(null,i,isSvgMode)}}else{if(!win.document){throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.")}o=i.R=win.document.createElement(!useNativeShadowDom&&BUILD.slotRelocation&&i.i&2?"slot-fb":i.T);{updateElement(null,i,isSvgMode)}if(isDef(scopeId)&&o["s-si"]!==scopeId){o.classList.add(o["s-si"]=scopeId)}if(i.k){for(a=0;a<i.k.length;++a){l=createElm(e,i,a);if(l){o.appendChild(l)}}}}o["s-hn"]=hostTagName;{if(i.i&(2|1)){o["s-sr"]=true;o["s-cr"]=contentRef;o["s-sn"]=i._||"";o["s-rf"]=(n=i.C)==null?void 0:n.ref;patchSlotNode(o);s=e&&e.k&&e.k[r];if(s&&s.T===i.T&&e.R){{putBackInOriginalLocation(e.R,false)}}{addRemoveSlotScopedClass(contentRef,o,t.R,e==null?void 0:e.R)}}}return o};var putBackInOriginalLocation=function(e,t){plt.i|=1;var r=Array.from(e.__childNodes||e.childNodes);if(e["s-sr"]&&BUILD.experimentalSlotFixes){var n=e;while(n=n.nextSibling){if(n&&n["s-sn"]===e["s-sn"]&&n["s-sh"]===hostTagName){r.push(n)}}}for(var i=r.length-1;i>=0;i--){var a=r[i];if(a["s-hn"]!==hostTagName&&a["s-ol"]){insertBefore(referenceNode(a).parentNode,a,referenceNode(a));a["s-ol"].remove();a["s-ol"]=void 0;a["s-sh"]=void 0;checkSlotRelocate=true}if(t){putBackInOriginalLocation(a,t)}}plt.i&=~1};var addVnodes=function(e,t,r,n,i,a){var o=e["s-cr"]&&e["s-cr"].parentNode||e;var l;for(;i<=a;++i){if(n[i]){l=createElm(null,r,i);if(l){n[i].R=l;insertBefore(o,l,referenceNode(t))}}}};var removeVnodes=function(e,t,r){for(var n=t;n<=r;++n){var i=e[n];if(i){var a=i.R;nullifyVNodeRefs(i);if(a){{checkSlotFallbackVisibility=true;if(a["s-ol"]){a["s-ol"].remove()}else{putBackInOriginalLocation(a,true)}}a.remove()}}}};var updateChildren=function(e,t,r,n,i){if(i===void 0){i=false}var a=0;var o=0;var l=0;var s=0;var u=t.length-1;var f=t[0];var c=t[u];var v=n.length-1;var d=n[0];var p=n[v];var m;var h;while(a<=u&&o<=v){if(f==null){f=t[++a]}else if(c==null){c=t[--u]}else if(d==null){d=n[++o]}else if(p==null){p=n[--v]}else if(isSameVnode(f,d,i)){patch(f,d,i);f=t[++a];d=n[++o]}else if(isSameVnode(c,p,i)){patch(c,p,i);c=t[--u];p=n[--v]}else if(isSameVnode(f,p,i)){if(f.T==="slot"||p.T==="slot"){putBackInOriginalLocation(f.R.parentNode,false)}patch(f,p,i);insertBefore(e,f.R,c.R.nextSibling);f=t[++a];p=n[--v]}else if(isSameVnode(c,d,i)){if(f.T==="slot"||p.T==="slot"){putBackInOriginalLocation(c.R.parentNode,false)}patch(c,d,i);insertBefore(e,c.R,f.R);c=t[--u];d=n[++o]}else{l=-1;{for(s=a;s<=u;++s){if(t[s]&&t[s].N!==null&&t[s].N===d.N){l=s;break}}}if(l>=0){h=t[l];if(h.T!==d.T){m=createElm(t&&t[o],r,l)}else{patch(h,d,i);t[l]=void 0;m=h.R}d=n[++o]}else{m=createElm(t&&t[o],r,o);d=n[++o]}if(m){{insertBefore(referenceNode(f.R).parentNode,m,referenceNode(f.R))}}}}if(a>u){addVnodes(e,n[v+1]==null?null:n[v+1].R,r,n,o,v)}else if(o>v){removeVnodes(t,a,u)}};var isSameVnode=function(e,t,r){if(r===void 0){r=false}if(e.T===t.T){if(e.T==="slot"){return e._===t._}if(!r){return e.N===t.N}if(r&&!e.N&&t.N){e.N=t.N}return true}return false};var referenceNode=function(e){return e&&e["s-ol"]||e};var patch=function(e,t,r){if(r===void 0){r=false}var n=t.R=e.R;var i=e.k;var a=t.k;{{updateElement(e,t,isSvgMode)}if(i!==null&&a!==null){updateChildren(n,i,t,a,r)}else if(a!==null){addVnodes(n,null,t,a,0,a.length-1)}else if(!r&&BUILD.updatable&&i!==null){removeVnodes(i,0,i.length-1)}}};var relocateNodes=[];var markSlotContentForRelocation=function(e){var t;var r;var n;var i=e.__childNodes||e.childNodes;for(var a=0,o=i;a<o.length;a++){var l=o[a];if(l["s-sr"]&&(t=l["s-cr"])&&t.parentNode){r=t.parentNode.__childNodes||t.parentNode.childNodes;var s=l["s-sn"];var u=function(){t=r[n];if(!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==l["s-hn"]&&!BUILD.experimentalSlotFixes){if(isNodeLocatedInSlot(t,s)){var e=relocateNodes.find((function(e){return e.L===t}));checkSlotFallbackVisibility=true;t["s-sn"]=t["s-sn"]||s;if(e){e.L["s-sh"]=l["s-hn"];e.D=l}else{t["s-sh"]=l["s-hn"];relocateNodes.push({D:l,L:t})}if(t["s-sr"]){relocateNodes.map((function(r){if(isNodeLocatedInSlot(r.L,t["s-sn"])){e=relocateNodes.find((function(e){return e.L===t}));if(e&&!r.D){r.D=e.D}}}))}}else if(!relocateNodes.some((function(e){return e.L===t}))){relocateNodes.push({L:t})}}};for(n=r.length-1;n>=0;n--){u()}}if(l.nodeType===1){markSlotContentForRelocation(l)}}};var nullifyVNodeRefs=function(e){{e.C&&e.C.ref&&e.C.ref(null);e.k&&e.k.map(nullifyVNodeRefs)}};var insertBefore=function(e,t,r){if(typeof t["s-sn"]==="string"&&!!t["s-sr"]&&!!t["s-cr"]){addRemoveSlotScopedClass(t["s-cr"],t,e,t.parentElement)}{return e==null?void 0:e.insertBefore(t,r)}};function addRemoveSlotScopedClass(e,t,r,n){var i,a;var o;if(e&&typeof t["s-sn"]==="string"&&!!t["s-sr"]&&e.parentNode&&e.parentNode["s-sc"]&&(o=t["s-si"]||e.parentNode["s-sc"])){var l=t["s-sn"];var s=t["s-hn"];(i=r.classList)==null?void 0:i.add(o+"-s");if(n&&((a=n.classList)==null?void 0:a.contains(o+"-s"))){var u=(n.__childNodes||n.childNodes)[0];var f=false;while(u){if(u["s-sn"]!==l&&u["s-hn"]===s&&!!u["s-sr"]){f=true;break}u=u.nextSibling}if(!f)n.classList.remove(o+"-s")}}}var renderVdom=function(e,t,r){if(r===void 0){r=false}var n,i,a,o;var l=e.$hostElement$;var s=e.V||newVNode(null,null);var u=isHost(t)?t:h(null,null,t);hostTagName=l.tagName;if(r&&u.C){for(var f=0,c=Object.keys(u.C);f<c.length;f++){var v=c[f];if(l.hasAttribute(v)&&!["key","ref","style","class"].includes(v)){u.C[v]=l[v]}}}u.T=null;u.i|=4;e.V=u;u.R=s.R=l;{scopeId=l["s-sc"]}useNativeShadowDom=supportsShadow;{contentRef=l["s-cr"];checkSlotFallbackVisibility=false}patch(s,u,r);{plt.i|=1;if(checkSlotRelocate){markSlotContentForRelocation(u.R);for(var d=0,p=relocateNodes;d<p.length;d++){var m=p[d];var y=m.L;if(!y["s-ol"]&&win.document){var S=win.document.createTextNode("");S["s-nr"]=y;insertBefore(y.parentNode,y["s-ol"]=S,y)}}for(var g=0,w=relocateNodes;g<w.length;g++){var m=w[g];var y=m.L;var b=m.D;if(b){var C=b.parentNode;var k=b.nextSibling;{var S=(n=y["s-ol"])==null?void 0:n.previousSibling;while(S){var N=(i=S["s-nr"])!=null?i:null;if(N&&N["s-sn"]===y["s-sn"]&&C===(N.__parentNode||N.parentNode)){N=N.nextSibling;while(N===y||(N==null?void 0:N["s-sr"])){N=N==null?void 0:N.nextSibling}if(!N||!N["s-nr"]){k=N;break}}S=S.previousSibling}}var _=y.__parentNode||y.parentNode;var T=y.__nextSibling||y.nextSibling;if(!k&&C!==_||T!==k){if(y!==k){if(!y["s-hn"]&&y["s-ol"]){y["s-hn"]=y["s-ol"].parentNode.nodeName}insertBefore(C,y,k);if(y.nodeType===1&&y.tagName!=="SLOT-FB"){y.hidden=(a=y["s-ih"])!=null?a:false}}}y&&typeof b["s-rf"]==="function"&&b["s-rf"](b)}else{if(y.nodeType===1){if(r){y["s-ih"]=(o=y.hidden)!=null?o:false}y.hidden=true}}}}if(checkSlotFallbackVisibility){updateFallbackSlotVisibility(u.R)}plt.i&=~1;relocateNodes.length=0}contentRef=void 0};var attachToAncestor=function(e,t){if(t&&!e.I&&t["s-p"]){var r=t["s-p"].push(new Promise((function(n){return e.I=function(){t["s-p"].splice(r-1,1);n()}})))}};var scheduleUpdate=function(e,t){{e.i|=16}if(e.i&4){e.i|=512;return}attachToAncestor(e,e.$);var r=function(){return dispatchHooks(e,t)};return writeTask(r)};var dispatchHooks=function(e,t){var r=e.$hostElement$;var n=createTime("scheduleUpdate",e.o.p);var i=e.t;if(!i){throw new Error("Can't render component <".concat(r.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"))}var a;if(t){a=safeCall(i,"componentWillLoad",void 0,r)}else{a=safeCall(i,"componentWillUpdate",void 0,r)}a=enqueue(a,(function(){return safeCall(i,"componentWillRender",void 0,r)}));n();return enqueue(a,(function(){return updateComponent(e,i,t)}))};var enqueue=function(e,t){return isPromisey(e)?e.then(t).catch((function(e){console.error(e);t()})):t()};var isPromisey=function(e){return e instanceof Promise||e&&e.then&&typeof e.then==="function"};var updateComponent=function(e,t,r){return __awaiter(void 0,void 0,void 0,(function(){var n,i,a,o,l,s,u;return __generator(this,(function(f){i=e.$hostElement$;a=createTime("update",e.o.p);o=i["s-rc"];if(r){attachStyles(e)}l=createTime("render",e.o.p);{callRender(e,t,i,r)}if(o){o.map((function(e){return e()}));i["s-rc"]=void 0}l();a();{s=(n=i["s-p"])!=null?n:[];u=function(){return postUpdateComponent(e)};if(s.length===0){u()}else{Promise.all(s).then(u);e.i|=4;s.length=0}}return[2]}))}))};var callRender=function(e,t,r,n){try{t=t.render();{e.i&=~16}{e.i|=2}{{{renderVdom(e,t,n)}}}}catch(t){consoleError(t,e.$hostElement$)}return null};var postUpdateComponent=function(e){var t=e.o.p;var r=e.$hostElement$;var n=createTime("postUpdate",t);var i=e.t;var a=e.$;safeCall(i,"componentDidRender",void 0,r);if(!(e.i&64)){e.i|=64;{addHydratedFlag(r)}safeCall(i,"componentDidLoad",void 0,r);n();{e.v(r);if(!a){appDidLoad()}}}else{safeCall(i,"componentDidUpdate",void 0,r);n()}{if(e.I){e.I();e.I=void 0}if(e.i&512){nextTick((function(){return scheduleUpdate(e,false)}))}e.i&=~(4|512)}};var appDidLoad=function(e){nextTick((function(){return emitEvent(win,"appload",{detail:{namespace:NAMESPACE}})}))};var safeCall=function(e,t,r,n){if(e&&e[t]){try{return e[t](r)}catch(e){consoleError(e,n)}}return void 0};var addHydratedFlag=function(e){var t;return e.classList.add((t=BUILD.hydratedSelectorName)!=null?t:"hydrated")};var getValue=function(e,t){return getHostRef(e).l.get(t)};var setValue=function(e,t,r,n){var i=getHostRef(e);if(!i){throw new Error("Couldn't find host element for \"".concat(n.p,'" 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).'))}var a=i.$hostElement$;var o=i.l.get(t);var l=i.i;var s=i.t;r=parsePropertyValue(r,n.H[t][0]);var u=Number.isNaN(o)&&Number.isNaN(r);var f=r!==o&&!u;if((!(l&8)||o===void 0)&&f){i.l.set(t,r);if(s){if(n.O&&l&128){var c=n.O[t];if(c){c.map((function(e){try{s[e](r,o,t)}catch(e){consoleError(e,a)}}))}}if((l&(2|16))===2){if(s.componentShouldUpdate){if(s.componentShouldUpdate(r,o,t)===false){return}}scheduleUpdate(i,false)}}}};var proxyComponent=function(e,t,r){var n,i;var a=e.prototype;if(t.H||(t.O||e.watchers)){if(e.watchers&&!t.O){t.O=e.watchers}var o=Object.entries((n=t.H)!=null?n:{});o.map((function(e){var n=e[0],i=e[1][0];if(i&31||r&2&&i&32){var o=Object.getOwnPropertyDescriptor(a,n)||{},l=o.get,s=o.set;if(l)t.H[n][0]|=2048;if(s)t.H[n][0]|=4096;if(r&1||!l){Object.defineProperty(a,n,{get:function(){{if((t.H[n][0]&2048)===0){return getValue(this,n)}var e=getHostRef(this);var r=e?e.t:a;if(!r)return;return r[n]}},configurable:true,enumerable:true})}Object.defineProperty(a,n,{set:function(e){var a=this;var o=getHostRef(this);if(s){var l=i&32?this[n]:o.$hostElement$[n];if(typeof l==="undefined"&&o.l.get(n)){e=o.l.get(n)}else if(!o.l.get(n)&&l){o.l.set(n,l)}s.apply(this,[parsePropertyValue(e,i)]);e=i&32?this[n]:o.$hostElement$[n];setValue(this,n,e,t);return}{if((r&1)===0||(t.H[n][0]&4096)===0){setValue(this,n,e,t);if(r&1&&!o.t){o.u.then((function(){if(t.H[n][0]&4096&&o.t[n]!==o.l.get(n)){o.t[n]=e}}))}return}var u=function(){var r=o.t[n];if(!o.l.get(n)&&r){o.l.set(n,r)}o.t[n]=parsePropertyValue(e,i);setValue(a,n,o.t[n],t)};if(o.t){u()}else{o.u.then((function(){return u()}))}}}})}}));if(r&1){var l=new Map;a.attributeChangedCallback=function(e,r,n){var i=this;plt.jmp((function(){var o;var s=l.get(e);if(i.hasOwnProperty(s)&&BUILD.lazyLoad){n=i[s];delete i[s]}else if(a.hasOwnProperty(s)&&typeof i[s]==="number"&&i[s]==n){return}else if(s==null){var u=getHostRef(i);var f=u==null?void 0:u.i;if(f&&!(f&8)&&f&128&&n!==r){var c=u.t;var v=(o=t.O)==null?void 0:o[e];v==null?void 0:v.forEach((function(t){if(c[t]!=null){c[t].call(c,n,r,e)}}))}return}var d=Object.getOwnPropertyDescriptor(a,s);n=n===null&&typeof i[s]==="boolean"?false:n;if(n!==i[s]&&(!d.get||!!d.set)){i[s]=n}}))};e.observedAttributes=Array.from(new Set(__spreadArray(__spreadArray([],Object.keys((i=t.O)!=null?i:{}),true),o.filter((function(e){var t=e[0],r=e[1];return r[0]&15})).map((function(e){var t=e[0],r=e[1];var n=r[1]||t;l.set(n,t);return n})),true)))}}return e};var initializeComponent=function(e,t,r,n){return __awaiter(void 0,void 0,void 0,(function(){var n,i,a,o,l,s,u,f,c,v,d;return __generator(this,(function(p){switch(p.label){case 0:if(!((t.i&32)===0))return[3,6];t.i|=32;i=r.m;if(!i)return[3,4];a=loadModule(r,t);if(!(a&&"then"in a))return[3,2];o=uniqueTime();return[4,a];case 1:n=p.sent();o();return[3,3];case 2:n=a;p.label=3;case 3:if(!n){throw new Error('Constructor for "'.concat(r.p,"#").concat(t.B,'" was not found'))}if(!n.isProxied){{r.O=n.watchers}proxyComponent(n,r,2);n.isProxied=true}l=createTime("createInstance",r.p);{t.i|=8}try{new n(t)}catch(t){consoleError(t,e)}{t.i&=~8}{t.i|=128}l();fireConnectedCallback(t.t,e);return[3,5];case 4:n=e.constructor;s=e.localName;customElements.whenDefined(s).then((function(){return t.i|=128}));p.label=5;case 5:if(n&&n.style){u=void 0;if(typeof n.style==="string"){u=n.style}f=getScopeId(r);if(!styles.has(f)){c=createTime("registerStyles",r.p);registerStyle(f,u,!!(r.i&1));c()}}p.label=6;case 6:v=t.$;d=function(){return scheduleUpdate(t,true)};if(v&&v["s-rc"]){v["s-rc"].push(d)}else{d()}return[2]}}))}))};var fireConnectedCallback=function(e,t){{safeCall(e,"connectedCallback",void 0,t)}};var connectedCallback=function(e){if((plt.i&1)===0){var t=getHostRef(e);var r=t.o;var n=createTime("connectedCallback",r.p);if(!(t.i&1)){t.i|=1;{if(r.i&(4|8)){setContentReference(e)}}{var i=e;while(i=i.parentNode||i.host){if(i["s-p"]){attachToAncestor(t,t.$=i);break}}}if(r.H){Object.entries(r.H).map((function(t){var r=t[0],n=t[1][0];if(n&31&&e.hasOwnProperty(r)){var i=e[r];delete e[r];e[r]=i}}))}{initializeComponent(e,t,r)}}else{if(t==null?void 0:t.t){fireConnectedCallback(t.t,e)}else if(t==null?void 0:t.u){t.u.then((function(){return fireConnectedCallback(t.t,e)}))}}n()}};var setContentReference=function(e){if(!win.document){return}var t=e["s-cr"]=win.document.createComment("");t["s-cn"]=true;insertBefore(e,t,e.firstChild)};var disconnectInstance=function(e,t){{safeCall(e,"disconnectedCallback",void 0,t||e)}};var disconnectedCallback=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t;return __generator(this,(function(r){if((plt.i&1)===0){t=getHostRef(e);if(t==null?void 0:t.t){disconnectInstance(t.t,e)}else if(t==null?void 0:t.u){t.u.then((function(){return disconnectInstance(t.t,e)}))}}if(rootAppliedStyles.has(e)){rootAppliedStyles.delete(e)}if(e.shadowRoot&&rootAppliedStyles.has(e.shadowRoot)){rootAppliedStyles.delete(e.shadowRoot)}return[2]}))}))};var bootstrapLazy=function(e,t){if(t===void 0){t={}}var r;if(!win.document){console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");return}var n=createTime();var i=[];var a=t.exclude||[];var o=win.customElements;var l=win.document.head;var s=l.querySelector("meta[charset]");var u=win.document.createElement("style");var f=[];var c;var v=true;Object.assign(plt,t);plt.h=new URL(t.resourcesUrl||"./",win.document.baseURI).href;var d=false;e.map((function(e){e[1].map((function(t){var r;var n={i:t[0],p:t[1],H:t[2],F:t[3]};if(n.i&4){d=true}{n.H=t[2]}{n.O=(r=t[4])!=null?r:{}}var l=n.p;var s=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;r.hasRegisteredEventListeners=false;t=r;registerHost(t,n);return r}t.prototype.connectedCallback=function(){var e=this;getHostRef(this);if(!this.hasRegisteredEventListeners){this.hasRegisteredEventListeners=true}if(c){clearTimeout(c);c=null}if(v){f.push(this)}else{plt.jmp((function(){return connectedCallback(e)}))}};t.prototype.disconnectedCallback=function(){var e=this;plt.jmp((function(){return disconnectedCallback(e)}));plt.raf((function(){var t;var r=getHostRef(e);var n=f.findIndex((function(t){return t===e}));if(n>-1){f.splice(n,1)}if(((t=r==null?void 0:r.V)==null?void 0:t.R)instanceof Node&&!r.V.R.isConnected){delete r.V.R}}))};t.prototype.componentOnReady=function(){return getHostRef(this).u};return t}(HTMLElement);n.m=e[0];if(!a.includes(l)&&!o.get(l)){i.push(l);o.define(l,proxyComponent(s,n,1))}}))}));if(i.length>0){if(d){u.textContent+=SLOT_FB_CSS}{u.textContent+=i.sort()+HYDRATED_CSS}if(u.innerHTML.length){u.setAttribute("data-styles","");var p=(r=plt.A)!=null?r:queryNonceMetaTagContent(win.document);if(p!=null){u.setAttribute("nonce",p)}l.insertBefore(u,s?s.nextSibling:l.firstChild)}}v=false;if(f.length){f.map((function(e){return e.connectedCallback()}))}else{{plt.jmp((function(){return c=setTimeout(appDidLoad,30)}))}}n()};var setNonce=function(e){return plt.A=e};export{Host as H,bootstrapLazy as b,createEvent as c,getElement as g,h,promiseResolve as p,registerInstance as r,setNonce as s};
//# sourceMappingURL=index-c6a20355.js.map