1import{effectScope as h,inject as v}from"vue";import{S as M,a as S}from"./socket-io-adapter-Cz7Hnc3D.js";import{ao as g}from"./logger-B4OCWT-4.js";class l extends Error{moduleName;moduleOwner;widgetStubs;constructor(o,r,n){super(o,n),this.moduleName=r?.name,this.moduleOwner=r?.owner,this.widgetStubs=r?.widgetStubs}}const f=Symbol(),p=h(!0);let u,d;const C={install(e,o){u={registry:{},...o},e.provide(f,u)}};function I(e){let o=!1;const r=s=>{if(!o){const i=`(module ${e}) useModule can't be used inside init function.`;console.warn(i)}const t=v(f);if(t===void 0)throw new Error("No module context");return t.registry[s]};let n;return{useModule:r,implement:s=>{n=s},init:(async s=>{if(n===void 0)throw new l(`Module ${e} miss implementation.`);const t=await n(s);return o=!0,{name:e,data:t.data,shortcuts:t.shortcuts,features:t.features,router:t.router,setup:t.setup}})}}async function j(e,o={},r){d={app:e};const n=await Promise.allSettled(r()),s=[];for(const t of n){if(t.status==="fulfilled"){s.push(t.value===!1?void 0:t.value);continue}s.push(void 0),o.onModuleInitFailed?.(t.reason)}for(const t of s)try{e.runWithContext(()=>p.run(()=>t?.setup?.()))}catch(i){o.onModuleSetupFailed?.(i)}return d=void 0,s}async function y(e,o,r){if(d===void 0)throw new Error("`loadModule` can only be called inside of a `setupModules` call.");try{const n=performance.now(),s=await(typeof e=="function"?e():e),t=performance.now()-n;if(s.init===void 0)return;const i=performance.now(),a=await d.app.runWithContext(()=>p.run(()=>s.init(o))),m=performance.now()-i;for(const w of Object.values(a.features??{})){const c=w?.component;c?.__asyncLoader&&c.owner===void 0&&Object.assign(c,{owner:r.owner})}return u.registry[a.name]=a.data,u.onModuleLoaded?.(a,{importTime:t,initTime:m}),a}catch(n){throw new l("Module setup failed",r,{cause:n})}}async function F(e,o,r,n){if(e)return y(o,r,n)}const N=({app:e,enabled:o,connectionKey:r})=>{const n=g();e.use(M,{enabled:o,connectionKey:r,adapter:new S({query:{...n,xorigin:window.location.host,app:"frontend"}})})};export{C as M,l as a,F as b,I as d,y as l,N as p,j as s};
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.