function t(t){return null==t||"string"==typeof t&&""===t.trim()}function e(t){if(null==t||"object"!=typeof t)return!1;for(const e in t)return!1;return!0}const i=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"];let n;function r(t,e=null,r=null){n||(n=document.createElement("textarea"),n.setAttribute("tab-index","-1"),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),t.getAttribute("wrap")?n.setAttribute("wrap",t.getAttribute("wrap")):n.removeAttribute("wrap");const{paddingSize:o,borderSize:a,boxSizing:l,sizingStyle:p}=function(t){const e=window.getComputedStyle(t),n=e.getPropertyValue("box-sizing")||e.getPropertyValue("-moz-box-sizing")||e.getPropertyValue("-webkit-box-sizing"),r=(parseFloat(e.getPropertyValue("padding-top"))||0)+(parseFloat(e.getPropertyValue("padding-bottom"))||0),o=(parseFloat(e.getPropertyValue("border-bottom-width"))||0)+(parseFloat(e.getPropertyValue("border-top-width"))||0);return{sizingStyle:i.map(t=>`${t}:${e.getPropertyValue(t)}`).join(";"),paddingSize:r,borderSize:o,boxSizing:n}}(t);n.setAttribute("style",`${p};\n    min-height:0 !important;\n    max-height:none !important;\n    height:0 !important;\n    visibility:hidden !important;\n    position:absolute !important;\n    overflow:hidden !important;\n    z-index:-1000 !important;\n    top:0 !important;\n    right:0 !important;\n`),n.value=t.value||t.placeholder||"";let d=Number.MIN_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER,g=parseFloat(n.scrollHeight);if("border-box"===l?g+=a:"content-box"===l&&(g-=o),null!==e||null!==r){n.value=" ";const t=n.scrollHeight-o;null!==e&&(d=t*e,"border-box"===l&&(d=d+o+a),g=d>g?d:g),null!==r&&(u=t*r,"border-box"===l&&(u=u+o+a),g=u<g?u:g)}return`height: ${g}px; min-height: ${d}px; max-height: ${u}px; overflow-y: ${g<u?"hidden":"unset"}`}export{e as a,r as c,t as i};
