diff --git a/Example/harmony_use_pushy/harmony/entry/src/main/resources/rawfile/bundle.harmony.js b/Example/harmony_use_pushy/harmony/entry/src/main/resources/rawfile/bundle.harmony.js index 1c6e21af..7508c87d 100644 --- a/Example/harmony_use_pushy/harmony/entry/src/main/resources/rawfile/bundle.harmony.js +++ b/Example/harmony_use_pushy/harmony/entry/src/main/resources/rawfile/bundle.harmony.js @@ -420,37 +420,37 @@ __d((function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0]).VirtualizedList}),41 __d((function(g,r,i,a,m,e,d){'use strict';var s={pointerEvents:!0,accessible:!0,accessibilityActions:!0,accessibilityLabel:!0,accessibilityLiveRegion:!0,accessibilityRole:!0,accessibilityState:!0,accessibilityValue:!0,accessibilityHint:!0,accessibilityLanguage:!0,importantForAccessibility:!0,nativeID:!0,testID:!0,renderToHardwareTextureAndroid:!0,shouldRasterizeIOS:!0,onLayout:!0,onAccessibilityAction:!0,onAccessibilityTap:!0,onMagicTap:!0,onAccessibilityEscape:!0,collapsable:!0,needsOffscreenAlphaCompositing:!0,style:r(d[0])(r(d[1])).default},c={UIView:s,RCTView:Object.assign({},s,{removeClippedSubviews:!0})};m.exports=c}),414,[3,160]); __d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(){return(0,_r(d[8]).jsx)(_r(d[7]).PushyProvider,{client:a,children:(0,_r(d[8]).jsx)(s,{})})};var e=_r(d[0])(_r(d[1])),t=_r(d[0])(_r(d[2])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var s=i?Object.getOwnPropertyDescriptor(e,l):null;s&&(s.get||s.set)?Object.defineProperty(r,l,s):r[l]=e[l]}return r.default=e,n&&n.set(e,r),r})(_r(d[3])),r=_r(d[4]),i=_r(d[0])(_r(d[5]));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}var l=_r(d[0])(_r(d[6])).default.harmony.appKey;function s(){var o=(0,_r(d[7]).usePushy)(),l=o.client,s=o.checkUpdate,a=o.downloadUpdate,u=o.switchVersionLater,h=o.switchVersion,y=o.updateInfo,f=o.packageVersion,x=o.currentHash,j=o.progress,p=(j=void 0===j?{}:j).received,w=j.total,b=(0,n.useState)(!1),T=(0,t.default)(b,2),v=T[0],P=T[1],O=(0,n.useState)(!1),C=(0,t.default)(O,2),V=C[0],k=C[1],_=(0,n.useState)(!1),D=(0,t.default)(_,2),I=D[0],S=D[1],F=(0,n.useState)(!1),M=(0,t.default)(F,2),W=M[0],A=M[1],B=!v&&W&&(null==y?void 0:y.update);return V?(0,_r(d[8]).jsx)(i.default,{visible:!0,onClose:function(){return k(!1)}}):(0,_r(d[8]).jsxs)(r.View,{style:c.container,children:[(0,_r(d[8]).jsx)(r.Text,{style:c.welcome,children:"\u6b22\u8fce\u4f7f\u7528Pushy\u70ed\u66f4\u65b0\u670d\u52a1"}),(0,_r(d[8]).jsx)(r.View,{style:{flexDirection:'row'},children:(0,_r(d[8]).jsxs)(r.TouchableOpacity,{onPress:function(){null==l||l.setOptions({updateStrategy:v?'alwaysAlert':null}),A(v),P(!v)},style:{flexDirection:'row',alignItems:'center'},children:[(0,_r(d[8]).jsx)(r.View,{style:{width:20,height:20,borderWidth:1,borderColor:'#999',backgroundColor:v?'blue':'white',justifyContent:'center',alignItems:'center'},children:v&&(0,_r(d[8]).jsx)(r.Text,{style:{color:'white'},children:"\u2713"})}),(0,_r(d[8]).jsxs)(r.Text,{style:{marginLeft:8},children:[' ',v?'\u5f53\u524d\u4f7f\u7528':'\u5f53\u524d\u4e0d\u4f7f\u7528',"\u9ed8\u8ba4\u7684alert\u66f4\u65b0\u63d0\u793a"]})]})}),(0,_r(d[8]).jsx)(r.Image,{resizeMode:'contain',source:_r(d[9]),style:c.image}),(0,_r(d[8]).jsxs)(r.Text,{style:c.instructions,children:["\u8fd9\u662f\u7248\u672c\u4e00 ",'\n',"\u5f53\u524d\u539f\u751f\u5305\u7248\u672c\u53f7: ",f,'\n',"\u5f53\u524d\u70ed\u66f4\u65b0\u7248\u672cHash: ",x||'(\u7a7a)','\n']}),(0,_r(d[8]).jsxs)(r.Text,{children:["\u4e0b\u8f7d\u8fdb\u5ea6\uff1a",p," / ",w]}),(0,_r(d[8]).jsx)(r.TouchableOpacity,{onPress:function(){s(),A(!0)},children:(0,_r(d[8]).jsx)(r.Text,{style:c.instructions,children:"\u70b9\u51fb\u8fd9\u91cc\u68c0\u67e5\u66f4\u65b0"})}),(0,_r(d[8]).jsx)(r.TouchableOpacity,{testID:"testcase",style:{marginTop:15},onPress:function(){k(!0)},children:(0,_r(d[8]).jsxs)(r.Text,{style:c.instructions,children:["react-native-update\u7248\u672c\uff1a",null==l?void 0:l.version]})}),B&&(0,_r(d[8]).jsx)(r.View,{style:c.overlay,children:(0,_r(d[8]).jsxs)(r.View,{style:{width:'100%',backgroundColor:'#333',padding:16,flexDirection:'row',justifyContent:'space-between',alignItems:'center'},children:[(0,_r(d[8]).jsxs)(r.Text,{style:{color:'white'},children:["\u6709\u65b0\u7248\u672c(",y.name,")\u53ef\u7528\uff0c\u662f\u5426\u66f4\u65b0\uff1f"]}),(0,_r(d[8]).jsxs)(r.View,{style:{flexDirection:'row'},children:[(0,_r(d[8]).jsx)(r.TouchableOpacity,{onPress:function(){return A(!1)},style:{marginRight:10},children:(0,_r(d[8]).jsx)(r.Text,{style:{color:'white'},children:"\u53d6\u6d88"})}),(0,_r(d[8]).jsx)(r.TouchableOpacity,{onPress:(0,e.default)((function*(){A(!1),yield a(),S(!0)})),children:(0,_r(d[8]).jsx)(r.Text,{style:{color:'#2196F3'},children:"\u66f4\u65b0"})})]})]})}),I&&(0,_r(d[8]).jsx)(r.View,{style:c.overlay,children:(0,_r(d[8]).jsxs)(r.View,{style:{width:'100%',backgroundColor:'#fff',padding:16,borderBottomWidth:1,borderBottomColor:'#eee'},children:[(0,_r(d[8]).jsx)(r.View,{style:{flexDirection:'row',alignItems:'center'},children:(0,_r(d[8]).jsx)(r.Text,{children:"\u66f4\u65b0\u5df2\u5b8c\u6210\uff0c\u662f\u5426\u7acb\u5373\u91cd\u542f\uff1f"})}),(0,_r(d[8]).jsxs)(r.View,{style:{flexDirection:'row',justifyContent:'flex-end',marginTop:10},children:[(0,_r(d[8]).jsx)(r.TouchableOpacity,{onPress:function(){u(),S(!1)},style:{marginRight:20},children:(0,_r(d[8]).jsx)(r.Text,{style:{color:'#2196F3'},children:"\u4e0b\u6b21\u518d\u8bf4"})}),(0,_r(d[8]).jsx)(r.TouchableOpacity,{onPress:h,children:(0,_r(d[8]).jsx)(r.Text,{style:{color:'#2196F3'},children:"\u7acb\u5373\u91cd\u542f"})})]})]})})]})}var c=r.StyleSheet.create({overlay:{position:'absolute',top:0,left:0,right:0,bottom:0,backgroundColor:'rgba(0, 0, 0, 0.5)',justifyContent:'center',alignItems:'center'},container:{flex:1,justifyContent:'center',alignItems:'center',backgroundColor:'#F5FCFF'},welcome:{fontSize:20,textAlign:'center',margin:10},instructions:{textAlign:'center',color:'#333333',marginBottom:5},image:{}}),a=new(_r(d[7]).Pushy)({appKey:l,debug:!0})}),415,[3,289,24,143,1,416,448,417,193,449]); __d((function(g,r,_i,a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(x){var v=x.visible,k=x.onClose,j=(0,o.useState)(''),w=(0,n.default)(j,2),P=w[0],C=w[1],I=(0,o.useState)(!1),S=(0,n.default)(I,2),T=S[0],U=S[1],F=(0,o.useState)(),B=(0,n.default)(F,2),A=B[0],D=B[1],_=(0,o.useState)(!1),z=(0,n.default)(_,2),M=z[0],V=z[1],H=(0,o.useState)(''),E=(0,n.default)(H,2),L=E[0],N=E[1],O=(0,o.useMemo)((function(){return[{name:'setLocalHashInfo',invoke:function(){C(`setLocalHashInfo\n${l}\n{"version":"1.0.0","size":"19M"}`)}},{name:'getLocalHashInfo',invoke:function(){C(`getLocalHashInfo\n${l}`)}},{name:'setUuid',invoke:function(){C(`setUuid\n${s}`)}},{name:'reloadUpdate',invoke:function(){C('reloadUpdate'),D({hash:l})}},{name:'setNeedUpdateForApp',invoke:function(){C('setNeedUpdate'),D({hash:h})}},{name:'setNeedUpdateForPPK',invoke:function(){C('setNeedUpdate'),D({hash:p})}},{name:'markSuccess',invoke:function(){C('markSuccess'),D(void 0)}},{name:'downloadPatchFromPpk',invoke:function(){C('downloadPatchFromPpk'),D({updateUrl:f,hash:p,originHash:b})}},{name:'downloadPatchFromPackage',invoke:function(){C('downloadPatchFromPackage'),D({updateUrl:c,hash:h})}},{name:'downloadFullUpdate',invoke:function(){C('downloadFullUpdate'),D({updateUrl:u,hash:l})}},{name:'downloadAndInstallApk',invoke:function(){C('downloadAndInstallApk'),D({url:u,target:l,hash:l})}}]}),[]),W=(0,o.useCallback)((function(){for(var e=[],t=function(t){e.push((0,r(d[6]).jsx)(i.TouchableOpacity,{testID:O[t].name,onPress:function(){O[t].invoke()},children:(0,r(d[6]).jsx)(i.Text,{children:O[t].name})},t))},n=0;n0&&void 0!==arguments[0]?arguments[0]:h.options.server.main}/checkUpdate/${h.options.appKey}`},this.markSuccess=function(){!e.marked&&r(d[8]).isFirstTime&&(e.marked=!0,r(d[8]).PushyModule.markSuccess(),h.report({type:'markSuccess'}))},this.switchVersion=(function(){var o=(0,t.default)((function*(o){if(e.assertHash(o)&&!e.applyingUpdate)return(0,r(d[7]).log)('switchVersion: '+o),e.applyingUpdate=!0,r(d[8]).PushyModule.reloadUpdate({hash:o})}));return function(e){return o.apply(this,arguments)}})(),this.switchVersionLater=(function(){var o=(0,t.default)((function*(o){if(e.assertHash(o))return(0,r(d[7]).log)('switchVersionLater: '+o),r(d[8]).PushyModule.setNeedUpdate({hash:o})}));return function(e){return o.apply(this,arguments)}})(),this.checkUpdate=(function(){var e=(0,t.default)((function*(e){if('web'!==p.Platform.OS){if(!h.options.beforeCheckUpdate||!1!==(yield h.options.beforeCheckUpdate())){var o=Date.now();if(h.lastRespJson&&h.lastChecking&&o-h.lastChecking<5e3)return yield h.lastRespJson;h.lastChecking=o;var t,n=Object.assign({packageVersion:r(d[8]).packageVersion,hash:r(d[8]).currentVersion,buildTime:r(d[8]).buildTime,cInfo:r(d[8]).cInfo},e),s=JSON.stringify(n),l={method:'POST',headers:{Accept:'application/json','Content-Type':'application/json'},body:s};try{h.report({type:'checking',message:h.options.appKey+': '+s}),t=yield fetch(h.getCheckUrl(),l)}catch(e){h.report({type:'errorChecking',message:'Can not connect to update server. Trying backup endpoints.'});var c=yield h.getBackupEndpoints();if(c)try{t=yield(0,r(d[7]).promiseAny)(c.map((function(e){return fetch(h.getCheckUrl(e),l)})))}catch(e){h.throwIfEnabled(new Error('errorCheckingUseBackup'))}else h.throwIfEnabled(new Error('errorCheckingGetBackup'))}if(!t)return h.report({type:'errorChecking',message:'Can not connect to update server. Please check your network.'}),h.throwIfEnabled(new Error('errorChecking')),h.lastRespJson?yield h.lastRespJson:r(d[7]).emptyObj;h.lastRespJson=t.json();var u=yield h.lastRespJson;return(0,r(d[7]).log)('checking result:',u),200!==t.status&&(h.report({type:'errorChecking',message:u.message}),h.throwIfEnabled(new Error(u.message))),u}(0,r(d[7]).log)('beforeCheckUpdate \u8fd4\u56de false, \u5ffd\u7565\u68c0\u67e5')}else console.warn('web \u7aef\u4e0d\u652f\u6301\u70ed\u66f4\u65b0\u68c0\u67e5')}));return function(o){return e.apply(this,arguments)}})(),this.getBackupEndpoints=(0,t.default)((function*(){var e=h.options.server;if(!e)return[];if(e.queryUrls)try{var t=yield(0,r(d[7]).promiseAny)(e.queryUrls.map((function(e){return fetch(e)}))),n=yield t.json();(0,r(d[7]).log)('fetch endpoints:',n),Array.isArray(n)&&(e.backups=Array.from(new Set([].concat((0,o.default)(e.backups||[]),(0,o.default)(n)))))}catch(o){(0,r(d[7]).log)('failed to fetch endpoints from: ',e.queryUrls)}return e.backups})),this.downloadUpdate=(function(){var o=(0,t.default)((function*(o,t){var n=o.hash,s=o.diff,l=o.pdiff,p=o.full,c=o.paths,u=void 0===c?[]:c,f=o.name,y=o.description,w=void 0===y?'':y,k=o.metaInfo;if(h.options.beforeDownloadUpdate&&!1===(yield h.options.beforeDownloadUpdate(o)))(0,r(d[7]).log)('beforeDownloadUpdate \u8fd4\u56de false, \u5ffd\u7565\u4e0b\u8f7d');else if(o.update&&n)if(r(d[8]).rolledBackVersion!==n){if(e.downloadedHash===n)return(0,r(d[7]).log)(`duplicated downloaded hash ${e.downloadedHash}, ignored`),e.downloadedHash;if(!e.progressHandlers[n]){t&&(e.progressHandlers[n]=r(d[8]).pushyNativeEventEmitter.addListener('RCTPushyDownloadProgress',(function(e){e.hash===n&&t(e)})));var v,b='';h.report({type:'downloading'});var P=yield(0,r(d[7]).testUrls)((0,r(d[7]).joinUrls)(u,s));if(P){(0,r(d[7]).log)('downloading diff');try{yield r(d[8]).PushyModule.downloadPatchFromPpk({updateUrl:P,hash:n,originHash:r(d[8]).currentVersion}),b='diff'}catch(e){v=e,(0,r(d[7]).log)(`diff error: ${e.message}, try pdiff`)}}var U=yield(0,r(d[7]).testUrls)((0,r(d[7]).joinUrls)(u,l));if(!b&&U){(0,r(d[7]).log)('downloading pdiff');try{yield r(d[8]).PushyModule.downloadPatchFromPackage({updateUrl:U,hash:n}),b='pdiff'}catch(e){v=e,(0,r(d[7]).log)(`pdiff error: ${e.message}, try full patch`)}}var E=yield(0,r(d[7]).testUrls)((0,r(d[7]).joinUrls)(u,p));if(!b&&E){(0,r(d[7]).log)('downloading full patch');try{yield r(d[8]).PushyModule.downloadFullUpdate({updateUrl:E,hash:n}),b='full'}catch(e){v=e,(0,r(d[7]).log)(`full patch error: ${e.message}`)}}if(e.progressHandlers[n]&&(e.progressHandlers[n].remove(),delete e.progressHandlers[n]),b)return h.report({type:'downloadSuccess',data:{newVersion:n,diff:b}}),(0,r(d[7]).log)(`downloaded ${b} hash:`,n),(0,r(d[8]).setLocalHashInfo)(n,{name:f,description:w,metaInfo:k}),e.downloadedHash=n,n;if(h.report({type:'errorUpdate',data:{newVersion:n}}),v)throw v}}else(0,r(d[7]).log)(`rolledback hash ${r(d[8]).rolledBackVersion}, ignored`)}));return function(e,t){return o.apply(this,arguments)}})(),this.downloadAndInstallApk=(function(){var o=(0,t.default)((function*(o,t){if('android'===p.Platform.OS&&'downloading'!==e.apkStatus){if('downloaded'===e.apkStatus)return h.report({type:'errorInstallApk'}),void h.throwIfEnabled(new Error('errorInstallApk'));if(p.Platform.Version<=23)try{if((yield r(d[9]).PermissionsAndroid.request(r(d[9]).PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE))!==r(d[9]).PermissionsAndroid.RESULTS.GRANTED)return h.report({type:'rejectStoragePermission'}),void h.throwIfEnabled(new Error('rejectStoragePermission'))}catch(e){return h.report({type:'errorStoragePermission'}),void h.throwIfEnabled(e)}e.apkStatus='downloading',h.report({type:'downloadingApk'});var n='downloadingApk';t&&(e.progressHandlers[n]&&e.progressHandlers[n].remove(),e.progressHandlers[n]=r(d[8]).pushyNativeEventEmitter.addListener('RCTPushyDownloadProgress',(function(e){e.hash===n&&t(e)}))),yield r(d[8]).PushyModule.downloadAndInstallApk({url:o,target:'update.apk',hash:n}).catch((function(){e.apkStatus=null,h.report({type:'errorDownloadAndInstallApk'}),h.throwIfEnabled(new Error('errorDownloadAndInstallApk'))})),e.apkStatus='downloaded',e.progressHandlers[n]&&(e.progressHandlers[n].remove(),delete e.progressHandlers[n])}}));return function(e,t){return o.apply(this,arguments)}})(),('ios'===p.Platform.OS||'android'===p.Platform.OS)&&!s.appKey)throw new Error('appKey is required');this.setOptions(s),r(d[8]).isRolledBack&&this.report({type:'rollback',data:{rolledBackVersion:r(d[8]).rolledBackVersion}})}));e=u,u.progressHandlers={},u.apkStatus=null,u.marked=!1,u.applyingUpdate=!1,u.assertHash=function(o){if(e.downloadedHash){if(o===e.downloadedHash)return!0;(0,r(d[7]).log)(`use downloaded hash ${e.downloadedHash} first`)}}}),418,[3,6,289,24,13,12,1,419,420,425]); -__d((function(g,_r,i,a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.emptyObj=_e.emptyModule=void 0,_e.joinUrls=function(n,t){if(t)return n.map((function(n){return'https://'+n+'/'+t}))},_e.log=o,_e.noop=void 0,_e.promiseAny=u,_e.testUrls=void 0;var n=_r(d[0])(_r(d[1])),t=_r(d[0])(_r(d[2])),e=_r(d[0])(_r(d[3])),r=_r(d[4]);function o(){for(var n,t=arguments.length,e=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:c.options.server.main}/checkUpdate/${c.options.appKey}`},this.assertDebug=function(){return!0},this.markSuccess=function(){!e.marked&&r(d[11]).isFirstTime&&(e.marked=!0,r(d[11]).PushyModule.markSuccess(),c.report({type:'markSuccess'}))},this.switchVersion=(function(){var t=(0,l.default)((function*(t){if((0,r(d[10]).assertDev)('switchVersion()'))return e.assertHash(t)&&!e.applyingUpdate?((0,r(d[10]).log)('switchVersion: '+t),e.applyingUpdate=!0,r(d[11]).PushyModule.reloadUpdate({hash:t})):void 0}));return function(e){return t.apply(this,arguments)}})(),this.switchVersionLater=(function(){var t=(0,l.default)((function*(t){if((0,r(d[10]).assertDev)('switchVersionLater()'))return e.assertHash(t)?((0,r(d[10]).log)('switchVersionLater: '+t),r(d[11]).PushyModule.setNeedUpdate({hash:t})):void 0}));return function(e){return t.apply(this,arguments)}})(),this.checkUpdate=(function(){var e=(0,l.default)((function*(e){if(c.assertDebug()&&(0,r(d[10]).assertWeb)()){if(!c.options.beforeCheckUpdate||!1!==(yield c.options.beforeCheckUpdate())){var t=Date.now();if(c.lastRespJson&&c.lastChecking&&t-c.lastChecking<5e3)return yield c.lastRespJson;c.lastChecking=t;var o=Object.assign({packageVersion:r(d[11]).packageVersion,hash:r(d[11]).currentVersion,buildTime:r(d[11]).buildTime,cInfo:r(d[11]).cInfo},e),n=JSON.stringify(o),s=o;'ios'!==h.Platform.OS&&'android'!==h.Platform.OS||(s=n);var l,p={method:'POST',headers:{Accept:'application/json','Content-Type':'application/json'},body:s};try{c.report({type:'checking',message:c.options.appKey+': '+n}),l=yield fetch(c.getCheckUrl(),p)}catch(e){c.report({type:'errorChecking',message:`Can not connect to update server: ${e.message}. Trying backup endpoints.`});var u=yield c.getBackupEndpoints();if(u)try{l=yield(0,r(d[10]).promiseAny)(u.map((function(e){return fetch(c.getCheckUrl(e),p)})))}catch(e){c.throwIfEnabled(new Error('errorCheckingUseBackup'))}else c.throwIfEnabled(new Error('errorCheckingGetBackup'))}if(!l)return c.report({type:'errorChecking',message:'Can not connect to update server. Please check your network.'}),c.throwIfEnabled(new Error('errorChecking')),c.lastRespJson?yield c.lastRespJson:r(d[10]).emptyObj;c.lastRespJson=l.json();var f=yield c.lastRespJson;return(0,r(d[10]).log)('checking result:',f),200!==l.status&&(c.report({type:'errorChecking',message:f.message}),c.throwIfEnabled(new Error(f.message))),f}(0,r(d[10]).log)('beforeCheckUpdate returned false, skipping check')}}));return function(t){return e.apply(this,arguments)}})(),this.getBackupEndpoints=(0,l.default)((function*(){var e=c.options.server;if(!e)return[];if(e.queryUrls)try{var t=yield(0,r(d[10]).promiseAny)(e.queryUrls.map((function(e){return fetch(e)}))),o=yield t.json();(0,r(d[10]).log)('fetch endpoints:',o),Array.isArray(o)&&(e.backups=Array.from(new Set([].concat((0,s.default)(e.backups||[]),(0,s.default)(o)))))}catch(t){(0,r(d[10]).log)('failed to fetch endpoints from: ',e.queryUrls)}return e.backups})),this.downloadUpdate=(function(){var t=(0,l.default)((function*(t,o){var n=t.hash,s=t.diff,l=t.pdiff,p=t.full,u=t.paths,f=void 0===u?[]:u,y=t.name,v=t.description,w=void 0===v?'':v,k=t.metaInfo;if(c.options.beforeDownloadUpdate&&!1===(yield c.options.beforeDownloadUpdate(t)))(0,r(d[10]).log)('beforeDownloadUpdate returned false, skipping download');else if(t.update&&n)if(r(d[11]).rolledBackVersion!==n){if(e.downloadedHash===n)return(0,r(d[10]).log)(`duplicated downloaded hash ${e.downloadedHash}, ignored`),e.downloadedHash;if(!e.progressHandlers[n]){o&&('harmony'===h.Platform.OS?(console.log('\ud83d\ude01progressData0'),e.progressHandlers[n]=h.DeviceEventEmitter.addListener('RCTPushyDownloadProgress',(function(e){console.log('\ud83d\ude01progressData',e),e.hash===n&&o(e)}))):e.progressHandlers[n]=r(d[11]).pushyNativeEventEmitter.addListener('RCTPushyDownloadProgress',(function(e){e.hash===n&&o(e)})));var P,b='';c.report({type:'downloading'});var E=[],U=yield(0,r(d[10]).testUrls)((0,r(d[10]).joinUrls)(f,s));if(U){(0,r(d[10]).log)('downloading diff');try{yield r(d[11]).PushyModule.downloadPatchFromPpk({updateUrl:U,hash:n,originHash:r(d[11]).currentVersion}),b='diff'}catch(e){var S=`diff error: ${e.message}`;E.push(S),P=new Error(S),(0,r(d[10]).log)(S)}}var I=yield(0,r(d[10]).testUrls)((0,r(d[10]).joinUrls)(f,l));if(!b&&I){(0,r(d[10]).log)('downloading pdiff');try{yield r(d[11]).PushyModule.downloadPatchFromPackage({updateUrl:I,hash:n}),b='pdiff'}catch(e){var A=`pdiff error: ${e.message}`;E.push(A),P=new Error(A),(0,r(d[10]).log)(A)}}var C=yield(0,r(d[10]).testUrls)((0,r(d[10]).joinUrls)(f,p));if(!b&&C){(0,r(d[10]).log)('downloading full patch');try{yield r(d[11]).PushyModule.downloadFullUpdate({updateUrl:C,hash:n}),b='full'}catch(e){var H=`full patch error: ${e.message}`;E.push(H),P=new Error(H),(0,r(d[10]).log)(H)}}if(e.progressHandlers[n]&&(e.progressHandlers[n].remove(),delete e.progressHandlers[n]),b)return c.report({type:'downloadSuccess',data:{newVersion:n,diff:b}}),(0,r(d[10]).log)(`downloaded ${b} hash:`,n),(0,r(d[11]).setLocalHashInfo)(n,{name:y,description:w,metaInfo:k}),e.downloadedHash=n,n;if(c.report({type:'errorUpdate',data:{newVersion:n},message:E.join(';')}),P)throw P}}else(0,r(d[10]).log)(`rolledback hash ${r(d[11]).rolledBackVersion}, ignored`)}));return function(e,o){return t.apply(this,arguments)}})(),this.downloadAndInstallApk=(function(){var t=(0,l.default)((function*(t,o){if('android'===h.Platform.OS&&'downloading'!==e.apkStatus){if('downloaded'===e.apkStatus)return c.report({type:'errorInstallApk'}),void c.throwIfEnabled(new Error('errorInstallApk'));if(h.Platform.Version<=23)try{if((yield r(d[12]).PermissionsAndroid.request(r(d[12]).PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE))!==r(d[12]).PermissionsAndroid.RESULTS.GRANTED)return c.report({type:'rejectStoragePermission'}),void c.throwIfEnabled(new Error('rejectStoragePermission'))}catch(e){return c.report({type:'errorStoragePermission'}),void c.throwIfEnabled(e)}e.apkStatus='downloading',c.report({type:'downloadingApk'});var n='downloadingApk';o&&(e.progressHandlers[n]&&e.progressHandlers[n].remove(),e.progressHandlers[n]=r(d[11]).pushyNativeEventEmitter.addListener('RCTPushyDownloadProgress',(function(e){e.hash===n&&o(e)}))),yield r(d[11]).PushyModule.downloadAndInstallApk({url:t,target:'update.apk',hash:n}).catch((function(){e.apkStatus=null,c.report({type:'errorDownloadAndInstallApk'}),c.throwIfEnabled(new Error('errorDownloadAndInstallApk'))})),e.apkStatus='downloaded',e.progressHandlers[n]&&(e.progressHandlers[n].remove(),delete e.progressHandlers[n])}}));return function(e,o){return t.apply(this,arguments)}})(),('ios'===h.Platform.OS||'android'===h.Platform.OS)&&!t.appKey)throw new Error('appKey is required');this.clientType=o||'Pushy',this.options.server=y[this.clientType],this.setOptions(t),r(d[11]).isRolledBack&&this.report({type:'rollback',data:{rolledBackVersion:r(d[11]).rolledBackVersion}})}));e=w,w.progressHandlers={},w.apkStatus=null,w.marked=!1,w.applyingUpdate=!1,w.assertHash=function(t){if(e.downloadedHash){if(t===e.downloadedHash)return!0;(0,r(d[10]).log)(`use downloaded hash ${e.downloadedHash} first`)}};_e.Cresc=(function(e){function s(e){return(0,u.default)(this,s),n=this,l=s,p=[e,'Cresc'],l=(0,o.default)(l),(0,t.default)(n,f()?Reflect.construct(l,p||[],(0,o.default)(n).constructor):l.apply(n,p));var n,l,p}return(0,n.default)(s,e),(0,c.default)(s)})(w)}),418,[3,44,46,47,6,289,24,13,12,1,419,420,425]); +__d((function(g,_r,i,a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.emptyObj=_e.emptyModule=_e.assertWeb=_e.assertDev=void 0,_e.joinUrls=function(e,t){if(t)return e.map((function(e){return'https://'+e+'/'+t}))},_e.log=o,_e.noop=void 0,_e.promiseAny=u,_e.testUrls=void 0;var e=_r(d[0])(_r(d[1])),t=_r(d[0])(_r(d[2])),n=_r(d[0])(_r(d[3])),r=_r(d[4]);function o(){for(var e,t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:21;return function(){for(var o='',i=0|(arguments.length>0&&void 0!==arguments[0]?arguments[0]:t);i--;)o+=n[Math.random()*n.length|0];return o}},e.nanoid=function(){for(var n='',t=0|(arguments.length>0&&void 0!==arguments[0]?arguments[0]:21);t--;)n+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return n}}),423,[]); -__d((function(e,t,a,i,s,r,n){s.exports={name:"react-native-update",version:"10.19.6",description:"react-native hot update",main:"src/index",scripts:{prepack:"yarn submodule && yarn lint",lint:"eslint \"src/*.@(ts|tsx|js|jsx)\" && tsc --noEmit",submodule:"git submodule update --init --recursive",test:"echo \"Error: no test specified\" && exit 1","build-lib":"yarn submodule && $ANDROID_HOME/ndk/20.1.5948944/ndk-build NDK_PROJECT_PATH=android APP_BUILD_SCRIPT=android/jni/Android.mk NDK_APPLICATION_MK=android/jni/Application.mk NDK_LIBS_OUT=android/lib","build:ios-debug":"cd Example/testHotUpdate && yarn && detox build --configuration ios.sim.debug","build:ios-release":"cd Example/testHotUpdate && yarn && detox build --configuration ios.sim.release","test:ios-debug":"cd Example/testHotUpdate && detox test --configuration ios.sim.debug","test:ios-release":"cd Example/testHotUpdate && yarn detox test --configuration ios.sim.release","build:android-debug":"cd Example/testHotUpdate && yarn && detox build --configuration android.emu.debug","build:android-release":"cd Example/testHotUpdate && yarn && detox build --configuration android.emu.release","test:android-release":"cd Example/testHotUpdate && yarn detox test --configuration android.emu.release --headless --record-logs all","test:android-debug":"cd Example/testHotUpdate && detox test --configuration android.emu.debug --headless --record-logs all","e2e:ios":"npm run build:ios-release && npm run test:ios-release","e2e:android":"npm run build:android-release && npm run test:android-release","tests:emulator:prepare":"cd .github/workflows/scripts/functions && yarn && yarn build","tests:emulator:start-ci":"yarn tests:emulator:prepare && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh","tests:packager:jet-ci":"cd Example/testHotUpdate && cross-env TMPDIR=$HOME/.metro REACT_DEBUGGER=\"echo nope\" node_modules/.bin/react-native start --no-interactive","tests:ios:pod:install":"cd Example/testHotUpdate && yarn && yarn pod-install"},repository:{type:"git",url:"git+https://github.com/reactnativecn/react-native-pushy.git"},keywords:["react-native","ios","android","update"],author:"reactnativecn",license:"MIT",bugs:{url:"https://github.com/reactnativecn/react-native-pushy/issues"},peerDependencies:{react:">=16.8.0","react-native":">=0.59.0"},homepage:"https://github.com/reactnativecn/react-native-pushy#readme",dependencies:{nanoid:"^3.3.3","react-native-url-polyfill":"^2.0.0"},codegenConfig:{name:"RCTPushySpec",type:"modules",jsSrcsDir:"src"},devDependencies:{"@babel/core":"^7.25.8","@react-native/babel-preset":"^0.73.21","@react-native/eslint-config":"^0.73.2","@react-native/typescript-config":"^0.74.0","@types/fs-extra":"^11.0.4","@types/jest":"^29.5.13","@types/node":"^22.7.6","@types/react":"^18.3.11",detox:"^20.27.3",eslint:"^8.57.0","eslint-plugin-ft-flow":"^3.0.7","firebase-tools":"^13.22.1","fs-extra":"^11.2.0",jest:"^29.7.0","pod-install":"^0.2.2",prettier:"^2",react:"18.2.0","react-native":"0.73","ts-jest":"^29.2.5",typescript:"^5.6.3"},packageManager:"yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"}}),424,[]); +__d((function(e,t,a,i,s,r,n){s.exports={name:"react-native-update",version:"10.26.1",description:"react-native hot update",main:"src/index",scripts:{prepack:"yarn submodule && yarn lint",lint:"eslint \"src/*.@(ts|tsx|js|jsx)\" && tsc --noEmit",submodule:"git submodule update --init --recursive",test:"echo \"Error: no test specified\" && exit 1","build-lib":"yarn submodule && $ANDROID_HOME/ndk/20.1.5948944/ndk-build NDK_PROJECT_PATH=android APP_BUILD_SCRIPT=android/jni/Android.mk NDK_APPLICATION_MK=android/jni/Application.mk NDK_LIBS_OUT=android/lib","build:ios-debug":"cd Example/testHotUpdate && yarn && detox build --configuration ios.sim.debug","build:ios-release":"cd Example/testHotUpdate && yarn && detox build --configuration ios.sim.release","test:ios-debug":"cd Example/testHotUpdate && detox test --configuration ios.sim.debug","test:ios-release":"cd Example/testHotUpdate && yarn detox test --configuration ios.sim.release","build:android-debug":"cd Example/testHotUpdate && yarn && detox build --configuration android.emu.debug","build:android-release":"cd Example/testHotUpdate && yarn && detox build --configuration android.emu.release","test:android-release":"cd Example/testHotUpdate && yarn detox test --configuration android.emu.release --headless --record-logs all","test:android-debug":"cd Example/testHotUpdate && detox test --configuration android.emu.debug --headless --record-logs all","e2e:ios":"npm run build:ios-release && npm run test:ios-release","e2e:android":"npm run build:android-release && npm run test:android-release","tests:emulator:prepare":"cd .github/workflows/scripts/functions && yarn && yarn build","tests:emulator:start-ci":"yarn tests:emulator:prepare && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh","tests:packager:jet-ci":"cd Example/testHotUpdate && cross-env TMPDIR=$HOME/.metro REACT_DEBUGGER=\"echo nope\" node_modules/.bin/react-native start --no-interactive","tests:ios:pod:install":"cd Example/testHotUpdate && yarn && yarn pod-install"},repository:{type:"git",url:"git+https://github.com/reactnativecn/react-native-update.git"},keywords:["react-native","ios","android","update"],author:"reactnativecn",license:"MIT",bugs:{url:"https://github.com/reactnativecn/react-native-update/issues"},peerDependencies:{react:">=16.8.0","react-native":">=0.59.0"},homepage:"https://github.com/reactnativecn/react-native-update#readme",dependencies:{nanoid:"^3.3.3","react-native-url-polyfill":"^2.0.0"},codegenConfig:{name:"RCTPushySpec",type:"modules",jsSrcsDir:"src"},devDependencies:{"@babel/core":"^7.25.8","@react-native/babel-preset":"^0.73.21","@react-native/eslint-config":"^0.73.2","@react-native/typescript-config":"^0.74.0","@types/fs-extra":"^11.0.4","@types/jest":"^29.5.13","@types/node":"^22.7.6","@types/react":"^18.3.11",detox:"^20.27.3",eslint:"^8.57.0","eslint-plugin-ft-flow":"^3.0.7","firebase-tools":"^13.22.1","fs-extra":"^11.2.0",jest:"^29.7.0","pod-install":"^0.2.2",prettier:"^2",react:"18.2.0","react-native":"0.73","ts-jest":"^29.2.5",typescript:"^5.6.3"}}}),424,[]); __d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"PermissionsAndroid",{enumerable:!0,get:function(){return n.PermissionsAndroid}});var n=r(d[0])}),425,[1]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.usePushy=e.defaultContext=e.PushyContext=void 0;var t=r(d[0]),n=function(){},o=function(){return Promise.resolve()},s=e.defaultContext={checkUpdate:o,switchVersion:o,switchVersionLater:o,markSuccess:n,dismissError:n,downloadUpdate:o,downloadAndInstallApk:o,getCurrentVersionInfo:function(){return Promise.resolve({})},parseTestQrCode:function(){return!1},currentHash:'',packageVersion:''},u=e.PushyContext=(0,t.createContext)(s);e.usePushy=function(){return(0,t.useContext)(u)}}),426,[143]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.PushyProvider=void 0;var e=_r(d[0])(_r(d[1])),t=_r(d[0])(_r(d[2])),r=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=o?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n})(_r(d[3])),n=_r(d[4]);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}_e.PushyProvider=function(a){var o=a.client,u=a.children,i=o.options,l=(0,r.useRef)(),s=(0,r.useState)(),c=(0,t.default)(s,2),f=c[0],p=c[1],y=(0,r.useRef)(f),h=(0,r.useState)(),v=(0,t.default)(h,2),k=v[0],w=v[1],S=(0,r.useState)(),A=(0,t.default)(S,2),P=A[0],b=A[1],L=(0,r.useRef)(0),C=(0,r.useCallback)((function(e){if(i.throwError)throw e}),[i.throwError]),V=(0,r.useCallback)((function(){b(void 0)}),[]),_=(0,r.useCallback)((function(){'alwaysAlert'!==i.updateStrategy&&'alertUpdateAndIgnoreError'!==i.updateStrategy||n.Alert.alert.apply(n.Alert,arguments)}),[i.updateStrategy]),O=(0,r.useCallback)((function(){'alwaysAlert'===i.updateStrategy&&n.Alert.alert.apply(n.Alert,arguments)}),[i.updateStrategy]),x=(0,r.useCallback)((0,e.default)((function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y.current;if(e&&e.hash)return o.switchVersion(e.hash)})),[o]),E=(0,r.useCallback)((0,e.default)((function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y.current;if(e&&e.hash)return o.switchVersionLater(e.hash)})),[o]),U=(0,r.useCallback)((0,e.default)((function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y.current;if(!e||!e.update)return!1;try{var t=yield o.downloadUpdate(e,w);return!!t&&(l.current&&l.current.remove(),'silentAndNow'===i.updateStrategy?(o.switchVersion(t),!0):'silentAndLater'===i.updateStrategy?(o.switchVersionLater(t),!0):(_('\u63d0\u793a','\u4e0b\u8f7d\u5b8c\u6bd5\uff0c\u662f\u5426\u7acb\u5373\u66f4\u65b0?',[{text:'\u4e0b\u6b21\u518d\u8bf4',style:'cancel',onPress:function(){o.switchVersionLater(t)}},{text:'\u7acb\u5373\u66f4\u65b0',style:'default',onPress:function(){o.switchVersion(t)}}]),!0))}catch(e){return b(e),O('\u66f4\u65b0\u5931\u8d25',e.message),C(e),!1}})),[o,i.updateStrategy,_,O,C]),R=(0,r.useCallback)((function(){var t=(0,e.default)((function*(e){'android'===n.Platform.OS&&e&&(yield o.downloadAndInstallApk(e,w))}));return function(e){return t.apply(this,arguments)}})(),[o]),I=(0,r.useCallback)((0,e.default)((function*(){var e,t,r,a=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).extra,u=Date.now();if(!(L.current&&u-L.current<1e3)){var l;L.current=u;try{l=yield o.checkUpdate(a)}catch(e){return b(e),O('\u66f4\u65b0\u68c0\u67e5\u5931\u8d25',e.message),void C(e)}if(l){var s=null==(e=l.config)||null==(t=e.rollout)?void 0:t[_r(d[5]).packageVersion];if(s){if(!(0,_r(d[6]).isInRollout)(s))return void(0,_r(d[7]).log)(`not in ${s}% rollout, ignored`);(0,_r(d[7]).log)(`in ${s}% rollout, continue`)}if(l.description=null!=(r=l.description)?r:'',y.current=l,p(l),l.expired){var c=l.downloadUrl;if(c){if('silentAndNow'===i.updateStrategy)return void('android'===n.Platform.OS&&c.endsWith('.apk')?R(c):n.Linking.openURL(c));_('\u63d0\u793a','\u60a8\u7684\u5e94\u7528\u7248\u672c\u5df2\u66f4\u65b0\uff0c\u70b9\u51fb\u66f4\u65b0\u4e0b\u8f7d\u5b89\u88c5\u65b0\u7248\u672c',[{text:'\u66f4\u65b0',onPress:function(){'android'===n.Platform.OS&&c.endsWith('.apk')?R(c):n.Linking.openURL(c)}}])}}else if(l.update){if('silentAndNow'===i.updateStrategy||'silentAndLater'===i.updateStrategy)return void U(l);_('\u63d0\u793a','\u68c0\u67e5\u5230\u65b0\u7684\u7248\u672c'+l.name+',\u662f\u5426\u4e0b\u8f7d?\n'+l.description,[{text:'\u53d6\u6d88',style:'cancel'},{text:'\u786e\u5b9a',style:'default',onPress:function(){U()}}])}}}})),[o,O,C,i.updateStrategy,_,R,U]),j=o.markSuccess;(0,r.useEffect)((function(){var e,t=i.checkStrategy,r=i.dismissErrorAfter;return i.autoMarkSuccess&&j(),'both'!==t&&'onAppResume'!==t||(l.current=n.AppState.addEventListener('change',(function(e){'active'===e&&I()}))),'both'!==t&&'onAppStart'!==t||I(),'number'==typeof r&&r>0&&(e=setTimeout((function(){V()}),r)),function(){l.current&&l.current.remove(),clearTimeout(e)}}),[I,i,V,j]);var M=(0,r.useCallback)((function(e){if(e&&e.type&&e.type.startsWith('__rnPushy')){var t=i.logger||function(){};return i.logger=function(e){var r=e.type,a=e.data;t({type:r,data:a}),n.Alert.alert(r,JSON.stringify(a))},'__rnPushyVersionHash'===e.type&&I({extra:{toHash:e.data}}).then((function(){y.current&&y.current.upToDate&&n.Alert.alert('\u63d0\u793a','\u5f53\u524d\u5c1a\u672a\u68c0\u6d4b\u5230\u66f4\u65b0\u7248\u672c\uff0c\u5982\u679c\u662f\u9996\u6b21\u626b\u7801\uff0c\u8bf7\u7b49\u5f85\u670d\u52a1\u5668\u7aef\u751f\u6210\u8865\u4e01\u5305\u540e\u518d\u8bd5\uff08\u7ea610\u79d2\uff09'),i.logger=t})),!0}return!1}),[I,i]),W=(0,r.useCallback)((function(e){try{var t='string'==typeof e?JSON.parse(e):e;return M(t)}catch(e){return!1}}),[M]);return(0,r.useEffect)((function(){var e=function(e){if(e){var t=new(_r(d[8]).URL)(e).searchParams,r={type:t.get('type'),data:t.get('data')};M(r)}};n.Linking.getInitialURL().then(e);var t=n.Linking.addEventListener('url',(function(t){var r=t.url;return e(r)}));return function(){t.remove()}}),[M]),(0,_r(d[9]).jsx)(_r(d[10]).PushyContext.Provider,{value:{checkUpdate:I,switchVersion:x,switchVersionLater:E,dismissError:V,updateInfo:f,lastError:P,markSuccess:j,client:o,downloadUpdate:U,packageVersion:_r(d[5]).packageVersion,currentHash:_r(d[5]).currentVersion,progress:k,downloadAndInstallApk:R,getCurrentVersionInfo:_r(d[5]).getCurrentVersionInfo,parseTestQrCode:W},children:u})}}),427,[3,289,24,143,1,420,428,419,429,193,426]); -__d((function(g,r,_i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.isInRollout=function(o){return t%1001&&void 0!==arguments[1]?arguments[1]:0;for(o=3&t.length,c=t.length-o,n=C,u=3432918353,i=461845907,A=0;A>>17))*i+(((l>>>16)*i&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(h>>>16)&65535)<<16);switch(l=0,o){case 3:l^=(255&t.charCodeAt(A+2))<<16;case 2:l^=(255&t.charCodeAt(A+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(A)))*u+(((l>>>16)*u&65535)<<16)&4294967295)<<15|l>>>17))*i+(((l>>>16)*i&65535)<<16)&4294967295}return n^=t.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0})(r(d[0]).cInfo.uuid)}),428,[420]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0});var t={setupURLPolyfill:!0};e.setupURLPolyfill=function(){globalThis.REACT_NATIVE_URL_POLYFILL=`${l.default.name}@${l.default.version}`,globalThis.URL=r(d[3]).URL,globalThis.URLSearchParams=r(d[4]).URLSearchParams},r(d[0]);var l=r(d[1])(r(d[2]));Object.keys(r(d[3])).forEach((function(l){"default"!==l&&"__esModule"!==l&&(Object.prototype.hasOwnProperty.call(t,l)||l in e&&e[l]===r(d[3])[l]||Object.defineProperty(e,l,{enumerable:!0,get:function(){return r(d[3])[l]}}))})),Object.keys(r(d[4])).forEach((function(l){"default"!==l&&"__esModule"!==l&&(Object.prototype.hasOwnProperty.call(t,l)||l in e&&e[l]===r(d[4])[l]||Object.defineProperty(e,l,{enumerable:!0,get:function(){return r(d[4])[l]}}))}))}),429,[430,3,431,432,447]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]),n=parseInt(t.Platform.Version,10);'ios'===t.Platform.OS&&10===n&&null==Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,'byteLength')&&Object.defineProperty(ArrayBuffer.prototype,'byteLength',{configurable:!0,enumerable:!1,get:function(){return null}})}),430,[1]); -__d((function(e,t,i,r,a,n,l){a.exports={name:"react-native-url-polyfill",version:"2.0.0",description:"A lightweight and trustworthy URL polyfill for React Native",keywords:["URL","URLSearchParams","polyfill","react native","whatwg-url"],bugs:{url:"https://github.com/charpeni/react-native-url-polyfill/issues"},homepage:"https://github.com/charpeni/react-native-url-polyfill",readme:"https://github.com/charpeni/react-native-url-polyfill#readme",repository:{type:"git",url:"https://github.com/charpeni/react-native-url-polyfill.git"},main:"index.js",types:"index.d.ts",scripts:{test:"jest",lint:"eslint .",prepare:"husky install","bundle-size":"node scripts/bundle-size"},author:"Nicolas Charpentier ",license:"MIT",dependencies:{"whatwg-url-without-unicode":"8.0.0-3"},devDependencies:{"@react-native-community/eslint-config":"3.2.0",detox:"20.9.1",eslint:"8.44.0","eslint-plugin-prettier":"4.2.1",husky:"8.0.3",jest:"29.5.0","lint-staged":"13.2.3","metro-react-native-babel-preset":"0.76.7",nanoid:"3.3.6",prettier:"2.8.8",react:"18.2.0","react-native":"0.72.1","react-native-bundle-scale":"1.1.0",typescript:"5.1.6"},peerDependencies:{"react-native":"*"},jest:{preset:"react-native",testPathIgnorePatterns:["/node_modules/","./platforms/"]},"lint-staged":{"*.js":["eslint --fix"]}}}),431,[]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.URL=void 0;var t=r(d[0]),o=null,n=t.NativeModules.BlobModule;n&&'string'==typeof n.BLOB_URI_SCHEME&&(o=n.BLOB_URI_SCHEME+':','string'==typeof n.BLOB_URI_HOST&&(o+=`//${n.BLOB_URI_HOST}/`)),r(d[1]).URL.createObjectURL=function(t){if(null===o)throw new Error('Cannot create URL for blob!');return`${o}${t.data.blobId}?offset=${t.data.offset}&size=${t.size}`},r(d[1]).URL.revokeObjectURL=function(t){};e.URL=r(d[1]).URL}),432,[1,433]); -__d((function(g,r,i,a,m,e,d){"use strict";var s={};r(d[0]).URL.install(s),r(d[0]).URLSearchParams.install(s),e.URL=s.URL,e.URLSearchParams=s.URLSearchParams,e.parseURL=r(d[1]).parseURL,e.basicURLParse=r(d[1]).basicURLParse,e.serializeURL=r(d[1]).serializeURL,e.serializeHost=r(d[1]).serializeHost,e.serializeInteger=r(d[1]).serializeInteger,e.serializeURLOrigin=r(d[1]).serializeURLOrigin,e.setTheUsername=r(d[1]).setTheUsername,e.setThePassword=r(d[1]).setThePassword,e.cannotHaveAUsernamePasswordPort=r(d[1]).cannotHaveAUsernamePasswordPort,e.percentDecode=r(d[2]).percentDecode}),433,[434,438,443]); -__d((function(g,r,i,a,m,e,d){"use strict";e.URL=r(d[0]),e.URLSearchParams=r(d[1])}),434,[435,444]); -__d((function(g,r,i,a,m,e,d){"use strict";var t={_mixedIntoPredicates:[],is:function(t){if(t){if(r(d[0]).hasOwn(t,r(d[0]).implSymbol)&&t[r(d[0]).implSymbol]instanceof r(d[1]).implementation)return!0;for(var o of m.exports._mixedIntoPredicates)if(o(t))return!0}return!1},isImpl:function(t){if(t){if(t instanceof r(d[1]).implementation)return!0;var o=r(d[0]).wrapperForImpl(t);for(var n of m.exports._mixedIntoPredicates)if(n(o))return!0}return!1},convert:function(t){var o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).context,n=void 0===o?"The provided value":o;if(m.exports.is(t))return r(d[0]).implForWrapper(t);throw new TypeError(`${n} is not of type 'URL'.`)},create:function(o,n,s){if(void 0===o[r(d[0]).ctorRegistrySymbol])throw new Error("Internal error: invalid global object");var l=o[r(d[0]).ctorRegistrySymbol].URL;if(void 0===l)throw new Error("Internal error: constructor URL is not installed on the passed global object");var p=Object.create(l.prototype);return p=t.setup(p,o,n,s)},createImpl:function(o,n,s){var l=t.create(o,n,s);return r(d[0]).implForWrapper(l)},_internalSetup:function(t){},setup:function(o,n){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return l.wrapper=o,t._internalSetup(o),Object.defineProperty(o,r(d[0]).implSymbol,{value:new(r(d[1]).implementation)(n,s,l),configurable:!0}),o[r(d[0]).implSymbol][r(d[0]).wrapperSymbol]=o,r(d[1]).init&&r(d[1]).init(o[r(d[0]).implSymbol],l),o},install:function(o){var n=(function(){return r(d[4])((function n(s){if(r(d[2])(this,n),arguments.length<1)throw new TypeError("Failed to construct 'URL': 1 argument required, but only "+arguments.length+" present.");var l=[],p=arguments[0];p=r(d[3]).USVString(p,{context:"Failed to construct 'URL': parameter 1"}),l.push(p);var h=arguments[1];return void 0!==h&&(h=r(d[3]).USVString(h,{context:"Failed to construct 'URL': parameter 2"})),l.push(h),t.setup(Object.create(this.constructor.prototype),o,l)}),[{key:"toJSON",value:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].toJSON()}},{key:"href",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].href},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'href' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].href=t}},{key:"toString",value:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].href}},{key:"origin",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].origin}},{key:"protocol",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].protocol},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'protocol' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].protocol=t}},{key:"username",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].username},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'username' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].username=t}},{key:"password",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].password},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'password' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].password=t}},{key:"host",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].host},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'host' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].host=t}},{key:"hostname",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].hostname},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'hostname' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].hostname=t}},{key:"port",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].port},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'port' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].port=t}},{key:"pathname",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].pathname},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'pathname' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].pathname=t}},{key:"search",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].search},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'search' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].search=t}},{key:"searchParams",get:function(){var t=this;if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return r(d[0]).getSameObject(this,"searchParams",(function(){return r(d[0]).tryWrapperForImpl(t[r(d[0]).implSymbol].searchParams)}))}},{key:"hash",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].hash},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'hash' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].hash=t}}])})();Object.defineProperties(n.prototype,r(d[5])({toJSON:{enumerable:!0},href:{enumerable:!0},toString:{enumerable:!0},origin:{enumerable:!0},protocol:{enumerable:!0},username:{enumerable:!0},password:{enumerable:!0},host:{enumerable:!0},hostname:{enumerable:!0},port:{enumerable:!0},pathname:{enumerable:!0},search:{enumerable:!0},searchParams:{enumerable:!0},hash:{enumerable:!0}},Symbol.toStringTag,{value:"URL",configurable:!0})),void 0===o[r(d[0]).ctorRegistrySymbol]&&(o[r(d[0]).ctorRegistrySymbol]=Object.create(null)),o[r(d[0]).ctorRegistrySymbol].URL=n,Object.defineProperty(o,"URL",{configurable:!0,writable:!0,value:n})}};m.exports=t}),435,[436,437,12,446,13,169]); -__d((function(g,r,_i,a,m,_e,d){"use strict";var e=Symbol("wrapper"),t=Symbol("impl"),o=Symbol("SameObject caches"),p=Symbol.for("[webidl2js] constructor registry");function n(t){return t?t[e]:null}function y(e){return e?e[t]:null}var i=Symbol("internal"),l=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));var s=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get;var u=Symbol("supports property index"),c=Symbol("supported property indices"),b=Symbol("supports property name"),S=Symbol("supported property names"),f=Symbol("indexed property get"),x=Symbol("indexed property set new"),O=Symbol("indexed property set existing"),w=Symbol("named property get"),j=Symbol("named property set new"),P=Symbol("named property set existing"),I=Symbol("named property delete");m.exports={isObject:function(e){return"object"==typeof e&&null!==e||"function"==typeof e},hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},wrapperSymbol:e,implSymbol:t,getSameObject:function(e,t,p){return e[o]||(e[o]=Object.create(null)),t in e[o]||(e[o][t]=p()),e[o][t]},ctorRegistrySymbol:p,wrapperForImpl:n,implForWrapper:y,tryWrapperForImpl:function(e){var t=n(e);return t||e},tryImplForWrapper:function(e){var t=y(e);return t||e},iterInternalSymbol:i,IteratorPrototype:l,isArrayBuffer:function(e){try{return s.call(e),!0}catch(e){return!1}},isArrayIndexPropName:function(e){if("string"!=typeof e)return!1;var t=e>>>0;return t!==Math.pow(2,32)-1&&e===`${t}`},supportsPropertyIndex:u,supportedPropertyIndices:c,supportsPropertyName:b,supportedPropertyNames:S,indexedGet:f,indexedSetNew:x,indexedSetExisting:O,namedGet:w,namedSetNew:j,namedSetExisting:P,namedDelete:I}}),436,[]); -__d((function(g,r,i,a,m,e,d){"use strict";e.implementation=(function(){return r(d[3])((function t(s,n){r(d[0])(this,t);var u=n[0],l=n[1],h=null;if(void 0!==l&&null===(h=r(d[1]).basicURLParse(l)))throw new TypeError(`Invalid base URL: ${l}`);var o=r(d[1]).basicURLParse(u,{baseURL:h});if(null===o)throw new TypeError(`Invalid URL: ${u}`);var _=null!==o.query?o.query:"";this._url=o,this._query=r(d[2]).createImpl(s,[_],{doNotStripQMark:!0}),this._query._url=this}),[{key:"href",get:function(){return r(d[1]).serializeURL(this._url)},set:function(t){var s=r(d[1]).basicURLParse(t);if(null===s)throw new TypeError(`Invalid URL: ${t}`);this._url=s,this._query._list.splice(0);var n=s.query;null!==n&&(this._query._list=r(d[4]).parseUrlencoded(n))}},{key:"origin",get:function(){return r(d[1]).serializeURLOrigin(this._url)}},{key:"protocol",get:function(){return this._url.scheme+":"},set:function(t){r(d[1]).basicURLParse(t+":",{url:this._url,stateOverride:"scheme start"})}},{key:"username",get:function(){return this._url.username},set:function(t){r(d[1]).cannotHaveAUsernamePasswordPort(this._url)||r(d[1]).setTheUsername(this._url,t)}},{key:"password",get:function(){return this._url.password},set:function(t){r(d[1]).cannotHaveAUsernamePasswordPort(this._url)||r(d[1]).setThePassword(this._url,t)}},{key:"host",get:function(){var t=this._url;return null===t.host?"":null===t.port?r(d[1]).serializeHost(t.host):r(d[1]).serializeHost(t.host)+":"+r(d[1]).serializeInteger(t.port)},set:function(t){this._url.cannotBeABaseURL||r(d[1]).basicURLParse(t,{url:this._url,stateOverride:"host"})}},{key:"hostname",get:function(){return null===this._url.host?"":r(d[1]).serializeHost(this._url.host)},set:function(t){this._url.cannotBeABaseURL||r(d[1]).basicURLParse(t,{url:this._url,stateOverride:"hostname"})}},{key:"port",get:function(){return null===this._url.port?"":r(d[1]).serializeInteger(this._url.port)},set:function(t){r(d[1]).cannotHaveAUsernamePasswordPort(this._url)||(""===t?this._url.port=null:r(d[1]).basicURLParse(t,{url:this._url,stateOverride:"port"}))}},{key:"pathname",get:function(){return this._url.cannotBeABaseURL?this._url.path[0]:0===this._url.path.length?"":"/"+this._url.path.join("/")},set:function(t){this._url.cannotBeABaseURL||(this._url.path=[],r(d[1]).basicURLParse(t,{url:this._url,stateOverride:"path start"}))}},{key:"search",get:function(){return null===this._url.query||""===this._url.query?"":"?"+this._url.query},set:function(t){var s=this._url;if(""===t)return s.query=null,void(this._query._list=[]);var n="?"===t[0]?t.substring(1):t;s.query="",r(d[1]).basicURLParse(n,{url:s,stateOverride:"query"}),this._query._list=r(d[4]).parseUrlencoded(n)}},{key:"searchParams",get:function(){return this._query}},{key:"hash",get:function(){return null===this._url.fragment||""===this._url.fragment?"":"#"+this._url.fragment},set:function(t){if(""!==t){var s="#"===t[0]?t.substring(1):t;this._url.fragment="",r(d[1]).basicURLParse(s,{url:this._url,stateOverride:"fragment"})}else this._url.fragment=null}},{key:"toJSON",value:function(){return this.href}}])})()}),437,[12,438,444,13,443]); -__d((function(g,r,_i,a,m,_e,d){"use strict";var t={ftp:21,file:null,http:80,https:443,ws:80,wss:443},s=Symbol("failure");function e(t){return r(d[0]).ucs2.decode(t).length}function i(t,s){var e=t[s];return isNaN(e)?void 0:String.fromCodePoint(e)}function h(t){return"."===t||"%2e"===t.toLowerCase()}function u(t){return 2===t.length&&r(d[1]).isASCIIAlpha(t.codePointAt(0))&&(":"===t[1]||"|"===t[1])}function n(s){return void 0!==t[s]}function o(t){return n(t.scheme)}function l(t){return!n(t.scheme)}function p(s){return t[s]}function f(t){for(var s=r(d[2]).Buffer.from(t),e="",i=0;i126}var b=new Set([47,58,59,61,64,91,92,93,94,124]);function v(t){return I(t)||b.has(t)}var y=new Set([32,34,60,62,96]);function w(t){return c(t)||y.has(t)}var A=new Set([35,63,123,125]);function I(t){return w(t)||A.has(t)}function E(t,s){var e=String.fromCodePoint(t);return s(t)?f(e):e}function S(t){var e=10;if(t.length>=2&&"0"===t.charAt(0)&&"x"===t.charAt(1).toLowerCase()?(t=t.substring(2),e=16):t.length>=2&&"0"===t.charAt(0)&&(t=t.substring(1),e=8),""===t)return 0;var i=/[^0-7]/;return 10===e&&(i=/[^0-9]/),16===e&&(i=/[^0-9A-Fa-f]/),i.test(t)?s:parseInt(t,e)}function q(t){var e=t.split(".");if(""===e[e.length-1]&&e.length>1&&e.pop(),e.length>4)return t;var i=[];for(var h of e){if(""===h)return t;var u=S(h);if(u===s)return t;i.push(u)}for(var n=0;n255)return s;if(i[i.length-1]>=Math.pow(256,5-i.length))return s;var o=i.pop(),l=0;for(var p of i)o+=p*Math.pow(256,3-l),++l;return o}function C(t){for(var s="",e=t,i=1;i<=4;++i)s=String(e%256)+s,4!==i&&(s="."+s),e=Math.floor(e/256);return s}function N(t){var e=[0,0,0,0,0,0,0,0],h=0,u=null,n=0;if(58===(t=r(d[0]).ucs2.decode(t))[n]){if(58!==t[n+1])return s;n+=2,u=++h}for(;n6)return s;for(var p=0;void 0!==t[n];){var f=null;if(p>0){if(!(46===t[n]&&p<4))return s;++n}if(!r(d[1]).isASCIIDigit(t[n]))return s;for(;r(d[1]).isASCIIDigit(t[n]);){var c=parseInt(i(t,n));if(null===f)f=c;else{if(0===f)return s;f=10*f+c}if(f>255)return s;++n}e[h]=256*e[h]+f,2!==++p&&4!==p||++h}if(4!==p)return s;break}if(58===t[n]){if(void 0===t[++n])return s}else if(void 0!==t[n])return s;e[h]=o,++h}else{if(null!==u)return s;++n,u=++h}}if(null!==u){var b=h-u;for(h=7;0!==h&&b>0;){var v=e[u+b-1];e[u+b-1]=e[h],e[h]=v,--h,--b}}else if(null===u&&8!==h)return s;return e}function O(t){for(var s="",e=U(t).idx,i=!1,h=0;h<=7;++h){if(!i||0!==t[h])if(i&&(i=!1),e!==h)s+=t[h].toString(16),7!==h&&(s+=":");else s+=0===h?"::":":",i=!0}return s}function x(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("["===t[0])return"]"!==t[t.length-1]?s:N(t.substring(1,t.length-1));if(e)return L(t);var i=B(r(d[3]).percentDecode(r(d[2]).Buffer.from(t)).toString());if(i===s)return s;if(-1!==i.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/))return s;var h=q(i);return"number"==typeof h||h===s?h:i}function L(t){if(-1!==t.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/))return s;for(var e="",i=r(d[0]).ucs2.decode(t),h=0;he&&(s=i,e=h),i=null,h=0):(null===i&&(i=u),++h);return h>e&&(s=i,e=h),{idx:s,len:e}}function R(t){return"number"==typeof t?C(t):t instanceof Array?"["+O(t)+"]":t}function B(t){return null===t?s:t}function F(t){return t.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g,"")}function P(t){return t.replace(/\u0009|\u000A|\u000D/g,"")}function H(t){var s,e=t.path;0!==e.length&&("file"===t.scheme&&1===e.length&&(s=e[0],/^[A-Za-z]:$/.test(s))||e.pop())}function k(t){return""!==t.username||""!==t.password}function D(t,e,i,h,u){if(this.pointer=0,this.input=t,this.base=e||null,this.encodingOverride=i||"utf-8",this.stateOverride=u,this.url=h,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,cannotBeABaseURL:!1};var n=F(this.input);n!==this.input&&(this.parseError=!0),this.input=n}var o=P(this.input);for(o!==this.input&&(this.parseError=!0),this.input=o,this.state=u||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=r(d[0]).ucs2.decode(this.input);this.pointer<=this.input.length;++this.pointer){var l=this.input[this.pointer],p=isNaN(l)?void 0:String.fromCodePoint(l),f=this["parse "+this.state](l,p);if(!f)break;if(f===s){this.failure=!0;break}}}D.prototype["parse scheme start"]=function(t,e){if(r(d[1]).isASCIIAlpha(t))this.buffer+=e.toLowerCase(),this.state="scheme";else{if(this.stateOverride)return this.parseError=!0,s;this.state="no scheme",--this.pointer}return!0},D.prototype["parse scheme"]=function(t,e){if(r(d[1]).isASCIIAlphanumeric(t)||43===t||45===t||46===t)this.buffer+=e.toLowerCase();else if(58===t){if(this.stateOverride){if(o(this.url)&&!n(this.buffer))return!1;if(!o(this.url)&&n(this.buffer))return!1;if((k(this.url)||null!==this.url.port)&&"file"===this.buffer)return!1;if("file"===this.url.scheme&&(""===this.url.host||null===this.url.host))return!1}if(this.url.scheme=this.buffer,this.stateOverride)return this.url.port===p(this.url.scheme)&&(this.url.port=null),!1;this.buffer="","file"===this.url.scheme?(47===this.input[this.pointer+1]&&47===this.input[this.pointer+2]||(this.parseError=!0),this.state="file"):o(this.url)&&null!==this.base&&this.base.scheme===this.url.scheme?this.state="special relative or authority":o(this.url)?this.state="special authority slashes":47===this.input[this.pointer+1]?(this.state="path or authority",++this.pointer):(this.url.cannotBeABaseURL=!0,this.url.path.push(""),this.state="cannot-be-a-base-URL path")}else{if(this.stateOverride)return this.parseError=!0,s;this.buffer="",this.state="no scheme",this.pointer=-1}return!0},D.prototype["parse no scheme"]=function(t){return null===this.base||this.base.cannotBeABaseURL&&35!==t?s:(this.base.cannotBeABaseURL&&35===t?(this.url.scheme=this.base.scheme,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.url.cannotBeABaseURL=!0,this.state="fragment"):"file"===this.base.scheme?(this.state="file",--this.pointer):(this.state="relative",--this.pointer),!0)},D.prototype["parse special relative or authority"]=function(t){return 47===t&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="relative",--this.pointer),!0},D.prototype["parse path or authority"]=function(t){return 47===t?this.state="authority":(this.state="path",--this.pointer),!0},D.prototype["parse relative"]=function(t){return this.url.scheme=this.base.scheme,isNaN(t)?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query):47===t?this.state="relative slash":63===t?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===t?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):o(this.url)&&92===t?(this.parseError=!0,this.state="relative slash"):(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(0,this.base.path.length-1),this.state="path",--this.pointer),!0},D.prototype["parse relative slash"]=function(t){return!o(this.url)||47!==t&&92!==t?47===t?this.state="authority":(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer):(92===t&&(this.parseError=!0),this.state="special authority ignore slashes"),!0},D.prototype["parse special authority slashes"]=function(t){return 47===t&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="special authority ignore slashes",--this.pointer),!0},D.prototype["parse special authority ignore slashes"]=function(t){return 47!==t&&92!==t?(this.state="authority",--this.pointer):this.parseError=!0,!0},D.prototype["parse authority"]=function(t,i){if(64===t){this.parseError=!0,this.atFlag&&(this.buffer="%40"+this.buffer),this.atFlag=!0;for(var h=e(this.buffer),u=0;uMath.pow(2,16)-1)return this.parseError=!0,s;this.url.port=i===p(this.url.scheme)?null:i,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}return!0};var z=new Set([47,92,63,35]);function T(t,s){var e,i,h=t.length-s;return h>=2&&(e=t[s],i=t[s+1],r(d[1]).isASCIIAlpha(e)&&(58===i||124===i))&&(2===h||z.has(t[s+2]))}D.prototype["parse file"]=function(t){return this.url.scheme="file",47===t||92===t?(92===t&&(this.parseError=!0),this.state="file slash"):null!==this.base&&"file"===this.base.scheme?isNaN(t)?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query):63===t?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===t?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):(T(this.input,this.pointer)?this.parseError=!0:(this.url.host=this.base.host,this.url.path=this.base.path.slice(),H(this.url)),this.state="path",--this.pointer):(this.state="path",--this.pointer),!0},D.prototype["parse file slash"]=function(t){var s;return 47===t||92===t?(92===t&&(this.parseError=!0),this.state="file host"):(null===this.base||"file"!==this.base.scheme||T(this.input,this.pointer)||(2===(s=this.base.path[0]).length&&r(d[1]).isASCIIAlpha(s.codePointAt(0))&&":"===s[1]?this.url.path.push(this.base.path[0]):this.url.host=this.base.host),this.state="path",--this.pointer),!0},D.prototype["parse file host"]=function(t,e){if(isNaN(t)||47===t||92===t||63===t||35===t)if(--this.pointer,!this.stateOverride&&u(this.buffer))this.parseError=!0,this.state="path";else if(""===this.buffer){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{var i=x(this.buffer,l(this.url));if(i===s)return s;if("localhost"===i&&(i=""),this.url.host=i,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=e;return!0},D.prototype["parse path start"]=function(t){return o(this.url)?(92===t&&(this.parseError=!0),this.state="path",47!==t&&92!==t&&--this.pointer):this.stateOverride||63!==t?this.stateOverride||35!==t?void 0!==t&&(this.state="path",47!==t&&--this.pointer):(this.url.fragment="",this.state="fragment"):(this.url.query="",this.state="query"),!0},D.prototype["parse path"]=function(t){if(isNaN(t)||47===t||o(this.url)&&92===t||!this.stateOverride&&(63===t||35===t)){if(o(this.url)&&92===t&&(this.parseError=!0),".."===(s=(s=this.buffer).toLowerCase())||"%2e."===s||".%2e"===s||"%2e%2e"===s?(H(this.url),47===t||o(this.url)&&92===t||this.url.path.push("")):!h(this.buffer)||47===t||o(this.url)&&92===t?h(this.buffer)||("file"===this.url.scheme&&0===this.url.path.length&&u(this.buffer)&&(""!==this.url.host&&null!==this.url.host&&(this.parseError=!0,this.url.host=""),this.buffer=this.buffer[0]+":"),this.url.path.push(this.buffer)):this.url.path.push(""),this.buffer="","file"===this.url.scheme&&(void 0===t||63===t||35===t))for(;this.url.path.length>1&&""===this.url.path[0];)this.parseError=!0,this.url.path.shift();63===t&&(this.url.query="",this.state="query"),35===t&&(this.url.fragment="",this.state="fragment")}else 37!==t||r(d[1]).isASCIIHex(this.input[this.pointer+1])&&r(d[1]).isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=E(t,I);var s;return!0},D.prototype["parse cannot-be-a-base-URL path"]=function(t){return 63===t?(this.url.query="",this.state="query"):35===t?(this.url.fragment="",this.state="fragment"):(isNaN(t)||37===t||(this.parseError=!0),37!==t||r(d[1]).isASCIIHex(this.input[this.pointer+1])&&r(d[1]).isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),isNaN(t)||(this.url.path[0]+=E(t,c))),!0},D.prototype["parse query"]=function(t,s){if(isNaN(t)||!this.stateOverride&&35===t){o(this.url)&&"ws"!==this.url.scheme&&"wss"!==this.url.scheme||(this.encodingOverride="utf-8");for(var e=r(d[2]).Buffer.from(this.buffer),i=0;i126||34===e[i]||35===e[i]||60===e[i]||62===e[i]||39===e[i]&&o(this.url)?this.url.query+=r(d[3]).percentEncode(e[i]):this.url.query+=String.fromCodePoint(e[i]);this.buffer="",35===t&&(this.url.fragment="",this.state="fragment")}else 37!==t||r(d[1]).isASCIIHex(this.input[this.pointer+1])&&r(d[1]).isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=s;return!0},D.prototype["parse fragment"]=function(t){return isNaN(t)||(0===t?this.parseError=!0:(37!==t||r(d[1]).isASCIIHex(this.input[this.pointer+1])&&r(d[1]).isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),this.url.fragment+=E(t,w))),!0},m.exports.serializeURL=function(t,s){var e=t.scheme+":";if(null!==t.host?(e+="//",""===t.username&&""===t.password||(e+=t.username,""!==t.password&&(e+=":"+t.password),e+="@"),e+=R(t.host),null!==t.port&&(e+=":"+t.port)):null===t.host&&"file"===t.scheme&&(e+="//"),t.cannotBeABaseURL)e+=t.path[0];else for(var i of t.path)e+="/"+i;return null!==t.query&&(e+="?"+t.query),s||null===t.fragment||(e+="#"+t.fragment),e},m.exports.serializeURLOrigin=function(t){switch(t.scheme){case"blob":try{return m.exports.serializeURLOrigin(m.exports.parseURL(t.path[0]))}catch(t){return"null"}case"ftp":case"http":case"https":case"ws":case"wss":return s={scheme:t.scheme,host:t.host,port:t.port},e=s.scheme+"://",e+=R(s.host),null!==s.port&&(e+=":"+s.port),e;default:return"null"}var s,e},m.exports.basicURLParse=function(t,s){void 0===s&&(s={});var e=new D(t,s.baseURL,s.encodingOverride,s.url,s.stateOverride);return e.failure?null:e.url},m.exports.setTheUsername=function(t,s){t.username="";for(var e=r(d[0]).ucs2.decode(s),i=0;i= 0x80 (not a basic code point)','invalid-input':'Invalid input'},v=Math.floor,c=String.fromCharCode;function l(n){throw new RangeError(f[n])}function s(n,o){for(var t=[],i=n.length;i--;)t[i]=o(n[i]);return t}function p(n,o){var t=n.split('@'),i='';return t.length>1&&(i=t[0]+'@',n=t[1]),i+s((n=n.replace(u,'.')).split('.'),o).join('.')}function h(n){for(var o=[],t=0,i=n.length;t=55296&&u<=56319&&t>1,n+=v(n/t);n>455;u+=o)n=v(n/35);return v(u+36*n/(n+38))},x=function(t){var i,u=[],f=t.length,c=0,s=128,p=72,h=t.lastIndexOf("-");h<0&&(h=0);for(var w=0;w=128&&l('not-basic'),u.push(t.charCodeAt(w));for(var x=h>0?h+1:0;x=f&&l('invalid-input');var F=(i=t.charCodeAt(x++))>=48&&i<58?i-48+26:i>=65&&i<91?i-65:i>=97&&i<123?i-97:o;F>=o&&l('invalid-input'),F>v((n-c)/S)&&l('overflow'),c+=F*S;var I=b<=p?1:b>=p+26?26:b-p;if(Fv(n/m)&&l('overflow'),S*=m}var E=u.length+1;p=C(c-A,E,0==A),v(c/E)>n-s&&l('overflow'),s+=v(c/E),c%=E,u.splice(c++,0,s)}return String.fromCodePoint.apply(String,u)},A=function(t){var i=[],u=(t=h(t)).length,f=128,s=0,p=72;for(var x of t)x<128&&i.push(c(x));var A=i.length,S=A;for(A&&i.push("-");S=f&&Fv((n-s)/I)&&l('overflow'),s+=(b-f)*I,f=b,t))if(mn&&l('overflow'),m===f){for(var E=s,j=o;;j+=o){var k=j<=p?1:j>=p+26?26:j-p;if(E=48&&n<=57}function t(n){return n>=65&&n<=90||n>=97&&n<=122}m.exports={isASCIIDigit:n,isASCIIAlpha:t,isASCIIAlphanumeric:function(u){return t(u)||n(u)},isASCIIHex:function(t){return n(t)||t>=65&&t<=70||t>=97&&t<=102}}}),440,[]); -__d((function(g,r,_i,_a,_m,_e,d){'use strict';var t='function'==typeof Symbol&&'function'==typeof Symbol.for?Symbol.for('nodejs.util.inspect.custom'):null;_e.Buffer=i,_e.SlowBuffer=function(t){+t!=t&&(t=0);return i.alloc(+t)},_e.INSPECT_MAX_BYTES=50;var e=2147483647;function n(t){if(t>e)throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=new Uint8Array(t);return Object.setPrototypeOf(n,i.prototype),n}function i(t,e,n){if('number'==typeof t){if('string'==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return s(t)}return o(t,e,n)}function o(t,e,n){if('string'==typeof t)return h(t,e);if(ArrayBuffer.isView(t))return p(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return c(t,e,n);if('undefined'!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return c(t,e,n);if('number'==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var o=t.valueOf&&t.valueOf();if(null!=o&&o!==t)return i.from(o,e,n);var f=l(t);if(f)return f;if('undefined'!=typeof Symbol&&null!=Symbol.toPrimitive&&'function'==typeof t[Symbol.toPrimitive])return i.from(t[Symbol.toPrimitive]('string'),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if('number'!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t,e,i){return f(t),t<=0?n(t):void 0!==e?'string'==typeof i?n(t).fill(e,i):n(t).fill(e):n(t)}function s(t){return f(t),n(t<0?0:0|y(t))}function h(t,e){if('string'==typeof e&&''!==e||(e='utf8'),!i.isEncoding(e))throw new TypeError('Unknown encoding: '+e);var o=0|w(t,e),f=n(o),u=f.write(t,e);return u!==o&&(f=f.slice(0,u)),f}function a(t){for(var e=t.length<0?0:0|y(t.length),i=n(e),o=0;o=e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e.toString(16)+' bytes');return 0|t}function w(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if('string'!=typeof t)throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type "+typeof t);var n=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;for(var f=!1;;)switch(e){case'ascii':case'latin1':case'binary':return n;case'utf8':case'utf-8':return Y(t).length;case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return 2*n;case'hex':return n>>>1;case'base64':return W(t).length;default:if(f)return o?-1:Y(t).length;e=(''+e).toLowerCase(),f=!0}}function v(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return'';if((void 0===n||n>this.length)&&(n=this.length),n<=0)return'';if((n>>>=0)<=(e>>>=0))return'';for(t||(t='utf8');;)switch(t){case'hex':return P(this,e,n);case'utf8':case'utf-8':return S(this,e,n);case'ascii':return x(this,e,n);case'latin1':case'binary':return C(this,e,n);case'base64':return L(this,e,n);case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return k(this,e,n);default:if(i)throw new TypeError('Unknown encoding: '+t);t=(t+'').toLowerCase(),i=!0}}function b(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function m(t,e,n,o,f){if(0===t.length)return-1;if('string'==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Z(n=+n)&&(n=f?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(f)return-1;n=t.length-1}else if(n<0){if(!f)return-1;n=0}if('string'==typeof e&&(e=i.from(e,o)),i.isBuffer(e))return 0===e.length?-1:E(t,e,n,o,f);if('number'==typeof e)return e&=255,'function'==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):E(t,[e],n,o,f);throw new TypeError('val must be string, number or Buffer')}function E(t,e,n,i,o){var f,u=1,s=t.length,h=e.length;if(void 0!==i&&('ucs2'===(i=String(i).toLowerCase())||'ucs-2'===i||'utf16le'===i||'utf-16le'===i)){if(t.length<2||e.length<2)return-1;u=2,s/=2,h/=2,n/=2}function a(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(o){var p=-1;for(f=n;fs&&(n=s-h),f=n;f>=0;f--){for(var c=!0,l=0;lo&&(i=o):i=o;var f=e.length;i>f/2&&(i=f/2);for(var u=0;u239?4:a>223?3:a>191?2:1;if(o+c<=n)switch(c){case 1:a<128&&(p=a);break;case 2:128==(192&(f=t[o+1]))&&(h=(31&a)<<6|63&f)>127&&(p=h);break;case 3:f=t[o+1],u=t[o+2],128==(192&f)&&128==(192&u)&&(h=(15&a)<<12|(63&f)<<6|63&u)>2047&&(h<55296||h>57343)&&(p=h);break;case 4:f=t[o+1],u=t[o+2],s=t[o+3],128==(192&f)&&128==(192&u)&&128==(192&s)&&(h=(15&a)<<18|(63&f)<<12|(63&u)<<6|63&s)>65535&&h<1114112&&(p=h)}null===p?(p=65533,c=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|1023&p),i.push(p),o+=c}return R(i)}_e.kMaxLength=e,i.TYPED_ARRAY_SUPPORT=(function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}})(),i.TYPED_ARRAY_SUPPORT||'undefined'==typeof console||'function'!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,'parent',{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,'offset',{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),i.poolSize=8192,i.from=function(t,e,n){return o(t,e,n)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array),i.alloc=function(t,e,n){return u(t,e,n)},i.allocUnsafe=function(t){return s(t)},i.allocUnsafeSlow=function(t){return s(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==i.prototype},i.compare=function(t,e){if(J(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),J(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var n=t.length,o=e.length,f=0,u=Math.min(n,o);fo.length?i.from(u).copy(o,f):Uint8Array.prototype.set.call(o,u,f);else{if(!i.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(o,f)}f+=u.length}return o},i.byteLength=w,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError('Buffer size must be a multiple of 16-bits');for(var e=0;ee&&(t+=' ... '),''},t&&(i.prototype[t]=i.prototype.inspect),i.prototype.compare=function(t,e,n,o,f){if(J(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type "+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===f&&(f=this.length),e<0||n>t.length||o<0||f>this.length)throw new RangeError('out of range index');if(o>=f&&e>=n)return 0;if(o>=f)return-1;if(e>=n)return 1;if(this===t)return 0;for(var u=(f>>>=0)-(o>>>=0),s=(n>>>=0)-(e>>>=0),h=Math.min(u,s),a=this.slice(o,f),p=t.slice(e,n),c=0;c>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i='utf8')):(i=n,n=void 0)}var o=this.length-e;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError('Attempt to write outside buffer bounds');i||(i='utf8');for(var f=!1;;)switch(i){case'hex':return B(this,t,e,n);case'utf8':case'utf-8':return A(this,t,e,n);case'ascii':case'latin1':case'binary':return U(this,t,e,n);case'base64':return T(this,t,e,n);case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return I(this,t,e,n);default:if(f)throw new TypeError('Unknown encoding: '+i);i=(''+i).toLowerCase(),f=!0}},i.prototype.toJSON=function(){return{type:'Buffer',data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function R(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);for(var n='',i=0;ii)&&(n=i);for(var o='',f=e;fn)throw new RangeError('Trying to access beyond buffer length')}function _(t,e,n,o,f,u){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>f||et.length)throw new RangeError('Index out of range')}function j(t,e,n,i,o,f){if(n+i>t.length)throw new RangeError('Index out of range');if(n<0)throw new RangeError('Index out of range')}function z(t,e,n,i,o){return e=+e,n>>>=0,o||j(t,0,n,4),r(d[1]).write(t,e,n,i,23,4),n+4}function D(t,e,n,i,o){return e=+e,n>>>=0,o||j(t,0,n,8),r(d[1]).write(t,e,n,i,52,8),n+8}i.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||M(t,e,this.length);for(var i=this[t],o=1,f=0;++f>>=0,e>>>=0,n||M(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i},i.prototype.readUint8=i.prototype.readUInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),this[t]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||M(t,e,this.length);for(var i=this[t],o=1,f=0;++f=(o*=128)&&(i-=Math.pow(2,8*e)),i},i.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||M(t,e,this.length);for(var i=e,o=1,f=this[t+--i];i>0&&(o*=256);)f+=this[t+--i]*o;return f>=(o*=128)&&(f-=Math.pow(2,8*e)),f},i.prototype.readInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||M(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(t,e){t>>>=0,e||M(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||M(t,4,this.length),r(d[1]).read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||M(t,4,this.length),r(d[1]).read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||M(t,8,this.length),r(d[1]).read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||M(t,8,this.length),r(d[1]).read(this,t,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(t,e,n,i){(t=+t,e>>>=0,n>>>=0,i)||_(this,t,e,n,Math.pow(2,8*n)-1,0);var o=1,f=0;for(this[e]=255&t;++f>>=0,n>>>=0,i)||_(this,t,e,n,Math.pow(2,8*n)-1,0);var o=n-1,f=1;for(this[e+o]=255&t;--o>=0&&(f*=256);)this[e+o]=t/f&255;return e+n},i.prototype.writeUint8=i.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e>>>=0,!i){var o=Math.pow(2,8*n-1);_(this,t,e,n,o-1,-o)}var f=0,u=1,s=0;for(this[e]=255&t;++f>>=0,!i){var o=Math.pow(2,8*n-1);_(this,t,e,n,o-1,-o)}var f=n-1,u=1,s=0;for(this[e+f]=255&t;--f>=0&&(u*=256);)t<0&&0===s&&0!==this[e+f+1]&&(s=1),this[e+f]=(t/u|0)-s&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,n){return z(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return z(this,t,e,!1,n)},i.prototype.writeDoubleLE=function(t,e,n){return D(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return D(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,o){if(!i.isBuffer(t))throw new TypeError('argument should be a Buffer');if(n||(n=0),o||0===o||(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o=this.length)throw new RangeError('Index out of range');if(o<0)throw new RangeError('sourceEnd out of bounds');o>this.length&&(o=this.length),t.length-e>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),'number'==typeof t)for(u=e;u55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&f.push(239,191,189);continue}if(u+1===i){(e-=3)>-1&&f.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&f.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&f.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;f.push(n)}else if(n<2048){if((e-=2)<0)break;f.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;f.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error('Invalid code point');if((e-=4)<0)break;f.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return f}function q(t){for(var e=[],n=0;n>8,o=n%256,f.push(o),f.push(i);return f}function W(t){return r(d[0]).toByteArray(N(t))}function X(t,e,n,i){for(var o=0;o=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Z(t){return t!=t}var $=(function(){for(var t='0123456789abcdef',e=new Array(256),n=0;n<16;++n)for(var i=16*n,o=0;o<16;++o)e[i+o]=t[n]+t[o];return e})()}),441,[99,442]); -__d((function(g,r,_i,a,_m,_e,_d){_e.read=function(o,t,h,M,f){var w,p,i=8*f-M-1,n=(1<>1,e=-7,u=h?f-1:0,s=h?-1:1,c=o[t+u];for(u+=s,w=c&(1<<-e)-1,c>>=-e,e+=i;e>0;w=256*w+o[t+u],u+=s,e-=8);for(p=w&(1<<-e)-1,w>>=-e,e+=M;e>0;p=256*p+o[t+u],u+=s,e-=8);if(0===w)w=1-N;else{if(w===n)return p?NaN:1/0*(c?-1:1);p+=Math.pow(2,M),w-=N}return(c?-1:1)*p*Math.pow(2,w-M)},_e.write=function(o,t,h,M,f,w){var p,i,n,N=8*w-f-1,e=(1<>1,s=23===f?Math.pow(2,-24)-Math.pow(2,-77):0,c=M?0:w-1,l=M?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,p=e):(p=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-p))<1&&(p--,n*=2),(t+=p+u>=1?s/n:s*Math.pow(2,1-u))*n>=2&&(p++,n/=2),p+u>=e?(i=0,p=e):p+u>=1?(i=(t*n-1)*Math.pow(2,f),p+=u):(i=t*Math.pow(2,u-1)*Math.pow(2,f),p=0));f>=8;o[h+c]=255&i,c+=l,i/=256,f-=8);for(p=p<0;o[h+c]=255&p,c+=l,p/=256,N-=8);o[h+c-l]|=128*d}}),442,[]); -__d((function(g,r,_i,a,m,e,d){"use strict";function n(n,f){for(var t=[],o=0,i=n.indexOf(f);i>=0;)t.push(n.slice(o,i)),o=i+1,i=n.indexOf(f,o);return o!==n.length&&t.push(n.slice(o)),t}function f(n,f,t){for(var o=n.indexOf(f);o>=0;)n[o]=t,o=n.indexOf(f,o+1);return n}function t(n){var f=n.toString(16).toUpperCase();return 1===f.length&&(f="0"+f),"%"+f}function o(n){for(var f=r(d[0]).Buffer.alloc(n.byteLength),t=0,o=0;o=0?(l=c.slice(0,v),s=c.slice(v+1)):(l=c,s=r(d[0]).Buffer.alloc(0)),l=f(r(d[0]).Buffer.from(l),43,32),s=f(r(d[0]).Buffer.from(s),43,32),u.push([o(l).toString(),o(s).toString()])}return u}function u(n){var f="";for(var o of n)f+=32===o?"+":42===o||45===o||46===o||o>=48&&o<=57||o>=65&&o<=90||95===o||o>=97&&o<=122?String.fromCodePoint(o):t(o);return f}m.exports={percentEncode:t,percentDecode:o,parseUrlencoded:function(n){return i(r(d[0]).Buffer.from(n))},serializeUrlencoded:function(n){var f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,t="utf-8";void 0!==f&&(t=f);var o="";for(var i of n.entries()){var c=r(d[2])(i,2),l=c[0],s=c[1],v=u(r(d[0]).Buffer.from(s[0])),h=s[1];s.length>2&&void 0!==s[2]&&("hidden"===s[2]&&"_charset_"===v?h=t:"file"===s[2]&&(h=h.name)),0!==l&&(o+="&"),o+=`${v}=${h=u(r(d[0]).Buffer.from(h))}`}return o}}}),443,[441,440,24]); -__d((function(g,r,_i,a,m,e,d){"use strict";var t=Object.create(r(d[0]).IteratorPrototype,r(d[1])({next:{value:function(){var t=this[r(d[0]).iterInternalSymbol],o=t.target,n=t.kind,i=t.index,l=Array.from(o[r(d[0]).implSymbol]);if(i>=l.length)return{value:void 0,done:!0};var s=l[i];t.index=i+1;var c,u=s.map(r(d[0]).tryWrapperForImpl),p=r(d[2])(u,2),h=p[0],y=p[1];switch(n){case"key":c=h;break;case"value":c=y;break;case"key+value":c=[h,y]}return{value:c,done:!1}},writable:!0,enumerable:!0,configurable:!0}},Symbol.toStringTag,{value:"URLSearchParams Iterator",configurable:!0})),o={_mixedIntoPredicates:[],is:function(t){if(t){if(r(d[0]).hasOwn(t,r(d[0]).implSymbol)&&t[r(d[0]).implSymbol]instanceof r(d[3]).implementation)return!0;for(var o of m.exports._mixedIntoPredicates)if(o(t))return!0}return!1},isImpl:function(t){if(t){if(t instanceof r(d[3]).implementation)return!0;var o=r(d[0]).wrapperForImpl(t);for(var n of m.exports._mixedIntoPredicates)if(n(o))return!0}return!1},convert:function(t){var o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).context,n=void 0===o?"The provided value":o;if(m.exports.is(t))return r(d[0]).implForWrapper(t);throw new TypeError(`${n} is not of type 'URLSearchParams'.`)},createDefaultIterator:function(o,n){var i=Object.create(t);return Object.defineProperty(i,r(d[0]).iterInternalSymbol,{value:{target:o,kind:n,index:0},configurable:!0}),i},create:function(t,n,i){if(void 0===t[r(d[0]).ctorRegistrySymbol])throw new Error("Internal error: invalid global object");var l=t[r(d[0]).ctorRegistrySymbol].URLSearchParams;if(void 0===l)throw new Error("Internal error: constructor URLSearchParams is not installed on the passed global object");var s=Object.create(l.prototype);return s=o.setup(s,t,n,i)},createImpl:function(t,n,i){var l=o.create(t,n,i);return r(d[0]).implForWrapper(l)},_internalSetup:function(t){},setup:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return l.wrapper=t,o._internalSetup(t),Object.defineProperty(t,r(d[0]).implSymbol,{value:new(r(d[3]).implementation)(n,i,l),configurable:!0}),t[r(d[0]).implSymbol][r(d[0]).wrapperSymbol]=t,r(d[3]).init&&r(d[3]).init(t[r(d[0]).implSymbol],l),t},install:function(t){var n=(function(){return r(d[6])((function n(){r(d[4])(this,n);var i=[],l=arguments[0];if(void 0!==l)if(r(d[0]).isObject(l))if(void 0!==l[Symbol.iterator]){if(!r(d[0]).isObject(l))throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object.");var s=[],c=l;for(var u of c){if(!r(d[0]).isObject(u))throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object.");var p=[],h=u;for(var y of h)y=r(d[5]).USVString(y,{context:"Failed to construct 'URLSearchParams': parameter 1 sequence's element's element"}),p.push(y);u=p,s.push(u)}l=s}else{if(!r(d[0]).isObject(l))throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 record is not an object.");var f=Object.create(null);for(var v of Reflect.ownKeys(l)){var b=Object.getOwnPropertyDescriptor(l,v);if(b&&b.enumerable){var S=v;S=r(d[5]).USVString(S,{context:"Failed to construct 'URLSearchParams': parameter 1 record's key"});var w=l[v];w=r(d[5]).USVString(w,{context:"Failed to construct 'URLSearchParams': parameter 1 record's value"}),f[S]=w}}l=f}else l=r(d[5]).USVString(l,{context:"Failed to construct 'URLSearchParams': parameter 1"});else l="";return i.push(l),o.setup(Object.create(this.constructor.prototype),t,i)}),[{key:"append",value:function(t,o){var n;if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");if(arguments.length<2)throw new TypeError("Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only "+arguments.length+" present.");var i=[],l=arguments[0];l=r(d[5]).USVString(l,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 1"}),i.push(l);var s=arguments[1];return s=r(d[5]).USVString(s,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 2"}),i.push(s),(n=this[r(d[0]).implSymbol]).append.apply(n,i)}},{key:"delete",value:function(t){var o;if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");if(arguments.length<1)throw new TypeError("Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only "+arguments.length+" present.");var n=[],i=arguments[0];return i=r(d[5]).USVString(i,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 1"}),n.push(i),(o=this[r(d[0]).implSymbol]).delete.apply(o,n)}},{key:"get",value:function(t){var o;if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");if(arguments.length<1)throw new TypeError("Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only "+arguments.length+" present.");var n=[],i=arguments[0];return i=r(d[5]).USVString(i,{context:"Failed to execute 'get' on 'URLSearchParams': parameter 1"}),n.push(i),(o=this[r(d[0]).implSymbol]).get.apply(o,n)}},{key:"getAll",value:function(t){var o;if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");if(arguments.length<1)throw new TypeError("Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only "+arguments.length+" present.");var n=[],i=arguments[0];return i=r(d[5]).USVString(i,{context:"Failed to execute 'getAll' on 'URLSearchParams': parameter 1"}),n.push(i),r(d[0]).tryWrapperForImpl((o=this[r(d[0]).implSymbol]).getAll.apply(o,n))}},{key:"has",value:function(t){var o;if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");if(arguments.length<1)throw new TypeError("Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only "+arguments.length+" present.");var n=[],i=arguments[0];return i=r(d[5]).USVString(i,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 1"}),n.push(i),(o=this[r(d[0]).implSymbol]).has.apply(o,n)}},{key:"set",value:function(t,o){var n;if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");if(arguments.length<2)throw new TypeError("Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only "+arguments.length+" present.");var i=[],l=arguments[0];l=r(d[5]).USVString(l,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 1"}),i.push(l);var s=arguments[1];return s=r(d[5]).USVString(s,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 2"}),i.push(s),(n=this[r(d[0]).implSymbol]).set.apply(n,i)}},{key:"sort",value:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].sort()}},{key:"toString",value:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].toString()}},{key:"keys",value:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return m.exports.createDefaultIterator(this,"key")}},{key:"values",value:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return m.exports.createDefaultIterator(this,"value")}},{key:"entries",value:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return m.exports.createDefaultIterator(this,"key+value")}},{key:"forEach",value:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");if(arguments.length<1)throw new TypeError("Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1 is not a function.");for(var o=arguments[1],n=Array.from(this[r(d[0]).implSymbol]),i=0;ii[0]},t.map((function(t,i){return{item:t,index:i}})).sort((function(t,s){return i(t.item,s.item)||t.index-s.index})).map((function(t){return t.item}))),this._updateSteps()}},{key:Symbol.iterator,value:function(){return this._list[Symbol.iterator]()}},{key:"toString",value:function(){return r(d[1]).serializeUrlencoded(this._list)}}])})()}),445,[12,443,13]); -__d((function(g,r,_i,_a,m,_e,_d){"use strict";function n(n,t){return`${t&&t.context?t.context:"Value"} ${n}.`}function t(n){if(null===n)return"Null";switch(typeof n){case"undefined":return"Undefined";case"boolean":return"Boolean";case"number":return"Number";case"string":return"String";case"symbol":return"Symbol";default:return"Object"}}function e(n){return a(n>0&&n%1==.5&&!(1&n)||n<0&&n%1==-.5&&!(1&~n)?Math.floor(n):Math.round(n))}function o(n){return a(Math.trunc(n))}function i(n){return n<0?-1:1}function u(n,t){var e=n%t;return i(t)!==i(e)?e+t:e}function a(n){return 0===n?0:n}function f(t,i){var f,c,s=!i.unsigned;64===t?(c=Math.pow(2,53)-1,f=s?1-Math.pow(2,53):0):s?(f=-Math.pow(2,t-1),c=Math.pow(2,t-1)-1):(f=0,c=Math.pow(2,t)-1);var l=Math.pow(2,t),y=Math.pow(2,t-1);return function(t,i){void 0===i&&(i={});var w=+t;if(w=a(w),i.enforceRange){if(!Number.isFinite(w))throw new TypeError(n("is not a finite number",i));if((w=o(w))c)throw new TypeError(n(`is outside the accepted range of ${f} to ${c}, inclusive`,i));return w}return!Number.isNaN(w)&&i.clamp?w=e(w=Math.min(Math.max(w,f),c)):Number.isFinite(w)&&0!==w?(w=o(w))>=f&&w<=c?w:(w=u(w,l),s&&w>=y?w-l:w):0}}function c(t,e){if("function"!=typeof t)throw new TypeError(n("is not a function",e));return t}_e.any=function(n){return n},_e.void=function(){},_e.boolean=function(n){return!!n},_e.byte=f(8,{unsigned:!1}),_e.octet=f(8,{unsigned:!0}),_e.short=f(16,{unsigned:!1}),_e["unsigned short"]=f(16,{unsigned:!0}),_e.long=f(32,{unsigned:!1}),_e["unsigned long"]=f(32,{unsigned:!0}),_e["long long"]=f(64,{unsigned:!1}),_e["unsigned long long"]=f(64,{unsigned:!0}),_e.double=function(t,e){var o=+t;if(!Number.isFinite(o))throw new TypeError(n("is not a finite floating-point value",e));return o},_e["unrestricted double"]=function(n){return+n},_e.float=function(t,e){var o=+t;if(!Number.isFinite(o))throw new TypeError(n("is not a finite floating-point value",e));if(Object.is(o,-0))return o;var i=Math.fround(o);if(!Number.isFinite(i))throw new TypeError(n("is outside the range of a single-precision floating-point value",e));return i},_e["unrestricted float"]=function(n){var t=+n;return isNaN(t)||Object.is(t,-0)?t:Math.fround(t)},_e.DOMString=function(t,e){if(void 0===e&&(e={}),e.treatNullAsEmptyString&&null===t)return"";if("symbol"==typeof t)throw new TypeError(n("is a symbol, which cannot be converted to a string",e));return String(t)},_e.ByteString=function(t,e){for(var o,i=_e.DOMString(t,e),u=0;void 0!==(o=i.codePointAt(u));++u)if(o>255)throw new TypeError(n("is not a valid ByteString",e));return i},_e.USVString=function(n,t){for(var e=_e.DOMString(n,t),o=e.length,i=[],u=0;u57343)i.push(String.fromCodePoint(a));else if(56320<=a&&a<=57343)i.push(String.fromCodePoint(65533));else if(u===o-1)i.push(String.fromCodePoint(65533));else{var f=e.charCodeAt(u+1);if(56320<=f&&f<=57343){var c=1023&a,s=1023&f;i.push(String.fromCodePoint(65536+1024*c+s)),++u}else i.push(String.fromCodePoint(65533))}}return i.join("")},_e.object=function(e,o){if("Object"!==t(e))throw new TypeError(n("is not an object",o));return e};var s=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get;function l(n){try{return s.call(n),!0}catch(n){return!1}}_e.ArrayBuffer=function(t,e){if(!l(t))throw new TypeError(n("is not a view on an ArrayBuffer object",e));return t};var y=Object.getOwnPropertyDescriptor(DataView.prototype,"byteLength").get;_e.DataView=function(t,e){try{return y.call(t),t}catch(t){throw new TypeError(n("is not a view on an DataView object",e))}},[Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Uint8ClampedArray,Float32Array,Float64Array].forEach((function(t){var e=t.name,o=/^[AEIOU]/.test(e)?"an":"a";_e[e]=function(t,i){if(!ArrayBuffer.isView(t)||t.constructor.name!==e)throw new TypeError(n(`is not ${o} ${e} object`,i));return t}})),_e.ArrayBufferView=function(t,e){if(!ArrayBuffer.isView(t))throw new TypeError(n("is not a view on an ArrayBuffer object",e));return t},_e.BufferSource=function(t,e){if(!ArrayBuffer.isView(t)&&!l(t))throw new TypeError(n("is not an ArrayBuffer object or a view on one",e));return t},_e.DOMTimeStamp=_e["unsigned long long"],_e.Function=c,_e.VoidFunction=c}),446,[]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"URLSearchParams",{enumerable:!0,get:function(){return r(d[0]).URLSearchParams}})}),447,[433]); +__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.UpdateProvider=_e.PushyProvider=void 0;var e=_r(d[0])(_r(d[1])),t=_r(d[0])(_r(d[2])),r=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var u=o?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(n,i,u):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n})(_r(d[3])),n=_r(d[4]);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}var o=_e.UpdateProvider=function(a){var o=a.client,i=a.children,u=(o=(0,r.useRef)(o).current).options,s=(0,r.useRef)(),l=(0,r.useState)(),c=(0,t.default)(l,2),f=c[0],p=c[1],v=(0,r.useRef)(f),h=(0,r.useState)(),y=(0,t.default)(h,2),k=y[0],w=y[1],S=(0,r.useState)(),A=(0,t.default)(S,2),P=A[0],b=A[1],L=(0,r.useRef)(0),C=(0,r.useCallback)((function(e){if(u.throwError)throw e}),[u.throwError]),V=(0,r.useCallback)((function(){b(void 0)}),[]),U=(0,r.useCallback)((function(){'alwaysAlert'!==u.updateStrategy&&'alertUpdateAndIgnoreError'!==u.updateStrategy||n.Alert.alert.apply(n.Alert,arguments)}),[u.updateStrategy]),_=(0,r.useCallback)((function(){'alwaysAlert'===u.updateStrategy&&n.Alert.alert.apply(n.Alert,arguments)}),[u.updateStrategy]),O=(0,r.useCallback)((0,e.default)((function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v.current;if(e&&e.hash)return o.switchVersion(e.hash)})),[o]),E=(0,r.useCallback)((0,e.default)((function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v.current;if(e&&e.hash)return o.switchVersionLater(e.hash)})),[o]),x=(0,r.useCallback)((0,e.default)((function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v.current;if(!e||!e.update)return!1;try{var t=yield o.downloadUpdate(e,w);return!!t&&(s.current&&s.current.remove(),'silentAndNow'===u.updateStrategy?(o.switchVersion(t),!0):'silentAndLater'===u.updateStrategy?(o.switchVersionLater(t),!0):(U('\u63d0\u793a','\u4e0b\u8f7d\u5b8c\u6bd5\uff0c\u662f\u5426\u7acb\u5373\u66f4\u65b0?',[{text:'\u4e0b\u6b21\u518d\u8bf4',style:'cancel',onPress:function(){o.switchVersionLater(t)}},{text:'\u7acb\u5373\u66f4\u65b0',style:'default',onPress:function(){o.switchVersion(t)}}]),!0))}catch(e){return b(e),_('\u66f4\u65b0\u5931\u8d25',e.message),C(e),!1}})),[o,u.updateStrategy,U,_,C]),R=(0,r.useCallback)((function(){var t=(0,e.default)((function*(e){'android'===n.Platform.OS&&e&&(yield o.downloadAndInstallApk(e,w))}));return function(e){return t.apply(this,arguments)}})(),[o]),I=(0,r.useCallback)((0,e.default)((function*(){var e,t,r,a=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).extra,i=Date.now();if(!(L.current&&i-L.current<1e3)){var s;L.current=i;try{s=yield o.checkUpdate(a)}catch(e){return b(e),_('\u66f4\u65b0\u68c0\u67e5\u5931\u8d25',e.message),void C(e)}if(s){var l=null==(e=s.config)||null==(t=e.rollout)?void 0:t[_r(d[5]).packageVersion];if(l){if(!(0,_r(d[6]).isInRollout)(l))return void(0,_r(d[7]).log)(`not in ${l}% rollout, ignored`);(0,_r(d[7]).log)(`in ${l}% rollout, continue`)}if(s.description=null!=(r=s.description)?r:'',v.current=s,p(s),s.expired){var c=s.downloadUrl;if(c){if('silentAndNow'===u.updateStrategy)return'android'===n.Platform.OS&&c.endsWith('.apk')?R(c):n.Linking.openURL(c),s;U('\u63d0\u793a','\u60a8\u7684\u5e94\u7528\u7248\u672c\u5df2\u66f4\u65b0\uff0c\u70b9\u51fb\u66f4\u65b0\u4e0b\u8f7d\u5b89\u88c5\u65b0\u7248\u672c',[{text:'\u66f4\u65b0',onPress:function(){'android'===n.Platform.OS&&c.endsWith('.apk')?R(c):n.Linking.openURL(c)}}])}}else if(s.update){if('silentAndNow'===u.updateStrategy||'silentAndLater'===u.updateStrategy)return x(s),s;U('\u63d0\u793a','\u68c0\u67e5\u5230\u65b0\u7684\u7248\u672c'+s.name+',\u662f\u5426\u4e0b\u8f7d?\n'+s.description,[{text:'\u53d6\u6d88',style:'cancel'},{text:'\u786e\u5b9a',style:'default',onPress:function(){x()}}])}return s}}})),[o,_,C,u.updateStrategy,U,R,x]),j=o.markSuccess;(0,r.useEffect)((function(){if(o.assertDebug()){var e,t=u.checkStrategy,r=u.dismissErrorAfter;return u.autoMarkSuccess&&j(),'both'!==t&&'onAppResume'!==t||(s.current=n.AppState.addEventListener('change',(function(e){'active'===e&&I()}))),'both'!==t&&'onAppStart'!==t||I(),'number'==typeof r&&r>0&&(e=setTimeout((function(){V()}),r)),function(){s.current&&s.current.remove(),clearTimeout(e)}}}),[I,u,V,j,o]);var M=(0,r.useCallback)((function(e){if(e&&e.type&&e.type.startsWith('__rnUpdate')){var t=u.logger||function(){};return u.logger=function(e){var r=e.type,a=e.data;t({type:r,data:a}),n.Alert.alert(r,JSON.stringify(a))},'__rnPushyVersionHash'===e.type&&I({extra:{toHash:e.data}}).then((function(){v.current&&v.current.upToDate&&n.Alert.alert('Info','No update found, please wait 10s for the server to generate the patch package'),u.logger=t})),!0}return!1}),[I,u]),N=(0,r.useCallback)((function(e){try{var t='string'==typeof e?JSON.parse(e):e;return M(t)}catch(e){return!1}}),[M]);return(0,r.useEffect)((function(){var e=function(e){if(e){var t=new(_r(d[8]).URL)(e).searchParams,r={type:t.get('type'),data:t.get('data')};M(r)}};n.Linking.getInitialURL().then(e);var t=function(t){var r=t.url;e(r)},r=n.Linking.addEventListener('url',t);return function(){'removeEventListener'in n.Linking?n.Linking.removeEventListener('url',t):r.remove()}}),[M]),(0,_r(d[9]).jsx)(_r(d[10]).UpdateContext.Provider,{value:{checkUpdate:I,switchVersion:O,switchVersionLater:E,dismissError:V,updateInfo:f,lastError:P,markSuccess:j,client:o,downloadUpdate:x,packageVersion:_r(d[5]).packageVersion,currentHash:_r(d[5]).currentVersion,progress:k,downloadAndInstallApk:R,getCurrentVersionInfo:_r(d[5]).getCurrentVersionInfo,parseTestQrCode:N},children:i})};_e.PushyProvider=o}),426,[3,289,24,143,1,420,427,419,428,193,447]); +__d((function(g,r,_i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.isInRollout=function(o){return t%1001&&void 0!==arguments[1]?arguments[1]:0;for(o=3&t.length,c=t.length-o,n=C,u=3432918353,i=461845907,A=0;A>>17))*i+(((l>>>16)*i&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(h>>>16)&65535)<<16);switch(l=0,o){case 3:l^=(255&t.charCodeAt(A+2))<<16;case 2:l^=(255&t.charCodeAt(A+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(A)))*u+(((l>>>16)*u&65535)<<16)&4294967295)<<15|l>>>17))*i+(((l>>>16)*i&65535)<<16)&4294967295}return n^=t.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0})(r(d[0]).cInfo.uuid)}),427,[420]); +__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0});var t={setupURLPolyfill:!0};e.setupURLPolyfill=function(){globalThis.REACT_NATIVE_URL_POLYFILL=`${l.default.name}@${l.default.version}`,globalThis.URL=r(d[3]).URL,globalThis.URLSearchParams=r(d[4]).URLSearchParams},r(d[0]);var l=r(d[1])(r(d[2]));Object.keys(r(d[3])).forEach((function(l){"default"!==l&&"__esModule"!==l&&(Object.prototype.hasOwnProperty.call(t,l)||l in e&&e[l]===r(d[3])[l]||Object.defineProperty(e,l,{enumerable:!0,get:function(){return r(d[3])[l]}}))})),Object.keys(r(d[4])).forEach((function(l){"default"!==l&&"__esModule"!==l&&(Object.prototype.hasOwnProperty.call(t,l)||l in e&&e[l]===r(d[4])[l]||Object.defineProperty(e,l,{enumerable:!0,get:function(){return r(d[4])[l]}}))}))}),428,[429,3,430,431,446]); +__d((function(g,r,i,a,m,e,d){var t=r(d[0]),n=parseInt(t.Platform.Version,10);'ios'===t.Platform.OS&&10===n&&null==Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,'byteLength')&&Object.defineProperty(ArrayBuffer.prototype,'byteLength',{configurable:!0,enumerable:!1,get:function(){return null}})}),429,[1]); +__d((function(e,t,i,r,a,n,l){a.exports={name:"react-native-url-polyfill",version:"2.0.0",description:"A lightweight and trustworthy URL polyfill for React Native",keywords:["URL","URLSearchParams","polyfill","react native","whatwg-url"],bugs:{url:"https://github.com/charpeni/react-native-url-polyfill/issues"},homepage:"https://github.com/charpeni/react-native-url-polyfill",readme:"https://github.com/charpeni/react-native-url-polyfill#readme",repository:{type:"git",url:"https://github.com/charpeni/react-native-url-polyfill.git"},main:"index.js",types:"index.d.ts",scripts:{test:"jest",lint:"eslint .",prepare:"husky install","bundle-size":"node scripts/bundle-size"},author:"Nicolas Charpentier ",license:"MIT",dependencies:{"whatwg-url-without-unicode":"8.0.0-3"},devDependencies:{"@react-native-community/eslint-config":"3.2.0",detox:"20.9.1",eslint:"8.44.0","eslint-plugin-prettier":"4.2.1",husky:"8.0.3",jest:"29.5.0","lint-staged":"13.2.3","metro-react-native-babel-preset":"0.76.7",nanoid:"3.3.6",prettier:"2.8.8",react:"18.2.0","react-native":"0.72.1","react-native-bundle-scale":"1.1.0",typescript:"5.1.6"},peerDependencies:{"react-native":"*"},jest:{preset:"react-native",testPathIgnorePatterns:["/node_modules/","./platforms/"]},"lint-staged":{"*.js":["eslint --fix"]}}}),430,[]); +__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.URL=void 0;var t=r(d[0]),o=null,n=t.NativeModules.BlobModule;n&&'string'==typeof n.BLOB_URI_SCHEME&&(o=n.BLOB_URI_SCHEME+':','string'==typeof n.BLOB_URI_HOST&&(o+=`//${n.BLOB_URI_HOST}/`)),r(d[1]).URL.createObjectURL=function(t){if(null===o)throw new Error('Cannot create URL for blob!');return`${o}${t.data.blobId}?offset=${t.data.offset}&size=${t.size}`},r(d[1]).URL.revokeObjectURL=function(t){};e.URL=r(d[1]).URL}),431,[1,432]); +__d((function(g,r,i,a,m,e,d){"use strict";var s={};r(d[0]).URL.install(s),r(d[0]).URLSearchParams.install(s),e.URL=s.URL,e.URLSearchParams=s.URLSearchParams,e.parseURL=r(d[1]).parseURL,e.basicURLParse=r(d[1]).basicURLParse,e.serializeURL=r(d[1]).serializeURL,e.serializeHost=r(d[1]).serializeHost,e.serializeInteger=r(d[1]).serializeInteger,e.serializeURLOrigin=r(d[1]).serializeURLOrigin,e.setTheUsername=r(d[1]).setTheUsername,e.setThePassword=r(d[1]).setThePassword,e.cannotHaveAUsernamePasswordPort=r(d[1]).cannotHaveAUsernamePasswordPort,e.percentDecode=r(d[2]).percentDecode}),432,[433,437,442]); +__d((function(g,r,i,a,m,e,d){"use strict";e.URL=r(d[0]),e.URLSearchParams=r(d[1])}),433,[434,443]); +__d((function(g,r,i,a,m,e,d){"use strict";var t={_mixedIntoPredicates:[],is:function(t){if(t){if(r(d[0]).hasOwn(t,r(d[0]).implSymbol)&&t[r(d[0]).implSymbol]instanceof r(d[1]).implementation)return!0;for(var o of m.exports._mixedIntoPredicates)if(o(t))return!0}return!1},isImpl:function(t){if(t){if(t instanceof r(d[1]).implementation)return!0;var o=r(d[0]).wrapperForImpl(t);for(var n of m.exports._mixedIntoPredicates)if(n(o))return!0}return!1},convert:function(t){var o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).context,n=void 0===o?"The provided value":o;if(m.exports.is(t))return r(d[0]).implForWrapper(t);throw new TypeError(`${n} is not of type 'URL'.`)},create:function(o,n,s){if(void 0===o[r(d[0]).ctorRegistrySymbol])throw new Error("Internal error: invalid global object");var l=o[r(d[0]).ctorRegistrySymbol].URL;if(void 0===l)throw new Error("Internal error: constructor URL is not installed on the passed global object");var p=Object.create(l.prototype);return p=t.setup(p,o,n,s)},createImpl:function(o,n,s){var l=t.create(o,n,s);return r(d[0]).implForWrapper(l)},_internalSetup:function(t){},setup:function(o,n){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return l.wrapper=o,t._internalSetup(o),Object.defineProperty(o,r(d[0]).implSymbol,{value:new(r(d[1]).implementation)(n,s,l),configurable:!0}),o[r(d[0]).implSymbol][r(d[0]).wrapperSymbol]=o,r(d[1]).init&&r(d[1]).init(o[r(d[0]).implSymbol],l),o},install:function(o){var n=(function(){return r(d[4])((function n(s){if(r(d[2])(this,n),arguments.length<1)throw new TypeError("Failed to construct 'URL': 1 argument required, but only "+arguments.length+" present.");var l=[],p=arguments[0];p=r(d[3]).USVString(p,{context:"Failed to construct 'URL': parameter 1"}),l.push(p);var h=arguments[1];return void 0!==h&&(h=r(d[3]).USVString(h,{context:"Failed to construct 'URL': parameter 2"})),l.push(h),t.setup(Object.create(this.constructor.prototype),o,l)}),[{key:"toJSON",value:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].toJSON()}},{key:"href",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].href},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'href' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].href=t}},{key:"toString",value:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].href}},{key:"origin",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].origin}},{key:"protocol",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].protocol},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'protocol' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].protocol=t}},{key:"username",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].username},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'username' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].username=t}},{key:"password",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].password},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'password' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].password=t}},{key:"host",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].host},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'host' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].host=t}},{key:"hostname",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].hostname},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'hostname' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].hostname=t}},{key:"port",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].port},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'port' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].port=t}},{key:"pathname",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].pathname},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'pathname' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].pathname=t}},{key:"search",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].search},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'search' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].search=t}},{key:"searchParams",get:function(){var t=this;if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return r(d[0]).getSameObject(this,"searchParams",(function(){return r(d[0]).tryWrapperForImpl(t[r(d[0]).implSymbol].searchParams)}))}},{key:"hash",get:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].hash},set:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");t=r(d[3]).USVString(t,{context:"Failed to set the 'hash' property on 'URL': The provided value"}),this[r(d[0]).implSymbol].hash=t}}])})();Object.defineProperties(n.prototype,r(d[5])({toJSON:{enumerable:!0},href:{enumerable:!0},toString:{enumerable:!0},origin:{enumerable:!0},protocol:{enumerable:!0},username:{enumerable:!0},password:{enumerable:!0},host:{enumerable:!0},hostname:{enumerable:!0},port:{enumerable:!0},pathname:{enumerable:!0},search:{enumerable:!0},searchParams:{enumerable:!0},hash:{enumerable:!0}},Symbol.toStringTag,{value:"URL",configurable:!0})),void 0===o[r(d[0]).ctorRegistrySymbol]&&(o[r(d[0]).ctorRegistrySymbol]=Object.create(null)),o[r(d[0]).ctorRegistrySymbol].URL=n,Object.defineProperty(o,"URL",{configurable:!0,writable:!0,value:n})}};m.exports=t}),434,[435,436,12,445,13,169]); +__d((function(g,r,_i,a,m,_e,d){"use strict";var e=Symbol("wrapper"),t=Symbol("impl"),o=Symbol("SameObject caches"),p=Symbol.for("[webidl2js] constructor registry");function n(t){return t?t[e]:null}function y(e){return e?e[t]:null}var i=Symbol("internal"),l=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));var s=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get;var u=Symbol("supports property index"),c=Symbol("supported property indices"),b=Symbol("supports property name"),S=Symbol("supported property names"),f=Symbol("indexed property get"),x=Symbol("indexed property set new"),O=Symbol("indexed property set existing"),w=Symbol("named property get"),j=Symbol("named property set new"),P=Symbol("named property set existing"),I=Symbol("named property delete");m.exports={isObject:function(e){return"object"==typeof e&&null!==e||"function"==typeof e},hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},wrapperSymbol:e,implSymbol:t,getSameObject:function(e,t,p){return e[o]||(e[o]=Object.create(null)),t in e[o]||(e[o][t]=p()),e[o][t]},ctorRegistrySymbol:p,wrapperForImpl:n,implForWrapper:y,tryWrapperForImpl:function(e){var t=n(e);return t||e},tryImplForWrapper:function(e){var t=y(e);return t||e},iterInternalSymbol:i,IteratorPrototype:l,isArrayBuffer:function(e){try{return s.call(e),!0}catch(e){return!1}},isArrayIndexPropName:function(e){if("string"!=typeof e)return!1;var t=e>>>0;return t!==Math.pow(2,32)-1&&e===`${t}`},supportsPropertyIndex:u,supportedPropertyIndices:c,supportsPropertyName:b,supportedPropertyNames:S,indexedGet:f,indexedSetNew:x,indexedSetExisting:O,namedGet:w,namedSetNew:j,namedSetExisting:P,namedDelete:I}}),435,[]); +__d((function(g,r,i,a,m,e,d){"use strict";e.implementation=(function(){return r(d[3])((function t(s,n){r(d[0])(this,t);var u=n[0],l=n[1],h=null;if(void 0!==l&&null===(h=r(d[1]).basicURLParse(l)))throw new TypeError(`Invalid base URL: ${l}`);var o=r(d[1]).basicURLParse(u,{baseURL:h});if(null===o)throw new TypeError(`Invalid URL: ${u}`);var _=null!==o.query?o.query:"";this._url=o,this._query=r(d[2]).createImpl(s,[_],{doNotStripQMark:!0}),this._query._url=this}),[{key:"href",get:function(){return r(d[1]).serializeURL(this._url)},set:function(t){var s=r(d[1]).basicURLParse(t);if(null===s)throw new TypeError(`Invalid URL: ${t}`);this._url=s,this._query._list.splice(0);var n=s.query;null!==n&&(this._query._list=r(d[4]).parseUrlencoded(n))}},{key:"origin",get:function(){return r(d[1]).serializeURLOrigin(this._url)}},{key:"protocol",get:function(){return this._url.scheme+":"},set:function(t){r(d[1]).basicURLParse(t+":",{url:this._url,stateOverride:"scheme start"})}},{key:"username",get:function(){return this._url.username},set:function(t){r(d[1]).cannotHaveAUsernamePasswordPort(this._url)||r(d[1]).setTheUsername(this._url,t)}},{key:"password",get:function(){return this._url.password},set:function(t){r(d[1]).cannotHaveAUsernamePasswordPort(this._url)||r(d[1]).setThePassword(this._url,t)}},{key:"host",get:function(){var t=this._url;return null===t.host?"":null===t.port?r(d[1]).serializeHost(t.host):r(d[1]).serializeHost(t.host)+":"+r(d[1]).serializeInteger(t.port)},set:function(t){this._url.cannotBeABaseURL||r(d[1]).basicURLParse(t,{url:this._url,stateOverride:"host"})}},{key:"hostname",get:function(){return null===this._url.host?"":r(d[1]).serializeHost(this._url.host)},set:function(t){this._url.cannotBeABaseURL||r(d[1]).basicURLParse(t,{url:this._url,stateOverride:"hostname"})}},{key:"port",get:function(){return null===this._url.port?"":r(d[1]).serializeInteger(this._url.port)},set:function(t){r(d[1]).cannotHaveAUsernamePasswordPort(this._url)||(""===t?this._url.port=null:r(d[1]).basicURLParse(t,{url:this._url,stateOverride:"port"}))}},{key:"pathname",get:function(){return this._url.cannotBeABaseURL?this._url.path[0]:0===this._url.path.length?"":"/"+this._url.path.join("/")},set:function(t){this._url.cannotBeABaseURL||(this._url.path=[],r(d[1]).basicURLParse(t,{url:this._url,stateOverride:"path start"}))}},{key:"search",get:function(){return null===this._url.query||""===this._url.query?"":"?"+this._url.query},set:function(t){var s=this._url;if(""===t)return s.query=null,void(this._query._list=[]);var n="?"===t[0]?t.substring(1):t;s.query="",r(d[1]).basicURLParse(n,{url:s,stateOverride:"query"}),this._query._list=r(d[4]).parseUrlencoded(n)}},{key:"searchParams",get:function(){return this._query}},{key:"hash",get:function(){return null===this._url.fragment||""===this._url.fragment?"":"#"+this._url.fragment},set:function(t){if(""!==t){var s="#"===t[0]?t.substring(1):t;this._url.fragment="",r(d[1]).basicURLParse(s,{url:this._url,stateOverride:"fragment"})}else this._url.fragment=null}},{key:"toJSON",value:function(){return this.href}}])})()}),436,[12,437,443,13,442]); +__d((function(g,r,_i,a,m,_e,d){"use strict";var t={ftp:21,file:null,http:80,https:443,ws:80,wss:443},s=Symbol("failure");function e(t){return r(d[0]).ucs2.decode(t).length}function i(t,s){var e=t[s];return isNaN(e)?void 0:String.fromCodePoint(e)}function h(t){return"."===t||"%2e"===t.toLowerCase()}function u(t){return 2===t.length&&r(d[1]).isASCIIAlpha(t.codePointAt(0))&&(":"===t[1]||"|"===t[1])}function n(s){return void 0!==t[s]}function o(t){return n(t.scheme)}function l(t){return!n(t.scheme)}function p(s){return t[s]}function f(t){for(var s=r(d[2]).Buffer.from(t),e="",i=0;i126}var b=new Set([47,58,59,61,64,91,92,93,94,124]);function v(t){return I(t)||b.has(t)}var y=new Set([32,34,60,62,96]);function w(t){return c(t)||y.has(t)}var A=new Set([35,63,123,125]);function I(t){return w(t)||A.has(t)}function E(t,s){var e=String.fromCodePoint(t);return s(t)?f(e):e}function S(t){var e=10;if(t.length>=2&&"0"===t.charAt(0)&&"x"===t.charAt(1).toLowerCase()?(t=t.substring(2),e=16):t.length>=2&&"0"===t.charAt(0)&&(t=t.substring(1),e=8),""===t)return 0;var i=/[^0-7]/;return 10===e&&(i=/[^0-9]/),16===e&&(i=/[^0-9A-Fa-f]/),i.test(t)?s:parseInt(t,e)}function q(t){var e=t.split(".");if(""===e[e.length-1]&&e.length>1&&e.pop(),e.length>4)return t;var i=[];for(var h of e){if(""===h)return t;var u=S(h);if(u===s)return t;i.push(u)}for(var n=0;n255)return s;if(i[i.length-1]>=Math.pow(256,5-i.length))return s;var o=i.pop(),l=0;for(var p of i)o+=p*Math.pow(256,3-l),++l;return o}function C(t){for(var s="",e=t,i=1;i<=4;++i)s=String(e%256)+s,4!==i&&(s="."+s),e=Math.floor(e/256);return s}function N(t){var e=[0,0,0,0,0,0,0,0],h=0,u=null,n=0;if(58===(t=r(d[0]).ucs2.decode(t))[n]){if(58!==t[n+1])return s;n+=2,u=++h}for(;n6)return s;for(var p=0;void 0!==t[n];){var f=null;if(p>0){if(!(46===t[n]&&p<4))return s;++n}if(!r(d[1]).isASCIIDigit(t[n]))return s;for(;r(d[1]).isASCIIDigit(t[n]);){var c=parseInt(i(t,n));if(null===f)f=c;else{if(0===f)return s;f=10*f+c}if(f>255)return s;++n}e[h]=256*e[h]+f,2!==++p&&4!==p||++h}if(4!==p)return s;break}if(58===t[n]){if(void 0===t[++n])return s}else if(void 0!==t[n])return s;e[h]=o,++h}else{if(null!==u)return s;++n,u=++h}}if(null!==u){var b=h-u;for(h=7;0!==h&&b>0;){var v=e[u+b-1];e[u+b-1]=e[h],e[h]=v,--h,--b}}else if(null===u&&8!==h)return s;return e}function O(t){for(var s="",e=U(t).idx,i=!1,h=0;h<=7;++h){if(!i||0!==t[h])if(i&&(i=!1),e!==h)s+=t[h].toString(16),7!==h&&(s+=":");else s+=0===h?"::":":",i=!0}return s}function x(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("["===t[0])return"]"!==t[t.length-1]?s:N(t.substring(1,t.length-1));if(e)return L(t);var i=B(r(d[3]).percentDecode(r(d[2]).Buffer.from(t)).toString());if(i===s)return s;if(-1!==i.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/))return s;var h=q(i);return"number"==typeof h||h===s?h:i}function L(t){if(-1!==t.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/))return s;for(var e="",i=r(d[0]).ucs2.decode(t),h=0;he&&(s=i,e=h),i=null,h=0):(null===i&&(i=u),++h);return h>e&&(s=i,e=h),{idx:s,len:e}}function R(t){return"number"==typeof t?C(t):t instanceof Array?"["+O(t)+"]":t}function B(t){return null===t?s:t}function F(t){return t.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g,"")}function P(t){return t.replace(/\u0009|\u000A|\u000D/g,"")}function H(t){var s,e=t.path;0!==e.length&&("file"===t.scheme&&1===e.length&&(s=e[0],/^[A-Za-z]:$/.test(s))||e.pop())}function k(t){return""!==t.username||""!==t.password}function D(t,e,i,h,u){if(this.pointer=0,this.input=t,this.base=e||null,this.encodingOverride=i||"utf-8",this.stateOverride=u,this.url=h,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,cannotBeABaseURL:!1};var n=F(this.input);n!==this.input&&(this.parseError=!0),this.input=n}var o=P(this.input);for(o!==this.input&&(this.parseError=!0),this.input=o,this.state=u||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=r(d[0]).ucs2.decode(this.input);this.pointer<=this.input.length;++this.pointer){var l=this.input[this.pointer],p=isNaN(l)?void 0:String.fromCodePoint(l),f=this["parse "+this.state](l,p);if(!f)break;if(f===s){this.failure=!0;break}}}D.prototype["parse scheme start"]=function(t,e){if(r(d[1]).isASCIIAlpha(t))this.buffer+=e.toLowerCase(),this.state="scheme";else{if(this.stateOverride)return this.parseError=!0,s;this.state="no scheme",--this.pointer}return!0},D.prototype["parse scheme"]=function(t,e){if(r(d[1]).isASCIIAlphanumeric(t)||43===t||45===t||46===t)this.buffer+=e.toLowerCase();else if(58===t){if(this.stateOverride){if(o(this.url)&&!n(this.buffer))return!1;if(!o(this.url)&&n(this.buffer))return!1;if((k(this.url)||null!==this.url.port)&&"file"===this.buffer)return!1;if("file"===this.url.scheme&&(""===this.url.host||null===this.url.host))return!1}if(this.url.scheme=this.buffer,this.stateOverride)return this.url.port===p(this.url.scheme)&&(this.url.port=null),!1;this.buffer="","file"===this.url.scheme?(47===this.input[this.pointer+1]&&47===this.input[this.pointer+2]||(this.parseError=!0),this.state="file"):o(this.url)&&null!==this.base&&this.base.scheme===this.url.scheme?this.state="special relative or authority":o(this.url)?this.state="special authority slashes":47===this.input[this.pointer+1]?(this.state="path or authority",++this.pointer):(this.url.cannotBeABaseURL=!0,this.url.path.push(""),this.state="cannot-be-a-base-URL path")}else{if(this.stateOverride)return this.parseError=!0,s;this.buffer="",this.state="no scheme",this.pointer=-1}return!0},D.prototype["parse no scheme"]=function(t){return null===this.base||this.base.cannotBeABaseURL&&35!==t?s:(this.base.cannotBeABaseURL&&35===t?(this.url.scheme=this.base.scheme,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.url.cannotBeABaseURL=!0,this.state="fragment"):"file"===this.base.scheme?(this.state="file",--this.pointer):(this.state="relative",--this.pointer),!0)},D.prototype["parse special relative or authority"]=function(t){return 47===t&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="relative",--this.pointer),!0},D.prototype["parse path or authority"]=function(t){return 47===t?this.state="authority":(this.state="path",--this.pointer),!0},D.prototype["parse relative"]=function(t){return this.url.scheme=this.base.scheme,isNaN(t)?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query):47===t?this.state="relative slash":63===t?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===t?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):o(this.url)&&92===t?(this.parseError=!0,this.state="relative slash"):(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(0,this.base.path.length-1),this.state="path",--this.pointer),!0},D.prototype["parse relative slash"]=function(t){return!o(this.url)||47!==t&&92!==t?47===t?this.state="authority":(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer):(92===t&&(this.parseError=!0),this.state="special authority ignore slashes"),!0},D.prototype["parse special authority slashes"]=function(t){return 47===t&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="special authority ignore slashes",--this.pointer),!0},D.prototype["parse special authority ignore slashes"]=function(t){return 47!==t&&92!==t?(this.state="authority",--this.pointer):this.parseError=!0,!0},D.prototype["parse authority"]=function(t,i){if(64===t){this.parseError=!0,this.atFlag&&(this.buffer="%40"+this.buffer),this.atFlag=!0;for(var h=e(this.buffer),u=0;uMath.pow(2,16)-1)return this.parseError=!0,s;this.url.port=i===p(this.url.scheme)?null:i,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}return!0};var z=new Set([47,92,63,35]);function T(t,s){var e,i,h=t.length-s;return h>=2&&(e=t[s],i=t[s+1],r(d[1]).isASCIIAlpha(e)&&(58===i||124===i))&&(2===h||z.has(t[s+2]))}D.prototype["parse file"]=function(t){return this.url.scheme="file",47===t||92===t?(92===t&&(this.parseError=!0),this.state="file slash"):null!==this.base&&"file"===this.base.scheme?isNaN(t)?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query):63===t?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===t?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):(T(this.input,this.pointer)?this.parseError=!0:(this.url.host=this.base.host,this.url.path=this.base.path.slice(),H(this.url)),this.state="path",--this.pointer):(this.state="path",--this.pointer),!0},D.prototype["parse file slash"]=function(t){var s;return 47===t||92===t?(92===t&&(this.parseError=!0),this.state="file host"):(null===this.base||"file"!==this.base.scheme||T(this.input,this.pointer)||(2===(s=this.base.path[0]).length&&r(d[1]).isASCIIAlpha(s.codePointAt(0))&&":"===s[1]?this.url.path.push(this.base.path[0]):this.url.host=this.base.host),this.state="path",--this.pointer),!0},D.prototype["parse file host"]=function(t,e){if(isNaN(t)||47===t||92===t||63===t||35===t)if(--this.pointer,!this.stateOverride&&u(this.buffer))this.parseError=!0,this.state="path";else if(""===this.buffer){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{var i=x(this.buffer,l(this.url));if(i===s)return s;if("localhost"===i&&(i=""),this.url.host=i,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=e;return!0},D.prototype["parse path start"]=function(t){return o(this.url)?(92===t&&(this.parseError=!0),this.state="path",47!==t&&92!==t&&--this.pointer):this.stateOverride||63!==t?this.stateOverride||35!==t?void 0!==t&&(this.state="path",47!==t&&--this.pointer):(this.url.fragment="",this.state="fragment"):(this.url.query="",this.state="query"),!0},D.prototype["parse path"]=function(t){if(isNaN(t)||47===t||o(this.url)&&92===t||!this.stateOverride&&(63===t||35===t)){if(o(this.url)&&92===t&&(this.parseError=!0),".."===(s=(s=this.buffer).toLowerCase())||"%2e."===s||".%2e"===s||"%2e%2e"===s?(H(this.url),47===t||o(this.url)&&92===t||this.url.path.push("")):!h(this.buffer)||47===t||o(this.url)&&92===t?h(this.buffer)||("file"===this.url.scheme&&0===this.url.path.length&&u(this.buffer)&&(""!==this.url.host&&null!==this.url.host&&(this.parseError=!0,this.url.host=""),this.buffer=this.buffer[0]+":"),this.url.path.push(this.buffer)):this.url.path.push(""),this.buffer="","file"===this.url.scheme&&(void 0===t||63===t||35===t))for(;this.url.path.length>1&&""===this.url.path[0];)this.parseError=!0,this.url.path.shift();63===t&&(this.url.query="",this.state="query"),35===t&&(this.url.fragment="",this.state="fragment")}else 37!==t||r(d[1]).isASCIIHex(this.input[this.pointer+1])&&r(d[1]).isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=E(t,I);var s;return!0},D.prototype["parse cannot-be-a-base-URL path"]=function(t){return 63===t?(this.url.query="",this.state="query"):35===t?(this.url.fragment="",this.state="fragment"):(isNaN(t)||37===t||(this.parseError=!0),37!==t||r(d[1]).isASCIIHex(this.input[this.pointer+1])&&r(d[1]).isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),isNaN(t)||(this.url.path[0]+=E(t,c))),!0},D.prototype["parse query"]=function(t,s){if(isNaN(t)||!this.stateOverride&&35===t){o(this.url)&&"ws"!==this.url.scheme&&"wss"!==this.url.scheme||(this.encodingOverride="utf-8");for(var e=r(d[2]).Buffer.from(this.buffer),i=0;i126||34===e[i]||35===e[i]||60===e[i]||62===e[i]||39===e[i]&&o(this.url)?this.url.query+=r(d[3]).percentEncode(e[i]):this.url.query+=String.fromCodePoint(e[i]);this.buffer="",35===t&&(this.url.fragment="",this.state="fragment")}else 37!==t||r(d[1]).isASCIIHex(this.input[this.pointer+1])&&r(d[1]).isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=s;return!0},D.prototype["parse fragment"]=function(t){return isNaN(t)||(0===t?this.parseError=!0:(37!==t||r(d[1]).isASCIIHex(this.input[this.pointer+1])&&r(d[1]).isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),this.url.fragment+=E(t,w))),!0},m.exports.serializeURL=function(t,s){var e=t.scheme+":";if(null!==t.host?(e+="//",""===t.username&&""===t.password||(e+=t.username,""!==t.password&&(e+=":"+t.password),e+="@"),e+=R(t.host),null!==t.port&&(e+=":"+t.port)):null===t.host&&"file"===t.scheme&&(e+="//"),t.cannotBeABaseURL)e+=t.path[0];else for(var i of t.path)e+="/"+i;return null!==t.query&&(e+="?"+t.query),s||null===t.fragment||(e+="#"+t.fragment),e},m.exports.serializeURLOrigin=function(t){switch(t.scheme){case"blob":try{return m.exports.serializeURLOrigin(m.exports.parseURL(t.path[0]))}catch(t){return"null"}case"ftp":case"http":case"https":case"ws":case"wss":return s={scheme:t.scheme,host:t.host,port:t.port},e=s.scheme+"://",e+=R(s.host),null!==s.port&&(e+=":"+s.port),e;default:return"null"}var s,e},m.exports.basicURLParse=function(t,s){void 0===s&&(s={});var e=new D(t,s.baseURL,s.encodingOverride,s.url,s.stateOverride);return e.failure?null:e.url},m.exports.setTheUsername=function(t,s){t.username="";for(var e=r(d[0]).ucs2.decode(s),i=0;i= 0x80 (not a basic code point)','invalid-input':'Invalid input'},v=Math.floor,c=String.fromCharCode;function l(n){throw new RangeError(f[n])}function s(n,o){for(var t=[],i=n.length;i--;)t[i]=o(n[i]);return t}function p(n,o){var t=n.split('@'),i='';return t.length>1&&(i=t[0]+'@',n=t[1]),i+s((n=n.replace(u,'.')).split('.'),o).join('.')}function h(n){for(var o=[],t=0,i=n.length;t=55296&&u<=56319&&t>1,n+=v(n/t);n>455;u+=o)n=v(n/35);return v(u+36*n/(n+38))},x=function(t){var i,u=[],f=t.length,c=0,s=128,p=72,h=t.lastIndexOf("-");h<0&&(h=0);for(var w=0;w=128&&l('not-basic'),u.push(t.charCodeAt(w));for(var x=h>0?h+1:0;x=f&&l('invalid-input');var F=(i=t.charCodeAt(x++))>=48&&i<58?i-48+26:i>=65&&i<91?i-65:i>=97&&i<123?i-97:o;F>=o&&l('invalid-input'),F>v((n-c)/S)&&l('overflow'),c+=F*S;var I=b<=p?1:b>=p+26?26:b-p;if(Fv(n/m)&&l('overflow'),S*=m}var E=u.length+1;p=C(c-A,E,0==A),v(c/E)>n-s&&l('overflow'),s+=v(c/E),c%=E,u.splice(c++,0,s)}return String.fromCodePoint.apply(String,u)},A=function(t){var i=[],u=(t=h(t)).length,f=128,s=0,p=72;for(var x of t)x<128&&i.push(c(x));var A=i.length,S=A;for(A&&i.push("-");S=f&&Fv((n-s)/I)&&l('overflow'),s+=(b-f)*I,f=b,t))if(mn&&l('overflow'),m===f){for(var E=s,j=o;;j+=o){var k=j<=p?1:j>=p+26?26:j-p;if(E=48&&n<=57}function t(n){return n>=65&&n<=90||n>=97&&n<=122}m.exports={isASCIIDigit:n,isASCIIAlpha:t,isASCIIAlphanumeric:function(u){return t(u)||n(u)},isASCIIHex:function(t){return n(t)||t>=65&&t<=70||t>=97&&t<=102}}}),439,[]); +__d((function(g,r,_i,_a,_m,_e,d){'use strict';var t='function'==typeof Symbol&&'function'==typeof Symbol.for?Symbol.for('nodejs.util.inspect.custom'):null;_e.Buffer=i,_e.SlowBuffer=function(t){+t!=t&&(t=0);return i.alloc(+t)},_e.INSPECT_MAX_BYTES=50;var e=2147483647;function n(t){if(t>e)throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=new Uint8Array(t);return Object.setPrototypeOf(n,i.prototype),n}function i(t,e,n){if('number'==typeof t){if('string'==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return s(t)}return o(t,e,n)}function o(t,e,n){if('string'==typeof t)return h(t,e);if(ArrayBuffer.isView(t))return p(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return c(t,e,n);if('undefined'!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return c(t,e,n);if('number'==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var o=t.valueOf&&t.valueOf();if(null!=o&&o!==t)return i.from(o,e,n);var f=l(t);if(f)return f;if('undefined'!=typeof Symbol&&null!=Symbol.toPrimitive&&'function'==typeof t[Symbol.toPrimitive])return i.from(t[Symbol.toPrimitive]('string'),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if('number'!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t,e,i){return f(t),t<=0?n(t):void 0!==e?'string'==typeof i?n(t).fill(e,i):n(t).fill(e):n(t)}function s(t){return f(t),n(t<0?0:0|y(t))}function h(t,e){if('string'==typeof e&&''!==e||(e='utf8'),!i.isEncoding(e))throw new TypeError('Unknown encoding: '+e);var o=0|w(t,e),f=n(o),u=f.write(t,e);return u!==o&&(f=f.slice(0,u)),f}function a(t){for(var e=t.length<0?0:0|y(t.length),i=n(e),o=0;o=e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e.toString(16)+' bytes');return 0|t}function w(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if('string'!=typeof t)throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type "+typeof t);var n=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;for(var f=!1;;)switch(e){case'ascii':case'latin1':case'binary':return n;case'utf8':case'utf-8':return Y(t).length;case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return 2*n;case'hex':return n>>>1;case'base64':return W(t).length;default:if(f)return o?-1:Y(t).length;e=(''+e).toLowerCase(),f=!0}}function v(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return'';if((void 0===n||n>this.length)&&(n=this.length),n<=0)return'';if((n>>>=0)<=(e>>>=0))return'';for(t||(t='utf8');;)switch(t){case'hex':return P(this,e,n);case'utf8':case'utf-8':return S(this,e,n);case'ascii':return x(this,e,n);case'latin1':case'binary':return C(this,e,n);case'base64':return L(this,e,n);case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return k(this,e,n);default:if(i)throw new TypeError('Unknown encoding: '+t);t=(t+'').toLowerCase(),i=!0}}function b(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function m(t,e,n,o,f){if(0===t.length)return-1;if('string'==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Z(n=+n)&&(n=f?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(f)return-1;n=t.length-1}else if(n<0){if(!f)return-1;n=0}if('string'==typeof e&&(e=i.from(e,o)),i.isBuffer(e))return 0===e.length?-1:E(t,e,n,o,f);if('number'==typeof e)return e&=255,'function'==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):E(t,[e],n,o,f);throw new TypeError('val must be string, number or Buffer')}function E(t,e,n,i,o){var f,u=1,s=t.length,h=e.length;if(void 0!==i&&('ucs2'===(i=String(i).toLowerCase())||'ucs-2'===i||'utf16le'===i||'utf-16le'===i)){if(t.length<2||e.length<2)return-1;u=2,s/=2,h/=2,n/=2}function a(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(o){var p=-1;for(f=n;fs&&(n=s-h),f=n;f>=0;f--){for(var c=!0,l=0;lo&&(i=o):i=o;var f=e.length;i>f/2&&(i=f/2);for(var u=0;u239?4:a>223?3:a>191?2:1;if(o+c<=n)switch(c){case 1:a<128&&(p=a);break;case 2:128==(192&(f=t[o+1]))&&(h=(31&a)<<6|63&f)>127&&(p=h);break;case 3:f=t[o+1],u=t[o+2],128==(192&f)&&128==(192&u)&&(h=(15&a)<<12|(63&f)<<6|63&u)>2047&&(h<55296||h>57343)&&(p=h);break;case 4:f=t[o+1],u=t[o+2],s=t[o+3],128==(192&f)&&128==(192&u)&&128==(192&s)&&(h=(15&a)<<18|(63&f)<<12|(63&u)<<6|63&s)>65535&&h<1114112&&(p=h)}null===p?(p=65533,c=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|1023&p),i.push(p),o+=c}return R(i)}_e.kMaxLength=e,i.TYPED_ARRAY_SUPPORT=(function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}})(),i.TYPED_ARRAY_SUPPORT||'undefined'==typeof console||'function'!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,'parent',{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,'offset',{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),i.poolSize=8192,i.from=function(t,e,n){return o(t,e,n)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array),i.alloc=function(t,e,n){return u(t,e,n)},i.allocUnsafe=function(t){return s(t)},i.allocUnsafeSlow=function(t){return s(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==i.prototype},i.compare=function(t,e){if(J(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),J(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var n=t.length,o=e.length,f=0,u=Math.min(n,o);fo.length?i.from(u).copy(o,f):Uint8Array.prototype.set.call(o,u,f);else{if(!i.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(o,f)}f+=u.length}return o},i.byteLength=w,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError('Buffer size must be a multiple of 16-bits');for(var e=0;ee&&(t+=' ... '),''},t&&(i.prototype[t]=i.prototype.inspect),i.prototype.compare=function(t,e,n,o,f){if(J(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type "+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===f&&(f=this.length),e<0||n>t.length||o<0||f>this.length)throw new RangeError('out of range index');if(o>=f&&e>=n)return 0;if(o>=f)return-1;if(e>=n)return 1;if(this===t)return 0;for(var u=(f>>>=0)-(o>>>=0),s=(n>>>=0)-(e>>>=0),h=Math.min(u,s),a=this.slice(o,f),p=t.slice(e,n),c=0;c>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i='utf8')):(i=n,n=void 0)}var o=this.length-e;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError('Attempt to write outside buffer bounds');i||(i='utf8');for(var f=!1;;)switch(i){case'hex':return B(this,t,e,n);case'utf8':case'utf-8':return A(this,t,e,n);case'ascii':case'latin1':case'binary':return U(this,t,e,n);case'base64':return T(this,t,e,n);case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return I(this,t,e,n);default:if(f)throw new TypeError('Unknown encoding: '+i);i=(''+i).toLowerCase(),f=!0}},i.prototype.toJSON=function(){return{type:'Buffer',data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function R(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);for(var n='',i=0;ii)&&(n=i);for(var o='',f=e;fn)throw new RangeError('Trying to access beyond buffer length')}function _(t,e,n,o,f,u){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>f||et.length)throw new RangeError('Index out of range')}function j(t,e,n,i,o,f){if(n+i>t.length)throw new RangeError('Index out of range');if(n<0)throw new RangeError('Index out of range')}function z(t,e,n,i,o){return e=+e,n>>>=0,o||j(t,0,n,4),r(d[1]).write(t,e,n,i,23,4),n+4}function D(t,e,n,i,o){return e=+e,n>>>=0,o||j(t,0,n,8),r(d[1]).write(t,e,n,i,52,8),n+8}i.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||M(t,e,this.length);for(var i=this[t],o=1,f=0;++f>>=0,e>>>=0,n||M(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i},i.prototype.readUint8=i.prototype.readUInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),this[t]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||M(t,e,this.length);for(var i=this[t],o=1,f=0;++f=(o*=128)&&(i-=Math.pow(2,8*e)),i},i.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||M(t,e,this.length);for(var i=e,o=1,f=this[t+--i];i>0&&(o*=256);)f+=this[t+--i]*o;return f>=(o*=128)&&(f-=Math.pow(2,8*e)),f},i.prototype.readInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||M(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(t,e){t>>>=0,e||M(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||M(t,4,this.length),r(d[1]).read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||M(t,4,this.length),r(d[1]).read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||M(t,8,this.length),r(d[1]).read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||M(t,8,this.length),r(d[1]).read(this,t,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(t,e,n,i){(t=+t,e>>>=0,n>>>=0,i)||_(this,t,e,n,Math.pow(2,8*n)-1,0);var o=1,f=0;for(this[e]=255&t;++f>>=0,n>>>=0,i)||_(this,t,e,n,Math.pow(2,8*n)-1,0);var o=n-1,f=1;for(this[e+o]=255&t;--o>=0&&(f*=256);)this[e+o]=t/f&255;return e+n},i.prototype.writeUint8=i.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e>>>=0,!i){var o=Math.pow(2,8*n-1);_(this,t,e,n,o-1,-o)}var f=0,u=1,s=0;for(this[e]=255&t;++f>>=0,!i){var o=Math.pow(2,8*n-1);_(this,t,e,n,o-1,-o)}var f=n-1,u=1,s=0;for(this[e+f]=255&t;--f>=0&&(u*=256);)t<0&&0===s&&0!==this[e+f+1]&&(s=1),this[e+f]=(t/u|0)-s&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||_(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,n){return z(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return z(this,t,e,!1,n)},i.prototype.writeDoubleLE=function(t,e,n){return D(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return D(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,o){if(!i.isBuffer(t))throw new TypeError('argument should be a Buffer');if(n||(n=0),o||0===o||(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o=this.length)throw new RangeError('Index out of range');if(o<0)throw new RangeError('sourceEnd out of bounds');o>this.length&&(o=this.length),t.length-e>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),'number'==typeof t)for(u=e;u55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&f.push(239,191,189);continue}if(u+1===i){(e-=3)>-1&&f.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&f.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&f.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;f.push(n)}else if(n<2048){if((e-=2)<0)break;f.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;f.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error('Invalid code point');if((e-=4)<0)break;f.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return f}function q(t){for(var e=[],n=0;n>8,o=n%256,f.push(o),f.push(i);return f}function W(t){return r(d[0]).toByteArray(N(t))}function X(t,e,n,i){for(var o=0;o=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Z(t){return t!=t}var $=(function(){for(var t='0123456789abcdef',e=new Array(256),n=0;n<16;++n)for(var i=16*n,o=0;o<16;++o)e[i+o]=t[n]+t[o];return e})()}),440,[99,441]); +__d((function(g,r,_i,a,_m,_e,_d){_e.read=function(o,t,h,M,f){var w,p,i=8*f-M-1,n=(1<>1,e=-7,u=h?f-1:0,s=h?-1:1,c=o[t+u];for(u+=s,w=c&(1<<-e)-1,c>>=-e,e+=i;e>0;w=256*w+o[t+u],u+=s,e-=8);for(p=w&(1<<-e)-1,w>>=-e,e+=M;e>0;p=256*p+o[t+u],u+=s,e-=8);if(0===w)w=1-N;else{if(w===n)return p?NaN:1/0*(c?-1:1);p+=Math.pow(2,M),w-=N}return(c?-1:1)*p*Math.pow(2,w-M)},_e.write=function(o,t,h,M,f,w){var p,i,n,N=8*w-f-1,e=(1<>1,s=23===f?Math.pow(2,-24)-Math.pow(2,-77):0,c=M?0:w-1,l=M?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,p=e):(p=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-p))<1&&(p--,n*=2),(t+=p+u>=1?s/n:s*Math.pow(2,1-u))*n>=2&&(p++,n/=2),p+u>=e?(i=0,p=e):p+u>=1?(i=(t*n-1)*Math.pow(2,f),p+=u):(i=t*Math.pow(2,u-1)*Math.pow(2,f),p=0));f>=8;o[h+c]=255&i,c+=l,i/=256,f-=8);for(p=p<0;o[h+c]=255&p,c+=l,p/=256,N-=8);o[h+c-l]|=128*d}}),441,[]); +__d((function(g,r,_i,a,m,e,d){"use strict";function n(n,f){for(var t=[],o=0,i=n.indexOf(f);i>=0;)t.push(n.slice(o,i)),o=i+1,i=n.indexOf(f,o);return o!==n.length&&t.push(n.slice(o)),t}function f(n,f,t){for(var o=n.indexOf(f);o>=0;)n[o]=t,o=n.indexOf(f,o+1);return n}function t(n){var f=n.toString(16).toUpperCase();return 1===f.length&&(f="0"+f),"%"+f}function o(n){for(var f=r(d[0]).Buffer.alloc(n.byteLength),t=0,o=0;o=0?(l=c.slice(0,v),s=c.slice(v+1)):(l=c,s=r(d[0]).Buffer.alloc(0)),l=f(r(d[0]).Buffer.from(l),43,32),s=f(r(d[0]).Buffer.from(s),43,32),u.push([o(l).toString(),o(s).toString()])}return u}function u(n){var f="";for(var o of n)f+=32===o?"+":42===o||45===o||46===o||o>=48&&o<=57||o>=65&&o<=90||95===o||o>=97&&o<=122?String.fromCodePoint(o):t(o);return f}m.exports={percentEncode:t,percentDecode:o,parseUrlencoded:function(n){return i(r(d[0]).Buffer.from(n))},serializeUrlencoded:function(n){var f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,t="utf-8";void 0!==f&&(t=f);var o="";for(var i of n.entries()){var c=r(d[2])(i,2),l=c[0],s=c[1],v=u(r(d[0]).Buffer.from(s[0])),h=s[1];s.length>2&&void 0!==s[2]&&("hidden"===s[2]&&"_charset_"===v?h=t:"file"===s[2]&&(h=h.name)),0!==l&&(o+="&"),o+=`${v}=${h=u(r(d[0]).Buffer.from(h))}`}return o}}}),442,[440,439,24]); +__d((function(g,r,_i,a,m,e,d){"use strict";var t=Object.create(r(d[0]).IteratorPrototype,r(d[1])({next:{value:function(){var t=this[r(d[0]).iterInternalSymbol],o=t.target,n=t.kind,i=t.index,l=Array.from(o[r(d[0]).implSymbol]);if(i>=l.length)return{value:void 0,done:!0};var s=l[i];t.index=i+1;var c,u=s.map(r(d[0]).tryWrapperForImpl),p=r(d[2])(u,2),h=p[0],y=p[1];switch(n){case"key":c=h;break;case"value":c=y;break;case"key+value":c=[h,y]}return{value:c,done:!1}},writable:!0,enumerable:!0,configurable:!0}},Symbol.toStringTag,{value:"URLSearchParams Iterator",configurable:!0})),o={_mixedIntoPredicates:[],is:function(t){if(t){if(r(d[0]).hasOwn(t,r(d[0]).implSymbol)&&t[r(d[0]).implSymbol]instanceof r(d[3]).implementation)return!0;for(var o of m.exports._mixedIntoPredicates)if(o(t))return!0}return!1},isImpl:function(t){if(t){if(t instanceof r(d[3]).implementation)return!0;var o=r(d[0]).wrapperForImpl(t);for(var n of m.exports._mixedIntoPredicates)if(n(o))return!0}return!1},convert:function(t){var o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).context,n=void 0===o?"The provided value":o;if(m.exports.is(t))return r(d[0]).implForWrapper(t);throw new TypeError(`${n} is not of type 'URLSearchParams'.`)},createDefaultIterator:function(o,n){var i=Object.create(t);return Object.defineProperty(i,r(d[0]).iterInternalSymbol,{value:{target:o,kind:n,index:0},configurable:!0}),i},create:function(t,n,i){if(void 0===t[r(d[0]).ctorRegistrySymbol])throw new Error("Internal error: invalid global object");var l=t[r(d[0]).ctorRegistrySymbol].URLSearchParams;if(void 0===l)throw new Error("Internal error: constructor URLSearchParams is not installed on the passed global object");var s=Object.create(l.prototype);return s=o.setup(s,t,n,i)},createImpl:function(t,n,i){var l=o.create(t,n,i);return r(d[0]).implForWrapper(l)},_internalSetup:function(t){},setup:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return l.wrapper=t,o._internalSetup(t),Object.defineProperty(t,r(d[0]).implSymbol,{value:new(r(d[3]).implementation)(n,i,l),configurable:!0}),t[r(d[0]).implSymbol][r(d[0]).wrapperSymbol]=t,r(d[3]).init&&r(d[3]).init(t[r(d[0]).implSymbol],l),t},install:function(t){var n=(function(){return r(d[6])((function n(){r(d[4])(this,n);var i=[],l=arguments[0];if(void 0!==l)if(r(d[0]).isObject(l))if(void 0!==l[Symbol.iterator]){if(!r(d[0]).isObject(l))throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object.");var s=[],c=l;for(var u of c){if(!r(d[0]).isObject(u))throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object.");var p=[],h=u;for(var y of h)y=r(d[5]).USVString(y,{context:"Failed to construct 'URLSearchParams': parameter 1 sequence's element's element"}),p.push(y);u=p,s.push(u)}l=s}else{if(!r(d[0]).isObject(l))throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 record is not an object.");var f=Object.create(null);for(var v of Reflect.ownKeys(l)){var b=Object.getOwnPropertyDescriptor(l,v);if(b&&b.enumerable){var S=v;S=r(d[5]).USVString(S,{context:"Failed to construct 'URLSearchParams': parameter 1 record's key"});var w=l[v];w=r(d[5]).USVString(w,{context:"Failed to construct 'URLSearchParams': parameter 1 record's value"}),f[S]=w}}l=f}else l=r(d[5]).USVString(l,{context:"Failed to construct 'URLSearchParams': parameter 1"});else l="";return i.push(l),o.setup(Object.create(this.constructor.prototype),t,i)}),[{key:"append",value:function(t,o){var n;if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");if(arguments.length<2)throw new TypeError("Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only "+arguments.length+" present.");var i=[],l=arguments[0];l=r(d[5]).USVString(l,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 1"}),i.push(l);var s=arguments[1];return s=r(d[5]).USVString(s,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 2"}),i.push(s),(n=this[r(d[0]).implSymbol]).append.apply(n,i)}},{key:"delete",value:function(t){var o;if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");if(arguments.length<1)throw new TypeError("Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only "+arguments.length+" present.");var n=[],i=arguments[0];return i=r(d[5]).USVString(i,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 1"}),n.push(i),(o=this[r(d[0]).implSymbol]).delete.apply(o,n)}},{key:"get",value:function(t){var o;if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");if(arguments.length<1)throw new TypeError("Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only "+arguments.length+" present.");var n=[],i=arguments[0];return i=r(d[5]).USVString(i,{context:"Failed to execute 'get' on 'URLSearchParams': parameter 1"}),n.push(i),(o=this[r(d[0]).implSymbol]).get.apply(o,n)}},{key:"getAll",value:function(t){var o;if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");if(arguments.length<1)throw new TypeError("Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only "+arguments.length+" present.");var n=[],i=arguments[0];return i=r(d[5]).USVString(i,{context:"Failed to execute 'getAll' on 'URLSearchParams': parameter 1"}),n.push(i),r(d[0]).tryWrapperForImpl((o=this[r(d[0]).implSymbol]).getAll.apply(o,n))}},{key:"has",value:function(t){var o;if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");if(arguments.length<1)throw new TypeError("Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only "+arguments.length+" present.");var n=[],i=arguments[0];return i=r(d[5]).USVString(i,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 1"}),n.push(i),(o=this[r(d[0]).implSymbol]).has.apply(o,n)}},{key:"set",value:function(t,o){var n;if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");if(arguments.length<2)throw new TypeError("Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only "+arguments.length+" present.");var i=[],l=arguments[0];l=r(d[5]).USVString(l,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 1"}),i.push(l);var s=arguments[1];return s=r(d[5]).USVString(s,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 2"}),i.push(s),(n=this[r(d[0]).implSymbol]).set.apply(n,i)}},{key:"sort",value:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].sort()}},{key:"toString",value:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return this[r(d[0]).implSymbol].toString()}},{key:"keys",value:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return m.exports.createDefaultIterator(this,"key")}},{key:"values",value:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return m.exports.createDefaultIterator(this,"value")}},{key:"entries",value:function(){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");return m.exports.createDefaultIterator(this,"key+value")}},{key:"forEach",value:function(t){if(!this||!m.exports.is(this))throw new TypeError("Illegal invocation");if(arguments.length<1)throw new TypeError("Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1 is not a function.");for(var o=arguments[1],n=Array.from(this[r(d[0]).implSymbol]),i=0;ii[0]},t.map((function(t,i){return{item:t,index:i}})).sort((function(t,s){return i(t.item,s.item)||t.index-s.index})).map((function(t){return t.item}))),this._updateSteps()}},{key:Symbol.iterator,value:function(){return this._list[Symbol.iterator]()}},{key:"toString",value:function(){return r(d[1]).serializeUrlencoded(this._list)}}])})()}),444,[12,442,13]); +__d((function(g,r,_i,_a,m,_e,_d){"use strict";function n(n,t){return`${t&&t.context?t.context:"Value"} ${n}.`}function t(n){if(null===n)return"Null";switch(typeof n){case"undefined":return"Undefined";case"boolean":return"Boolean";case"number":return"Number";case"string":return"String";case"symbol":return"Symbol";default:return"Object"}}function e(n){return a(n>0&&n%1==.5&&!(1&n)||n<0&&n%1==-.5&&!(1&~n)?Math.floor(n):Math.round(n))}function o(n){return a(Math.trunc(n))}function i(n){return n<0?-1:1}function u(n,t){var e=n%t;return i(t)!==i(e)?e+t:e}function a(n){return 0===n?0:n}function f(t,i){var f,c,s=!i.unsigned;64===t?(c=Math.pow(2,53)-1,f=s?1-Math.pow(2,53):0):s?(f=-Math.pow(2,t-1),c=Math.pow(2,t-1)-1):(f=0,c=Math.pow(2,t)-1);var l=Math.pow(2,t),y=Math.pow(2,t-1);return function(t,i){void 0===i&&(i={});var w=+t;if(w=a(w),i.enforceRange){if(!Number.isFinite(w))throw new TypeError(n("is not a finite number",i));if((w=o(w))c)throw new TypeError(n(`is outside the accepted range of ${f} to ${c}, inclusive`,i));return w}return!Number.isNaN(w)&&i.clamp?w=e(w=Math.min(Math.max(w,f),c)):Number.isFinite(w)&&0!==w?(w=o(w))>=f&&w<=c?w:(w=u(w,l),s&&w>=y?w-l:w):0}}function c(t,e){if("function"!=typeof t)throw new TypeError(n("is not a function",e));return t}_e.any=function(n){return n},_e.void=function(){},_e.boolean=function(n){return!!n},_e.byte=f(8,{unsigned:!1}),_e.octet=f(8,{unsigned:!0}),_e.short=f(16,{unsigned:!1}),_e["unsigned short"]=f(16,{unsigned:!0}),_e.long=f(32,{unsigned:!1}),_e["unsigned long"]=f(32,{unsigned:!0}),_e["long long"]=f(64,{unsigned:!1}),_e["unsigned long long"]=f(64,{unsigned:!0}),_e.double=function(t,e){var o=+t;if(!Number.isFinite(o))throw new TypeError(n("is not a finite floating-point value",e));return o},_e["unrestricted double"]=function(n){return+n},_e.float=function(t,e){var o=+t;if(!Number.isFinite(o))throw new TypeError(n("is not a finite floating-point value",e));if(Object.is(o,-0))return o;var i=Math.fround(o);if(!Number.isFinite(i))throw new TypeError(n("is outside the range of a single-precision floating-point value",e));return i},_e["unrestricted float"]=function(n){var t=+n;return isNaN(t)||Object.is(t,-0)?t:Math.fround(t)},_e.DOMString=function(t,e){if(void 0===e&&(e={}),e.treatNullAsEmptyString&&null===t)return"";if("symbol"==typeof t)throw new TypeError(n("is a symbol, which cannot be converted to a string",e));return String(t)},_e.ByteString=function(t,e){for(var o,i=_e.DOMString(t,e),u=0;void 0!==(o=i.codePointAt(u));++u)if(o>255)throw new TypeError(n("is not a valid ByteString",e));return i},_e.USVString=function(n,t){for(var e=_e.DOMString(n,t),o=e.length,i=[],u=0;u57343)i.push(String.fromCodePoint(a));else if(56320<=a&&a<=57343)i.push(String.fromCodePoint(65533));else if(u===o-1)i.push(String.fromCodePoint(65533));else{var f=e.charCodeAt(u+1);if(56320<=f&&f<=57343){var c=1023&a,s=1023&f;i.push(String.fromCodePoint(65536+1024*c+s)),++u}else i.push(String.fromCodePoint(65533))}}return i.join("")},_e.object=function(e,o){if("Object"!==t(e))throw new TypeError(n("is not an object",o));return e};var s=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get;function l(n){try{return s.call(n),!0}catch(n){return!1}}_e.ArrayBuffer=function(t,e){if(!l(t))throw new TypeError(n("is not a view on an ArrayBuffer object",e));return t};var y=Object.getOwnPropertyDescriptor(DataView.prototype,"byteLength").get;_e.DataView=function(t,e){try{return y.call(t),t}catch(t){throw new TypeError(n("is not a view on an DataView object",e))}},[Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Uint8ClampedArray,Float32Array,Float64Array].forEach((function(t){var e=t.name,o=/^[AEIOU]/.test(e)?"an":"a";_e[e]=function(t,i){if(!ArrayBuffer.isView(t)||t.constructor.name!==e)throw new TypeError(n(`is not ${o} ${e} object`,i));return t}})),_e.ArrayBufferView=function(t,e){if(!ArrayBuffer.isView(t))throw new TypeError(n("is not a view on an ArrayBuffer object",e));return t},_e.BufferSource=function(t,e){if(!ArrayBuffer.isView(t)&&!l(t))throw new TypeError(n("is not an ArrayBuffer object or a view on one",e));return t},_e.DOMTimeStamp=_e["unsigned long long"],_e.Function=c,_e.VoidFunction=c}),445,[]); +__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"URLSearchParams",{enumerable:!0,get:function(){return r(d[0]).URLSearchParams}})}),446,[432]); +__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.useUpdate=e.usePushy=e.useCresc=e.defaultContext=e.UpdateContext=void 0;var t=r(d[0]),n=function(){},s=function(){return Promise.resolve()},o=e.defaultContext={checkUpdate:s,switchVersion:s,switchVersionLater:s,markSuccess:n,dismissError:n,downloadUpdate:s,downloadAndInstallApk:s,getCurrentVersionInfo:function(){return Promise.resolve({})},parseTestQrCode:function(){return!1},currentHash:'',packageVersion:''},u=e.UpdateContext=(0,t.createContext)(o),c=e.useUpdate=function(){return(0,t.useContext)(u)};e.usePushy=c,e.useCresc=c}),447,[143]); __d((function(p,a,d,n,e,o,r){e.exports={ios:{appId:24794,appKey:"SqShg4Klnj2hG6LAFMW2PdcgSSuniz0T"},android:{appId:27509,appKey:"aQz3Uc2pA7gt_prDaQ4rbWRY"},harmony:{appId:29140,appKey:"JLklGflGIRbY-cMebjQwm1J1"}}}),448,[]); __d((function(g,r,i,a,m,e,d){m.exports=r(d[0]).registerAsset({__packager_asset:!0,httpServerLocation:"/assets/assets",width:24,height:24,scales:[1,2,3],hash:"9e7669fef128a85f6fae4b929ebff8dd",name:"shezhi",type:"png"})}),449,[450]); __d((function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0])}),450,[177]); diff --git a/Example/harmony_use_pushy/harmony/entry/src/main/resources/rawfile/meta.json b/Example/harmony_use_pushy/harmony/entry/src/main/resources/rawfile/meta.json index 155e6bac..af04222a 100644 --- a/Example/harmony_use_pushy/harmony/entry/src/main/resources/rawfile/meta.json +++ b/Example/harmony_use_pushy/harmony/entry/src/main/resources/rawfile/meta.json @@ -1,4 +1,4 @@ { - "pushy_build_time": "2025-02-14T09:43:25.648Z", + "pushy_build_time": "2025-03-09T01:57:42.464Z", "versionName": "1.0.0" } \ No newline at end of file diff --git a/Example/harmony_use_pushy/yarn.lock b/Example/harmony_use_pushy/yarn.lock index 1337f5fd..143bd977 100644 --- a/Example/harmony_use_pushy/yarn.lock +++ b/Example/harmony_use_pushy/yarn.lock @@ -5520,9 +5520,9 @@ mustache@^4.2.0: integrity sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ== nanoid@^3.3.3: - version "3.3.8" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf" - integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w== + version "3.3.9" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.9.tgz#e0097d8e026b3343ff053e9ccd407360a03f503a" + integrity sha512-SppoicMGpZvbF1l3z4x7No3OlIjP7QJvC9XR7AhZr1kL133KHnKPztkKDc+Ir4aJ/1VhTySrtKhrsycmrMQfvg== natural-compare-lite@^1.4.0: version "1.4.0" @@ -6003,7 +6003,7 @@ react-is@^17.0.1: integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== "react-native-update@file:../..": - version "10.19.6" + version "10.26.1" dependencies: nanoid "^3.3.3" react-native-url-polyfill "^2.0.0" diff --git a/harmony/src/main/ets/DownloadTask.ts b/harmony/src/main/ets/DownloadTask.ts index 867c4e53..d74e54ea 100644 --- a/harmony/src/main/ets/DownloadTask.ts +++ b/harmony/src/main/ets/DownloadTask.ts @@ -65,9 +65,13 @@ export class DownloadTask { 0, params.targetFile.lastIndexOf('/'), ); - await fileIo.mkdir(targetDir); + const exists = fileIo.accessSync(targetDir); + if(!exists){ + await fileIo.mkdir(targetDir); + } } } catch (error) { + throw error; } const response = await httpRequest.request(params.url, { @@ -78,12 +82,11 @@ export class DownloadTask { 'Content-Type': 'application/octet-stream', }, }); - if (response.responseCode > 299) { throw new Error(`Server error: ${response.responseCode}`); } - const contentLength = parseInt(response.header['Content-Length'] || '0'); + const contentLength = parseInt(response.header['content-length'] || '0'); const writer = await fileIo.open( params.targetFile, fileIo.OpenMode.CREATE | fileIo.OpenMode.READ_WRITE, @@ -102,8 +105,12 @@ export class DownloadTask { this.onProgressUpdate(received, contentLength); } await fileIo.close(writer); - const stat = await fileIo.stat(params.targetFile); - const fileSize = stat.size; + const stats = await fileIo.stat(params.targetFile); + const fileSize = stats.size; + if (fileSize !== contentLength) { + throw new Error(`Download incomplete: expected ${contentLength} bytes but got ${stats.size} bytes`); + } + } catch (error) { console.error('Download failed:', error); throw error; @@ -113,7 +120,7 @@ export class DownloadTask { } private onProgressUpdate(received: number, total: number): void { - this.eventHub.emit('downloadProgress', { + this.eventHub.emit('RCTPushyDownloadProgress', { received, total, hash: this.hash, @@ -288,8 +295,8 @@ export class DownloadTask { } } - if(entry.filename !== '.DS_Store'){ - await zip.decompressFile(entry.filename, params.unzipDirectory); + if(fn !== '.DS_Store'){ + await zip.decompressFile(fn, params.unzipDirectory); } } @@ -491,4 +498,4 @@ export class DownloadTask { params.listener?.onDownloadFailed(error); } } -} \ No newline at end of file +} diff --git a/harmony/src/main/ets/EventHub.ts b/harmony/src/main/ets/EventHub.ts index 8f803113..9459a82f 100644 --- a/harmony/src/main/ets/EventHub.ts +++ b/harmony/src/main/ets/EventHub.ts @@ -3,6 +3,7 @@ type EventCallback = (data: any) => void; export class EventHub { private static instance: EventHub; private listeners: Map>; + private rnInstance: any; private constructor() { this.listeners = new Map(); @@ -27,12 +28,12 @@ export class EventHub { } public emit(event: string, data: any): void { - this.listeners.get(event)?.forEach(callback => { - try { - callback(data); - } catch (error) { - console.error(`Error in event listener for ${event}:`, error); - } - }); + if (this.rnInstance) { + this.rnInstance.emitDeviceEvent(event, data); + } + } + + setRNInstance(instance: any) { + this.rnInstance = instance; } } \ No newline at end of file diff --git a/harmony/src/main/ets/PushyTurboModule.ts b/harmony/src/main/ets/PushyTurboModule.ts index ecc02079..0edfceda 100644 --- a/harmony/src/main/ets/PushyTurboModule.ts +++ b/harmony/src/main/ets/PushyTurboModule.ts @@ -7,6 +7,7 @@ import { BusinessError } from '@ohos.base'; import logger from './Logger'; import { UpdateModuleImpl } from './UpdateModuleImpl'; import { UpdateContext } from './UpdateContext'; +import { EventHub } from './EventHub'; const TAG = "PushyTurboModule" @@ -18,9 +19,8 @@ export class PushyTurboModule extends TurboModule { super(ctx); logger.debug(TAG, ",PushyTurboModule constructor"); this.mUiCtx = ctx.uiAbilityContext - let rnInstance = ctx.rnInstance this.context = new UpdateContext(this.mUiCtx) - // rnInstance.emitDeviceEvent("Pushy",{code: err.code, message: err.message}); + EventHub.getInstance().setRNInstance(ctx.rnInstance) } diff --git a/harmony/src/main/ets/UpdateContext.ts b/harmony/src/main/ets/UpdateContext.ts index e6ec71fd..7101a801 100644 --- a/harmony/src/main/ets/UpdateContext.ts +++ b/harmony/src/main/ets/UpdateContext.ts @@ -31,11 +31,14 @@ export class UpdateContext { this.preferences = preferences.getPreferencesSync(this.context, {name:'update'}); const packageVersion = this.getPackageVersion(); const storedVersion = this.preferences.getSync('packageVersion', ''); - if (packageVersion !== storedVersion) { - this.preferences.clear(); - this.preferences.putSync('packageVersion', packageVersion); - this.preferences.flush(); - this.cleanUp(); + if(!storedVersion){ + this.preferences.putSync('packageVersion', packageVersion); + this.preferences.flush(); + } else if (storedVersion && packageVersion !== storedVersion) { + this.preferences.clear(); + this.preferences.putSync('packageVersion', packageVersion); + this.preferences.flush(); + this.cleanUp(); } } catch (e) { console.error('Failed to init preferences:', e); @@ -137,8 +140,9 @@ export class UpdateContext { params.unzipDirectory = `${this.rootDir}/${hash}`; const downloadTask = new DownloadTask(this.context); - await downloadTask.execute(params); + return await downloadTask.execute(params); } catch (e) { + throw e; console.error('Failed to download APK patch:', e); } } @@ -152,14 +156,13 @@ export class UpdateContext { const lastVersion = this.getKv('currentVersion'); this.setKv('currentVersion', hash); - if (lastVersion && lastVersion !== hash) { this.setKv('lastVersion', lastVersion); } this.setKv('firstTime', 'true'); this.setKv('firstTimeOk', 'false'); - this.setKv('rolledBackVersion', null); + this.setKv('rolledBackVersion', ""); } catch (e) { console.error('Failed to switch version:', e); } @@ -211,7 +214,7 @@ export class UpdateContext { } public getCurrentVersion() : string { - const currentVersion = this.preferences.getSync('currentVersion', '') as string; + const currentVersion = this.getKv('currentVersion'); return currentVersion; } diff --git a/harmony/src/main/ets/UpdateModuleImpl.ts b/harmony/src/main/ets/UpdateModuleImpl.ts index e4473a64..9f2bd646 100644 --- a/harmony/src/main/ets/UpdateModuleImpl.ts +++ b/harmony/src/main/ets/UpdateModuleImpl.ts @@ -56,7 +56,7 @@ export class UpdateModuleImpl { options: { updateUrl: string; hash: string } ): Promise { try { - await updateContext.downloadPatchFromPackage(options.updateUrl, options.hash, { + return await updateContext.downloadPatchFromPackage(options.updateUrl, options.hash, { onDownloadCompleted: (params: DownloadTaskParams) => { return Promise.resolve(); }, diff --git a/src/client.ts b/src/client.ts index e824d0a9..4fb3d047 100644 --- a/src/client.ts +++ b/src/client.ts @@ -9,7 +9,7 @@ import { promiseAny, testUrls, } from './utils'; -import { EmitterSubscription, Platform } from 'react-native'; +import { EmitterSubscription, Platform, DeviceEventEmitter } from 'react-native'; import { PermissionsAndroid } from './permissions'; import { PushyModule, @@ -350,14 +350,25 @@ export class Pushy { return; } if (onDownloadProgress) { - Pushy.progressHandlers[hash] = pushyNativeEventEmitter.addListener( - 'RCTPushyDownloadProgress', - progressData => { - if (progressData.hash === hash) { - onDownloadProgress(progressData); - } - }, - ); + if (Platform.OS === 'harmony') { + Pushy.progressHandlers[hash] = DeviceEventEmitter.addListener( + 'RCTPushyDownloadProgress', + progressData => { + if (progressData.hash === hash) { + onDownloadProgress(progressData); + } + }, + ); + } else { + Pushy.progressHandlers[hash] = pushyNativeEventEmitter.addListener( + 'RCTPushyDownloadProgress', + progressData => { + if (progressData.hash === hash) { + onDownloadProgress(progressData); + } + }, + ); + } } let succeeded = ''; this.report({ type: 'downloading' });