import{computed as e}from"/vue.js";function t(...e){console.warn(...e)}function n(e,n,r,i){if(typeof e!=`string`)return i!==`update`&&t(r+` parameter type is not string: `,typeof e,e,n),typeof e==`number`?e:`auto`;let a=e.split(`/`);if(a.length!==2)return i!==`update`&&(a.length>2?t(r+` parameter must contain only one '/' :`,e,n):t(r+` parameter does not contain '/' :`,e,n)),`auto`;let o=Number(a[0]),s=Number(a[1]);return s<=0||o>s||isNaN(o)||isNaN(s)?(i!==`update`&&t(r+` parameter does not resolve to valid number:`,e,n),`auto`):o/s}function r(e,t,r){if(!e)return``;let i=e.style||``;if(i!=null&&i.width&&(t=!1),t===!0&&!e.width?i+=`width:100%;`:t&&!e.width&&(i=i+`width:`+t+`;`),e.width){if(typeof e.width!=`string`){console.error(`row or column width property is not string:`,e.width);return}if(e.width.search(`/`)>=0){let t=n(e.width,e,`width`,r)*100;t===`auto`||(typeof i==`object`?i.width==null&&(i.width=t+`%`):i.search(`width:`)<0&&(i=`width:`+t+`%;`+i))}else typeof i==`object`?i.width==null&&(i.width=e.width):i.search(`width:`)<0&&(i=i+`width:`+e.width+`;`+i)}if(e.height)if(e.height.search(`/`)>=0){i!==``&&(i+=` `);let t=n(e.height,e,`height`,r)*100;typeof i==`object`?i.height==null&&(t===`auto`?i.height=`auto`:i.height=t+`%`):t===`auto`?i=`height:auto;`+i:i.search(`height:`)<0&&(i=i+`height:`+t+`%;`+i)}else typeof i==`object`?i.height==null&&(i.height=e.height):i.search(`height:`)<0&&(i=i+`height:`+e.height+`;`+i);return i}function i(t,n){return{name:t,props:{style:{type:[String,Object],default:void 0},width:{type:String,default:void 0},height:{type:String,default:void 0}},setup(t){return{calculatedStyle:e(()=>r(t,n))}}}}export{r as n,i as t};