1(function(){"use strict";window.Theme=window.Theme||{};const log=(window.Theme.Logger||{ns:()=>({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console)})}).ns("store.ui"),Events=window.Theme.events||null;Events||log.error("window.Theme.events not found \u2014 events.js must load before alpine-store-ui.js");const UIRegistered=Events?.UISurfaceRegisteredEvent,UIOpened=Events?.UISurfaceOpenedEvent,UIClosed=Events?.UISurfaceClosedEvent,dispatch=(EventClass,...args)=>{if(EventClass)try{document.dispatchEvent(new EventClass(...args))}catch(err){log.error("Failed to dispatch surface event",err)}},setupStore=()=>{if(typeof Alpine>"u"){log.error("Alpine not loaded \u2014 cannot register $store.ui");return}Alpine.store("ui",{surfaces:{},_openTick:0,register(id,ref){if(!id||typeof id!="string"){log.warn("register: id must be a non-empty string",{id});return}if(!ref||typeof ref!="object"){log.warn("register: ref must be an object",{id,ref});return}this.surfaces[id]=ref,this._openTick++,log.debug("Registered",{id,type:ref.type}),dispatch(UIRegistered,id,ref.type||"unknown",ref.meta||{})},unregister(id){id in this.surfaces&&(delete this.surfaces[id],this._openTick++,log.debug("Unregistered",{id}))},notifyStateChange(id){this._openTick++},get(id){return this.surfaces[id]},isOpen(id){this._openTick;const ref=this.surfaces[id];if(!ref)return!1;try{return!!ref.isOpen}catch(err){return log.warn("isOpen read threw",{id,err}),!1}},byType(type){return Object.values(this.surfaces).filter(ref=>ref.type===type)},get anyOpen(){return this._openTick,Object.values(this.surfaces).some(ref=>{try{return!!ref.isOpen}catch{return!1}})},open(id){const ref=this.surfaces[id];if(!ref){log.warn("open: no surface registered",{id});return}if(typeof ref.open!="function"){log.warn("open: surface has no open() method",{id});return}try{const result=ref.open();return this._openTick++,dispatch(UIOpened,id,ref.type||"unknown",ref.meta||{}),result}catch(err){log.error("open: surface threw",{id,err})}},close(id){const ref=this.surfaces[id];if(ref){if(typeof ref.close!="function"){log.warn("close: surface has no close() method",{id});return}try{const result=ref.close();return this._openTick++,dispatch(UIClosed,id,ref.type||"unknown",ref.meta||{}),result}catch(err){log.error("close: surface threw",{id,err})}}},closeAll(){for(const id of Object.keys(this.surfaces))this.isOpen(id)&&this.close(id)}}),log.info("$store.ui registered")};document.addEventListener("alpine:init",setupStore),log.info("alpine-store-ui v1.0.0 loaded")})(); 2//# sourceMappingURL=/cdn/shop/t/5/assets/alpine-store-ui.js.map?v=57356780327321338271779544706
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.