(self.webpackChunk_components_admin_1_1_41=self.webpackChunk_components_admin_1_1_41||[]).push([[437,2818],{2818(e,t,n){"use strict";n.r(t),n.d(t,{FontLoader:()=>d,default:()=>u,loadFont:()=>f});var r=n(13732),o=n.n(r),a=n(98139),i=n.n(a);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s.apply(null,arguments)}const c=["type","colorful","className","fontClassName","size","style","prefix"],l=e=>(/^[1-9]+[0-9]*]*$/.test(e.toString())&&(e+="px"),e),u=e=>{let t=e.type,n=e.colorful,r=void 0!==n&&n,a=e.className,u=e.fontClassName,f=void 0===u?"iconfont":u,d=e.size,p=e.style,m=e.prefix,v=void 0===m?"":m,y=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,c);const h=((e,t,n)=>"icon-"===t||""===t?(n?"icon-color-":"icon-")+e.replace(/^icon-(color-)?/,""):t+e)(t,v,r),g=i()(a,{[f]:!r,["".concat(f,"--color")]:r},h),b=Object.assign({},p,d?{fontSize:l(d)}:{});return r?o().createElement("svg",s({},y,{className:g,style:b}),o().createElement("use",{xlinkHref:"#".concat(h),style:{pointerEvents:"none"}})):o().createElement("i",s({},y,{className:g,style:b}))},f=async(e,t)=>{if(!document.head.querySelector('script[href*="'.concat(t||(e=>{const t=(e=e.replace(/\/+$/,"")).split("/").filter(e=>""!==e);return t[t.length-1]})(e),'"]'))){if(/.js$/.test(e)){const t=document.createElement("script");return t.src=e,await new Promise((e,n)=>{t.addEventListener("load",()=>{e()}),t.addEventListener("error",e=>{n(e)}),document.head.append(t)}),()=>{document.head.removeChild(t)}}if(/.css$/.test(e)){const t=document.createElement("link");return t.setAttribute("href",e),t.setAttribute("rel","stylesheet"),await new Promise((e,n)=>{t.addEventListener("load",()=>{e()}),t.addEventListener("error",e=>{n(e)}),document.head.append(t)}),()=>{document.head.removeChild(t)}}throw new Error("Unable to load font type")}},d=e=>{let t=e.path,n=e.name;return(0,r.useEffect)(()=>{const e=f(t,n);return()=>{e.then(e=>{e&&e()})}},[t,n]),null}},98139(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,a(n)))}return e}function a(e){if("string"===typeof e||"number"===typeof e)return e;if("object"!==typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=i(t,n));return t}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()}}]);
//# sourceMappingURL=2818.f58e394f.chunk.js.map