@univer-cli/resource-library 1.0.0-rc.0 → 1.0.0
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.
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5e3730=_0x561a;(function(_0x219052,_0x4a712e){const _0x47ecb1=_0x561a,_0xa2c23=_0x219052();while(!![]){try{const _0x14e3e4=parseInt(_0x47ecb1(0x1fb))/0x1+parseInt(_0x47ecb1(0x1ba))/0x2+-parseInt(_0x47ecb1(0x214))/0x3*(-parseInt(_0x47ecb1(0x16e))/0x4)+-parseInt(_0x47ecb1(0x19c))/0x5+parseInt(_0x47ecb1(0x17c))/0x6*(parseInt(_0x47ecb1(0x18f))/0x7)+parseInt(_0x47ecb1(0x1cc))/0x8+parseInt(_0x47ecb1(0x1ea))/0x9*(-parseInt(_0x47ecb1(0x1b7))/0xa);if(_0x14e3e4===_0x4a712e)break;else _0xa2c23['push'](_0xa2c23['shift']());}catch(_0x513efa){_0xa2c23['push'](_0xa2c23['shift']());}}}(_0x191d,0x4b954));import{randomUUID as _0x2c33c3}from'node:crypto';import{mkdir as _0xce22d8,readFile as _0x1c72ca,readdir as _0x2d1c6f,rename as _0x3be09a,rm as _0x311f6b,stat as _0x8b4291,unlink as _0x19c3f1,writeFile as _0xe9db9d}from'node:fs/promises';import{dirname as _0x15aa6e,isAbsolute as _0x324a08,join as _0x553560,parse as _0xffbb55,resolve as _0x59d85e}from'node:path';function _0x191d(){const _0x3c2d18=['string','Invalid\x20resource\x20handle\x20\x22','defaultLocale','Duplicate\x20export\x20filename\x20\x22','done','.order','headers','resource-download-http','resource-invalid-resource-id','resource-invalid-handle','fetch','Resource\x20search\x20needs\x20at\x20least\x20one\x20non-empty\x20query.','3779955uMuyIb','reference','manifest','catalog','download','pid','Unknown\x20resource\x20registry\x20\x22','has','resource','parse','registrations\x20must\x20not\x20be\x20empty.','Duplicate\x20registry\x20ID\x20\x22','ENOENT','.keywords','Duplicate\x20resource\x20handle\x20\x22','Resource\x20search\x20limit\x20must\x20be\x20a\x20positive\x20integer;\x20received\x20\x22','filter','286013yEnXrG','globalIndex','read','protocol','resource-manifest-read-failed','\x22\x20is\x20not\x20an\x20SVG\x20document.','.svg','cacheRoot','concat','content-length','.payload','\x20must\x20be\x20a\x20finite\x20number.','name','input','\x22:\x20expected\x20an\x20addressable\x20filesystem-safe\x20component\x20without\x20\x22--\x22.','clearCache','listRegistries','resource-download-insecure-redirect','Resource\x20export\x20filename\x20exceeds\x20','utf8','width','order','path','.description','registrations[','488793YCqsSu','Resource\x20server\x20returned\x20an\x20invalid\x20redirect\x20URL.','entries','image','number','fetchImpl','signal','url','groups','searchText','.id','startsWith','includes','resources','Invalid\x20registry\x20ID\x20\x22','resource-download-timeout','.storagePolicy\x20must\x20be\x20\x22reference\x22.','.name','resource-cache-root-invalid','isFile','Resource\x20server\x20returned\x20HTTP\x20','isInteger','Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.','.tmp','Resource\x20download\x20timed\x20out\x20after\x20','\x20ID\x20\x22','body','ResourceLibraryError','registries','byteLength','queries','\x20must\x20be\x20an\x20object.','8bgDEJw','.source.value','destination','output','clear','.tagIds\x20references\x20unknown\x20tag\x20\x22','resourceByHandle','Downloaded\x20resource\x20\x22','colorEditable','isArray','tags','resource-manifest-invalid','\x20must\x20be\x20a\x20non-empty\x20string.','catch','18YDVGTG','storagePolicy','.intrinsicSize\x20must\x20be\x20positive.','group','decode','].id','\x22:\x20','maxBytes','registry','Resource\x20cache\x20root\x20must\x20be\x20an\x20absolute,\x20dedicated\x20directory\x20below\x20the\x20filesystem\x20root;\x20received\x20\x22','\x20bytes.','manual','value','message','resource-download-invalid-redirect','releaseLock','text','.source.value\x20must\x20be\x20a\x20URL.','timeoutMs','751261JjCpZg','].input.registryId','.intrinsicSize.width','limit','cancel','set','push','keywords','resource-not-found','resource-download-invalid-utf8','resource-query-empty','intrinsicSize','\x20must\x20be\x20an\x20array.','2625605kENlLR','registrationIndex','cache','replace','map','aborted','\x20ms.','Resource\x20response\x20is\x20not\x20an\x20SVG\x20document.','\x22;\x20expected\x20<registryId>/<resourceId>.','https:','resource-limit-invalid','add','.source.type\x20must\x20be\x20\x22url\x22.','find','utf-8','manifest.registrations','Resource\x20exceeds\x20the\x20maximum\x20size\x20of\x20','resource-invalid-registry-id','handles','sourceUrl','handle','source','Resource\x20URL\x20must\x20use\x20HTTPS.','.resource-','getReader','\x22:\x20expected\x20filesystem-safe\x20characters.','Resource\x20response\x20is\x20not\x20valid\x20UTF-8.','10WlqgQx','tagIds','\x20must\x20be\x20a\x20boolean.','21918XSxeur','resource-download-invalid-svg','resource-download-too-many-redirects','].input.defaultLocale','.intrinsicSize','].input','groupId','byteCount','normalize','resourceIndex','length','some','toLowerCase','type','location','size','height','Duplicate\x20','2479208gvjQQp','trim','NFKC','isFinite','get','description','\x20contains\x20no\x20usable\x20localized\x20text.','registryId','write','\x20without\x20a\x20Location\x20header.','options','maxRedirects','code','resourceCount','export','label','.payload.colorEditable','resource-download-failed'];_0x191d=function(){return _0x3c2d18;};return _0x191d();}import{readFileSync as _0xce1fe3}from'node:fs';var h=class extends Error{['code'];[_0x5e3730(0x1b0)];constructor(_0x335d4d,_0x40a4bf,_0x14bde5,_0x4f2b27){const _0x9d7c65=_0x5e3730;super(_0x40a4bf,_0x4f2b27),this['code']=_0x335d4d,this['handle']=_0x14bde5,this[_0x9d7c65(0x207)]=_0x9d7c65(0x169);}};function g(_0xfec357){return _0xfec357 instanceof h;}var _=/^[A-Za-z0-9._-]+$/u,v=0xff,y=0x4;function b(_0x1c9645){return _['test'](_0x1c9645)&&_0x1c9645!=='.'&&_0x1c9645!=='..';}function x(_0x4f9871){const _0x44c2a5=_0x5e3730;if(!b(_0x4f9871)||_0x4f9871[_0x44c2a5(0x159)]('-')||_0x4f9871[_0x44c2a5(0x15a)]('--')||_0x4f9871[_0x44c2a5(0x1c4)]>v)throw new h(_0x44c2a5(0x1ad),_0x44c2a5(0x15c)+_0x4f9871+_0x44c2a5(0x209));}function S(_0x431bb4){const _0x53c33e=_0x5e3730;if(!b(_0x431bb4)||_0x431bb4[_0x53c33e(0x1c4)]+y>v)throw new h(_0x53c33e(0x1e6),'Invalid\x20resource\x20ID\x20\x22'+_0x431bb4+_0x53c33e(0x1b5));}function C(_0xa8a417){const _0x1afcdf=_0x5e3730;let _0x5cde92=_0xa8a417['split']('/');if(_0x5cde92[_0x1afcdf(0x1c4)]!==0x2||_0x5cde92[0x0]===''||_0x5cde92[0x1]==='')throw new h(_0x1afcdf(0x1e7),_0x1afcdf(0x1df)+_0xa8a417+_0x1afcdf(0x1a4),_0xa8a417);let _0x4f9e60=_0x5cde92[0x0],_0x3b8bc6=_0x5cde92[0x1];return x(_0x4f9e60),S(_0x3b8bc6),{'registryId':_0x4f9e60,'resourceId':_0x3b8bc6};}function ee(_0x432497,_0x237d03){return x(_0x432497),S(_0x237d03),_0x432497+'/'+_0x237d03;}function w(_0x362b17){const _0x59a186=_0x5e3730;let {registryId:_0x10517c,resourceId:_0x1953dc}=C(_0x362b17),_0x2e257c=_0x10517c+'--'+_0x1953dc+_0x59a186(0x201);if(_0x2e257c[_0x59a186(0x1c4)]>v)throw new h('resource-export-filename-too-long',_0x59a186(0x20d)+v+_0x59a186(0x186),_0x362b17);return _0x2e257c;}function T(_0x116f94){const _0x6efcfa=_0x5e3730;return new h(_0x6efcfa(0x179),'Invalid\x20resource\x20manifest:\x20'+_0x116f94);}function E(_0x8dc81f,_0xe78460){const _0xa97589=_0x5e3730;if(typeof _0x8dc81f!='object'||!_0x8dc81f||Array['isArray'](_0x8dc81f))throw T(_0xe78460+_0xa97589(0x16d));return _0x8dc81f;}function D(_0x263b92,_0x451646,_0x68b68c=!0x1){const _0x4fefb0=_0x5e3730;if(_0x68b68c&&_0x263b92===void 0x0)return[];if(!Array[_0x4fefb0(0x177)](_0x263b92))throw T(_0x451646+_0x4fefb0(0x19b));return _0x263b92;}function O(_0x1f6d2d,_0x48dbdc){const _0x1be43b=_0x5e3730;if(typeof _0x1f6d2d!=_0x1be43b(0x1de)||_0x1f6d2d==='')throw T(_0x48dbdc+_0x1be43b(0x17a));return _0x1f6d2d;}function k(_0x376d6d,_0x54b87f,_0x5157b0=!0x1){const _0x25e717=_0x5e3730;return D(_0x376d6d,_0x54b87f,_0x5157b0)[_0x25e717(0x1a0)]((_0x424905,_0x20c574)=>O(_0x424905,_0x54b87f+'['+_0x20c574+']'));}function A(_0x2bd684,_0x198b5c){const _0x52213d=_0x5e3730;return D(_0x2bd684,_0x198b5c,!0x0)['map']((_0x482ab7,_0x27bddb)=>{const _0x31f97e=_0x561a;if(typeof _0x482ab7!=_0x31f97e(0x1de))throw T(_0x198b5c+'['+_0x27bddb+']\x20must\x20be\x20a\x20string.');return _0x482ab7;})[_0x52213d(0x1fa)](_0x3c4b7f=>_0x3c4b7f!=='');}function j(_0x2e988a,_0x2aade1){const _0x34bafd=_0x5e3730;if(typeof _0x2e988a!=_0x34bafd(0x218)||!Number[_0x34bafd(0x1cf)](_0x2e988a))throw T(_0x2aade1+_0x34bafd(0x206));return _0x2e988a;}function M(_0x5fda86,_0x305199){const _0x598738=_0x5e3730;if(typeof _0x5fda86!='boolean')throw T(_0x305199+_0x598738(0x1b9));return _0x5fda86;}function N(_0xc4ae12,_0x568694,_0x8823a1){const _0x324ea5=_0x5e3730;if(typeof _0xc4ae12==_0x324ea5(0x1de)&&_0xc4ae12!=='')return _0xc4ae12;let _0x2d4acf=E(_0xc4ae12,_0x568694),_0x451b62=_0x8823a1===void 0x0?void 0x0:_0x2d4acf[_0x8823a1];if(typeof _0x451b62==_0x324ea5(0x1de)&&_0x451b62!=='')return _0x451b62;let _0x32cad6=_0x2d4acf['en-US'];if(typeof _0x32cad6==_0x324ea5(0x1de)&&_0x32cad6!=='')return _0x32cad6;let _0x2b33a4=Object['values'](_0x2d4acf)[_0x324ea5(0x1a9)](_0x3dd72d=>typeof _0x3dd72d==_0x324ea5(0x1de)&&_0x3dd72d!=='');if(_0x2b33a4!==void 0x0)return _0x2b33a4;throw T(_0x568694+_0x324ea5(0x1d2));}function P(_0x20d0ad,_0x28293d,_0x42ee93){const _0x231c79=_0x5e3730;try{_0x42ee93===_0x231c79(0x184)?x(_0x20d0ad):S(_0x20d0ad);}catch(_0x91e373){throw T(_0x28293d+':\x20'+(_0x91e373 instanceof Error?_0x91e373['message']:String(_0x91e373)));}}function _0x561a(_0x4a5b54,_0x3286a6){_0x4a5b54=_0x4a5b54-0x159;const _0x191d12=_0x191d();let _0x561a13=_0x191d12[_0x4a5b54];return _0x561a13;}function F(_0x5e0f19,_0xaf6c17,_0x35d297){const _0x203cec=_0x5e3730;let _0x2543c0=new Map();for(let [_0x53a7c2,_0x443575]of D(_0x5e0f19,_0xaf6c17,!0x0)[_0x203cec(0x216)]()){let _0x59dc2e=E(_0x443575,_0xaf6c17+'['+_0x53a7c2+']'),_0xc902c5=O(_0x59dc2e['id'],_0xaf6c17+'['+_0x53a7c2+'].id');if(P(_0xc902c5,_0xaf6c17+'['+_0x53a7c2+_0x203cec(0x181),'resource'),_0x2543c0[_0x203cec(0x1f1)](_0xc902c5))throw T(_0x203cec(0x1cb)+_0xaf6c17+_0x203cec(0x167)+_0xc902c5+'\x22.');_0x2543c0[_0x203cec(0x194)](_0xc902c5,N(_0x59dc2e[_0x203cec(0x1db)],_0xaf6c17+'['+_0x53a7c2+'].label',_0x35d297));}return _0x2543c0;}function I(_0x778443,_0x2471b5){const _0x53cfcd=_0x5e3730;let _0x1a572c=E(_0x778443[_0x53cfcd(0x19a)],_0x2471b5+_0x53cfcd(0x1be)),_0x120ef9=j(_0x1a572c[_0x53cfcd(0x20f)],_0x2471b5+_0x53cfcd(0x191)),_0x2870f5=j(_0x1a572c[_0x53cfcd(0x1ca)],_0x2471b5+'.intrinsicSize.height');if(_0x120ef9<=0x0||_0x2870f5<=0x0)throw T(_0x2471b5+_0x53cfcd(0x17e));return{'width':_0x120ef9,'height':_0x2870f5};}function L(_0x5d36e9,_0x46a8f2){const _0x4ef293=_0x5e3730;if(_0x5d36e9[_0x4ef293(0x1c7)]!==_0x4ef293(0x217))throw T(_0x46a8f2+'.type\x20must\x20be\x20\x22image\x22.');if(_0x5d36e9[_0x4ef293(0x17d)]!==_0x4ef293(0x1eb))throw T(_0x46a8f2+_0x4ef293(0x15e));let _0x443737=E(_0x5d36e9[_0x4ef293(0x1b1)],_0x46a8f2+'.source');if(_0x443737[_0x4ef293(0x1c7)]!==_0x4ef293(0x21b))throw T(_0x46a8f2+_0x4ef293(0x1a8));let _0x1076f1=O(_0x443737[_0x4ef293(0x188)],_0x46a8f2+_0x4ef293(0x16f)),_0x45d74f;try{_0x45d74f=new URL(_0x1076f1);}catch{throw T(_0x46a8f2+_0x4ef293(0x18d));}if(_0x45d74f[_0x4ef293(0x1fe)]!==_0x4ef293(0x1a5))throw T(_0x46a8f2+'.source.value\x20must\x20use\x20HTTPS.');return _0x1076f1;}function R(_0x587bd0){const _0x139917=_0x5e3730;return _0x587bd0[_0x139917(0x1c2)](_0x139917(0x1ce))[_0x139917(0x1c6)]()[_0x139917(0x1cd)]()[_0x139917(0x19f)](/\s+/gu,'\x20');}function z(_0xf719d5){const _0x3d38f4=_0x5e3730;let _0x43a289=E(_0xf719d5,_0x3d38f4(0x1ec)),_0x4ea197=new Map(),_0x179678=new Map(),_0x19d77b=[],_0x3ab729=[],_0xf0579=new Set(),_0x1abb4e=0x0;for(let [_0x40b7a9,_0x15c359]of D(_0x43a289['registrations'],_0x3d38f4(0x1ab))[_0x3d38f4(0x216)]()){let _0x75d1ed=E(E(_0x15c359,_0x3d38f4(0x213)+_0x40b7a9+']')[_0x3d38f4(0x208)],'registrations['+_0x40b7a9+_0x3d38f4(0x1bf)),_0x3871a4=O(_0x75d1ed['registryId'],'registrations['+_0x40b7a9+_0x3d38f4(0x190));if(P(_0x3871a4,'registrations['+_0x40b7a9+_0x3d38f4(0x190),_0x3d38f4(0x184)),_0x4ea197[_0x3d38f4(0x1f1)](_0x3871a4))throw T(_0x3d38f4(0x1f5)+_0x3871a4+'\x22.');let _0x1116ab=_0x75d1ed[_0x3d38f4(0x1e0)]===void 0x0?void 0x0:O(_0x75d1ed[_0x3d38f4(0x1e0)],_0x3d38f4(0x213)+_0x40b7a9+_0x3d38f4(0x1bd)),_0x233f36=F(_0x75d1ed[_0x3d38f4(0x21c)],_0x3d38f4(0x213)+_0x40b7a9+'].input.groups',_0x1116ab),_0x13cb5d=F(_0x75d1ed[_0x3d38f4(0x178)],_0x3d38f4(0x213)+_0x40b7a9+'].input.tags',_0x1116ab),_0x5196eb=[];for(let [_0x15493a,_0x4934eb]of D(_0x75d1ed['resources'],_0x3d38f4(0x213)+_0x40b7a9+'].input.resources')['entries']()){let _0x16df47=_0x3d38f4(0x213)+_0x40b7a9+'].input.resources['+_0x15493a+']',_0x467551=E(_0x4934eb,_0x16df47),_0x359a72=O(_0x467551['id'],_0x16df47+_0x3d38f4(0x21e));P(_0x359a72,_0x16df47+_0x3d38f4(0x21e),_0x3d38f4(0x1f2));let _0x3f4f72=ee(_0x3871a4,_0x359a72);if(_0x179678[_0x3d38f4(0x1f1)](_0x3f4f72))throw T(_0x3d38f4(0x1f8)+_0x3f4f72+'\x22.');let _0x24a571;try{_0x24a571=w(_0x3f4f72);}catch(_0x41f49c){throw T(_0x16df47+':\x20'+(_0x41f49c instanceof Error?_0x41f49c[_0x3d38f4(0x189)]:String(_0x41f49c)));}if(_0xf0579[_0x3d38f4(0x1f1)](_0x24a571))throw T(_0x3d38f4(0x1e1)+_0x24a571+'\x22.');_0xf0579[_0x3d38f4(0x1a7)](_0x24a571);let _0x5752d4=_0x467551[_0x3d38f4(0x1c0)]===void 0x0?void 0x0:O(_0x467551[_0x3d38f4(0x1c0)],_0x16df47+'.groupId');if(_0x5752d4!==void 0x0&&!_0x233f36[_0x3d38f4(0x1f1)](_0x5752d4))throw T(_0x16df47+'.groupId\x20references\x20unknown\x20group\x20\x22'+_0x5752d4+'\x22.');let _0x155d41=k(_0x467551[_0x3d38f4(0x1b8)],_0x16df47+'.tagIds',!0x0);for(let _0x5d397c of _0x155d41)if(!_0x13cb5d[_0x3d38f4(0x1f1)](_0x5d397c))throw T(_0x16df47+_0x3d38f4(0x173)+_0x5d397c+'\x22.');let _0x261ea1=A(_0x467551[_0x3d38f4(0x196)],_0x16df47+_0x3d38f4(0x1f7)),_0xd7dc24=N(_0x467551[_0x3d38f4(0x207)],_0x16df47+_0x3d38f4(0x15f),_0x1116ab),_0x22e768=_0x467551['description']===void 0x0?void 0x0:N(_0x467551[_0x3d38f4(0x1d1)],_0x16df47+_0x3d38f4(0x212),_0x1116ab),_0x5af174=_0x5752d4===void 0x0?null:{'id':_0x5752d4,'label':_0x233f36[_0x3d38f4(0x1d0)](_0x5752d4)},_0xd38359=_0x155d41[_0x3d38f4(0x1a0)](_0x18ad7e=>({'id':_0x18ad7e,'label':_0x13cb5d[_0x3d38f4(0x1d0)](_0x18ad7e)})),_0x45471f=E(_0x467551['payload'],_0x16df47+_0x3d38f4(0x205)),_0x4b749d=_0x467551[_0x3d38f4(0x210)]===void 0x0?null:j(_0x467551[_0x3d38f4(0x210)],_0x16df47+_0x3d38f4(0x1e3)),_0x436510=M(_0x45471f['colorEditable'],_0x16df47+_0x3d38f4(0x1dc)),_0xaa62aa={'handle':_0x3f4f72,'registryId':_0x3871a4,'id':_0x359a72,'name':_0xd7dc24,..._0x22e768===void 0x0?{}:{'description':_0x22e768},'group':_0x5af174,'tags':_0xd38359,'keywords':_0x261ea1,'order':_0x4b749d,'intrinsicSize':I(_0x45471f,_0x16df47+_0x3d38f4(0x205)),'colorEditable':_0x436510,'sourceUrl':L(_0x45471f,_0x16df47+_0x3d38f4(0x205)),'registrationIndex':_0x40b7a9,'resourceIndex':_0x15493a,'globalIndex':_0x1abb4e,'searchText':R([_0xd7dc24,_0x22e768,_0x5af174?.[_0x3d38f4(0x1db)],..._0xd38359[_0x3d38f4(0x1a0)](_0x3df481=>_0x3df481['label']),..._0x261ea1][_0x3d38f4(0x1fa)](_0x13d5fc=>_0x13d5fc!==void 0x0)['join']('\x20'))};_0x1abb4e++,_0x5196eb[_0x3d38f4(0x195)](_0xaa62aa),_0x3ab729[_0x3d38f4(0x195)](_0xaa62aa),_0x179678[_0x3d38f4(0x194)](_0x3f4f72,_0xaa62aa);}let _0x26b730={'id':_0x3871a4,'groups':_0x233f36,'tags':_0x13cb5d,'resources':_0x5196eb};_0x19d77b['push'](_0x26b730),_0x4ea197[_0x3d38f4(0x194)](_0x3871a4,_0x26b730);}if(_0x19d77b[_0x3d38f4(0x1c4)]===0x0)throw T(_0x3d38f4(0x1f4));return{'registries':_0x19d77b,'registryById':_0x4ea197,'resourceByHandle':_0x179678,'resources':_0x3ab729};}function B(_0x8882ac,_0x3b6f13){const _0x4fa80d=_0x5e3730;C(_0x3b6f13);let _0x42508b=_0x8882ac[_0x4fa80d(0x174)][_0x4fa80d(0x1d0)](_0x3b6f13);if(_0x42508b===void 0x0)throw new h(_0x4fa80d(0x197),'Unknown\x20resource\x20\x22'+_0x3b6f13+'\x22;\x20try\x20resources\x20find\x20<query>.',_0x3b6f13);return _0x42508b;}function te(_0x3a2c0f){const _0x3221d8=_0x5e3730;return _0x3a2c0f[_0x3221d8(0x16a)]['map'](_0xcc4d74=>({'id':_0xcc4d74['id'],'resourceCount':_0xcc4d74['resources'][_0x3221d8(0x1c4)],'groupCount':_0xcc4d74['groups'][_0x3221d8(0x1c9)],'tagCount':_0xcc4d74[_0x3221d8(0x178)][_0x3221d8(0x1c9)],'colorEditableCount':_0xcc4d74['resources'][_0x3221d8(0x1fa)](_0x188c2c=>_0x188c2c[_0x3221d8(0x176)])['length']}));}function ne(_0x1c8aa7){const _0x4380cc=_0x5e3730;return{'handle':_0x1c8aa7[_0x4380cc(0x1b0)],'registryId':_0x1c8aa7[_0x4380cc(0x1d3)],'id':_0x1c8aa7['id'],'name':_0x1c8aa7['name'],'group':_0x1c8aa7[_0x4380cc(0x17f)],'tags':_0x1c8aa7[_0x4380cc(0x178)],'keywords':_0x1c8aa7[_0x4380cc(0x196)],'order':_0x1c8aa7[_0x4380cc(0x210)],'intrinsicSize':_0x1c8aa7[_0x4380cc(0x19a)],'colorEditable':_0x1c8aa7['colorEditable']};}function re(_0x5081a4,_0x29fb44){const _0x54524c=_0x5e3730;let _0x2fabb5=(_0x5081a4['order']??_0x5081a4[_0x54524c(0x1fc)])-(_0x29fb44[_0x54524c(0x210)]??_0x29fb44[_0x54524c(0x1fc)]);if(_0x2fabb5!==0x0)return _0x2fabb5;let _0x5ae8cf=_0x5081a4[_0x54524c(0x19d)]-_0x29fb44[_0x54524c(0x19d)];if(_0x5ae8cf!==0x0)return _0x5ae8cf;let _0x32d909=_0x5081a4['resourceIndex']-_0x29fb44[_0x54524c(0x1c3)];return _0x32d909===0x0?_0x5081a4['handle']['localeCompare'](_0x29fb44[_0x54524c(0x1b0)]):_0x32d909;}function ie(_0x1e656b,_0x102592){const _0x2343bd=_0x5e3730;let _0xb3d1be=_0x102592[_0x2343bd(0x16c)][_0x2343bd(0x1a0)](R)[_0x2343bd(0x1fa)](_0x239dc4=>_0x239dc4!=='');if(_0xb3d1be['length']===0x0)throw new h(_0x2343bd(0x199),_0x2343bd(0x1e9));let _0x151524=new Set(_0x102592[_0x2343bd(0x16a)]??[]);for(let _0x48917e of _0x151524)if(!_0x1e656b['registryById']['has'](_0x48917e))throw new h('resource-registry-not-found',_0x2343bd(0x1f0)+_0x48917e+'\x22.');let _0x19bb27=_0x102592[_0x2343bd(0x192)]??_0x1e656b['resources'][_0x2343bd(0x1c4)];if(!Number[_0x2343bd(0x163)](_0x19bb27)||_0x19bb27<0x1)throw new h(_0x2343bd(0x1a6),_0x2343bd(0x1f9)+_0x19bb27+'\x22.');let _0x6400d4=_0x1e656b[_0x2343bd(0x15b)][_0x2343bd(0x1fa)](_0x38b438=>_0x151524[_0x2343bd(0x1c9)]===0x0||_0x151524[_0x2343bd(0x1f1)](_0x38b438[_0x2343bd(0x1d3)]))[_0x2343bd(0x1fa)](_0x46ff9b=>_0xb3d1be[_0x2343bd(0x1c5)](_0x1a540b=>_0x46ff9b[_0x2343bd(0x21d)][_0x2343bd(0x15a)](_0x1a540b)))['sort'](re);return{'resources':_0x6400d4['slice'](0x0,_0x19bb27)[_0x2343bd(0x1a0)](ne),'total':_0x6400d4['length']};}function V(_0x17b92c){return/^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[^]*?-->\s*)*<svg(?:\s|>)/iu['test'](_0x17b92c);}function H(_0xc35c89,_0x2e49a0){const _0x167691=_0x5e3730;return g(_0x2e49a0)?{'handle':_0xc35c89,'code':_0x2e49a0[_0x167691(0x1d8)],'message':_0x2e49a0['message']}:{'handle':_0xc35c89,'code':'resource-export-failed','message':_0x2e49a0 instanceof Error?_0x2e49a0[_0x167691(0x189)]:String(_0x2e49a0)};}var U=class{['options'];[_0x5e3730(0x1ed)];constructor(_0x44cf1e){const _0x453dab=_0x5e3730;this[_0x453dab(0x1d6)]=_0x44cf1e,this[_0x453dab(0x1ed)]=z(_0x44cf1e[_0x453dab(0x1ec)]);}get['cacheLocation'](){const _0xb63ca8=_0x5e3730;return this[_0xb63ca8(0x1d6)][_0xb63ca8(0x19e)][_0xb63ca8(0x1c8)];}[_0x5e3730(0x20b)](){return te(this['catalog']);}['find'](_0xaedaff){const _0x5e5401=_0x5e3730;return ie(this[_0x5e5401(0x1ed)],_0xaedaff);}async['read'](_0xd056d5){const _0x316e00=_0x5e3730;let _0x4e6438=B(this[_0x316e00(0x1ed)],_0xd056d5['handle']),_0x5072d4=await this[_0x316e00(0x1d6)][_0x316e00(0x19e)]['read'](_0xd056d5[_0x316e00(0x1b0)]);if(_0x5072d4!==void 0x0&&V(_0x5072d4))return{'handle':_0xd056d5['handle'],'svg':_0x5072d4};let _0x4f1b9c;try{_0x4f1b9c=await this[_0x316e00(0x1d6)]['downloader'][_0x316e00(0x1ee)](_0x4e6438[_0x316e00(0x1af)]);}catch(_0x333f1a){throw g(_0x333f1a)?_0x333f1a:new h(_0x316e00(0x1dd),'Failed\x20to\x20download\x20\x22'+_0xd056d5[_0x316e00(0x1b0)]+_0x316e00(0x182)+(_0x333f1a instanceof Error?_0x333f1a[_0x316e00(0x189)]:String(_0x333f1a)),_0xd056d5[_0x316e00(0x1b0)],{'cause':_0x333f1a});}if(!V(_0x4f1b9c))throw new h('resource-invalid-svg',_0x316e00(0x175)+_0xd056d5[_0x316e00(0x1b0)]+_0x316e00(0x200),_0xd056d5[_0x316e00(0x1b0)]);return await this['options'][_0x316e00(0x19e)][_0x316e00(0x1d4)](_0xd056d5[_0x316e00(0x1b0)],_0x4f1b9c),{'handle':_0xd056d5[_0x316e00(0x1b0)],'svg':_0x4f1b9c};}async[_0x5e3730(0x1da)](_0x4906ae){const _0x3e4e2a=_0x5e3730;let _0x2ca2e2=[],_0x4ef685=[];for(let _0xd57d78 of _0x4906ae[_0x3e4e2a(0x1ae)])try{let {svg:_0x4d9fde}=await this['read']({'handle':_0xd57d78}),_0x52ae9b=await this[_0x3e4e2a(0x1d6)][_0x3e4e2a(0x171)][_0x3e4e2a(0x1d4)](_0x4906ae[_0x3e4e2a(0x170)],w(_0xd57d78),_0x4d9fde);_0x2ca2e2['push']({'handle':_0xd57d78,'path':_0x52ae9b});}catch(_0x5c160c){_0x4ef685[_0x3e4e2a(0x195)](H(_0xd57d78,_0x5c160c));}return{'exported':_0x2ca2e2,'failed':_0x4ef685};}async[_0x5e3730(0x20a)](){const _0x56e775=_0x5e3730;return await this['options'][_0x56e775(0x19e)][_0x56e775(0x172)]();}};function W(_0x1201e7){return new U(_0x1201e7);}function G(_0x5ac95d){const _0x92e771=_0x5e3730;return _0x5ac95d instanceof Error&&_0x92e771(0x1d8)in _0x5ac95d;}function K(_0x5bf119){const _0x5ae65d=_0x5e3730;let _0x4e0d65=_0x59d85e(_0x5bf119);if(!_0x324a08(_0x5bf119)||_0x4e0d65===_0xffbb55(_0x4e0d65)['root'])throw new h(_0x5ae65d(0x160),_0x5ae65d(0x185)+_0x5bf119+'\x22.');return _0x4e0d65;}async function q(_0x2a021b){const _0x5b85fd=_0x5e3730;let _0x38cef5;try{_0x38cef5=await _0x2d1c6f(_0x2a021b,{'withFileTypes':!0x0});}catch(_0x48d6ea){if(G(_0x48d6ea)&&_0x48d6ea['code']===_0x5b85fd(0x1f6))return{'resourceCount':0x0,'byteCount':0x0};throw _0x48d6ea;}let _0x101620=0x0,_0x18dfb7=0x0;for(let _0x2827fe of _0x38cef5){let _0x3dfcac=_0x553560(_0x2a021b,_0x2827fe['name']);if(_0x2827fe['isDirectory']()){let _0x2616a6=await q(_0x3dfcac);_0x101620+=_0x2616a6[_0x5b85fd(0x1d9)],_0x18dfb7+=_0x2616a6[_0x5b85fd(0x1c1)];}else{if(_0x2827fe[_0x5b85fd(0x161)]()&&_0x2827fe[_0x5b85fd(0x207)]['endsWith'](_0x5b85fd(0x201))){let _0x58a673=await _0x8b4291(_0x3dfcac);_0x101620++,_0x18dfb7+=_0x58a673[_0x5b85fd(0x1c9)];}}}return{'resourceCount':_0x101620,'byteCount':_0x18dfb7};}var J=class{['location'];constructor(_0x26cbd7){const _0x5f3425=_0x5e3730;this[_0x5f3425(0x1c8)]=K(_0x26cbd7);}[_0x5e3730(0x211)](_0x3f5929){const _0x40abcd=_0x5e3730;let {registryId:_0x5ae4f6,resourceId:_0x56f139}=C(_0x3f5929);return _0x553560(this[_0x40abcd(0x1c8)],_0x5ae4f6,_0x56f139+'.svg');}async[_0x5e3730(0x1fd)](_0x55f230){const _0x63261e=_0x5e3730;try{return await _0x1c72ca(this[_0x63261e(0x211)](_0x55f230),_0x63261e(0x20e));}catch(_0x21b397){if(G(_0x21b397)&&_0x21b397['code']===_0x63261e(0x1f6))return;throw _0x21b397;}}async[_0x5e3730(0x1d4)](_0x7f7b08,_0x244467){const _0x11af8b=_0x5e3730;let _0x20a3c7=this[_0x11af8b(0x211)](_0x7f7b08);await _0xce22d8(_0x15aa6e(_0x20a3c7),{'recursive':!0x0});let _0x196a07=_0x553560(_0x15aa6e(_0x20a3c7),_0x11af8b(0x1b3)+process[_0x11af8b(0x1ef)]+'-'+_0x2c33c3()+_0x11af8b(0x165));try{await _0xe9db9d(_0x196a07,_0x244467,{'encoding':_0x11af8b(0x20e),'mode':0x180}),await _0x3be09a(_0x196a07,_0x20a3c7);}catch(_0x494b3a){throw await _0x19c3f1(_0x196a07)[_0x11af8b(0x17b)](()=>void 0x0),_0x494b3a;}}async[_0x5e3730(0x172)](){const _0x55ffa0=_0x5e3730;let _0x59ef6e=await q(this[_0x55ffa0(0x1c8)]);return await _0x311f6b(this[_0x55ffa0(0x1c8)],{'force':!0x0,'recursive':!0x0}),{'path':this[_0x55ffa0(0x1c8)],..._0x59ef6e};}},Y=class{async['write'](_0x47b452,_0xa499ff,_0x32beb9){await _0xce22d8(_0x47b452,{'recursive':!0x0});let _0x48267f=_0x553560(_0x47b452,_0xa499ff);return await _0xe9db9d(_0x48267f,_0x32beb9,'utf8'),_0x48267f;}},X=0x7530,ae=0xa00000,oe=0xa,se=new Set([0x12d,0x12e,0x12f,0x133,0x134]);function Z(_0x3430e4){const _0x26ca3b=_0x5e3730;return new h('resource-download-too-large',_0x26ca3b(0x1ac)+_0x3430e4+_0x26ca3b(0x186));}async function ce(_0x348f95,_0x2217d3){const _0x207fed=_0x5e3730;let _0x1dd8d8=Number(_0x348f95['headers'][_0x207fed(0x1d0)](_0x207fed(0x204)));if(Number['isFinite'](_0x1dd8d8)&&_0x1dd8d8>_0x2217d3)throw Z(_0x2217d3);if(_0x348f95['body']===null){let _0x2c2a1e=await _0x348f95[_0x207fed(0x18c)]();if(Buffer[_0x207fed(0x16b)](_0x2c2a1e)>_0x2217d3)throw Z(_0x2217d3);return _0x2c2a1e;}let _0x2c2591=_0x348f95[_0x207fed(0x168)][_0x207fed(0x1b4)](),_0x27d4b5=[],_0x36b1c1=0x0;try{for(;;){let _0x975b94=await _0x2c2591[_0x207fed(0x1fd)]();if(_0x975b94[_0x207fed(0x1e2)])break;if(_0x36b1c1+=_0x975b94[_0x207fed(0x188)]['byteLength'],_0x36b1c1>_0x2217d3)throw await _0x2c2591[_0x207fed(0x193)]()['catch'](()=>void 0x0),Z(_0x2217d3);_0x27d4b5[_0x207fed(0x195)](_0x975b94[_0x207fed(0x188)]);}}finally{_0x2c2591[_0x207fed(0x18b)]();}try{return new TextDecoder(_0x207fed(0x1aa),{'fatal':!0x0})[_0x207fed(0x180)](Buffer[_0x207fed(0x203)](_0x27d4b5,_0x36b1c1));}catch{throw new h(_0x207fed(0x198),_0x207fed(0x1b6));}}var Q=class{[_0x5e3730(0x219)];[_0x5e3730(0x18e)];[_0x5e3730(0x183)];[_0x5e3730(0x1d7)];constructor(_0x4bdfe6={}){const _0x62e798=_0x5e3730;this[_0x62e798(0x219)]=_0x4bdfe6[_0x62e798(0x1e8)]??fetch,this[_0x62e798(0x18e)]=_0x4bdfe6[_0x62e798(0x18e)]??X,this[_0x62e798(0x183)]=_0x4bdfe6[_0x62e798(0x183)]??ae,this[_0x62e798(0x1d7)]=_0x4bdfe6['maxRedirects']??oe;}async[_0x5e3730(0x1ee)](_0x3b4cb6){const _0x3c5ae0=_0x5e3730;let _0x1bea4e=new URL(_0x3b4cb6);if(_0x1bea4e[_0x3c5ae0(0x1fe)]!==_0x3c5ae0(0x1a5))throw new h('resource-download-insecure',_0x3c5ae0(0x1b2));let _0x57eafc=new AbortController(),_0x2e1ce4=setTimeout(()=>_0x57eafc['abort'](),this[_0x3c5ae0(0x18e)]);try{let _0x2883ea=_0x1bea4e;for(let _0x135560=0x0;;_0x135560++){let _0x12d62d=await this[_0x3c5ae0(0x219)](_0x2883ea,{'redirect':_0x3c5ae0(0x187),'signal':_0x57eafc['signal']});if(se['has'](_0x12d62d['status'])){if(_0x135560>=this[_0x3c5ae0(0x1d7)])throw new h(_0x3c5ae0(0x1bc),'Resource\x20request\x20followed\x20too\x20many\x20redirects;\x20maximum\x20'+this['maxRedirects']+'.');let _0xe44b3b=_0x12d62d[_0x3c5ae0(0x1e4)][_0x3c5ae0(0x1d0)](_0x3c5ae0(0x1c8));if(_0xe44b3b===null)throw new h('resource-download-invalid-redirect',_0x3c5ae0(0x162)+_0x12d62d['status']+_0x3c5ae0(0x1d5));let _0x2b30f5;try{_0x2b30f5=new URL(_0xe44b3b,_0x2883ea);}catch{throw new h(_0x3c5ae0(0x18a),_0x3c5ae0(0x215));}if(_0x2b30f5[_0x3c5ae0(0x1fe)]!==_0x3c5ae0(0x1a5))throw new h(_0x3c5ae0(0x20c),_0x3c5ae0(0x164));_0x2883ea=_0x2b30f5;continue;}if(!_0x12d62d['ok'])throw new h(_0x3c5ae0(0x1e5),_0x3c5ae0(0x162)+_0x12d62d['status']+'.');if(_0x12d62d['url']!==''&&new URL(_0x12d62d[_0x3c5ae0(0x21b)])[_0x3c5ae0(0x1fe)]!=='https:')throw new h(_0x3c5ae0(0x20c),_0x3c5ae0(0x164));let _0x358fed=await ce(_0x12d62d,this[_0x3c5ae0(0x183)]);if(!V(_0x358fed))throw new h(_0x3c5ae0(0x1bb),_0x3c5ae0(0x1a3));return _0x358fed;}}catch(_0x3973ea){throw _0x57eafc[_0x3c5ae0(0x21a)][_0x3c5ae0(0x1a1)]?new h(_0x3c5ae0(0x15d),_0x3c5ae0(0x166)+this[_0x3c5ae0(0x18e)]+_0x3c5ae0(0x1a2)):_0x3973ea;}finally{clearTimeout(_0x2e1ce4);}}};function $(_0x1fed30){const _0x2aea20=_0x5e3730;try{return JSON[_0x2aea20(0x1f3)](_0xce1fe3(_0x1fed30,_0x2aea20(0x20e)));}catch(_0x583d01){throw new h(_0x2aea20(0x1ff),'Cannot\x20read\x20resource\x20manifest\x20at\x20'+_0x1fed30+':\x20'+(_0x583d01 instanceof Error?_0x583d01[_0x2aea20(0x189)]:String(_0x583d01)),void 0x0,{'cause':_0x583d01});}}function le(_0x1a8a10){const _0x2a5981=_0x5e3730;let _0x4ddec1;return()=>(_0x4ddec1??=W({'manifest':$(_0x1a8a10['manifestPath']),'cache':new J(_0x1a8a10[_0x2a5981(0x202)]),'downloader':new Q(_0x1a8a10['downloader']),'output':new Y()}),_0x4ddec1);}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
|
+
function _0x2b7f(_0x5ecc42,_0x271a6c){_0x5ecc42=_0x5ecc42-0x1ae;const _0x54fd31=_0x54fd();let _0x2b7f7c=_0x54fd31[_0x5ecc42];return _0x2b7f7c;}const _0x19c91c=_0x2b7f;(function(_0x5abb1a,_0x254e1d){const _0x43f1bd=_0x2b7f,_0x6c601d=_0x5abb1a();while(!![]){try{const _0x461ba4=-parseInt(_0x43f1bd(0x207))/0x1*(parseInt(_0x43f1bd(0x22c))/0x2)+-parseInt(_0x43f1bd(0x237))/0x3+-parseInt(_0x43f1bd(0x20a))/0x4*(parseInt(_0x43f1bd(0x24d))/0x5)+parseInt(_0x43f1bd(0x20c))/0x6+-parseInt(_0x43f1bd(0x1e7))/0x7+-parseInt(_0x43f1bd(0x228))/0x8+parseInt(_0x43f1bd(0x273))/0x9*(parseInt(_0x43f1bd(0x217))/0xa);if(_0x461ba4===_0x254e1d)break;else _0x6c601d['push'](_0x6c601d['shift']());}catch(_0x9b2e43){_0x6c601d['push'](_0x6c601d['shift']());}}}(_0x54fd,0x8292f));function _0x54fd(){const _0x282fa8=['tags','en-US','length','manifest.registrations','body','number','catalog','concat','protocol','.source.value\x20must\x20use\x20HTTPS.','.tagIds','split','byteLength','.resource-','resource','Invalid\x20resource\x20manifest:\x20','\x20must\x20be\x20a\x20non-empty\x20string.','Failed\x20to\x20download\x20\x22','searchText','groups','].input.resources','ResourceLibraryError','get','queries','resource-registry-not-found','.groupId\x20references\x20unknown\x20group\x20\x22','\x20ms.','intrinsicSize','pid','resource-not-found','18424242WeGfiB','join','content-length','tagIds','name','filter','.groupId','].input.groups','isDirectory','\x22\x20is\x20not\x20an\x20SVG\x20document.','resource-invalid-registry-id','Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.','size','NFKC','Resource\x20search\x20needs\x20at\x20least\x20one\x20non-empty\x20query.','\x20ID\x20\x22','image','maxBytes','string','label','read','find','.payload.colorEditable','resource-export-filename-too-long','options','resource-download-too-many-redirects','registrationIndex','.order','isFile','manual','width','values','resource-cache-root-invalid','aborted','.id','resource-invalid-svg','catch','listRegistries','\x20contains\x20no\x20usable\x20localized\x20text.','Invalid\x20registry\x20ID\x20\x22','Unknown\x20resource\x20registry\x20\x22','getReader','cacheRoot','resource-manifest-invalid','registry','destination','defaultLocale','].label','Unknown\x20resource\x20\x22','isArray','.tagIds\x20references\x20unknown\x20tag\x20\x22','replace','toLowerCase','resourceIndex','].input.registryId','Resource\x20server\x20returned\x20HTTP\x20','.description','.intrinsicSize.width','https:','resource-export-failed','isFinite','.intrinsicSize.height','registries','.keywords','headers','handles','4474799AxvVhv','byteCount','Resource\x20response\x20is\x20not\x20valid\x20UTF-8.','].id','.name','Duplicate\x20registry\x20ID\x20\x22','payload','resources','cache','Invalid\x20resource\x20ID\x20\x22','includes','.tmp','download','some','registrations','height','\x20bytes.','Resource\x20request\x20followed\x20too\x20many\x20redirects;\x20maximum\x20','resource-manifest-read-failed','.intrinsicSize\x20must\x20be\x20positive.','url','map','timeoutMs','\x20without\x20a\x20Location\x20header.','Resource\x20URL\x20must\x20use\x20HTTPS.','location','description','maxRedirects','set','Invalid\x20resource\x20handle\x20\x22','ENOENT','signal','1627BCSsTI','resource-limit-invalid','\x20must\x20be\x20an\x20array.','15536mcphLC','\x20must\x20be\x20an\x20object.','563964IiRwnG','reference','Resource\x20exceeds\x20the\x20maximum\x20size\x20of\x20','Resource\x20server\x20returned\x20an\x20invalid\x20redirect\x20URL.','resource-query-empty','\x20must\x20be\x20a\x20finite\x20number.','fetchImpl','startsWith','.payload','resource-invalid-handle','].input.resources[','20hzDntu','globalIndex','code','registryById','Resource\x20response\x20is\x20not\x20an\x20SVG\x20document.','clear','type','output','Cannot\x20read\x20resource\x20manifest\x20at\x20','registrations\x20must\x20not\x20be\x20empty.','input','colorEditable','clearCache','\x22;\x20try\x20resources\x20find\x20<query>.','message','.source.value\x20must\x20be\x20a\x20URL.','export','3459792VAqXWG','registrations[','slice','Resource\x20cache\x20root\x20must\x20be\x20an\x20absolute,\x20dedicated\x20directory\x20below\x20the\x20filesystem\x20root;\x20received\x20\x22','1036xBetMQ','status','keywords','value','resource-download-too-large','.type\x20must\x20be\x20\x22image\x22.','storagePolicy','endsWith','.source.type\x20must\x20be\x20\x22url\x22.','registryId','\x22:\x20expected\x20an\x20addressable\x20filesystem-safe\x20component\x20without\x20\x22--\x22.','3177666hMdANU','resource-download-insecure-redirect','test','.source','sort','Resource\x20download\x20timed\x20out\x20after\x20','root','.svg','manifest','push','resource-download-invalid-redirect','Resource\x20search\x20limit\x20must\x20be\x20a\x20positive\x20integer;\x20received\x20\x22','downloader','path','text','handle','entries','has','write','utf8','add','order','875sKCojS','].input.tags','manifestPath','resourceCount','groupId','.storagePolicy\x20must\x20be\x20\x22reference\x22.','fetch','resource-download-invalid-svg'];_0x54fd=function(){return _0x282fa8;};return _0x54fd();}import{randomUUID as _0x2f2b18}from'node:crypto';import{mkdir as _0x147b1b,readFile as _0x2f8c48,readdir as _0x1777e5,rename as _0x3a8b8c,rm as _0x54c064,stat as _0x223d32,unlink as _0x2037ed,writeFile as _0x2c7421}from'node:fs/promises';import{dirname as _0x2f664c,isAbsolute as _0x8095c8,join as _0x29feae,parse as _0x4ce26a,resolve as _0x1f582e}from'node:path';import{readFileSync as _0x3422d9}from'node:fs';var h=class extends Error{[_0x19c91c(0x219)];[_0x19c91c(0x246)];constructor(_0x3312ec,_0x7ec013,_0xfc5f90,_0x48a711){const _0x1491f0=_0x19c91c;super(_0x7ec013,_0x48a711),this[_0x1491f0(0x219)]=_0x3312ec,this[_0x1491f0(0x246)]=_0xfc5f90,this[_0x1491f0(0x277)]=_0x1491f0(0x26a);}};function g(_0x2144f0){return _0x2144f0 instanceof h;}var _=/^[A-Za-z0-9._-]+$/u,v=0xff,y=0x4;function b(_0x2c9315){const _0x51ac93=_0x19c91c;return _[_0x51ac93(0x239)](_0x2c9315)&&_0x2c9315!=='.'&&_0x2c9315!=='..';}function x(_0x88aa52){const _0x348cf8=_0x19c91c;if(!b(_0x88aa52)||_0x88aa52[_0x348cf8(0x213)]('-')||_0x88aa52[_0x348cf8(0x1f1)]('--')||_0x88aa52[_0x348cf8(0x257)]>v)throw new h(_0x348cf8(0x1af),_0x348cf8(0x1cc)+_0x88aa52+_0x348cf8(0x236));}function S(_0xa24fff){const _0x1b1d7a=_0x19c91c;if(!b(_0xa24fff)||_0xa24fff[_0x1b1d7a(0x257)]+y>v)throw new h('resource-invalid-resource-id',_0x1b1d7a(0x1f0)+_0xa24fff+'\x22:\x20expected\x20filesystem-safe\x20characters.');}function C(_0x5b9717){const _0x31c88c=_0x19c91c;let _0x4f54c0=_0x5b9717[_0x31c88c(0x260)]('/');if(_0x4f54c0['length']!==0x2||_0x4f54c0[0x0]===''||_0x4f54c0[0x1]==='')throw new h(_0x31c88c(0x215),_0x31c88c(0x204)+_0x5b9717+'\x22;\x20expected\x20<registryId>/<resourceId>.',_0x5b9717);let _0x49c433=_0x4f54c0[0x0],_0x527032=_0x4f54c0[0x1];return x(_0x49c433),S(_0x527032),{'registryId':_0x49c433,'resourceId':_0x527032};}function ee(_0x5b1308,_0x1b2308){return x(_0x5b1308),S(_0x1b2308),_0x5b1308+'/'+_0x1b2308;}function w(_0x540fb2){const _0x547c1e=_0x19c91c;let {registryId:_0x2ef445,resourceId:_0x4090f0}=C(_0x540fb2),_0x57b762=_0x2ef445+'--'+_0x4090f0+_0x547c1e(0x23e);if(_0x57b762[_0x547c1e(0x257)]>v)throw new h(_0x547c1e(0x1bc),'Resource\x20export\x20filename\x20exceeds\x20'+v+_0x547c1e(0x1f7),_0x540fb2);return _0x57b762;}function T(_0x349904){const _0x575688=_0x19c91c;return new h(_0x575688(0x1d0),_0x575688(0x264)+_0x349904);}function E(_0x21944c,_0x2c3a45){const _0x4569eb=_0x19c91c;if(typeof _0x21944c!='object'||!_0x21944c||Array[_0x4569eb(0x1d6)](_0x21944c))throw T(_0x2c3a45+_0x4569eb(0x20b));return _0x21944c;}function D(_0x21dbd7,_0x16e1a5,_0x49a9d1=!0x1){const _0xcde75c=_0x19c91c;if(_0x49a9d1&&_0x21dbd7===void 0x0)return[];if(!Array[_0xcde75c(0x1d6)](_0x21dbd7))throw T(_0x16e1a5+_0xcde75c(0x209));return _0x21dbd7;}function O(_0x4fc67b,_0x270539){const _0x3ba532=_0x19c91c;if(typeof _0x4fc67b!=_0x3ba532(0x1b7)||_0x4fc67b==='')throw T(_0x270539+_0x3ba532(0x265));return _0x4fc67b;}function k(_0x2c961f,_0x1ff26e,_0x53f9f8=!0x1){const _0x23ccee=_0x19c91c;return D(_0x2c961f,_0x1ff26e,_0x53f9f8)[_0x23ccee(0x1fc)]((_0x49159b,_0x284ca9)=>O(_0x49159b,_0x1ff26e+'['+_0x284ca9+']'));}function A(_0x1d5217,_0x299d63){const _0x20e396=_0x19c91c;return D(_0x1d5217,_0x299d63,!0x0)[_0x20e396(0x1fc)]((_0x547d30,_0x260797)=>{if(typeof _0x547d30!='string')throw T(_0x299d63+'['+_0x260797+']\x20must\x20be\x20a\x20string.');return _0x547d30;})[_0x20e396(0x278)](_0x5b4704=>_0x5b4704!=='');}function j(_0x27d851,_0xbed9b){const _0x3be18b=_0x19c91c;if(typeof _0x27d851!=_0x3be18b(0x25a)||!Number[_0x3be18b(0x1e1)](_0x27d851))throw T(_0xbed9b+_0x3be18b(0x211));return _0x27d851;}function M(_0x2f1a41,_0x1fb5b3){if(typeof _0x2f1a41!='boolean')throw T(_0x1fb5b3+'\x20must\x20be\x20a\x20boolean.');return _0x2f1a41;}function N(_0x28e873,_0x57a5de,_0x178f3d){const _0x406d64=_0x19c91c;if(typeof _0x28e873=='string'&&_0x28e873!=='')return _0x28e873;let _0x4987b9=E(_0x28e873,_0x57a5de),_0x3e36b=_0x178f3d===void 0x0?void 0x0:_0x4987b9[_0x178f3d];if(typeof _0x3e36b==_0x406d64(0x1b7)&&_0x3e36b!=='')return _0x3e36b;let _0x2f8d93=_0x4987b9[_0x406d64(0x256)];if(typeof _0x2f8d93==_0x406d64(0x1b7)&&_0x2f8d93!=='')return _0x2f8d93;let _0x33bc6f=Object[_0x406d64(0x1c4)](_0x4987b9)[_0x406d64(0x1ba)](_0x222740=>typeof _0x222740=='string'&&_0x222740!=='');if(_0x33bc6f!==void 0x0)return _0x33bc6f;throw T(_0x57a5de+_0x406d64(0x1cb));}function P(_0x4d4afe,_0x4f9879,_0x431c7b){const _0x40be61=_0x19c91c;try{_0x431c7b===_0x40be61(0x1d1)?x(_0x4d4afe):S(_0x4d4afe);}catch(_0x1b9163){throw T(_0x4f9879+':\x20'+(_0x1b9163 instanceof Error?_0x1b9163[_0x40be61(0x225)]:String(_0x1b9163)));}}function F(_0x5a8434,_0x2e70c2,_0x1fd145){const _0x5cb2c6=_0x19c91c;let _0x389667=new Map();for(let [_0x2c053a,_0x488d24]of D(_0x5a8434,_0x2e70c2,!0x0)[_0x5cb2c6(0x247)]()){let _0x2fe00c=E(_0x488d24,_0x2e70c2+'['+_0x2c053a+']'),_0x4b39ea=O(_0x2fe00c['id'],_0x2e70c2+'['+_0x2c053a+_0x5cb2c6(0x1ea));if(P(_0x4b39ea,_0x2e70c2+'['+_0x2c053a+_0x5cb2c6(0x1ea),'resource'),_0x389667[_0x5cb2c6(0x248)](_0x4b39ea))throw T('Duplicate\x20'+_0x2e70c2+_0x5cb2c6(0x1b4)+_0x4b39ea+'\x22.');_0x389667['set'](_0x4b39ea,N(_0x2fe00c['label'],_0x2e70c2+'['+_0x2c053a+_0x5cb2c6(0x1d4),_0x1fd145));}return _0x389667;}function I(_0x118717,_0x71a2b5){const _0x1eccd6=_0x19c91c;let _0x5abf64=E(_0x118717[_0x1eccd6(0x270)],_0x71a2b5+'.intrinsicSize'),_0x3f1bfd=j(_0x5abf64[_0x1eccd6(0x1c3)],_0x71a2b5+_0x1eccd6(0x1de)),_0x491e6d=j(_0x5abf64[_0x1eccd6(0x1f6)],_0x71a2b5+_0x1eccd6(0x1e2));if(_0x3f1bfd<=0x0||_0x491e6d<=0x0)throw T(_0x71a2b5+_0x1eccd6(0x1fa));return{'width':_0x3f1bfd,'height':_0x491e6d};}function L(_0x599e62,_0x2da2ce){const _0x1ecc23=_0x19c91c;if(_0x599e62[_0x1ecc23(0x21d)]!==_0x1ecc23(0x1b5))throw T(_0x2da2ce+_0x1ecc23(0x231));if(_0x599e62[_0x1ecc23(0x232)]!==_0x1ecc23(0x20d))throw T(_0x2da2ce+_0x1ecc23(0x252));let _0x32b3bc=E(_0x599e62['source'],_0x2da2ce+_0x1ecc23(0x23a));if(_0x32b3bc[_0x1ecc23(0x21d)]!=='url')throw T(_0x2da2ce+_0x1ecc23(0x234));let _0x48e51a=O(_0x32b3bc[_0x1ecc23(0x22f)],_0x2da2ce+'.source.value'),_0x16a766;try{_0x16a766=new URL(_0x48e51a);}catch{throw T(_0x2da2ce+_0x1ecc23(0x226));}if(_0x16a766[_0x1ecc23(0x25d)]!==_0x1ecc23(0x1df))throw T(_0x2da2ce+_0x1ecc23(0x25e));return _0x48e51a;}function R(_0x1a1005){const _0x56fb23=_0x19c91c;return _0x1a1005['normalize'](_0x56fb23(0x1b2))[_0x56fb23(0x1d9)]()['trim']()[_0x56fb23(0x1d8)](/\s+/gu,'\x20');}function z(_0x2b973e){const _0x12911b=_0x19c91c;let _0x4455d0=E(_0x2b973e,_0x12911b(0x23f)),_0x22d1e3=new Map(),_0x284c4e=new Map(),_0x10906c=[],_0x5a6c67=[],_0x23d4e5=new Set(),_0x3dfab2=0x0;for(let [_0x130fa0,_0x515cba]of D(_0x4455d0[_0x12911b(0x1f5)],_0x12911b(0x258))[_0x12911b(0x247)]()){let _0x4f376e=E(E(_0x515cba,_0x12911b(0x229)+_0x130fa0+']')[_0x12911b(0x221)],'registrations['+_0x130fa0+'].input'),_0x183d30=O(_0x4f376e['registryId'],_0x12911b(0x229)+_0x130fa0+_0x12911b(0x1db));if(P(_0x183d30,_0x12911b(0x229)+_0x130fa0+_0x12911b(0x1db),_0x12911b(0x1d1)),_0x22d1e3[_0x12911b(0x248)](_0x183d30))throw T(_0x12911b(0x1ec)+_0x183d30+'\x22.');let _0x6d3087=_0x4f376e[_0x12911b(0x1d3)]===void 0x0?void 0x0:O(_0x4f376e[_0x12911b(0x1d3)],_0x12911b(0x229)+_0x130fa0+'].input.defaultLocale'),_0x1201d5=F(_0x4f376e[_0x12911b(0x268)],_0x12911b(0x229)+_0x130fa0+_0x12911b(0x27a),_0x6d3087),_0x1fe1e3=F(_0x4f376e['tags'],'registrations['+_0x130fa0+_0x12911b(0x24e),_0x6d3087),_0x52176f=[];for(let [_0x5e58c5,_0x29ba2b]of D(_0x4f376e['resources'],_0x12911b(0x229)+_0x130fa0+_0x12911b(0x269))[_0x12911b(0x247)]()){let _0x1d65fe=_0x12911b(0x229)+_0x130fa0+_0x12911b(0x216)+_0x5e58c5+']',_0x569d76=E(_0x29ba2b,_0x1d65fe),_0xa06dee=O(_0x569d76['id'],_0x1d65fe+'.id');P(_0xa06dee,_0x1d65fe+_0x12911b(0x1c7),_0x12911b(0x263));let _0x4bcdba=ee(_0x183d30,_0xa06dee);if(_0x284c4e[_0x12911b(0x248)](_0x4bcdba))throw T('Duplicate\x20resource\x20handle\x20\x22'+_0x4bcdba+'\x22.');let _0x5ab815;try{_0x5ab815=w(_0x4bcdba);}catch(_0x44bd3e){throw T(_0x1d65fe+':\x20'+(_0x44bd3e instanceof Error?_0x44bd3e[_0x12911b(0x225)]:String(_0x44bd3e)));}if(_0x23d4e5[_0x12911b(0x248)](_0x5ab815))throw T('Duplicate\x20export\x20filename\x20\x22'+_0x5ab815+'\x22.');_0x23d4e5[_0x12911b(0x24b)](_0x5ab815);let _0x417848=_0x569d76['groupId']===void 0x0?void 0x0:O(_0x569d76[_0x12911b(0x251)],_0x1d65fe+_0x12911b(0x279));if(_0x417848!==void 0x0&&!_0x1201d5[_0x12911b(0x248)](_0x417848))throw T(_0x1d65fe+_0x12911b(0x26e)+_0x417848+'\x22.');let _0x533cb3=k(_0x569d76[_0x12911b(0x276)],_0x1d65fe+_0x12911b(0x25f),!0x0);for(let _0x3f5f11 of _0x533cb3)if(!_0x1fe1e3[_0x12911b(0x248)](_0x3f5f11))throw T(_0x1d65fe+_0x12911b(0x1d7)+_0x3f5f11+'\x22.');let _0x1513ac=A(_0x569d76['keywords'],_0x1d65fe+_0x12911b(0x1e4)),_0x295c94=N(_0x569d76['name'],_0x1d65fe+_0x12911b(0x1eb),_0x6d3087),_0x3189=_0x569d76[_0x12911b(0x201)]===void 0x0?void 0x0:N(_0x569d76[_0x12911b(0x201)],_0x1d65fe+_0x12911b(0x1dd),_0x6d3087),_0x507a47=_0x417848===void 0x0?null:{'id':_0x417848,'label':_0x1201d5[_0x12911b(0x26b)](_0x417848)},_0x4458f6=_0x533cb3[_0x12911b(0x1fc)](_0x27d830=>({'id':_0x27d830,'label':_0x1fe1e3[_0x12911b(0x26b)](_0x27d830)})),_0x11a277=E(_0x569d76[_0x12911b(0x1ed)],_0x1d65fe+_0x12911b(0x214)),_0x178057=_0x569d76[_0x12911b(0x24c)]===void 0x0?null:j(_0x569d76['order'],_0x1d65fe+_0x12911b(0x1c0)),_0x418530=M(_0x11a277[_0x12911b(0x222)],_0x1d65fe+_0x12911b(0x1bb)),_0x115a12={'handle':_0x4bcdba,'registryId':_0x183d30,'id':_0xa06dee,'name':_0x295c94,..._0x3189===void 0x0?{}:{'description':_0x3189},'group':_0x507a47,'tags':_0x4458f6,'keywords':_0x1513ac,'order':_0x178057,'intrinsicSize':I(_0x11a277,_0x1d65fe+'.payload'),'colorEditable':_0x418530,'sourceUrl':L(_0x11a277,_0x1d65fe+_0x12911b(0x214)),'registrationIndex':_0x130fa0,'resourceIndex':_0x5e58c5,'globalIndex':_0x3dfab2,'searchText':R([_0x295c94,_0x3189,_0x507a47?.[_0x12911b(0x1b8)],..._0x4458f6['map'](_0x1ad7a9=>_0x1ad7a9[_0x12911b(0x1b8)]),..._0x1513ac]['filter'](_0x5d3ad9=>_0x5d3ad9!==void 0x0)[_0x12911b(0x274)]('\x20'))};_0x3dfab2++,_0x52176f['push'](_0x115a12),_0x5a6c67[_0x12911b(0x240)](_0x115a12),_0x284c4e['set'](_0x4bcdba,_0x115a12);}let _0x47660f={'id':_0x183d30,'groups':_0x1201d5,'tags':_0x1fe1e3,'resources':_0x52176f};_0x10906c['push'](_0x47660f),_0x22d1e3[_0x12911b(0x203)](_0x183d30,_0x47660f);}if(_0x10906c[_0x12911b(0x257)]===0x0)throw T(_0x12911b(0x220));return{'registries':_0x10906c,'registryById':_0x22d1e3,'resourceByHandle':_0x284c4e,'resources':_0x5a6c67};}function B(_0x578571,_0x19dcce){const _0x4a0070=_0x19c91c;C(_0x19dcce);let _0x584714=_0x578571['resourceByHandle'][_0x4a0070(0x26b)](_0x19dcce);if(_0x584714===void 0x0)throw new h(_0x4a0070(0x272),_0x4a0070(0x1d5)+_0x19dcce+_0x4a0070(0x224),_0x19dcce);return _0x584714;}function te(_0x50472e){const _0x43c980=_0x19c91c;return _0x50472e[_0x43c980(0x1e3)][_0x43c980(0x1fc)](_0x102c7b=>({'id':_0x102c7b['id'],'resourceCount':_0x102c7b['resources']['length'],'groupCount':_0x102c7b[_0x43c980(0x268)][_0x43c980(0x1b1)],'tagCount':_0x102c7b[_0x43c980(0x255)][_0x43c980(0x1b1)],'colorEditableCount':_0x102c7b[_0x43c980(0x1ee)][_0x43c980(0x278)](_0x5a2490=>_0x5a2490[_0x43c980(0x222)])['length']}));}function ne(_0xc67f93){const _0xb3800a=_0x19c91c;return{'handle':_0xc67f93[_0xb3800a(0x246)],'registryId':_0xc67f93[_0xb3800a(0x235)],'id':_0xc67f93['id'],'name':_0xc67f93[_0xb3800a(0x277)],'group':_0xc67f93['group'],'tags':_0xc67f93[_0xb3800a(0x255)],'keywords':_0xc67f93[_0xb3800a(0x22e)],'order':_0xc67f93['order'],'intrinsicSize':_0xc67f93[_0xb3800a(0x270)],'colorEditable':_0xc67f93[_0xb3800a(0x222)]};}function re(_0x1eb7e1,_0x20085a){const _0x30a735=_0x19c91c;let _0x2f2ec5=(_0x1eb7e1[_0x30a735(0x24c)]??_0x1eb7e1[_0x30a735(0x218)])-(_0x20085a[_0x30a735(0x24c)]??_0x20085a[_0x30a735(0x218)]);if(_0x2f2ec5!==0x0)return _0x2f2ec5;let _0x281922=_0x1eb7e1[_0x30a735(0x1bf)]-_0x20085a['registrationIndex'];if(_0x281922!==0x0)return _0x281922;let _0x128658=_0x1eb7e1[_0x30a735(0x1da)]-_0x20085a[_0x30a735(0x1da)];return _0x128658===0x0?_0x1eb7e1[_0x30a735(0x246)]['localeCompare'](_0x20085a[_0x30a735(0x246)]):_0x128658;}function ie(_0x5e24c0,_0x8e82c4){const _0x5c7ec6=_0x19c91c;let _0x4e0663=_0x8e82c4[_0x5c7ec6(0x26c)][_0x5c7ec6(0x1fc)](R)[_0x5c7ec6(0x278)](_0x30a5c4=>_0x30a5c4!=='');if(_0x4e0663[_0x5c7ec6(0x257)]===0x0)throw new h(_0x5c7ec6(0x210),_0x5c7ec6(0x1b3));let _0x4242e4=new Set(_0x8e82c4['registries']??[]);for(let _0x2ba7e2 of _0x4242e4)if(!_0x5e24c0[_0x5c7ec6(0x21a)][_0x5c7ec6(0x248)](_0x2ba7e2))throw new h(_0x5c7ec6(0x26d),_0x5c7ec6(0x1cd)+_0x2ba7e2+'\x22.');let _0x28dd0f=_0x8e82c4['limit']??_0x5e24c0[_0x5c7ec6(0x1ee)][_0x5c7ec6(0x257)];if(!Number['isInteger'](_0x28dd0f)||_0x28dd0f<0x1)throw new h(_0x5c7ec6(0x208),_0x5c7ec6(0x242)+_0x28dd0f+'\x22.');let _0x5458f8=_0x5e24c0[_0x5c7ec6(0x1ee)][_0x5c7ec6(0x278)](_0x13d7a9=>_0x4242e4['size']===0x0||_0x4242e4[_0x5c7ec6(0x248)](_0x13d7a9[_0x5c7ec6(0x235)]))[_0x5c7ec6(0x278)](_0x575ccc=>_0x4e0663[_0x5c7ec6(0x1f4)](_0x43b9f4=>_0x575ccc[_0x5c7ec6(0x267)][_0x5c7ec6(0x1f1)](_0x43b9f4)))[_0x5c7ec6(0x23b)](re);return{'resources':_0x5458f8[_0x5c7ec6(0x22a)](0x0,_0x28dd0f)['map'](ne),'total':_0x5458f8[_0x5c7ec6(0x257)]};}function V(_0x31855b){return/^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[^]*?-->\s*)*<svg(?:\s|>)/iu['test'](_0x31855b);}function H(_0x283137,_0x40ab9c){const _0x639676=_0x19c91c;return g(_0x40ab9c)?{'handle':_0x283137,'code':_0x40ab9c[_0x639676(0x219)],'message':_0x40ab9c['message']}:{'handle':_0x283137,'code':_0x639676(0x1e0),'message':_0x40ab9c instanceof Error?_0x40ab9c[_0x639676(0x225)]:String(_0x40ab9c)};}var U=class{[_0x19c91c(0x1bd)];[_0x19c91c(0x25b)];constructor(_0x9ece37){const _0x1b52e0=_0x19c91c;this['options']=_0x9ece37,this[_0x1b52e0(0x25b)]=z(_0x9ece37[_0x1b52e0(0x23f)]);}get['cacheLocation'](){const _0x675322=_0x19c91c;return this[_0x675322(0x1bd)]['cache']['location'];}[_0x19c91c(0x1ca)](){const _0x313c4f=_0x19c91c;return te(this[_0x313c4f(0x25b)]);}[_0x19c91c(0x1ba)](_0x1288a1){return ie(this['catalog'],_0x1288a1);}async[_0x19c91c(0x1b9)](_0x1a1f1b){const _0x340764=_0x19c91c;let _0x130c0d=B(this[_0x340764(0x25b)],_0x1a1f1b['handle']),_0x2a3810=await this[_0x340764(0x1bd)][_0x340764(0x1ef)]['read'](_0x1a1f1b[_0x340764(0x246)]);if(_0x2a3810!==void 0x0&&V(_0x2a3810))return{'handle':_0x1a1f1b['handle'],'svg':_0x2a3810};let _0x7acbdc;try{_0x7acbdc=await this[_0x340764(0x1bd)][_0x340764(0x243)][_0x340764(0x1f3)](_0x130c0d['sourceUrl']);}catch(_0x46295d){throw g(_0x46295d)?_0x46295d:new h('resource-download-failed',_0x340764(0x266)+_0x1a1f1b[_0x340764(0x246)]+'\x22:\x20'+(_0x46295d instanceof Error?_0x46295d['message']:String(_0x46295d)),_0x1a1f1b[_0x340764(0x246)],{'cause':_0x46295d});}if(!V(_0x7acbdc))throw new h(_0x340764(0x1c8),'Downloaded\x20resource\x20\x22'+_0x1a1f1b['handle']+_0x340764(0x1ae),_0x1a1f1b[_0x340764(0x246)]);return await this['options'][_0x340764(0x1ef)][_0x340764(0x249)](_0x1a1f1b[_0x340764(0x246)],_0x7acbdc),{'handle':_0x1a1f1b[_0x340764(0x246)],'svg':_0x7acbdc};}async[_0x19c91c(0x227)](_0x11cb35){const _0x4946e0=_0x19c91c;let _0x573117=[],_0x53dbc4=[];for(let _0x4501ac of _0x11cb35[_0x4946e0(0x1e6)])try{let {svg:_0x38f2c0}=await this[_0x4946e0(0x1b9)]({'handle':_0x4501ac}),_0x2235e5=await this[_0x4946e0(0x1bd)][_0x4946e0(0x21e)][_0x4946e0(0x249)](_0x11cb35[_0x4946e0(0x1d2)],w(_0x4501ac),_0x38f2c0);_0x573117[_0x4946e0(0x240)]({'handle':_0x4501ac,'path':_0x2235e5});}catch(_0x32f7e8){_0x53dbc4['push'](H(_0x4501ac,_0x32f7e8));}return{'exported':_0x573117,'failed':_0x53dbc4};}async[_0x19c91c(0x223)](){const _0x2d608e=_0x19c91c;return await this[_0x2d608e(0x1bd)][_0x2d608e(0x1ef)][_0x2d608e(0x21c)]();}};function W(_0x286d2a){return new U(_0x286d2a);}function G(_0x7032ac){return _0x7032ac instanceof Error&&'code'in _0x7032ac;}function K(_0x35016b){const _0x53e10d=_0x19c91c;let _0x424446=_0x1f582e(_0x35016b);if(!_0x8095c8(_0x35016b)||_0x424446===_0x4ce26a(_0x424446)[_0x53e10d(0x23d)])throw new h(_0x53e10d(0x1c5),_0x53e10d(0x22b)+_0x35016b+'\x22.');return _0x424446;}async function q(_0x3c678e){const _0x17e229=_0x19c91c;let _0x27b93d;try{_0x27b93d=await _0x1777e5(_0x3c678e,{'withFileTypes':!0x0});}catch(_0x150a8f){if(G(_0x150a8f)&&_0x150a8f[_0x17e229(0x219)]===_0x17e229(0x205))return{'resourceCount':0x0,'byteCount':0x0};throw _0x150a8f;}let _0x21b2ec=0x0,_0x5ad8d7=0x0;for(let _0x487b35 of _0x27b93d){let _0x2ab7d3=_0x29feae(_0x3c678e,_0x487b35[_0x17e229(0x277)]);if(_0x487b35[_0x17e229(0x27b)]()){let _0x2709d3=await q(_0x2ab7d3);_0x21b2ec+=_0x2709d3[_0x17e229(0x250)],_0x5ad8d7+=_0x2709d3[_0x17e229(0x1e8)];}else{if(_0x487b35[_0x17e229(0x1c1)]()&&_0x487b35[_0x17e229(0x277)][_0x17e229(0x233)](_0x17e229(0x23e))){let _0x59f8f9=await _0x223d32(_0x2ab7d3);_0x21b2ec++,_0x5ad8d7+=_0x59f8f9[_0x17e229(0x1b1)];}}}return{'resourceCount':_0x21b2ec,'byteCount':_0x5ad8d7};}var J=class{[_0x19c91c(0x200)];constructor(_0x33b1bc){const _0x112a08=_0x19c91c;this[_0x112a08(0x200)]=K(_0x33b1bc);}[_0x19c91c(0x244)](_0x56d153){const _0x1a4c28=_0x19c91c;let {registryId:_0x3c9cf2,resourceId:_0x2f84e0}=C(_0x56d153);return _0x29feae(this[_0x1a4c28(0x200)],_0x3c9cf2,_0x2f84e0+_0x1a4c28(0x23e));}async[_0x19c91c(0x1b9)](_0x43e7c4){const _0xbed78c=_0x19c91c;try{return await _0x2f8c48(this['path'](_0x43e7c4),_0xbed78c(0x24a));}catch(_0xe1f71){if(G(_0xe1f71)&&_0xe1f71[_0xbed78c(0x219)]===_0xbed78c(0x205))return;throw _0xe1f71;}}async[_0x19c91c(0x249)](_0x51e7d4,_0x56a884){const _0x131dc8=_0x19c91c;let _0x7534eb=this['path'](_0x51e7d4);await _0x147b1b(_0x2f664c(_0x7534eb),{'recursive':!0x0});let _0x4860d8=_0x29feae(_0x2f664c(_0x7534eb),_0x131dc8(0x262)+process[_0x131dc8(0x271)]+'-'+_0x2f2b18()+_0x131dc8(0x1f2));try{await _0x2c7421(_0x4860d8,_0x56a884,{'encoding':_0x131dc8(0x24a),'mode':0x180}),await _0x3a8b8c(_0x4860d8,_0x7534eb);}catch(_0x5e52a3){throw await _0x2037ed(_0x4860d8)[_0x131dc8(0x1c9)](()=>void 0x0),_0x5e52a3;}}async[_0x19c91c(0x21c)](){const _0x56d12c=_0x19c91c;let _0x86a72f=await q(this[_0x56d12c(0x200)]);return await _0x54c064(this[_0x56d12c(0x200)],{'force':!0x0,'recursive':!0x0}),{'path':this[_0x56d12c(0x200)],..._0x86a72f};}},Y=class{async[_0x19c91c(0x249)](_0x28ac3c,_0x32c4be,_0x4c100d){const _0xf04f5=_0x19c91c;await _0x147b1b(_0x28ac3c,{'recursive':!0x0});let _0x1e53a7=_0x29feae(_0x28ac3c,_0x32c4be);return await _0x2c7421(_0x1e53a7,_0x4c100d,_0xf04f5(0x24a)),_0x1e53a7;}},X=0x7530,ae=0xa00000,oe=0xa,se=new Set([0x12d,0x12e,0x12f,0x133,0x134]);function Z(_0x44b768){const _0x1eaf14=_0x19c91c;return new h(_0x1eaf14(0x230),_0x1eaf14(0x20e)+_0x44b768+_0x1eaf14(0x1f7));}async function ce(_0x1f7f54,_0x3f0eec){const _0x3f3351=_0x19c91c;let _0x5df6ad=Number(_0x1f7f54[_0x3f3351(0x1e5)]['get'](_0x3f3351(0x275)));if(Number[_0x3f3351(0x1e1)](_0x5df6ad)&&_0x5df6ad>_0x3f0eec)throw Z(_0x3f0eec);if(_0x1f7f54['body']===null){let _0x6ea9aa=await _0x1f7f54[_0x3f3351(0x245)]();if(Buffer[_0x3f3351(0x261)](_0x6ea9aa)>_0x3f0eec)throw Z(_0x3f0eec);return _0x6ea9aa;}let _0x31a277=_0x1f7f54[_0x3f3351(0x259)][_0x3f3351(0x1ce)](),_0x11cd20=[],_0x52ffdf=0x0;try{for(;;){let _0x17b6f1=await _0x31a277[_0x3f3351(0x1b9)]();if(_0x17b6f1['done'])break;if(_0x52ffdf+=_0x17b6f1[_0x3f3351(0x22f)][_0x3f3351(0x261)],_0x52ffdf>_0x3f0eec)throw await _0x31a277['cancel']()[_0x3f3351(0x1c9)](()=>void 0x0),Z(_0x3f0eec);_0x11cd20['push'](_0x17b6f1[_0x3f3351(0x22f)]);}}finally{_0x31a277['releaseLock']();}try{return new TextDecoder('utf-8',{'fatal':!0x0})['decode'](Buffer[_0x3f3351(0x25c)](_0x11cd20,_0x52ffdf));}catch{throw new h('resource-download-invalid-utf8',_0x3f3351(0x1e9));}}var Q=class{[_0x19c91c(0x212)];[_0x19c91c(0x1fd)];[_0x19c91c(0x1b6)];['maxRedirects'];constructor(_0x95daa9={}){const _0x501924=_0x19c91c;this['fetchImpl']=_0x95daa9[_0x501924(0x253)]??fetch,this[_0x501924(0x1fd)]=_0x95daa9[_0x501924(0x1fd)]??X,this[_0x501924(0x1b6)]=_0x95daa9[_0x501924(0x1b6)]??ae,this['maxRedirects']=_0x95daa9[_0x501924(0x202)]??oe;}async['download'](_0x129849){const _0x462e29=_0x19c91c;let _0x4803e9=new URL(_0x129849);if(_0x4803e9[_0x462e29(0x25d)]!=='https:')throw new h('resource-download-insecure',_0x462e29(0x1ff));let _0x278c69=new AbortController(),_0x3a41da=setTimeout(()=>_0x278c69['abort'](),this['timeoutMs']);try{let _0x576d5a=_0x4803e9;for(let _0x3a6560=0x0;;_0x3a6560++){let _0xee2293=await this[_0x462e29(0x212)](_0x576d5a,{'redirect':_0x462e29(0x1c2),'signal':_0x278c69[_0x462e29(0x206)]});if(se[_0x462e29(0x248)](_0xee2293[_0x462e29(0x22d)])){if(_0x3a6560>=this[_0x462e29(0x202)])throw new h(_0x462e29(0x1be),_0x462e29(0x1f8)+this[_0x462e29(0x202)]+'.');let _0x5d4c53=_0xee2293['headers']['get'](_0x462e29(0x200));if(_0x5d4c53===null)throw new h(_0x462e29(0x241),_0x462e29(0x1dc)+_0xee2293[_0x462e29(0x22d)]+_0x462e29(0x1fe));let _0x567ffd;try{_0x567ffd=new URL(_0x5d4c53,_0x576d5a);}catch{throw new h(_0x462e29(0x241),_0x462e29(0x20f));}if(_0x567ffd['protocol']!==_0x462e29(0x1df))throw new h(_0x462e29(0x238),'Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.');_0x576d5a=_0x567ffd;continue;}if(!_0xee2293['ok'])throw new h('resource-download-http','Resource\x20server\x20returned\x20HTTP\x20'+_0xee2293['status']+'.');if(_0xee2293[_0x462e29(0x1fb)]!==''&&new URL(_0xee2293[_0x462e29(0x1fb)])[_0x462e29(0x25d)]!==_0x462e29(0x1df))throw new h(_0x462e29(0x238),_0x462e29(0x1b0));let _0x38061f=await ce(_0xee2293,this[_0x462e29(0x1b6)]);if(!V(_0x38061f))throw new h(_0x462e29(0x254),_0x462e29(0x21b));return _0x38061f;}}catch(_0x1697a1){throw _0x278c69[_0x462e29(0x206)][_0x462e29(0x1c6)]?new h('resource-download-timeout',_0x462e29(0x23c)+this[_0x462e29(0x1fd)]+_0x462e29(0x26f)):_0x1697a1;}finally{clearTimeout(_0x3a41da);}}};function $(_0x19498){const _0x24587e=_0x19c91c;try{return JSON['parse'](_0x3422d9(_0x19498,_0x24587e(0x24a)));}catch(_0x79b721){throw new h(_0x24587e(0x1f9),_0x24587e(0x21f)+_0x19498+':\x20'+(_0x79b721 instanceof Error?_0x79b721[_0x24587e(0x225)]:String(_0x79b721)),void 0x0,{'cause':_0x79b721});}}function le(_0x38563d){const _0x260b34=_0x19c91c;let _0xcf51c;return()=>(_0xcf51c??=W({'manifest':$(_0x38563d[_0x260b34(0x24f)]),'cache':new J(_0x38563d[_0x260b34(0x1cf)]),'downloader':new Q(_0x38563d[_0x260b34(0x243)]),'output':new Y()}),_0xcf51c);}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};
|