UNPKG

@claromentis/design-system

Version:

Claromentis Design System Component Library

2 lines 12.9 kB
const t="claromentis";let e,n,l,s=!1,o=!1,c=!1,i=!1,r=!1;const a=t=>{const e=new URL(t,$t.t);return e.origin!==pt.location.origin?e.href:e.pathname},f="http://www.w3.org/1999/xlink",u={},d=t=>"object"==(t=typeof t)||"function"===t;function p(t){var e,n,l;return null!==(l=null===(n=null===(e=t.head)||void 0===e?void 0:e.querySelector('meta[name="csp-nonce"]'))||void 0===n?void 0:n.getAttribute("content"))&&void 0!==l?l:void 0}const h=(t,e,...n)=>{let l=null,s=null,o=!1,c=!1;const i=[],r=e=>{for(let n=0;n<e.length;n++)l=e[n],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof t&&!d(l))&&(l+=""),o&&c?i[i.length-1].l+=l:i.push(o?m(null,l):l),c=o)};if(r(n),e){e.name&&(s=e.name);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const a=m(t,null);return a.o=e,i.length>0&&(a.i=i),a.u=s,a},m=(t,e)=>({p:0,h:t,l:e,m:null,i:null,o:null,u:null}),$={},w=t=>ot(t).$,b=(t,e,n)=>{const l=w(t);return{emit:t=>y(l,e,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:t})}},y=(t,e,n)=>{const l=$t.ce(e,n);return t.dispatchEvent(l),l},v=new WeakMap,g=t=>"sc-"+t.v,j=(t,e,n,l,s,o)=>{if(n!==l){let i=rt(t,e),r=e.toLowerCase();if("class"===e){const e=t.classList,s=S(n),o=S(l);e.remove(...s.filter((t=>t&&!o.includes(t)))),e.add(...o.filter((t=>t&&!s.includes(t))))}else if("style"===e){for(const e in n)l&&null!=l[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in l)n&&l[e]===n[e]||(e.includes("-")?t.style.setProperty(e,l[e]):t.style[e]=l[e])}else if("ref"===e)l&&l(t);else if(i||"o"!==e[0]||"n"!==e[1]){const a=d(l);if((i||a&&null!==l)&&!s)try{if(t.tagName.includes("-"))t[e]=l;else{const s=null==l?"":l;"list"===e?i=!1:null!=n&&t[e]==s||(t[e]=s)}}catch(c){}let u=!1;r!==(r=r.replace(/^xlink\:?/,""))&&(e=r,u=!0),null==l||!1===l?!1===l&&""!==t.getAttribute(e)||(u?t.removeAttributeNS(f,e):t.removeAttribute(e)):(!i||4&o||s)&&!a&&(l=!0===l?"":l,u?t.setAttributeNS(f,e,l):t.setAttribute(e,l))}else e="-"===e[2]?e.slice(3):rt(pt,r)?r.slice(2):r[2]+e.slice(3),n&&$t.rel(t,e,n,!1),l&&$t.ael(t,e,l,!1)}},k=/\s/,S=t=>t?t.split(k):[],O=(t,e,n,l)=>{const s=11===e.m.nodeType&&e.m.host?e.m.host:e.m,o=t&&t.o||u,c=e.o||u;for(l in o)l in c||j(s,l,o[l],void 0,n,e.p);for(l in c)j(s,l,o[l],c[l],n,e.p)},_=(t,o,r,a)=>{const f=o.i[r];let u,d,p,h=0;if(s||(c=!0,"slot"===f.h&&(e&&a.classList.add(e+"-s"),f.p|=f.i?2:1)),null!==f.l)u=f.m=ht.createTextNode(f.l);else if(1&f.p)u=f.m=ht.createTextNode("");else{if(i||(i="svg"===f.h),u=f.m=ht.createElementNS(i?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&f.p?"slot-fb":f.h),i&&"foreignObject"===f.h&&(i=!1),O(null,f,i),null!=e&&u["s-si"]!==e&&u.classList.add(u["s-si"]=e),f.i)for(h=0;h<f.i.length;++h)d=_(t,f,h,u),d&&u.appendChild(d);"svg"===f.h?i=!1:"foreignObject"===u.tagName&&(i=!0)}return u["s-hn"]=l,3&f.p&&(u["s-sr"]=!0,u["s-cr"]=n,u["s-sn"]=f.u||"",p=t&&t.i&&t.i[r],p&&p.h===f.h&&t.m&&C(t.m,!1)),u},C=(t,e)=>{$t.p|=1;const n=t.childNodes;for(let s=n.length-1;s>=0;s--){const t=n[s];t["s-hn"]!==l&&t["s-ol"]&&(N(t).insertBefore(t,L(t)),t["s-ol"].remove(),t["s-ol"]=void 0,c=!0),e&&C(t,e)}$t.p&=-2},M=(t,e,n,s,o,c)=>{let i,r=t["s-cr"]&&t["s-cr"].parentNode||t;for(r.shadowRoot&&r.tagName===l&&(r=r.shadowRoot);o<=c;++o)s[o]&&(i=_(null,n,o,t),i&&(s[o].m=i,r.insertBefore(i,L(e))))},R=(t,e,n,l,s)=>{for(;e<=n;++e)(l=t[e])&&(s=l.m,A(l),o=!0,s["s-ol"]?s["s-ol"].remove():C(s,!0),s.remove())},x=(t,e)=>t.h===e.h&&("slot"!==t.h||t.u===e.u),L=t=>t&&t["s-ol"]||t,N=t=>(t["s-ol"]?t["s-ol"]:t).parentNode,T=(t,e)=>{const n=e.m=t.m,l=t.i,s=e.i,o=e.h,c=e.l;let r;null===c?(i="svg"===o||"foreignObject"!==o&&i,"slot"===o||O(t,e,i),null!==l&&null!==s?((t,e,n,l)=>{let s,o=0,c=0,i=e.length-1,r=e[0],a=e[i],f=l.length-1,u=l[0],d=l[f];for(;o<=i&&c<=f;)null==r?r=e[++o]:null==a?a=e[--i]:null==u?u=l[++c]:null==d?d=l[--f]:x(r,u)?(T(r,u),r=e[++o],u=l[++c]):x(a,d)?(T(a,d),a=e[--i],d=l[--f]):x(r,d)?("slot"!==r.h&&"slot"!==d.h||C(r.m.parentNode,!1),T(r,d),t.insertBefore(r.m,a.m.nextSibling),r=e[++o],d=l[--f]):x(a,u)?("slot"!==r.h&&"slot"!==d.h||C(a.m.parentNode,!1),T(a,u),t.insertBefore(a.m,r.m),a=e[--i],u=l[++c]):(s=_(e&&e[c],n,c,t),u=l[++c],s&&N(r.m).insertBefore(s,L(r.m)));o>i?M(t,null==l[f+1]?null:l[f+1].m,n,l,c,f):c>f&&R(e,o,i)})(n,l,e,s):null!==s?(null!==t.l&&(n.textContent=""),M(n,null,e,s,0,s.length-1)):null!==l&&R(l,0,l.length-1),i&&"svg"===o&&(i=!1)):(r=n["s-cr"])?r.parentNode.textContent=c:t.l!==c&&(n.data=c)},U=t=>{const e=t.childNodes;let n,l,s,o,c,i;for(l=0,s=e.length;l<s;l++)if(n=e[l],1===n.nodeType){if(n["s-sr"])for(c=n["s-sn"],n.hidden=!1,o=0;o<s;o++)if(i=e[o].nodeType,e[o]["s-hn"]!==n["s-hn"]||""!==c){if(1===i&&c===e[o].getAttribute("slot")){n.hidden=!0;break}}else if(1===i||3===i&&""!==e[o].textContent.trim()){n.hidden=!0;break}U(n)}},P=[],W=t=>{let e,n,l,s,c,i,r=0;const a=t.childNodes,f=a.length;for(;r<f;r++){if(e=a[r],e["s-sr"]&&(n=e["s-cr"])&&n.parentNode)for(l=n.parentNode.childNodes,s=e["s-sn"],i=l.length-1;i>=0;i--)n=l[i],n["s-cn"]||n["s-nr"]||n["s-hn"]===e["s-hn"]||(E(n,s)?(c=P.find((t=>t.g===n)),o=!0,n["s-sn"]=n["s-sn"]||s,c?c.j=e:P.push({j:e,g:n}),n["s-sr"]&&P.map((t=>{E(t.g,n["s-sn"])&&(c=P.find((t=>t.g===n)),c&&!t.j&&(t.j=c.j))}))):P.some((t=>t.g===n))||P.push({g:n}));1===e.nodeType&&W(e)}},E=(t,e)=>1===t.nodeType?null===t.getAttribute("slot")&&""===e||t.getAttribute("slot")===e:t["s-sn"]===e||""===e,A=t=>{t.o&&t.o.ref&&t.o.ref(null),t.i&&t.i.map(A)},D=(t,e)=>{e&&!t.k&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.k=e)))},F=(t,e)=>{if(t.p|=16,!(4&t.p))return D(t,t.S),_t((()=>q(t,e)));t.p|=512},q=(t,e)=>{const n=t.O;let l;return e?(t.p|=256,t._&&(t._.map((([t,e])=>G(n,t,e))),t._=null),l=G(n,"componentWillLoad")):l=G(n,"componentWillUpdate"),I(l,(()=>H(t,n,e)))},H=async(t,e,n)=>{const l=t.$,s=l["s-rc"];n&&(t=>{const e=t.C,n=t.$,l=e.p,s=((t,e)=>{var n;let l=g(e);const s=dt.get(l);if(t=11===t.nodeType?t:ht,s)if("string"==typeof s){let e,o=v.get(t=t.head||t);if(o||v.set(t,o=new Set),!o.has(l)){{e=ht.createElement("style"),e.innerHTML=s;const l=null!==(n=$t.M)&&void 0!==n?n:p(ht);null!=l&&e.setAttribute("nonce",l),t.insertBefore(e,t.querySelector("link"))}o&&o.add(l)}}else t.adoptedStyleSheets.includes(s)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,s]);return l})(wt&&n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(t);V(t,e),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=l["s-p"],n=()=>z(t);0===e.length?n():(Promise.all(e).then(n),t.p|=4,e.length=0)}},V=(t,i)=>{try{i=i.render(),t.p&=-17,t.p|=2,((t,i)=>{const r=t.$,a=t.C,f=t.R||m(null,null),u=(t=>t&&t.h===$)(i)?i:h(null,null,i);if(l=r.tagName,a.L&&(u.o=u.o||{},a.L.map((([t,e])=>u.o[e]=r[t]))),u.h=null,u.p|=4,t.R=u,u.m=f.m=r.shadowRoot||r,e=r["s-sc"],n=r["s-cr"],s=wt&&0!=(1&a.p),o=!1,T(f,u),$t.p|=1,c){let t,e,n,l,s,o;W(u.m);let c=0;for(;c<P.length;c++)t=P[c],e=t.g,e["s-ol"]||(n=ht.createTextNode(""),n["s-nr"]=e,e.parentNode.insertBefore(e["s-ol"]=n,e));for(c=0;c<P.length;c++)if(t=P[c],e=t.g,t.j){for(l=t.j.parentNode,s=t.j.nextSibling,n=e["s-ol"];n=n.previousSibling;)if(o=n["s-nr"],o&&o["s-sn"]===e["s-sn"]&&l===o.parentNode&&(o=o.nextSibling,!o||!o["s-nr"])){s=o;break}(!s&&l!==e.parentNode||e.nextSibling!==s)&&e!==s&&(!e["s-hn"]&&e["s-ol"]&&(e["s-hn"]=e["s-ol"].parentNode.nodeName),l.insertBefore(e,s))}else 1===e.nodeType&&(e.hidden=!0)}o&&U(u.m),$t.p&=-2,P.length=0})(t,i)}catch(r){at(r,t.$)}return null},z=t=>{const e=t.$,n=t.O,l=t.S;64&t.p?G(n,"componentDidUpdate"):(t.p|=64,J(e),G(n,"componentDidLoad"),t.N(e),l||B()),t.k&&(t.k(),t.k=void 0),512&t.p&&Ot((()=>F(t,!1))),t.p&=-517},B=()=>{J(ht.documentElement),Ot((()=>y(pt,"appload",{detail:{namespace:t}})))},G=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(l){at(l)}},I=(t,e)=>t&&t.then?t.then(e):e(),J=t=>t.classList.add("hydrated"),K=(t,e,n)=>{if(e.T){t.watchers&&(e.U=t.watchers);const l=Object.entries(e.T),s=t.prototype;if(l.map((([t,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,t,{get(){return((t,e)=>ot(this).P.get(e))(0,t)},set(n){((t,e,n,l)=>{const s=ot(t),o=s.$,c=s.P.get(e),i=s.p,r=s.O;if(n=((t,e)=>null==t||d(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?parseFloat(t):1&e?t+"":t)(n,l.T[e][0]),(!(8&i)||void 0===c)&&n!==c&&(!Number.isNaN(c)||!Number.isNaN(n))&&(s.P.set(e,n),r)){if(l.U&&128&i){const t=l.U[e];t&&t.map((t=>{try{r[t](n,c,e)}catch(l){at(l,o)}}))}2==(18&i)&&F(s,!1)}})(this,t,n,e)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(t,e,l){$t.jmp((()=>{const e=n.get(t);if(this.hasOwnProperty(e))l=this[e],delete this[e];else if(s.hasOwnProperty(e)&&"number"==typeof this[e]&&this[e]==l)return;this[e]=(null!==l||"boolean"!=typeof this[e])&&l}))},t.observedAttributes=l.filter((([t,e])=>15&e[0])).map((([t,l])=>{const s=l[1]||t;return n.set(s,t),512&l[0]&&e.L.push([t,s]),s}))}}return t},Q=t=>{G(t,"connectedCallback")},X=t=>{const e=t.cloneNode;t.cloneNode=function(t){const n=this,l=n.shadowRoot&&wt,s=e.call(n,!!l&&t);if(!l&&t){let t,e,l=0;const o=["s-id","s-cr","s-lr","s-rc","s-sc","s-p","s-cn","s-sr","s-sn","s-hn","s-ol","s-nr","s-si"];for(;l<n.childNodes.length;l++)t=n.childNodes[l]["s-nr"],e=o.every((t=>!n.childNodes[l][t])),t&&s.appendChild(t.cloneNode(!0)),e&&s.appendChild(n.childNodes[l].cloneNode(!0))}return s}},Y=(t,e={})=>{var n;const l=[],s=e.exclude||[],o=pt.customElements,c=ht.head,i=c.querySelector("meta[charset]"),r=ht.createElement("style"),a=[];let f,u=!0;Object.assign($t,e),$t.t=new URL(e.resourcesUrl||"./",ht.baseURI).href,t.map((t=>{t[1].map((e=>{const n={p:e[0],v:e[1],T:e[2],W:e[3]};n.T=e[2],n.W=e[3],n.L=[],n.U={},!wt&&1&n.p&&(n.p|=8);const c=n.v,i=class extends HTMLElement{constructor(t){super(t),it(t=this,n),1&n.p&&(wt?t.attachShadow({mode:"open"}):"shadowRoot"in t||(t.shadowRoot=t))}connectedCallback(){f&&(clearTimeout(f),f=null),u?a.push(this):$t.jmp((()=>(t=>{if(0==(1&$t.p)){const e=ot(t),n=e.C,l=()=>{};if(1&e.p)Z(t,e,n.W),Q(e.O);else{e.p|=1,12&n.p&&(t=>{const e=t["s-cr"]=ht.createComment("");e["s-cn"]=!0,t.insertBefore(e,t.firstChild)})(t);{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){D(e,e.S=n);break}}n.T&&Object.entries(n.T).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n,l,s)=>{if(0==(32&e.p)){{if(e.p|=32,(s=ut(n)).then){const t=()=>{};s=await s,t()}s.isProxied||(n.U=s.watchers,K(s,n,2),s.isProxied=!0);const t=()=>{};e.p|=8;try{new s(e)}catch(i){at(i)}e.p&=-9,e.p|=128,t(),Q(e.O)}if(s.style){let t=s.style;const e=g(n);if(!dt.has(e)){const l=()=>{};8&n.p&&(t=await __sc_import_claromentis("./p-da455c82.js").then((n=>n.scopeCss(t,e,!1)))),((t,e,n)=>{let l=dt.get(t);yt&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,dt.set(t,l)})(e,t,!!(1&n.p)),l()}}}const o=e.S,c=()=>F(e,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(0,e,n)}l()}})(this)))}disconnectedCallback(){$t.jmp((()=>(()=>{if(0==(1&$t.p)){const t=ot(this),e=t.O;t.A&&(t.A.map((t=>t())),t.A=void 0),G(e,"disconnectedCallback")}})()))}componentOnReady(){return ot(this).D}};X(i.prototype),n.F=t[0],s.includes(c)||o.get(c)||(l.push(c),o.define(c,K(i,n,1)))}))}));{r.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",r.setAttribute("data-styles","");const t=null!==(n=$t.M)&&void 0!==n?n:p(ht);null!=t&&r.setAttribute("nonce",t),c.insertBefore(r,i?i.nextSibling:c.firstChild)}u=!1,a.length?a.map((t=>t.connectedCallback())):$t.jmp((()=>f=setTimeout(B,30)))},Z=(t,e,n)=>{n&&n.map((([n,l,s])=>{const o=et(t,n),c=tt(e,s),i=nt(n);$t.ael(o,l,c,i),(e.A=e.A||[]).push((()=>$t.rel(o,l,c,i)))}))},tt=(t,e)=>n=>{try{256&t.p?t.O[e](n):(t._=t._||[]).push([e,n])}catch(l){at(l)}},et=(t,e)=>4&e?ht:8&e?pt:t,nt=t=>0!=(2&t),lt=t=>$t.M=t,st=new WeakMap,ot=t=>st.get(t),ct=(t,e)=>st.set(e.O=t,e),it=(t,e)=>{const n={p:0,$:t,C:e,P:new Map};return n.D=new Promise((t=>n.N=t)),t["s-p"]=[],t["s-rc"]=[],Z(t,n,e.W),st.set(t,n)},rt=(t,e)=>e in t,at=(t,e)=>(0,console.error)(t,e),ft=new Map,ut=t=>{const e=t.v.replace(/-/g,"_"),n=t.F,l=ft.get(n);return l?l[e]:__sc_import_claromentis(`./${n}.entry.js`).then((t=>(ft.set(n,t),t[e])),at) /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},dt=new Map,pt="undefined"!=typeof window?window:{},ht=pt.document||{head:{}},mt=pt.HTMLElement||class{},$t={p:0,t:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},wt=(()=>(ht.head.attachShadow+"").indexOf("[native")>-1)(),bt=t=>Promise.resolve(t),yt=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),vt=[],gt=[],jt=(t,e)=>n=>{t.push(n),r||(r=!0,e&&4&$t.p?Ot(St):$t.raf(St))},kt=t=>{for(let n=0;n<t.length;n++)try{t[n](performance.now())}catch(e){at(e)}t.length=0},St=()=>{kt(vt),kt(gt),(r=vt.length>0)&&$t.raf(St)},Ot=t=>bt().then(t),_t=jt(gt,!0);export{mt as H,t as N,$t as a,Y as b,b as c,ht as d,$ as e,a as f,w as g,h,bt as p,ct as r,lt as s,pt as w}