@univer-cli/resource-library 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +1 -1
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- const _0x1987b4=_0x8792;(function(_0x390b18,_0x509e4d){const _0x415cda=_0x8792,_0x4c1945=_0x390b18();while(!![]){try{const _0x529934=parseInt(_0x415cda(0x156))/0x1+parseInt(_0x415cda(0x1d4))/0x2+-parseInt(_0x415cda(0x1c7))/0x3*(-parseInt(_0x415cda(0x140))/0x4)+parseInt(_0x415cda(0x1ae))/0x5*(parseInt(_0x415cda(0x176))/0x6)+-parseInt(_0x415cda(0x1d6))/0x7+parseInt(_0x415cda(0x19f))/0x8*(parseInt(_0x415cda(0x16d))/0x9)+parseInt(_0x415cda(0x1a0))/0xa*(-parseInt(_0x415cda(0x1d9))/0xb);if(_0x529934===_0x509e4d)break;else _0x4c1945['push'](_0x4c1945['shift']());}catch(_0xfea372){_0x4c1945['push'](_0x4c1945['shift']());}}}(_0x4647,0x6e649));import{randomUUID as _0x13f68d}from'node:crypto';import{mkdir as _0x13b129,readFile as _0x23b84d,readdir as _0x2a572b,rename as _0x202301,rm as _0x12636a,stat as _0x55e9ef,unlink as _0x256e70,writeFile as _0x309679}from'node:fs/promises';import{dirname as _0xb78523,isAbsolute as _0x5b3c5f,join as _0x4e56ee,parse as _0x3b9698,resolve as _0x17a86b}from'node:path';import{readFileSync as _0x1b185f}from'node:fs';var h=class extends Error{[_0x1987b4(0x160)];[_0x1987b4(0x178)];constructor(_0x41d980,_0x16fde1,_0x346601,_0x45b6f0){const _0x37f39d=_0x1987b4;super(_0x16fde1,_0x45b6f0),this[_0x37f39d(0x160)]=_0x41d980,this[_0x37f39d(0x178)]=_0x346601,this['name']=_0x37f39d(0x1ca);}};function g(_0x5c7533){return _0x5c7533 instanceof h;}var _=/^[A-Za-z0-9._-]+$/u,v=0xff,y=0x4;function b(_0x2b7880){const _0x504969=_0x1987b4;return _[_0x504969(0x1bc)](_0x2b7880)&&_0x2b7880!=='.'&&_0x2b7880!=='..';}function x(_0x21fc65){const _0x219a2d=_0x1987b4;if(!b(_0x21fc65)||_0x21fc65['startsWith']('-')||_0x21fc65[_0x219a2d(0x1d5)]('--')||_0x21fc65[_0x219a2d(0x1bf)]>v)throw new h(_0x219a2d(0x180),_0x219a2d(0x14e)+_0x21fc65+_0x219a2d(0x136));}function S(_0x4222e7){const _0x4b3c05=_0x1987b4;if(!b(_0x4222e7)||_0x4222e7[_0x4b3c05(0x1bf)]+y>v)throw new h('resource-invalid-resource-id',_0x4b3c05(0x175)+_0x4222e7+_0x4b3c05(0x129));}function C(_0xbd1089){const _0x5a6a35=_0x1987b4;let _0x2dd15b=_0xbd1089['split']('/');if(_0x2dd15b['length']!==0x2||_0x2dd15b[0x0]===''||_0x2dd15b[0x1]==='')throw new h(_0x5a6a35(0x154),_0x5a6a35(0x120)+_0xbd1089+_0x5a6a35(0x19e),_0xbd1089);let _0x2c9353=_0x2dd15b[0x0],_0xce6673=_0x2dd15b[0x1];return x(_0x2c9353),S(_0xce6673),{'registryId':_0x2c9353,'resourceId':_0xce6673};}function ee(_0x3c72c7,_0x5eddf5){return x(_0x3c72c7),S(_0x5eddf5),_0x3c72c7+'/'+_0x5eddf5;}function w(_0x4d1a4b){const _0x2235a4=_0x1987b4;let {registryId:_0x44b4f2,resourceId:_0x19f43d}=C(_0x4d1a4b),_0x1043f4=_0x44b4f2+'--'+_0x19f43d+_0x2235a4(0x17e);if(_0x1043f4[_0x2235a4(0x1bf)]>v)throw new h(_0x2235a4(0x1bb),_0x2235a4(0x131)+v+_0x2235a4(0x12c),_0x4d1a4b);return _0x1043f4;}function T(_0x24c598){const _0x49fe2e=_0x1987b4;return new h(_0x49fe2e(0x17f),'Invalid\x20resource\x20manifest:\x20'+_0x24c598);}function E(_0x524b05,_0x5b47c0){const _0x1a415d=_0x1987b4;if(typeof _0x524b05!=_0x1a415d(0x1cc)||!_0x524b05||Array['isArray'](_0x524b05))throw T(_0x5b47c0+'\x20must\x20be\x20an\x20object.');return _0x524b05;}function D(_0x4e732d,_0x1ad8d4,_0x41a34d=!0x1){const _0x593b7=_0x1987b4;if(_0x41a34d&&_0x4e732d===void 0x0)return[];if(!Array[_0x593b7(0x198)](_0x4e732d))throw T(_0x1ad8d4+_0x593b7(0x174));return _0x4e732d;}function O(_0x5d18ac,_0x250146){const _0x18554a=_0x1987b4;if(typeof _0x5d18ac!='string'||_0x5d18ac==='')throw T(_0x250146+_0x18554a(0x157));return _0x5d18ac;}function k(_0x5bb176,_0x5993df,_0x38d18d=!0x1){return D(_0x5bb176,_0x5993df,_0x38d18d)['map']((_0x405e1b,_0x5a0fdb)=>O(_0x405e1b,_0x5993df+'['+_0x5a0fdb+']'));}function A(_0x26e95b,_0x406d7a){const _0x32ee2f=_0x1987b4;return D(_0x26e95b,_0x406d7a,!0x0)[_0x32ee2f(0x15b)]((_0x2fe1ea,_0x332298)=>{if(typeof _0x2fe1ea!='string')throw T(_0x406d7a+'['+_0x332298+']\x20must\x20be\x20a\x20string.');return _0x2fe1ea;})[_0x32ee2f(0x1b8)](_0x4f8c33=>_0x4f8c33!=='');}function j(_0x3f5b3c,_0xf0983c){const _0x13c944=_0x1987b4;if(typeof _0x3f5b3c!='number'||!Number['isFinite'](_0x3f5b3c))throw T(_0xf0983c+_0x13c944(0x197));return _0x3f5b3c;}function M(_0x2a6962,_0x38cab0){const _0x3ba3a5=_0x1987b4;if(typeof _0x2a6962!=_0x3ba3a5(0x1c3))throw T(_0x38cab0+_0x3ba3a5(0x1b3));return _0x2a6962;}function N(_0x30af7f,_0x190562,_0xfef78b){const _0x389b73=_0x1987b4;if(typeof _0x30af7f==_0x389b73(0x15a)&&_0x30af7f!=='')return _0x30af7f;let _0x2419eb=E(_0x30af7f,_0x190562),_0x3b372f=_0xfef78b===void 0x0?void 0x0:_0x2419eb[_0xfef78b];if(typeof _0x3b372f==_0x389b73(0x15a)&&_0x3b372f!=='')return _0x3b372f;let _0x4c8e68=_0x2419eb[_0x389b73(0x186)];if(typeof _0x4c8e68==_0x389b73(0x15a)&&_0x4c8e68!=='')return _0x4c8e68;let _0x5d5a96=Object[_0x389b73(0x182)](_0x2419eb)[_0x389b73(0x1dc)](_0x16c9fd=>typeof _0x16c9fd==_0x389b73(0x15a)&&_0x16c9fd!=='');if(_0x5d5a96!==void 0x0)return _0x5d5a96;throw T(_0x190562+'\x20contains\x20no\x20usable\x20localized\x20text.');}function _0x8792(_0x294e1b,_0x354913){_0x294e1b=_0x294e1b-0x11e;const _0x4647a6=_0x4647();let _0x879282=_0x4647a6[_0x294e1b];return _0x879282;}function P(_0x46040a,_0x401b0f,_0x3e6731){const _0x38e403=_0x1987b4;try{_0x3e6731==='registry'?x(_0x46040a):S(_0x46040a);}catch(_0x5e1dfb){throw T(_0x401b0f+':\x20'+(_0x5e1dfb instanceof Error?_0x5e1dfb[_0x38e403(0x16a)]:String(_0x5e1dfb)));}}function F(_0xb72fe3,_0x30d959,_0x33bd88){const _0x2ebc62=_0x1987b4;let _0x218c3b=new Map();for(let [_0xc9d8c9,_0x54d659]of D(_0xb72fe3,_0x30d959,!0x0)[_0x2ebc62(0x14d)]()){let _0x1524b7=E(_0x54d659,_0x30d959+'['+_0xc9d8c9+']'),_0x4ed6c4=O(_0x1524b7['id'],_0x30d959+'['+_0xc9d8c9+'].id');if(P(_0x4ed6c4,_0x30d959+'['+_0xc9d8c9+_0x2ebc62(0x194),_0x2ebc62(0x1cf)),_0x218c3b['has'](_0x4ed6c4))throw T(_0x2ebc62(0x171)+_0x30d959+_0x2ebc62(0x191)+_0x4ed6c4+'\x22.');_0x218c3b[_0x2ebc62(0x121)](_0x4ed6c4,N(_0x1524b7[_0x2ebc62(0x1e0)],_0x30d959+'['+_0xc9d8c9+_0x2ebc62(0x126),_0x33bd88));}return _0x218c3b;}function I(_0x263031,_0x49d3c5){const _0x4c05b7=_0x1987b4;let _0x1917a3=E(_0x263031[_0x4c05b7(0x1d8)],_0x49d3c5+'.intrinsicSize'),_0x3d21c4=j(_0x1917a3[_0x4c05b7(0x185)],_0x49d3c5+_0x4c05b7(0x164)),_0x450969=j(_0x1917a3[_0x4c05b7(0x150)],_0x49d3c5+_0x4c05b7(0x139));if(_0x3d21c4<=0x0||_0x450969<=0x0)throw T(_0x49d3c5+'.intrinsicSize\x20must\x20be\x20positive.');return{'width':_0x3d21c4,'height':_0x450969};}function L(_0x53ad90,_0x3de3b9){const _0x5df92f=_0x1987b4;if(_0x53ad90[_0x5df92f(0x190)]!==_0x5df92f(0x1cb))throw T(_0x3de3b9+_0x5df92f(0x17c));if(_0x53ad90[_0x5df92f(0x128)]!=='reference')throw T(_0x3de3b9+_0x5df92f(0x1bd));let _0x1e7e3b=E(_0x53ad90[_0x5df92f(0x1a9)],_0x3de3b9+_0x5df92f(0x123));if(_0x1e7e3b['type']!=='url')throw T(_0x3de3b9+'.source.type\x20must\x20be\x20\x22url\x22.');let _0x5ac088=O(_0x1e7e3b['value'],_0x3de3b9+'.source.value'),_0x196cb9;try{_0x196cb9=new URL(_0x5ac088);}catch{throw T(_0x3de3b9+_0x5df92f(0x144));}if(_0x196cb9[_0x5df92f(0x158)]!==_0x5df92f(0x147))throw T(_0x3de3b9+_0x5df92f(0x18a));return _0x5ac088;}function R(_0x188b06){const _0x469c8a=_0x1987b4;return _0x188b06[_0x469c8a(0x17b)](_0x469c8a(0x18f))[_0x469c8a(0x127)]()['trim']()[_0x469c8a(0x12a)](/\s+/gu,'\x20');}function z(_0x324d30){const _0xca312a=_0x1987b4;let _0x26a28b=E(_0x324d30,'manifest'),_0xf5cf0=new Map(),_0x22548a=new Map(),_0x367089=[],_0x3c60cc=[],_0x28781e=new Set(),_0xbbc1d1=0x0;for(let [_0x28c8af,_0x18c420]of D(_0x26a28b[_0xca312a(0x124)],'manifest.registrations')[_0xca312a(0x14d)]()){let _0x5e748f=E(E(_0x18c420,_0xca312a(0x179)+_0x28c8af+']')[_0xca312a(0x1e3)],'registrations['+_0x28c8af+_0xca312a(0x1a8)),_0xebc9af=O(_0x5e748f[_0xca312a(0x15f)],_0xca312a(0x179)+_0x28c8af+'].input.registryId');if(P(_0xebc9af,_0xca312a(0x179)+_0x28c8af+_0xca312a(0x1ab),'registry'),_0xf5cf0['has'](_0xebc9af))throw T(_0xca312a(0x1d2)+_0xebc9af+'\x22.');let _0xbba36b=_0x5e748f[_0xca312a(0x1dd)]===void 0x0?void 0x0:O(_0x5e748f[_0xca312a(0x1dd)],'registrations['+_0x28c8af+_0xca312a(0x1c6)),_0x3c697a=F(_0x5e748f['groups'],'registrations['+_0x28c8af+_0xca312a(0x1c4),_0xbba36b),_0x48fa39=F(_0x5e748f[_0xca312a(0x1d1)],_0xca312a(0x179)+_0x28c8af+_0xca312a(0x169),_0xbba36b),_0x1629bc=[];for(let [_0x2e360f,_0x484db6]of D(_0x5e748f[_0xca312a(0x13a)],_0xca312a(0x179)+_0x28c8af+_0xca312a(0x155))['entries']()){let _0x1c1c2c=_0xca312a(0x179)+_0x28c8af+_0xca312a(0x16e)+_0x2e360f+']',_0x28faf5=E(_0x484db6,_0x1c1c2c),_0x1f12a9=O(_0x28faf5['id'],_0x1c1c2c+_0xca312a(0x1b1));P(_0x1f12a9,_0x1c1c2c+_0xca312a(0x1b1),'resource');let _0x59a406=ee(_0xebc9af,_0x1f12a9);if(_0x22548a[_0xca312a(0x1b5)](_0x59a406))throw T(_0xca312a(0x1c0)+_0x59a406+'\x22.');let _0x371a92;try{_0x371a92=w(_0x59a406);}catch(_0x1c7eea){throw T(_0x1c1c2c+':\x20'+(_0x1c7eea instanceof Error?_0x1c7eea[_0xca312a(0x16a)]:String(_0x1c7eea)));}if(_0x28781e[_0xca312a(0x1b5)](_0x371a92))throw T(_0xca312a(0x1e1)+_0x371a92+'\x22.');_0x28781e[_0xca312a(0x1b6)](_0x371a92);let _0x139f16=_0x28faf5[_0xca312a(0x18b)]===void 0x0?void 0x0:O(_0x28faf5['groupId'],_0x1c1c2c+_0xca312a(0x167));if(_0x139f16!==void 0x0&&!_0x3c697a[_0xca312a(0x1b5)](_0x139f16))throw T(_0x1c1c2c+'.groupId\x20references\x20unknown\x20group\x20\x22'+_0x139f16+'\x22.');let _0x1a0dfa=k(_0x28faf5['tagIds'],_0x1c1c2c+_0xca312a(0x1be),!0x0);for(let _0x1d6dc3 of _0x1a0dfa)if(!_0x48fa39['has'](_0x1d6dc3))throw T(_0x1c1c2c+_0xca312a(0x13f)+_0x1d6dc3+'\x22.');let _0x18f879=A(_0x28faf5[_0xca312a(0x16c)],_0x1c1c2c+'.keywords'),_0x3be77c=N(_0x28faf5['name'],_0x1c1c2c+_0xca312a(0x1d3),_0xbba36b),_0x10964d=_0x28faf5[_0xca312a(0x199)]===void 0x0?void 0x0:N(_0x28faf5[_0xca312a(0x199)],_0x1c1c2c+'.description',_0xbba36b),_0x4e09f9=_0x139f16===void 0x0?null:{'id':_0x139f16,'label':_0x3c697a[_0xca312a(0x132)](_0x139f16)},_0x1e439d=_0x1a0dfa['map'](_0x4cc493=>({'id':_0x4cc493,'label':_0x48fa39['get'](_0x4cc493)})),_0x281500=E(_0x28faf5[_0xca312a(0x1db)],_0x1c1c2c+'.payload'),_0x400b92=_0x28faf5[_0xca312a(0x1a3)]===void 0x0?null:j(_0x28faf5[_0xca312a(0x1a3)],_0x1c1c2c+_0xca312a(0x13c)),_0x3088f4=M(_0x281500[_0xca312a(0x1a1)],_0x1c1c2c+_0xca312a(0x170)),_0x3f7f33={'handle':_0x59a406,'registryId':_0xebc9af,'id':_0x1f12a9,'name':_0x3be77c,..._0x10964d===void 0x0?{}:{'description':_0x10964d},'group':_0x4e09f9,'tags':_0x1e439d,'keywords':_0x18f879,'order':_0x400b92,'intrinsicSize':I(_0x281500,_0x1c1c2c+'.payload'),'colorEditable':_0x3088f4,'sourceUrl':L(_0x281500,_0x1c1c2c+_0xca312a(0x146)),'registrationIndex':_0x28c8af,'resourceIndex':_0x2e360f,'globalIndex':_0xbbc1d1,'searchText':R([_0x3be77c,_0x10964d,_0x4e09f9?.[_0xca312a(0x1e0)],..._0x1e439d[_0xca312a(0x15b)](_0x48cf10=>_0x48cf10[_0xca312a(0x1e0)]),..._0x18f879][_0xca312a(0x1b8)](_0x372495=>_0x372495!==void 0x0)['join']('\x20'))};_0xbbc1d1++,_0x1629bc[_0xca312a(0x1b4)](_0x3f7f33),_0x3c60cc[_0xca312a(0x1b4)](_0x3f7f33),_0x22548a[_0xca312a(0x121)](_0x59a406,_0x3f7f33);}let _0xd87f6c={'id':_0xebc9af,'groups':_0x3c697a,'tags':_0x48fa39,'resources':_0x1629bc};_0x367089['push'](_0xd87f6c),_0xf5cf0['set'](_0xebc9af,_0xd87f6c);}if(_0x367089[_0xca312a(0x1bf)]===0x0)throw T(_0xca312a(0x1a4));return{'registries':_0x367089,'registryById':_0xf5cf0,'resourceByHandle':_0x22548a,'resources':_0x3c60cc};}function B(_0x40ddfc,_0x143261){const _0x41bc10=_0x1987b4;C(_0x143261);let _0x47826e=_0x40ddfc[_0x41bc10(0x1af)]['get'](_0x143261);if(_0x47826e===void 0x0)throw new h(_0x41bc10(0x1a5),_0x41bc10(0x17a)+_0x143261+'\x22;\x20try\x20resources\x20find\x20<query>.',_0x143261);return _0x47826e;}function te(_0x5c6371){const _0x327dd3=_0x1987b4;return _0x5c6371[_0x327dd3(0x1ac)][_0x327dd3(0x15b)](_0x3e1641=>({'id':_0x3e1641['id'],'resourceCount':_0x3e1641[_0x327dd3(0x13a)][_0x327dd3(0x1bf)],'groupCount':_0x3e1641[_0x327dd3(0x173)][_0x327dd3(0x162)],'tagCount':_0x3e1641['tags'][_0x327dd3(0x162)],'colorEditableCount':_0x3e1641[_0x327dd3(0x13a)]['filter'](_0x1955b7=>_0x1955b7['colorEditable'])[_0x327dd3(0x1bf)]}));}function ne(_0x2a5edf){const _0x597a6e=_0x1987b4;return{'handle':_0x2a5edf[_0x597a6e(0x178)],'registryId':_0x2a5edf['registryId'],'id':_0x2a5edf['id'],'name':_0x2a5edf[_0x597a6e(0x135)],'group':_0x2a5edf['group'],'tags':_0x2a5edf[_0x597a6e(0x1d1)],'keywords':_0x2a5edf['keywords'],'order':_0x2a5edf[_0x597a6e(0x1a3)],'intrinsicSize':_0x2a5edf[_0x597a6e(0x1d8)],'colorEditable':_0x2a5edf['colorEditable']};}function re(_0x5c60eb,_0x266dc8){const _0x4ce186=_0x1987b4;let _0x1db71f=(_0x5c60eb[_0x4ce186(0x1a3)]??_0x5c60eb[_0x4ce186(0x15d)])-(_0x266dc8[_0x4ce186(0x1a3)]??_0x266dc8['globalIndex']);if(_0x1db71f!==0x0)return _0x1db71f;let _0x10e3f3=_0x5c60eb[_0x4ce186(0x1df)]-_0x266dc8[_0x4ce186(0x1df)];if(_0x10e3f3!==0x0)return _0x10e3f3;let _0x5bf9b0=_0x5c60eb[_0x4ce186(0x149)]-_0x266dc8[_0x4ce186(0x149)];return _0x5bf9b0===0x0?_0x5c60eb[_0x4ce186(0x178)]['localeCompare'](_0x266dc8['handle']):_0x5bf9b0;}function ie(_0x26fe82,_0x140929){const _0x37e2a2=_0x1987b4;let _0x41ca17=_0x140929[_0x37e2a2(0x161)][_0x37e2a2(0x15b)](R)[_0x37e2a2(0x1b8)](_0x885606=>_0x885606!=='');if(_0x41ca17[_0x37e2a2(0x1bf)]===0x0)throw new h(_0x37e2a2(0x1c9),_0x37e2a2(0x19b));let _0x21b583=new Set(_0x140929[_0x37e2a2(0x1ac)]??[]);for(let _0x40bb5b of _0x21b583)if(!_0x26fe82[_0x37e2a2(0x143)][_0x37e2a2(0x1b5)](_0x40bb5b))throw new h(_0x37e2a2(0x16b),_0x37e2a2(0x138)+_0x40bb5b+'\x22.');let _0x396a92=_0x140929[_0x37e2a2(0x1b2)]??_0x26fe82[_0x37e2a2(0x13a)][_0x37e2a2(0x1bf)];if(!Number[_0x37e2a2(0x19a)](_0x396a92)||_0x396a92<0x1)throw new h(_0x37e2a2(0x137),_0x37e2a2(0x19c)+_0x396a92+'\x22.');let _0x1a1dcf=_0x26fe82[_0x37e2a2(0x13a)][_0x37e2a2(0x1b8)](_0x4d4a58=>_0x21b583[_0x37e2a2(0x162)]===0x0||_0x21b583[_0x37e2a2(0x1b5)](_0x4d4a58[_0x37e2a2(0x15f)]))[_0x37e2a2(0x1b8)](_0x5d9b27=>_0x41ca17['some'](_0x36c13e=>_0x5d9b27['searchText'][_0x37e2a2(0x1d5)](_0x36c13e)))['sort'](re);return{'resources':_0x1a1dcf[_0x37e2a2(0x1d7)](0x0,_0x396a92)['map'](ne),'total':_0x1a1dcf['length']};}function V(_0x4b0549){const _0x1d9230=_0x1987b4;return/^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[^]*?-->\s*)*<svg(?:\s|>)/iu[_0x1d9230(0x1bc)](_0x4b0549);}function H(_0x32430d,_0x117253){const _0x1c4974=_0x1987b4;return g(_0x117253)?{'handle':_0x32430d,'code':_0x117253[_0x1c4974(0x160)],'message':_0x117253[_0x1c4974(0x16a)]}:{'handle':_0x32430d,'code':'resource-export-failed','message':_0x117253 instanceof Error?_0x117253[_0x1c4974(0x16a)]:String(_0x117253)};}var U=class{['options'];[_0x1987b4(0x1b9)];constructor(_0xe86320){const _0x71f152=_0x1987b4;this[_0x71f152(0x1aa)]=_0xe86320,this['catalog']=z(_0xe86320[_0x71f152(0x181)]);}get[_0x1987b4(0x12e)](){const _0x1f556a=_0x1987b4;return this[_0x1f556a(0x1aa)]['cache'][_0x1f556a(0x195)];}[_0x1987b4(0x1ce)](){const _0x1bb149=_0x1987b4;return te(this[_0x1bb149(0x1b9)]);}[_0x1987b4(0x1dc)](_0x103dce){return ie(this['catalog'],_0x103dce);}async[_0x1987b4(0x12b)](_0x570e37){const _0x4cfee3=_0x1987b4;let _0x2c6fcb=B(this[_0x4cfee3(0x1b9)],_0x570e37[_0x4cfee3(0x178)]),_0xf8d8f6=await this[_0x4cfee3(0x1aa)]['cache'][_0x4cfee3(0x12b)](_0x570e37['handle']);if(_0xf8d8f6!==void 0x0&&V(_0xf8d8f6))return{'handle':_0x570e37[_0x4cfee3(0x178)],'svg':_0xf8d8f6};let _0x3be789;try{_0x3be789=await this[_0x4cfee3(0x1aa)][_0x4cfee3(0x1c1)][_0x4cfee3(0x13d)](_0x2c6fcb['sourceUrl']);}catch(_0x4244dc){throw g(_0x4244dc)?_0x4244dc:new h(_0x4cfee3(0x14a),_0x4cfee3(0x16f)+_0x570e37['handle']+_0x4cfee3(0x192)+(_0x4244dc instanceof Error?_0x4244dc[_0x4cfee3(0x16a)]:String(_0x4244dc)),_0x570e37[_0x4cfee3(0x178)],{'cause':_0x4244dc});}if(!V(_0x3be789))throw new h('resource-invalid-svg','Downloaded\x20resource\x20\x22'+_0x570e37[_0x4cfee3(0x178)]+'\x22\x20is\x20not\x20an\x20SVG\x20document.',_0x570e37['handle']);return await this[_0x4cfee3(0x1aa)][_0x4cfee3(0x1da)][_0x4cfee3(0x1b0)](_0x570e37[_0x4cfee3(0x178)],_0x3be789),{'handle':_0x570e37['handle'],'svg':_0x3be789};}async['export'](_0x535a4b){const _0x2da59e=_0x1987b4;let _0x5b1611=[],_0xf858b0=[];for(let _0x1d9368 of _0x535a4b['handles'])try{let {svg:_0x22c591}=await this[_0x2da59e(0x12b)]({'handle':_0x1d9368}),_0x4fa4e6=await this[_0x2da59e(0x1aa)][_0x2da59e(0x13b)][_0x2da59e(0x1b0)](_0x535a4b['destination'],w(_0x1d9368),_0x22c591);_0x5b1611[_0x2da59e(0x1b4)]({'handle':_0x1d9368,'path':_0x4fa4e6});}catch(_0x82820b){_0xf858b0[_0x2da59e(0x1b4)](H(_0x1d9368,_0x82820b));}return{'exported':_0x5b1611,'failed':_0xf858b0};}async[_0x1987b4(0x15e)](){const _0x5f38d7=_0x1987b4;return await this[_0x5f38d7(0x1aa)][_0x5f38d7(0x1da)][_0x5f38d7(0x148)]();}};function W(_0x26e2a6){return new U(_0x26e2a6);}function G(_0x18bc78){const _0x2c7d38=_0x1987b4;return _0x18bc78 instanceof Error&&_0x2c7d38(0x160)in _0x18bc78;}function K(_0x577b27){const _0x43a342=_0x1987b4;let _0x263530=_0x17a86b(_0x577b27);if(!_0x5b3c5f(_0x577b27)||_0x263530===_0x3b9698(_0x263530)[_0x43a342(0x196)])throw new h(_0x43a342(0x177),_0x43a342(0x1de)+_0x577b27+'\x22.');return _0x263530;}async function q(_0x32e8d5){const _0x284a2f=_0x1987b4;let _0x177252;try{_0x177252=await _0x2a572b(_0x32e8d5,{'withFileTypes':!0x0});}catch(_0x2d9277){if(G(_0x2d9277)&&_0x2d9277[_0x284a2f(0x160)]==='ENOENT')return{'resourceCount':0x0,'byteCount':0x0};throw _0x2d9277;}let _0x4c2101=0x0,_0x371397=0x0;for(let _0x458b87 of _0x177252){let _0x1f3476=_0x4e56ee(_0x32e8d5,_0x458b87[_0x284a2f(0x135)]);if(_0x458b87['isDirectory']()){let _0x2f37e1=await q(_0x1f3476);_0x4c2101+=_0x2f37e1[_0x284a2f(0x189)],_0x371397+=_0x2f37e1['byteCount'];}else{if(_0x458b87['isFile']()&&_0x458b87[_0x284a2f(0x135)][_0x284a2f(0x13e)](_0x284a2f(0x17e))){let _0x4d53b6=await _0x55e9ef(_0x1f3476);_0x4c2101++,_0x371397+=_0x4d53b6[_0x284a2f(0x162)];}}}return{'resourceCount':_0x4c2101,'byteCount':_0x371397};}function _0x4647(){const _0x444c79=['values','Resource\x20response\x20is\x20not\x20an\x20SVG\x20document.','Resource\x20URL\x20must\x20use\x20HTTPS.','width','en-US','resource-download-too-many-redirects','maxRedirects','resourceCount','.source.value\x20must\x20use\x20HTTPS.','groupId','releaseLock','byteLength','manifestPath','NFKC','type','\x20ID\x20\x22','\x22:\x20','parse','].id','location','root','\x20must\x20be\x20a\x20finite\x20number.','isArray','description','isInteger','Resource\x20search\x20needs\x20at\x20least\x20one\x20non-empty\x20query.','Resource\x20search\x20limit\x20must\x20be\x20a\x20positive\x20integer;\x20received\x20\x22','Resource\x20request\x20followed\x20too\x20many\x20redirects;\x20maximum\x20','\x22;\x20expected\x20<registryId>/<resourceId>.','185760UtjhWM','213790gLKMHR','colorEditable','aborted','order','registrations\x20must\x20not\x20be\x20empty.','resource-not-found','utf-8','done','].input','source','options','].input.registryId','registries','timeoutMs','47005ePWzNG','resourceByHandle','write','.id','limit','\x20must\x20be\x20a\x20boolean.','push','has','add','cacheRoot','filter','catalog','\x20without\x20a\x20Location\x20header.','resource-export-filename-too-long','test','.storagePolicy\x20must\x20be\x20\x22reference\x22.','.tagIds','length','Duplicate\x20resource\x20handle\x20\x22','downloader','path','boolean','].input.groups','Resource\x20server\x20returned\x20HTTP\x20','].input.defaultLocale','4953lnyXxV','catch','resource-query-empty','ResourceLibraryError','image','object','resource-download-insecure-redirect','listRegistries','resource','fetchImpl','tags','Duplicate\x20registry\x20ID\x20\x22','.name','709676mGHOhE','includes','3210424CtlmPl','slice','intrinsicSize','649pZvhaq','cache','payload','find','defaultLocale','Resource\x20cache\x20root\x20must\x20be\x20an\x20absolute,\x20dedicated\x20directory\x20below\x20the\x20filesystem\x20root;\x20received\x20\x22','registrationIndex','label','Duplicate\x20export\x20filename\x20\x22','signal','input','maxBytes','value','Invalid\x20resource\x20handle\x20\x22','set','manual','.source','registrations','resource-download-insecure','].label','toLowerCase','storagePolicy','\x22:\x20expected\x20filesystem-safe\x20characters.','replace','read','\x20bytes.','body','cacheLocation','resource-download-invalid-redirect','concat','Resource\x20export\x20filename\x20exceeds\x20','get','Resource\x20response\x20is\x20not\x20valid\x20UTF-8.','status','name','\x22:\x20expected\x20an\x20addressable\x20filesystem-safe\x20component\x20without\x20\x22--\x22.','resource-limit-invalid','Unknown\x20resource\x20registry\x20\x22','.intrinsicSize.height','resources','output','.order','download','endsWith','.tagIds\x20references\x20unknown\x20tag\x20\x22','732UDZELA','cancel','pid','registryById','.source.value\x20must\x20be\x20a\x20URL.','getReader','.payload','https:','clear','resourceIndex','resource-download-failed','resource-download-too-large','resource-download-invalid-utf8','entries','Invalid\x20registry\x20ID\x20\x22','resource-download-timeout','height','utf8','Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.','url','resource-invalid-handle','].input.resources','613825aJFKvD','\x20must\x20be\x20a\x20non-empty\x20string.','protocol','decode','string','map','.resource-','globalIndex','clearCache','registryId','code','queries','size','resource-download-http','.intrinsicSize.width','text','\x20ms.','.groupId','content-length','].input.tags','message','resource-registry-not-found','keywords','36ChoAhh','].input.resources[','Failed\x20to\x20download\x20\x22','.payload.colorEditable','Duplicate\x20','Resource\x20server\x20returned\x20an\x20invalid\x20redirect\x20URL.','groups','\x20must\x20be\x20an\x20array.','Invalid\x20resource\x20ID\x20\x22','516ovVbRR','resource-cache-root-invalid','handle','registrations[','Unknown\x20resource\x20\x22','normalize','.type\x20must\x20be\x20\x22image\x22.','isFinite','.svg','resource-manifest-invalid','resource-invalid-registry-id','manifest'];_0x4647=function(){return _0x444c79;};return _0x4647();}var J=class{[_0x1987b4(0x195)];constructor(_0x163a7){const _0x56070a=_0x1987b4;this[_0x56070a(0x195)]=K(_0x163a7);}[_0x1987b4(0x1c2)](_0x3ae75f){const _0x5d2257=_0x1987b4;let {registryId:_0xdde485,resourceId:_0x4d8483}=C(_0x3ae75f);return _0x4e56ee(this[_0x5d2257(0x195)],_0xdde485,_0x4d8483+_0x5d2257(0x17e));}async[_0x1987b4(0x12b)](_0x549ef7){const _0x27747e=_0x1987b4;try{return await _0x23b84d(this[_0x27747e(0x1c2)](_0x549ef7),_0x27747e(0x151));}catch(_0x4cbb72){if(G(_0x4cbb72)&&_0x4cbb72[_0x27747e(0x160)]==='ENOENT')return;throw _0x4cbb72;}}async[_0x1987b4(0x1b0)](_0x4ddfc8,_0x2201f8){const _0xe862f6=_0x1987b4;let _0x258c61=this[_0xe862f6(0x1c2)](_0x4ddfc8);await _0x13b129(_0xb78523(_0x258c61),{'recursive':!0x0});let _0x5da5ed=_0x4e56ee(_0xb78523(_0x258c61),_0xe862f6(0x15c)+process[_0xe862f6(0x142)]+'-'+_0x13f68d()+'.tmp');try{await _0x309679(_0x5da5ed,_0x2201f8,{'encoding':_0xe862f6(0x151),'mode':0x180}),await _0x202301(_0x5da5ed,_0x258c61);}catch(_0x5e0f06){throw await _0x256e70(_0x5da5ed)[_0xe862f6(0x1c8)](()=>void 0x0),_0x5e0f06;}}async[_0x1987b4(0x148)](){const _0x5b470f=_0x1987b4;let _0x31f5c1=await q(this[_0x5b470f(0x195)]);return await _0x12636a(this[_0x5b470f(0x195)],{'force':!0x0,'recursive':!0x0}),{'path':this[_0x5b470f(0x195)],..._0x31f5c1};}},Y=class{async[_0x1987b4(0x1b0)](_0x4d37f0,_0x238284,_0x58e87b){const _0x481bd5=_0x1987b4;await _0x13b129(_0x4d37f0,{'recursive':!0x0});let _0x12f7f7=_0x4e56ee(_0x4d37f0,_0x238284);return await _0x309679(_0x12f7f7,_0x58e87b,_0x481bd5(0x151)),_0x12f7f7;}},X=0x7530,ae=0xa00000,oe=0xa,se=new Set([0x12d,0x12e,0x12f,0x133,0x134]);function Z(_0x5131a3){const _0x3bee18=_0x1987b4;return new h(_0x3bee18(0x14b),'Resource\x20exceeds\x20the\x20maximum\x20size\x20of\x20'+_0x5131a3+_0x3bee18(0x12c));}async function ce(_0x559b36,_0x1c5eeb){const _0x197eaf=_0x1987b4;let _0x333a3e=Number(_0x559b36['headers']['get'](_0x197eaf(0x168)));if(Number[_0x197eaf(0x17d)](_0x333a3e)&&_0x333a3e>_0x1c5eeb)throw Z(_0x1c5eeb);if(_0x559b36[_0x197eaf(0x12d)]===null){let _0x1a9658=await _0x559b36[_0x197eaf(0x165)]();if(Buffer['byteLength'](_0x1a9658)>_0x1c5eeb)throw Z(_0x1c5eeb);return _0x1a9658;}let _0x53be4b=_0x559b36[_0x197eaf(0x12d)][_0x197eaf(0x145)](),_0x48d1fb=[],_0x2e7ebd=0x0;try{for(;;){let _0x4dca3f=await _0x53be4b[_0x197eaf(0x12b)]();if(_0x4dca3f[_0x197eaf(0x1a7)])break;if(_0x2e7ebd+=_0x4dca3f[_0x197eaf(0x11f)][_0x197eaf(0x18d)],_0x2e7ebd>_0x1c5eeb)throw await _0x53be4b[_0x197eaf(0x141)]()['catch'](()=>void 0x0),Z(_0x1c5eeb);_0x48d1fb[_0x197eaf(0x1b4)](_0x4dca3f['value']);}}finally{_0x53be4b[_0x197eaf(0x18c)]();}try{return new TextDecoder(_0x197eaf(0x1a6),{'fatal':!0x0})[_0x197eaf(0x159)](Buffer[_0x197eaf(0x130)](_0x48d1fb,_0x2e7ebd));}catch{throw new h(_0x197eaf(0x14c),_0x197eaf(0x133));}}var Q=class{['fetchImpl'];[_0x1987b4(0x1ad)];['maxBytes'];['maxRedirects'];constructor(_0x527133={}){const _0x232201=_0x1987b4;this[_0x232201(0x1d0)]=_0x527133['fetch']??fetch,this['timeoutMs']=_0x527133[_0x232201(0x1ad)]??X,this['maxBytes']=_0x527133['maxBytes']??ae,this[_0x232201(0x188)]=_0x527133[_0x232201(0x188)]??oe;}async[_0x1987b4(0x13d)](_0x15c6ef){const _0x16ce78=_0x1987b4;let _0x307a66=new URL(_0x15c6ef);if(_0x307a66[_0x16ce78(0x158)]!==_0x16ce78(0x147))throw new h(_0x16ce78(0x125),_0x16ce78(0x184));let _0x4e8b76=new AbortController(),_0x1e4e3b=setTimeout(()=>_0x4e8b76['abort'](),this[_0x16ce78(0x1ad)]);try{let _0x1d35a7=_0x307a66;for(let _0xc7d779=0x0;;_0xc7d779++){let _0x2316e8=await this['fetchImpl'](_0x1d35a7,{'redirect':_0x16ce78(0x122),'signal':_0x4e8b76['signal']});if(se[_0x16ce78(0x1b5)](_0x2316e8['status'])){if(_0xc7d779>=this[_0x16ce78(0x188)])throw new h(_0x16ce78(0x187),_0x16ce78(0x19d)+this[_0x16ce78(0x188)]+'.');let _0x5a4412=_0x2316e8['headers']['get']('location');if(_0x5a4412===null)throw new h('resource-download-invalid-redirect','Resource\x20server\x20returned\x20HTTP\x20'+_0x2316e8[_0x16ce78(0x134)]+_0x16ce78(0x1ba));let _0x159380;try{_0x159380=new URL(_0x5a4412,_0x1d35a7);}catch{throw new h(_0x16ce78(0x12f),_0x16ce78(0x172));}if(_0x159380[_0x16ce78(0x158)]!==_0x16ce78(0x147))throw new h(_0x16ce78(0x1cd),_0x16ce78(0x152));_0x1d35a7=_0x159380;continue;}if(!_0x2316e8['ok'])throw new h(_0x16ce78(0x163),_0x16ce78(0x1c5)+_0x2316e8[_0x16ce78(0x134)]+'.');if(_0x2316e8[_0x16ce78(0x153)]!==''&&new URL(_0x2316e8[_0x16ce78(0x153)])[_0x16ce78(0x158)]!=='https:')throw new h(_0x16ce78(0x1cd),'Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.');let _0x1d28fa=await ce(_0x2316e8,this[_0x16ce78(0x11e)]);if(!V(_0x1d28fa))throw new h('resource-download-invalid-svg',_0x16ce78(0x183));return _0x1d28fa;}}catch(_0x49aaac){throw _0x4e8b76[_0x16ce78(0x1e2)][_0x16ce78(0x1a2)]?new h(_0x16ce78(0x14f),'Resource\x20download\x20timed\x20out\x20after\x20'+this[_0x16ce78(0x1ad)]+_0x16ce78(0x166)):_0x49aaac;}finally{clearTimeout(_0x1e4e3b);}}};function $(_0x548a53){const _0x1b354f=_0x1987b4;try{return JSON[_0x1b354f(0x193)](_0x1b185f(_0x548a53,_0x1b354f(0x151)));}catch(_0x4f7771){throw new h('resource-manifest-read-failed','Cannot\x20read\x20resource\x20manifest\x20at\x20'+_0x548a53+':\x20'+(_0x4f7771 instanceof Error?_0x4f7771[_0x1b354f(0x16a)]:String(_0x4f7771)),void 0x0,{'cause':_0x4f7771});}}function le(_0x1d91d6){const _0x1fb081=_0x1987b4;let _0x719b37;return()=>(_0x719b37??=W({'manifest':$(_0x1d91d6[_0x1fb081(0x18e)]),'cache':new J(_0x1d91d6[_0x1fb081(0x1b7)]),'downloader':new Q(_0x1d91d6[_0x1fb081(0x1c1)]),'output':new Y()}),_0x719b37);}export{J as FilesystemResourceCache,Y as FilesystemResourceOutput,Q as HttpsResourceDownloader,h as ResourceLibraryError,le as createNodeResourceLibraryFactory,W as createResourceLibrary,g as isResourceLibraryError,$ as loadResourceManifestFromPath,K as validateResourceCacheRoot};
1
+ const _0x42915f=_0x31b2;(function(_0x242363,_0x338307){const _0x4a229d=_0x31b2,_0x315c85=_0x242363();while(!![]){try{const _0x237c8e=-parseInt(_0x4a229d(0x1eb))/0x1+-parseInt(_0x4a229d(0x17e))/0x2*(parseInt(_0x4a229d(0x192))/0x3)+-parseInt(_0x4a229d(0x1bb))/0x4*(parseInt(_0x4a229d(0x15f))/0x5)+-parseInt(_0x4a229d(0x1a5))/0x6+parseInt(_0x4a229d(0x1a8))/0x7+-parseInt(_0x4a229d(0x19e))/0x8+parseInt(_0x4a229d(0x1f6))/0x9*(parseInt(_0x4a229d(0x171))/0xa);if(_0x237c8e===_0x338307)break;else _0x315c85['push'](_0x315c85['shift']());}catch(_0x3af0b5){_0x315c85['push'](_0x315c85['shift']());}}}(_0x1316,0xc40bc));import{randomUUID as _0x36e8de}from'node:crypto';import{mkdir as _0xb63cd8,readFile as _0x374256,readdir as _0x286657,rename as _0x5a37a9,rm as _0x54662b,stat as _0x4f3d8d,unlink as _0x47950c,writeFile as _0x301011}from'node:fs/promises';import{dirname as _0x51bff7,isAbsolute as _0x168354,join as _0x177d01,parse as _0x4fb604,resolve as _0x36f1f9}from'node:path';import{readFileSync as _0x1c66fd}from'node:fs';var h=class extends Error{[_0x42915f(0x150)];[_0x42915f(0x200)];constructor(_0x495a0d,_0x4ee28d,_0x329c18,_0x42405d){const _0x41082e=_0x42915f;super(_0x4ee28d,_0x42405d),this[_0x41082e(0x150)]=_0x495a0d,this[_0x41082e(0x200)]=_0x329c18,this[_0x41082e(0x1a6)]=_0x41082e(0x1c8);}};function g(_0x424223){return _0x424223 instanceof h;}var _=/^[A-Za-z0-9._-]+$/u,v=0xff,y=0x4;function b(_0xbdf9ed){const _0x363283=_0x42915f;return _[_0x363283(0x13a)](_0xbdf9ed)&&_0xbdf9ed!=='.'&&_0xbdf9ed!=='..';}function x(_0x199b7c){const _0x270142=_0x42915f;if(!b(_0x199b7c)||_0x199b7c[_0x270142(0x1e5)]('-')||_0x199b7c[_0x270142(0x188)]('--')||_0x199b7c[_0x270142(0x170)]>v)throw new h(_0x270142(0x152),_0x270142(0x1e0)+_0x199b7c+_0x270142(0x1df));}function S(_0x4e8d0d){const _0x3f12e2=_0x42915f;if(!b(_0x4e8d0d)||_0x4e8d0d[_0x3f12e2(0x170)]+y>v)throw new h(_0x3f12e2(0x1c4),_0x3f12e2(0x164)+_0x4e8d0d+_0x3f12e2(0x1af));}function _0x1316(){const _0xa66bd1=['Failed\x20to\x20download\x20\x22','number','en-US','resource-download-too-many-redirects','manifest.registrations','fetch','catch','code','label','resource-invalid-registry-id','location','].input.groups','endsWith','abort','.source.value','Cannot\x20read\x20resource\x20manifest\x20at\x20','cacheLocation','.source','\x20must\x20be\x20a\x20non-empty\x20string.','type','description','downloader','85DitpUN','tagIds','localeCompare','Resource\x20response\x20is\x20not\x20valid\x20UTF-8.','resource-registry-not-found','Invalid\x20resource\x20ID\x20\x22','resource-download-invalid-svg','split','resource-invalid-handle','groups','height','Invalid\x20resource\x20handle\x20\x22','handles','isFinite','Resource\x20download\x20timed\x20out\x20after\x20','values','keywords','length','10vPAiLs','resourceByHandle','payload','tags','\x22;\x20try\x20resources\x20find\x20<query>.','storagePolicy','\x20ID\x20\x22','join','].input.defaultLocale','manual','protocol','done','Resource\x20exceeds\x20the\x20maximum\x20size\x20of\x20','1666478rVHlRN','write','slice','entries','].input.resources[','Invalid\x20resource\x20manifest:\x20','globalIndex','download','utf-8','registrationIndex','includes','cache','add','resource-cache-root-invalid','aborted','filter','registrations[','].input.resources','\x22:\x20','.resource-','3wfKpIh','.payload','cancel','.keywords','clearCache','resource-not-found','sourceUrl','searchText','image','resource-download-insecure','resources','ENOENT','3002936OruDXO','\x20without\x20a\x20Location\x20header.','Resource\x20server\x20returned\x20an\x20invalid\x20redirect\x20URL.','utf8','timeoutMs','releaseLock','maxBytes','6911934EieVmo','name','listRegistries','4285085yLdYau','catalog','registry','.tagIds\x20references\x20unknown\x20tag\x20\x22','clear','group','path','\x22:\x20expected\x20filesystem-safe\x20characters.','resource-query-empty','Duplicate\x20export\x20filename\x20\x22','Duplicate\x20registry\x20ID\x20\x22','toLowerCase','.payload.colorEditable','.order','cacheRoot','decode','].id','Resource\x20server\x20returned\x20HTTP\x20','isInteger','89988lNZwMB','body','input','map','.type\x20must\x20be\x20\x22image\x22.','width','Duplicate\x20resource\x20handle\x20\x22','.intrinsicSize.height','Resource\x20URL\x20must\x20use\x20HTTPS.','resource-invalid-resource-id','size','resource-download-failed','.source.type\x20must\x20be\x20\x22url\x22.','ResourceLibraryError','\x20contains\x20no\x20usable\x20localized\x20text.','source','status','.name','options','getReader','resource-download-invalid-redirect','registries','https:','text','.svg','resource','Resource\x20response\x20is\x20not\x20an\x20SVG\x20document.','queries','object','resource-export-failed','\x22\x20is\x20not\x20an\x20SVG\x20document.','.description','trim','maxRedirects','byteCount','\x20must\x20be\x20an\x20array.','\x22:\x20expected\x20an\x20addressable\x20filesystem-safe\x20component\x20without\x20\x22--\x22.','Invalid\x20registry\x20ID\x20\x22','resource-download-invalid-utf8','groupId','.tmp','].input.registryId','startsWith','read','fetchImpl','\x20bytes.','resourceIndex','registryId','580434CSRnqh','.intrinsicSize.width','message','defaultLocale','parse','resource-download-too-large','reference','get','.tagIds','colorEditable','limit','31628943TjMuun','resource-manifest-invalid','set','Resource\x20export\x20filename\x20exceeds\x20','Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.','Downloaded\x20resource\x20\x22','isFile','has','\x22;\x20expected\x20<registryId>/<resourceId>.','isArray','handle','headers','signal','manifest','test','Unknown\x20resource\x20registry\x20\x22','].input','.id','push','intrinsicSize','registrations\x20must\x20not\x20be\x20empty.','string','find','resource-download-insecure-redirect','url','order','root','value','Resource\x20search\x20limit\x20must\x20be\x20a\x20positive\x20integer;\x20received\x20\x22'];_0x1316=function(){return _0xa66bd1;};return _0x1316();}function C(_0x4f59dc){const _0x5a0404=_0x42915f;let _0x25a7db=_0x4f59dc[_0x5a0404(0x166)]('/');if(_0x25a7db[_0x5a0404(0x170)]!==0x2||_0x25a7db[0x0]===''||_0x25a7db[0x1]==='')throw new h(_0x5a0404(0x167),_0x5a0404(0x16a)+_0x4f59dc+_0x5a0404(0x1fe),_0x4f59dc);let _0xff37c4=_0x25a7db[0x0],_0x2f24f2=_0x25a7db[0x1];return x(_0xff37c4),S(_0x2f24f2),{'registryId':_0xff37c4,'resourceId':_0x2f24f2};}function ee(_0x16be88,_0x519cba){return x(_0x16be88),S(_0x519cba),_0x16be88+'/'+_0x519cba;}function w(_0xe0adcf){const _0x29ce2e=_0x42915f;let {registryId:_0x1ffe49,resourceId:_0x70495b}=C(_0xe0adcf),_0x5cc988=_0x1ffe49+'--'+_0x70495b+_0x29ce2e(0x1d3);if(_0x5cc988[_0x29ce2e(0x170)]>v)throw new h('resource-export-filename-too-long',_0x29ce2e(0x1f9)+v+_0x29ce2e(0x1e8),_0xe0adcf);return _0x5cc988;}function T(_0x15251e){const _0x179bcd=_0x42915f;return new h(_0x179bcd(0x1f7),_0x179bcd(0x183)+_0x15251e);}function E(_0x30b781,_0x486cb6){const _0x331e6b=_0x42915f;if(typeof _0x30b781!=_0x331e6b(0x1d7)||!_0x30b781||Array[_0x331e6b(0x1ff)](_0x30b781))throw T(_0x486cb6+'\x20must\x20be\x20an\x20object.');return _0x30b781;}function D(_0x57529e,_0x1387bc,_0x4e16a6=!0x1){const _0x277244=_0x42915f;if(_0x4e16a6&&_0x57529e===void 0x0)return[];if(!Array['isArray'](_0x57529e))throw T(_0x1387bc+_0x277244(0x1de));return _0x57529e;}function O(_0x18feb1,_0x6de1ac){const _0xd5bd21=_0x42915f;if(typeof _0x18feb1!='string'||_0x18feb1==='')throw T(_0x6de1ac+_0xd5bd21(0x15b));return _0x18feb1;}function k(_0x585cc1,_0x59f380,_0x14c9cb=!0x1){const _0x26c753=_0x42915f;return D(_0x585cc1,_0x59f380,_0x14c9cb)[_0x26c753(0x1be)]((_0x1f9125,_0x1213d6)=>O(_0x1f9125,_0x59f380+'['+_0x1213d6+']'));}function A(_0x73ef1e,_0x4e1b21){const _0x1cf831=_0x42915f;return D(_0x73ef1e,_0x4e1b21,!0x0)[_0x1cf831(0x1be)]((_0x189335,_0x479275)=>{const _0x1d686a=_0x1cf831;if(typeof _0x189335!=_0x1d686a(0x141))throw T(_0x4e1b21+'['+_0x479275+']\x20must\x20be\x20a\x20string.');return _0x189335;})['filter'](_0x5ad2ff=>_0x5ad2ff!=='');}function j(_0x5b82bf,_0x537012){const _0x161dad=_0x42915f;if(typeof _0x5b82bf!=_0x161dad(0x14a)||!Number[_0x161dad(0x16c)](_0x5b82bf))throw T(_0x537012+'\x20must\x20be\x20a\x20finite\x20number.');return _0x5b82bf;}function M(_0x513daf,_0x5392f8){if(typeof _0x513daf!='boolean')throw T(_0x5392f8+'\x20must\x20be\x20a\x20boolean.');return _0x513daf;}function N(_0x3a0ab4,_0x403d0a,_0xd397ec){const _0x384036=_0x42915f;if(typeof _0x3a0ab4==_0x384036(0x141)&&_0x3a0ab4!=='')return _0x3a0ab4;let _0x4093d1=E(_0x3a0ab4,_0x403d0a),_0x1dd053=_0xd397ec===void 0x0?void 0x0:_0x4093d1[_0xd397ec];if(typeof _0x1dd053==_0x384036(0x141)&&_0x1dd053!=='')return _0x1dd053;let _0x269de9=_0x4093d1[_0x384036(0x14b)];if(typeof _0x269de9==_0x384036(0x141)&&_0x269de9!=='')return _0x269de9;let _0x49241a=Object[_0x384036(0x16e)](_0x4093d1)[_0x384036(0x142)](_0x22841c=>typeof _0x22841c==_0x384036(0x141)&&_0x22841c!=='');if(_0x49241a!==void 0x0)return _0x49241a;throw T(_0x403d0a+_0x384036(0x1c9));}function P(_0x3966b1,_0x202ae9,_0x2f7efa){const _0x4e0650=_0x42915f;try{_0x2f7efa===_0x4e0650(0x1aa)?x(_0x3966b1):S(_0x3966b1);}catch(_0x4e6a65){throw T(_0x202ae9+':\x20'+(_0x4e6a65 instanceof Error?_0x4e6a65[_0x4e0650(0x1ed)]:String(_0x4e6a65)));}}function F(_0x1dce1e,_0x2aeeaa,_0x50f01c){const _0x3df04a=_0x42915f;let _0xcd6a70=new Map();for(let [_0xe2a218,_0x2735e8]of D(_0x1dce1e,_0x2aeeaa,!0x0)['entries']()){let _0x517144=E(_0x2735e8,_0x2aeeaa+'['+_0xe2a218+']'),_0x5b4163=O(_0x517144['id'],_0x2aeeaa+'['+_0xe2a218+'].id');if(P(_0x5b4163,_0x2aeeaa+'['+_0xe2a218+_0x3df04a(0x1b8),_0x3df04a(0x1d4)),_0xcd6a70[_0x3df04a(0x1fd)](_0x5b4163))throw T('Duplicate\x20'+_0x2aeeaa+_0x3df04a(0x177)+_0x5b4163+'\x22.');_0xcd6a70['set'](_0x5b4163,N(_0x517144[_0x3df04a(0x151)],_0x2aeeaa+'['+_0xe2a218+'].label',_0x50f01c));}return _0xcd6a70;}function I(_0x31cc1e,_0xec43b0){const _0x1dc738=_0x42915f;let _0x460caf=E(_0x31cc1e['intrinsicSize'],_0xec43b0+'.intrinsicSize'),_0x52cbcc=j(_0x460caf[_0x1dc738(0x1c0)],_0xec43b0+_0x1dc738(0x1ec)),_0x3d4bbd=j(_0x460caf[_0x1dc738(0x169)],_0xec43b0+_0x1dc738(0x1c2));if(_0x52cbcc<=0x0||_0x3d4bbd<=0x0)throw T(_0xec43b0+'.intrinsicSize\x20must\x20be\x20positive.');return{'width':_0x52cbcc,'height':_0x3d4bbd};}function L(_0x2d2fb3,_0x2bccac){const _0x5ee46c=_0x42915f;if(_0x2d2fb3['type']!==_0x5ee46c(0x19a))throw T(_0x2bccac+_0x5ee46c(0x1bf));if(_0x2d2fb3[_0x5ee46c(0x176)]!==_0x5ee46c(0x1f1))throw T(_0x2bccac+'.storagePolicy\x20must\x20be\x20\x22reference\x22.');let _0x4b9b1b=E(_0x2d2fb3[_0x5ee46c(0x1ca)],_0x2bccac+_0x5ee46c(0x15a));if(_0x4b9b1b[_0x5ee46c(0x15c)]!==_0x5ee46c(0x144))throw T(_0x2bccac+_0x5ee46c(0x1c7));let _0x37dff3=O(_0x4b9b1b[_0x5ee46c(0x147)],_0x2bccac+_0x5ee46c(0x157)),_0x24d992;try{_0x24d992=new URL(_0x37dff3);}catch{throw T(_0x2bccac+'.source.value\x20must\x20be\x20a\x20URL.');}if(_0x24d992[_0x5ee46c(0x17b)]!==_0x5ee46c(0x1d1))throw T(_0x2bccac+'.source.value\x20must\x20use\x20HTTPS.');return _0x37dff3;}function R(_0xc6d7c4){const _0x49f9a4=_0x42915f;return _0xc6d7c4['normalize']('NFKC')[_0x49f9a4(0x1b3)]()[_0x49f9a4(0x1db)]()['replace'](/\s+/gu,'\x20');}function z(_0xfd7da){const _0x240a05=_0x42915f;let _0x3e6e69=E(_0xfd7da,_0x240a05(0x139)),_0x1fed52=new Map(),_0x4a2c2a=new Map(),_0x2f4654=[],_0x264fc5=[],_0x1829ad=new Set(),_0x5af8da=0x0;for(let [_0x137796,_0x314dcc]of D(_0x3e6e69['registrations'],_0x240a05(0x14d))['entries']()){let _0x15f64a=E(E(_0x314dcc,'registrations['+_0x137796+']')[_0x240a05(0x1bd)],_0x240a05(0x18e)+_0x137796+_0x240a05(0x13c)),_0x304a09=O(_0x15f64a['registryId'],_0x240a05(0x18e)+_0x137796+_0x240a05(0x1e4));if(P(_0x304a09,_0x240a05(0x18e)+_0x137796+'].input.registryId','registry'),_0x1fed52[_0x240a05(0x1fd)](_0x304a09))throw T(_0x240a05(0x1b2)+_0x304a09+'\x22.');let _0x56e676=_0x15f64a[_0x240a05(0x1ee)]===void 0x0?void 0x0:O(_0x15f64a[_0x240a05(0x1ee)],_0x240a05(0x18e)+_0x137796+_0x240a05(0x179)),_0x162d2a=F(_0x15f64a[_0x240a05(0x168)],'registrations['+_0x137796+_0x240a05(0x154),_0x56e676),_0x31d5ab=F(_0x15f64a[_0x240a05(0x174)],'registrations['+_0x137796+'].input.tags',_0x56e676),_0x193013=[];for(let [_0x3d4309,_0x326568]of D(_0x15f64a[_0x240a05(0x19c)],_0x240a05(0x18e)+_0x137796+_0x240a05(0x18f))[_0x240a05(0x181)]()){let _0x1df3bf=_0x240a05(0x18e)+_0x137796+_0x240a05(0x182)+_0x3d4309+']',_0x223f41=E(_0x326568,_0x1df3bf),_0x738e04=O(_0x223f41['id'],_0x1df3bf+'.id');P(_0x738e04,_0x1df3bf+_0x240a05(0x13d),'resource');let _0x12c295=ee(_0x304a09,_0x738e04);if(_0x4a2c2a[_0x240a05(0x1fd)](_0x12c295))throw T(_0x240a05(0x1c1)+_0x12c295+'\x22.');let _0x23d04b;try{_0x23d04b=w(_0x12c295);}catch(_0x3d8c96){throw T(_0x1df3bf+':\x20'+(_0x3d8c96 instanceof Error?_0x3d8c96['message']:String(_0x3d8c96)));}if(_0x1829ad[_0x240a05(0x1fd)](_0x23d04b))throw T(_0x240a05(0x1b1)+_0x23d04b+'\x22.');_0x1829ad[_0x240a05(0x18a)](_0x23d04b);let _0x2db942=_0x223f41[_0x240a05(0x1e2)]===void 0x0?void 0x0:O(_0x223f41['groupId'],_0x1df3bf+'.groupId');if(_0x2db942!==void 0x0&&!_0x162d2a[_0x240a05(0x1fd)](_0x2db942))throw T(_0x1df3bf+'.groupId\x20references\x20unknown\x20group\x20\x22'+_0x2db942+'\x22.');let _0x4a6b67=k(_0x223f41[_0x240a05(0x160)],_0x1df3bf+_0x240a05(0x1f3),!0x0);for(let _0x3b54a9 of _0x4a6b67)if(!_0x31d5ab['has'](_0x3b54a9))throw T(_0x1df3bf+_0x240a05(0x1ab)+_0x3b54a9+'\x22.');let _0x5c9e86=A(_0x223f41['keywords'],_0x1df3bf+_0x240a05(0x195)),_0x480dac=N(_0x223f41['name'],_0x1df3bf+_0x240a05(0x1cc),_0x56e676),_0x51ea67=_0x223f41[_0x240a05(0x15d)]===void 0x0?void 0x0:N(_0x223f41[_0x240a05(0x15d)],_0x1df3bf+_0x240a05(0x1da),_0x56e676),_0x20989e=_0x2db942===void 0x0?null:{'id':_0x2db942,'label':_0x162d2a[_0x240a05(0x1f2)](_0x2db942)},_0x4076d7=_0x4a6b67[_0x240a05(0x1be)](_0x538d84=>({'id':_0x538d84,'label':_0x31d5ab[_0x240a05(0x1f2)](_0x538d84)})),_0x13255c=E(_0x223f41[_0x240a05(0x173)],_0x1df3bf+_0x240a05(0x193)),_0xebee5d=_0x223f41[_0x240a05(0x145)]===void 0x0?null:j(_0x223f41[_0x240a05(0x145)],_0x1df3bf+_0x240a05(0x1b5)),_0x5be8cd=M(_0x13255c[_0x240a05(0x1f4)],_0x1df3bf+_0x240a05(0x1b4)),_0x4f4e0c={'handle':_0x12c295,'registryId':_0x304a09,'id':_0x738e04,'name':_0x480dac,..._0x51ea67===void 0x0?{}:{'description':_0x51ea67},'group':_0x20989e,'tags':_0x4076d7,'keywords':_0x5c9e86,'order':_0xebee5d,'intrinsicSize':I(_0x13255c,_0x1df3bf+_0x240a05(0x193)),'colorEditable':_0x5be8cd,'sourceUrl':L(_0x13255c,_0x1df3bf+_0x240a05(0x193)),'registrationIndex':_0x137796,'resourceIndex':_0x3d4309,'globalIndex':_0x5af8da,'searchText':R([_0x480dac,_0x51ea67,_0x20989e?.[_0x240a05(0x151)],..._0x4076d7[_0x240a05(0x1be)](_0x63cef3=>_0x63cef3[_0x240a05(0x151)]),..._0x5c9e86][_0x240a05(0x18d)](_0x1f44fe=>_0x1f44fe!==void 0x0)[_0x240a05(0x178)]('\x20'))};_0x5af8da++,_0x193013[_0x240a05(0x13e)](_0x4f4e0c),_0x264fc5[_0x240a05(0x13e)](_0x4f4e0c),_0x4a2c2a[_0x240a05(0x1f8)](_0x12c295,_0x4f4e0c);}let _0x26d326={'id':_0x304a09,'groups':_0x162d2a,'tags':_0x31d5ab,'resources':_0x193013};_0x2f4654[_0x240a05(0x13e)](_0x26d326),_0x1fed52[_0x240a05(0x1f8)](_0x304a09,_0x26d326);}if(_0x2f4654[_0x240a05(0x170)]===0x0)throw T(_0x240a05(0x140));return{'registries':_0x2f4654,'registryById':_0x1fed52,'resourceByHandle':_0x4a2c2a,'resources':_0x264fc5};}function B(_0x85e43e,_0x3e25d0){const _0x2495b8=_0x42915f;C(_0x3e25d0);let _0x41f60e=_0x85e43e[_0x2495b8(0x172)][_0x2495b8(0x1f2)](_0x3e25d0);if(_0x41f60e===void 0x0)throw new h(_0x2495b8(0x197),'Unknown\x20resource\x20\x22'+_0x3e25d0+_0x2495b8(0x175),_0x3e25d0);return _0x41f60e;}function te(_0x2f2034){const _0x5b270e=_0x42915f;return _0x2f2034['registries'][_0x5b270e(0x1be)](_0x38f017=>({'id':_0x38f017['id'],'resourceCount':_0x38f017['resources']['length'],'groupCount':_0x38f017[_0x5b270e(0x168)]['size'],'tagCount':_0x38f017[_0x5b270e(0x174)][_0x5b270e(0x1c5)],'colorEditableCount':_0x38f017[_0x5b270e(0x19c)]['filter'](_0x159e7c=>_0x159e7c[_0x5b270e(0x1f4)])['length']}));}function ne(_0x292e0c){const _0xfbabab=_0x42915f;return{'handle':_0x292e0c[_0xfbabab(0x200)],'registryId':_0x292e0c['registryId'],'id':_0x292e0c['id'],'name':_0x292e0c['name'],'group':_0x292e0c[_0xfbabab(0x1ad)],'tags':_0x292e0c[_0xfbabab(0x174)],'keywords':_0x292e0c[_0xfbabab(0x16f)],'order':_0x292e0c[_0xfbabab(0x145)],'intrinsicSize':_0x292e0c[_0xfbabab(0x13f)],'colorEditable':_0x292e0c['colorEditable']};}function re(_0x1ca0fc,_0x264bb2){const _0x3f63fe=_0x42915f;let _0x3352e9=(_0x1ca0fc[_0x3f63fe(0x145)]??_0x1ca0fc[_0x3f63fe(0x184)])-(_0x264bb2[_0x3f63fe(0x145)]??_0x264bb2[_0x3f63fe(0x184)]);if(_0x3352e9!==0x0)return _0x3352e9;let _0x2dc640=_0x1ca0fc[_0x3f63fe(0x187)]-_0x264bb2[_0x3f63fe(0x187)];if(_0x2dc640!==0x0)return _0x2dc640;let _0x53e761=_0x1ca0fc['resourceIndex']-_0x264bb2[_0x3f63fe(0x1e9)];return _0x53e761===0x0?_0x1ca0fc[_0x3f63fe(0x200)][_0x3f63fe(0x161)](_0x264bb2[_0x3f63fe(0x200)]):_0x53e761;}function ie(_0x429a95,_0x1be0dc){const _0x27f133=_0x42915f;let _0x2fe570=_0x1be0dc[_0x27f133(0x1d6)]['map'](R)['filter'](_0x2d100f=>_0x2d100f!=='');if(_0x2fe570['length']===0x0)throw new h(_0x27f133(0x1b0),'Resource\x20search\x20needs\x20at\x20least\x20one\x20non-empty\x20query.');let _0xeff01b=new Set(_0x1be0dc[_0x27f133(0x1d0)]??[]);for(let _0x478892 of _0xeff01b)if(!_0x429a95['registryById']['has'](_0x478892))throw new h(_0x27f133(0x163),_0x27f133(0x13b)+_0x478892+'\x22.');let _0x142b5d=_0x1be0dc[_0x27f133(0x1f5)]??_0x429a95[_0x27f133(0x19c)][_0x27f133(0x170)];if(!Number[_0x27f133(0x1ba)](_0x142b5d)||_0x142b5d<0x1)throw new h('resource-limit-invalid',_0x27f133(0x148)+_0x142b5d+'\x22.');let _0x43a752=_0x429a95[_0x27f133(0x19c)][_0x27f133(0x18d)](_0x2d66ee=>_0xeff01b[_0x27f133(0x1c5)]===0x0||_0xeff01b['has'](_0x2d66ee[_0x27f133(0x1ea)]))[_0x27f133(0x18d)](_0x3aa416=>_0x2fe570['some'](_0x284e33=>_0x3aa416[_0x27f133(0x199)][_0x27f133(0x188)](_0x284e33)))['sort'](re);return{'resources':_0x43a752[_0x27f133(0x180)](0x0,_0x142b5d)[_0x27f133(0x1be)](ne),'total':_0x43a752[_0x27f133(0x170)]};}function V(_0x3c770d){const _0x5b02b0=_0x42915f;return/^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[^]*?-->\s*)*<svg(?:\s|>)/iu[_0x5b02b0(0x13a)](_0x3c770d);}function H(_0x25dc3a,_0x39bbee){const _0xe040f4=_0x42915f;return g(_0x39bbee)?{'handle':_0x25dc3a,'code':_0x39bbee[_0xe040f4(0x150)],'message':_0x39bbee[_0xe040f4(0x1ed)]}:{'handle':_0x25dc3a,'code':_0xe040f4(0x1d8),'message':_0x39bbee instanceof Error?_0x39bbee[_0xe040f4(0x1ed)]:String(_0x39bbee)};}var U=class{['options'];[_0x42915f(0x1a9)];constructor(_0x5500c3){const _0x523469=_0x42915f;this['options']=_0x5500c3,this[_0x523469(0x1a9)]=z(_0x5500c3[_0x523469(0x139)]);}get[_0x42915f(0x159)](){const _0x189507=_0x42915f;return this[_0x189507(0x1cd)][_0x189507(0x189)]['location'];}[_0x42915f(0x1a7)](){const _0x33bca7=_0x42915f;return te(this[_0x33bca7(0x1a9)]);}[_0x42915f(0x142)](_0x104e79){return ie(this['catalog'],_0x104e79);}async[_0x42915f(0x1e6)](_0x5acbf3){const _0x585216=_0x42915f;let _0x4a1e33=B(this[_0x585216(0x1a9)],_0x5acbf3[_0x585216(0x200)]),_0x467273=await this[_0x585216(0x1cd)][_0x585216(0x189)][_0x585216(0x1e6)](_0x5acbf3['handle']);if(_0x467273!==void 0x0&&V(_0x467273))return{'handle':_0x5acbf3[_0x585216(0x200)],'svg':_0x467273};let _0x1385bd;try{_0x1385bd=await this[_0x585216(0x1cd)][_0x585216(0x15e)][_0x585216(0x185)](_0x4a1e33[_0x585216(0x198)]);}catch(_0x4dde46){throw g(_0x4dde46)?_0x4dde46:new h(_0x585216(0x1c6),_0x585216(0x149)+_0x5acbf3[_0x585216(0x200)]+_0x585216(0x190)+(_0x4dde46 instanceof Error?_0x4dde46['message']:String(_0x4dde46)),_0x5acbf3['handle'],{'cause':_0x4dde46});}if(!V(_0x1385bd))throw new h('resource-invalid-svg',_0x585216(0x1fb)+_0x5acbf3[_0x585216(0x200)]+_0x585216(0x1d9),_0x5acbf3[_0x585216(0x200)]);return await this[_0x585216(0x1cd)][_0x585216(0x189)][_0x585216(0x17f)](_0x5acbf3[_0x585216(0x200)],_0x1385bd),{'handle':_0x5acbf3['handle'],'svg':_0x1385bd};}async['export'](_0x5d9a29){const _0x322362=_0x42915f;let _0x4da2cf=[],_0x40212c=[];for(let _0x1544ab of _0x5d9a29[_0x322362(0x16b)])try{let {svg:_0x3408b3}=await this[_0x322362(0x1e6)]({'handle':_0x1544ab}),_0x1a3e43=await this[_0x322362(0x1cd)]['output'][_0x322362(0x17f)](_0x5d9a29['destination'],w(_0x1544ab),_0x3408b3);_0x4da2cf[_0x322362(0x13e)]({'handle':_0x1544ab,'path':_0x1a3e43});}catch(_0x342489){_0x40212c[_0x322362(0x13e)](H(_0x1544ab,_0x342489));}return{'exported':_0x4da2cf,'failed':_0x40212c};}async[_0x42915f(0x196)](){const _0x1cefff=_0x42915f;return await this[_0x1cefff(0x1cd)][_0x1cefff(0x189)][_0x1cefff(0x1ac)]();}};function W(_0x2960f9){return new U(_0x2960f9);}function _0x31b2(_0x429e8a,_0x25f404){_0x429e8a=_0x429e8a-0x139;const _0x1316e4=_0x1316();let _0x31b20a=_0x1316e4[_0x429e8a];return _0x31b20a;}function G(_0x4dc467){const _0x27b9d2=_0x42915f;return _0x4dc467 instanceof Error&&_0x27b9d2(0x150)in _0x4dc467;}function K(_0x512d81){const _0xf0a2d0=_0x42915f;let _0x4c85df=_0x36f1f9(_0x512d81);if(!_0x168354(_0x512d81)||_0x4c85df===_0x4fb604(_0x4c85df)[_0xf0a2d0(0x146)])throw new h(_0xf0a2d0(0x18b),'Resource\x20cache\x20root\x20must\x20be\x20an\x20absolute,\x20dedicated\x20directory\x20below\x20the\x20filesystem\x20root;\x20received\x20\x22'+_0x512d81+'\x22.');return _0x4c85df;}async function q(_0x51e232){const _0x4f0160=_0x42915f;let _0x8d1041;try{_0x8d1041=await _0x286657(_0x51e232,{'withFileTypes':!0x0});}catch(_0x15d501){if(G(_0x15d501)&&_0x15d501['code']===_0x4f0160(0x19d))return{'resourceCount':0x0,'byteCount':0x0};throw _0x15d501;}let _0x551706=0x0,_0x1ce62f=0x0;for(let _0xe378c2 of _0x8d1041){let _0x53449a=_0x177d01(_0x51e232,_0xe378c2[_0x4f0160(0x1a6)]);if(_0xe378c2['isDirectory']()){let _0x526af6=await q(_0x53449a);_0x551706+=_0x526af6['resourceCount'],_0x1ce62f+=_0x526af6[_0x4f0160(0x1dd)];}else{if(_0xe378c2[_0x4f0160(0x1fc)]()&&_0xe378c2[_0x4f0160(0x1a6)][_0x4f0160(0x155)](_0x4f0160(0x1d3))){let _0x25b9da=await _0x4f3d8d(_0x53449a);_0x551706++,_0x1ce62f+=_0x25b9da[_0x4f0160(0x1c5)];}}}return{'resourceCount':_0x551706,'byteCount':_0x1ce62f};}var J=class{[_0x42915f(0x153)];constructor(_0x1dcca5){this['location']=K(_0x1dcca5);}[_0x42915f(0x1ae)](_0x111480){const _0x524631=_0x42915f;let {registryId:_0x32e97b,resourceId:_0x3df895}=C(_0x111480);return _0x177d01(this[_0x524631(0x153)],_0x32e97b,_0x3df895+_0x524631(0x1d3));}async[_0x42915f(0x1e6)](_0x478e27){const _0x4f4a1a=_0x42915f;try{return await _0x374256(this[_0x4f4a1a(0x1ae)](_0x478e27),_0x4f4a1a(0x1a1));}catch(_0x4fb005){if(G(_0x4fb005)&&_0x4fb005[_0x4f4a1a(0x150)]==='ENOENT')return;throw _0x4fb005;}}async['write'](_0x160728,_0x2f674d){const _0x5f4ed1=_0x42915f;let _0x2b8071=this[_0x5f4ed1(0x1ae)](_0x160728);await _0xb63cd8(_0x51bff7(_0x2b8071),{'recursive':!0x0});let _0x478b0a=_0x177d01(_0x51bff7(_0x2b8071),_0x5f4ed1(0x191)+process['pid']+'-'+_0x36e8de()+_0x5f4ed1(0x1e3));try{await _0x301011(_0x478b0a,_0x2f674d,{'encoding':'utf8','mode':0x180}),await _0x5a37a9(_0x478b0a,_0x2b8071);}catch(_0x5e09c2){throw await _0x47950c(_0x478b0a)[_0x5f4ed1(0x14f)](()=>void 0x0),_0x5e09c2;}}async[_0x42915f(0x1ac)](){const _0x12984d=_0x42915f;let _0x24f868=await q(this[_0x12984d(0x153)]);return await _0x54662b(this['location'],{'force':!0x0,'recursive':!0x0}),{'path':this[_0x12984d(0x153)],..._0x24f868};}},Y=class{async[_0x42915f(0x17f)](_0x4e4d77,_0x5e7f24,_0x98aad1){const _0x3157b0=_0x42915f;await _0xb63cd8(_0x4e4d77,{'recursive':!0x0});let _0x24d969=_0x177d01(_0x4e4d77,_0x5e7f24);return await _0x301011(_0x24d969,_0x98aad1,_0x3157b0(0x1a1)),_0x24d969;}},X=0x7530,ae=0xa00000,oe=0xa,se=new Set([0x12d,0x12e,0x12f,0x133,0x134]);function Z(_0x4385c5){const _0x9b954e=_0x42915f;return new h(_0x9b954e(0x1f0),_0x9b954e(0x17d)+_0x4385c5+_0x9b954e(0x1e8));}async function ce(_0x10c769,_0x453fd0){const _0x4d4333=_0x42915f;let _0x5ec3cf=Number(_0x10c769['headers']['get']('content-length'));if(Number[_0x4d4333(0x16c)](_0x5ec3cf)&&_0x5ec3cf>_0x453fd0)throw Z(_0x453fd0);if(_0x10c769[_0x4d4333(0x1bc)]===null){let _0x584460=await _0x10c769[_0x4d4333(0x1d2)]();if(Buffer['byteLength'](_0x584460)>_0x453fd0)throw Z(_0x453fd0);return _0x584460;}let _0x11ff3d=_0x10c769['body'][_0x4d4333(0x1ce)](),_0x4d0eb1=[],_0x1c4ed4=0x0;try{for(;;){let _0x3850a9=await _0x11ff3d[_0x4d4333(0x1e6)]();if(_0x3850a9[_0x4d4333(0x17c)])break;if(_0x1c4ed4+=_0x3850a9[_0x4d4333(0x147)]['byteLength'],_0x1c4ed4>_0x453fd0)throw await _0x11ff3d[_0x4d4333(0x194)]()[_0x4d4333(0x14f)](()=>void 0x0),Z(_0x453fd0);_0x4d0eb1[_0x4d4333(0x13e)](_0x3850a9[_0x4d4333(0x147)]);}}finally{_0x11ff3d[_0x4d4333(0x1a3)]();}try{return new TextDecoder(_0x4d4333(0x186),{'fatal':!0x0})[_0x4d4333(0x1b7)](Buffer['concat'](_0x4d0eb1,_0x1c4ed4));}catch{throw new h(_0x4d4333(0x1e1),_0x4d4333(0x162));}}var Q=class{[_0x42915f(0x1e7)];[_0x42915f(0x1a2)];[_0x42915f(0x1a4)];[_0x42915f(0x1dc)];constructor(_0x863f7f={}){const _0x59b9a7=_0x42915f;this[_0x59b9a7(0x1e7)]=_0x863f7f[_0x59b9a7(0x14e)]??fetch,this['timeoutMs']=_0x863f7f[_0x59b9a7(0x1a2)]??X,this[_0x59b9a7(0x1a4)]=_0x863f7f[_0x59b9a7(0x1a4)]??ae,this[_0x59b9a7(0x1dc)]=_0x863f7f[_0x59b9a7(0x1dc)]??oe;}async[_0x42915f(0x185)](_0x2fe7ea){const _0x59d04c=_0x42915f;let _0x1602c1=new URL(_0x2fe7ea);if(_0x1602c1[_0x59d04c(0x17b)]!==_0x59d04c(0x1d1))throw new h(_0x59d04c(0x19b),_0x59d04c(0x1c3));let _0x4bf0c7=new AbortController(),_0x454836=setTimeout(()=>_0x4bf0c7[_0x59d04c(0x156)](),this['timeoutMs']);try{let _0x480a27=_0x1602c1;for(let _0x1e378a=0x0;;_0x1e378a++){let _0x5c19bd=await this['fetchImpl'](_0x480a27,{'redirect':_0x59d04c(0x17a),'signal':_0x4bf0c7[_0x59d04c(0x202)]});if(se[_0x59d04c(0x1fd)](_0x5c19bd['status'])){if(_0x1e378a>=this[_0x59d04c(0x1dc)])throw new h(_0x59d04c(0x14c),'Resource\x20request\x20followed\x20too\x20many\x20redirects;\x20maximum\x20'+this[_0x59d04c(0x1dc)]+'.');let _0x1c64e2=_0x5c19bd[_0x59d04c(0x201)][_0x59d04c(0x1f2)](_0x59d04c(0x153));if(_0x1c64e2===null)throw new h(_0x59d04c(0x1cf),_0x59d04c(0x1b9)+_0x5c19bd['status']+_0x59d04c(0x19f));let _0x35c658;try{_0x35c658=new URL(_0x1c64e2,_0x480a27);}catch{throw new h(_0x59d04c(0x1cf),_0x59d04c(0x1a0));}if(_0x35c658['protocol']!=='https:')throw new h(_0x59d04c(0x143),'Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.');_0x480a27=_0x35c658;continue;}if(!_0x5c19bd['ok'])throw new h('resource-download-http','Resource\x20server\x20returned\x20HTTP\x20'+_0x5c19bd[_0x59d04c(0x1cb)]+'.');if(_0x5c19bd[_0x59d04c(0x144)]!==''&&new URL(_0x5c19bd['url'])['protocol']!=='https:')throw new h(_0x59d04c(0x143),_0x59d04c(0x1fa));let _0x2013e4=await ce(_0x5c19bd,this['maxBytes']);if(!V(_0x2013e4))throw new h(_0x59d04c(0x165),_0x59d04c(0x1d5));return _0x2013e4;}}catch(_0x485a7d){throw _0x4bf0c7[_0x59d04c(0x202)][_0x59d04c(0x18c)]?new h('resource-download-timeout',_0x59d04c(0x16d)+this[_0x59d04c(0x1a2)]+'\x20ms.'):_0x485a7d;}finally{clearTimeout(_0x454836);}}};function $(_0x2e2cfd){const _0x4a75de=_0x42915f;try{return JSON[_0x4a75de(0x1ef)](_0x1c66fd(_0x2e2cfd,_0x4a75de(0x1a1)));}catch(_0x3408e5){throw new h('resource-manifest-read-failed',_0x4a75de(0x158)+_0x2e2cfd+':\x20'+(_0x3408e5 instanceof Error?_0x3408e5[_0x4a75de(0x1ed)]:String(_0x3408e5)),void 0x0,{'cause':_0x3408e5});}}function le(_0x29d319){const _0x22db55=_0x42915f;let _0x23bf12;return()=>(_0x23bf12??=W({'manifest':$(_0x29d319['manifestPath']),'cache':new J(_0x29d319[_0x22db55(0x1b6)]),'downloader':new Q(_0x29d319[_0x22db55(0x15e)]),'output':new Y()}),_0x23bf12);}export{J as FilesystemResourceCache,Y as FilesystemResourceOutput,Q as HttpsResourceDownloader,h as ResourceLibraryError,le as createNodeResourceLibraryFactory,W as createResourceLibrary,g as isResourceLibraryError,$ as loadResourceManifestFromPath,K as validateResourceCacheRoot};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@univer-cli/resource-library",
3
3
  "type": "module",
4
- "version": "1.3.0",
4
+ "version": "1.3.1",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",