ll-package
Version:
2 lines (1 loc) • 1.21 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../../../../@emotion/hash/dist/emotion-hash.esm.js"),u=require("../../vc-util/Dom/dynamicCSS.js"),y=require("../canUseDom.js"),m=require("./theme/Theme.js"),l=new WeakMap;function s(n){let e=l.get(n)||"";return e||(Object.keys(n).forEach(r=>{const o=n[r];e+=r,o instanceof m.default?e+=o.id:o&&typeof o=="object"?e+=s(o):e+=o}),l.set(n,e)),e}function v(n,e){return p.default(`${e}_${s(n)}`)}const i=`random-${Date.now()}-${Math.random()}`.replace(/\./g,""),d="_bAmBoO_";function S(n,e,r){var o,c;if(y.default()){u.updateCSS(n,i);const t=document.createElement("div");t.style.position="fixed",t.style.left="0",t.style.top="0",e==null||e(t),document.body.appendChild(t),process.env.NODE_ENV!=="production"&&(t.innerHTML="Test",t.style.zIndex="9999999");const f=r?r(t):(o=getComputedStyle(t).content)===null||o===void 0?void 0:o.includes(d);return(c=t.parentNode)===null||c===void 0||c.removeChild(t),u.removeCSS(i),f}return!1}let a;function b(){return a===void 0&&(a=S(`@layer ${i} { .${i} { content: "${d}"!important; } }`,n=>{n.className=i})),a}exports.flattenToken=s;exports.supportLayer=b;exports.token2key=v;
;