@mgdis/stencil-helpers 2.2.6 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -5
- package/dist/index.es.js +630 -448
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +22 -7
- package/dist/index.umd.js.map +1 -1
- package/dist/storybook/index.d.ts +6 -5
- package/dist/storybook/index.d.ts.map +1 -1
- package/package.json +11 -10
package/dist/index.umd.js
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
|
-
(function(a,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(a=typeof globalThis<"u"?globalThis:a||self,p(a.StencilHelpersModule={}))})(this,function(a){"use strict";var yt=Object.defineProperty;var me=a=>{throw TypeError(a)};var mt=(a,p,m)=>p in a?yt(a,p,{enumerable:!0,configurable:!0,writable:!0,value:m}):a[p]=m;var v=(a,p,m)=>mt(a,typeof p!="symbol"?p+"":p,m),bt=(a,p,m)=>p.has(a)||me("Cannot "+m);var O=(a,p,m)=>(bt(a,p,"read from private field"),m?m.call(a):p.get(a)),Z=(a,p,m)=>p.has(a)?me("Cannot add the same private member more than once"):p instanceof WeakSet?p.add(a):p.set(a,m);var _,w;const p=(e="",t=10)=>{const s=new Uint8Array(t);crypto.getRandomValues(s);const r=Array.from(s).map(n=>n.toString(16).padStart(2,"0")).join("").slice(0,t);return e!==""?`${e}-${r}`:r},m=e=>K(e)&&/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e)!==null;class be{constructor(t=[]){v(this,"classes");v(this,"add",t=>{this.has(t)||this.classes.push(t)});v(this,"delete",t=>{const s=this.classes.indexOf(t);s>-1&&this.classes.splice(s,1)});v(this,"has",t=>this.classes.includes(t));v(this,"join",()=>this.classes.join(" "));this.classes=t}}const Se=e=>Array.isArray(e)&&e.every(t=>typeof t=="string"),ke=(e,t)=>t.includes(e==null?void 0:e.tagName.toLowerCase()),Te='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button',Ee=e=>{const t=I(e),s=J(e);return[e,...t,...s]},I=(e,t=[])=>{if(e.self!==e.top)try{const s=e.parent;return s?(t.push(s),I(s,t)):t}catch(s){return console.error("Different hosts between iframes:",s),t}return t},J=(e,t=[])=>{if(e.frames.length>0)for(const s of Array.from(e.frames))t.push(s),J(s,t);return t},K=e=>typeof e=="string"&&e.trim()!=="",_e=e=>typeof e=="object"?JSON.stringify(e):`${e}`,Ae=e=>typeof e=="number"&&!Number.isNaN(e),je=e=>typeof e=="string"?e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g,""):e,Oe=async e=>e();var F={updatable:!0,slotRelocation:!0,experimentalSlotFixes:!1},Me=Object.defineProperty,Le=(e,t)=>{for(var s in t)Me(e,s,{get:t[s],enumerable:!0})},Re="http://www.w3.org/2000/svg",Ne="http://www.w3.org/1999/xhtml",Q=(e,t)=>t in e,Y="http://www.w3.org/1999/xlink",V=typeof window<"u"?window:{},x=V.document||{head:{}},A={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,s,r)=>e.addEventListener(t,s,r),rel:(e,t,s,r)=>e.removeEventListener(t,s,r),ce:(e,t)=>new CustomEvent(e,t)},Fe=e=>e!=null&&e!==void 0,ee=e=>(e=typeof e,e==="object"||e==="function"),xe={};Le(xe,{err:()=>te,map:()=>Ce,ok:()=>W,unwrap:()=>De,unwrapErr:()=>He});var W=e=>({isOk:!0,isErr:!1,value:e}),te=e=>({isOk:!1,isErr:!0,value:e});function Ce(e,t){if(e.isOk){const s=t(e.value);return s instanceof Promise?s.then(r=>W(r)):W(s)}if(e.isErr){const s=e.value;return te(s)}throw"should never get here"}var De=e=>{if(e.isOk)return e.value;throw e.value},He=e=>{if(e.isErr)return e.value;throw e.value},se=e=>{const t=e.__childNodes||e.childNodes;e.tagName&&e.tagName.includes("-")&&e["s-cr"]&&e.tagName!=="SLOT-FB"&&re(t,e.tagName).forEach(s=>{var r;s.nodeType===1&&s.tagName==="SLOT-FB"&&((r=Ue(s,s["s-sn"],!1))!=null&&r.length?s.hidden=!0:s.hidden=!1)});for(const s of t)s.nodeType===1&&(s.__childNodes||s.childNodes).length&&se(s)};function re(e,t,s){let r=0,n=[],i;for(;r<e.length;r++)i=e[r],i["s-sr"]&&i["s-hn"]===t&&s===void 0&&n.push(i),n=[...n,...re(i.childNodes,t,s)];return n}var Ue=(e,t,s=!0)=>{const r=[];for((s&&e["s-sr"]||!e["s-sr"])&&r.push(e);(e=e.nextSibling)&&e["s-sn"]===t;)r.push(e);return r},ne=(e,t)=>e.nodeType===1?e.getAttribute("slot")===null&&t===""||e.getAttribute("slot")===t:e["s-sn"]===t?!0:t==="",Pe=(e,t,...s)=>{let r=null,n=null,i=null,o=!1,u=!1;const f=[],$=l=>{for(let g=0;g<l.length;g++)r=l[g],Array.isArray(r)?$(r):r!=null&&typeof r!="boolean"&&((o=!ee(r))&&(r=String(r)),o&&u?f[f.length-1].$text$+=r:f.push(o?z(null,r):r),u=o)};$(s);const d=z(e,null);return d.$attrs$=t,f.length>0&&(d.$children$=f),d.$key$=n,d.$name$=i,d},z=(e,t)=>{const s={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return s.$attrs$=null,s.$key$=null,s.$name$=null,s},qe={},we=e=>e&&e.$tag$===qe,ie=(e,t,s,r,n,i,o)=>{if(s!==r){let u=Q(e,t),f=t.toLowerCase();if(t==="class"){const $=e.classList,d=oe(s);let l=oe(r);$.remove(...d.filter(g=>g&&!l.includes(g))),$.add(...l.filter(g=>g&&!d.includes(g)))}else if(t==="style"){for(const $ in s)(!r||r[$]==null)&&($.includes("-")?e.style.removeProperty($):e.style[$]="");for(const $ in r)(!s||r[$]!==s[$])&&($.includes("-")?e.style.setProperty($,r[$]):e.style[$]=r[$])}else if(t!=="key")if(t==="ref")r&&r(e);else if(!e.__lookupSetter__(t)&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"?t=t.slice(3):Q(V,f)?t=f.slice(2):t=f[2]+t.slice(3),s||r){const $=t.endsWith(le);t=t.replace(Ie,""),s&&A.rel(e,t,s,$),r&&A.ael(e,t,r,$)}}else{const $=ee(r);if((u||$&&r!==null)&&!n)try{if(e.tagName.includes("-"))e[t]!==r&&(e[t]=r);else{const l=r??"";t==="list"?u=!1:(s==null||e[t]!=l)&&(typeof e.__lookupSetter__(t)=="function"?e[t]=l:e.setAttribute(t,l))}}catch{}let d=!1;f!==(f=f.replace(/^xlink\:?/,""))&&(t=f,d=!0),r==null||r===!1?(r!==!1||e.getAttribute(t)==="")&&(d?e.removeAttributeNS(Y,t):e.removeAttribute(t)):(!u||i&4||n)&&!$&&(r=r===!0?"":r,d?e.setAttributeNS(Y,t,r):e.setAttribute(t,r))}}},Be=/\s/,oe=e=>(typeof e=="object"&&e&&"baseVal"in e&&(e=e.baseVal),!e||typeof e!="string"?[]:e.split(Be)),le="Capture",Ie=new RegExp(le+"$"),ae=(e,t,s,r)=>{const n=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,i=e&&e.$attrs$||{},o=t.$attrs$||{};for(const u of ce(Object.keys(i)))u in o||ie(n,u,i[u],void 0,s,t.$flags$);for(const u of ce(Object.keys(o)))ie(n,u,i[u],o[u],s,t.$flags$)};function ce(e){return e.includes("ref")?[...e.filter(t=>t!=="ref"),"ref"]:e}var C,D,M,H=!1,U=!1,G=!1,b=!1,P=(e,t,s)=>{var r;const n=t.$children$[s];let i=0,o,u,f;if(H||(G=!0,n.$tag$==="slot"&&(n.$flags$|=n.$children$?2:1)),n.$text$!==null)o=n.$elm$=x.createTextNode(n.$text$);else if(n.$flags$&1)o=n.$elm$=x.createTextNode("");else{if(b||(b=n.$tag$==="svg"),o=n.$elm$=x.createElementNS(b?Re:Ne,!H&&F.slotRelocation&&n.$flags$&2?"slot-fb":n.$tag$),b&&n.$tag$==="foreignObject"&&(b=!1),ae(null,n,b),Fe(C)&&o["s-si"]!==C&&o.classList.add(o["s-si"]=C),n.$children$)for(i=0;i<n.$children$.length;++i)u=P(e,n,i),u&&o.appendChild(u);n.$tag$==="svg"?b=!1:o.tagName==="foreignObject"&&(b=!0)}return o["s-hn"]=M,n.$flags$&3&&(o["s-sr"]=!0,o["s-cr"]=D,o["s-sn"]=n.$name$||"",o["s-rf"]=(r=n.$attrs$)==null?void 0:r.ref,f=e&&e.$children$&&e.$children$[s],f&&f.$tag$===n.$tag$&&e.$elm$&&L(e.$elm$,!1),ge(D,o,t.$elm$,e==null?void 0:e.$elm$)),o},L=(e,t)=>{A.$flags$|=1;const s=Array.from(e.__childNodes||e.childNodes);e["s-sr"]&&F.experimentalSlotFixes;for(let r=s.length-1;r>=0;r--){const n=s[r];n["s-hn"]!==M&&n["s-ol"]&&(E(R(n).parentNode,n,R(n)),n["s-ol"].remove(),n["s-ol"]=void 0,n["s-sh"]=void 0,G=!0),t&&L(n,t)}A.$flags$&=-2},fe=(e,t,s,r,n,i)=>{let o=e["s-cr"]&&e["s-cr"].parentNode||e,u;for(o.shadowRoot&&o.tagName===M&&(o=o.shadowRoot);n<=i;++n)r[n]&&(u=P(null,s,n),u&&(r[n].$elm$=u,E(o,u,R(t))))},ue=(e,t,s)=>{for(let r=t;r<=s;++r){const n=e[r];if(n){const i=n.$elm$;de(n),i&&(U=!0,i["s-ol"]?i["s-ol"].remove():L(i,!0),i.remove())}}},We=(e,t,s,r,n=!1)=>{let i=0,o=0,u=0,f=0,$=t.length-1,d=t[0],l=t[$],g=r.length-1,c=r[0],h=r[g],T,S;for(;i<=$&&o<=g;)if(d==null)d=t[++i];else if(l==null)l=t[--$];else if(c==null)c=r[++o];else if(h==null)h=r[--g];else if(q(d,c,n))j(d,c,n),d=t[++i],c=r[++o];else if(q(l,h,n))j(l,h,n),l=t[--$],h=r[--g];else if(q(d,h,n))(d.$tag$==="slot"||h.$tag$==="slot")&&L(d.$elm$.parentNode,!1),j(d,h,n),E(e,d.$elm$,l.$elm$.nextSibling),d=t[++i],h=r[--g];else if(q(l,c,n))(d.$tag$==="slot"||h.$tag$==="slot")&&L(l.$elm$.parentNode,!1),j(l,c,n),E(e,l.$elm$,d.$elm$),l=t[--$],c=r[++o];else{for(u=-1,f=i;f<=$;++f)if(t[f]&&t[f].$key$!==null&&t[f].$key$===c.$key$){u=f;break}u>=0?(S=t[u],S.$tag$!==c.$tag$?T=P(t&&t[o],s,u):(j(S,c,n),t[u]=void 0,T=S.$elm$),c=r[++o]):(T=P(t&&t[o],s,o),c=r[++o]),T&&E(R(d.$elm$).parentNode,T,R(d.$elm$))}i>$?fe(e,r[g+1]==null?null:r[g+1].$elm$,s,r,o,g):o>g&&ue(t,i,$)},q=(e,t,s=!1)=>e.$tag$===t.$tag$?e.$tag$==="slot"?e.$name$===t.$name$:s?(s&&!e.$key$&&t.$key$&&(e.$key$=t.$key$),!0):e.$key$===t.$key$:!1,R=e=>e&&e["s-ol"]||e,j=(e,t,s=!1)=>{const r=t.$elm$=e.$elm$,n=e.$children$,i=t.$children$,o=t.$tag$,u=t.$text$;let f;u===null?(b=o==="svg"?!0:o==="foreignObject"?!1:b,o==="slot"&&!H||ae(e,t,b),n!==null&&i!==null?We(r,n,t,i,s):i!==null?(e.$text$!==null&&(r.textContent=""),fe(r,null,t,i,0,i.length-1)):!s&&F.updatable&&n!==null&&ue(n,0,n.length-1),b&&o==="svg"&&(b=!1)):(f=r["s-cr"])?f.parentNode.textContent=u:e.$text$!==u&&(r.data=u)},k=[],$e=e=>{let t,s,r;const n=e.__childNodes||e.childNodes;for(const i of n){if(i["s-sr"]&&(t=i["s-cr"])&&t.parentNode){s=t.parentNode.__childNodes||t.parentNode.childNodes;const o=i["s-sn"];for(r=s.length-1;r>=0;r--)if(t=s[r],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==i["s-hn"])if(ne(t,o)){let u=k.find(f=>f.$nodeToRelocate$===t);U=!0,t["s-sn"]=t["s-sn"]||o,u?(u.$nodeToRelocate$["s-sh"]=i["s-hn"],u.$slotRefNode$=i):(t["s-sh"]=i["s-hn"],k.push({$slotRefNode$:i,$nodeToRelocate$:t})),t["s-sr"]&&k.map(f=>{ne(f.$nodeToRelocate$,t["s-sn"])&&(u=k.find($=>$.$nodeToRelocate$===t),u&&!f.$slotRefNode$&&(f.$slotRefNode$=u.$slotRefNode$))})}else k.some(u=>u.$nodeToRelocate$===t)||k.push({$nodeToRelocate$:t})}i.nodeType===1&&$e(i)}},de=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(de)},E=(e,t,s)=>(typeof t["s-sn"]=="string"&&t["s-sr"]&&t["s-cr"]&&ge(t["s-cr"],t,e,t.parentElement),e==null?void 0:e.insertBefore(t,s));function ge(e,t,s,r){var n;let i;if(e&&typeof t["s-sn"]=="string"&&t["s-sr"]&&e.parentNode&&e.parentNode["s-sc"]&&(i=t["s-si"]||e.parentNode["s-sc"])){const o=t["s-sn"],u=t["s-hn"];if((n=s.classList)==null||n.add(i+"-s"),r&&r.classList.contains(i+"-s")){let f=(r.__childNodes||r.childNodes)[0],$=!1;for(;f;){if(f["s-sn"]!==o&&f["s-hn"]===u&&f["s-sr"]){$=!0;break}f=f.nextSibling}$||r.classList.remove(i+"-s")}}}var ze=(e,t,s=!1)=>{var r,n,i,o,u;const f=e.$hostElement$,$=e.$cmpMeta$,d=e.$vnode$||z(null,null),l=we(t)?t:Pe(null,null,t);if(M=f.tagName,$.$attrsToReflect$&&(l.$attrs$=l.$attrs$||{},$.$attrsToReflect$.map(([g,c])=>l.$attrs$[c]=f[g])),s&&l.$attrs$)for(const g of Object.keys(l.$attrs$))f.hasAttribute(g)&&!["key","ref","style","class"].includes(g)&&(l.$attrs$[g]=f[g]);l.$tag$=null,l.$flags$|=4,e.$vnode$=l,l.$elm$=d.$elm$=f.shadowRoot||f,C=f["s-sc"],H=($.$flags$&1)!==0,D=f["s-cr"],U=!1,j(d,l,s);{if(A.$flags$|=1,G){$e(l.$elm$);for(const g of k){const c=g.$nodeToRelocate$;if(!c["s-ol"]){const h=x.createTextNode("");h["s-nr"]=c,E(c.parentNode,c["s-ol"]=h,c)}}for(const g of k){const c=g.$nodeToRelocate$,h=g.$slotRefNode$;if(h){const T=h.parentNode;let S=h.nextSibling;{let B=(r=c["s-ol"])==null?void 0:r.previousSibling;for(;B;){let y=(n=B["s-nr"])!=null?n:null;if(y&&y["s-sn"]===c["s-sn"]&&T===(y.__parentNode||y.parentNode)){for(y=y.nextSibling;y===c||y!=null&&y["s-sr"];)y=y==null?void 0:y.nextSibling;if(!y||!y["s-nr"]){S=y;break}}B=B.previousSibling}}const ht=c.__parentNode||c.parentNode,vt=c.__nextSibling||c.nextSibling;(!S&&T!==ht||vt!==S)&&c!==S&&(!c["s-hn"]&&c["s-ol"]&&(c["s-hn"]=c["s-ol"].parentNode.nodeName),E(T,c,S),c.nodeType===1&&c.tagName!=="SLOT-FB"&&(c.hidden=(i=c["s-ih"])!=null?i:!1)),c&&typeof h["s-rf"]=="function"&&h["s-rf"](c)}else c.nodeType===1&&(s&&(c["s-ih"]=(o=c.hidden)!=null?o:!1),c.hidden=!0)}}U&&se(l.$elm$),A.$flags$&=-2,k.length=0}if(F.experimentalScopedSlotChanges&&$.$flags$&2){const g=l.$elm$.__childNodes||l.$elm$.childNodes;for(const c of g)c["s-hn"]!==M&&!c["s-sh"]&&(s&&c["s-ih"]==null&&(c["s-ih"]=(u=c.hidden)!=null?u:!1),c.hidden=!0)}D=void 0};const Ge=(e,t,s)=>{[null,void 0,"",!1].includes(s)||["innerHTML","style"].includes(t)||e.setAttribute(t,["object","function"].includes(typeof s)?"/!\\ Object props are not rendered in the code example":s)},pe=(e,t,s,r,n)=>{if(t&&typeof t=="string"){const i=document.createElement(t);Object.keys(s||{}).forEach(o=>{Ge(i,o,s[o])}),r==null||r.forEach(o=>{pe(i,o.$tag$,o.$attrs$,o.$children$,o.$text$)}),s!=null&&s.innerHTML&&(i.innerHTML=s.innerHTML),e.appendChild(i)}n&&(e.innerHTML=n)},Xe=(e,t)=>{const s={};if(typeof e!="object")throw new Error("filterArgs - args isn't an object.");for(const r in e)if(!r.startsWith("slot")){const n=e[r],i=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();(!t||!Object.keys(t).includes(r)||t[r]!==n)&&(s[i]=n)}return s},Ze=(e,t)=>{var r,n;const s=document.getElementById("storybook-root");if(s!==null)return(n=document.querySelector("[lang]"))==null||n.setAttribute("lang",((r=t.globals)==null?void 0:r.locale)||"en"),ze({$cmpMeta$:{$flags$:0,$tagName$:s.tagName},$hostElement$:s},e(t)),s.children[s.children.length-1]},Je=({$tag$:e,$attrs$:t,$children$:s,$text$:r})=>{const n=document.createElement("div");return pe(n,e,t,s,r),n.innerHTML},N=(e,t)=>{if(!t)return;const s=t.split("/");return`${e}${s.slice(2,s.length-1).join("-")}--docs`};class Ke{constructor(t){v(this,"jsonDoc");Z(this,_,t=>this.jsonDoc.components.find(s=>s.tag===t));Z(this,w,t=>{const s=t.type.replace(/"([^"]+)"/g,"$1").replace(/\s/g,"").replace(/\(.*?\)/g,r=>r.replace(/\|/g," OR ")).split("|").map(r=>r.trim().replace(/ OR /g,"|"));return t.type==="string"?{control:{type:"text"}}:t.type==="number"?{control:{type:"number"}}:t.type==="boolean"?{control:{type:"boolean"}}:t.type.startsWith("{")&&t.type.endsWith("}")?{control:{type:"object"}}:s.length>1?s.includes("string")?{control:{type:"text"}}:s.every(r=>r==null?void 0:r.includes("[]"))?{control:{type:"object"}}:(s.unshift(void 0),{control:{type:"select"},options:s}):{control:{type:"object"}}});v(this,"extractArgTypes",t=>{const s=O(this,_).call(this,t),r=s==null?void 0:s.props.reduce((d,l)=>{const{control:g,options:c}=O(this,w).call(this,l);return{...d,[l.name]:{name:l.attr||l.name,description:l.docs,type:{required:l.required},table:{category:"props",type:{summary:l.type},defaultValue:{summary:l.default}},control:g,options:c}}},{}),n=s==null?void 0:s.events.reduce((d,l)=>({...d,[l.event]:{name:l.event,description:l.docs,table:{category:"events",type:{summary:l.detail}}}}),{}),i=s==null?void 0:s.methods.reduce((d,l)=>({...d,[l.name]:{name:l.name,description:l.docs,table:{category:"methods",type:{summary:l.signature}}}}),{}),o=s==null?void 0:s.slots.reduce((d,l)=>({...d,[l.name]:{name:l.name!==""?l.name:"default",description:l.docs,table:{category:"slots",type:{summary:void 0}}}}),{}),u=s==null?void 0:s.styles.reduce((d,l)=>({...d,[l.name]:{name:l.name,description:l.docs,table:{category:"custom properties",type:{summary:void 0}}}}),{}),f=s==null?void 0:s.dependencies.reduce((d,l)=>{const g=O(this,_).call(this,l);return{...d,[l]:{name:l,description:`<a href="./?path=/docs/${N("",g==null?void 0:g.filePath)}">View Component Documentation</a>`,table:{category:"depends on",type:{summary:void 0}}}}},{}),$=s==null?void 0:s.dependents.reduce((d,l)=>{const g=O(this,_).call(this,l);return{...d,[l]:{name:l,description:`<a href="./?path=/docs/${N("",g==null?void 0:g.filePath)}">View Component Documentation</a>`,table:{category:"used by",type:{summary:void 0}}}}},{});return{...r,...n,...i,...o,...u,...f,...$}});v(this,"extractComponentDescription",t=>{const s=O(this,_).call(this,t);return(s==null?void 0:s.readme)||(s==null?void 0:s.docs)});this.jsonDoc=t}}_=new WeakMap,w=new WeakMap;const Qe=(e,t)=>{if(t)return`${e}${t}`},he=e=>{let t=e.overview?`${e.overview}
|
|
1
|
+
(function(u,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(u=typeof globalThis<"u"?globalThis:u||self,d(u.StencilHelpersModule={}))})(this,function(u){"use strict";var Kt=Object.defineProperty;var Ne=u=>{throw TypeError(u)};var Qt=(u,d,_)=>d in u?Kt(u,d,{enumerable:!0,configurable:!0,writable:!0,value:_}):u[d]=_;var b=(u,d,_)=>Qt(u,typeof d!="symbol"?d+"":d,_),Vt=(u,d,_)=>d.has(u)||Ne("Cannot "+_);var z=(u,d,_)=>(Vt(u,d,"read from private field"),_?_.call(u):d.get(u)),oe=(u,d,_)=>d.has(u)?Ne("Cannot add the same private member more than once"):d instanceof WeakSet?d.add(u):d.set(u,_);var T,Z;const d=(e="",t=10)=>{const r=new Uint8Array(t);crypto.getRandomValues(r);const s=Array.from(r).map(n=>n.toString(16).padStart(2,"0")).join("").slice(0,t);return e!==""?`${e}-${s}`:s},_=e=>le(e)&&/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e)!==null;class Me{constructor(t=[]){b(this,"classes");b(this,"add",t=>{this.has(t)||this.classes.push(t)});b(this,"delete",t=>{const r=this.classes.indexOf(t);r>-1&&this.classes.splice(r,1)});b(this,"has",t=>this.classes.includes(t));b(this,"join",()=>this.classes.join(" "));this.classes=t}}const Le=e=>Array.isArray(e)&&e.every(t=>typeof t=="string"),Fe=(e,t)=>t.includes(e==null?void 0:e.tagName.toLowerCase()),Ce='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button',Ie=e=>{const t=W(e),r=ae(e);return[e,...t,...r]},W=(e,t=[])=>{if(e.self!==e.top)try{const r=e.parent;return r?(t.push(r),W(r,t)):t}catch(r){return console.error("Different hosts between iframes:",r),t}return t},ae=(e,t=[])=>{if(e.frames.length>0)for(const r of Array.from(e.frames))t.push(r),ae(r,t);return t},le=e=>typeof e=="string"&&e.trim()!=="",De=e=>typeof e=="object"?JSON.stringify(e):`${e}`,Ue=e=>typeof e=="number"&&!Number.isNaN(e),Pe=e=>typeof e=="string"?e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g,""):e,He=async e=>e();var C={updatable:!0,slotRelocation:!0,experimentalSlotFixes:!1},qe=Object.defineProperty,Ze=(e,t)=>{for(var r in t)qe(e,r,{get:t[r],enumerable:!0})},Be="http://www.w3.org/2000/svg",Ge="http://www.w3.org/1999/xhtml",ce=(e,t)=>t in e,fe="http://www.w3.org/1999/xlink",k=typeof window<"u"?window:{},j={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,r,s)=>e.addEventListener(t,r,s),rel:(e,t,r,s)=>e.removeEventListener(t,r,s),ce:(e,t)=>new CustomEvent(e,t)},We=e=>e!=null&&e!==void 0,ue=e=>(e=typeof e,e==="object"||e==="function"),Xe={};Ze(Xe,{err:()=>ge,map:()=>Je,ok:()=>X,unwrap:()=>Ye,unwrapErr:()=>Ke});var X=e=>({isOk:!0,isErr:!1,value:e}),ge=e=>({isOk:!1,isErr:!0,value:e});function Je(e,t){if(e.isOk){const r=t(e.value);return r instanceof Promise?r.then(s=>X(s)):X(r)}if(e.isErr){const r=e.value;return ge(r)}throw"should never get here"}var Ye=e=>{if(e.isOk)return e.value;throw e.value},Ke=e=>{if(e.isErr)return e.value;throw e.value},pe=e=>{const t=ye(e,"childNodes");e.tagName&&e.tagName.includes("-")&&e["s-cr"]&&e.tagName!=="SLOT-FB"&&$e(t,e.tagName).forEach(s=>{s.nodeType===1&&s.tagName==="SLOT-FB"&&(Ve(s,J(s),!1).length?s.hidden=!0:s.hidden=!1)});let r=0;for(r=0;r<t.length;r++){const s=t[r];s.nodeType===1&&ye(s,"childNodes").length&&pe(s)}},Qe=e=>{const t=[];for(let r=0;r<e.length;r++){const s=e[r]["s-nr"]||void 0;s&&s.isConnected&&t.push(s)}return t};function $e(e,t,r){let s=0,n=[],i;for(;s<e.length;s++)i=e[s],i["s-sr"]&&(!t||i["s-hn"]===t)&&r===void 0&&n.push(i),n=[...n,...$e(i.childNodes,t,r)];return n}var Ve=(e,t,r=!0)=>{const s=[];(r&&e["s-sr"]||!e["s-sr"])&&s.push(e);let n=e;for(;n=n.nextSibling;)J(n)===t&&(r||!n["s-sr"])&&s.push(n);return s},de=(e,t)=>e.nodeType===1?e.getAttribute("slot")===null&&t===""||e.getAttribute("slot")===t:e["s-sn"]===t?!0:t==="",J=e=>typeof e["s-sn"]=="string"?e["s-sn"]:e.nodeType===1&&e.getAttribute("slot")||void 0;function et(e){if(e.assignedElements||e.assignedNodes||!e["s-sr"])return;const t=r=>(function(s){const n=[],i=this["s-sn"];s!=null&&s.flatten&&console.error(`
|
|
2
|
+
Flattening is not supported for Stencil non-shadow slots.
|
|
3
|
+
You can use \`.childNodes\` to nested slot fallback content.
|
|
4
|
+
If you have a particular use case, please open an issue on the Stencil repo.
|
|
5
|
+
`);const o=this["s-cr"].parentElement;return(o.__childNodes?o.childNodes:Qe(o.childNodes)).forEach(l=>{i===J(l)&&n.push(l)}),r?n.filter(l=>l.nodeType===1):n}).bind(e);e.assignedElements=t(!0),e.assignedNodes=t(!1)}function ye(e,t){if("__"+t in e){const r=e["__"+t];return typeof r!="function"?r:r.bind(e)}else return typeof e[t]!="function"?e[t]:e[t].bind(e)}var tt=(e,t,...r)=>{let s=null,n=null,i=null,o=!1,f=!1;const l=[],c=a=>{for(let $=0;$<a.length;$++)s=a[$],Array.isArray(s)?c(s):s!=null&&typeof s!="boolean"&&((o=!ue(s))&&(s=String(s)),o&&f?l[l.length-1].$text$+=s:l.push(o?Y(null,s):s),f=o)};c(r);const p=Y(e,null);return p.$attrs$=t,l.length>0&&(p.$children$=l),p.$key$=n,p.$name$=i,p},Y=(e,t)=>{const r={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return r.$attrs$=null,r.$key$=null,r.$name$=null,r},rt={},st=e=>e&&e.$tag$===rt,be=(e,t,r,s,n,i,o)=>{if(r===s)return;let f=ce(e,t),l=t.toLowerCase();if(t==="class"){const c=e.classList,p=ve(r);let a=ve(s);c.remove(...p.filter($=>$&&!a.includes($))),c.add(...a.filter($=>$&&!p.includes($)))}else if(t==="style"){for(const c in r)(!s||s[c]==null)&&(c.includes("-")?e.style.removeProperty(c):e.style[c]="");for(const c in s)(!r||s[c]!==r[c])&&(c.includes("-")?e.style.setProperty(c,s[c]):e.style[c]=s[c])}else if(t!=="key")if(t==="ref")s&&s(e);else if(!e.__lookupSetter__(t)&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"?t=t.slice(3):ce(k,l)?t=l.slice(2):t=l[2]+t.slice(3),r||s){const c=t.endsWith(he);t=t.replace(it,""),r&&j.rel(e,t,r,c),s&&j.ael(e,t,s,c)}}else{const c=ue(s);if((f||c&&s!==null)&&!n)try{if(e.tagName.includes("-"))e[t]!==s&&(e[t]=s);else{const a=s??"";t==="list"?f=!1:(r==null||e[t]!=a)&&(typeof e.__lookupSetter__(t)=="function"?e[t]=a:e.setAttribute(t,a))}}catch{}let p=!1;l!==(l=l.replace(/^xlink\:?/,""))&&(t=l,p=!0),s==null||s===!1?(s!==!1||e.getAttribute(t)==="")&&(p?e.removeAttributeNS(fe,t):e.removeAttribute(t)):(!f||i&4||n)&&!c&&e.nodeType===1&&(s=s===!0?"":s,p?e.setAttributeNS(fe,t,s):e.setAttribute(t,s))}},nt=/\s/,ve=e=>(typeof e=="object"&&e&&"baseVal"in e&&(e=e.baseVal),!e||typeof e!="string"?[]:e.split(nt)),he="Capture",it=new RegExp(he+"$"),K=(e,t,r,s)=>{const n=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,i=e&&e.$attrs$||{},o=t.$attrs$||{};for(const f of _e(Object.keys(i)))f in o||be(n,f,i[f],void 0,r,t.$flags$);for(const f of _e(Object.keys(o)))be(n,f,i[f],o[f],r,t.$flags$)};function _e(e){return e.includes("ref")?[...e.filter(t=>t!=="ref"),"ref"]:e}var I,D,N,Q=!1,U=!1,V=!1,h=!1,P=(e,t,r)=>{var s;const n=t.$children$[r];let i=0,o,f,l;if(Q||(V=!0,n.$tag$==="slot"&&(n.$flags$|=n.$children$?2:1)),n.$text$!==null)o=n.$elm$=k.document.createTextNode(n.$text$);else if(n.$flags$&1)o=n.$elm$=k.document.createTextNode(""),K(null,n,h);else{if(h||(h=n.$tag$==="svg"),!k.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.");if(o=n.$elm$=k.document.createElementNS(h?Be:Ge,!Q&&C.slotRelocation&&n.$flags$&2?"slot-fb":n.$tag$),h&&n.$tag$==="foreignObject"&&(h=!1),K(null,n,h),We(I)&&o["s-si"]!==I&&o.classList.add(o["s-si"]=I),n.$children$)for(i=0;i<n.$children$.length;++i)f=P(e,n,i),f&&o.appendChild(f);n.$tag$==="svg"?h=!1:o.tagName==="foreignObject"&&(h=!0)}return o["s-hn"]=N,n.$flags$&3&&(o["s-sr"]=!0,o["s-cr"]=D,o["s-sn"]=n.$name$||"",o["s-rf"]=(s=n.$attrs$)==null?void 0:s.ref,et(o),l=e&&e.$children$&&e.$children$[r],l&&l.$tag$===n.$tag$&&e.$elm$&&M(e.$elm$,!1),Oe(D,o,t.$elm$,e==null?void 0:e.$elm$)),o},M=(e,t)=>{j.$flags$|=1;const r=Array.from(e.__childNodes||e.childNodes);e["s-sr"]&&C.experimentalSlotFixes;for(let s=r.length-1;s>=0;s--){const n=r[s];n["s-hn"]!==N&&n["s-ol"]&&(A(L(n).parentNode,n,L(n)),n["s-ol"].remove(),n["s-ol"]=void 0,n["s-sh"]=void 0,V=!0),t&&M(n,t)}j.$flags$&=-2},we=(e,t,r,s,n,i)=>{let o=e["s-cr"]&&e["s-cr"].parentNode||e,f;for(o.shadowRoot&&o.tagName===N&&(o=o.shadowRoot);n<=i;++n)s[n]&&(f=P(null,r,n),f&&(s[n].$elm$=f,A(o,f,L(t))))},Se=(e,t,r)=>{for(let s=t;s<=r;++s){const n=e[s];if(n){const i=n.$elm$;Ee(n),i&&(U=!0,i["s-ol"]?i["s-ol"].remove():M(i,!0),i.remove())}}},ot=(e,t,r,s,n=!1)=>{let i=0,o=0,f=0,l=0,c=t.length-1,p=t[0],a=t[c],$=s.length-1,g=s[0],y=s[$],m,w;for(;i<=c&&o<=$;)if(p==null)p=t[++i];else if(a==null)a=t[--c];else if(g==null)g=s[++o];else if(y==null)y=s[--$];else if(H(p,g,n))R(p,g,n),p=t[++i],g=s[++o];else if(H(a,y,n))R(a,y,n),a=t[--c],y=s[--$];else if(H(p,y,n))(p.$tag$==="slot"||y.$tag$==="slot")&&M(p.$elm$.parentNode,!1),R(p,y,n),A(e,p.$elm$,a.$elm$.nextSibling),p=t[++i],y=s[--$];else if(H(a,g,n))(p.$tag$==="slot"||y.$tag$==="slot")&&M(a.$elm$.parentNode,!1),R(a,g,n),A(e,a.$elm$,p.$elm$),a=t[--c],g=s[++o];else{for(f=-1,l=i;l<=c;++l)if(t[l]&&t[l].$key$!==null&&t[l].$key$===g.$key$){f=l;break}f>=0?(w=t[f],w.$tag$!==g.$tag$?m=P(t&&t[o],r,f):(R(w,g,n),t[f]=void 0,m=w.$elm$),g=s[++o]):(m=P(t&&t[o],r,o),g=s[++o]),m&&A(L(p.$elm$).parentNode,m,L(p.$elm$))}i>c?we(e,s[$+1]==null?null:s[$+1].$elm$,r,s,o,$):o>$&&Se(t,i,c)},H=(e,t,r=!1)=>e.$tag$===t.$tag$?e.$tag$==="slot"?e.$name$===t.$name$:r?(r&&!e.$key$&&t.$key$&&(e.$key$=t.$key$),!0):e.$key$===t.$key$:!1,L=e=>e&&e["s-ol"]||e,R=(e,t,r=!1)=>{const s=t.$elm$=e.$elm$,n=e.$children$,i=t.$children$,o=t.$tag$,f=t.$text$;let l;f===null?(h=o==="svg"?!0:o==="foreignObject"?!1:h,K(e,t,h),n!==null&&i!==null?ot(s,n,t,i,r):i!==null?(e.$text$!==null&&(s.textContent=""),we(s,null,t,i,0,i.length-1)):!r&&C.updatable&&n!==null&&Se(n,0,n.length-1),h&&o==="svg"&&(h=!1)):(l=s["s-cr"])?l.parentNode.textContent=f:e.$text$!==f&&(s.data=f)},O=[],me=e=>{let t,r,s;const n=e.__childNodes||e.childNodes;for(const i of n){if(i["s-sr"]&&(t=i["s-cr"])&&t.parentNode){r=t.parentNode.__childNodes||t.parentNode.childNodes;const o=i["s-sn"];for(s=r.length-1;s>=0;s--)if(t=r[s],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==i["s-hn"])if(de(t,o)){let f=O.find(l=>l.$nodeToRelocate$===t);U=!0,t["s-sn"]=t["s-sn"]||o,f?(f.$nodeToRelocate$["s-sh"]=i["s-hn"],f.$slotRefNode$=i):(t["s-sh"]=i["s-hn"],O.push({$slotRefNode$:i,$nodeToRelocate$:t})),t["s-sr"]&&O.map(l=>{de(l.$nodeToRelocate$,t["s-sn"])&&(f=O.find(c=>c.$nodeToRelocate$===t),f&&!l.$slotRefNode$&&(l.$slotRefNode$=f.$slotRefNode$))})}else O.some(f=>f.$nodeToRelocate$===t)||O.push({$nodeToRelocate$:t})}i.nodeType===1&&me(i)}},Ee=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(Ee)},A=(e,t,r)=>(typeof t["s-sn"]=="string"&&t["s-sr"]&&t["s-cr"]&&Oe(t["s-cr"],t,e,t.parentElement),e==null?void 0:e.insertBefore(t,r));function Oe(e,t,r,s){var n,i;let 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"])){const f=t["s-sn"],l=t["s-hn"];if((n=r.classList)==null||n.add(o+"-s"),s&&((i=s.classList)!=null&&i.contains(o+"-s"))){let c=(s.__childNodes||s.childNodes)[0],p=!1;for(;c;){if(c["s-sn"]!==f&&c["s-hn"]===l&&c["s-sr"]){p=!0;break}c=c.nextSibling}p||s.classList.remove(o+"-s")}}}var at=(e,t,r=!1)=>{var s,n,i,o,f;const l=e.$hostElement$,c=e.$cmpMeta$,p=e.$vnode$||Y(null,null),a=st(t)?t:tt(null,null,t);if(N=l.tagName,c.$attrsToReflect$&&(a.$attrs$=a.$attrs$||{},c.$attrsToReflect$.map(([$,g])=>a.$attrs$[g]=l[$])),r&&a.$attrs$)for(const $ of Object.keys(a.$attrs$))l.hasAttribute($)&&!["key","ref","style","class"].includes($)&&(a.$attrs$[$]=l[$]);a.$tag$=null,a.$flags$|=4,e.$vnode$=a,a.$elm$=p.$elm$=l.shadowRoot||l,I=l["s-sc"],Q=!!(c.$flags$&1)&&!(c.$flags$&128),D=l["s-cr"],U=!1,R(p,a,r);{if(j.$flags$|=1,V){me(a.$elm$);for(const $ of O){const g=$.$nodeToRelocate$;if(!g["s-ol"]&&k.document){const y=k.document.createTextNode("");y["s-nr"]=g,A(g.parentNode,g["s-ol"]=y,g)}}for(const $ of O){const g=$.$nodeToRelocate$,y=$.$slotRefNode$;if(y){const m=y.parentNode;let w=y.nextSibling;{let E=(s=g["s-ol"])==null?void 0:s.previousSibling;for(;E;){let v=(n=E["s-nr"])!=null?n:null;if(v&&v["s-sn"]===g["s-sn"]&&m===(v.__parentNode||v.parentNode)){for(v=v.nextSibling;v===g||v!=null&&v["s-sr"];)v=v==null?void 0:v.nextSibling;if(!v||!v["s-nr"]){w=v;break}}E=E.previousSibling}}const B=g.__parentNode||g.parentNode,G=g.__nextSibling||g.nextSibling;(!w&&m!==B||G!==w)&&g!==w&&(!g["s-hn"]&&g["s-ol"]&&(g["s-hn"]=g["s-ol"].parentNode.nodeName),A(m,g,w),g.nodeType===1&&g.tagName!=="SLOT-FB"&&(g.hidden=(i=g["s-ih"])!=null?i:!1)),g&&typeof y["s-rf"]=="function"&&y["s-rf"](y)}else g.nodeType===1&&(r&&(g["s-ih"]=(o=g.hidden)!=null?o:!1),g.hidden=!0)}}U&&pe(a.$elm$),j.$flags$&=-2,O.length=0}if(C.experimentalScopedSlotChanges&&c.$flags$&2){const $=a.$elm$.__childNodes||a.$elm$.childNodes;for(const g of $)g["s-hn"]!==N&&!g["s-sh"]&&(r&&g["s-ih"]==null&&(g["s-ih"]=(f=g.hidden)!=null?f:!1),g.hidden=!0)}D=void 0};const ee={ignore:[],ignore_with:"_!i-£___£%_",strict:!1,tab_size:2,tag_wrap:!1,tag_wrap_width:80,trim:[]},S="!i-£___£%_",ke=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],te=e=>/<(?:[A-Za-z]+[A-Za-z0-9]*)(?:\s+.*?)*?\/{0,1}>/.test(e)||/<(?<Element>(?:[A-Za-z]+[A-Za-z0-9]*:)?(?:[A-Za-z]+[A-Za-z0-9]*))(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e)||/<(?<Element>(?:[a-z][a-z0-9._]*:)?[a-z][a-z0-9._]*-[a-z0-9._-]+)(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e),Ae=(e,t)=>{if(!e||!t)throw new Error("Both 'current' and 'updates' must be passed-in to mergeObjects()");let r;if(Array.isArray(e))r=structuredClone(e).concat(t);else if(typeof e=="object"){r={...e};for(let s of Object.keys(t))typeof t[s]!="object"?r[s]=t[s]:r[s]=Ae(r[s]||{},t[s])}return r},lt=(e,t)=>Ae(structuredClone(e),t),ct=e=>(e=e.replace(/<[\w:\-]+([^>]*[^\/])>/g,(t,r)=>t.replace(r,s=>s.replace(/\n/g,S+"nl!").replace(/\r/g,S+"cr!").replace(/\s/g,S+"ws!"))),e),ft=e=>{const t=/<([A-Za-z][A-Za-z0-9]*|[a-z][a-z0-9._]*-[a-z0-9._-]+)((?:\s+[A-Za-z0-9_-]+="[^"]*"|\s*[a-z]*)*)>/g;return e=e.replace(t,(r,s,n)=>r.replace(n,i=>i.replace(/</g,S+"lt!").replace(/>/g,S+"gt!"))),e},ut=(e,t)=>{const r=t.ignore,s=t.ignore_with;for(let n=0;n<r.length;n++){const i=new RegExp(`<${r[n]}[^>]*>((.|
|
|
6
|
+
)*?)</${r[n]}>`,"g");e=e.replace(i,(o,f)=>o.replace(f,l=>l.replace(/</g,"-"+s+"lt-").replace(/>/g,"-"+s+"gt-").replace(/\n/g,"-"+s+"nl-").replace(/\r/g,"-"+s+"cr-").replace(/\s/g,"-"+s+"ws-")))}return e},gt=(e,t)=>{for(let r=0;r<t.length;r++){const s=new RegExp(`(<${t[r]}[^>]*>)\\s+`,"g"),n=new RegExp(`\\s+(</${t[r]}>)`,"g");e=e.replace(s,"$1").replace(n,"$1")}return e},pt=e=>(e=e.replace(/<[\w:\-]+([^>]*[^\/])>/g,(t,r)=>t.replace(r,s=>s.replace(new RegExp(S+"nl!","g"),`
|
|
7
|
+
`).replace(new RegExp(S+"cr!","g"),"\r").replace(new RegExp(S+"ws!","g")," "))),e),$t=e=>(e=e.replace(/<[\w:\-]+([^>]*)>/g,(t,r)=>t.replace(r,s=>s.replace(new RegExp(S+"lt!","g"),"<").replace(new RegExp(S+"gt!","g"),">"))),e),dt=(e,t)=>{const r=t.ignore,s=t.ignore_with;for(let n=0;n<r.length;n++){const i=new RegExp(`<${r[n]}[^>]*>((.|
|
|
8
|
+
)*?)</${r[n]}>`,"g");e=e.replace(i,(o,f)=>o.replace(f,l=>l.replace(new RegExp("-"+s+"lt-","g"),"<").replace(new RegExp("-"+s+"gt-","g"),">").replace(new RegExp("-"+s+"nl-","g"),`
|
|
9
|
+
`).replace(new RegExp("-"+s+"cr-","g"),"\r").replace(new RegExp("-"+s+"ws-","g")," ")))}return e},yt=e=>{var s,n;if(typeof e!="object")throw new Error("Config must be an object.");if(!(Object.hasOwn(e,"ignore")||Object.hasOwn(e,"ignore_with")||Object.hasOwn(e,"strict")||Object.hasOwn(e,"tab_size")||Object.hasOwn(e,"tag_wrap")||Object.hasOwn(e,"tag_wrap_width")||Object.hasOwn(e,"trim")))return ee;let r=e.tab_size;if(r){if(typeof r!="number")throw new Error(`tab_size must be a number, not ${typeof e.tab_size}.`);if(!Number.isSafeInteger(r))throw new Error(`Tab size ${r} is not safe. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger for more info.`);if(r=Math.floor(r),r<1||r>16)throw new Error("Tab size out of range. Expecting 1 to 16.");e.tab_size=r}if(Object.hasOwn(e,"ignore")&&(!Array.isArray(e.ignore)||!((s=e.ignore)!=null&&s.every(i=>typeof i=="string"))))throw new Error("Ignore config must be an array of strings.");if(Object.hasOwn(e,"ignore_with")&&typeof e.ignore_with!="string")throw new Error(`Ignore_with config must be a string, not ${typeof e.ignore_with}.`);if(Object.hasOwn(e,"strict")&&typeof e.strict!="boolean")throw new Error(`Strict config must be a boolean, not ${typeof e.strict}.`);if(Object.hasOwn(e,"tag_wrap")&&typeof e.tag_wrap!="boolean")throw new Error(`tag_wrap config must be a boolean, not ${typeof e.tag_wrap}.`);if(Object.hasOwn(e,"tag_wrap_width")&&typeof e.tag_wrap_width!="number")throw new Error(`tag_wrap_width config must be a number, not ${typeof e.tag_wrap_width}.`);if(Object.hasOwn(e,"trim")&&(!Array.isArray(e.trim)||!((n=e.trim)!=null&&n.every(i=>typeof i=="string"))))throw new Error("Trim config must be an array of strings.");return lt(ee,e)},bt=(e,t=!0)=>t&&!te(e)?e:e.replace(/<([a-zA-Z\-0-9:]+)[^>]*>/g,(r,s)=>ke.indexOf(s)>-1?`${r.substring(0,r.length-1)} />`.replace(/\/\s\//g,"/"):r.replace(/[\s]?\/>/g,`></${s}>`)),vt=(e,t=!1)=>(e=e.replace(/<textarea[^>]*>((.|\n)*?)<\/textarea>/g,(r,s)=>r.replace(s,n=>n.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\n/g," ").replace(/\r/g," ").replace(/\s/g," "))),t&&(e=e.replace(/<textarea[^>]*>((.|\n)*?)<\/textarea>/g,(r,s)=>(r=r.replace(s,n=>n.replace(/\n|\t/g,"").replace(/[a-z]+="\s*"/ig,"").replace(/>\s+</g,"><").replace(/\s+/g," ")),r=r.replace(/\s+/g," ").replace(/\s>/g,">").replace(/>\s/g,">").replace(/\s</g,"<").replace(/class=["']\s/g,n=>n.replace(/\s/g,"")).replace(/(class=.*)\s(["'])/g,"$1$2"),r))),e),ht=(e,t=!0)=>t&&!te(e)?e:(e=vt(e),e.replace(/\n|\t/g,"").replace(/>\s+</g,"><").replace(/\s+/g," ").replace(/(.+=)"\s+"/ig,'$1""').replace(/(.+=)'\s+'/ig,"$1''").replace(/\s>/g,">").replace(/<\s\//g,"</").replace(/class=["']\s/g,r=>r.replace(/\s/g,"")).replace(/(class=.*)\s(["'])/g,"$1$2"));let q,re;const x={line:[]},_t=e=>{x.line=[];let t=-1;const r=/(<[^>]+>)|([^<]+)/g;return e=e.replace(r,(s,n,i)=>(n?x.line.push({type:"tag",value:s}):i&&i.trim().length>0&&x.line.push({type:"text",value:s}),t++,`
|
|
10
|
+
[#-# : ${t} : ${s} : #-#]
|
|
11
|
+
`)),e},wt=e=>(e=bt(e,!1),re.length>0&&(e=gt(e,re)),e=ht(e,!1),e=_t(e),e),St=(e,t)=>{const r=t.tab_size,s=t.tag_wrap,n=t.tag_wrap_width;let i="";x.line.forEach((l,c)=>{e=e.replace(/\n+/g,`
|
|
12
|
+
`).replace(`[#-# : ${c} : ${l.value} : #-#]`,p=>{var w,B;let a=0;const $=`[#-# : ${c-1} : ${(w=x.line[c-1])==null?void 0:w.value} : #-#]`;i+="0",c===0&&a++,p.indexOf(`#-# : ${c} : </`)>-1&&a++,$.indexOf("<!doctype")>-1&&a++,$.indexOf("<!--")>-1&&a++,$.indexOf("/> : #-#")>-1&&a++,$.indexOf(`#-# : ${c-1} : </`)>-1&&a++,((B=x.line[c-1])==null?void 0:B.type)==="text"&&a++;const g=i.length-a;if(i=i.substring(0,g),q&&p.indexOf("<!--")>-1)return"";const y=p.replace(`[#-# : ${c} : `,"").replace(" : #-#]","");if(s&&/<[A-Za-z]+\b[^>]*(?:.|\n)*?\/?>/g.test(l.value)&&l.value.length>n){const G=/\s{1}[A-Za-z-]+(?:=".*?")?/g,E=l.value.split(G).filter(Boolean),v=l.value.matchAll(G),ne=r*g,Xt=ne+r;let ie=E[0].padStart(E[0].length+ne)+`
|
|
13
|
+
`;for(const ze of v){const Yt=ze[0].trim().padStart(ze[0].trim().length+Xt)+`
|
|
14
|
+
`;ie+=Yt}const Jt=E[1].padStart(E[1].trim().length+ne+(q&&ke.includes(E[0].slice(1))?1:0));return ie+=Jt,ie}else return y.padStart(y.length+r*g)})}),s&&(e=ct(e)),e=e.replace(/<(?<Element>.+).*>[^<]*?[^><\/\s][^<]*?<\/{1}\k<Element>|<script[^>]*>\s+<\/script>|<(\w+)>\s+<\/(\w+)|<(?:([\w:\._-]+)|([\w:\._-]+)[^>]*[^\/])>\s+<\/([\w:\._-]+)>/g,l=>l.replace(/\n|\t|\s{2,}/g,"")),s&&(e=pt(e)),q&&(e=e.replace(/\s\/>|\/>/g,">"));const o=e.substring(0,1),f=e.substring(e.length-1);return o===`
|
|
15
|
+
`&&(e=e.substring(1,e.length)),f===`
|
|
16
|
+
`&&(e=e.substring(0,e.length-1)),e},mt=(e,t)=>{if(!te(e))return e;const r=t?yt(t):ee;q=r.strict;const s=r.ignore.length>0;return re=r.trim,s&&(e=ut(e,r)),e=ft(e),e=wt(e),e=St(e,r),e=$t(e),s&&(e=dt(e,r)),e},Et=(e,t,r)=>{[null,void 0,"",!1].includes(r)||["innerHTML","style",""].includes(t)||e.setAttribute(t,["object","function"].includes(typeof r)?"⚠️ Property must be set through a script or a framework-specific syntax.":r)},Te=(e,t,r,s,n)=>{if(t&&typeof t=="string"){const i=document.createElement(t);Object.keys(r||{}).forEach(o=>{Et(i,o,r[o])}),s==null||s.forEach(o=>{Te(i,o.$tag$,o.$attrs$,o.$children$,o.$text$)}),r!=null&&r.innerHTML&&(i.innerHTML=r.innerHTML),e.appendChild(i)}n&&(e.innerHTML=n)},Ot=(e,t,r=[])=>{const s={};if(typeof e!="object")throw new Error("filterArgs - args isn't an object.");for(const n in e)if(!r.includes(n)){const i=e[n],o=n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();(!t||!Object.keys(t).includes(n)||t[n]!==i)&&(s[o]=i)}return s},kt=(e,t)=>{var s,n;const r=document.getElementById("storybook-root");if(r!==null)return(n=document.querySelector("[lang]"))==null||n.setAttribute("lang",((s=t.globals)==null?void 0:s.locale)||"en"),at({$cmpMeta$:{$flags$:0,$tagName$:r.tagName},$hostElement$:r},e(t)),r.children[r.children.length-1]},At=({$tag$:e,$attrs$:t,$children$:r,$text$:s})=>{const n=document.createElement("div");return Te(n,e,t,r,s),mt(n.innerHTML,{tag_wrap:!0}).replace(/="true"/g,"")},F=(e,t)=>{if(!t)return;const r=t.split("/");return`${e}${r.slice(2,r.length-1).join("-")}--docs`};class Tt{constructor(t){b(this,"jsonDoc");oe(this,T,t=>this.jsonDoc.components.find(r=>r.tag===t));oe(this,Z,t=>{const r=t.type.replace(/"([^"]+)"/g,"$1").replace(/\s/g,"").replace(/\(.*?\)/g,s=>s.replace(/\|/g," OR ")).split("|").map(s=>s.trim().replace(/ OR /g,"|"));return t.type==="string"?{control:{type:"text"}}:t.type==="number"?{control:{type:"number"}}:t.type==="boolean"?{control:{type:"boolean"}}:t.type.startsWith("{")&&t.type.endsWith("}")?{control:{type:"object"}}:r.length>1?r.includes("string")?{control:{type:"text"}}:r.every(s=>s==null?void 0:s.includes("[]"))?{control:{type:"object"}}:(r.unshift(void 0),{control:{type:"select"},options:r}):{control:{type:"object"}}});b(this,"extractArgTypes",t=>{const r=z(this,T).call(this,t),s=r==null?void 0:r.props.reduce((p,a)=>{const{control:$,options:g}=z(this,Z).call(this,a);return{...p,[a.name]:{name:a.attr||a.name,description:a.docs,type:{required:a.required},table:{category:"props",type:{summary:a.type},defaultValue:{summary:a.default}},control:$,options:g}}},{}),n=r==null?void 0:r.events.reduce((p,a)=>({...p,[a.event]:{name:a.event,description:a.docs,table:{category:"events",type:{summary:a.detail}}}}),{}),i=r==null?void 0:r.methods.reduce((p,a)=>({...p,[a.name]:{name:a.name,description:a.docs,table:{category:"methods",type:{summary:a.signature}}}}),{}),o=r==null?void 0:r.slots.reduce((p,a)=>({...p,[a.name]:{name:a.name!==""?a.name:"default",description:a.docs,table:{category:"slots",type:{summary:void 0}}}}),{}),f=r==null?void 0:r.styles.reduce((p,a)=>({...p,[a.name]:{name:a.name,description:a.docs,table:{category:"custom properties",type:{summary:void 0}}}}),{}),l=r==null?void 0:r.dependencies.reduce((p,a)=>{const $=z(this,T).call(this,a);return $?{...p,[a]:{name:a,description:`<a href="./?path=/docs/${F("",$==null?void 0:$.filePath)}">View Component Documentation</a>`,table:{category:"depends on",type:{summary:void 0}}}}:p},{}),c=r==null?void 0:r.dependents.reduce((p,a)=>{const $=z(this,T).call(this,a);return $?{...p,[a]:{name:a,description:`<a href="./?path=/docs/${F("",$==null?void 0:$.filePath)}">View Component Documentation</a>`,table:{category:"used by",type:{summary:void 0}}}}:p},{});return{...s,...n,...i,...o,...f,...l,...c}});b(this,"extractComponentDescription",t=>{const r=z(this,T).call(this,t);return(r==null?void 0:r.readme)||(r==null?void 0:r.docs)});this.jsonDoc=t}}T=new WeakMap,Z=new WeakMap;const jt=(e,t)=>{if(t)return`${e}${t}`},je=e=>{let t=e.overview?`${e.overview}
|
|
2
17
|
|
|
3
|
-
`:"";const
|
|
4
|
-
`,t+=
|
|
18
|
+
`:"";const r=e.props.filter(({attr:n})=>n!==void 0);r.length&&(t+=`Attributes:
|
|
19
|
+
`,t+=r.map(({attr:n,docs:i})=>`- \`${n}\`: ${i}
|
|
5
20
|
`).join(""),t+=`
|
|
6
|
-
`);const
|
|
7
|
-
`,t+=
|
|
21
|
+
`);const s=e.props.filter(({attr:n})=>n===void 0);return s.length&&(t+=`Properties:
|
|
22
|
+
`,t+=s.map(({name:n,docs:i})=>`- \`${n}\`: ${i}
|
|
8
23
|
`).join(""),t+=`
|
|
9
24
|
`),e.methods.length&&(t+=`Methods:
|
|
10
25
|
`,t+=e.methods.map(({name:n,docs:i})=>`- \`${n}\`: ${i}
|
|
@@ -18,7 +33,7 @@
|
|
|
18
33
|
`),e.slots.length&&(t+=`Slots:
|
|
19
34
|
`,t+=e.slots.map(({name:n,docs:i})=>`- \`${n}\`: ${i}
|
|
20
35
|
`).join(""),t+=`
|
|
21
|
-
`),t},
|
|
36
|
+
`),t},se=e=>`${e.docs}
|
|
22
37
|
|
|
23
|
-
Type: \`${e.type}\``,
|
|
38
|
+
Type: \`${e.type}\``,Rt=(e,t,r,s)=>({$schema:"https://json.schemastore.org/web-types",name:e,version:t,"description-markup":"markdown",contributions:{html:{elements:r.components.map(n=>{const i=F(s,n.filePath);return{name:n.tag,description:je(n),"doc-url":i,attributes:n.props.filter(o=>o.attr).map(o=>({name:o.attr,description:se(o),"doc-url":i,value:{type:o.type,default:o.default,required:o.required}})),js:{properties:n.props.map(o=>({name:o.name,description:se(o),"doc-url":i,value:{type:o.type,default:o.default,required:o.required}})),events:n.events.map(o=>({name:o.event,description:o.docs}))},css:{properties:n.styles.map(o=>({name:o.name,description:o.docs}))}}})}}}),xt=(e,t,r)=>[{name:"Storybook",url:F(e,r)},{name:"Sources",url:jt(t,r)}],zt=e=>{if(!e.values.some(({value:t})=>t===void 0))return e.values.map(({value:t})=>({name:t}))},Nt=(e,t,r)=>({version:1.1,tags:e.components.map(s=>{const n=xt(t,r,s.filePath);return{name:s.tag,description:je(s),attributes:s.props.map(i=>({name:i.attr||i.name,description:se(i),values:zt(i),references:n})),references:n}}),globalAttributes:[],valueSets:[]}),Mt=e=>({version:1.1,properties:e.components.flatMap(t=>t.styles.map(r=>({name:r.name,description:r.docs})))}),Lt=e=>{const t={value:"2023",pattern:"yyyy"},r={value:"12",pattern:"mm"},s={value:"24",pattern:"dd"};return xe([t.value,r.value,s.value].join("-"),e,{timeZone:"UTC"}).replace(t.value,t.pattern).replace(r.value,r.pattern).replace(s.value,s.pattern)},Ft=e=>e.toISOString().split("T")[0],Ct=(e,t,r)=>{const s=e.closest("[lang]"),n=Intl.NumberFormat.supportedLocalesOf(s==null?void 0:s.lang),i=n.length>0&&typeof n[0]=="string"?n[0]:navigator.language||r,o=i.split("-").shift();return Object.keys(t).length===0?{locale:i,messages:{lang:r}}:{locale:i,messages:t[o]||t[r]||{lang:r}}},It=(e,t,r)=>new Intl.NumberFormat(t,{style:"currency",currency:r}).format(e),Dt=(e,t,r=0)=>new Intl.NumberFormat(t,{minimumFractionDigits:r}).format(Number(e)),Ut=(e,t,r=0)=>new Intl.NumberFormat(t,{style:"percent",minimumFractionDigits:r,maximumFractionDigits:r}).format(e),Pt=(e,t,r,s="short",n=0)=>new Intl.NumberFormat(t,{style:"unit",unit:r,unitDisplay:s,minimumFractionDigits:n,maximumFractionDigits:n}).format(e),Re=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,xe=(e,t,r)=>typeof e!="string"||e===""||!Re.test(e)?"":new Intl.DateTimeFormat(t,r).format(new Date(e)),Ht=(e,t)=>r=>Ct(r,e,t),qt=({disconnect:e,observe:t,takeRecords:r})=>{class s{constructor(i){b(this,"disconnect",e);b(this,"observe",t);b(this,"takeRecords",r);b(this,"cb");this.cb=i}}return[window,global].forEach(n=>{Object.defineProperty(n,"MutationObserver",{writable:!0,configurable:!0,value:s})}),s},Zt=({disconnect:e,observe:t})=>{class r{constructor(n){b(this,"disconnect",e);b(this,"observe",t);b(this,"unobserve");b(this,"cb");this.cb=n}}return[window,global].forEach(s=>{Object.defineProperty(s,"ResizeObserver",{writable:!0,configurable:!0,value:r})}),r};class Bt extends Event{constructor(){super(...arguments);b(this,"detail")}}const Gt=()=>{class e extends Bt{}return[window,global].forEach(t=>{Object.defineProperty(t,"SubmitEvent",{writable:!0,configurable:!0,value:e})}),e},Wt=e=>{const t=r=>(setTimeout(r,1),e(),0);return[window,global].forEach(r=>{Object.defineProperty(r,"requestAnimationFrame",{writable:!0,configurable:!0,value:t})}),t};u.ClassList=Me,u.StorybookPreview=Tt,u.allItemsAreString=Le,u.cleanString=Pe,u.createID=d,u.dateRegExp=Re,u.dateToString=Ft,u.defineLocales=Ht,u.filterArgs=Ot,u.focusableElements=Ce,u.getLocaleDatePattern=Lt,u.getParentWindows=W,u.getStoryHTML=At,u.getStorybookUrl=F,u.getWindows=Ie,u.isTagName=Fe,u.isValidNumber=Ue,u.isValidString=le,u.isValideID=_,u.localeCurrency=It,u.localeDate=xe,u.localeNumber=Dt,u.localePercent=Ut,u.localeUnit=Pt,u.nextTick=He,u.setUpRequestAnimationFrameMock=Wt,u.setupMutationObserverMock=qt,u.setupResizeObserverMock=Zt,u.setupSubmitEventMock=Gt,u.stencilWrapper=kt,u.toString=De,u.vsCodeCssGenerator=Mt,u.vsCodeGenerator=Nt,u.webTypesGenerator=Rt,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
|
24
39
|
//# sourceMappingURL=index.umd.js.map
|