/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
import{reactive as e,ref as t,watch as i,onMounted as a,nextTick as l,openBlock as o,createElementBlock as n,normalizeClass as r,unref as h,normalizeStyle as s,createElementVNode as c,renderSlot as d}from"vue";import{useWindowSizeFn as u}from"@gsc-basic/hooks";import{useNamespace as g}from"../../hooks/useNamespace.js";import './index2.css';import './index.css';/* empty css          *//* empty css          */import p from"../../_virtual/_plugin-vue_export-helper.js";const f=/* @__PURE__ */p({__name:"index",props:{width:{type:[String,Number],default:1920},height:{type:[String,Number],default:1080},fullScreen:{type:Boolean,default:!1},autoScale:{type:[Object,Boolean],default:!0},delay:{type:Number,default:300},boxStyle:{type:Object,default:()=>({})},wrapperStyle:{type:Object,default:()=>({})}},setup(p){const f=p,{prefixCls:m}=g("screen-box"),y=e({width:0,height:0,originalWidth:0,originalHeight:0}),b=t(null),w=e({}),x=t(null);i(()=>f.autoScale,async e=>{e?$():Object.assign(w,{margin:"",transform:""})});const v=()=>new Promise(e=>{x.value.scrollLeft=0,x.value.scrollTop=0,l(()=>{f.width&&f.height?(y.width=f.width,y.height=f.height):(y.width=b.value?.clientWidth,y.height=b.value?.clientHeight),y.originalHeight&&y.originalWidth||(y.originalWidth=window.screen.width,y.originalHeight=window.screen.height),e()})}),S=()=>{y.width&&y.height?Object.assign(w,{width:`${y.width}px`,height:`${y.height}px`}):Object.assign(w,{width:`${y.originalWidth}px`,height:`${y.originalHeight}px`})};const j=()=>{const e=document.body.clientWidth,t=document.body.clientHeight,i=e/+(y.width||y.originalWidth),a=t/+(y.height||y.originalHeight);if(f.fullScreen)return Object.assign(w,{transform:`scale(${i},${a})`}),!1;(e=>{if(!f.autoScale)return;const t=b.value.clientWidth,i=b.value.clientHeight,a=document.body.clientWidth,l=document.body.clientHeight;let o=Math.max((a-t*e)/2,0),n=Math.max((l-i*e)/2,0);"object"==typeof f.autoScale&&(!f.autoScale.x&&(o=0),!f.autoScale.y&&(n=0)),Object.assign(w,{margin:`${n}px ${o}px`,transform:`scale(${e},${e})`})})(Math.min(i,a))};async function $(){await v(),S(),j()}return u($,f.delay),a(()=>{l(async()=>{await v(),S(),j()})}),(e,t)=>(o(),n("section",{ref_key:"box",ref:x,style:s(p.boxStyle),class:r([h(m)])},[c("div",{ref_key:"screenWrapper",ref:b,style:s({...p.wrapperStyle,...w}),class:"screen-wrapper"},[d(e.$slots,"default",{},void 0,!0)],4)],6))}},[["__scopeId","data-v-7eabd167"]]);export{f as default};