"use strict";const r=require("vue");function C(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function A(t){return typeof t=="function"?t():r.unref(t)}const E=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function R(t){var o;const u=A(t);return(o=u==null?void 0:u.$el)!=null?o:u}const M=E?window:void 0;function T(){const t=r.ref(!1),o=r.getCurrentInstance();return o&&r.onMounted(()=>{t.value=!0},o),t}function D(t){const o=T();return r.computed(()=>(o.value,!!t()))}function $(t,o,u={}){const{window:v=M,...p}=u;let c;const y=D(()=>v&&"ResizeObserver"in v),s=()=>{c&&(c.disconnect(),c=void 0)},i=r.computed(()=>Array.isArray(t)?t.map(f=>R(f)):[R(t)]),l=r.watch(i,f=>{if(s(),y.value&&v){c=new ResizeObserver(o);for(const h of f)h&&c.observe(h,p)}},{immediate:!0,flush:"post"}),a=()=>{s(),l()};return C(a),{isSupported:y,stop:a}}const k=({designWidth:t=1920,designHeight:o=1080,widthOffsetRatio:u=0,heightOffsetRatio:v=0,isProduction:p=!0})=>{g(t,o,u,v);const c=b(u),y=b(v),s=r.ref(t),i=r.ref(o),l=r.ref(1),a=r.ref(null),f=t/o,h=f*(1+c),m=f*(1-y);r.onMounted(()=>{N()}),p&&$(a,e=>{const n=e[0],d=n.contentRect.width/n.contentRect.height;requestAnimationFrame(()=>{O(d,n.contentRect.width,n.contentRect.height),x()})});function g(e,n,d,z){if(e<1920||n<1080)throw new Error("Design width and height must be at least 1920x1080.");if(!w(d)||!w(z))throw console.error("Width and height offset ratios must be non-negative numbers."),new Error("Offset ratios are invalid.")}function b(e){return w(e),e}function w(e){if(e>=0)return!0;throw new Error("Number is not non-negative.")}function N(){const e=a.value;if(e){p&&(e.style.width="100vw",e.style.height="100vh",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center");const n=e==null?void 0:e.children[0];n&&(p&&(n.style.flexShrink="0"),S(n))}}function O(e,n,d){e>=f?(i.value=o,l.value=d/i.value,e>h?s.value=i.value*h:s.value=n/l.value):(s.value=t,l.value=n/s.value,e