UNPKG

@claromentis/design-system

Version:

Claromentis Design System Component Library

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