1var e=Object.defineProperty,t=(t,n,i)=>((t,n,i)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i)(t,"symbol"!=typeof n?n+"":n,i);import{C as n}from"./bluetti.Component.DCUZfk5_.min.js";import{j as i,k as o}from"./bluetti.utils.D8Vxl0wu.min.js";const s=class e extends n{static get observedAttributes(){return["open","direction"]}async onMount(){const e=this.hasAttribute("open");this.setAttribute("role","dialog"),this.setAttribute("aria-modal","true"),this.setAttribute("tabindex","-1"),this._updateDirection(),e&&this.handleOpen(),this._previousActiveElement=null,this._handleKeyDown=this._handleKeyDown.bind(this),this.addEventListener("keydown",this._handleKeyDown),this._handleResize=this._updateDirection.bind(this),window.addEventListener("resize",this._handleResize)}_updateDirection(){const e=this.getAttribute("direction-desktop"),t=this.getAttribute("direction-mobile"),n=this.getAttribute("direction-breakpoint"),i=n?parseInt(n,10):1024;let o=this.getAttribute("direction")||"right";e&&window.innerWidth>=i?o=e:t&&window.innerWidth<i&&(o=t),this.setAttribute("direction",o)}onUnmount(){this.removeEventListener("keydown",this._handleKeyDown),window.removeEventListener("resize",this._handleResize),this._previousActiveElement&&"function"==typeof this._previousActiveElement.focus&&(this._previousActiveElement.focus(),this._previousActiveElement=null),this.hasAttribute("open")&&this._decOpenCount(),e._openDrawers.delete(this)}render(){}handleOpen(){if(window.innerWidth<1024){if(document.querySelectorAll("bluetti-search-component").forEach(e=>{e.handleClose&&"visible"===e.style.visibility&&e.handleClose({closeDrawer:!1})}),window.customElements.get("bluetti-popover")){const e=window.customElements.get("bluetti-popover");"function"==typeof e.closeAll&&e.closeAll()}}this.hasAttribute("open")||this.setAttribute("open",""),this._incOpenCount(),document.activeElement!==this&&(this._previousActiveElement=document.activeElement),this.focus({preventScroll:!0}),this._focusFirstDescendant(),this.dispatchEvent(new CustomEvent("open"))}handleClose({level:t="current"}={}){"all"!==t?(this.hasAttribute("open")&&this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close")),this._decOpenCount(),this._previousActiveElement&&"function"==typeof this._previousActiveElement.focus&&(setTimeout(()=>{var e;return null==(e=this._previousActiveElement)?void 0:e.focus()},0),this._previousActiveElement=null)):e.closeAll()}static closeAll(){const t=Array.from(e._openDrawers).filter(e=>e.hasAttribute("open")),n=t[t.length-1],i=null==n?void 0:n._previousActiveElement;t.forEach(t=>{t.hasAttribute("open")&&t.removeAttribute("open"),t._drawerIsOpen&&(t._drawerIsOpen=!1,e._openCount--,e._openDrawers.delete(t)),t.dispatchEvent(new CustomEvent("close"))}),o(),e._openCount=0,i&&"function"==typeof i.focus&&setTimeout(()=>
1i.focus(),0),t.forEach(e=>{e._previousActiveElement=null})}_incOpenCount(){this._drawerIsOpen||(e._openCount++,this._drawerIsOpen=!0,e._openDrawers.add(this),1===e._openCount&&i())}_decOpenCount(){if(this._drawerIsOpen){e._openCount--,this._drawerIsOpen=!1,e._openDrawers.delete(this);Array.from(e._openDrawers).some(e=>e.hasAttribute("open"))||(o(),e._openCount=0)}}_handleKeyDown(e){if("Escape"===e.key||27===e.keyCode)return this.handleClose(),e.stopPropagation(),void e.preventDefault();"Tab"!==e.key&&9!==e.keyCode||this._trapFocus(e)}_focusFirstDescendant(){const e=this._getFocusableElements();e.length?e[0].focus():this.focus({preventScroll:!0})}_getFocusableElements(){return Array.from(this.querySelectorAll(['a[href]:not([tabindex="-1"]):not([disabled])','area[href]:not([tabindex="-1"]):not([disabled])','input:not([type="hidden"]):not([disabled]):not([tabindex="-1"])','select:not([disabled]):not([tabindex="-1"])','textarea:not([disabled]):not([tabindex="-1"])','button:not([disabled]):not([tabindex="-1"])','iframe:not([tabindex="-1"])','[tabindex]:not([tabindex="-1"]):not([disabled])','[contenteditable]:not([tabindex="-1"])'].join(","))).filter(e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden"))}_trapFocus(e){const t=this._getFocusableElements();if(!t.length)return void e.preventDefault();const n=t[0],i=t[t.length-1];e.shiftKey?document.activeElement!==n&&document.activeElement!==this||(i.focus(),e.preventDefault()):document.activeElement===i&&(n.focus(),e.preventDefault())}};t(s,"_openCount",0),t(s,"_openDrawers",new Set);let r=s;window.customElements.define("bluetti-drawer",r);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.