/*!
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
*/
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index2.css');require('./index.css');const e=require("vue"),t=require("@gsc-basic/hooks"),i=require("../../hooks/useNamespace.js");/* empty css             */;/* empty css            */const a=require("../../_virtual/_plugin-vue_export-helper.js"),l={__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(a){const l=a,{prefixCls:n}=i.useNamespace("screen-box"),r=e.reactive({width:0,height:0,originalWidth:0,originalHeight:0}),o=e.ref(null),c=e.reactive({}),s=e.ref(null);e.watch(()=>l.autoScale,async e=>{e?g():Object.assign(c,{margin:"",transform:""})});const h=()=>new Promise(t=>{s.value.scrollLeft=0,s.value.scrollTop=0,e.nextTick(()=>{l.width&&l.height?(r.width=l.width,r.height=l.height):(r.width=o.value?.clientWidth,r.height=o.value?.clientHeight),r.originalHeight&&r.originalWidth||(r.originalWidth=window.screen.width,r.originalHeight=window.screen.height),t()})}),u=()=>{r.width&&r.height?Object.assign(c,{width:`${r.width}px`,height:`${r.height}px`}):Object.assign(c,{width:`${r.originalWidth}px`,height:`${r.originalHeight}px`})};const d=()=>{const e=document.body.clientWidth,t=document.body.clientHeight,i=e/+(r.width||r.originalWidth),a=t/+(r.height||r.originalHeight);if(l.fullScreen)return Object.assign(c,{transform:`scale(${i},${a})`}),!1;(e=>{if(!l.autoScale)return;const t=o.value.clientWidth,i=o.value.clientHeight,a=document.body.clientWidth,n=document.body.clientHeight;let r=Math.max((a-t*e)/2,0),s=Math.max((n-i*e)/2,0);"object"==typeof l.autoScale&&(!l.autoScale.x&&(r=0),!l.autoScale.y&&(s=0)),Object.assign(c,{margin:`${s}px ${r}px`,transform:`scale(${e},${e})`})})(Math.min(i,a))};async function g(){await h(),u(),d()}return t.useWindowSizeFn(g,l.delay),e.onMounted(()=>{e.nextTick(async()=>{await h(),u(),d()})}),(t,i)=>(e.openBlock(),e.createElementBlock("section",{ref_key:"box",ref:s,style:e.normalizeStyle(a.boxStyle),class:e.normalizeClass([e.unref(n)])},[e.createElementVNode("div",{ref_key:"screenWrapper",ref:o,style:e.normalizeStyle({...a.wrapperStyle,...c}),class:"screen-wrapper"},[e.renderSlot(t.$slots,"default",{},void 0,!0)],4)],6))}},n=a.default(l,[["__scopeId","data-v-7eabd167"]]);exports.default=n;