UNPKG

ant-design-x-vue

Version:

Craft AI-driven interfaces effortlessly

2 lines (1 loc) 1.17 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../vc-util/Dom/canUseDom.js"),_=require("../../StyleContext.js"),l="data-ant-cssinjs-cache-path",c="_FILE_STYLE__";function S(t){return Object.keys(t).map(e=>{const n=t[e];return`${e}:${n}`}).join(";")}let s,o=!0;function f(t,e=!0){s=t,o=e}function a(){var t;if(!s&&(s={},r.default())){const e=document.createElement("div");e.className=l,e.style.position="fixed",e.style.visibility="hidden",e.style.top="-9999px",document.body.appendChild(e);let n=getComputedStyle(e).content||"";n=n.replace(/^"/,"").replace(/"$/,""),n.split(";").forEach(u=>{const[d,y]=u.split(":");s[d]=y});const i=document.querySelector(`style[${l}]`);i&&(o=!1,(t=i.parentNode)==null||t.removeChild(i)),document.body.removeChild(e)}}function p(t){return a(),!!s[t]}function h(t){const e=s[t];let n=null;if(e&&r.default())if(o)n=c;else{const i=document.querySelector(`style[${_.ATTR_MARK}="${s[t]}"]`);i?n=i.innerHTML:delete s[t]}return[n,e]}exports.ATTR_CACHE_MAP=l;exports.CSS_FILE_STYLE=c;exports.existPath=p;exports.getStyleAndHash=h;exports.prepare=a;exports.reset=f;exports.serialize=S;