@mgdis/stencil-helpers 2.2.6 → 3.1.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/components/index.d.ts +87 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.es.js +790 -478
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +24 -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,27 @@
|
|
|
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(f,$){typeof exports=="object"&&typeof module<"u"?$(exports):typeof define=="function"&&define.amd?define(["exports"],$):(f=typeof globalThis<"u"?globalThis:f||self,$(f.StencilHelpersModule={}))})(this,function(f){"use strict";var dr=Object.defineProperty;var He=f=>{throw TypeError(f)};var $r=(f,$,_)=>$ in f?dr(f,$,{enumerable:!0,configurable:!0,writable:!0,value:_}):f[$]=_;var y=(f,$,_)=>$r(f,typeof $!="symbol"?$+"":$,_),qe=(f,$,_)=>$.has(f)||He("Cannot "+_);var S=(f,$,_)=>(qe(f,$,"read from private field"),_?_.call(f):$.get(f)),M=(f,$,_)=>$.has(f)?He("Cannot add the same private member more than once"):$ instanceof WeakSet?$.add(f):$.set(f,_),te=(f,$,_,Z)=>(qe(f,$,"write to private field"),Z?Z.call(f,_):$.set(f,_),_);var x,L,D,R,Q;const $=(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=>$e(e)&&/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e)!==null;class Z{constructor(t=[]){y(this,"classes");y(this,"add",t=>{this.has(t)||this.classes.push(t)});y(this,"delete",t=>{const r=this.classes.indexOf(t);r>-1&&this.classes.splice(r,1)});y(this,"has",t=>this.classes.includes(t));y(this,"join",()=>this.classes.join(" "));this.classes=t}}const Ge=e=>Array.isArray(e)&&e.every(t=>typeof t=="string"),We=(e,t)=>t.includes(e==null?void 0:e.tagName.toLowerCase()),Be='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button',Je=e=>{const t=re(e),r=de(e);return[e,...t,...r]},re=(e,t=[])=>{if(e.self!==e.top)try{const r=e.parent;return r?(t.push(r),re(r,t)):t}catch(r){return console.error("Different hosts between iframes:",r),t}return t},de=(e,t=[])=>{if(e.frames.length>0)for(const r of Array.from(e.frames))t.push(r),de(r,t);return t},$e=e=>typeof e=="string"&&e.trim()!=="",Xe=e=>typeof e=="object"?JSON.stringify(e):`${e}`,Ke=e=>typeof e=="number"&&!Number.isNaN(e),Ye=e=>typeof e=="string"?e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g,""):e,Qe=async e=>{if(e)return e()},H=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,ye=(e,t,r)=>{const s=".";if(!H(e)||typeof t!="string")return r;const[n,...i]=t.split(s);return i.length?ye(e[n],i.join(s)):e[n]},Ve={FIRST:"first",NEXT:"next",PREVIOUS:"previous",LAST:"last"},he=10;class be{constructor(t){y(this,"items",[]);y(this,"total");y(this,"top",he);y(this,"next");y(this,"baseIndex",1);y(this,"getIndexFromCursor",(t="first",r)=>{if(!Array.isArray(this.items)||!this.items.length)return null;const n=this.items.length-this.baseIndex;let i=0,a=0;if(["previous","next"].includes(t)&&r){const c=this.items.findIndex(l=>JSON.stringify(l)===JSON.stringify(r));if(c===-1)return 0;a=c}return t==="first"?i=0:t==="last"?i=n:t==="previous"?i=JSON.stringify(this.items[a])===JSON.stringify(this.items[0])?n:a-this.baseIndex:t==="next"&&(i=JSON.stringify(this.items[a])===JSON.stringify(this.items[n])?0:a+this.baseIndex),i});if(H(t))Array.isArray(t.items)&&(this.items=t.items),typeof t.top=="number"&&(this.top=t.top),this.total=typeof t.total=="number"?t.total:this.items.length,this.next=t.next;else throw new Error("Page - init must match IPage type.")}}class et{constructor(t,r){y(this,"items",[]);M(this,x,he);M(this,L);M(this,D);y(this,"getPage",(t=0,r)=>{const s=typeof r=="function"?this.items.filter(r):this.items;let n;return S(this,L)?n=S(this,L):s.length>t+S(this,x)&&(n=()=>this.getPage(t+S(this,x),r)),new be({items:s.slice(t,t+S(this,x)),total:S(this,D),top:S(this,x),next:n})});Array.isArray(t)&&(this.items=t),r&&(["string","function"].includes(typeof r.next)||H(r.next)&&URL.canParse(r.next))&&te(this,L,r.next),typeof(r==null?void 0:r.top)=="number"&&te(this,x,r.top),typeof(r==null?void 0:r.total)=="number"&&te(this,D,r.total)}}x=new WeakMap,L=new WeakMap,D=new WeakMap;var q={updatable:!0,slotRelocation:!0,experimentalSlotFixes:!1},tt=Object.defineProperty,rt=(e,t)=>{for(var r in t)tt(e,r,{get:t[r],enumerable:!0})},st="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml",_e=(e,t)=>t in e,ve="http://www.w3.org/1999/xlink",k=typeof window<"u"?window:{},z={$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)},it=e=>e!=null&&e!==void 0,we=e=>(e=typeof e,e==="object"||e==="function"),at={};rt(at,{err:()=>me,map:()=>ot,ok:()=>se,unwrap:()=>lt,unwrapErr:()=>ct});var se=e=>({isOk:!0,isErr:!1,value:e}),me=e=>({isOk:!1,isErr:!0,value:e});function ot(e,t){if(e.isOk){const r=t(e.value);return r instanceof Promise?r.then(s=>se(s)):se(r)}if(e.isErr){const r=e.value;return me(r)}throw"should never get here"}var lt=e=>{if(e.isOk)return e.value;throw e.value},ct=e=>{if(e.isErr)return e.value;throw e.value},Se=e=>{const t=Ae(e,"childNodes");e.tagName&&e.tagName.includes("-")&&e["s-cr"]&&e.tagName!=="SLOT-FB"&&Ee(t,e.tagName).forEach(s=>{s.nodeType===1&&s.tagName==="SLOT-FB"&&(ut(s,ne(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&&Ae(s,"childNodes").length&&Se(s)}},ft=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 Ee(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,...Ee(i.childNodes,t,r)];return n}var ut=(e,t,r=!0)=>{const s=[];(r&&e["s-sr"]||!e["s-sr"])&&s.push(e);let n=e;for(;n=n.nextSibling;)ne(n)===t&&(r||!n["s-sr"])&&s.push(n);return s},Oe=(e,t)=>e.nodeType===1?e.getAttribute("slot")===null&&t===""||e.getAttribute("slot")===t:e["s-sn"]===t?!0:t==="",ne=e=>typeof e["s-sn"]=="string"?e["s-sn"]:e.nodeType===1&&e.getAttribute("slot")||void 0;function gt(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 a=this["s-cr"].parentElement;return(a.__childNodes?a.childNodes:ft(a.childNodes)).forEach(l=>{i===ne(l)&&n.push(l)}),r?n.filter(l=>l.nodeType===1):n}).bind(e);e.assignedElements=t(!0),e.assignedNodes=t(!1)}function Ae(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 pt=(e,t,...r)=>{let s=null,n=null,i=null,a=!1,c=!1;const l=[],u=o=>{for(let d=0;d<o.length;d++)s=o[d],Array.isArray(s)?u(s):s!=null&&typeof s!="boolean"&&((a=!we(s))&&(s=String(s)),a&&c?l[l.length-1].$text$+=s:l.push(a?ie(null,s):s),c=a)};u(r);const p=ie(e,null);return p.$attrs$=t,l.length>0&&(p.$children$=l),p.$key$=n,p.$name$=i,p},ie=(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},dt={},$t=e=>e&&e.$tag$===dt,xe=(e,t,r,s,n,i,a)=>{if(r===s)return;let c=_e(e,t),l=t.toLowerCase();if(t==="class"){const u=e.classList,p=ke(r);let o=ke(s);u.remove(...p.filter(d=>d&&!o.includes(d))),u.add(...o.filter(d=>d&&!p.includes(d)))}else if(t==="style"){for(const u in r)(!s||s[u]==null)&&(u.includes("-")?e.style.removeProperty(u):e.style[u]="");for(const u in s)(!r||s[u]!==r[u])&&(u.includes("-")?e.style.setProperty(u,s[u]):e.style[u]=s[u])}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):_e(k,l)?t=l.slice(2):t=l[2]+t.slice(3),r||s){const u=t.endsWith(Te);t=t.replace(ht,""),r&&z.rel(e,t,r,u),s&&z.ael(e,t,s,u)}}else{const u=we(s);if((c||u&&s!==null)&&!n)try{if(e.tagName.includes("-"))e[t]!==s&&(e[t]=s);else{const o=s??"";t==="list"?c=!1:(r==null||e[t]!=o)&&(typeof e.__lookupSetter__(t)=="function"?e[t]=o:e.setAttribute(t,o))}}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(ve,t):e.removeAttribute(t)):(!c||i&4||n)&&!u&&e.nodeType===1&&(s=s===!0?"":s,p?e.setAttributeNS(ve,t,s):e.setAttribute(t,s))}},yt=/\s/,ke=e=>(typeof e=="object"&&e&&"baseVal"in e&&(e=e.baseVal),!e||typeof e!="string"?[]:e.split(yt)),Te="Capture",ht=new RegExp(Te+"$"),ae=(e,t,r,s)=>{const n=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,i=e&&e.$attrs$||{},a=t.$attrs$||{};for(const c of je(Object.keys(i)))c in a||xe(n,c,i[c],void 0,r,t.$flags$);for(const c of je(Object.keys(a)))xe(n,c,i[c],a[c],r,t.$flags$)};function je(e){return e.includes("ref")?[...e.filter(t=>t!=="ref"),"ref"]:e}var G,W,F,oe=!1,B=!1,le=!1,w=!1,J=(e,t,r)=>{var s;const n=t.$children$[r];let i=0,a,c,l;if(oe||(le=!0,n.$tag$==="slot"&&(n.$flags$|=n.$children$?2:1)),n.$text$!==null)a=n.$elm$=k.document.createTextNode(n.$text$);else if(n.$flags$&1)a=n.$elm$=k.document.createTextNode(""),ae(null,n,w);else{if(w||(w=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(a=n.$elm$=k.document.createElementNS(w?st:nt,!oe&&q.slotRelocation&&n.$flags$&2?"slot-fb":n.$tag$),w&&n.$tag$==="foreignObject"&&(w=!1),ae(null,n,w),it(G)&&a["s-si"]!==G&&a.classList.add(a["s-si"]=G),n.$children$)for(i=0;i<n.$children$.length;++i)c=J(e,n,i),c&&a.appendChild(c);n.$tag$==="svg"?w=!1:a.tagName==="foreignObject"&&(w=!0)}return a["s-hn"]=F,n.$flags$&3&&(a["s-sr"]=!0,a["s-cr"]=W,a["s-sn"]=n.$name$||"",a["s-rf"]=(s=n.$attrs$)==null?void 0:s.ref,gt(a),l=e&&e.$children$&&e.$children$[r],l&&l.$tag$===n.$tag$&&e.$elm$&&C(e.$elm$,!1),Le(W,a,t.$elm$,e==null?void 0:e.$elm$)),a},C=(e,t)=>{z.$flags$|=1;const r=Array.from(e.__childNodes||e.childNodes);e["s-sr"]&&q.experimentalSlotFixes;for(let s=r.length-1;s>=0;s--){const n=r[s];n["s-hn"]!==F&&n["s-ol"]&&(T(P(n).parentNode,n,P(n)),n["s-ol"].remove(),n["s-ol"]=void 0,n["s-sh"]=void 0,le=!0),t&&C(n,t)}z.$flags$&=-2},Re=(e,t,r,s,n,i)=>{let a=e["s-cr"]&&e["s-cr"].parentNode||e,c;for(a.shadowRoot&&a.tagName===F&&(a=a.shadowRoot);n<=i;++n)s[n]&&(c=J(null,r,n),c&&(s[n].$elm$=c,T(a,c,P(t))))},Ne=(e,t,r)=>{for(let s=t;s<=r;++s){const n=e[s];if(n){const i=n.$elm$;Ie(n),i&&(B=!0,i["s-ol"]?i["s-ol"].remove():C(i,!0),i.remove())}}},bt=(e,t,r,s,n=!1)=>{let i=0,a=0,c=0,l=0,u=t.length-1,p=t[0],o=t[u],d=s.length-1,g=s[0],h=s[d],v,m;for(;i<=u&&a<=d;)if(p==null)p=t[++i];else if(o==null)o=t[--u];else if(g==null)g=s[++a];else if(h==null)h=s[--d];else if(X(p,g,n))I(p,g,n),p=t[++i],g=s[++a];else if(X(o,h,n))I(o,h,n),o=t[--u],h=s[--d];else if(X(p,h,n))(p.$tag$==="slot"||h.$tag$==="slot")&&C(p.$elm$.parentNode,!1),I(p,h,n),T(e,p.$elm$,o.$elm$.nextSibling),p=t[++i],h=s[--d];else if(X(o,g,n))(p.$tag$==="slot"||h.$tag$==="slot")&&C(o.$elm$.parentNode,!1),I(o,g,n),T(e,o.$elm$,p.$elm$),o=t[--u],g=s[++a];else{for(c=-1,l=i;l<=u;++l)if(t[l]&&t[l].$key$!==null&&t[l].$key$===g.$key$){c=l;break}c>=0?(m=t[c],m.$tag$!==g.$tag$?v=J(t&&t[a],r,c):(I(m,g,n),t[c]=void 0,v=m.$elm$),g=s[++a]):(v=J(t&&t[a],r,a),g=s[++a]),v&&T(P(p.$elm$).parentNode,v,P(p.$elm$))}i>u?Re(e,s[d+1]==null?null:s[d+1].$elm$,r,s,a,d):a>d&&Ne(t,i,u)},X=(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,P=e=>e&&e["s-ol"]||e,I=(e,t,r=!1)=>{const s=t.$elm$=e.$elm$,n=e.$children$,i=t.$children$,a=t.$tag$,c=t.$text$;let l;c===null?(w=a==="svg"?!0:a==="foreignObject"?!1:w,ae(e,t,w),n!==null&&i!==null?bt(s,n,t,i,r):i!==null?(e.$text$!==null&&(s.textContent=""),Re(s,null,t,i,0,i.length-1)):!r&&q.updatable&&n!==null&&Ne(n,0,n.length-1),w&&a==="svg"&&(w=!1)):(l=s["s-cr"])?l.parentNode.textContent=c:e.$text$!==c&&(s.data=c)},O=[],ze=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 a=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(Oe(t,a)){let c=O.find(l=>l.$nodeToRelocate$===t);B=!0,t["s-sn"]=t["s-sn"]||a,c?(c.$nodeToRelocate$["s-sh"]=i["s-hn"],c.$slotRefNode$=i):(t["s-sh"]=i["s-hn"],O.push({$slotRefNode$:i,$nodeToRelocate$:t})),t["s-sr"]&&O.map(l=>{Oe(l.$nodeToRelocate$,t["s-sn"])&&(c=O.find(u=>u.$nodeToRelocate$===t),c&&!l.$slotRefNode$&&(l.$slotRefNode$=c.$slotRefNode$))})}else O.some(c=>c.$nodeToRelocate$===t)||O.push({$nodeToRelocate$:t})}i.nodeType===1&&ze(i)}},Ie=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(Ie)},T=(e,t,r)=>(typeof t["s-sn"]=="string"&&t["s-sr"]&&t["s-cr"]&&Le(t["s-cr"],t,e,t.parentElement),e==null?void 0:e.insertBefore(t,r));function Le(e,t,r,s){var n,i;let a;if(e&&typeof t["s-sn"]=="string"&&t["s-sr"]&&e.parentNode&&e.parentNode["s-sc"]&&(a=t["s-si"]||e.parentNode["s-sc"])){const c=t["s-sn"],l=t["s-hn"];if((n=r.classList)==null||n.add(a+"-s"),s&&((i=s.classList)!=null&&i.contains(a+"-s"))){let u=(s.__childNodes||s.childNodes)[0],p=!1;for(;u;){if(u["s-sn"]!==c&&u["s-hn"]===l&&u["s-sr"]){p=!0;break}u=u.nextSibling}p||s.classList.remove(a+"-s")}}}var _t=(e,t,r=!1)=>{var s,n,i,a,c;const l=e.$hostElement$,u=e.$cmpMeta$,p=e.$vnode$||ie(null,null),o=$t(t)?t:pt(null,null,t);if(F=l.tagName,u.$attrsToReflect$&&(o.$attrs$=o.$attrs$||{},u.$attrsToReflect$.map(([d,g])=>o.$attrs$[g]=l[d])),r&&o.$attrs$)for(const d of Object.keys(o.$attrs$))l.hasAttribute(d)&&!["key","ref","style","class"].includes(d)&&(o.$attrs$[d]=l[d]);o.$tag$=null,o.$flags$|=4,e.$vnode$=o,o.$elm$=p.$elm$=l.shadowRoot||l,G=l["s-sc"],oe=!!(u.$flags$&1)&&!(u.$flags$&128),W=l["s-cr"],B=!1,I(p,o,r);{if(z.$flags$|=1,le){ze(o.$elm$);for(const d of O){const g=d.$nodeToRelocate$;if(!g["s-ol"]&&k.document){const h=k.document.createTextNode("");h["s-nr"]=g,T(g.parentNode,g["s-ol"]=h,g)}}for(const d of O){const g=d.$nodeToRelocate$,h=d.$slotRefNode$;if(h){const v=h.parentNode;let m=h.nextSibling;{let N=(s=g["s-ol"])==null?void 0:s.previousSibling;for(;N;){let b=(n=N["s-nr"])!=null?n:null;if(b&&b["s-sn"]===g["s-sn"]&&v===(b.__parentNode||b.parentNode)){for(b=b.nextSibling;b===g||b!=null&&b["s-sr"];)b=b==null?void 0:b.nextSibling;if(!b||!b["s-nr"]){m=b;break}}N=N.previousSibling}}const V=g.__parentNode||g.parentNode,ee=g.__nextSibling||g.nextSibling;(!m&&v!==V||ee!==m)&&g!==m&&(!g["s-hn"]&&g["s-ol"]&&(g["s-hn"]=g["s-ol"].parentNode.nodeName),T(v,g,m),g.nodeType===1&&g.tagName!=="SLOT-FB"&&(g.hidden=(i=g["s-ih"])!=null?i:!1)),g&&typeof h["s-rf"]=="function"&&h["s-rf"](h)}else g.nodeType===1&&(r&&(g["s-ih"]=(a=g.hidden)!=null?a:!1),g.hidden=!0)}}B&&Se(o.$elm$),z.$flags$&=-2,O.length=0}if(q.experimentalScopedSlotChanges&&u.$flags$&2){const d=o.$elm$.__childNodes||o.$elm$.childNodes;for(const g of d)g["s-hn"]!==F&&!g["s-sh"]&&(r&&g["s-ih"]==null&&(g["s-ih"]=(c=g.hidden)!=null?c:!1),g.hidden=!0)}W=void 0};const K={content_wrap:0,ignore:[],ignore_with:"_!i-£___£%_",strict:!1,tab_size:2,tag_wrap:0,tag_wrap_width:80,trim:[]},A="__!i-£___£%__",E="!i-£___£%_",Me=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],ce=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),Fe=(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]=Fe(r[s]||{},t[s])}return r},vt=(e,t)=>Fe(structuredClone(e),t),wt=e=>(e=e.replace(/<[\w:\-]+([^>]*[^\/])>/g,(t,r)=>t.replace(r,s=>s.replace(/\n/g,E+"nl!").replace(/\r/g,E+"cr!").replace(/\s/g,E+"ws!"))),e),mt=e=>e.replace(/\n/g,A+"nl!").replace(/\r/g,A+"cr!").replace(/\s/g,A+"ws!"),St=e=>{const t=/\s*<([a-zA-Z0-9:-]+)[^>]*>\n\s*<\/\1>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n)|<([a-zA-Z0-9:-]+)[^>]*>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n\s*)<\/\3>/g;return e.replace(t,(r,s,n,i,a)=>{const c=n||a;if(!c)return r;const l=c.replace(/\n/g,A+"nl!").replace(/\r/g,A+"cr!").replace(/\s/g,A+"ws!");return r.replace(c,l)})},Et=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,E+"lt!").replace(/>/g,E+"gt!"))),e},Ot=(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,(a,c)=>a.replace(c,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},At=(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},xt=e=>(e=e.replace(/<[\w:\-]+([^>]*[^\/])>/g,(t,r)=>t.replace(r,s=>s.replace(new RegExp(E+"nl!","g"),`
|
|
7
|
+
`).replace(new RegExp(E+"cr!","g"),"\r").replace(new RegExp(E+"ws!","g")," "))),e),kt=e=>(e=e.replace(/.*__!i-£___£%__[a-z]{2}!.*/g,t=>t.replace(/__!i-£___£%__[a-z]{2}!/g,r=>r.replace(new RegExp(A+"nl!","g"),`
|
|
8
|
+
`).replace(new RegExp(A+"cr!","g"),"\r").replace(new RegExp(A+"ws!","g")," "))),e),Tt=e=>(e=e.replace(/<[\w:\-]+([^>]*)>/g,(t,r)=>t.replace(r,s=>s.replace(new RegExp(E+"lt!","g"),"<").replace(new RegExp(E+"gt!","g"),">"))),e),jt=(e,t)=>{const r=t.ignore,s=t.ignore_with;for(let n=0;n<r.length;n++){const i=new RegExp(`<${r[n]}[^>]*>((.|
|
|
9
|
+
)*?)</${r[n]}>`,"g");e=e.replace(i,(a,c)=>a.replace(c,l=>l.replace(new RegExp("-"+s+"lt-","g"),"<").replace(new RegExp("-"+s+"gt-","g"),">").replace(new RegExp("-"+s+"nl-","g"),`
|
|
10
|
+
`).replace(new RegExp("-"+s+"cr-","g"),"\r").replace(new RegExp("-"+s+"ws-","g")," ")))}return e},Rt=e=>{var s,n;if(typeof e!="object")throw new Error("Config must be an object.");if(!(Object.hasOwn(e,"content_wrap")||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 K;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,"content_wrap")&&typeof e.content_wrap!="number")throw new Error(`content_wrap config must be a number, not ${typeof e.tag_wrap_width}.`);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"&&(console.warn("tag_wrap as a boolean is deprecated, and will not be supported in v0.9.0+. Use `tag_wrap: <number>` instead; where <number> is the max character width acceptable before wrapping attributes."),e.tag_wrap_width?e.tag_wrap=e.tag_wrap_width:e.tag_wrap=K.tag_wrap_width),Object.hasOwn(e,"tag_wrap")&&typeof e.tag_wrap!="number")throw new Error(`tag_wrap config must be a number, not ${typeof e.tag_wrap}.`);if(Object.hasOwn(e,"tag_wrap_width")&&console.warn("tag_wrap_width is deprecated, and will not be supported in v0.9.0+. Use `tag_wrap: <number>` instead; where <number> is the max character width acceptable before wrapping attributes."),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 vt(K,e)},Nt=(e,t,r)=>{const s=e.split(/\s+/);if(s.length===0)return"";const n=[];let i="",a=!0;s.forEach(l=>{if(l!=="")if(i==="")i=l;else if(l.length>=t)a?(n.push(i.padStart(i.length)),n.push(l.padStart(l.length)),a=!1):(n.push(i.padStart(i.length+r)),n.push(l.padStart(l.length+r)));else{const u=i+" "+l;u.length<=t?i=u:(a?(n.push(i.padStart(i.length)),a=!1):n.push(i.padStart(i.length+r)),i=l)}}),i!==""&&n.push(i.padStart(i.length+r));const c=n.join(`
|
|
11
|
+
`);return mt(c)},zt=(e,t=!0)=>t&&!ce(e)?e:e.replace(/<([a-zA-Z\-0-9:]+)[^>]*>/g,(r,s)=>Me.indexOf(s)>-1?`${r.substring(0,r.length-1)} />`.replace(/\/\s\//g,"/"):r.replace(/[\s]?\/>/g,`></${s}>`)),It=(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),Lt=(e,t=!0)=>t&&!ce(e)?e:(e=It(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(/>\s/g,">").replace(/\s</g,"<").replace(/class=["']\s/g,r=>r.replace(/\s/g,"")).replace(/(class=.*)\s(["'])/g,"$1$2"));let Y,fe;const j={line:[]},Mt=e=>{j.line=[];let t=-1;const r=/(<[^>]+>)|([^<]+)/g;return e=e.replace(r,(s,n,i)=>(n?j.line.push({type:"tag",value:s}):i&&i.trim().length>0&&j.line.push({type:"text",value:s}),t++,`
|
|
12
|
+
[#-# : ${t} : ${s} : #-#]
|
|
13
|
+
`)),e},Ft=e=>(e=zt(e,!1),fe.length>0&&(e=At(e,fe)),e=Lt(e,!1),e=Mt(e),e),Ct=(e,t)=>{const r=t.tab_size,s=t.tag_wrap,n=t.content_wrap;let i="";j.line.forEach((l,u)=>{e=e.replace(/\n+/g,`
|
|
14
|
+
`).replace(`[#-# : ${u} : ${l.value} : #-#]`,p=>{var m,V,ee;let o=0;const d=`[#-# : ${u-1} : ${(m=j.line[u-1])==null?void 0:m.value} : #-#]`,g=/<[A-Za-z]+\b[^>]*(?:.|\n)*?\/?>/g;i+="0",u===0&&o++,p.indexOf(`#-# : ${u} : </`)>-1&&o++,d.indexOf("<!doctype")>-1&&o++,d.indexOf("<!--")>-1&&o++,d.indexOf("/> : #-#")>-1&&o++,d.indexOf(`#-# : ${u-1} : </`)>-1&&o++,((V=j.line[u-1])==null?void 0:V.type)==="text"&&o++;const h=i.length-o;if(i=i.substring(0,h),Y&&p.indexOf("<!--")>-1)return"";let v=p.replace(`[#-# : ${u} : `,"").replace(" : #-#]","");if(((ee=j.line[u])==null?void 0:ee.type)==="text"&&n>0&&v.length>=n&&(v=Nt(v,n,r*h)),s>0&&l.value.length>s&&g.test(l.value)){const N=/\s{1}[A-Za-z-]+(?:=".*?")?/g,b=l.value.split(N).filter(Boolean),fr=l.value.matchAll(N),ge=r*h,ur=ge+r;let pe=b[0].padStart(b[0].length+ge)+`
|
|
15
|
+
`;for(const Ze of fr){const pr=Ze[0].trim().padStart(Ze[0].trim().length+ur)+`
|
|
16
|
+
`;pe+=pr}const gr=b[1].padStart(b[1].trim().length+ge+(Y&&Me.includes(b[0].slice(1))?1:0));return pe+=gr,pe}else return v.padStart(v.length+r*h)})}),s>0&&(e=wt(e)),n>0&&/\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n/.test(e)&&(e=St(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,"")),n>0&&(e=kt(e)),s>0&&(e=xt(e)),Y&&(e=e.replace(/\s\/>|\/>/g,">"));const a=e.substring(0,1),c=e.substring(e.length-1);return a===`
|
|
17
|
+
`&&(e=e.substring(1,e.length)),c===`
|
|
18
|
+
`&&(e=e.substring(0,e.length-1)),e},Pt=(e,t)=>{if(!ce(e))return e;const r=t?Rt(t):K;Y=r.strict;const s=r.ignore.length>0;return fe=r.trim,s&&(e=Ot(e,r)),e=Et(e),e=Ft(e),e=Ct(e,r),e=Tt(e),s&&(e=jt(e,r)),e},Ut=(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)},Ce=(e,t,r,s,n)=>{if(t&&typeof t=="string"){const i=document.createElement(t);Object.keys(r||{}).forEach(a=>{Ut(i,a,r[a])}),s==null||s.forEach(a=>{Ce(i,a.$tag$,a.$attrs$,a.$children$,a.$text$)}),r!=null&&r.innerHTML&&(i.innerHTML=r.innerHTML),e.appendChild(i)}n&&(e.innerHTML=n)},Dt=(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],a=n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();(!t||!Object.keys(t).includes(n)||t[n]!==i)&&(s[a]=i)}return s},Zt=(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"),_t({$cmpMeta$:{$flags$:0,$tagName$:r.tagName},$hostElement$:r},e(t)),r.children[r.children.length-1]},Ht=({$tag$:e,$attrs$:t,$children$:r,$text$:s})=>{const n=document.createElement("div");return Ce(n,e,t,r,s),Pt(n.innerHTML,{tag_wrap:40,content_wrap:120}).replace(/="true"/g,"")},U=(e,t)=>{if(!t)return;const r=t.split("/");return`${e}${r.slice(2,r.length-1).join("-")}--docs`};class qt{constructor(t){y(this,"jsonDoc");M(this,R,t=>this.jsonDoc.components.find(r=>r.tag===t));M(this,Q,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"}}});y(this,"extractArgTypes",t=>{const r=S(this,R).call(this,t),s=r==null?void 0:r.props.reduce((p,o)=>{const{control:d,options:g}=S(this,Q).call(this,o);return{...p,[o.name]:{name:o.attr||o.name,description:o.docs,type:{required:o.required},table:{category:"props",type:{summary:o.type},defaultValue:{summary:o.default}},control:d,options:g}}},{}),n=r==null?void 0:r.events.reduce((p,o)=>({...p,[o.event]:{name:o.event,description:o.docs,table:{category:"events",type:{summary:o.detail}}}}),{}),i=r==null?void 0:r.methods.reduce((p,o)=>({...p,[o.name]:{name:o.name,description:o.docs,table:{category:"methods",type:{summary:o.signature}}}}),{}),a=r==null?void 0:r.slots.reduce((p,o)=>({...p,[o.name]:{name:o.name!==""?o.name:"default",description:o.docs,table:{category:"slots",type:{summary:void 0}}}}),{}),c=r==null?void 0:r.styles.reduce((p,o)=>({...p,[o.name]:{name:o.name,description:o.docs,table:{category:"custom properties",type:{summary:void 0}}}}),{}),l=r==null?void 0:r.dependencies.reduce((p,o)=>{const d=S(this,R).call(this,o);return d?{...p,[o]:{name:o,description:`<a href="./?path=/docs/${U("",d==null?void 0:d.filePath)}">View Component Documentation</a>`,table:{category:"depends on",type:{summary:void 0}}}}:p},{}),u=r==null?void 0:r.dependents.reduce((p,o)=>{const d=S(this,R).call(this,o);return d?{...p,[o]:{name:o,description:`<a href="./?path=/docs/${U("",d==null?void 0:d.filePath)}">View Component Documentation</a>`,table:{category:"used by",type:{summary:void 0}}}}:p},{});return{...s,...n,...i,...a,...c,...l,...u}});y(this,"extractComponentDescription",t=>{const r=S(this,R).call(this,t);return(r==null?void 0:r.readme)||(r==null?void 0:r.docs)});this.jsonDoc=t}}R=new WeakMap,Q=new WeakMap;const Gt=(e,t)=>{if(t)return`${e}${t}`},Pe=e=>{let t=e.overview?`${e.overview}
|
|
2
19
|
|
|
3
|
-
`:"";const
|
|
4
|
-
`,t+=
|
|
20
|
+
`:"";const r=e.props.filter(({attr:n})=>n!==void 0);r.length&&(t+=`Attributes:
|
|
21
|
+
`,t+=r.map(({attr:n,docs:i})=>`- \`${n}\`: ${i}
|
|
5
22
|
`).join(""),t+=`
|
|
6
|
-
`);const
|
|
7
|
-
`,t+=
|
|
23
|
+
`);const s=e.props.filter(({attr:n})=>n===void 0);return s.length&&(t+=`Properties:
|
|
24
|
+
`,t+=s.map(({name:n,docs:i})=>`- \`${n}\`: ${i}
|
|
8
25
|
`).join(""),t+=`
|
|
9
26
|
`),e.methods.length&&(t+=`Methods:
|
|
10
27
|
`,t+=e.methods.map(({name:n,docs:i})=>`- \`${n}\`: ${i}
|
|
@@ -18,7 +35,7 @@
|
|
|
18
35
|
`),e.slots.length&&(t+=`Slots:
|
|
19
36
|
`,t+=e.slots.map(({name:n,docs:i})=>`- \`${n}\`: ${i}
|
|
20
37
|
`).join(""),t+=`
|
|
21
|
-
`),t},
|
|
38
|
+
`),t},ue=e=>`${e.docs}
|
|
22
39
|
|
|
23
|
-
Type: \`${e.type}\``,
|
|
40
|
+
Type: \`${e.type}\``,Wt=(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=U(s,n.filePath);return{name:n.tag,description:Pe(n),"doc-url":i,attributes:n.props.filter(a=>a.attr).map(a=>({name:a.attr,description:ue(a),"doc-url":i,value:{type:a.type,default:a.default,required:a.required}})),js:{properties:n.props.map(a=>({name:a.name,description:ue(a),"doc-url":i,value:{type:a.type,default:a.default,required:a.required}})),events:n.events.map(a=>({name:a.event,description:a.docs}))},css:{properties:n.styles.map(a=>({name:a.name,description:a.docs}))}}})}}}),Bt=(e,t,r)=>[{name:"Storybook",url:U(e,r)},{name:"Sources",url:Gt(t,r)}],Jt=e=>{if(!e.values.some(({value:t})=>t===void 0))return e.values.map(({value:t})=>({name:t}))},Xt=(e,t,r)=>({version:1.1,tags:e.components.map(s=>{const n=Bt(t,r,s.filePath);return{name:s.tag,description:Pe(s),attributes:s.props.map(i=>({name:i.attr||i.name,description:ue(i),values:Jt(i),references:n})),references:n}}),globalAttributes:[],valueSets:[]}),Kt=e=>({version:1.1,properties:e.components.flatMap(t=>t.styles.map(r=>({name:r.name,description:r.docs})))}),Yt=e=>{const t={value:"2023",pattern:"yyyy"},r={value:"12",pattern:"mm"},s={value:"24",pattern:"dd"};return De([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)},Qt=e=>e.toISOString().split("T")[0],Vt=(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,a=i.split("-").shift();return Object.keys(t).length===0?{locale:i,messages:{lang:r}}:{locale:i,messages:t[a]||t[r]||{lang:r}}},er=(e,t,r)=>new Intl.NumberFormat(t,{style:"currency",currency:r}).format(e),tr=(e,t,r=0)=>new Intl.NumberFormat(t,{minimumFractionDigits:r}).format(Number(e)),rr=(e,t,r=0)=>new Intl.NumberFormat(t,{style:"percent",minimumFractionDigits:r,maximumFractionDigits:r}).format(e),sr=(e,t,r,s="short",n=0)=>new Intl.NumberFormat(t,{style:"unit",unit:r,unitDisplay:s,minimumFractionDigits:n,maximumFractionDigits:n}).format(e),Ue=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,De=(e,t,r)=>typeof e!="string"||e===""||!Ue.test(e)?"":new Intl.DateTimeFormat(t,r).format(new Date(e)),nr=(e,t)=>r=>Vt(r,e,t),ir=({disconnect:e,observe:t,takeRecords:r})=>{class s{constructor(i){y(this,"disconnect",e);y(this,"observe",t);y(this,"takeRecords",r);y(this,"cb");this.cb=i}}return[window,global].forEach(n=>{Object.defineProperty(n,"MutationObserver",{writable:!0,configurable:!0,value:s})}),s},ar=({disconnect:e,observe:t})=>{class r{constructor(n){y(this,"disconnect",e);y(this,"observe",t);y(this,"unobserve");y(this,"cb");this.cb=n}}return[window,global].forEach(s=>{Object.defineProperty(s,"ResizeObserver",{writable:!0,configurable:!0,value:r})}),r};class or extends Event{constructor(){super(...arguments);y(this,"detail")}}const lr=()=>{class e extends or{}return[window,global].forEach(t=>{Object.defineProperty(t,"SubmitEvent",{writable:!0,configurable:!0,value:e})}),e},cr=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};f.ClassList=Z,f.Cursor=Ve,f.Page=be,f.Paginate=et,f.StorybookPreview=qt,f.allItemsAreString=Ge,f.cleanString=Ye,f.createID=$,f.dateRegExp=Ue,f.dateToString=Qt,f.defineLocales=nr,f.filterArgs=Dt,f.focusableElements=Be,f.getLocaleDatePattern=Yt,f.getObjectValueFromKey=ye,f.getParentWindows=re,f.getStoryHTML=Ht,f.getStorybookUrl=U,f.getWindows=Je,f.isObject=H,f.isTagName=We,f.isValidNumber=Ke,f.isValidString=$e,f.isValideID=_,f.localeCurrency=er,f.localeDate=De,f.localeNumber=tr,f.localePercent=rr,f.localeUnit=sr,f.nextTick=Qe,f.setUpRequestAnimationFrameMock=cr,f.setupMutationObserverMock=ir,f.setupResizeObserverMock=ar,f.setupSubmitEventMock=lr,f.stencilWrapper=Zt,f.toString=Xe,f.vsCodeCssGenerator=Kt,f.vsCodeGenerator=Xt,f.webTypesGenerator=Wt,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
24
41
|
//# sourceMappingURL=index.umd.js.map
|