@snk-libs/sankhya-ds 1.0.0-dev.46 → 1.0.0-dev.48
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/dist/chart/catalog.json +1 -1
- package/dist/chart/web-types.json +1 -1
- package/dist/code-editor/catalog.json +1 -1
- package/dist/code-editor/web-types.json +1 -1
- package/dist/custom-elements.json +1 -1
- package/dist/data-grid/catalog.json +1 -1
- package/dist/data-grid/cdn/chunks/{data-grid-BLBYtNPV.js → data-grid-xFL6yWNx.js} +2 -2
- package/dist/data-grid/cdn/chunks/{define-Csxzwkt8.js → define-BEFisBI0.js} +1 -1
- package/dist/data-grid/cdn/chunks/{define-VTcPsgZv.js → define-C8PxHM4z.js} +1 -1
- package/dist/data-grid/cdn/chunks/{define-EU1MkDqa.js → define-CFP25HPW.js} +1 -1
- package/dist/data-grid/cdn/chunks/{define-CJKm_-fO.js → define-oIgn67JN.js} +1 -1
- package/dist/data-grid/cdn/sankhya-ds-data-grid.js +1 -1
- package/dist/data-grid/components/data-grid/data-grid.js +1 -1
- package/dist/data-grid/components/data-grid/data-grid.styles.js +1 -1
- package/dist/data-grid/docs/components/data-grid.md +54 -53
- package/dist/data-grid/docs/llms-full.txt +54 -53
- package/dist/data-grid/web-types.json +1 -1
- package/dist/icons/catalog.json +1 -1
- package/dist/icons/web-types.json +1 -1
- package/dist/rich-text/catalog.json +1 -1
- package/dist/rich-text/web-types.json +1 -1
- package/dist/tokens/tokens.json +1 -1
- package/dist/ui/catalog.json +1 -1
- package/dist/ui/cdn/chunks/define-sm_HClpR.js +1 -0
- package/dist/ui/cdn/sankhya-ds-ui.js +1 -1
- package/dist/ui/components/header/header.js +1 -1
- package/dist/ui/custom-elements.json +1 -1
- package/dist/ui/docs/components/header.md +2 -1
- package/dist/ui/docs/llms-full.txt +2 -1
- package/dist/ui/web-types.json +1 -1
- package/package.json +1 -1
- package/dist/ui/cdn/chunks/define-CLnqtb-w.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{devWarn as e}from"../../internal/dev.js";import{SankhyaDsElement as t}from"../../internal/sankhya-ds-element.js";import{HasSlotController as n}from"../../internal/slot.js";import{HeightMotionController as r,ListMotionController as i,enter as a,fade as o,flip as s,ghostOf as c,leave as l,measure as u,motionTiming as d,pinGhost as f}from"../../internal/motion.js";import{msg as p,str as m}from"../../internal/localize.js";import{safeImageSrc as h}from"../../internal/url.js";import{loadTooltip as g}from"../../internal/tooltip-loader.js";import{OverflowTipController as ee}from"../../internal/overflow-tip.js";import{highlight as _,matchesTerm as v}from"../../internal/highlight.js";import{followPageTheme as te}from"../../internal/page-theme.js";import{LiquidGlassController as ne,MATERIALS as re,isGlass as y}from"../../internal/liquid-glass.js";import{loadDropdownMenu as ie}from"../../internal/dropdown-menu-loader.js";import{isApplePlatform as ae}from"../../internal/platform.js";import"./header-avatar.js";import{headerSearchPanel as b,loadHeaderSearchPanel as oe}from"../../internal/header-search-panel-loader.js";import{styles as se}from"./header.styles.js";import{html as x,nothing as S}from"lit";import{property as C,state as w}from"lit/decorators.js";import{repeat as T}from"lit/directives/repeat.js";import{classMap as E}from"lit/directives/class-map.js";import{ifDefined as D}from"lit/directives/if-defined.js";import{live as ce}from"lit/directives/live.js";var O=function(e,t,n,r,i,a){function o(e){if(e!==void 0&&typeof e!=`function`)throw TypeError(`Function expected`);return e}for(var s=r.kind,c=s===`getter`?`get`:s===`setter`?`set`:`value`,l=!t&&e?r.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),d,f=!1,p=n.length-1;p>=0;p--){var m={};for(var h in r)m[h]=h===`access`?{}:r[h];for(var h in r.access)m.access[h]=r.access[h];m.addInitializer=function(e){if(f)throw TypeError(`Cannot add initializers after decoration has completed`);a.push(o(e||null))};var g=(0,n[p])(s===`accessor`?{get:u.get,set:u.set}:u[c],m);if(s===`accessor`){if(g===void 0)continue;if(typeof g!=`object`||!g)throw TypeError(`Object expected`);(d=o(g.get))&&(u.get=d),(d=o(g.set))&&(u.set=d),(d=o(g.init))&&i.unshift(d)}else(d=o(g))&&(s===`field`?i.unshift(d):u[c]=d)}l&&Object.defineProperty(l,r.name,u),f=!0},k=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0},le=[`hideSearch`,`hideAvatar`],ue=`.center > [data-part-key], .actions > [data-part-key]`,de=`:scope > [slot="actions"]:not([data-ghost]):not([hidden])`,fe=[`gray`,`white`,`translucent`],pe=[`default`,`dark`],me=[`default`,`light`],he=[`default`,`compact`],ge=[`local`,`remote`];function _e(e){return e.split(/\s*\+\s*|\s+/).filter(Boolean)}var A=e=>String(e.dataset.motionKey),j=class{host;root;overlay;#e=[];constructor(e,t,n=!1){this.host=e,this.root=t,this.overlay=n,e.addController(this)}hostUpdate(){let e=this.root();this.#e=e?[...e.querySelectorAll(`:scope > .group:not([data-ghost])`)].map(e=>({el:e,key:String(e.dataset.group),parent:e.parentNode,next:e.nextElementSibling,rect:e.getBoundingClientRect()})):[]}hostUpdated(){let e=this.root();if(!e)return;let t=new Set([...e.querySelectorAll(`:scope > .group:not([data-ghost])`)].map(e=>String(e.dataset.group)));for(let{el:n,key:r,parent:i,next:a,rect:o}of this.#e){if(t.has(r)||!n.children.length)continue;let p=c(n);for(let e of p.querySelectorAll(`[data-motion-key]`))delete e.dataset.motionKey;let m=a?.parentNode===i?a:null;for(;m?.previousSibling?.nodeType===Node.COMMENT_NODE;)m=m.previousSibling;if(i.insertBefore(p,m),this.overlay){f(p,o),l(p).then(()=>p.remove());continue}let h=d(this.host);l(p).then(()=>{let t=[...e.querySelectorAll(`[data-motion-key]`)].filter(e=>!e.hasAttribute(`data-ghost`)),n=u(t,A);p.remove(),s(n,t,A,h)})}this.#e=[]}},ve=6,ye=400,M=[`custom`,`bia`,`apps`,`help`,`notifications`],N=[`custom`,`notifications`,`help`,`apps`,`bia`],be={bia:{icon:`robot`,label:()=>p(`BIA`)},notifications:{icon:`bell`,label:()=>p(`Notificações`)},help:{icon:`question-circle`,label:()=>p(`Ajuda`)},apps:{icon:`apps`,label:()=>p(`Aplicações`)}},xe=450,Se=300,Ce=0,P=(()=>{let f=t,A,P=[],I=[],L,R=[],z=[],B,V=[],H=[],U,W=[],G=[],K,q=[],J=[],Y,X=[],Z=[],we,Te=[],Ee=[],De,Oe=[],ke=[],Ae,je=[],Me=[],Ne,Pe=[],Fe=[],Ie,Le=[],Re=[],ze,Be=[],Ve=[],He,Ue=[],We=[],Ge,Ke=[],qe=[],Je,Ye=[],Xe=[],Ze,Qe=[],$e=[],et,tt=[],nt=[],rt,it=[],at=[],ot,st=[],ct=[],lt,ut=[],dt=[],ft,pt=[],mt=[],ht,gt=[],_t=[],vt,yt=[],bt=[],xt,St=[],Ct=[],wt,Tt=[],Et=[],Dt,Q=[],Ot=[],kt,At=[],jt=[],Mt,Nt=[],Pt=[],Ft,It=[],Lt=[],Rt,zt=[],$=[];return class extends f{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;A=[C({reflect:!0})],L=[C({reflect:!0})],B=[C({attribute:`field-tone`,reflect:!0})],U=[C({reflect:!0})],K=[C()],Y=[C({reflect:!0})],we=[C({attribute:!1})],De=[C({attribute:`search-mode`})],Ae=[C({type:Number,attribute:`max-results-per-group`})],Ne=[C({type:Boolean,reflect:!0})],Ie=[C({type:Boolean,reflect:!0})],ze=[C()],He=[C()],Ge=[C()],Je=[C({attribute:`avatar-src`})],Ze=[C({attribute:`user-name`})],et=[C({type:Boolean,reflect:!0,attribute:`hide-search`})],rt=[C({type:Boolean,reflect:!0,attribute:`hide-avatar`})],ot=[C({type:Boolean,reflect:!0,attribute:`show-empty-items`})],lt=[C({type:Boolean,reflect:!0})],ft=[C({attribute:!1})],ht=[C({attribute:!1})],vt=[C()],xt=[C({type:Boolean,reflect:!0})],wt=[w()],Dt=[w()],kt=[w()],Mt=[w()],Ft=[w()],Rt=[w()],O(this,null,A,{kind:`accessor`,name:`surface`,static:!1,private:!1,access:F(`surface`),metadata:e},P,I),O(this,null,L,{kind:`accessor`,name:`tone`,static:!1,private:!1,access:F(`tone`),metadata:e},R,z),O(this,null,B,{kind:`accessor`,name:`fieldTone`,static:!1,private:!1,access:F(`fieldTone`),metadata:e},V,H),O(this,null,U,{kind:`accessor`,name:`material`,static:!1,private:!1,access:F(`material`),metadata:e},W,G),O(this,null,K,{kind:`accessor`,name:`backdrop`,static:!1,private:!1,access:F(`backdrop`),metadata:e},q,J),O(this,null,Y,{kind:`accessor`,name:`density`,static:!1,private:!1,access:F(`density`),metadata:e},X,Z),O(this,null,we,{kind:`accessor`,name:`items`,static:!1,private:!1,access:F(`items`),metadata:e},Te,Ee),O(this,null,De,{kind:`accessor`,name:`searchMode`,static:!1,private:!1,access:F(`searchMode`),metadata:e},Oe,ke),O(this,null,Ae,{kind:`accessor`,name:`maxResultsPerGroup`,static:!1,private:!1,access:F(`maxResultsPerGroup`),metadata:e},je,Me),O(this,null,Ne,{kind:`accessor`,name:`loading`,static:!1,private:!1,access:F(`loading`),metadata:e},Pe,Fe),O(this,null,Ie,{kind:`accessor`,name:`refreshing`,static:!1,private:!1,access:F(`refreshing`),metadata:e},Le,Re),O(this,null,ze,{kind:`accessor`,name:`value`,static:!1,private:!1,access:F(`value`),metadata:e},Be,Ve),O(this,null,He,{kind:`accessor`,name:`placeholder`,static:!1,private:!1,access:F(`placeholder`),metadata:e},Ue,We),O(this,null,Ge,{kind:`accessor`,name:`hint`,static:!1,private:!1,access:F(`hint`),metadata:e},Ke,qe),O(this,null,Je,{kind:`accessor`,name:`avatarSrc`,static:!1,private:!1,access:F(`avatarSrc`),metadata:e},Ye,Xe),O(this,null,Ze,{kind:`accessor`,name:`userName`,static:!1,private:!1,access:F(`userName`),metadata:e},Qe,$e),O(this,null,et,{kind:`accessor`,name:`hideSearch`,static:!1,private:!1,access:F(`hideSearch`),metadata:e},tt,nt),O(this,null,rt,{kind:`accessor`,name:`hideAvatar`,static:!1,private:!1,access:F(`hideAvatar`),metadata:e},it,at),O(this,null,ot,{kind:`accessor`,name:`showEmptyItems`,static:!1,private:!1,access:F(`showEmptyItems`),metadata:e},st,ct),O(this,null,lt,{kind:`accessor`,name:`favoritable`,static:!1,private:!1,access:F(`favoritable`),metadata:e},ut,dt),O(this,null,ft,{kind:`accessor`,name:`groups`,static:!1,private:!1,access:F(`groups`),metadata:e},pt,mt),O(this,null,ht,{kind:`accessor`,name:`categories`,static:!1,private:!1,access:F(`categories`),metadata:e},gt,_t),O(this,null,vt,{kind:`accessor`,name:`category`,static:!1,private:!1,access:F(`category`),metadata:e},yt,bt),O(this,null,xt,{kind:`accessor`,name:`error`,static:!1,private:!1,access:F(`error`),metadata:e},St,Ct),O(this,null,wt,{kind:`accessor`,name:`announcement`,static:!1,private:!1,access:F(`announcement`),metadata:e},Tt,Et),O(this,null,Dt,{kind:`accessor`,name:`open`,static:!1,private:!1,access:F(`open`),metadata:e},Q,Ot),O(this,null,kt,{kind:`accessor`,name:`active`,static:!1,private:!1,access:F(`active`),metadata:e},At,jt),O(this,null,Mt,{kind:`accessor`,name:`expanded`,static:!1,private:!1,access:F(`expanded`),metadata:e},Nt,Pt),O(this,null,Ft,{kind:`accessor`,name:`split`,static:!1,private:!1,access:F(`split`),metadata:e},It,Lt),O(this,null,Rt,{kind:`accessor`,name:`overflowed`,static:!1,private:!1,access:F(`overflowed`),metadata:e},zt,$),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static css=se;static enums={surface:fe,material:re,tone:pe,fieldTone:me,density:he,searchMode:ge};#e=new n(this,`logo`,`avatar`,`context`,`tabs`);glass=new ne(this,()=>this.renderRoot.querySelector(`[part="base"]`));#t=new ee(this);#n=`sankhya-ds-header-${++Ce}`;groupMotion=new j(this,()=>this.renderRoot.querySelector(`.results`));listMotion=new i(this,{root:()=>this.renderRoot.querySelector(`.results`)});richGroupMotion=new j(this,()=>this.renderRoot.querySelector(`.rich-list`),!0);richMotion=new i(this,{root:()=>this.renderRoot.querySelector(`.rich-list`),exit:`overlay`});panelHeight=new r(this,{target:()=>{let e=this.renderRoot.querySelector(`.panel`);return e?.matches(`:popover-open`)?e:null}});#r=``;#i=/* @__PURE__ */ new Map;#a=!1;#o=!1;#s=k(this,P,`gray`);get surface(){return this.#s}set surface(e){this.#s=e}#c=(k(this,I),k(this,R,`default`));get tone(){return this.#c}set tone(e){this.#c=e}#l=(k(this,z),k(this,V,`default`));get fieldTone(){return this.#l}set fieldTone(e){this.#l=e}#u=(k(this,H),k(this,W,`default`));get material(){return this.#u}set material(e){this.#u=e}#d=(k(this,G),k(this,q,``));get backdrop(){return this.#d}set backdrop(e){this.#d=e}#f=(k(this,J),k(this,X,`default`));get density(){return this.#f}set density(e){this.#f=e}#p=(k(this,Z),k(this,Te,[]));get items(){return this.#p}set items(e){this.#p=e}#m=(k(this,Ee),k(this,Oe,`local`));get searchMode(){return this.#m}set searchMode(e){this.#m=e}#h=(k(this,ke),k(this,je,void 0));get maxResultsPerGroup(){return this.#h}set maxResultsPerGroup(e){this.#h=e}#g=(k(this,Me),k(this,Pe,!1));get loading(){return this.#g}set loading(e){this.#g=e}#_=(k(this,Fe),k(this,Le,!1));get refreshing(){return this.#_}set refreshing(e){this.#_=e}#v=(k(this,Re),k(this,Be,``));get value(){return this.#v}set value(e){this.#v=e}#y=(k(this,Ve),k(this,Ue,``));get placeholder(){return this.#y}set placeholder(e){this.#y=e}#b=(k(this,We),k(this,Ke,void 0));get hint(){return this.#b}set hint(e){this.#b=e}#x=(k(this,qe),k(this,Ye,``));get avatarSrc(){return this.#x}set avatarSrc(e){this.#x=e}#S=(k(this,Xe),k(this,Qe,``));get userName(){return this.#S}set userName(e){this.#S=e}#C=(k(this,$e),k(this,tt,!1));get hideSearch(){return this.#C}set hideSearch(e){this.#C=e}#w=(k(this,nt),k(this,it,!1));get hideAvatar(){return this.#w}set hideAvatar(e){this.#w=e}#T=(k(this,at),k(this,st,!1));get showEmptyItems(){return this.#T}set showEmptyItems(e){this.#T=e}#E=(k(this,ct),k(this,ut,!1));get favoritable(){return this.#E}set favoritable(e){this.#E=e}#D=(k(this,dt),k(this,pt,[]));get groups(){return this.#D}set groups(e){this.#D=e}#O=(k(this,mt),k(this,gt,[]));get categories(){return this.#O}set categories(e){this.#O=e}#k=(k(this,_t),k(this,yt,``));get category(){return this.#k}set category(e){this.#k=e}#A=(k(this,bt),k(this,St,!1));get error(){return this.#A}set error(e){this.#A=e}#j=(k(this,Ct),k(this,Tt,``));get announcement(){return this.#j}set announcement(e){this.#j=e}#M=(k(this,Et),k(this,Q,!1));get open(){return this.#M}set open(e){this.#M=e}#N=(k(this,Ot),/* @__PURE__ */ new Set);#P=k(this,At,0);get active(){return this.#P}set active(e){this.#P=e}#F=(k(this,jt),k(this,Nt,!1));get expanded(){return this.#F}set expanded(e){this.#F=e}#I=(k(this,Pt),k(this,It,!1));get split(){return this.#I}set split(e){this.#I=e}#L=(k(this,Lt),k(this,zt,[]));get overflowed(){return this.#L}set overflowed(e){this.#L=e}#R=(k(this,$),/* @__PURE__ */ new Set);#z=0;#B=!1;#V;#H=/* @__PURE__ */ new WeakSet;#U;#W;#G=new MutationObserver(e=>this.#Ue(e));#K=/* @__PURE__ */ new WeakMap;#q=0;#J;#Y=new MutationObserver(()=>this.requestUpdate());#X=()=>{this.#Y.disconnect();let e=this.querySelector(`:scope > [slot="avatar"]`);e&&this.#Y.observe(e,{attributes:!0,attributeFilter:[`label`]}),this.requestUpdate()};get#Z(){return this.renderRoot.querySelector(`.search:not([data-leaving]) .input`)}get#Q(){return this.renderRoot.querySelector(`.results`)}get#$(){return(this.items??[]).map(e=>typeof e==`string`?{label:e}:e)}get results(){return this.#ee(this.value).flatMap(e=>e.rows.map(([e])=>e))}#ee(e){let t=this.searchMode===`remote`?e.trim()?this.#$.map((e,t)=>[e,t]):[]:this.#te(e),n=[...new Set(this.#$.map(e=>e.group??``))],r=n.some(e=>e!==``),i=Math.floor(Number(this.maxResultsPerGroup??(r?5:0))||0);return n.map(e=>{let n=t.filter(([t])=>(t.group??``)===e);return{group:e,rows:i>0?n.slice(0,i):n}}).filter(e=>e.rows.length)}#te(e){return e.trim()?this.#$.map((e,t)=>[e,t]).filter(([t])=>v(t.label,e)||v(t.hint??``,e)):[]}get#ne(){return!this.#re&&this.open&&!this.hideSearch&&this.value.trim().length>0}get#re(){return this.showEmptyItems||this.favoritable||!!this.groups?.length||!!this.categories?.length}get#ie(){return this.#re&&this.open&&!this.hideSearch&&(this.showEmptyItems||this.value.trim().length>0)}get#ae(){return this.renderRoot.querySelector(`.panel`)}get#oe(){return this.renderRoot.querySelector(`.panel-input`)}get#se(){return(this.categories??[]).some(e=>e.value===this.category)?this.category:``}#ce(e,t){return e.value&&!this.#N.has(e.value)?`v:${e.value}`:`r${t}`}#le(e,t){let n=this.#ce(e,t);return this.#i.has(n)?this.#i.get(n):!!e.favorite}connectedCallback(){super.connectedCallback(),window.addEventListener(`keydown`,this.#_e),window.addEventListener(`blur`,this.#ye),document.addEventListener(`pointerdown`,this.#ve,!0),this.#W=new ResizeObserver(()=>{this.#pe(),this.#me()}),this.#W.observe(this),this.#G.observe(this,{childList:!0,attributes:!0,subtree:!0,attributeFilter:[`hidden`,`slot`],attributeOldValue:!0}),this.addEventListener(`focusin`,this.#de),this.addEventListener(`focusout`,this.#fe),this.#X()}#ue(e){let t=e instanceof Node?e:null;for(;t&&t.parentNode!==this;)t=t.parentNode;return t instanceof HTMLElement&&t.getAttribute(`slot`)===`actions`?t:void 0}#de=e=>{this.#J=this.#ue(e.target)};#fe=e=>{e.relatedTarget&&(this.#J=this.#ue(e.relatedTarget));let t=e.relatedTarget;this.open&&this.#re&&!b()&&e.composedPath()[0]===this.#Z&&t!==this&&!(t&&this.contains(t))&&(this.open=!1)};#pe=()=>{let e=this.getBoundingClientRect().width<=ye;for(let t of this.querySelectorAll(`:scope > sankhya-ds-logo[slot="logo"]`))e&&!t.markOnly?(t.markOnly=!0,this.#H.add(t)):!e&&this.#H.has(t)&&(t.markOnly=!1,this.#H.delete(t))};async#me(e=!1){let t=this.renderRoot?.querySelector(`.base`);if(!(!t||this.#B)){this.#B=!0;try{await this.#he();let n=this.getBoundingClientRect().width,r=this.renderRoot.querySelector(`.actions`),i=this.renderRoot.querySelector(`.logo:not([hidden])`),a=this.renderRoot.querySelector(`.search-toggle`),o=()=>{let e=t.getBoundingClientRect(),n=r.getBoundingClientRect();if(n.right>e.right+1)return!0;let o=a?.getBoundingClientRect();return(o&&o.width?Math.min(o.left,n.left):n.left)<(i?i.getBoundingClientRect().right:e.left)-1};if((this.#R.size||this.overflowed.length)&&(e||n>this.#z)){for(let e of this.#R)e.iconOnly=!1;this.#R.clear();for(let e of this.overflowed)e.removeAttribute(`data-overflow`);this.overflowed=[],await this.#he()}if(!o())return;this.#z=n,e||setTimeout(()=>void this.#me(!0),xe);let s=[...this.querySelectorAll(`:scope > [slot="context"]`)].filter(e=>typeof e.iconOnly==`boolean`&&!!e.icon&&!e.iconOnly);if(s.length){for(let e of s)e.iconOnly=!0,this.#R.add(e);if(await this.#he(),!o())return}let c=e=>e.getAttribute(`kind`)||`custom`,l=this.#ze().filter(e=>e.localName===`sankhya-ds-header-action`).sort((e,t)=>M.indexOf(c(e))-M.indexOf(c(t)));l.length>1&&await ie();let u=[];for(let e of l)if(u.push(e),!(u.length<2)){for(let e of u)e.setAttribute(`data-overflow`,``);if(this.overflowed=[...u].sort((e,t)=>N.indexOf(c(e))-N.indexOf(c(t))),await this.#he(),!o())break}}finally{this.#B=!1}}}async#he(){await this.updateComplete,await Promise.all([...this.querySelectorAll(`:scope > [slot="context"], :scope > [slot="logo"]`)].map(e=>e.updateComplete))}#ge=e=>{e.stopPropagation(),this.overflowed[Number(e.detail.value)]?.click()};disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`keydown`,this.#_e),window.removeEventListener(`blur`,this.#ye),this.removeEventListener(`focusin`,this.#de),this.removeEventListener(`focusout`,this.#fe),document.removeEventListener(`pointerdown`,this.#ve,!0),this.#W?.disconnect(),this.#G.disconnect(),this.#Y.disconnect(),this.#Pe(),this.#$e?.disconnect(),this.#tt?.()}focus(e){if(this.hideSearch)return;this.expanded=!0,this.#re&&this.#rt();let t=this.#oe;this.#ie&&t?t.focus(e):this.#re&&(this.showEmptyItems||this.value.trim())?(this.open=!0,b()||this.#Z?.focus(e)):this.#Z?.focus(e)}clear(){this.value=``,this.open=!1,this.emit(`sankhya-ds-input`,{value:``})}#_e=e=>{this.hideSearch||(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),this.focus())};#ve=e=>{e.composedPath().includes(this)||(this.open=!1,this.value||(this.expanded=!1))};#ye=()=>{let e=this.renderRoot instanceof ShadowRoot?this.renderRoot.activeElement:null,t=e===this.#Z||e===this.#oe?e:null;(this.open||t)&&(this.open=!1,this.announcement=``,this.value||(this.expanded=!1),t?.blur())};#be=e=>{this.value=e.target.value,this.open=!0,this.active=this.#re&&!this.value.trim()?-1:0,this.emit(`sankhya-ds-input`,{value:this.value})};#xe=()=>{this.#re&&this.#rt(),this.#re?this.#a||(this.showEmptyItems||this.value.trim())&&(this.open=!0):this.value&&(this.open=!0)};#Se=()=>{this.#re&&!this.open&&this.#xe()};#Ce=e=>{if(e.button!==0)return;let t=this.#Z,n=e.composedPath();!t||n.includes(t)||n.some(e=>e.part?.contains?.(`clear-button`))||(e.preventDefault(),this.renderRoot instanceof ShadowRoot&&this.renderRoot.activeElement===t?this.#Se():t.focus())};#we(e){let t=this.#ie;this.value=e.label,t?this.#Ee(!0):this.open=!1,this.emit(`sankhya-ds-select`,{item:e})}#Te(){this.#ie?this.#Ee(!0):this.open=!1,this.emit(`sankhya-ds-search-all`,{value:this.value.trim()})}#Ee(e){this.open=!1,this.announcement=``,e&&(this.#a=!0,this.#Z?.focus(),this.#a=!1)}#De=e=>{let t=e.relatedTarget;t&&!this.#ae.contains(t)&&this.#ie&&this.#Ee(!1)};#Oe(){this.emit(`sankhya-ds-retry`,{value:this.value.trim()})}#ke(e,t){let n=!this.#le(e,t);this.emit(`sankhya-ds-favorite`,{item:e,favorite:n},{cancelable:!0}).defaultPrevented||(this.#i.set(this.#ce(e,t),n),this.announcement=p(n?m`${e.label} adicionado aos favoritos.`:m`${e.label} removido dos favoritos.`),this.requestUpdate())}#Ae=e=>{if(this.#re&&e.key===`ArrowDown`&&!this.open){e.preventDefault(),this.#xe();return}if(e.key===`Escape`){this.#ne?this.open=!1:this.value?this.clear():(this.open=!1,this.expanded=!1,this.#Z?.blur()),e.preventDefault();return}if(!this.#ne)return;let t=this.results,n=t.length,r=Math.min(this.active,n);e.key===`ArrowDown`?(e.preventDefault(),this.active=Math.min(r+1,n),this.#Ze()):e.key===`ArrowUp`?(e.preventDefault(),this.active=Math.max(r-1,0),this.#Ze()):e.key===`Enter`&&(e.preventDefault(),t[r]?this.#we(t[r]):this.#Te())};#je=()=>{this.clear(),this.#Z?.focus()};#Me=()=>{this.focus()};#Ne(){let e=()=>{let e=this.renderRoot.querySelector(`.search`).getBoundingClientRect(),t=this.#Q;t.style.top=`${Math.round(e.bottom+ve)}px`,t.style.left=`${Math.round(e.left)}px`,t.style.width=`${Math.round(e.width)}px`};e(),!this.#V&&(window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),this.#V=()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)})}#Pe(){this.#V?.(),this.#V=void 0}willUpdate(t){if(super.willUpdate(t),t.has(`hideSearch`)&&this.hideSearch&&(this.open=!1,this.expanded=!1),this.hasUpdated&&le.some(e=>t.has(e))&&this.#He(),t.has(`open`)&&this.open&&this.#re&&(this.active=this.value.trim()?0:-1),!t.has(`items`))return;this.#i.clear();let n=/* @__PURE__ */ new Set;this.#N=/* @__PURE__ */ new Set;for(let t of this.items){let r=typeof t==`string`?void 0:t.value;r&&(n.has(r)&&(this.#N.add(r),e(this,`dup-value:${r}`,`value "${r.slice(0,40)}" repetido em items: use um value único por item (o sankhya-ds-select não distingue os dois).`)),n.add(r))}}#Fe=()=>{let e=this.renderRoot.querySelector(`slot[name="account"]`),t=this.hideAvatar?null:this.renderRoot.querySelector(`.avatar-button:not([data-leaving])`);for(let n of e?.assignedElements()??[])n.localName===`sankhya-ds-account-menu`&&(n.anchorElement=t)};updated(t){super.updated(t),t.has(`hideAvatar`)&&this.#Fe(),this.#ne||this.#Xe();let n=this.#Q;if(this.#ne?(this.#Ne(),n.matches(`:popover-open`)||(te(n),n.showPopover())):n.matches(`:popover-open`)&&(this.#Pe(),n.hidePopover()),t.has(`expanded`)&&this.expanded&&this.#Z?.focus(),this.#Ie(),this.#U&&this.#We(),(t.has(`material`)||t.has(`surface`)||t.has(`tone`)||t.has(`fieldTone`))&&y(this.material)){let t=[this.surface!==`gray`&&`surface`,this.tone!=="default"&&`tone`,this.fieldTone!=="default"&&`field-tone`].filter(Boolean);t.length&&e(this,`glass-ignores-${t.join(`-`)}`,`com material="${this.material}", ${t.join(`, `)} é ignorado (o vidro líquido segue o tema). Correção: tire ${t.length>1?`esses atributos`:`o atributo`}.`)}else(t.has(`tone`)||t.has(`surface`))&&this.tone===`dark`&&this.surface!==`translucent`&&e(this,`tone-without-translucent`,`tone="dark" só vale com surface="translucent": nos fundos opacos é ignorado. Correção: use surface="translucent" ou tire o tone.`);(t.has(`fieldTone`)||t.has(`surface`))&&!y(this.material)&&this.fieldTone===`light`&&this.surface!==`translucent`&&e(this,`field-tone-without-translucent`,`field-tone="light" só vale com surface="translucent": nos fundos opacos é ignorado. Correção: use surface="translucent" ou tire o field-tone.`),this.hideAvatar&&this.#e.test(`avatar`)&&e(this,`hidden-avatar-slot`,`hide-avatar com conteúdo no slot avatar: o conteúdo não aparece; tire o slot avatar ou o hide-avatar.`)}#Ie(){let e=this.#ie;this.#$e?.sync(e);let t=e&&!this.value.trim();t&&!this.#o&&this.emit(`sankhya-ds-focus-empty`),this.#o=t}#Le=e=>{if(e.getRootNode()===this.renderRoot)return String(e.dataset.partKey);let t=this.#K.get(e);return t||this.#K.set(e,t=`action-${++this.#q}`),t};#Re=()=>{let t=this.#ze().filter(e=>e.localName===`sankhya-ds-header-action`).map(e=>e.getAttribute(`kind`)||`custom`),n=t.filter(e=>e===`custom`).length;this.split=n>0&&n<t.length,n>2&&e(this,`too-many-extras`,`${n} ações extras no slot actions: o Header aceita até 2 além do catálogo do DS (R119). Correção: use kind="bia|notifications|help|apps" para os itens do catálogo e leve o resto para a tela.`);let r=t.find((e,n)=>e!==`custom`&&t.indexOf(e)!==n);r&&e(this,`repeated-kind-${r}`,`kind="${r}" repetido no slot actions: cada item do catálogo aparece uma vez. Correção: deixe só um.`),this.#me()};#ze(){return[...this.querySelectorAll(de)]}#Be(){return[...this.renderRoot.querySelectorAll(ue)].filter(e=>!e.hasAttribute(`data-ghost`))}#Ve(){let e=this.#Be(),t=e.filter(e=>e.parentElement?.classList.contains(`center`));return[...t,...this.#ze(),...e.filter(e=>!t.includes(e))]}#He(){let e=this.#Ve(),t=this.#Be(),n=this.shadowRoot?.activeElement,r=e.find(e=>n&&e.contains(n)||e.contains(document.activeElement));this.#U={rects:u(e,this.#Le),order:e.map(this.#Le),places:t.map(e=>({el:e,key:this.#Le(e),parent:e.parentNode,next:e.nextElementSibling})),focused:r&&this.#Le(r)}}#Ue(e){let t=e=>e instanceof HTMLElement&&e.parentNode===this&&e.getAttribute(`slot`)===`actions`&&!e.hasAttribute(`data-ghost`),n=/* @__PURE__ */ new Set,r=[];for(let i of e)if(i.target===this||i.target.parentNode===this){if(i.type===`attributes`){let e=i.target;if(e.hasAttribute(`data-ghost`))continue;let a=i.attributeName===`slot`?i.oldValue===`actions`&&!e.hidden:t(e)&&i.oldValue===null,o=t(e)&&!e.hidden;o&&!a?n.add(e):a&&!o&&r.push({el:e,before:e.nextSibling})}else if(i.target===this){for(let e of i.removedNodes)e instanceof HTMLElement&&e.getAttribute(`slot`)===`actions`&&!e.hasAttribute(`data-ghost`)&&!e.hidden&&!n.delete(e)&&r.push({el:e,before:i.nextSibling});for(let e of i.addedNodes)t(e)&&!e.hidden&&n.add(e)}}if(!n.size&&!r.length)return;let i=r.map(({el:e,before:t})=>{let n=c(e);return n.removeAttribute(`hidden`),n.setAttribute(`slot`,`actions`),this.insertBefore(n,t?.parentNode===this?t:null),this.#K.set(n,this.#Le(e)),n}),o=r.find(({el:e})=>e===this.#J)?.el,f=[];if(o){let e=this.#Be(),t=e.filter(e=>e.parentElement?.classList.contains(`center`));f=[...t,...this.querySelectorAll(`:scope > [slot="actions"]:not([hidden])`),...e.filter(e=>!t.includes(e))].map(this.#Le)}let p=new Map([...n].map(e=>[e,e.style.display]));for(let e of n)e.style.display=`none`;let m=u(this.#Ve(),this.#Le);for(let[e,t]of p)e.style.display=t;this.#G.takeRecords();let h=d(this);for(let e of n)a(e);s(m,this.#Ve(),this.#Le,h),o&&(this.#J=void 0,this.#Ge(f,this.#Le(o)));for(let e of i)l(e).then(()=>{if(!e.isConnected)return;let t=this.#Ve(),n=u(t,this.#Le);e.remove(),this.#G.takeRecords(),s(n,t,this.#Le,h)})}#We(){let e=this.#U;this.#U=void 0;let t=this.#Be(),n=d(this),r=new Set(this.#Ve().map(this.#Le));for(let n of t)if(!e.rects.has(this.#Le(n))){for(let e of this.renderRoot.querySelectorAll(`[data-ghost][data-part-key]`))e.dataset.partKey===n.dataset.partKey&&e.remove();a(n)}let i=/* @__PURE__ */ new Map;for(let{el:t,key:a,parent:o,next:d}of[...e.places].reverse()){if(r.has(a)){i.set(o,t);continue}if(!o.isConnected)continue;let f=c(t);f.setAttribute(`data-ghost`,``);let p=e.rects.get(a);p&&(f.style.inlineSize=`${p.width}px`,f.style.blockSize=`${p.height}px`);let m=i.has(o)?i.get(o):d?.parentNode===o?d:null;if(m&&!m.hasAttribute?.(`data-ghost`))for(;m?.previousSibling?.nodeType===Node.COMMENT_NODE;)m=m.previousSibling;o.insertBefore(f,m),i.set(o,f),l(f).then(()=>{if(!f.isConnected)return;let e=this.#Ve(),t=u(e,this.#Le);f.remove(),s(t,e,this.#Le,n)})}s(e.rects,this.#Ve(),this.#Le,n),e.focused&&!r.has(e.focused)&&this.#Ge(e.order,e.focused)}#Ge(e,t){let n=e.indexOf(t),r=new Map(this.#Ve().map(e=>[this.#Le(e),e])),i=e.slice(n+1).find(e=>r.has(e))??e.slice(0,n).reverse().find(e=>r.has(e)),a=i?r.get(i):null,o=a?.matches(`button`)||a?.getRootNode()!==this.renderRoot?a:a?.querySelector(`input, button`);if(o){o.focus();return}let s=this.renderRoot.querySelector(`[part="base"]`);s.tabIndex=-1,s.addEventListener(`blur`,()=>s.removeAttribute(`tabindex`),{once:!0}),s.focus()}#Ke(e,t,n,r,i){return x`<div part="result" data-motion-key=${e.value&&!this.#N.has(e.value)?`v:${e.value}`:`r${t}`} id=${`${this.#n}-opt-${n}`} class=${E({result:!0,"has-hint":!!e.hint,active:n===r})} role="option" aria-selected=${n===r?`true`:`false`} @pointerdown=${e=>e.preventDefault()} @click=${()=>this.#we(e)} @pointerenter=${()=>{this.#Xe(),this.active=n}} > <sankhya-ds-icon class="result-icon" name=${e.icon||`search`} aria-hidden="true" ></sankhya-ds-icon> <span class="result-label" id=${`${this.#n}-lbl-${n}`} @pointerenter=${this.#t.check} >${_(e.label,i)}</span > ${e.hint?x`<span class="result-hint" id=${`${this.#n}-hint-${n}`} @pointerenter=${this.#t.check} >${_(e.hint,i)}</span >`:S} </div>`}#qe(e){let t=0;return e.flatMap(e=>e.rows.map(([e])=>{let n=t++;return x`${this.#t.render(`${this.#n}-lbl-${n}`,e.label)}${e.hint?this.#t.render(`${this.#n}-hint-${n}`,e.hint):S}`}))}#Je=[];#Ye(e){return this.renderRoot.querySelector(`sankhya-ds-tooltip[for="${e.id}"]`)}#Xe(e=[]){for(let t of this.#Je)e.includes(t)||this.#Ye(t)?.hide();this.#Je=e}async#Ze(){await this.updateComplete;let e=this.renderRoot.querySelector(`.results [part="result"].active`),t=e?[...e.querySelectorAll(`.result-label, .result-hint`)]:[];this.#Xe(t);for(let e of t)this.#t.sync(e);await g(),await new Promise(e=>requestAnimationFrame(e)),await this.updateComplete;for(let e of t)this.#Je.includes(e)&&this.#Ye(e)?.show()}#Qe(e,t,n){let r=e.trim(),i=t.reduce((e,t)=>e+t.rows.length,0),a=this.loading?`loading`:r&&!i?`empty`:``,s=0;return x`${T(t,e=>e.group,(e,t)=>{let i=`${this.#n}-group-${t}`;return x`<div part=${e.group?`group`:S} class="group" data-group=${e.group} role=${D(e.group?`group`:void 0)} aria-labelledby=${D(e.group?i:void 0)} > ${e.group?x`<div part="group-label" class="group-label" id=${i} role="presentation" data-motion-key=${`g:${e.group}`} > ${e.group} </div>`:S} ${T(e.rows,([,e])=>e,([e,t])=>this.#Ke(e,t,s++,n,r))} </div>`})} <div class="status-slot sankhya-ds-swap" data-motion-key="status"> ${o(a,()=>a===`loading`?x`<div part="loading" class="status loading" role="presentation"> <sankhya-ds-spinner size="sm" aria-hidden="true"></sankhya-ds-spinner> ${p(`Buscando...`)} </div>`:x`<div part="empty" class="status empty" role="presentation"> ${p(m`Nenhum resultado para “${r}”.`)} </div>`)} </div> <div class="see-all-slot sankhya-ds-swap" data-motion-key="see-all"> ${o(r?`see-all`:``,()=>{let e=n===i;return x`<div part="see-all" id=${`${this.#n}-opt-all`} class=${E({result:!0,"see-all":!0,active:e,divided:i>0})} role="option" aria-selected=${e?`true`:`false`} @pointerdown=${e=>e.preventDefault()} @click=${()=>this.#Te()} @pointerenter=${()=>this.active=i} > <sankhya-ds-icon class="result-icon" name="search" aria-hidden="true"></sankhya-ds-icon> <span class="result-label">${p(m`Ver todos os resultados para “${r}”`)}</span> </div>`})} </div>`}#$e;#et=!1;#tt;#nt=(()=>{let e=this;return{header:e,get id(){return e.#n},get tip(){return e.#t},get items(){return e.#$},get category(){return e.#se},get active(){return e.active},set active(t){e.active=t},get pill(){return e.#Z},rowKey:(t,n)=>e.#ce(t,n),isFavorite:(t,n)=>e.#le(t,n),pick:t=>e.#we(t),searchAll:()=>e.#Te(),retry:()=>e.#Oe(),toggleFavorite:(t,n)=>e.#ke(t,n),closeRich:t=>e.#Ee(t),onInput:t=>e.#be(t),onPanelFocusOut:t=>e.#De(t)}})();#rt(){return b()?Promise.resolve():oe().then(()=>this.requestUpdate(),()=>e(this,`search-panel-load`,`não foi possível carregar o painel da busca; ele tenta de novo no próximo foco.`))}#it(e){let t=b();if(!t)return e&&this.#rt(),S;if(!this.#et&&this.renderRoot instanceof ShadowRoot){let e=t.panelStyles.styleSheet,n=this.renderRoot;e&&!n.adoptedStyleSheets.includes(e)&&(n.adoptedStyleSheets=[...n.adoptedStyleSheets,e]),this.#et=!0}return this.#$e??=new t.HeaderSearchPanel(this.#nt),this.#$e.render(e)}firstUpdated(e){super.firstUpdated(e);let t=e=>{if(`requestIdleCallback`in window){let t=window.requestIdleCallback(e);return()=>window.cancelIdleCallback(t)}let t=setTimeout(e,Se);return()=>clearTimeout(t)};this.#tt=t(()=>{this.#tt=void 0,this.#re&&!this.hideSearch&&this.#rt()})}render(){let e=this.#ne,t=this.#ie;e&&(this.#r=this.value);let n=this.#r,r=this.#ee(n),i=r.reduce((e,t)=>e+t.rows.length,0),a=Math.min(this.active,i),s=ae(),c=this.hint??p(s?`Cmd+K`:`Ctrl+K`),l=this.placeholder||p(`Escreva aqui o que você procura...`),u=`${this.#n}-results`,d=e?a<i?`${this.#n}-opt-${a}`:`${this.#n}-opt-all`:void 0,f=this.querySelector(`:scope > [slot="avatar"]`)?.getAttribute(`label`)?.trim()||(this.userName?p(m`Conta de ${this.userName}`):p(`Minha conta`)),g=this.#e.test(`tabs`);return x`<header part="base" class=${E({base:!0,expanded:this.expanded,"has-tabs":g})} > ${this.glass.filter()} <div class="logo" ?hidden=${!this.#e.test(`logo`)}> <slot name="logo" @slotchange=${this.#pe}></slot> </div> <div part="tabs" class="tabs" ?hidden=${!g}><slot name="tabs"></slot></div> <div class="center"> ${this.hideSearch?S:x`<span class="floor" aria-hidden="true"></span ><button part="search-toggle" id=${`${this.#n}-search-toggle`} data-part-key="search-toggle" class="action search-toggle" type="button" data-tip="always" aria-label=${p(`Buscar`)} @pointerenter=${this.#t.check} @focusin=${this.#t.check} @click=${this.#Me} > <sankhya-ds-icon class="action-icon" name="search" aria-hidden="true" ></sankhya-ds-icon></button >${this.#t.render(`${this.#n}-search-toggle`,p(`Buscar`))} <div part="search" data-part-key="search" class=${E({search:!0,open:e||t})} @mousedown=${this.#Ce} > <span class="field"> <span class="sizer" aria-hidden="true">${l}</span> <input part="input" class="input" type="text" role="combobox" autocomplete="off" enterkeyhint="search" aria-label=${p(`Busca global`)} aria-autocomplete="list" aria-expanded=${e?`true`:`false`} aria-controls=${u} aria-activedescendant=${D(d)} aria-keyshortcuts=${s?`Meta+K`:`Control+K`} size="1" placeholder=${l} .value=${ce(this.value)} @input=${this.#be} @focus=${this.#xe} @click=${this.#Se} @keydown=${this.#Ae} /> </span> <span class="affix sankhya-ds-swap" >${o(this.value?`clear`:c?`hint`:``,()=>this.value?x`<button part="clear-button" id=${`${this.#n}-clear`} class="clear sankhya-ds-pop" type="button" tabindex="-1" data-tip="always" aria-label=${p(`Limpar busca`)} @pointerenter=${this.#t.check} @click=${this.#je} > <sankhya-ds-icon class="clear-icon" name="times" aria-hidden="true" ></sankhya-ds-icon></button >${this.#t.render(`${this.#n}-clear`,p(`Limpar`))}`:x`<span part="hint" class="hint sankhya-ds-pop" aria-hidden="true" >${_e(c).map((e,t)=>x`${t?x`<span class="hint-sep"></span>`:S}<kbd part="hint-key" class="hint-key" >${e}</kbd >`)}</span >`)}</span > <sankhya-ds-icon part="search-icon" class="search-icon" name="search" aria-hidden="true" ></sankhya-ds-icon> </div>`} <div part="results" class="results" popover="manual" id=${u} role="listbox" aria-label=${p(`Resultados da busca`)} aria-busy=${this.loading?`true`:`false`} > ${this.#Qe(n,r,a)} </div> ${this.#qe(r)} ${this.#re?this.#it(t):S} <span class="visually-hidden" role="status" >${(e||t)&&this.loading?p(`Buscando...`):t&&this.refreshing?p(`Atualizando resultados...`):this.announcement}</span > </div> <div part="actions" class="actions"> <div part="context" class="context" ?hidden=${!this.#e.test(`context`)}> <slot name="context"></slot> </div> <slot name="actions" @slotchange=${this.#Re}></slot> ${this.overflowed.length?x`<sankhya-ds-dropdown-menu part="more" class="more" label=${p(`Mais ações`)} placement="bottom-end" @sankhya-ds-select=${this.#ge} > <sankhya-ds-header-action slot="trigger" icon="ellipsis-v" label=${p(`Mais ações`)} ></sankhya-ds-header-action> ${this.overflowed.map((e,t)=>{let n=be[e.getAttribute(`kind`)??``],r=e.label||n?.label()||e.textContent?.trim()||``,i=e.count?`${r} (${e.count})`:r;return x`<sankhya-ds-menu-item value=${String(t)} icon=${e.icon||n?.icon||S} >${i}</sankhya-ds-menu-item >`})} </sankhya-ds-dropdown-menu>`:S} <span part="separator" class="separator" aria-hidden="true" ?data-on=${this.split}></span> ${this.hideAvatar?S:x`<button part="avatar-button" id=${`${this.#n}-avatar`} data-part-key="avatar" class="avatar-button" type="button" data-tip="always" aria-label=${f} @pointerenter=${this.#t.check} @focusin=${this.#t.check} @click=${()=>this.emit(`sankhya-ds-avatar`)} > <slot name="avatar" @slotchange=${this.#X} ><sankhya-ds-avatar part="avatar" class="avatar" shape=${y(this.material)?`circle`:`rounded`} src=${h(this.avatarSrc,this)??`data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gHYSUNDX1BST0ZJTEUAAQEAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAA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HeJ1ZbM9FRjJRWLs1dGv4TtTcap2hzywozdPMjA/k/atqSQA6g7Dp7elUnBslktiY1mTvTuS6E4bbpj1GBn61euORjg7fxW3xZU41r2Y3JpvIyJJKqtyEHkO/0PpUmKbt15gpAPT5VBvkVhkY65x0/wDlPtLoLCpYEE7AGmhclSjHkaiud+hqUZA9R5QBk1CHB2wCfSkilzKowdxXOVwM1yglzdIPmKIC0ZcrUSXbyNTWYcnWos3SoEi9ryb1FtZ47iaW1uACSSVz5ikvZGjPMN1B3+VZPiLiGPSQLwOAIssHzj6fXp75xUbSW2GZdPSKDiDXprGygv7KMuup289ksAOcEyBQq/k/U1Euma1k0tzjlZO7wgE+JFJLyf8AU7Nj1VVNHAulniqO3NyGa0smaO3RhszMSWc+u5I+nzzfXNkus8TSXCKO6W692txjYomxb6sTj2FKuHc/0cVKK/hXM9Fc5gY5GQ9VJBorBpaemay7Wy01SUwrDIrFWDnlI6g4OK0egcaX0Fv2V+DcqgA52OH6evQ/X70UVoYLcztCmaFTSZPn420a6zH3lo5RjKNE2Rn3AI/NW2i3NtqOnWt/blXhuIlliYZ8SEZU77jIIOPLNFFP4MrvaYjyME40micrbkk7CubNzRs3pRRTAqQn8UReo1sR3ld/OiirAL1DzJVZdXSqzAn9JwaKKASt1q8h03S5rudsKFOPc+QrxP4kyxTW0LmQskt0hCocjJU/YbY+tFFL536G+LK8npXw8sJbXhmFAnZyyJjbYqD1O3nirGOyS1vuXACgeFB0A8hRRXeV0henumZjiZLddTc28iOGALBNwp+dFFFec5D3kpm7gWsaR//Z`} label=${f} aria-hidden="true" ></sankhya-ds-avatar ></slot></button >${this.#t.render(`${this.#n}-avatar`,f)}`} </div> <slot name="account" @slotchange=${this.#Fe}></slot> </header>`}}})();function F(e){return{has:t=>e in t,get:t=>t[e],set:(t,n)=>{t[e]=n}}}export{P as SankhyaDsHeader};
|
|
1
|
+
import{devWarn as e}from"../../internal/dev.js";import{SankhyaDsElement as t}from"../../internal/sankhya-ds-element.js";import{HasSlotController as n}from"../../internal/slot.js";import{HeightMotionController as r,ListMotionController as i,enter as a,fade as o,flip as s,ghostOf as c,leave as l,measure as u,motionTiming as d,pinGhost as f}from"../../internal/motion.js";import{msg as p,str as m}from"../../internal/localize.js";import{safeImageSrc as h}from"../../internal/url.js";import{loadTooltip as g}from"../../internal/tooltip-loader.js";import{OverflowTipController as ee}from"../../internal/overflow-tip.js";import{highlight as _,matchesTerm as v}from"../../internal/highlight.js";import{followPageTheme as te}from"../../internal/page-theme.js";import{LiquidGlassController as ne,MATERIALS as re,isGlass as y}from"../../internal/liquid-glass.js";import{loadDropdownMenu as ie}from"../../internal/dropdown-menu-loader.js";import{isApplePlatform as ae}from"../../internal/platform.js";import"./header-avatar.js";import{headerSearchPanel as b,loadHeaderSearchPanel as oe}from"../../internal/header-search-panel-loader.js";import{styles as se}from"./header.styles.js";import{html as x,nothing as S}from"lit";import{property as C,state as w}from"lit/decorators.js";import{repeat as T}from"lit/directives/repeat.js";import{classMap as E}from"lit/directives/class-map.js";import{ifDefined as D}from"lit/directives/if-defined.js";import{live as ce}from"lit/directives/live.js";var O=function(e,t,n,r,i,a){function o(e){if(e!==void 0&&typeof e!=`function`)throw TypeError(`Function expected`);return e}for(var s=r.kind,c=s===`getter`?`get`:s===`setter`?`set`:`value`,l=!t&&e?r.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),d,f=!1,p=n.length-1;p>=0;p--){var m={};for(var h in r)m[h]=h===`access`?{}:r[h];for(var h in r.access)m.access[h]=r.access[h];m.addInitializer=function(e){if(f)throw TypeError(`Cannot add initializers after decoration has completed`);a.push(o(e||null))};var g=(0,n[p])(s===`accessor`?{get:u.get,set:u.set}:u[c],m);if(s===`accessor`){if(g===void 0)continue;if(typeof g!=`object`||!g)throw TypeError(`Object expected`);(d=o(g.get))&&(u.get=d),(d=o(g.set))&&(u.set=d),(d=o(g.init))&&i.unshift(d)}else(d=o(g))&&(s===`field`?i.unshift(d):u[c]=d)}l&&Object.defineProperty(l,r.name,u),f=!0},k=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0},le=[`hideSearch`,`hideAvatar`],ue=`.center > [data-part-key], .actions > [data-part-key]`,de=`:scope > [slot="actions"]:not([data-ghost]):not([hidden])`,A=e=>e.kind||e.getAttribute(`kind`)||`custom`,fe=[`gray`,`white`,`translucent`],pe=[`default`,`dark`],me=[`default`,`light`],he=[`default`,`compact`],ge=[`local`,`remote`];function _e(e){return e.split(/\s*\+\s*|\s+/).filter(Boolean)}var j=e=>String(e.dataset.motionKey),M=class{host;root;overlay;#e=[];constructor(e,t,n=!1){this.host=e,this.root=t,this.overlay=n,e.addController(this)}hostUpdate(){let e=this.root();this.#e=e?[...e.querySelectorAll(`:scope > .group:not([data-ghost])`)].map(e=>({el:e,key:String(e.dataset.group),parent:e.parentNode,next:e.nextElementSibling,rect:e.getBoundingClientRect()})):[]}hostUpdated(){let e=this.root();if(!e)return;let t=new Set([...e.querySelectorAll(`:scope > .group:not([data-ghost])`)].map(e=>String(e.dataset.group)));for(let{el:n,key:r,parent:i,next:a,rect:o}of this.#e){if(t.has(r)||!n.children.length)continue;let p=c(n);for(let e of p.querySelectorAll(`[data-motion-key]`))delete e.dataset.motionKey;let m=a?.parentNode===i?a:null;for(;m?.previousSibling?.nodeType===Node.COMMENT_NODE;)m=m.previousSibling;if(i.insertBefore(p,m),this.overlay){f(p,o),l(p).then(()=>p.remove());continue}let h=d(this.host);l(p).then(()=>{let t=[...e.querySelectorAll(`[data-motion-key]`)].filter(e=>!e.hasAttribute(`data-ghost`)),n=u(t,j);p.remove(),s(n,t,j,h)})}this.#e=[]}},ve=6,ye=400,N=[`custom`,`bia`,`apps`,`help`,`notifications`],P=[`custom`,`notifications`,`help`,`apps`,`bia`],be={bia:{icon:`robot`,label:()=>p(`BIA`)},notifications:{icon:`bell`,label:()=>p(`Notificações`)},help:{icon:`question-circle`,label:()=>p(`Ajuda`)},apps:{icon:`apps`,label:()=>p(`Aplicações`)}},xe=450,Se=300,Ce=0,F=(()=>{let f=t,j,F=[],L=[],R,z=[],B=[],V,H=[],U=[],W,G=[],K=[],q,J=[],Y=[],X,Z=[],Q=[],we,Te=[],Ee=[],De,Oe=[],ke=[],Ae,je=[],Me=[],Ne,Pe=[],Fe=[],Ie,Le=[],Re=[],ze,Be=[],Ve=[],He,Ue=[],We=[],Ge,Ke=[],qe=[],Je,Ye=[],Xe=[],Ze,Qe=[],$e=[],et,tt=[],nt=[],rt,it=[],at=[],ot,st=[],ct=[],lt,ut=[],dt=[],ft,pt=[],mt=[],ht,gt=[],_t=[],vt,yt=[],bt=[],xt,St=[],Ct=[],wt,Tt=[],Et=[],$,Dt=[],Ot=[],kt,At=[],jt=[],Mt,Nt=[],Pt=[],Ft,It=[],Lt=[],Rt,zt=[],Bt=[];return class extends f{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;j=[C({reflect:!0})],R=[C({reflect:!0})],V=[C({attribute:`field-tone`,reflect:!0})],W=[C({reflect:!0})],q=[C()],X=[C({reflect:!0})],we=[C({attribute:!1})],De=[C({attribute:`search-mode`})],Ae=[C({type:Number,attribute:`max-results-per-group`})],Ne=[C({type:Boolean,reflect:!0})],Ie=[C({type:Boolean,reflect:!0})],ze=[C()],He=[C()],Ge=[C()],Je=[C({attribute:`avatar-src`})],Ze=[C({attribute:`user-name`})],et=[C({type:Boolean,reflect:!0,attribute:`hide-search`})],rt=[C({type:Boolean,reflect:!0,attribute:`hide-avatar`})],ot=[C({type:Boolean,reflect:!0,attribute:`show-empty-items`})],lt=[C({type:Boolean,reflect:!0})],ft=[C({attribute:!1})],ht=[C({attribute:!1})],vt=[C()],xt=[C({type:Boolean,reflect:!0})],wt=[w()],$=[w()],kt=[w()],Mt=[w()],Ft=[w()],Rt=[w()],O(this,null,j,{kind:`accessor`,name:`surface`,static:!1,private:!1,access:I(`surface`),metadata:e},F,L),O(this,null,R,{kind:`accessor`,name:`tone`,static:!1,private:!1,access:I(`tone`),metadata:e},z,B),O(this,null,V,{kind:`accessor`,name:`fieldTone`,static:!1,private:!1,access:I(`fieldTone`),metadata:e},H,U),O(this,null,W,{kind:`accessor`,name:`material`,static:!1,private:!1,access:I(`material`),metadata:e},G,K),O(this,null,q,{kind:`accessor`,name:`backdrop`,static:!1,private:!1,access:I(`backdrop`),metadata:e},J,Y),O(this,null,X,{kind:`accessor`,name:`density`,static:!1,private:!1,access:I(`density`),metadata:e},Z,Q),O(this,null,we,{kind:`accessor`,name:`items`,static:!1,private:!1,access:I(`items`),metadata:e},Te,Ee),O(this,null,De,{kind:`accessor`,name:`searchMode`,static:!1,private:!1,access:I(`searchMode`),metadata:e},Oe,ke),O(this,null,Ae,{kind:`accessor`,name:`maxResultsPerGroup`,static:!1,private:!1,access:I(`maxResultsPerGroup`),metadata:e},je,Me),O(this,null,Ne,{kind:`accessor`,name:`loading`,static:!1,private:!1,access:I(`loading`),metadata:e},Pe,Fe),O(this,null,Ie,{kind:`accessor`,name:`refreshing`,static:!1,private:!1,access:I(`refreshing`),metadata:e},Le,Re),O(this,null,ze,{kind:`accessor`,name:`value`,static:!1,private:!1,access:I(`value`),metadata:e},Be,Ve),O(this,null,He,{kind:`accessor`,name:`placeholder`,static:!1,private:!1,access:I(`placeholder`),metadata:e},Ue,We),O(this,null,Ge,{kind:`accessor`,name:`hint`,static:!1,private:!1,access:I(`hint`),metadata:e},Ke,qe),O(this,null,Je,{kind:`accessor`,name:`avatarSrc`,static:!1,private:!1,access:I(`avatarSrc`),metadata:e},Ye,Xe),O(this,null,Ze,{kind:`accessor`,name:`userName`,static:!1,private:!1,access:I(`userName`),metadata:e},Qe,$e),O(this,null,et,{kind:`accessor`,name:`hideSearch`,static:!1,private:!1,access:I(`hideSearch`),metadata:e},tt,nt),O(this,null,rt,{kind:`accessor`,name:`hideAvatar`,static:!1,private:!1,access:I(`hideAvatar`),metadata:e},it,at),O(this,null,ot,{kind:`accessor`,name:`showEmptyItems`,static:!1,private:!1,access:I(`showEmptyItems`),metadata:e},st,ct),O(this,null,lt,{kind:`accessor`,name:`favoritable`,static:!1,private:!1,access:I(`favoritable`),metadata:e},ut,dt),O(this,null,ft,{kind:`accessor`,name:`groups`,static:!1,private:!1,access:I(`groups`),metadata:e},pt,mt),O(this,null,ht,{kind:`accessor`,name:`categories`,static:!1,private:!1,access:I(`categories`),metadata:e},gt,_t),O(this,null,vt,{kind:`accessor`,name:`category`,static:!1,private:!1,access:I(`category`),metadata:e},yt,bt),O(this,null,xt,{kind:`accessor`,name:`error`,static:!1,private:!1,access:I(`error`),metadata:e},St,Ct),O(this,null,wt,{kind:`accessor`,name:`announcement`,static:!1,private:!1,access:I(`announcement`),metadata:e},Tt,Et),O(this,null,$,{kind:`accessor`,name:`open`,static:!1,private:!1,access:I(`open`),metadata:e},Dt,Ot),O(this,null,kt,{kind:`accessor`,name:`active`,static:!1,private:!1,access:I(`active`),metadata:e},At,jt),O(this,null,Mt,{kind:`accessor`,name:`expanded`,static:!1,private:!1,access:I(`expanded`),metadata:e},Nt,Pt),O(this,null,Ft,{kind:`accessor`,name:`split`,static:!1,private:!1,access:I(`split`),metadata:e},It,Lt),O(this,null,Rt,{kind:`accessor`,name:`overflowed`,static:!1,private:!1,access:I(`overflowed`),metadata:e},zt,Bt),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static css=se;static enums={surface:fe,material:re,tone:pe,fieldTone:me,density:he,searchMode:ge};#e=new n(this,`logo`,`avatar`,`context`,`tabs`);glass=new ne(this,()=>this.renderRoot.querySelector(`[part="base"]`));#t=new ee(this);#n=`sankhya-ds-header-${++Ce}`;groupMotion=new M(this,()=>this.renderRoot.querySelector(`.results`));listMotion=new i(this,{root:()=>this.renderRoot.querySelector(`.results`)});richGroupMotion=new M(this,()=>this.renderRoot.querySelector(`.rich-list`),!0);richMotion=new i(this,{root:()=>this.renderRoot.querySelector(`.rich-list`),exit:`overlay`});panelHeight=new r(this,{target:()=>{let e=this.renderRoot.querySelector(`.panel`);return e?.matches(`:popover-open`)?e:null}});#r=``;#i=/* @__PURE__ */ new Map;#a=!1;#o=!1;#s=k(this,F,`gray`);get surface(){return this.#s}set surface(e){this.#s=e}#c=(k(this,L),k(this,z,`default`));get tone(){return this.#c}set tone(e){this.#c=e}#l=(k(this,B),k(this,H,`default`));get fieldTone(){return this.#l}set fieldTone(e){this.#l=e}#u=(k(this,U),k(this,G,`default`));get material(){return this.#u}set material(e){this.#u=e}#d=(k(this,K),k(this,J,``));get backdrop(){return this.#d}set backdrop(e){this.#d=e}#f=(k(this,Y),k(this,Z,`default`));get density(){return this.#f}set density(e){this.#f=e}#p=(k(this,Q),k(this,Te,[]));get items(){return this.#p}set items(e){this.#p=e}#m=(k(this,Ee),k(this,Oe,`local`));get searchMode(){return this.#m}set searchMode(e){this.#m=e}#h=(k(this,ke),k(this,je,void 0));get maxResultsPerGroup(){return this.#h}set maxResultsPerGroup(e){this.#h=e}#g=(k(this,Me),k(this,Pe,!1));get loading(){return this.#g}set loading(e){this.#g=e}#_=(k(this,Fe),k(this,Le,!1));get refreshing(){return this.#_}set refreshing(e){this.#_=e}#v=(k(this,Re),k(this,Be,``));get value(){return this.#v}set value(e){this.#v=e}#y=(k(this,Ve),k(this,Ue,``));get placeholder(){return this.#y}set placeholder(e){this.#y=e}#b=(k(this,We),k(this,Ke,void 0));get hint(){return this.#b}set hint(e){this.#b=e}#x=(k(this,qe),k(this,Ye,``));get avatarSrc(){return this.#x}set avatarSrc(e){this.#x=e}#S=(k(this,Xe),k(this,Qe,``));get userName(){return this.#S}set userName(e){this.#S=e}#C=(k(this,$e),k(this,tt,!1));get hideSearch(){return this.#C}set hideSearch(e){this.#C=e}#w=(k(this,nt),k(this,it,!1));get hideAvatar(){return this.#w}set hideAvatar(e){this.#w=e}#T=(k(this,at),k(this,st,!1));get showEmptyItems(){return this.#T}set showEmptyItems(e){this.#T=e}#E=(k(this,ct),k(this,ut,!1));get favoritable(){return this.#E}set favoritable(e){this.#E=e}#D=(k(this,dt),k(this,pt,[]));get groups(){return this.#D}set groups(e){this.#D=e}#O=(k(this,mt),k(this,gt,[]));get categories(){return this.#O}set categories(e){this.#O=e}#k=(k(this,_t),k(this,yt,``));get category(){return this.#k}set category(e){this.#k=e}#A=(k(this,bt),k(this,St,!1));get error(){return this.#A}set error(e){this.#A=e}#j=(k(this,Ct),k(this,Tt,``));get announcement(){return this.#j}set announcement(e){this.#j=e}#M=(k(this,Et),k(this,Dt,!1));get open(){return this.#M}set open(e){this.#M=e}#N=(k(this,Ot),/* @__PURE__ */ new Set);#P=k(this,At,0);get active(){return this.#P}set active(e){this.#P=e}#F=(k(this,jt),k(this,Nt,!1));get expanded(){return this.#F}set expanded(e){this.#F=e}#I=(k(this,Pt),k(this,It,!1));get split(){return this.#I}set split(e){this.#I=e}#L=(k(this,Lt),k(this,zt,[]));get overflowed(){return this.#L}set overflowed(e){this.#L=e}#R=(k(this,Bt),/* @__PURE__ */ new Set);#z=0;#B=!1;#V;#H=/* @__PURE__ */ new WeakSet;#U;#W;#G=new MutationObserver(e=>this.#Ue(e));#K=/* @__PURE__ */ new WeakMap;#q=0;#J;#Y=new MutationObserver(()=>this.requestUpdate());#X=()=>{this.#Y.disconnect();let e=this.querySelector(`:scope > [slot="avatar"]`);e&&this.#Y.observe(e,{attributes:!0,attributeFilter:[`label`]}),this.requestUpdate()};get#Z(){return this.renderRoot.querySelector(`.search:not([data-leaving]) .input`)}get#Q(){return this.renderRoot.querySelector(`.results`)}get#$(){return(this.items??[]).map(e=>typeof e==`string`?{label:e}:e)}get results(){return this.#ee(this.value).flatMap(e=>e.rows.map(([e])=>e))}#ee(e){let t=this.searchMode===`remote`?e.trim()?this.#$.map((e,t)=>[e,t]):[]:this.#te(e),n=[...new Set(this.#$.map(e=>e.group??``))],r=n.some(e=>e!==``),i=Math.floor(Number(this.maxResultsPerGroup??(r?5:0))||0);return n.map(e=>{let n=t.filter(([t])=>(t.group??``)===e);return{group:e,rows:i>0?n.slice(0,i):n}}).filter(e=>e.rows.length)}#te(e){return e.trim()?this.#$.map((e,t)=>[e,t]).filter(([t])=>v(t.label,e)||v(t.hint??``,e)):[]}get#ne(){return!this.#re&&this.open&&!this.hideSearch&&this.value.trim().length>0}get#re(){return this.showEmptyItems||this.favoritable||!!this.groups?.length||!!this.categories?.length}get#ie(){return this.#re&&this.open&&!this.hideSearch&&(this.showEmptyItems||this.value.trim().length>0)}get#ae(){return this.renderRoot.querySelector(`.panel`)}get#oe(){return this.renderRoot.querySelector(`.panel-input`)}get#se(){return(this.categories??[]).some(e=>e.value===this.category)?this.category:``}#ce(e,t){return e.value&&!this.#N.has(e.value)?`v:${e.value}`:`r${t}`}#le(e,t){let n=this.#ce(e,t);return this.#i.has(n)?this.#i.get(n):!!e.favorite}connectedCallback(){super.connectedCallback(),window.addEventListener(`keydown`,this.#_e),window.addEventListener(`blur`,this.#ye),document.addEventListener(`pointerdown`,this.#ve,!0),this.#W=new ResizeObserver(()=>{this.#pe(),this.#me()}),this.#W.observe(this),this.#G.observe(this,{childList:!0,attributes:!0,subtree:!0,attributeFilter:[`hidden`,`slot`,`kind`],attributeOldValue:!0}),this.addEventListener(`focusin`,this.#de),this.addEventListener(`focusout`,this.#fe),this.#X()}#ue(e){let t=e instanceof Node?e:null;for(;t&&t.parentNode!==this;)t=t.parentNode;return t instanceof HTMLElement&&t.getAttribute(`slot`)===`actions`?t:void 0}#de=e=>{this.#J=this.#ue(e.target)};#fe=e=>{e.relatedTarget&&(this.#J=this.#ue(e.relatedTarget));let t=e.relatedTarget;this.open&&this.#re&&!b()&&e.composedPath()[0]===this.#Z&&t!==this&&!(t&&this.contains(t))&&(this.open=!1)};#pe=()=>{let e=this.getBoundingClientRect().width<=ye;for(let t of this.querySelectorAll(`:scope > sankhya-ds-logo[slot="logo"]`))e&&!t.markOnly?(t.markOnly=!0,this.#H.add(t)):!e&&this.#H.has(t)&&(t.markOnly=!1,this.#H.delete(t))};async#me(e=!1){let t=this.renderRoot?.querySelector(`.base`);if(!(!t||this.#B)){this.#B=!0;try{await this.#he();let n=this.getBoundingClientRect().width,r=this.renderRoot.querySelector(`.actions`),i=this.renderRoot.querySelector(`.logo:not([hidden])`),a=this.renderRoot.querySelector(`.search-toggle`),o=()=>{let e=t.getBoundingClientRect(),n=r.getBoundingClientRect();if(n.right>e.right+1)return!0;let o=a?.getBoundingClientRect();return(o&&o.width?Math.min(o.left,n.left):n.left)<(i?i.getBoundingClientRect().right:e.left)-1};if((this.#R.size||this.overflowed.length)&&(e||n>this.#z)){for(let e of this.#R)e.iconOnly=!1;this.#R.clear();for(let e of this.overflowed)e.removeAttribute(`data-overflow`);this.overflowed=[],await this.#he()}if(!o())return;this.#z=n,e||setTimeout(()=>void this.#me(!0),xe);let s=[...this.querySelectorAll(`:scope > [slot="context"]`)].filter(e=>typeof e.iconOnly==`boolean`&&!!e.icon&&!e.iconOnly);if(s.length){for(let e of s)e.iconOnly=!0,this.#R.add(e);if(await this.#he(),!o())return}let c=this.#ze().filter(e=>e.localName===`sankhya-ds-header-action`).sort((e,t)=>N.indexOf(A(e))-N.indexOf(A(t)));c.length>1&&await ie();let l=[];for(let e of c)if(l.push(e),!(l.length<2)){for(let e of l)e.setAttribute(`data-overflow`,``);if(this.overflowed=[...l].sort((e,t)=>P.indexOf(A(e))-P.indexOf(A(t))),await this.#he(),!o())break}}finally{this.#B=!1}}}async#he(){await this.updateComplete,await Promise.all([...this.querySelectorAll(`:scope > [slot="context"], :scope > [slot="logo"]`)].map(e=>e.updateComplete))}#ge=e=>{e.stopPropagation(),this.overflowed[Number(e.detail.value)]?.click()};disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`keydown`,this.#_e),window.removeEventListener(`blur`,this.#ye),this.removeEventListener(`focusin`,this.#de),this.removeEventListener(`focusout`,this.#fe),document.removeEventListener(`pointerdown`,this.#ve,!0),this.#W?.disconnect(),this.#G.disconnect(),this.#Y.disconnect(),this.#Pe(),this.#$e?.disconnect(),this.#tt?.()}focus(e){if(this.hideSearch)return;this.expanded=!0,this.#re&&this.#rt();let t=this.#oe;this.#ie&&t?t.focus(e):this.#re&&(this.showEmptyItems||this.value.trim())?(this.open=!0,b()||this.#Z?.focus(e)):this.#Z?.focus(e)}clear(){this.value=``,this.open=!1,this.emit(`sankhya-ds-input`,{value:``})}#_e=e=>{this.hideSearch||(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),this.focus())};#ve=e=>{e.composedPath().includes(this)||(this.open=!1,this.value||(this.expanded=!1))};#ye=()=>{let e=this.renderRoot instanceof ShadowRoot?this.renderRoot.activeElement:null,t=e===this.#Z||e===this.#oe?e:null;(this.open||t)&&(this.open=!1,this.announcement=``,this.value||(this.expanded=!1),t?.blur())};#be=e=>{this.value=e.target.value,this.open=!0,this.active=this.#re&&!this.value.trim()?-1:0,this.emit(`sankhya-ds-input`,{value:this.value})};#xe=()=>{this.#re&&this.#rt(),this.#re?this.#a||(this.showEmptyItems||this.value.trim())&&(this.open=!0):this.value&&(this.open=!0)};#Se=()=>{this.#re&&!this.open&&this.#xe()};#Ce=e=>{if(e.button!==0)return;let t=this.#Z,n=e.composedPath();!t||n.includes(t)||n.some(e=>e.part?.contains?.(`clear-button`))||(e.preventDefault(),this.renderRoot instanceof ShadowRoot&&this.renderRoot.activeElement===t?this.#Se():t.focus())};#we(e){let t=this.#ie;this.value=e.label,t?this.#Ee(!0):this.open=!1,this.emit(`sankhya-ds-select`,{item:e})}#Te(){this.#ie?this.#Ee(!0):this.open=!1,this.emit(`sankhya-ds-search-all`,{value:this.value.trim()})}#Ee(e){this.open=!1,this.announcement=``,e&&(this.#a=!0,this.#Z?.focus(),this.#a=!1)}#De=e=>{let t=e.relatedTarget;t&&!this.#ae.contains(t)&&this.#ie&&this.#Ee(!1)};#Oe(){this.emit(`sankhya-ds-retry`,{value:this.value.trim()})}#ke(e,t){let n=!this.#le(e,t);this.emit(`sankhya-ds-favorite`,{item:e,favorite:n},{cancelable:!0}).defaultPrevented||(this.#i.set(this.#ce(e,t),n),this.announcement=p(n?m`${e.label} adicionado aos favoritos.`:m`${e.label} removido dos favoritos.`),this.requestUpdate())}#Ae=e=>{if(this.#re&&e.key===`ArrowDown`&&!this.open){e.preventDefault(),this.#xe();return}if(e.key===`Escape`){this.#ne?this.open=!1:this.value?this.clear():(this.open=!1,this.expanded=!1,this.#Z?.blur()),e.preventDefault();return}if(!this.#ne)return;let t=this.results,n=t.length,r=Math.min(this.active,n);e.key===`ArrowDown`?(e.preventDefault(),this.active=Math.min(r+1,n),this.#Ze()):e.key===`ArrowUp`?(e.preventDefault(),this.active=Math.max(r-1,0),this.#Ze()):e.key===`Enter`&&(e.preventDefault(),t[r]?this.#we(t[r]):this.#Te())};#je=()=>{this.clear(),this.#Z?.focus()};#Me=()=>{this.focus()};#Ne(){let e=()=>{let e=this.renderRoot.querySelector(`.search`).getBoundingClientRect(),t=this.#Q;t.style.top=`${Math.round(e.bottom+ve)}px`,t.style.left=`${Math.round(e.left)}px`,t.style.width=`${Math.round(e.width)}px`};e(),!this.#V&&(window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),this.#V=()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)})}#Pe(){this.#V?.(),this.#V=void 0}willUpdate(t){if(super.willUpdate(t),t.has(`hideSearch`)&&this.hideSearch&&(this.open=!1,this.expanded=!1),this.hasUpdated&&le.some(e=>t.has(e))&&this.#He(),t.has(`open`)&&this.open&&this.#re&&(this.active=this.value.trim()?0:-1),!t.has(`items`))return;this.#i.clear();let n=/* @__PURE__ */ new Set;this.#N=/* @__PURE__ */ new Set;for(let t of this.items){let r=typeof t==`string`?void 0:t.value;r&&(n.has(r)&&(this.#N.add(r),e(this,`dup-value:${r}`,`value "${r.slice(0,40)}" repetido em items: use um value único por item (o sankhya-ds-select não distingue os dois).`)),n.add(r))}}#Fe=()=>{let e=this.renderRoot.querySelector(`slot[name="account"]`),t=this.hideAvatar?null:this.renderRoot.querySelector(`.avatar-button:not([data-leaving])`);for(let n of e?.assignedElements()??[])n.localName===`sankhya-ds-account-menu`&&(n.anchorElement=t)};updated(t){super.updated(t),t.has(`hideAvatar`)&&this.#Fe(),this.#ne||this.#Xe();let n=this.#Q;if(this.#ne?(this.#Ne(),n.matches(`:popover-open`)||(te(n),n.showPopover())):n.matches(`:popover-open`)&&(this.#Pe(),n.hidePopover()),t.has(`expanded`)&&this.expanded&&this.#Z?.focus(),this.#Ie(),this.#U&&this.#We(),(t.has(`material`)||t.has(`surface`)||t.has(`tone`)||t.has(`fieldTone`))&&y(this.material)){let t=[this.surface!==`gray`&&`surface`,this.tone!=="default"&&`tone`,this.fieldTone!=="default"&&`field-tone`].filter(Boolean);t.length&&e(this,`glass-ignores-${t.join(`-`)}`,`com material="${this.material}", ${t.join(`, `)} é ignorado (o vidro líquido segue o tema). Correção: tire ${t.length>1?`esses atributos`:`o atributo`}.`)}else(t.has(`tone`)||t.has(`surface`))&&this.tone===`dark`&&this.surface!==`translucent`&&e(this,`tone-without-translucent`,`tone="dark" só vale com surface="translucent": nos fundos opacos é ignorado. Correção: use surface="translucent" ou tire o tone.`);(t.has(`fieldTone`)||t.has(`surface`))&&!y(this.material)&&this.fieldTone===`light`&&this.surface!==`translucent`&&e(this,`field-tone-without-translucent`,`field-tone="light" só vale com surface="translucent": nos fundos opacos é ignorado. Correção: use surface="translucent" ou tire o field-tone.`),this.hideAvatar&&this.#e.test(`avatar`)&&e(this,`hidden-avatar-slot`,`hide-avatar com conteúdo no slot avatar: o conteúdo não aparece; tire o slot avatar ou o hide-avatar.`)}#Ie(){let e=this.#ie;this.#$e?.sync(e);let t=e&&!this.value.trim();t&&!this.#o&&this.emit(`sankhya-ds-focus-empty`),this.#o=t}#Le=e=>{if(e.getRootNode()===this.renderRoot)return String(e.dataset.partKey);let t=this.#K.get(e);return t||this.#K.set(e,t=`action-${++this.#q}`),t};#Re=()=>{let t=this.#ze().filter(e=>e.localName===`sankhya-ds-header-action`).map(A),n=t.filter(e=>e===`custom`).length;this.split=n>0&&n<t.length,n>2&&e(this,`too-many-extras`,`${n} ações extras no slot actions: o Header aceita até 2 além do catálogo do DS (R119). Correção: use kind="bia|notifications|help|apps" para os itens do catálogo e leve o resto para a tela.`);let r=t.find((e,n)=>e!==`custom`&&t.indexOf(e)!==n);r&&e(this,`repeated-kind-${r}`,`kind="${r}" repetido no slot actions: cada item do catálogo aparece uma vez. Correção: deixe só um.`),this.#me()};#ze(){return[...this.querySelectorAll(de)]}#Be(){return[...this.renderRoot.querySelectorAll(ue)].filter(e=>!e.hasAttribute(`data-ghost`))}#Ve(){let e=this.#Be(),t=e.filter(e=>e.parentElement?.classList.contains(`center`));return[...t,...this.#ze(),...e.filter(e=>!t.includes(e))]}#He(){let e=this.#Ve(),t=this.#Be(),n=this.shadowRoot?.activeElement,r=e.find(e=>n&&e.contains(n)||e.contains(document.activeElement));this.#U={rects:u(e,this.#Le),order:e.map(this.#Le),places:t.map(e=>({el:e,key:this.#Le(e),parent:e.parentNode,next:e.nextElementSibling})),focused:r&&this.#Le(r)}}#Ue(e){let t=e=>e instanceof HTMLElement&&e.parentNode===this&&e.getAttribute(`slot`)===`actions`&&!e.hasAttribute(`data-ghost`),n=/* @__PURE__ */ new Set,r=[],i=!1;for(let a of e)if(a.target===this||a.target.parentNode===this){if(a.attributeName===`kind`)i||=t(a.target);else if(a.type===`attributes`){let e=a.target;if(e.hasAttribute(`data-ghost`))continue;let i=a.attributeName===`slot`?a.oldValue===`actions`&&!e.hidden:t(e)&&a.oldValue===null,o=t(e)&&!e.hidden;o&&!i?n.add(e):i&&!o&&r.push({el:e,before:e.nextSibling})}else if(a.target===this){for(let e of a.removedNodes)e instanceof HTMLElement&&e.getAttribute(`slot`)===`actions`&&!e.hasAttribute(`data-ghost`)&&!e.hidden&&!n.delete(e)&&r.push({el:e,before:a.nextSibling});for(let e of a.addedNodes)t(e)&&!e.hidden&&n.add(e)}}if(i&&this.#Re(),!n.size&&!r.length)return;let o=r.map(({el:e,before:t})=>{let n=c(e);return n.removeAttribute(`hidden`),n.setAttribute(`slot`,`actions`),this.insertBefore(n,t?.parentNode===this?t:null),this.#K.set(n,this.#Le(e)),n}),f=r.find(({el:e})=>e===this.#J)?.el,p=[];if(f){let e=this.#Be(),t=e.filter(e=>e.parentElement?.classList.contains(`center`));p=[...t,...this.querySelectorAll(`:scope > [slot="actions"]:not([hidden])`),...e.filter(e=>!t.includes(e))].map(this.#Le)}let m=new Map([...n].map(e=>[e,e.style.display]));for(let e of n)e.style.display=`none`;let h=u(this.#Ve(),this.#Le);for(let[e,t]of m)e.style.display=t;this.#G.takeRecords();let g=d(this);for(let e of n)a(e);s(h,this.#Ve(),this.#Le,g),f&&(this.#J=void 0,this.#Ge(p,this.#Le(f)));for(let e of o)l(e).then(()=>{if(!e.isConnected)return;let t=this.#Ve(),n=u(t,this.#Le);e.remove(),this.#G.takeRecords(),s(n,t,this.#Le,g)})}#We(){let e=this.#U;this.#U=void 0;let t=this.#Be(),n=d(this),r=new Set(this.#Ve().map(this.#Le));for(let n of t)if(!e.rects.has(this.#Le(n))){for(let e of this.renderRoot.querySelectorAll(`[data-ghost][data-part-key]`))e.dataset.partKey===n.dataset.partKey&&e.remove();a(n)}let i=/* @__PURE__ */ new Map;for(let{el:t,key:a,parent:o,next:d}of[...e.places].reverse()){if(r.has(a)){i.set(o,t);continue}if(!o.isConnected)continue;let f=c(t);f.setAttribute(`data-ghost`,``);let p=e.rects.get(a);p&&(f.style.inlineSize=`${p.width}px`,f.style.blockSize=`${p.height}px`);let m=i.has(o)?i.get(o):d?.parentNode===o?d:null;if(m&&!m.hasAttribute?.(`data-ghost`))for(;m?.previousSibling?.nodeType===Node.COMMENT_NODE;)m=m.previousSibling;o.insertBefore(f,m),i.set(o,f),l(f).then(()=>{if(!f.isConnected)return;let e=this.#Ve(),t=u(e,this.#Le);f.remove(),s(t,e,this.#Le,n)})}s(e.rects,this.#Ve(),this.#Le,n),e.focused&&!r.has(e.focused)&&this.#Ge(e.order,e.focused)}#Ge(e,t){let n=e.indexOf(t),r=new Map(this.#Ve().map(e=>[this.#Le(e),e])),i=e.slice(n+1).find(e=>r.has(e))??e.slice(0,n).reverse().find(e=>r.has(e)),a=i?r.get(i):null,o=a?.matches(`button`)||a?.getRootNode()!==this.renderRoot?a:a?.querySelector(`input, button`);if(o){o.focus();return}let s=this.renderRoot.querySelector(`[part="base"]`);s.tabIndex=-1,s.addEventListener(`blur`,()=>s.removeAttribute(`tabindex`),{once:!0}),s.focus()}#Ke(e,t,n,r,i){return x`<div part="result" data-motion-key=${e.value&&!this.#N.has(e.value)?`v:${e.value}`:`r${t}`} id=${`${this.#n}-opt-${n}`} class=${E({result:!0,"has-hint":!!e.hint,active:n===r})} role="option" aria-selected=${n===r?`true`:`false`} @pointerdown=${e=>e.preventDefault()} @click=${()=>this.#we(e)} @pointerenter=${()=>{this.#Xe(),this.active=n}} > <sankhya-ds-icon class="result-icon" name=${e.icon||`search`} aria-hidden="true" ></sankhya-ds-icon> <span class="result-label" id=${`${this.#n}-lbl-${n}`} @pointerenter=${this.#t.check} >${_(e.label,i)}</span > ${e.hint?x`<span class="result-hint" id=${`${this.#n}-hint-${n}`} @pointerenter=${this.#t.check} >${_(e.hint,i)}</span >`:S} </div>`}#qe(e){let t=0;return e.flatMap(e=>e.rows.map(([e])=>{let n=t++;return x`${this.#t.render(`${this.#n}-lbl-${n}`,e.label)}${e.hint?this.#t.render(`${this.#n}-hint-${n}`,e.hint):S}`}))}#Je=[];#Ye(e){return this.renderRoot.querySelector(`sankhya-ds-tooltip[for="${e.id}"]`)}#Xe(e=[]){for(let t of this.#Je)e.includes(t)||this.#Ye(t)?.hide();this.#Je=e}async#Ze(){await this.updateComplete;let e=this.renderRoot.querySelector(`.results [part="result"].active`),t=e?[...e.querySelectorAll(`.result-label, .result-hint`)]:[];this.#Xe(t);for(let e of t)this.#t.sync(e);await g(),await new Promise(e=>requestAnimationFrame(e)),await this.updateComplete;for(let e of t)this.#Je.includes(e)&&this.#Ye(e)?.show()}#Qe(e,t,n){let r=e.trim(),i=t.reduce((e,t)=>e+t.rows.length,0),a=this.loading?`loading`:r&&!i?`empty`:``,s=0;return x`${T(t,e=>e.group,(e,t)=>{let i=`${this.#n}-group-${t}`;return x`<div part=${e.group?`group`:S} class="group" data-group=${e.group} role=${D(e.group?`group`:void 0)} aria-labelledby=${D(e.group?i:void 0)} > ${e.group?x`<div part="group-label" class="group-label" id=${i} role="presentation" data-motion-key=${`g:${e.group}`} > ${e.group} </div>`:S} ${T(e.rows,([,e])=>e,([e,t])=>this.#Ke(e,t,s++,n,r))} </div>`})} <div class="status-slot sankhya-ds-swap" data-motion-key="status"> ${o(a,()=>a===`loading`?x`<div part="loading" class="status loading" role="presentation"> <sankhya-ds-spinner size="sm" aria-hidden="true"></sankhya-ds-spinner> ${p(`Buscando...`)} </div>`:x`<div part="empty" class="status empty" role="presentation"> ${p(m`Nenhum resultado para “${r}”.`)} </div>`)} </div> <div class="see-all-slot sankhya-ds-swap" data-motion-key="see-all"> ${o(r?`see-all`:``,()=>{let e=n===i;return x`<div part="see-all" id=${`${this.#n}-opt-all`} class=${E({result:!0,"see-all":!0,active:e,divided:i>0})} role="option" aria-selected=${e?`true`:`false`} @pointerdown=${e=>e.preventDefault()} @click=${()=>this.#Te()} @pointerenter=${()=>this.active=i} > <sankhya-ds-icon class="result-icon" name="search" aria-hidden="true"></sankhya-ds-icon> <span class="result-label">${p(m`Ver todos os resultados para “${r}”`)}</span> </div>`})} </div>`}#$e;#et=!1;#tt;#nt=(()=>{let e=this;return{header:e,get id(){return e.#n},get tip(){return e.#t},get items(){return e.#$},get category(){return e.#se},get active(){return e.active},set active(t){e.active=t},get pill(){return e.#Z},rowKey:(t,n)=>e.#ce(t,n),isFavorite:(t,n)=>e.#le(t,n),pick:t=>e.#we(t),searchAll:()=>e.#Te(),retry:()=>e.#Oe(),toggleFavorite:(t,n)=>e.#ke(t,n),closeRich:t=>e.#Ee(t),onInput:t=>e.#be(t),onPanelFocusOut:t=>e.#De(t)}})();#rt(){return b()?Promise.resolve():oe().then(()=>this.requestUpdate(),()=>e(this,`search-panel-load`,`não foi possível carregar o painel da busca; ele tenta de novo no próximo foco.`))}#it(e){let t=b();if(!t)return e&&this.#rt(),S;if(!this.#et&&this.renderRoot instanceof ShadowRoot){let e=t.panelStyles.styleSheet,n=this.renderRoot;e&&!n.adoptedStyleSheets.includes(e)&&(n.adoptedStyleSheets=[...n.adoptedStyleSheets,e]),this.#et=!0}return this.#$e??=new t.HeaderSearchPanel(this.#nt),this.#$e.render(e)}firstUpdated(e){super.firstUpdated(e);let t=e=>{if(`requestIdleCallback`in window){let t=window.requestIdleCallback(e);return()=>window.cancelIdleCallback(t)}let t=setTimeout(e,Se);return()=>clearTimeout(t)};this.#tt=t(()=>{this.#tt=void 0,this.#re&&!this.hideSearch&&this.#rt()})}render(){let e=this.#ne,t=this.#ie;e&&(this.#r=this.value);let n=this.#r,r=this.#ee(n),i=r.reduce((e,t)=>e+t.rows.length,0),a=Math.min(this.active,i),s=ae(),c=this.hint??p(s?`Cmd+K`:`Ctrl+K`),l=this.placeholder||p(`Escreva aqui o que você procura...`),u=`${this.#n}-results`,d=e?a<i?`${this.#n}-opt-${a}`:`${this.#n}-opt-all`:void 0,f=this.querySelector(`:scope > [slot="avatar"]`)?.getAttribute(`label`)?.trim()||(this.userName?p(m`Conta de ${this.userName}`):p(`Minha conta`)),g=this.#e.test(`tabs`);return x`<header part="base" class=${E({base:!0,expanded:this.expanded,"has-tabs":g})} > ${this.glass.filter()} <div class="logo" ?hidden=${!this.#e.test(`logo`)}> <slot name="logo" @slotchange=${this.#pe}></slot> </div> <div part="tabs" class="tabs" ?hidden=${!g}><slot name="tabs"></slot></div> <div class="center"> ${this.hideSearch?S:x`<span class="floor" aria-hidden="true"></span ><button part="search-toggle" id=${`${this.#n}-search-toggle`} data-part-key="search-toggle" class="action search-toggle" type="button" data-tip="always" aria-label=${p(`Buscar`)} @pointerenter=${this.#t.check} @focusin=${this.#t.check} @click=${this.#Me} > <sankhya-ds-icon class="action-icon" name="search" aria-hidden="true" ></sankhya-ds-icon></button >${this.#t.render(`${this.#n}-search-toggle`,p(`Buscar`))} <div part="search" data-part-key="search" class=${E({search:!0,open:e||t})} @mousedown=${this.#Ce} > <span class="field"> <span class="sizer" aria-hidden="true">${l}</span> <input part="input" class="input" type="text" role="combobox" autocomplete="off" enterkeyhint="search" aria-label=${p(`Busca global`)} aria-autocomplete="list" aria-expanded=${e?`true`:`false`} aria-controls=${u} aria-activedescendant=${D(d)} aria-keyshortcuts=${s?`Meta+K`:`Control+K`} size="1" placeholder=${l} .value=${ce(this.value)} @input=${this.#be} @focus=${this.#xe} @click=${this.#Se} @keydown=${this.#Ae} /> </span> <span class="affix sankhya-ds-swap" >${o(this.value?`clear`:c?`hint`:``,()=>this.value?x`<button part="clear-button" id=${`${this.#n}-clear`} class="clear sankhya-ds-pop" type="button" tabindex="-1" data-tip="always" aria-label=${p(`Limpar busca`)} @pointerenter=${this.#t.check} @click=${this.#je} > <sankhya-ds-icon class="clear-icon" name="times" aria-hidden="true" ></sankhya-ds-icon></button >${this.#t.render(`${this.#n}-clear`,p(`Limpar`))}`:x`<span part="hint" class="hint sankhya-ds-pop" aria-hidden="true" >${_e(c).map((e,t)=>x`${t?x`<span class="hint-sep"></span>`:S}<kbd part="hint-key" class="hint-key" >${e}</kbd >`)}</span >`)}</span > <sankhya-ds-icon part="search-icon" class="search-icon" name="search" aria-hidden="true" ></sankhya-ds-icon> </div>`} <div part="results" class="results" popover="manual" id=${u} role="listbox" aria-label=${p(`Resultados da busca`)} aria-busy=${this.loading?`true`:`false`} > ${this.#Qe(n,r,a)} </div> ${this.#qe(r)} ${this.#re?this.#it(t):S} <span class="visually-hidden" role="status" >${(e||t)&&this.loading?p(`Buscando...`):t&&this.refreshing?p(`Atualizando resultados...`):this.announcement}</span > </div> <div part="actions" class="actions"> <div part="context" class="context" ?hidden=${!this.#e.test(`context`)}> <slot name="context"></slot> </div> <slot name="actions" @slotchange=${this.#Re}></slot> ${this.overflowed.length?x`<sankhya-ds-dropdown-menu part="more" class="more" label=${p(`Mais ações`)} placement="bottom-end" @sankhya-ds-select=${this.#ge} > <sankhya-ds-header-action slot="trigger" icon="ellipsis-v" label=${p(`Mais ações`)} ></sankhya-ds-header-action> ${this.overflowed.map((e,t)=>{let n=be[A(e)],r=e.label||n?.label()||e.textContent?.trim()||``,i=e.count?`${r} (${e.count})`:r;return x`<sankhya-ds-menu-item value=${String(t)} icon=${e.icon||n?.icon||S} >${i}</sankhya-ds-menu-item >`})} </sankhya-ds-dropdown-menu>`:S} <span part="separator" class="separator" aria-hidden="true" ?data-on=${this.split}></span> ${this.hideAvatar?S:x`<button part="avatar-button" id=${`${this.#n}-avatar`} data-part-key="avatar" class="avatar-button" type="button" data-tip="always" aria-label=${f} @pointerenter=${this.#t.check} @focusin=${this.#t.check} @click=${()=>this.emit(`sankhya-ds-avatar`)} > <slot name="avatar" @slotchange=${this.#X} ><sankhya-ds-avatar part="avatar" class="avatar" shape=${y(this.material)?`circle`:`rounded`} src=${h(this.avatarSrc,this)??`data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gHYSUNDX1BST0ZJTEUAAQEAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6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nBslktiY1mTvTuS6E4bbpj1GBn61euORjg7fxW3xZU41r2Y3JpvIyJJKqtyEHkO/0PpUmKbt15gpAPT5VBvkVhkY65x0/wDlPtLoLCpYEE7AGmhclSjHkaiud+hqUZA9R5QBk1CHB2wCfSkilzKowdxXOVwM1yglzdIPmKIC0ZcrUSXbyNTWYcnWos3SoEi9ryb1FtZ47iaW1uACSSVz5ikvZGjPMN1B3+VZPiLiGPSQLwOAIssHzj6fXp75xUbSW2GZdPSKDiDXprGygv7KMuup289ksAOcEyBQq/k/U1Euma1k0tzjlZO7wgE+JFJLyf8AU7Nj1VVNHAulniqO3NyGa0smaO3RhszMSWc+u5I+nzzfXNkus8TSXCKO6W692txjYomxb6sTj2FKuHc/0cVKK/hXM9Fc5gY5GQ9VJBorBpaemay7Wy01SUwrDIrFWDnlI6g4OK0egcaX0Fv2V+DcqgA52OH6evQ/X70UVoYLcztCmaFTSZPn420a6zH3lo5RjKNE2Rn3AI/NW2i3NtqOnWt/blXhuIlliYZ8SEZU77jIIOPLNFFP4MrvaYjyME40micrbkk7CubNzRs3pRRTAqQn8UReo1sR3ld/OiirAL1DzJVZdXSqzAn9JwaKKASt1q8h03S5rudsKFOPc+QrxP4kyxTW0LmQskt0hCocjJU/YbY+tFFL536G+LK8npXw8sJbXhmFAnZyyJjbYqD1O3nirGOyS1vuXACgeFB0A8hRRXeV0henumZjiZLddTc28iOGALBNwp+dFFFec5D3kpm7gWsaR//Z`} label=${f} aria-hidden="true" ></sankhya-ds-avatar ></slot></button >${this.#t.render(`${this.#n}-avatar`,f)}`} </div> <slot name="account" @slotchange=${this.#Fe}></slot> </header>`}}})();function I(e){return{has:t=>e in t,get:t=>t[e],set:(t,n)=>{t[e]=n}}}export{F as SankhyaDsHeader};
|