@seniorsistemas/tecnologia-webcomponents
Version:
A webcomponents library for Senior Sistemas - Suite BPM products.
1 lines • 11.8 kB
JavaScript
const t="tecnologia-webcomponents";let e,n,l,o=!1,s=!1,c=!1,r=!1;const i="undefined"!=typeof window?window:{},a=i.CSS,f=i.document||{head:{}},u={t:0,l:"",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)},d=(()=>(f.head.attachShadow+"").indexOf("[native")>-1)(),$=t=>Promise.resolve(t),h=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(t){}return!1})(),m=new WeakMap,p=t=>"sc-"+t.o,b={},y=t=>"object"==(t=typeof t)||"function"===t,w=(t,e,...n)=>{let l=null,o=null,s=!1,c=!1,r=[];const i=e=>{for(let n=0;n<e.length;n++)l=e[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof t&&!y(l))&&(l+=""),s&&c?r[r.length-1].i+=l:r.push(s?g(null,l):l),c=s)};if(i(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(" "))}}if("function"==typeof t)return t(null===e?{}:e,r,j);const a=g(t,null);return a.u=e,r.length>0&&(a.$=r),a.h=o,a},g=(t,e)=>({t:0,m:t,i:e,p:null,$:null,u:null,h:null}),v={},j={forEach:(t,e)=>t.map(S).forEach(e),map:(t,e)=>t.map(S).map(e).map(O)},S=t=>({vattrs:t.u,vchildren:t.$,vkey:t.g,vname:t.h,vtag:t.m,vtext:t.i}),O=t=>{if("function"==typeof t.vtag){const e=Object.assign({},t.vattrs);return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),w(t.vtag,e,...t.vchildren||[])}const e=g(t.vtag,t.vtext);return e.u=t.vattrs,e.$=t.vchildren,e.g=t.vkey,e.h=t.vname,e},_=(t,e,n,l,o,s)=>{if(n!==l){let r=rt(t,e),a=e.toLowerCase();if("class"===e){const e=t.classList,o=C(n),s=C(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(r||"o"!==e[0]||"n"!==e[1]){const i=y(l);if((r||i&&null!==l)&&!o)try{if(t.tagName.includes("-"))t[e]=l;else{let o=null==l?"":l;"list"===e?r=!1:null!=n&&t[e]==o||(t[e]=o)}}catch(c){}null==l||!1===l?!1===l&&""!==t.getAttribute(e)||t.removeAttribute(e):(!r||4&s||o)&&!i&&t.setAttribute(e,l=!0===l?"":l)}else e="-"===e[2]?e.slice(3):rt(i,a)?a.slice(2):a[2]+e.slice(3),n&&u.rel(t,e,n,!1),l&&u.ael(t,e,l,!1)}},k=/\s/,C=t=>t?t.split(k):[],M=(t,e,n,l)=>{const o=11===e.p.nodeType&&e.p.host?e.p.host:e.p,s=t&&t.u||b,c=e.u||b;for(l in s)l in c||_(o,l,s[l],void 0,n,e.t);for(l in c)_(o,l,s[l],c[l],n,e.t)},R=(t,s,r,i)=>{let a,u,d,$=s.$[r],h=0;if(o||(c=!0,"slot"===$.m&&(e&&i.classList.add(e+"-s"),$.t|=$.$?2:1)),null!==$.i)a=$.p=f.createTextNode($.i);else if(1&$.t)a=$.p=f.createTextNode("");else if(a=$.p=f.createElement(2&$.t?"slot-fb":$.m),M(null,$,!1),null!=e&&a["s-si"]!==e&&a.classList.add(a["s-si"]=e),$.$)for(h=0;h<$.$.length;++h)u=R(t,$,h,a),u&&a.appendChild(u);return a["s-hn"]=l,3&$.t&&(a["s-sr"]=!0,a["s-cr"]=n,a["s-sn"]=$.h||"",d=t&&t.$&&t.$[r],d&&d.m===$.m&&t.p&&x(t.p,!1)),a},x=(t,e)=>{u.t|=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"]&&(L(t).insertBefore(t,T(t)),t["s-ol"].remove(),t["s-ol"]=void 0,c=!0),e&&x(t,e)}u.t&=-2},E=(t,e,n,o,s,c)=>{let r,i=t["s-cr"]&&t["s-cr"].parentNode||t;for(i.shadowRoot&&i.tagName===l&&(i=i.shadowRoot);s<=c;++s)o[s]&&(r=R(null,n,s,t),r&&(o[s].p=r,i.insertBefore(r,T(e))))},N=(t,e,n,l,o)=>{for(;e<=n;++e)(l=t[e])&&(s=!0,(o=l.p)["s-ol"]?o["s-ol"].remove():x(o,!0),o.remove())},P=(t,e)=>t.m===e.m&&("slot"!==t.m||t.h===e.h),T=t=>t&&t["s-ol"]||t,L=t=>(t["s-ol"]?t["s-ol"]:t).parentNode,A=(t,e)=>{const n=e.p=t.p,l=t.$,o=e.$,s=e.i;let c;null===s?("slot"===e.m||M(t,e,!1),null!==l&&null!==o?((t,e,n,l)=>{let o,s=0,c=0,r=e.length-1,i=e[0],a=e[r],f=l.length-1,u=l[0],d=l[f];for(;s<=r&&c<=f;)null==i?i=e[++s]:null==a?a=e[--r]:null==u?u=l[++c]:null==d?d=l[--f]:P(i,u)?(A(i,u),i=e[++s],u=l[++c]):P(a,d)?(A(a,d),a=e[--r],d=l[--f]):P(i,d)?("slot"!==i.m&&"slot"!==d.m||x(i.p.parentNode,!1),A(i,d),t.insertBefore(i.p,a.p.nextSibling),i=e[++s],d=l[--f]):P(a,u)?("slot"!==i.m&&"slot"!==d.m||x(a.p.parentNode,!1),A(a,u),t.insertBefore(a.p,i.p),a=e[--r],u=l[++c]):(o=R(e&&e[c],n,c,t),u=l[++c],o&&L(i.p).insertBefore(o,T(i.p)));s>r?E(t,null==l[f+1]?null:l[f+1].p,n,l,c,f):c>f&&N(e,s,r)})(n,l,e,o):null!==o?(null!==t.i&&(n.textContent=""),E(n,null,e,o,0,o.length-1)):null!==l&&N(l,0,l.length-1)):(c=n["s-cr"])?c.parentNode.textContent=s:t.i!==s&&(n.data=s)},W=t=>{let e,n,l,o,s,c,r=t.childNodes;for(n=0,l=r.length;n<l;n++)if(e=r[n],1===e.nodeType){if(e["s-sr"])for(s=e["s-sn"],e.hidden=!1,o=0;o<l;o++)if(c=r[o].nodeType,r[o]["s-hn"]!==e["s-hn"]||""!==s){if(1===c&&s===r[o].getAttribute("slot")){e.hidden=!0;break}}else if(1===c||3===c&&""!==r[o].textContent.trim()){e.hidden=!0;break}W(e)}},F=[],H=t=>{let e,n,l,o,c,r,i=0,a=t.childNodes,f=a.length;for(;i<f;i++){if(e=a[i],e["s-sr"]&&(n=e["s-cr"])&&n.parentNode)for(l=n.parentNode.childNodes,o=e["s-sn"],r=l.length-1;r>=0;r--)n=l[r],n["s-cn"]||n["s-nr"]||n["s-hn"]===e["s-hn"]||(U(n,o)?(c=F.find((t=>t.v===n)),s=!0,n["s-sn"]=n["s-sn"]||o,c?c.j=e:F.push({j:e,v:n}),n["s-sr"]&&F.map((t=>{U(t.v,n["s-sn"])&&(c=F.find((t=>t.v===n)),c&&!t.j&&(t.j=c.j))}))):F.some((t=>t.v===n))||F.push({v:n}));1===e.nodeType&&H(e)}},U=(t,e)=>1===t.nodeType?null===t.getAttribute("slot")&&""===e||t.getAttribute("slot")===e:t["s-sn"]===e||""===e,q=t=>ot(t).S,D=(t,e,n)=>{const l=q(t);return{emit:t=>V(l,e,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:t})}},V=(t,e,n)=>{const l=u.ce(e,n);return t.dispatchEvent(l),l},z=(t,e)=>{e&&!t.O&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.O=e)))},B=(t,e)=>{if(t.t|=16,!(4&t.t))return z(t,t._),yt((()=>G(t,e)));t.t|=512},G=(t,e)=>{const n=t.k;let l;return e&&(l=X(n,"componentWillLoad")),Y(l,(()=>I(t,n,e)))},I=async(t,e,n)=>{const l=t.S,o=l["s-rc"];n&&(t=>{const e=t.C,n=t.S,l=e.t,o=((t,e)=>{let n=p(e),l=ut.get(n);if(t=11===t.nodeType?t:f,l)if("string"==typeof l){let e,o=m.get(t=t.head||t);o||m.set(t,o=new Set),o.has(n)||(e=f.createElement("style"),e.innerHTML=l,t.insertBefore(e,t.querySelector("link")),o&&o.add(n))}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]);return n})(d&&n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(t);J(t,e),o&&(o.map((t=>t())),l["s-rc"]=void 0);{const e=l["s-p"],n=()=>K(t);0===e.length?n():(Promise.all(e).then(n),t.t|=4,e.length=0)}},J=(t,r)=>{try{r=r.render(),t.t&=-17,t.t|=2,((t,r)=>{const i=t.S,a=t.C,$=t.M||g(null,null),h=(t=>t&&t.m===v)(r)?r:w(null,null,r);if(l=i.tagName,a.R&&(h.u=h.u||{},a.R.map((([t,e])=>h.u[e]=i[t]))),h.m=null,h.t|=4,t.M=h,h.p=$.p=i.shadowRoot||i,e=i["s-sc"],n=i["s-cr"],o=d&&0!=(1&a.t),s=!1,A($,h),u.t|=1,c){let t,e,n,l,o,s;H(h.p);let c=0;for(;c<F.length;c++)t=F[c],e=t.v,e["s-ol"]||(n=f.createTextNode(""),n["s-nr"]=e,e.parentNode.insertBefore(e["s-ol"]=n,e));for(c=0;c<F.length;c++)if(t=F[c],e=t.v,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&&W(h.p),u.t&=-2,F.length=0})(t,r)}catch(i){it(i,t.S)}return null},K=t=>{const e=t.S,n=t.k,l=t._;64&t.t||(t.t|=64,Z(e),X(n,"componentDidLoad"),t.N(e),l||Q()),t.P(e),t.O&&(t.O(),t.O=void 0),512&t.t&&bt((()=>B(t,!1))),t.t&=-517},Q=()=>{Z(f.documentElement),bt((()=>V(i,"appload",{detail:{namespace:"tecnologia-webcomponents"}})))},X=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(l){it(l)}},Y=(t,e)=>t&&t.then?t.then(e):e(),Z=t=>t.classList.add("hydrated"),tt=(t,e,n)=>{if(e.T){t.watchers&&(e.L=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).A.get(e))(0,t)},set(n){((t,e,n,l)=>{const o=ot(t),s=o.S,c=o.A.get(e),r=o.t,i=o.k;if(n=((t,e)=>null==t||y(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?parseFloat(t):1&e?t+"":t)(n,l.T[e][0]),!(8&r&&void 0!==c||n===c)&&(o.A.set(e,n),i)){if(l.L&&128&r){const t=l.L[e];t&&t.map((t=>{try{i[t](n,c,e)}catch(l){it(l,s)}}))}2==(18&r)&&B(o,!1)}})(this,t,n,e)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(o,t,{value(...e){const n=ot(this);return n.W.then((()=>n.k[t](...e)))}})})),1&n){const n=new Map;o.attributeChangedCallback=function(t,e,l){u.jmp((()=>{const e=n.get(t);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.R.push([t,o]),o}))}}return t},et=(t,e)=>{class n extends Array{item(t){return this[t]}}if(8&e.t){const e=t.__lookupGetter__("childNodes");Object.defineProperty(t,"children",{get(){return this.childNodes.map((t=>1===t.nodeType))}}),Object.defineProperty(t,"childElementCount",{get:()=>t.children.length}),Object.defineProperty(t,"childNodes",{get(){const t=e.call(this);if(0==(1&u.t)&&2&ot(this).t){const e=new n;for(let n=0;n<t.length;n++){const l=t[n]["s-nr"];l&&e.push(l)}return e}return n.from(t)}})}},nt=(t,e={})=>{const n=[],l=e.exclude||[],o=i.customElements,s=f.head,c=s.querySelector("meta[charset]"),r=f.createElement("style"),a=[];let $,m=!0;Object.assign(u,e),u.l=new URL(e.resourcesUrl||"./",f.baseURI).href,t.map((t=>t[1].map((e=>{const s={t:e[0],o:e[1],T:e[2],F:e[3]};s.T=e[2],s.R=[],s.L={},!d&&1&s.t&&(s.t|=8);const c=s.o,r=class extends HTMLElement{constructor(t){super(t),ct(t=this,s),1&s.t&&(d?t.attachShadow({mode:"open"}):"shadowRoot"in t||(t.shadowRoot=t)),et(t,s)}connectedCallback(){$&&(clearTimeout($),$=null),m?a.push(this):u.jmp((()=>(t=>{if(0==(1&u.t)){const e=ot(t),n=e.C,l=()=>{};if(!(1&e.t)){e.t|=1,12&n.t&&(t=>{const e=t["s-cr"]=f.createComment("");e["s-cn"]=!0,t.insertBefore(e,t.firstChild)})(t);{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){z(e,e._=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.t)){{if(e.t|=32,(o=ft(n)).then){const t=()=>{};o=await o,t()}o.isProxied||(n.L=o.watchers,tt(o,n,2),o.isProxied=!0);const t=()=>{};e.t|=8;try{new o(e)}catch(r){it(r)}e.t&=-9,e.t|=128,t()}if(o.style){let t=o.style;const e=p(n);if(!ut.has(e)){const l=()=>{};8&n.t&&(t=await __sc_import_tecnologia_webcomponents("./p-596b2685.js").then((n=>n.scopeCss(t,e,!1)))),((t,e,n)=>{let l=ut.get(t);h&&n?(l=l||new CSSStyleSheet,l.replace(e)):l=e,ut.set(t,l)})(e,t,!!(1&n.t)),l()}}}const s=e._,c=()=>B(e,!0);s&&s["s-rc"]?s["s-rc"].push(c):c()})(0,e,n)}l()}})(this)))}disconnectedCallback(){u.jmp((()=>{}))}componentOnReady(){return ot(this).H}};s.U=t[0],l.includes(c)||o.get(c)||(n.push(c),o.define(c,tt(r,s,1)))})))),r.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",r.setAttribute("data-styles",""),s.insertBefore(r,c?c.nextSibling:s.firstChild),m=!1,a.length?a.map((t=>t.connectedCallback())):u.jmp((()=>$=setTimeout(Q,30)))},lt=new WeakMap,ot=t=>lt.get(t),st=(t,e)=>lt.set(e.k=t,e),ct=(t,e)=>{const n={t:0,S:t,C:e,A:new Map};return n.W=new Promise((t=>n.P=t)),n.H=new Promise((t=>n.N=t)),t["s-p"]=[],t["s-rc"]=[],lt.set(t,n)},rt=(t,e)=>e in t,it=(t,e)=>(0,console.error)(t,e),at=new Map,ft=t=>{const e=t.o.replace(/-/g,"_"),n=t.U,l=at.get(n);return l?l[e]:__sc_import_tecnologia_webcomponents(`./${n}.entry.js`).then((t=>(at.set(n,t),t[e])),it)},ut=new Map,dt=[],$t=[],ht=(t,e)=>n=>{t.push(n),r||(r=!0,e&&4&u.t?bt(pt):u.raf(pt))},mt=t=>{for(let n=0;n<t.length;n++)try{t[n](performance.now())}catch(e){it(e)}t.length=0},pt=()=>{mt(dt),mt($t),(r=dt.length>0)&&u.raf(pt)},bt=t=>$().then(t),yt=ht($t,!0);export{a as C,v as H,t as N,$ as a,nt as b,D as c,f as d,q as g,w as h,u as p,st as r,i as w}