UNPKG

@public-ui/components

Version:

Contains all web components that belong to KoliBri - The accessible HTML-Standard.

4 lines 34.1 kB
/*! * KoliBri - The accessible HTML-Standard */ const NAMESPACE="kolibri",BUILD={allRenderFn:!1,appendChildSlotFix:!1,asyncLoading:!0,asyncQueue:!1,attachStyles:!0,cloneNodeFix:!1,cmpDidLoad:!0,cmpDidRender:!0,cmpDidUnload:!1,cmpDidUpdate:!1,cmpShouldUpdate:!1,cmpWillLoad:!0,cmpWillRender:!0,cmpWillUpdate:!1,connectedCallback:!0,constructableCSS:!0,cssAnnotations:!0,devTools:!1,disconnectedCallback:!0,element:!1,event:!1,experimentalScopedSlotChanges:!1,experimentalSlotFixes:!1,formAssociated:!1,hasRenderFn:!0,hostListener:!0,hostListenerTarget:!0,hostListenerTargetBody:!1,hostListenerTargetDocument:!1,hostListenerTargetParent:!1,hostListenerTargetWindow:!0,hotModuleReplacement:!1,hydrateClientSide:!0,hydrateServerSide:!1,hydratedAttribute:!1,hydratedClass:!0,hydratedSelectorName:"hydrated",initializeNextTick:!1,invisiblePrehydration:!0,isDebug:!1,isDev:!1,isTesting:!1,lazyLoad:!0,lifecycle:!0,lifecycleDOMEvents:!1,member:!0,method:!0,mode:!0,observeAttribute:!0,profile:!1,prop:!0,propBoolean:!0,propMutable:!0,propNumber:!0,propString:!0,reflect:!0,scoped:!1,scopedSlotTextContentFix:!1,scriptDataOpts:!1,shadowDelegatesFocus:!0,shadowDom:!0,slot:!0,slotChildNodesFix:!1,slotRelocation:!0,state:!0,style:!0,svg:!0,taskQueue:!1,transformTagName:!0,updatable:!0,vdomAttribute:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomPropOrAttr:!0,vdomRef:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,vdomXlink:!0,watchCallback:!0},Env={kolibriVersion:"2.2.8"};var __defProp=Object.defineProperty,__export=(e,t)=>{for(var o in t)__defProp(e,o,{get:t[o],enumerable:!0})},hostRefs=new WeakMap,getHostRef=e=>hostRefs.get(e),registerInstance=(e,t)=>hostRefs.set(t.$lazyInstance$=e,t),registerHost=(e,t)=>{const o={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return o.$onInstancePromise$=new Promise((e=>o.$onInstanceResolve$=e)),o.$onReadyPromise$=new Promise((e=>o.$onReadyResolve$=e)),e["s-p"]=[],e["s-rc"]=[],hostRefs.set(e,o)},isMemberInElement=(e,t)=>t in e,consoleError=(e,t)=>(0,console.error)(e,t),cmpModules=new Map,loadModule=(e,t,o)=>{const n=e.$tagName$.replace(/-/g,"_"),r=e.$lazyBundleId$;if(!r)return;const s=cmpModules.get(r);if(s)return s[n];if(!o||!BUILD.hotModuleReplacement){const e=e=>(cmpModules.set(r,e),e[n]);switch(r){case"kol-abbr":return import("./kol-abbr.entry.js").then(e,consoleError);case"kol-accordion":return import("./kol-accordion.entry.js").then(e,consoleError);case"kol-alert":return import("./kol-alert.entry.js").then(e,consoleError);case"kol-avatar":return import("./kol-avatar.entry.js").then(e,consoleError);case"kol-badge":return import("./kol-badge.entry.js").then(e,consoleError);case"kol-breadcrumb":return import("./kol-breadcrumb.entry.js").then(e,consoleError);case"kol-button":return import("./kol-button.entry.js").then(e,consoleError);case"kol-button-group":return import("./kol-button-group.entry.js").then(e,consoleError);case"kol-button-link":return import("./kol-button-link.entry.js").then(e,consoleError);case"kol-card":return import("./kol-card.entry.js").then(e,consoleError);case"kol-details":return import("./kol-details.entry.js").then(e,consoleError);case"kol-drawer":return import("./kol-drawer.entry.js").then(e,consoleError);case"kol-form":return import("./kol-form.entry.js").then(e,consoleError);case"kol-heading":return import("./kol-heading.entry.js").then(e,consoleError);case"kol-icon":return import("./kol-icon.entry.js").then(e,consoleError);case"kol-image":return import("./kol-image.entry.js").then(e,consoleError);case"kol-indented-text":return import("./kol-indented-text.entry.js").then(e,consoleError);case"kol-input-checkbox":return import("./kol-input-checkbox.entry.js").then(e,consoleError);case"kol-input-color":return import("./kol-input-color.entry.js").then(e,consoleError);case"kol-input-date":return import("./kol-input-date.entry.js").then(e,consoleError);case"kol-input-email":return import("./kol-input-email.entry.js").then(e,consoleError);case"kol-input-file":return import("./kol-input-file.entry.js").then(e,consoleError);case"kol-input-number":return import("./kol-input-number.entry.js").then(e,consoleError);case"kol-input-password":return import("./kol-input-password.entry.js").then(e,consoleError);case"kol-input-radio":return import("./kol-input-radio.entry.js").then(e,consoleError);case"kol-input-text":return import("./kol-input-text.entry.js").then(e,consoleError);case"kol-kolibri":return import("./kol-kolibri.entry.js").then(e,consoleError);case"kol-link":return import("./kol-link.entry.js").then(e,consoleError);case"kol-link-button":return import("./kol-link-button.entry.js").then(e,consoleError);case"kol-link-group":return import("./kol-link-group.entry.js").then(e,consoleError);case"kol-logo":return import("./kol-logo.entry.js").then(e,consoleError);case"kol-modal":return import("./kol-modal.entry.js").then(e,consoleError);case"kol-nav":return import("./kol-nav.entry.js").then(e,consoleError);case"kol-pagination":return import("./kol-pagination.entry.js").then(e,consoleError);case"kol-popover-button":return import("./kol-popover-button.entry.js").then(e,consoleError);case"kol-progress":return import("./kol-progress.entry.js").then(e,consoleError);case"kol-quote":return import("./kol-quote.entry.js").then(e,consoleError);case"kol-select":return import("./kol-select.entry.js").then(e,consoleError);case"kol-skip-nav":return import("./kol-skip-nav.entry.js").then(e,consoleError);case"kol-spin":return import("./kol-spin.entry.js").then(e,consoleError);case"kol-split-button":return import("./kol-split-button.entry.js").then(e,consoleError);case"kol-symbol":return import("./kol-symbol.entry.js").then(e,consoleError);case"kol-table":return import("./kol-table.entry.js").then(e,consoleError);case"kol-table-stateful":return import("./kol-table-stateful.entry.js").then(e,consoleError);case"kol-table-stateless":return import("./kol-table-stateless.entry.js").then(e,consoleError);case"kol-tabs":return import("./kol-tabs.entry.js").then(e,consoleError);case"kol-textarea":return import("./kol-textarea.entry.js").then(e,consoleError);case"kol-toast-container":return import("./kol-toast-container.entry.js").then(e,consoleError);case"kol-toolbar":return import("./kol-toolbar.entry.js").then(e,consoleError);case"kol-tree":return import("./kol-tree.entry.js").then(e,consoleError);case"kol-tree-item":return import("./kol-tree-item.entry.js").then(e,consoleError);case"kol-version":return import("./kol-version.entry.js").then(e,consoleError);case"kol-alert-wc":return import("./kol-alert-wc.entry.js").then(e,consoleError);case"kol-avatar-wc":return import("./kol-avatar-wc.entry.js").then(e,consoleError);case"kol-button-group-wc":return import("./kol-button-group-wc.entry.js").then(e,consoleError);case"kol-button-wc":return import("./kol-button-wc.entry.js").then(e,consoleError);case"kol-combobox":return import("./kol-combobox.entry.js").then(e,consoleError);case"kol-heading-wc":return import("./kol-heading-wc.entry.js").then(e,consoleError);case"kol-indented-text-wc":return import("./kol-indented-text-wc.entry.js").then(e,consoleError);case"kol-input":return import("./kol-input.entry.js").then(e,consoleError);case"kol-input-range":return import("./kol-input-range.entry.js").then(e,consoleError);case"kol-link-wc":return import("./kol-link-wc.entry.js").then(e,consoleError);case"kol-popover-wc":return import("./kol-popover-wc.entry.js").then(e,consoleError);case"kol-single-select":return import("./kol-single-select.entry.js").then(e,consoleError);case"kol-span-wc":return import("./kol-span-wc.entry.js").then(e,consoleError);case"kol-table-stateless-wc":return import("./kol-table-stateless-wc.entry.js").then(e,consoleError);case"kol-tooltip-wc":return import("./kol-tooltip-wc.entry.js").then(e,consoleError);case"kol-tree-item-wc":return import("./kol-tree-item-wc.entry.js").then(e,consoleError);case"kol-tree-wc":return import("./kol-tree-wc.entry.js").then(e,consoleError);case"test-component":return import("./test-component.entry.js").then(e,consoleError)}}return import(`./${r}.entry.js`).then((e=>(cmpModules.set(r,e),e[n])),consoleError)},styles=new Map,modeResolutionChain=[],CONTENT_REF_ID="r",ORG_LOCATION_ID="o",SLOT_NODE_ID="s",TEXT_NODE_ID="t",HYDRATE_ID="s-id",HYDRATED_STYLE_ID="sty-id",HYDRATE_CHILD_ID="c-id",HYDRATED_CSS="{visibility:hidden}.hydrated{visibility:inherit}",SLOT_FB_CSS="slot-fb{display:contents}slot-fb[hidden]{display:none}",XLINK_NS="http://www.w3.org/1999/xlink",win="undefined"!=typeof window?window:{},doc=win.document||{head:{}},plt={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,o,n)=>e.addEventListener(t,o,n),rel:(e,t,o,n)=>e.removeEventListener(t,o,n),ce:(e,t)=>new CustomEvent(e,t)},supportsShadow=BUILD.shadowDom,supportsListenerOptions=(()=>{let e=!1;try{doc.addEventListener("e",null,Object.defineProperty({},"passive",{get(){e=!0}}))}catch(e){}return e})(),promiseResolve=e=>Promise.resolve(e),supportsConstructableStylesheets=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),nextTick=e=>promiseResolve().then(e),EMPTY_OBJ={},SVG_NS="http://www.w3.org/2000/svg",HTML_NS="http://www.w3.org/1999/xhtml",isDef=e=>null!=e,isComplexType=e=>"object"===(e=typeof e)||"function"===e;function queryNonceMetaTagContent(e){var t,o,n;return null!=(n=null==(o=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:o.getAttribute("content"))?n:void 0}var result_exports={};__export(result_exports,{err:()=>err,map:()=>map,ok:()=>ok,unwrap:()=>unwrap,unwrapErr:()=>unwrapErr});var ok=e=>({isOk:!0,isErr:!1,value:e}),err=e=>({isOk:!1,isErr:!0,value:e});function map(e,t){if(e.isOk){const o=t(e.value);return o instanceof Promise?o.then((e=>ok(e))):ok(o)}if(e.isErr){const t=e.value;return err(t)}throw"should never get here"}var scopeId,contentRef,hostTagName,unwrap=e=>{if(e.isOk)return e.value;throw e.value},unwrapErr=e=>{if(e.isErr)return e.value;throw e.value},createTime=(e,t="")=>()=>{},uniqueTime=(e,t)=>()=>{},h=(e,t,...o)=>{let n=null,r=null,s=null,l=!1,a=!1;const i=[],c=t=>{for(let o=0;o<t.length;o++)n=t[o],Array.isArray(n)?c(n):null!=n&&"boolean"!=typeof n&&((l="function"!=typeof e&&!isComplexType(n))&&(n=String(n)),l&&a?i[i.length-1].$text$+=n:i.push(l?newVNode(null,n):n),a=l)};if(c(o),t){t.key&&(r=t.key),t.name&&(s=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,i,vdomFnUtils);const $=newVNode(e,null);return $.$attrs$=t,i.length>0&&($.$children$=i),$.$key$=r,$.$name$=s,$},newVNode=(e,t)=>{const o={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null,$key$:null,$name$:null};return o},Host={},isHost=e=>e&&e.$tag$===Host,vdomFnUtils={forEach:(e,t)=>e.map(convertToPublic).forEach(t),map:(e,t)=>e.map(convertToPublic).map(t).map(convertToPrivate)},convertToPublic=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),convertToPrivate=e=>{if("function"==typeof e.vtag){const t={...e.vattrs};return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),h(e.vtag,t,...e.vchildren||[])}const t=newVNode(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},initializeClientHydrate=(e,t,o,n)=>{const r=createTime("hydrateClient",t),s=e.shadowRoot,l=[],a=s?[]:null,i=n.$vnode$=newVNode(t,null);plt.$orgLocNodes$||initializeDocumentHydrate(doc.body,plt.$orgLocNodes$=new Map),e[HYDRATE_ID]=o,e.removeAttribute(HYDRATE_ID),clientHydrate(i,l,[],a,e,e,o),l.map((e=>{const o=e.$hostId$+"."+e.$nodeId$,n=plt.$orgLocNodes$.get(o),r=e.$elm$;n&&supportsShadow&&""===n["s-en"]&&n.parentNode.insertBefore(r,n.nextSibling),s||(r["s-hn"]=t,n&&(r["s-ol"]=n,r["s-ol"]["s-nr"]=r)),plt.$orgLocNodes$.delete(o)})),s&&a.map((e=>{e&&s.appendChild(e)})),r()},clientHydrate=(e,t,o,n,r,s,l)=>{let a,i,c,$;if(1===s.nodeType){if(a=s.getAttribute(HYDRATE_CHILD_ID),a&&(i=a.split("."),i[0]!==l&&"0"!==i[0]||(c={$flags$:0,$hostId$:i[0],$nodeId$:i[1],$depth$:i[2],$index$:i[3],$tag$:s.tagName.toLowerCase(),$elm$:s,$attrs$:null,$children$:null,$key$:null,$name$:null,$text$:null},t.push(c),s.removeAttribute(HYDRATE_CHILD_ID),e.$children$||(e.$children$=[]),e.$children$[c.$index$]=c,e=c,n&&"0"===c.$depth$&&(n[c.$index$]=c.$elm$))),s.shadowRoot)for($=s.shadowRoot.childNodes.length-1;$>=0;$--)clientHydrate(e,t,o,n,r,s.shadowRoot.childNodes[$],l);for($=s.childNodes.length-1;$>=0;$--)clientHydrate(e,t,o,n,r,s.childNodes[$],l)}else if(8===s.nodeType)i=s.nodeValue.split("."),i[1]!==l&&"0"!==i[1]||(a=i[0],c={$flags$:0,$hostId$:i[1],$nodeId$:i[2],$depth$:i[3],$index$:i[4],$elm$:s,$attrs$:null,$children$:null,$key$:null,$name$:null,$tag$:null,$text$:null},a===TEXT_NODE_ID?(c.$elm$=s.nextSibling,c.$elm$&&3===c.$elm$.nodeType&&(c.$text$=c.$elm$.textContent,t.push(c),s.remove(),e.$children$||(e.$children$=[]),e.$children$[c.$index$]=c,n&&"0"===c.$depth$&&(n[c.$index$]=c.$elm$))):c.$hostId$===l&&(a===SLOT_NODE_ID?(c.$tag$="slot",i[5]?s["s-sn"]=c.$name$=i[5]:s["s-sn"]="",s["s-sr"]=!0,n&&(c.$elm$=doc.createElement(c.$tag$),c.$name$&&c.$elm$.setAttribute("name",c.$name$),s.parentNode.insertBefore(c.$elm$,s),s.remove(),"0"===c.$depth$&&(n[c.$index$]=c.$elm$)),o.push(c),e.$children$||(e.$children$=[]),e.$children$[c.$index$]=c):a===CONTENT_REF_ID&&(n?s.remove():(r["s-cr"]=s,s["s-cn"]=!0))));else if(e&&"style"===e.$tag$){const t=newVNode(null,s.textContent);t.$elm$=s,t.$index$="0",e.$children$=[t]}},initializeDocumentHydrate=(e,t)=>{if(1===e.nodeType){let o=0;if(e.shadowRoot)for(;o<e.shadowRoot.childNodes.length;o++)initializeDocumentHydrate(e.shadowRoot.childNodes[o],t);for(o=0;o<e.childNodes.length;o++)initializeDocumentHydrate(e.childNodes[o],t)}else if(8===e.nodeType){const o=e.nodeValue.split(".");o[0]===ORG_LOCATION_ID&&(t.set(o[1]+"."+o[2],e),e.nodeValue="",e["s-en"]=o[3])}},computeMode=e=>modeResolutionChain.map((t=>t(e))).find((e=>!!e)),setMode=e=>modeResolutionChain.push(e),parsePropertyValue=(e,t)=>null==e||isComplexType(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?String(e):e,getElement=e=>getHostRef(e).$hostElement$,emitEvent=(e,t,o)=>{const n=plt.ce(t,o);return e.dispatchEvent(n),n},rootAppliedStyles=new WeakMap,registerStyle=(e,t,o)=>{let n=styles.get(e);supportsConstructableStylesheets&&o?(n=n||new CSSStyleSheet,"string"==typeof n?n=t:n.replaceSync(t)):n=t,styles.set(e,n)},addStyle=(e,t,o)=>{var n;const r=getScopeId(t,o),s=styles.get(r);if(e=11===e.nodeType?e:doc,s)if("string"==typeof s){e=e.head||e;let o,l=rootAppliedStyles.get(e);if(l||rootAppliedStyles.set(e,l=new Set),!l.has(r)){if(e.host&&(o=e.querySelector(`[${HYDRATED_STYLE_ID}="${r}"]`)))o.innerHTML=s;else{o=doc.createElement("style"),o.innerHTML=s;const r=null!=(n=plt.$nonce$)?n:queryNonceMetaTagContent(doc);null!=r&&o.setAttribute("nonce",r);(!(1&t.$flags$)||1&t.$flags$&&"HEAD"!==e.nodeName)&&e.insertBefore(o,e.querySelector("link"))}4&t.$flags$&&(o.innerHTML+=SLOT_FB_CSS),l&&l.add(r)}}else e.adoptedStyleSheets.includes(s)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,s]);return r},attachStyles=e=>{const t=e.$cmpMeta$,o=e.$hostElement$,n=t.$flags$,r=createTime("attachStyles",t.$tagName$),s=addStyle(o.shadowRoot?o.shadowRoot:o.getRootNode(),t,e.$modeName$);10&n&&2&n&&(o["s-sc"]=s,o.classList.add(s+"-h")),r()},getScopeId=(e,t)=>"sc-"+(t&&32&e.$flags$?e.$tagName$+"-"+t:e.$tagName$),setAccessor=(e,t,o,n,r,s)=>{if(o!==n){let l=isMemberInElement(e,t),a=t.toLowerCase();if("class"===t){const t=e.classList,r=parseClassList(o),s=parseClassList(n);t.remove(...r.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!r.includes(e))))}else if("style"===t){for(const t in o)n&&null!=n[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in n)o&&n[t]===o[t]||(t.includes("-")?e.style.setProperty(t,n[t]):e.style[t]=n[t])}else if("key"===t);else if("ref"===t)n&&n(e);else if(l||"o"!==t[0]||"n"!==t[1]){const i=isComplexType(n);if((l||i&&null!==n)&&!r)try{if(e.tagName.includes("-"))e[t]=n;else{const r=null==n?"":n;"list"===t?l=!1:null!=o&&e[t]==r||(e[t]=r)}}catch(e){}let c=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(t=a,c=!0),null==n||!1===n?!1===n&&""!==e.getAttribute(t)||(c?e.removeAttributeNS(XLINK_NS,t):e.removeAttribute(t)):(!l||4&s||r)&&!i&&(n=!0===n?"":n,c?e.setAttributeNS(XLINK_NS,t,n):e.setAttribute(t,n))}else if(t="-"===t[2]?t.slice(3):isMemberInElement(win,a)?a.slice(2):a[2]+t.slice(3),o||n){const r=t.endsWith(CAPTURE_EVENT_SUFFIX);t=t.replace(CAPTURE_EVENT_REGEX,""),o&&plt.rel(e,t,o,r),n&&plt.ael(e,t,n,r)}}},parseClassListRegex=/\s/,parseClassList=e=>e?e.split(parseClassListRegex):[],CAPTURE_EVENT_SUFFIX="Capture",CAPTURE_EVENT_REGEX=new RegExp(CAPTURE_EVENT_SUFFIX+"$"),updateElement=(e,t,o)=>{const n=11===t.$elm$.nodeType&&t.$elm$.host?t.$elm$.host:t.$elm$,r=e&&e.$attrs$||EMPTY_OBJ,s=t.$attrs$||EMPTY_OBJ;for(const e of sortedAttrNames(Object.keys(r)))e in s||setAccessor(n,e,r[e],void 0,o,t.$flags$);for(const e of sortedAttrNames(Object.keys(s)))setAccessor(n,e,r[e],s[e],o,t.$flags$)};function sortedAttrNames(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var useNativeShadowDom=!1,checkSlotFallbackVisibility=!1,checkSlotRelocate=!1,isSvgMode=!1,createElm=(e,t,o,n)=>{var r;const s=t.$children$[o];let l,a,i,c=0;if(useNativeShadowDom||(checkSlotRelocate=!0,"slot"===s.$tag$&&(scopeId&&n.classList.add(scopeId+"-s"),s.$flags$|=s.$children$?2:1)),null!==s.$text$)l=s.$elm$=doc.createTextNode(s.$text$);else if(1&s.$flags$)l=s.$elm$=doc.createTextNode("");else{isSvgMode||(isSvgMode="svg"===s.$tag$),l=s.$elm$=doc.createElementNS(isSvgMode?SVG_NS:HTML_NS,!useNativeShadowDom&&BUILD.slotRelocation&&2&s.$flags$?"slot-fb":s.$tag$),isSvgMode&&"foreignObject"===s.$tag$&&(isSvgMode=!1),updateElement(null,s,isSvgMode);if(!!l.getRootNode().querySelector("body")&&BUILD.scoped&&isDef(scopeId)&&l["s-si"]!==scopeId&&l.classList.add(l["s-si"]=scopeId),s.$children$)for(c=0;c<s.$children$.length;++c)a=createElm(e,s,c,l),a&&l.appendChild(a);"svg"===s.$tag$?isSvgMode=!1:"foreignObject"===l.tagName&&(isSvgMode=!0)}return l["s-hn"]=hostTagName,3&s.$flags$&&(l["s-sr"]=!0,l["s-cr"]=contentRef,l["s-sn"]=s.$name$||"",l["s-rf"]=null==(r=s.$attrs$)?void 0:r.ref,i=e&&e.$children$&&e.$children$[o],i&&i.$tag$===s.$tag$&&e.$elm$&&putBackInOriginalLocation(e.$elm$,!1)),l},putBackInOriginalLocation=(e,t)=>{plt.$flags$|=1;const o=Array.from(e.childNodes);if(e["s-sr"]&&BUILD.experimentalSlotFixes){let t=e;for(;t=t.nextSibling;)t&&t["s-sn"]===e["s-sn"]&&t["s-sh"]===hostTagName&&o.push(t)}for(let e=o.length-1;e>=0;e--){const n=o[e];n["s-hn"]!==hostTagName&&n["s-ol"]&&(insertBefore(parentReferenceNode(n),n,referenceNode(n)),n["s-ol"].remove(),n["s-ol"]=void 0,n["s-sh"]=void 0,checkSlotRelocate=!0),t&&putBackInOriginalLocation(n,t)}plt.$flags$&=-2},addVnodes=(e,t,o,n,r,s)=>{let l,a=e["s-cr"]&&e["s-cr"].parentNode||e;for(a.shadowRoot&&a.tagName===hostTagName&&(a=a.shadowRoot);r<=s;++r)n[r]&&(l=createElm(null,o,r,e),l&&(n[r].$elm$=l,insertBefore(a,l,referenceNode(t))))},removeVnodes=(e,t,o)=>{for(let n=t;n<=o;++n){const t=e[n];if(t){const e=t.$elm$;nullifyVNodeRefs(t),e&&(checkSlotFallbackVisibility=!0,e["s-ol"]?e["s-ol"].remove():putBackInOriginalLocation(e,!0),e.remove())}}},updateChildren=(e,t,o,n,r=!1)=>{let s,l,a=0,i=0,c=0,$=0,d=t.length-1,p=t[0],m=t[d],u=n.length-1,h=n[0],f=n[u];for(;a<=d&&i<=u;)if(null==p)p=t[++a];else if(null==m)m=t[--d];else if(null==h)h=n[++i];else if(null==f)f=n[--u];else if(isSameVnode(p,h,r))patch(p,h,r),p=t[++a],h=n[++i];else if(isSameVnode(m,f,r))patch(m,f,r),m=t[--d],f=n[--u];else if(isSameVnode(p,f,r))"slot"!==p.$tag$&&"slot"!==f.$tag$||putBackInOriginalLocation(p.$elm$.parentNode,!1),patch(p,f,r),insertBefore(e,p.$elm$,m.$elm$.nextSibling),p=t[++a],f=n[--u];else if(isSameVnode(m,h,r))"slot"!==p.$tag$&&"slot"!==f.$tag$||putBackInOriginalLocation(m.$elm$.parentNode,!1),patch(m,h,r),insertBefore(e,m.$elm$,p.$elm$),m=t[--d],h=n[++i];else{for(c=-1,$=a;$<=d;++$)if(t[$]&&null!==t[$].$key$&&t[$].$key$===h.$key$){c=$;break}c>=0?(l=t[c],l.$tag$!==h.$tag$?s=createElm(t&&t[i],o,c,e):(patch(l,h,r),t[c]=void 0,s=l.$elm$),h=n[++i]):(s=createElm(t&&t[i],o,i,e),h=n[++i]),s&&insertBefore(parentReferenceNode(p.$elm$),s,referenceNode(p.$elm$))}a>d?addVnodes(e,null==n[u+1]?null:n[u+1].$elm$,o,n,i,u):i>u&&removeVnodes(t,a,d)},isSameVnode=(e,t,o=!1)=>e.$tag$===t.$tag$&&("slot"===e.$tag$?(!("$nodeId$"in e)||!o||8===e.$elm$.nodeType)&&e.$name$===t.$name$:!!o||e.$key$===t.$key$),referenceNode=e=>e&&e["s-ol"]||e,parentReferenceNode=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,patch=(e,t,o=!1)=>{const n=t.$elm$=e.$elm$,r=e.$children$,s=t.$children$,l=t.$tag$,a=t.$text$;let i;null===a?(isSvgMode="svg"===l||"foreignObject"!==l&&isSvgMode,("slot"!==l||useNativeShadowDom)&&updateElement(e,t,isSvgMode),null!==r&&null!==s?updateChildren(n,r,t,s,o):null!==s?(null!==e.$text$&&(n.textContent=""),addVnodes(n,null,t,s,0,s.length-1)):!o&&BUILD.updatable&&null!==r&&removeVnodes(r,0,r.length-1),isSvgMode&&"svg"===l&&(isSvgMode=!1)):(i=n["s-cr"])?i.parentNode.textContent=a:e.$text$!==a&&(n.data=a)},updateFallbackSlotVisibility=e=>{const t=e.childNodes;for(const e of t)if(1===e.nodeType){if(e["s-sr"]){const o=e["s-sn"];e.hidden=!1;for(const n of t)if(n!==e)if(n["s-hn"]!==e["s-hn"]||""!==o){if(1===n.nodeType&&(o===n.getAttribute("slot")||o===n["s-sn"])||3===n.nodeType&&o===n["s-sn"]){e.hidden=!0;break}}else if(1===n.nodeType||3===n.nodeType&&""!==n.textContent.trim()){e.hidden=!0;break}}updateFallbackSlotVisibility(e)}},relocateNodes=[],markSlotContentForRelocation=e=>{let t,o,n;for(const r of e.childNodes){if(r["s-sr"]&&(t=r["s-cr"])&&t.parentNode){o=t.parentNode.childNodes;const e=r["s-sn"];for(n=o.length-1;n>=0;n--)if(t=o[n],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==r["s-hn"]&&!BUILD.experimentalSlotFixes)if(isNodeLocatedInSlot(t,e)){let o=relocateNodes.find((e=>e.$nodeToRelocate$===t));checkSlotFallbackVisibility=!0,t["s-sn"]=t["s-sn"]||e,o?(o.$nodeToRelocate$["s-sh"]=r["s-hn"],o.$slotRefNode$=r):(t["s-sh"]=r["s-hn"],relocateNodes.push({$slotRefNode$:r,$nodeToRelocate$:t})),t["s-sr"]&&relocateNodes.map((e=>{isNodeLocatedInSlot(e.$nodeToRelocate$,t["s-sn"])&&(o=relocateNodes.find((e=>e.$nodeToRelocate$===t)),o&&!e.$slotRefNode$&&(e.$slotRefNode$=o.$slotRefNode$))}))}else relocateNodes.some((e=>e.$nodeToRelocate$===t))||relocateNodes.push({$nodeToRelocate$:t})}1===r.nodeType&&markSlotContentForRelocation(r)}},isNodeLocatedInSlot=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,nullifyVNodeRefs=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(nullifyVNodeRefs)},insertBefore=(e,t,o)=>null==e?void 0:e.insertBefore(t,o),renderVdom=(e,t,o=!1)=>{var n,r,s,l;const a=e.$hostElement$,i=e.$cmpMeta$,c=e.$vnode$||newVNode(null,null),$=isHost(t)?t:h(null,null,t);if(hostTagName=a.tagName,i.$attrsToReflect$&&($.$attrs$=$.$attrs$||{},i.$attrsToReflect$.map((([e,t])=>$.$attrs$[t]=a[e]))),o&&$.$attrs$)for(const e of Object.keys($.$attrs$))a.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&($.$attrs$[e]=a[e]);if($.$tag$=null,$.$flags$|=4,e.$vnode$=$,$.$elm$=c.$elm$=a.shadowRoot||a,scopeId=a["s-sc"],useNativeShadowDom=!!(1&i.$flags$),contentRef=a["s-cr"],checkSlotFallbackVisibility=!1,patch(c,$,o),plt.$flags$|=1,checkSlotRelocate){markSlotContentForRelocation($.$elm$);for(const e of relocateNodes){const t=e.$nodeToRelocate$;if(!t["s-ol"]){const e=doc.createTextNode("");e["s-nr"]=t,insertBefore(t.parentNode,t["s-ol"]=e,t)}}for(const e of relocateNodes){const t=e.$nodeToRelocate$,a=e.$slotRefNode$;if(a){const e=a.parentNode;let o=a.nextSibling;{let s=null==(n=t["s-ol"])?void 0:n.previousSibling;for(;s;){let n=null!=(r=s["s-nr"])?r:null;if(n&&n["s-sn"]===t["s-sn"]&&e===n.parentNode){for(n=n.nextSibling;n===t||(null==n?void 0:n["s-sr"]);)n=null==n?void 0:n.nextSibling;if(!n||!n["s-nr"]){o=n;break}}s=s.previousSibling}}(!o&&e!==t.parentNode||t.nextSibling!==o)&&t!==o&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),insertBefore(e,t,o),1===t.nodeType&&(t.hidden=null!=(s=t["s-ih"])&&s)),t&&"function"==typeof a["s-rf"]&&a["s-rf"](t)}else 1===t.nodeType&&(o&&(t["s-ih"]=null!=(l=t.hidden)&&l),t.hidden=!0)}}checkSlotFallbackVisibility&&updateFallbackSlotVisibility($.$elm$),plt.$flags$&=-2,relocateNodes.length=0,contentRef=void 0},attachToAncestor=(e,t)=>{t&&!e.$onRenderResolve$&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.$onRenderResolve$=t)))},scheduleUpdate=(e,t)=>{if(4&e.$flags$)return void(e.$flags$|=512);attachToAncestor(e,e.$ancestorComponent$);return dispatchHooks(e,t)},dispatchHooks=(e,t)=>{const o=e.$hostElement$,n=createTime("scheduleUpdate",e.$cmpMeta$.$tagName$),r=e.$lazyInstance$;if(!r)throw new Error(`Can't render component <${o.tagName.toLowerCase()} /> with invalid KoliBri runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let s;return t&&(e.$flags$|=256,e.$queuedListeners$&&(e.$queuedListeners$.map((([e,t])=>safeCall(r,e,t))),e.$queuedListeners$=void 0),s=safeCall(r,"componentWillLoad")),s=enqueue(s,(()=>safeCall(r,"componentWillRender"))),n(),enqueue(s,(()=>updateComponent(e,r,t)))},enqueue=(e,t)=>isPromisey(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),isPromisey=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,updateComponent=async(e,t,o)=>{var n;const r=e.$hostElement$,s=createTime("update",e.$cmpMeta$.$tagName$),l=r["s-rc"];o&&attachStyles(e);const a=createTime("render",e.$cmpMeta$.$tagName$);callRender(e,t,r,o),l&&(l.map((e=>e())),r["s-rc"]=void 0),a(),s();{const t=null!=(n=r["s-p"])?n:[],o=()=>postUpdateComponent(e);0===t.length?o():(Promise.all(t).then(o),e.$flags$|=4,t.length=0)}},callRender=(e,t,o,n)=>{try{t=t.render&&t.render(),e.$flags$|=2,renderVdom(e,t,n)}catch(t){consoleError(t,e.$hostElement$)}return null},postUpdateComponent=e=>{const t=e.$cmpMeta$.$tagName$,o=e.$hostElement$,n=createTime("postUpdate",t),r=e.$lazyInstance$,s=e.$ancestorComponent$;safeCall(r,"componentDidRender"),64&e.$flags$?n():(e.$flags$|=64,addHydratedFlag(o),safeCall(r,"componentDidLoad"),n(),e.$onReadyResolve$(o),s||appDidLoad()),e.$onInstanceResolve$(o),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),512&e.$flags$&&nextTick((()=>scheduleUpdate(e,!1))),e.$flags$&=-517},appDidLoad=e=>{addHydratedFlag(doc.documentElement),nextTick((()=>emitEvent(win,"appload",{detail:{namespace:"kolibri"}})))},safeCall=(e,t,o)=>{if(e&&e[t])try{return e[t](o)}catch(e){consoleError(e)}},addHydratedFlag=e=>{var t;return e.classList.add(null!=(t=BUILD.hydratedSelectorName)?t:"hydrated")},getValue=(e,t)=>getHostRef(e).$instanceValues$.get(t),setValue=(e,t,o,n)=>{const r=getHostRef(e);if(!r)throw new Error(`Couldn't find host element for "${n.$tagName$}" as it is unknown to this KoliBri runtime. This usually happens when integrating a 3rd party KoliBri component with another KoliBri component or application. Please reach out to the maintainers of the 3rd party KoliBri component or report this on the KoliBri Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const s=r.$hostElement$,l=r.$instanceValues$.get(t),a=r.$flags$,i=r.$lazyInstance$;o=parsePropertyValue(o,n.$members$[t][0]);const c=Number.isNaN(l)&&Number.isNaN(o);if((!(8&a)||void 0===l)&&(o!==l&&!c)&&(r.$instanceValues$.set(t,o),i)){if(n.$watchers$&&128&a){const e=n.$watchers$[t];e&&e.map((e=>{try{i[e](o,l,t)}catch(e){consoleError(e,s)}}))}2==(18&a)&&scheduleUpdate(r,!1)}},proxyComponent=(e,t,o)=>{var n,r;const s=e.prototype;if(t.$members$||t.$watchers$||e.watchers){e.watchers&&!t.$watchers$&&(t.$watchers$=e.watchers);const l=Object.entries(null!=(n=t.$members$)?n:{});if(l.map((([e,[n]])=>{31&n||2&o&&32&n?Object.defineProperty(s,e,{get(){return getValue(this,e)},set(o){setValue(this,e,o,t)},configurable:!0,enumerable:!0}):1&o&&64&n&&Object.defineProperty(s,e,{value(...t){var o;const n=getHostRef(this);return null==(o=null==n?void 0:n.$onInstancePromise$)?void 0:o.then((()=>{var o;return null==(o=n.$lazyInstance$)?void 0:o[e](...t)}))}})})),1&o){const o=new Map;s.attributeChangedCallback=function(e,n,r){plt.jmp((()=>{var l;const a=o.get(e);if(this.hasOwnProperty(a))r=this[a],delete this[a];else{if(s.hasOwnProperty(a)&&"number"==typeof this[a]&&this[a]==r)return;if(null==a){const o=getHostRef(this),s=null==o?void 0:o.$flags$;if(s&&!(8&s)&&128&s&&r!==n){const s=o.$lazyInstance$,a=null==(l=t.$watchers$)?void 0:l[e];null==a||a.forEach((t=>{null!=s[t]&&s[t].call(s,r,n,e)}))}return}}this[a]=(null!==r||"boolean"!=typeof this[a])&&r}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=t.$watchers$)?r:{}),...l.filter((([e,t])=>15&t[0])).map((([e,n])=>{var r;const s=n[1]||e;return o.set(s,e),512&n[0]&&(null==(r=t.$attrsToReflect$)||r.push([e,s])),s}))]))}}return e},initializeComponent=async(e,t,o,n)=>{let r;if(!(32&t.$flags$)){t.$flags$|=32;if(o.$lazyBundleId$){const e=loadModule(o);if(e&&"then"in e){const t=uniqueTime();r=await e,t()}else r=e;if(!r)throw new Error(`Constructor for "${o.$tagName$}#${t.$modeName$}" was not found`);r.isProxied||(o.$watchers$=r.watchers,proxyComponent(r,o,2),r.isProxied=!0);const n=createTime("createInstance",o.$tagName$);t.$flags$|=8;try{new r(t)}catch(e){consoleError(e)}t.$flags$&=-9,t.$flags$|=128,n(),fireConnectedCallback(t.$lazyInstance$)}else{r=e.constructor;const o=e.localName;customElements.whenDefined(o).then((()=>t.$flags$|=128))}if(r&&r.style){let n;"string"==typeof r.style?n=r.style:"string"!=typeof r.style&&(t.$modeName$=computeMode(e),t.$modeName$&&(n=r.style[t.$modeName$]));const s=getScopeId(o,t.$modeName$);if(!styles.has(s)){const e=createTime("registerStyles",o.$tagName$);registerStyle(s,n,!!(1&o.$flags$)),e()}}}const s=t.$ancestorComponent$,l=()=>scheduleUpdate(t,!0);s&&s["s-rc"]?s["s-rc"].push(l):l()},fireConnectedCallback=e=>{safeCall(e,"connectedCallback")},connectedCallback=e=>{if(!(1&plt.$flags$)){const t=getHostRef(e),o=t.$cmpMeta$,n=createTime("connectedCallback",o.$tagName$);if(1&t.$flags$)addHostEventListeners(e,t,o.$listeners$),(null==t?void 0:t.$lazyInstance$)?fireConnectedCallback(t.$lazyInstance$):(null==t?void 0:t.$onReadyPromise$)&&t.$onReadyPromise$.then((()=>fireConnectedCallback(t.$lazyInstance$)));else{let n;if(t.$flags$|=1,n=e.getAttribute(HYDRATE_ID),n){if(1&o.$flags$){const t=addStyle(e.shadowRoot,o,e.getAttribute("s-mode"));e.classList.remove(t+"-h",t+"-s")}initializeClientHydrate(e,o.$tagName$,n,t)}n||12&o.$flags$&&setContentReference(e);{let o=e;for(;o=o.parentNode||o.host;)if(1===o.nodeType&&o.hasAttribute("s-id")&&o["s-p"]||o["s-p"]){attachToAncestor(t,t.$ancestorComponent$=o);break}}o.$members$&&Object.entries(o.$members$).map((([t,[o]])=>{if(31&o&&e.hasOwnProperty(t)){const o=e[t];delete e[t],e[t]=o}})),initializeComponent(e,t,o)}n()}},setContentReference=e=>{const t=e["s-cr"]=doc.createComment("");t["s-cn"]=!0,insertBefore(e,t,e.firstChild)},disconnectInstance=e=>{safeCall(e,"disconnectedCallback")},disconnectedCallback=async e=>{if(!(1&plt.$flags$)){const t=getHostRef(e);t.$rmListeners$&&(t.$rmListeners$.map((e=>e())),t.$rmListeners$=void 0),(null==t?void 0:t.$lazyInstance$)?disconnectInstance(t.$lazyInstance$):(null==t?void 0:t.$onReadyPromise$)&&t.$onReadyPromise$.then((()=>disconnectInstance(t.$lazyInstance$)))}},bootstrapLazy=(e,t={})=>{var o;const n=createTime(),r=[],s=t.exclude||[],l=win.customElements,a=doc.head,i=a.querySelector("meta[charset]"),c=doc.createElement("style"),$=[];let d,p=!0;Object.assign(plt,t),plt.$resourcesUrl$=new URL(t.resourcesUrl||"./",doc.baseURI).href,plt.$flags$|=2;let m=!1;if(e.map((e=>{e[1].map((o=>{var n;const a={$flags$:o[0],$tagName$:o[1],$members$:o[2],$listeners$:o[3]};4&a.$flags$&&(m=!0),a.$members$=o[2],a.$listeners$=o[3],a.$attrsToReflect$=[],a.$watchers$=null!=(n=o[4])?n:{};const i=t.transformTagName?t.transformTagName(a.$tagName$):a.$tagName$,c=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,registerHost(e=this,a),1&a.$flags$)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw new Error(`Unable to re-use existing shadow root for ${a.$tagName$}! Mode is set to ${e.shadowRoot.mode} but KoliBri only supports open shadow roots.`)}else e.attachShadow({mode:"open",delegatesFocus:!!(16&a.$flags$)})}connectedCallback(){const e=getHostRef(this);this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,addHostEventListeners(this,e,a.$listeners$)),d&&(clearTimeout(d),d=null),p?$.push(this):plt.jmp((()=>connectedCallback(this)))}disconnectedCallback(){plt.jmp((()=>disconnectedCallback(this)))}componentOnReady(){return getHostRef(this).$onReadyPromise$}};a.$lazyBundleId$=e[0],s.includes(i)||l.get(i)||(r.push(i),l.define(i,proxyComponent(c,a,1)))}))})),r.length>0&&(m&&(c.textContent+=SLOT_FB_CSS),c.textContent+=r.sort()+HYDRATED_CSS,c.innerHTML.length)){c.setAttribute("data-styles","");const e=null!=(o=plt.$nonce$)?o:queryNonceMetaTagContent(doc);null!=e&&c.setAttribute("nonce",e),a.insertBefore(c,i?i.nextSibling:a.firstChild)}p=!1,$.length?$.map((e=>e.connectedCallback())):plt.jmp((()=>d=setTimeout(appDidLoad,30))),n()},Fragment=(e,t)=>t,addHostEventListeners=(e,t,o,n)=>{o&&o.map((([o,n,r])=>{const s=getHostListenerTarget(e,o),l=hostListenerProxy(t,r),a=hostListenerOpts(o);plt.ael(s,n,l,a),(t.$rmListeners$=t.$rmListeners$||[]).push((()=>plt.rel(s,n,l,a)))}))},hostListenerProxy=(e,t)=>o=>{var n;try{256&e.$flags$?null==(n=e.$lazyInstance$)||n[t](o):(e.$queuedListeners$=e.$queuedListeners$||[]).push([t,o])}catch(e){consoleError(e)}},getHostListenerTarget=(e,t)=>8&t?win:e,hostListenerOpts=e=>supportsListenerOptions?{passive:!!(1&e),capture:!!(2&e)}:!!(2&e),setNonce=e=>plt.$nonce$=e;export{Env as E,Fragment as F,Host as H,setMode as a,bootstrapLazy as b,getElement as g,h,promiseResolve as p,registerInstance as r,setNonce as s};