@seastart/srtc-web-sdk 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.mts +851 -0
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(()=>(()=>{var e={7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],l=o[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,l)),c=0,h=l>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t);1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(l(e,a,a+s>u?u:a+s));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},6880:function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=r(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,n){void 0===n&&(n=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(r),s=Math.max(i,o),a=0,l=e.map([t,r],(function(t){var r=s-e.getVersionPrecision(t),n=t+new Array(r+1).join(".0");return e.map(n.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(n&&(a=s-Math.min(i,o)),s-=1;s>=a;){if(l[0][s]>l[1][s])return 1;if(l[0][s]===l[1][s]){if(s===a)return 0;s-=1}else if(l[0][s]<l[1][s])return-1}},e.map=function(e,t){var r,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n},e.find=function(e,t){var r,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(r=0,n=e.length;r<n;r+=1){var i=e[r];if(t(i,r))return i}},e.assign=function(e){for(var t,r,n=e,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];if(Object.assign)return Object.assign.apply(Object,[e].concat(o));var a=function(){var e=o[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){n[t]=e[t]}))};for(t=0,r=o.length;t<r;t+=1)a();return e},e.getBrowserAlias=function(e){return n.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return n.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,r){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(91))&&n.__esModule?n:{default:n},o=r(18);function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=function(){function e(){}var t,r,n;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,n=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}],(r=null)&&s(t.prototype,r),n&&s(t,n),e}();t.default=a,e.exports=t.default},91:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=l(r(92)),i=l(r(93)),o=l(r(94)),s=l(r(95)),a=l(r(17));function l(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=a.default.find(n.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=a.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=a.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=a.default.find(s.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return a.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,r={},n=0,i={},o=0;if(Object.keys(e).forEach((function(t){var s=e[t];"string"==typeof s?(i[t]=s,o+=1):"object"==typeof s&&(r[t]=s,n+=1)})),n>0){var s=Object.keys(r),l=a.default.find(s,(function(e){return t.isOS(e)}));if(l){var u=this.satisfies(r[l]);if(void 0!==u)return u}var c=a.default.find(s,(function(e){return t.isPlatform(e)}));if(c){var h=this.satisfies(r[c]);if(void 0!==h)return h}}if(o>0){var f=Object.keys(i),d=a.default.find(f,(function(e){return t.isBrowser(e,!0)}));if(void 0!==d)return this.compareVersion(i[d])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),i=a.default.getBrowserTypeByAlias(n);return t&&i&&(n=i.toLowerCase()),n===r},t.compareVersion=function(e){var t=[0],r=e,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(n=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(n=!0,r=e.substr(1)),t.indexOf(a.default.compareVersions(i,r,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=u,e.exports=t.default},92:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=/version\/(\d+(\.?_?\d+)+)/i,s=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=s,e.exports=t.default},93:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},r=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=i.default.getMacOSVersionName(t),n={name:o.OS_MAP.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=i.default.getAndroidVersionName(t),n={name:o.OS_MAP.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:o.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=s,e.exports=t.default},94:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=s,e.exports=t.default},95:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},r=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},r=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},r=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=s,e.exports=t.default}})},8287:(e,t,r)=>{"use strict";const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=l,t.IS=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|g(e,t);let n=a(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);const i=function(e){if(l.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Y(e.length)?a(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return c(e),a(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,l.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(i)return n?-1:$(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){let o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Y(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return G($(t,e.length-r),e,r,n)}function E(e,t,r,n){return G(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return G(K(t),e,r,n)}function k(e,t,r,n){return G(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(o=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=I));return r}(n)}l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.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(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},l.allocUnsafe=function(e){return h(e)},l.allocUnsafeSlow=function(e){return h(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=l.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,Uint8Array))i+t.length>n.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):y.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,i){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),u=this.slice(n,i),c=e.slice(t,r);for(let e=0;e<a;++e)if(u[e]!==c[e]){o=u[e],s=c[e];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function C(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function O(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=J[e[n]];return i}function M(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function P(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function B(e,t,r,n,i){V(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function L(e,t,r,n,i){V(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function U(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,o){return t=+t,r>>>=0,o||U(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function j(e,t,r,n,o){return t=+t,r>>>=0,o||U(e,0,r,8),i.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),l.prototype.readBigUInt64BE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),l.prototype.readBigInt64BE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=X((function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=X((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=X((function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=X((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return j(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return j(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},l.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=l.isBuffer(e)?e:l.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const D={};function F(e,t,r){D[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function W(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function V(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new D.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,o)}function z(e,t){if("number"!=typeof e)throw new D.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new D.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=W(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=W(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function $(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function K(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},955:function(e,t,r){var n;e.exports=(n=r(9021),r(754),r(4636),r(9506),r(7165),function(){var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],o=[],s=[],a=[],l=[],u=[],c=[],h=[],f=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,o[p]=r;var g=e[r],y=e[g],b=e[y],v=257*e[p]^16843008*p;s[r]=v<<24|v>>>8,a[r]=v<<16|v>>>16,l[r]=v<<8|v>>>24,u[r]=v,v=16843009*b^65537*y^257*g^16843008*r,c[p]=v<<24|v>>>8,h[p]=v<<16|v>>>16,f[p]=v<<8|v>>>24,d[p]=v,r?(r=g^e[e[e[b^g]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],g=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],s=0;s<n;s++)s<r?o[s]=t[s]:(u=o[s-1],s%r?r>6&&s%r==4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u]):(u=i[(u=u<<8|u>>>24)>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u],u^=p[s/r|0]<<24),o[s]=o[s-r]^u);for(var a=this._invKeySchedule=[],l=0;l<n;l++){if(s=n-l,l%4)var u=o[s];else u=o[s-4];a[l]=l<4||s<=4?u:c[i[u>>>24]]^h[i[u>>>16&255]]^f[i[u>>>8&255]]^d[i[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,l,u,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,c,h,f,d,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,s,a){for(var l=this._nRounds,u=e[t]^r[0],c=e[t+1]^r[1],h=e[t+2]^r[2],f=e[t+3]^r[3],d=4,p=1;p<l;p++){var g=n[u>>>24]^i[c>>>16&255]^o[h>>>8&255]^s[255&f]^r[d++],y=n[c>>>24]^i[h>>>16&255]^o[f>>>8&255]^s[255&u]^r[d++],b=n[h>>>24]^i[f>>>16&255]^o[u>>>8&255]^s[255&c]^r[d++],v=n[f>>>24]^i[u>>>16&255]^o[c>>>8&255]^s[255&h]^r[d++];u=g,c=y,h=b,f=v}g=(a[u>>>24]<<24|a[c>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^r[d++],y=(a[c>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&u])^r[d++],b=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[u>>>8&255]<<8|a[255&c])^r[d++],v=(a[f>>>24]<<24|a[u>>>16&255]<<16|a[c>>>8&255]<<8|a[255&h])^r[d++],e[t]=g,e[t+1]=y,e[t+2]=b,e[t+3]=v},keySize:8});e.AES=t._createHelper(g)}(),n.AES)},3128:function(e,t,r){var n;e.exports=(n=r(9021),r(754),r(4636),r(9506),r(7165),function(){var e=n,t=e.lib.BlockCipher,r=e.algo;const i=16,o=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var a={pbox:[],sbox:[]};function l(e,t){let r=t>>24&255,n=t>>16&255,i=t>>8&255,o=255&t,s=e.sbox[0][r]+e.sbox[1][n];return s^=e.sbox[2][i],s+=e.sbox[3][o],s}function u(e,t,r){let n,o=t,s=r;for(let t=0;t<i;++t)o^=e.pbox[t],s=l(e,o)^s,n=o,o=s,s=n;return n=o,o=s,s=n,s^=e.pbox[i],o^=e.pbox[i+1],{left:o,right:s}}function c(e,t,r){let n,o=t,s=r;for(let t=i+1;t>1;--t)o^=e.pbox[t],s=l(e,o)^s,n=o,o=s,s=n;return n=o,o=s,s=n,s^=e.pbox[1],o^=e.pbox[0],{left:o,right:s}}function h(e,t,r){for(let t=0;t<4;t++){e.sbox[t]=[];for(let r=0;r<256;r++)e.sbox[t][r]=s[t][r]}let n=0;for(let s=0;s<i+2;s++)e.pbox[s]=o[s]^t[n],n++,n>=r&&(n=0);let a=0,l=0,c=0;for(let t=0;t<i+2;t+=2)c=u(e,a,l),a=c.left,l=c.right,e.pbox[t]=a,e.pbox[t+1]=l;for(let t=0;t<4;t++)for(let r=0;r<256;r+=2)c=u(e,a,l),a=c.left,l=c.right,e.sbox[t][r]=a,e.sbox[t][r+1]=l;return!0}var f=r.Blowfish=t.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4;h(a,t,r)}},encryptBlock:function(e,t){var r=u(a,e[t],e[t+1]);e[t]=r.left,e[t+1]=r.right},decryptBlock:function(e,t){var r=c(a,e[t],e[t+1]);e[t]=r.left,e[t+1]=r.right},blockSize:2,keySize:4,ivSize:2});e.Blowfish=t._createHelper(f)}(),n.Blowfish)},7165:function(e,t,r){var n;e.exports=(n=r(9021),r(9506),void(n.lib.Cipher||function(e){var t=n,r=t.lib,i=r.Base,o=r.WordArray,s=r.BufferedBlockAlgorithm,a=t.enc,l=(a.Utf8,a.Base64),u=t.algo.EvpKDF,c=r.Cipher=s.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?m:b}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),h=(r.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),t.mode={}),f=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),d=h.CBC=function(){var t=f.extend();function r(t,r,n){var i,o=this._iv;o?(i=o,this._iv=e):i=this._prevBlock;for(var s=0;s<n;s++)t[r+s]^=i[s]}return t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize;r.call(this,e,t,i),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,o=e.slice(t,t+i);n.decryptBlock(e,t),r.call(this,e,t,i),this._prevBlock=o}}),t}(),p=(t.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,i=n<<24|n<<16|n<<8|n,s=[],a=0;a<n;a+=4)s.push(i);var l=o.create(s,n);e.concat(l)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},g=(r.BlockCipher=c.extend({cfg:c.cfg.extend({mode:d,padding:p}),reset:function(){var e;c.reset.call(this);var t=this.cfg,r=t.iv,n=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=n.createEncryptor:(e=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(n,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),y=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?o.create([1398893684,1701076831]).concat(r).concat(t):t).toString(l)},parse:function(e){var t,r=l.parse(e),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(t=o.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),g.create({ciphertext:r,salt:t})}},b=r.SerializableCipher=i.extend({cfg:i.extend({format:y}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),o=i.finalize(t),s=i.cfg;return g.create({ciphertext:o,key:r,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,n,i){if(n||(n=o.random(8)),i)s=u.create({keySize:t+r,hasher:i}).compute(e,n);else var s=u.create({keySize:t+r}).compute(e,n);var a=o.create(s.words.slice(t),4*r);return s.sigBytes=4*t,g.create({key:s,iv:a,salt:n})}},m=r.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:v}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize,n.salt,n.hasher);n.iv=i.iv;var o=b.encrypt.call(this,e,t,i.key,n);return o.mixIn(i),o},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt,n.hasher);return n.iv=i.iv,b.decrypt.call(this,e,t,i.key,n)}})}()))},9021:function(e,t,r){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==r.g&&r.g.crypto&&(n=r.g.crypto),!n)try{n=r(477)}catch(e){}var i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),s={},a=s.lib={},l=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=l.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o<i;o++){var s=r[o>>>2]>>>24-o%4*8&255;t[n+o>>>2]|=s<<24-(n+o)%4*8}else for(var a=0;a<i;a+=4)t[n+a>>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=l.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(i());return new u.init(t,e)}}),c=s.enc={},h=c.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new u.init(r,t/2)}},f=c.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new u.init(r,t)}},d=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,i=n.words,o=n.sigBytes,s=this.blockSize,a=o/(4*s),l=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,c=e.min(4*l,o);if(l){for(var h=0;h<l;h+=s)this._doProcessBlock(i,h);r=i.splice(0,l),n.sigBytes-=c}return new u.init(r,c)},clone:function(){var e=l.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),g=(a.Hasher=p.extend({cfg:l.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new g.HMAC.init(e,r).finalize(t)}}}),s.algo={});return s}(Math),n)},754:function(e,t,r){var n;e.exports=(n=r(9021),function(){var e=n,t=e.lib.WordArray;function r(e,r,n){for(var i=[],o=0,s=0;s<r;s++)if(s%4){var a=n[e.charCodeAt(s-1)]<<s%4*2|n[e.charCodeAt(s)]>>>6-s%4*2;i[o>>>2]|=a<<24-o%4*8,o++}return t.create(i,o)}e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],o=0;o<r;o+=3)for(var s=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<r;a++)i.push(n.charAt(s>>>6*(3-a)&63));var l=n.charAt(64);if(l)for(;i.length%4;)i.push(l);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<n.length;o++)i[n.charCodeAt(o)]=o}var s=n.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return r(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),n.enc.Base64)},4725:function(e,t,r){var n;e.exports=(n=r(9021),function(){var e=n,t=e.lib.WordArray;function r(e,r,n){for(var i=[],o=0,s=0;s<r;s++)if(s%4){var a=n[e.charCodeAt(s-1)]<<s%4*2|n[e.charCodeAt(s)]>>>6-s%4*2;i[o>>>2]|=a<<24-o%4*8,o++}return t.create(i,o)}e.enc.Base64url={stringify:function(e,t){void 0===t&&(t=!0);var r=e.words,n=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var o=[],s=0;s<n;s+=3)for(var a=(r[s>>>2]>>>24-s%4*8&255)<<16|(r[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|r[s+2>>>2]>>>24-(s+2)%4*8&255,l=0;l<4&&s+.75*l<n;l++)o.push(i.charAt(a>>>6*(3-l)&63));var u=i.charAt(64);if(u)for(;o.length%4;)o.push(u);return o.join("")},parse:function(e,t){void 0===t&&(t=!0);var n=e.length,i=t?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var s=0;s<i.length;s++)o[i.charCodeAt(s)]=s}var a=i.charAt(64);if(a){var l=e.indexOf(a);-1!==l&&(n=l)}return r(e,n,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),n.enc.Base64url)},5503:function(e,t,r){var n;e.exports=(n=r(9021),function(){var e=n,t=e.lib.WordArray,r=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var o=t[i>>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i<r;i++)n[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},r.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o+=2){var s=i(t[o>>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o<r;o++)n[o>>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return t.create(n,2*r)}}}(),n.enc.Utf16)},9506:function(e,t,r){var n,i,o,s,a,l,u,c;e.exports=(c=r(9021),r(5471),r(1025),i=(n=c).lib,o=i.Base,s=i.WordArray,a=n.algo,l=a.MD5,u=a.EvpKDF=o.extend({cfg:o.extend({keySize:4,hasher:l,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,i=n.hasher.create(),o=s.create(),a=o.words,l=n.keySize,u=n.iterations;a.length<l;){r&&i.update(r),r=i.update(e).finalize(t),i.reset();for(var c=1;c<u;c++)r=i.finalize(r),i.reset();o.concat(r)}return o.sigBytes=4*l,o}}),n.EvpKDF=function(e,t,r){return u.create(r).compute(e,t)},c.EvpKDF)},25:function(e,t,r){var n,i,o,s;e.exports=(s=r(9021),r(7165),i=(n=s).lib.CipherParams,o=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(o)},parse:function(e){var t=o.parse(e);return i.create({ciphertext:t})}},s.format.Hex)},3793:function(e,t,r){var n;e.exports=(n=r(9021),r(3009),r(1025),n.HmacSHA256)},1025:function(e,t,r){var n,i,o,s;e.exports=(n=r(9021),o=(i=n).lib.Base,s=i.enc.Utf8,void(i.algo.HMAC=o.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=s.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),a=i.words,l=o.words,u=0;u<r;u++)a[u]^=1549556828,l[u]^=909522486;i.sigBytes=o.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))},1396:function(e,t,r){var n;e.exports=(n=r(9021),r(3240),r(6440),r(5503),r(754),r(4725),r(4636),r(5471),r(3009),r(6308),r(1380),r(9557),r(5953),r(8056),r(1025),r(19),r(9506),r(7165),r(2169),r(6939),r(6372),r(3797),r(8454),r(2073),r(4905),r(482),r(2155),r(8124),r(25),r(955),r(7628),r(7193),r(6298),r(2696),r(3128),n)},6440:function(e,t,r){var n;e.exports=(n=r(9021),function(){if("function"==typeof ArrayBuffer){var e=n.lib.WordArray,t=e.init,r=e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var r=e.byteLength,n=[],i=0;i<r;i++)n[i>>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)};r.prototype=e}}(),n.lib.WordArray)},4636:function(e,t,r){var n;e.exports=(n=r(9021),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,s=e[t+0],l=e[t+1],d=e[t+2],p=e[t+3],g=e[t+4],y=e[t+5],b=e[t+6],v=e[t+7],m=e[t+8],w=e[t+9],_=e[t+10],E=e[t+11],S=e[t+12],k=e[t+13],A=e[t+14],T=e[t+15],I=o[0],C=o[1],R=o[2],O=o[3];I=u(I,C,R,O,s,7,a[0]),O=u(O,I,C,R,l,12,a[1]),R=u(R,O,I,C,d,17,a[2]),C=u(C,R,O,I,p,22,a[3]),I=u(I,C,R,O,g,7,a[4]),O=u(O,I,C,R,y,12,a[5]),R=u(R,O,I,C,b,17,a[6]),C=u(C,R,O,I,v,22,a[7]),I=u(I,C,R,O,m,7,a[8]),O=u(O,I,C,R,w,12,a[9]),R=u(R,O,I,C,_,17,a[10]),C=u(C,R,O,I,E,22,a[11]),I=u(I,C,R,O,S,7,a[12]),O=u(O,I,C,R,k,12,a[13]),R=u(R,O,I,C,A,17,a[14]),I=c(I,C=u(C,R,O,I,T,22,a[15]),R,O,l,5,a[16]),O=c(O,I,C,R,b,9,a[17]),R=c(R,O,I,C,E,14,a[18]),C=c(C,R,O,I,s,20,a[19]),I=c(I,C,R,O,y,5,a[20]),O=c(O,I,C,R,_,9,a[21]),R=c(R,O,I,C,T,14,a[22]),C=c(C,R,O,I,g,20,a[23]),I=c(I,C,R,O,w,5,a[24]),O=c(O,I,C,R,A,9,a[25]),R=c(R,O,I,C,p,14,a[26]),C=c(C,R,O,I,m,20,a[27]),I=c(I,C,R,O,k,5,a[28]),O=c(O,I,C,R,d,9,a[29]),R=c(R,O,I,C,v,14,a[30]),I=h(I,C=c(C,R,O,I,S,20,a[31]),R,O,y,4,a[32]),O=h(O,I,C,R,m,11,a[33]),R=h(R,O,I,C,E,16,a[34]),C=h(C,R,O,I,A,23,a[35]),I=h(I,C,R,O,l,4,a[36]),O=h(O,I,C,R,g,11,a[37]),R=h(R,O,I,C,v,16,a[38]),C=h(C,R,O,I,_,23,a[39]),I=h(I,C,R,O,k,4,a[40]),O=h(O,I,C,R,s,11,a[41]),R=h(R,O,I,C,p,16,a[42]),C=h(C,R,O,I,b,23,a[43]),I=h(I,C,R,O,w,4,a[44]),O=h(O,I,C,R,S,11,a[45]),R=h(R,O,I,C,T,16,a[46]),I=f(I,C=h(C,R,O,I,d,23,a[47]),R,O,s,6,a[48]),O=f(O,I,C,R,v,10,a[49]),R=f(R,O,I,C,A,15,a[50]),C=f(C,R,O,I,y,21,a[51]),I=f(I,C,R,O,S,6,a[52]),O=f(O,I,C,R,p,10,a[53]),R=f(R,O,I,C,_,15,a[54]),C=f(C,R,O,I,l,21,a[55]),I=f(I,C,R,O,m,6,a[56]),O=f(O,I,C,R,T,10,a[57]),R=f(R,O,I,C,b,15,a[58]),C=f(C,R,O,I,k,21,a[59]),I=f(I,C,R,O,g,6,a[60]),O=f(O,I,C,R,E,10,a[61]),R=f(R,O,I,C,d,15,a[62]),C=f(C,R,O,I,w,21,a[63]),o[0]=o[0]+I|0,o[1]=o[1]+C|0,o[2]=o[2]+R|0,o[3]=o[3]+O|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),s=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,l=a.words,u=0;u<4;u++){var c=l[u];l[u]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,n,i,o,s){var a=e+(t&r|~t&n)+i+s;return(a<<o|a>>>32-o)+t}function c(e,t,r,n,i,o,s){var a=e+(t&n|r&~n)+i+s;return(a<<o|a>>>32-o)+t}function h(e,t,r,n,i,o,s){var a=e+(t^r^n)+i+s;return(a<<o|a>>>32-o)+t}function f(e,t,r,n,i,o,s){var a=e+(r^(t|~n))+i+s;return(a<<o|a>>>32-o)+t}t.MD5=o._createHelper(l),t.HmacMD5=o._createHmacHelper(l)}(Math),n.MD5)},2169:function(e,t,r){var n;e.exports=(n=r(9021),r(7165),n.mode.CFB=function(){var e=n.lib.BlockCipherMode.extend();function t(e,t,r,n){var i,o=this._iv;o?(i=o.slice(0),this._iv=void 0):i=this._prevBlock,n.encryptBlock(i,0);for(var s=0;s<r;s++)e[t+s]^=i[s]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize;t.call(this,e,r,i,n),this._prevBlock=e.slice(r,r+i)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,o=e.slice(r,r+i);t.call(this,e,r,i,n),this._prevBlock=o}}),e}(),n.mode.CFB)},6372:function(e,t,r){var n;e.exports=(n=r(9021),r(7165),n.mode.CTRGladman=function(){var e=n.lib.BlockCipherMode.extend();function t(e){if(255&~(e>>24))e+=1<<24;else{var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}return e}function r(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var i=e.Encryptor=e.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,o=this._iv,s=this._counter;o&&(s=this._counter=o.slice(0),this._iv=void 0),r(s);var a=s.slice(0);n.encryptBlock(a,0);for(var l=0;l<i;l++)e[t+l]^=a[l]}});return e.Decryptor=i,e}(),n.mode.CTRGladman)},6939:function(e,t,r){var n,i,o;e.exports=(o=r(9021),r(7165),o.mode.CTR=(n=o.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,o=this._counter;i&&(o=this._counter=i.slice(0),this._iv=void 0);var s=o.slice(0);r.encryptBlock(s,0),o[n-1]=o[n-1]+1|0;for(var a=0;a<n;a++)e[t+a]^=s[a]}}),n.Decryptor=i,n),o.mode.CTR)},8454:function(e,t,r){var n,i;e.exports=(i=r(9021),r(7165),i.mode.ECB=((n=i.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),n.Decryptor=n.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),n),i.mode.ECB)},3797:function(e,t,r){var n,i,o;e.exports=(o=r(9021),r(7165),o.mode.OFB=(n=o.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,o=this._keystream;i&&(o=this._keystream=i.slice(0),this._iv=void 0),r.encryptBlock(o,0);for(var s=0;s<n;s++)e[t+s]^=o[s]}}),n.Decryptor=i,n),o.mode.OFB)},2073:function(e,t,r){var n;e.exports=(n=r(9021),r(7165),n.pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,i=n-r%n,o=r+i-1;e.clamp(),e.words[o>>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Ansix923)},4905:function(e,t,r){var n;e.exports=(n=r(9021),r(7165),n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126)},482:function(e,t,r){var n;e.exports=(n=r(9021),r(7165),n.pad.Iso97971={pad:function(e,t){e.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(e,t)},unpad:function(e){n.pad.ZeroPadding.unpad(e),e.sigBytes--}},n.pad.Iso97971)},8124:function(e,t,r){var n;e.exports=(n=r(9021),r(7165),n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)},2155:function(e,t,r){var n;e.exports=(n=r(9021),r(7165),n.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){var t=e.words,r=e.sigBytes-1;for(r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},n.pad.ZeroPadding)},19:function(e,t,r){var n,i,o,s,a,l,u,c,h;e.exports=(h=r(9021),r(3009),r(1025),i=(n=h).lib,o=i.Base,s=i.WordArray,a=n.algo,l=a.SHA256,u=a.HMAC,c=a.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:l,iterations:25e4}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=u.create(r.hasher,e),i=s.create(),o=s.create([1]),a=i.words,l=o.words,c=r.keySize,h=r.iterations;a.length<c;){var f=n.update(t).finalize(o);n.reset();for(var d=f.words,p=d.length,g=f,y=1;y<h;y++){g=n.finalize(g),n.reset();for(var b=g.words,v=0;v<p;v++)d[v]^=b[v]}i.concat(f),l[0]++}return i.sigBytes=4*c,i}}),n.PBKDF2=function(e,t,r){return c.create(r).compute(e,t)},h.PBKDF2)},2696:function(e,t,r){var n;e.exports=(n=r(9021),r(754),r(4636),r(9506),r(7165),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],o=[],s=[],a=r.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)l.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var o=t.words,s=o[0],a=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),h=u>>>16|4294901760&c,f=c<<16|65535&u;for(n[0]^=u,n[1]^=h,n[2]^=c,n[3]^=f,n[4]^=u,n[5]^=h,n[6]^=c,n[7]^=f,i=0;i<4;i++)l.call(this)}},_doProcessBlock:function(e,t){var r=this._X;l.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function l(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,l=((i*i>>>17)+i*a>>>15)+a*a,u=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=l^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=t._createHelper(a)}(),n.RabbitLegacy)},6298:function(e,t,r){var n;e.exports=(n=r(9021),r(754),r(4636),r(9506),r(7165),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],o=[],s=[],a=r.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)l.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var o=t.words,s=o[0],a=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),h=u>>>16|4294901760&c,f=c<<16|65535&u;for(i[0]^=u,i[1]^=h,i[2]^=c,i[3]^=f,i[4]^=u,i[5]^=h,i[6]^=c,i[7]^=f,r=0;r<4;r++)l.call(this)}},_doProcessBlock:function(e,t){var r=this._X;l.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function l(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,l=((i*i>>>17)+i*a>>>15)+a*a,u=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=l^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=t._createHelper(a)}(),n.Rabbit)},7193:function(e,t,r){var n;e.exports=(n=r(9021),r(754),r(4636),r(9506),r(7165),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var o=0;i<256;i++){var s=i%r,a=t[s>>>2]>>>24-s%4*8&255;o=(o+n[i]+a)%256;var l=n[i];n[i]=n[o],n[o]=l}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[r],e[r]=o,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var s=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(s)}(),n.RC4)},8056:function(e,t,r){var n;e.exports=(n=r(9021),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.algo,a=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=i.create([0,1518500249,1859775393,2400959708,2840853838]),f=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=s.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,s,d,w,_,E,S,k,A,T,I,C=this._hash.words,R=h.words,O=f.words,M=a.words,P=l.words,x=u.words,B=c.words;for(E=o=C[0],S=s=C[1],k=d=C[2],A=w=C[3],T=_=C[4],r=0;r<80;r+=1)I=o+e[t+M[r]]|0,I+=r<16?p(s,d,w)+R[0]:r<32?g(s,d,w)+R[1]:r<48?y(s,d,w)+R[2]:r<64?b(s,d,w)+R[3]:v(s,d,w)+R[4],I=(I=m(I|=0,x[r]))+_|0,o=_,_=w,w=m(d,10),d=s,s=I,I=E+e[t+P[r]]|0,I+=r<16?v(S,k,A)+O[0]:r<32?b(S,k,A)+O[1]:r<48?y(S,k,A)+O[2]:r<64?g(S,k,A)+O[3]:p(S,k,A)+O[4],I=(I=m(I|=0,B[r]))+T|0,E=T,T=A,A=m(k,10),k=S,S=I;I=C[1]+d+A|0,C[1]=C[2]+w+T|0,C[2]=C[3]+_+E|0,C[3]=C[4]+o+S|0,C[4]=C[0]+s+k|0,C[0]=I},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,s=0;s<5;s++){var a=o[s];o[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,r){return e^t^r}function g(e,t,r){return e&t|~e&r}function y(e,t,r){return(e|~t)^r}function b(e,t,r){return e&r|t&~r}function v(e,t,r){return e^(t|~r)}function m(e,t){return e<<t|e>>>32-t}t.RIPEMD160=o._createHelper(d),t.HmacRIPEMD160=o._createHmacHelper(d)}(Math),n.RIPEMD160)},5471:function(e,t,r){var n,i,o,s,a,l,u,c;e.exports=(c=r(9021),i=(n=c).lib,o=i.WordArray,s=i.Hasher,a=n.algo,l=[],u=a.SHA1=s.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],u=0;u<80;u++){if(u<16)l[u]=0|e[t+u];else{var c=l[u-3]^l[u-8]^l[u-14]^l[u-16];l[u]=c<<1|c>>>31}var h=(n<<5|n>>>27)+a+l[u];h+=u<20?1518500249+(i&o|~i&s):u<40?1859775393+(i^o^s):u<60?(i&o|i&s|o&s)-1894007588:(i^o^s)-899497514,a=s,s=o,o=i<<30|i>>>2,i=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=s._createHelper(u),n.HmacSHA1=s._createHmacHelper(u),c.SHA1)},6308:function(e,t,r){var n,i,o,s,a,l;e.exports=(l=r(9021),r(3009),i=(n=l).lib.WordArray,o=n.algo,s=o.SHA256,a=o.SHA224=s.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=s._createHelper(a),n.HmacSHA224=s._createHmacHelper(a),l.SHA224)},3009:function(e,t,r){var n;e.exports=(n=r(9021),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.algo,a=[],l=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(a[i]=r(e.pow(n,.5))),l[i]=r(e.pow(n,1/3)),i++),n++}();var u=[],c=s.SHA256=o.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],c=r[5],h=r[6],f=r[7],d=0;d<64;d++){if(d<16)u[d]=0|e[t+d];else{var p=u[d-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,y=u[d-2],b=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;u[d]=g+u[d-7]+b+u[d-16]}var v=n&i^n&o^i&o,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=f+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&c^~a&h)+l[d]+u[d];f=h,h=c,c=a,a=s+w|0,s=o,o=i,i=n,n=w+(m+v)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+c|0,r[6]=r[6]+h|0,r[7]=r[7]+f|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(c),t.HmacSHA256=o._createHmacHelper(c)}(Math),n.SHA256)},5953:function(e,t,r){var n;e.exports=(n=r(9021),r(3240),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.x64.Word,a=t.algo,l=[],u=[],c=[];!function(){for(var e=1,t=0,r=0;r<24;r++){l[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var a=0,h=0,f=0;f<7;f++){if(1&i){var d=(1<<f)-1;d<32?h^=1<<d:a^=1<<d-32}128&i?i=i<<1^113:i<<=1}c[o]=s.create(a,h)}}();var h=[];!function(){for(var e=0;e<25;e++)h[e]=s.create()}();var f=a.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new s.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var r=this._state,n=this.blockSize/2,i=0;i<n;i++){var o=e[t+2*i],s=e[t+2*i+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(C=r[i]).high^=s,C.low^=o}for(var a=0;a<24;a++){for(var f=0;f<5;f++){for(var d=0,p=0,g=0;g<5;g++)d^=(C=r[f+5*g]).high,p^=C.low;var y=h[f];y.high=d,y.low=p}for(f=0;f<5;f++){var b=h[(f+4)%5],v=h[(f+1)%5],m=v.high,w=v.low;for(d=b.high^(m<<1|w>>>31),p=b.low^(w<<1|m>>>31),g=0;g<5;g++)(C=r[f+5*g]).high^=d,C.low^=p}for(var _=1;_<25;_++){var E=(C=r[_]).high,S=C.low,k=l[_];k<32?(d=E<<k|S>>>32-k,p=S<<k|E>>>32-k):(d=S<<k-32|E>>>64-k,p=E<<k-32|S>>>64-k);var A=h[u[_]];A.high=d,A.low=p}var T=h[0],I=r[0];for(T.high=I.high,T.low=I.low,f=0;f<5;f++)for(g=0;g<5;g++){var C=r[_=f+5*g],R=h[_],O=h[(f+1)%5+5*g],M=h[(f+2)%5+5*g];C.high=R.high^~O.high&M.high,C.low=R.low^~O.low&M.low}C=r[0];var P=c[a];C.high^=P.high,C.low^=P.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,l=a/8,u=[],c=0;c<l;c++){var h=s[c],f=h.high,d=h.low;f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),u.push(d),u.push(f)}return new i.init(u,a)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=o._createHelper(f),t.HmacSHA3=o._createHmacHelper(f)}(Math),n.SHA3)},9557:function(e,t,r){var n,i,o,s,a,l,u,c;e.exports=(c=r(9021),r(3240),r(1380),i=(n=c).x64,o=i.Word,s=i.WordArray,a=n.algo,l=a.SHA512,u=a.SHA384=l.extend({_doReset:function(){this._hash=new s.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=l._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=l._createHelper(u),n.HmacSHA384=l._createHmacHelper(u),c.SHA384)},1380:function(e,t,r){var n;e.exports=(n=r(9021),r(3240),function(){var e=n,t=e.lib.Hasher,r=e.x64,i=r.Word,o=r.WordArray,s=e.algo;function a(){return i.create.apply(i,arguments)}var l=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=a()}();var c=s.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],c=r[5],h=r[6],f=r[7],d=n.high,p=n.low,g=i.high,y=i.low,b=o.high,v=o.low,m=s.high,w=s.low,_=a.high,E=a.low,S=c.high,k=c.low,A=h.high,T=h.low,I=f.high,C=f.low,R=d,O=p,M=g,P=y,x=b,B=v,L=m,U=w,N=_,j=E,D=S,F=k,W=A,V=T,z=I,H=C,q=0;q<80;q++){var $,K,G=u[q];if(q<16)K=G.high=0|e[t+2*q],$=G.low=0|e[t+2*q+1];else{var Q=u[q-15],Y=Q.high,J=Q.low,X=(Y>>>1|J<<31)^(Y>>>8|J<<24)^Y>>>7,Z=(J>>>1|Y<<31)^(J>>>8|Y<<24)^(J>>>7|Y<<25),ee=u[q-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=u[q-7],se=oe.high,ae=oe.low,le=u[q-16],ue=le.high,ce=le.low;K=(K=(K=X+se+(($=Z+ae)>>>0<Z>>>0?1:0))+ne+(($+=ie)>>>0<ie>>>0?1:0))+ue+(($+=ce)>>>0<ce>>>0?1:0),G.high=K,G.low=$}var he,fe=N&D^~N&W,de=j&F^~j&V,pe=R&M^R&x^M&x,ge=O&P^O&B^P&B,ye=(R>>>28|O<<4)^(R<<30|O>>>2)^(R<<25|O>>>7),be=(O>>>28|R<<4)^(O<<30|R>>>2)^(O<<25|R>>>7),ve=(N>>>14|j<<18)^(N>>>18|j<<14)^(N<<23|j>>>9),me=(j>>>14|N<<18)^(j>>>18|N<<14)^(j<<23|N>>>9),we=l[q],_e=we.high,Ee=we.low,Se=z+ve+((he=H+me)>>>0<H>>>0?1:0),ke=be+ge;z=W,H=V,W=D,V=F,D=N,F=j,N=L+(Se=(Se=(Se=Se+fe+((he+=de)>>>0<de>>>0?1:0))+_e+((he+=Ee)>>>0<Ee>>>0?1:0))+K+((he+=$)>>>0<$>>>0?1:0))+((j=U+he|0)>>>0<U>>>0?1:0)|0,L=x,U=B,x=M,B=P,M=R,P=O,R=Se+(ye+pe+(ke>>>0<be>>>0?1:0))+((O=he+ke|0)>>>0<he>>>0?1:0)|0}p=n.low=p+O,n.high=d+R+(p>>>0<O>>>0?1:0),y=i.low=y+P,i.high=g+M+(y>>>0<P>>>0?1:0),v=o.low=v+B,o.high=b+x+(v>>>0<B>>>0?1:0),w=s.low=w+U,s.high=m+L+(w>>>0<U>>>0?1:0),E=a.low=E+j,a.high=_+N+(E>>>0<j>>>0?1:0),k=c.low=k+F,c.high=S+D+(k>>>0<F>>>0?1:0),T=h.low=T+V,h.high=A+W+(T>>>0<V>>>0?1:0),C=f.low=C+H,f.high=I+z+(C>>>0<H>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(c),e.HmacSHA512=t._createHmacHelper(c)}(),n.SHA512)},7628:function(e,t,r){var n;e.exports=(n=r(9021),r(754),r(4636),r(9506),r(7165),function(){var e=n,t=e.lib,r=t.WordArray,i=t.BlockCipher,o=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],c=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=s[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var u=i[o]=[],c=l[o];for(r=0;r<24;r++)u[r/6|0]|=t[(a[r]-1+c)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(a[r+24]-1+c)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var h=this._invSubKeys=[];for(r=0;r<16;r++)h[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),f.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,s=this._rBlock,a=0,l=0;l<8;l++)a|=u[l][((s^i[l])&c[l])>>>0];this._lBlock=s,this._rBlock=o^a}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,f.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function f(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<<e}function d(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=i._createHelper(h);var p=o.TripleDES=i.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=h.createEncryptor(r.create(t)),this._des2=h.createEncryptor(r.create(n)),this._des3=h.createEncryptor(r.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(p)}(),n.TripleDES)},3240:function(e,t,r){var n;e.exports=(n=r(9021),function(e){var t=n,r=t.lib,i=r.Base,o=r.WordArray,s=t.x64={};s.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),s.WordArray=i.extend({init:function(t,r){t=this.words=t||[],this.sigBytes=r!=e?r:8*t.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var i=e[n];r.push(i.high),r.push(i.low)}return o.create(r,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}})}(),n)},7007:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,r)}(e,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,o,s,u;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,u=c,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function f(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var u=l.length,c=p(l,u);for(r=0;r<u;++r)n(c[r],this,t)}return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,h(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,h(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return f(this,e,!0)},o.prototype.rawListeners=function(e){return f(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+d]=255&s,d+=p,s/=256,u-=8);e[r+d-p]|=128*g}},3790:(e,t,r)=>{e.exports=function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[s]={exports:{}};t[s][0].call(u.exports,(function(e){var r=t[s][1][e];return i(r||e)}),u,u.exports,e,t,r,n)}return r[s].exports}for(var o=void 0,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t,n){(function(e){"use strict";var r,n,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,s=new i(c),a=e.document.createTextNode("");s.observe(a,{characterData:!0}),r=function(){a.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){c(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(c,0)};else{var l=new e.MessageChannel;l.port1.onmessage=c,r=function(){l.port2.postMessage(0)}}var u=[];function c(){var e,t;n=!0;for(var r=u.length;r;){for(t=u,u=[],e=-1;++e<r;)t[e]();r=u.length}n=!1}function h(e){1!==u.push(e)||n||r()}t.exports=h}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,r){"use strict";var n=e(1);function i(){}var o={},s=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==i&&d(this,e)}function c(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function h(e,t,r){n((function(){var n;try{n=t(r)}catch(t){return o.reject(e,t)}n===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,n)}))}function f(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function d(e,t){var r=!1;function n(t){r||(r=!0,o.reject(e,t))}function i(t){r||(r=!0,o.resolve(e,t))}function s(){t(i,n)}var a=p(s);"error"===a.status&&n(a.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}function g(e){return e instanceof this?e:o.resolve(new this(i),e)}function y(e){var t=new this(i);return o.reject(t,e)}function b(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var s=new Array(r),a=0,l=-1,u=new this(i);++l<r;)c(e[l],l);return u;function c(e,i){function l(e){s[i]=e,++a!==r||n||(n=!0,o.resolve(u,s))}t.resolve(e).then(l,(function(e){n||(n=!0,o.reject(u,e))}))}}function v(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var s=-1,a=new this(i);++s<r;)l(e[s]);return a;function l(e){t.resolve(e).then((function(e){n||(n=!0,o.resolve(a,e))}),(function(e){n||(n=!0,o.reject(a,e))}))}}t.exports=u,u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===s)return this;var r=new this.constructor(i);return this.state!==l?h(r,this.state===a?e:t,this.outcome):this.queue.push(new c(r,e,t)),r},c.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},c.prototype.otherCallFulfilled=function(e){h(this.promise,this.onFulfilled,e)},c.prototype.callRejected=function(e){o.reject(this.promise,e)},c.prototype.otherCallRejected=function(e){h(this.promise,this.onRejected,e)},o.resolve=function(e,t){var r=p(f,t);if("error"===r.status)return o.reject(e,r.value);var n=r.value;if(n)d(e,n);else{e.state=a,e.outcome=t;for(var i=-1,s=e.queue.length;++i<s;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=s,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},u.resolve=g,u.reject=y,u.all=b,u.race=v},{1:1}],3:[function(e,t,n){(function(t){"use strict";"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}var s=o();function a(){try{if(!s||!s.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}function l(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var u=Promise;function c(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function h(e,t,r){"function"==typeof t&&e.then(t),"function"==typeof r&&e.catch(r)}function f(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function d(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var p="local-forage-detect-blob-support",g=void 0,y={},b=Object.prototype.toString,v="readonly",m="readwrite";function w(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;i<t;i++)n[i]=e.charCodeAt(i);return r}function _(e){return new u((function(t){var r=e.transaction(p,m),n=l([""]);r.objectStore(p).put(n,"key"),r.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},r.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);t(r||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}function E(e){return"boolean"==typeof g?u.resolve(g):_(e).then((function(e){return g=e}))}function S(e){var t=y[e.name],r={};r.promise=new u((function(e,t){r.resolve=e,r.reject=t})),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then((function(){return r.promise})):t.dbReady=r.promise}function k(e){var t=y[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function A(e,t){var r=y[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function T(e,t){return new u((function(r,n){if(y[e.name]=y[e.name]||U(),e.db){if(!t)return r(e.db);S(e),e.db.close()}var i=[e.name];t&&i.push(e.version);var o=s.open.apply(s,i);t&&(o.onupgradeneeded=function(t){var r=o.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(p)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),o.onerror=function(e){e.preventDefault(),n(o.error)},o.onsuccess=function(){var t=o.result;t.onversionchange=function(e){e.target.close()},r(t),k(e)}}))}function I(e){return T(e,!1)}function C(e){return T(e,!0)}function R(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.version<e.db.version,i=e.version>e.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||r){if(r){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function O(e){return new u((function(t,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");t({__local_forage_encoded_blob:!0,data:n,type:e.type})},n.readAsBinaryString(e)}))}function M(e){return l([w(atob(e.data))],{type:e.type})}function P(e){return e&&e.__local_forage_encoded_blob}function x(e){var t=this,r=t._initReady().then((function(){var e=y[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return h(r,e,e),r}function B(e){S(e);for(var t=y[e.name],r=t.forages,n=0;n<r.length;n++){var i=r[n];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,I(e).then((function(t){return e.db=t,R(e)?C(e):t})).then((function(n){e.db=t.db=n;for(var i=0;i<r.length;i++)r[i]._dbInfo.db=n})).catch((function(t){throw A(e,t),t}))}function L(e,t,r,n){void 0===n&&(n=1);try{var i=e.db.transaction(e.storeName,t);r(null,i)}catch(i){if(n>0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return u.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),C(e)})).then((function(){return B(e).then((function(){L(e,t,r,n-1)}))})).catch(r);r(i)}}function U(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function N(e){var t=this,r={db:null};if(e)for(var n in e)r[n]=e[n];var i=y[r.name];i||(i=U(),y[r.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=x);var o=[];function s(){return u.resolve()}for(var a=0;a<i.forages.length;a++){var l=i.forages[a];l!==t&&o.push(l._initReady().catch(s))}var c=i.forages.slice(0);return u.all(o).then((function(){return r.db=i.db,I(r)})).then((function(e){return r.db=e,R(r,t._defaultConfig.version)?C(r):e})).then((function(e){r.db=i.db=e,t._dbInfo=r;for(var n=0;n<c.length;n++){var o=c[n];o!==t&&(o._dbInfo.db=r.db,o._dbInfo.version=r.version)}}))}function j(e,t){var r=this;e=f(e);var n=new u((function(t,n){r.ready().then((function(){L(r._dbInfo,v,(function(i,o){if(i)return n(i);try{var s=o.objectStore(r._dbInfo.storeName).get(e);s.onsuccess=function(){var e=s.result;void 0===e&&(e=null),P(e)&&(e=M(e)),t(e)},s.onerror=function(){n(s.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function D(e,t){var r=this,n=new u((function(t,n){r.ready().then((function(){L(r._dbInfo,v,(function(i,o){if(i)return n(i);try{var s=o.objectStore(r._dbInfo.storeName).openCursor(),a=1;s.onsuccess=function(){var r=s.result;if(r){var n=r.value;P(n)&&(n=M(n));var i=e(n,r.key,a++);void 0!==i?t(i):r.continue()}else t()},s.onerror=function(){n(s.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function F(e,t,r){var n=this;e=f(e);var i=new u((function(r,i){var o;n.ready().then((function(){return o=n._dbInfo,"[object Blob]"===b.call(t)?E(o.db).then((function(e){return e?t:O(t)})):t})).then((function(t){L(n._dbInfo,m,(function(o,s){if(o)return i(o);try{var a=s.objectStore(n._dbInfo.storeName);null===t&&(t=void 0);var l=a.put(t,e);s.oncomplete=function(){void 0===t&&(t=null),r(t)},s.onabort=s.onerror=function(){var e=l.error?l.error:l.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return c(i,r),i}function W(e,t){var r=this;e=f(e);var n=new u((function(t,n){r.ready().then((function(){L(r._dbInfo,m,(function(i,o){if(i)return n(i);try{var s=o.objectStore(r._dbInfo.storeName).delete(e);o.oncomplete=function(){t()},o.onerror=function(){n(s.error)},o.onabort=function(){var e=s.error?s.error:s.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function V(e){var t=this,r=new u((function(e,r){t.ready().then((function(){L(t._dbInfo,m,(function(n,i){if(n)return r(n);try{var o=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=o.error?o.error:o.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return c(r,e),r}function z(e){var t=this,r=new u((function(e,r){t.ready().then((function(){L(t._dbInfo,v,(function(n,i){if(n)return r(n);try{var o=i.objectStore(t._dbInfo.storeName).count();o.onsuccess=function(){e(o.result)},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return c(r,e),r}function H(e,t){var r=this,n=new u((function(t,n){e<0?t(null):r.ready().then((function(){L(r._dbInfo,v,(function(i,o){if(i)return n(i);try{var s=o.objectStore(r._dbInfo.storeName),a=!1,l=s.openKeyCursor();l.onsuccess=function(){var r=l.result;r?0===e||a?t(r.key):(a=!0,r.advance(e)):t(null)},l.onerror=function(){n(l.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function q(e){var t=this,r=new u((function(e,r){t.ready().then((function(){L(t._dbInfo,v,(function(n,i){if(n)return r(n);try{var o=i.objectStore(t._dbInfo.storeName).openKeyCursor(),s=[];o.onsuccess=function(){var t=o.result;t?(s.push(t.key),t.continue()):e(s)},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return c(r,e),r}function $(e,t){t=d.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var n,i=this;if(e.name){var o=e.name===r.name&&i._dbInfo.db?u.resolve(i._dbInfo.db):I(e).then((function(t){var r=y[e.name],n=r.forages;r.db=t;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=t;return t}));n=e.storeName?o.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var r=t.version+1;S(e);var n=y[e.name],i=n.forages;t.close();for(var o=0;o<i.length;o++){var a=i[o];a._dbInfo.db=null,a._dbInfo.version=r}var l=new u((function(t,n){var i=s.open(e.name,r);i.onerror=function(e){i.result.close(),n(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),t(e)}}));return l.then((function(e){n.db=e;for(var t=0;t<i.length;t++){var r=i[t];r._dbInfo.db=e,k(r._dbInfo)}})).catch((function(t){throw(A(e,t)||u.resolve()).catch((function(){})),t}))}})):o.then((function(t){S(e);var r=y[e.name],n=r.forages;t.close();for(var i=0;i<n.length;i++)n[i]._dbInfo.db=null;var o=new u((function(t,r){var n=s.deleteDatabase(e.name);n.onerror=function(){var e=n.result;e&&e.close(),r(n.error)},n.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},n.onsuccess=function(){var e=n.result;e&&e.close(),t(e)}}));return o.then((function(e){r.db=e;for(var t=0;t<n.length;t++)k(n[t]._dbInfo)})).catch((function(t){throw(A(e,t)||u.resolve()).catch((function(){})),t}))}))}else n=u.reject("Invalid arguments");return c(n,t),n}var K={_driver:"asyncStorage",_initStorage:N,_support:a(),iterate:D,getItem:j,setItem:F,removeItem:W,clear:V,length:z,key:H,keys:q,dropInstance:$};function G(){return"function"==typeof openDatabase}var Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Y="~~local_forage_type~",J=/^~~local_forage_type~([^~]+)~/,X="__lfsc__:",Z=X.length,ee="arbf",te="blob",re="si08",ne="ui08",ie="uic8",oe="si16",se="si32",ae="ur16",le="ui32",ue="fl32",ce="fl64",he=Z+ee.length,fe=Object.prototype.toString;function de(e){var t,r,n,i,o,s=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var u=new ArrayBuffer(s),c=new Uint8Array(u);for(t=0;t<a;t+=4)r=Q.indexOf(e[t]),n=Q.indexOf(e[t+1]),i=Q.indexOf(e[t+2]),o=Q.indexOf(e[t+3]),c[l++]=r<<2|n>>4,c[l++]=(15&n)<<4|i>>2,c[l++]=(3&i)<<6|63&o;return u}function pe(e){var t,r=new Uint8Array(e),n="";for(t=0;t<r.length;t+=3)n+=Q[r[t]>>2],n+=Q[(3&r[t])<<4|r[t+1]>>4],n+=Q[(15&r[t+1])<<2|r[t+2]>>6],n+=Q[63&r[t+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function ge(e,t){var r="";if(e&&(r=fe.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===fe.call(e.buffer))){var n,i=X;e instanceof ArrayBuffer?(n=e,i+=ee):(n=e.buffer,"[object Int8Array]"===r?i+=re:"[object Uint8Array]"===r?i+=ne:"[object Uint8ClampedArray]"===r?i+=ie:"[object Int16Array]"===r?i+=oe:"[object Uint16Array]"===r?i+=ae:"[object Int32Array]"===r?i+=se:"[object Uint32Array]"===r?i+=le:"[object Float32Array]"===r?i+=ue:"[object Float64Array]"===r?i+=ce:t(new Error("Failed to get type for BinaryArray"))),t(i+pe(n))}else if("[object Blob]"===r){var o=new FileReader;o.onload=function(){var r=Y+e.type+"~"+pe(this.result);t(X+te+r)},o.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}}function ye(e){if(e.substring(0,Z)!==X)return JSON.parse(e);var t,r=e.substring(he),n=e.substring(Z,he);if(n===te&&J.test(r)){var i=r.match(J);t=i[1],r=r.substring(i[0].length)}var o=de(r);switch(n){case ee:return o;case te:return l([o],{type:t});case re:return new Int8Array(o);case ne:return new Uint8Array(o);case ie:return new Uint8ClampedArray(o);case oe:return new Int16Array(o);case ae:return new Uint16Array(o);case se:return new Int32Array(o);case le:return new Uint32Array(o);case ue:return new Float32Array(o);case ce:return new Float64Array(o);default:throw new Error("Unkown type: "+n)}}var be={serialize:ge,deserialize:ye,stringToBuffer:de,bufferToString:pe};function ve(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function me(e){var t=this,r={db:null};if(e)for(var n in e)r[n]="string"!=typeof e[n]?e[n].toString():e[n];var i=new u((function(e,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(e){return n(e)}r.db.transaction((function(i){ve(i,r,(function(){t._dbInfo=r,e()}),(function(e,t){n(t)}))}),n)}));return r.serializer=be,i}function we(e,t,r,n,i,o){e.executeSql(r,n,i,(function(e,s){s.code===s.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,a){a.rows.length?o(e,s):ve(e,t,(function(){e.executeSql(r,n,i,o)}),o)}),o):o(e,s)}),o)}function _e(e,t){var r=this;e=f(e);var n=new u((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){we(r,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=i.serializer.deserialize(n)),t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function Ee(e,t){var r=this,n=new u((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){we(r,i,"SELECT * FROM "+i.storeName,[],(function(r,n){for(var o=n.rows,s=o.length,a=0;a<s;a++){var l=o.item(a),u=l.value;if(u&&(u=i.serializer.deserialize(u)),void 0!==(u=e(u,l.key,a+1)))return void t(u)}t()}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function Se(e,t,r,n){var i=this;e=f(e);var o=new u((function(o,s){i.ready().then((function(){void 0===t&&(t=null);var a=t,l=i._dbInfo;l.serializer.serialize(t,(function(t,u){u?s(u):l.db.transaction((function(r){we(r,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){o(a)}),(function(e,t){s(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(n>0)return void o(Se.apply(i,[e,a,r,n-1]));s(t)}}))}))})).catch(s)}));return c(o,r),o}function ke(e,t,r){return Se.apply(this,[e,t,r,1])}function Ae(e,t){var r=this;e=f(e);var n=new u((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){we(r,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function Te(e){var t=this,r=new u((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"DELETE FROM "+n.storeName,[],(function(){e()}),(function(e,t){r(t)}))}))})).catch(r)}));return c(r,e),r}function Ie(e){var t=this,r=new u((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],(function(t,r){var n=r.rows.item(0).c;e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return c(r,e),r}function Ce(e,t){var r=this,n=new u((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){we(r,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,r){var n=r.rows.length?r.rows.item(0).key:null;t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function Re(e){var t=this,r=new u((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"SELECT key FROM "+n.storeName,[],(function(t,r){for(var n=[],i=0;i<r.rows.length;i++)n.push(r.rows.item(i).key);e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return c(r,e),r}function Oe(e){return new u((function(t,r){e.transaction((function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(r,n){for(var i=[],o=0;o<n.rows.length;o++)i.push(n.rows.item(o).name);t({db:e,storeNames:i})}),(function(e,t){r(t)}))}),(function(e){r(e)}))}))}function Me(e,t){t=d.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var n,i=this;return c(n=e.name?new u((function(t){var n;n=e.name===r.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:n,storeNames:[e.storeName]}):t(Oe(n))})).then((function(e){return new u((function(t,r){e.db.transaction((function(n){function i(e){return new u((function(t,r){n.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){r(t)}))}))}for(var o=[],s=0,a=e.storeNames.length;s<a;s++)o.push(i(e.storeNames[s]));u.all(o).then((function(){t()})).catch((function(e){r(e)}))}),(function(e){r(e)}))}))})):u.reject("Invalid arguments"),t),n}var Pe={_driver:"webSQLStorage",_initStorage:me,_support:G(),iterate:Ee,getItem:_e,setItem:ke,removeItem:Ae,clear:Te,length:Ie,key:Ce,keys:Re,dropInstance:Me};function xe(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}function Be(e,t){var r=e.name+"/";return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}function Le(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}function Ue(){return!Le()||localStorage.length>0}function Ne(e){var t=this,r={};if(e)for(var n in e)r[n]=e[n];return r.keyPrefix=Be(e,t._defaultConfig),Ue()?(t._dbInfo=r,r.serializer=be,u.resolve()):u.reject()}function je(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return c(r,e),r}function De(e,t){var r=this;e=f(e);var n=r.ready().then((function(){var t=r._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n}));return c(n,t),n}function Fe(e,t){var r=this,n=r.ready().then((function(){for(var t=r._dbInfo,n=t.keyPrefix,i=n.length,o=localStorage.length,s=1,a=0;a<o;a++){var l=localStorage.key(a);if(0===l.indexOf(n)){var u=localStorage.getItem(l);if(u&&(u=t.serializer.deserialize(u)),void 0!==(u=e(u,l.substring(i),s++)))return u}}}));return c(n,t),n}function We(e,t){var r=this,n=r.ready().then((function(){var t,n=r._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t}));return c(n,t),n}function Ve(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo,r=localStorage.length,n=[],i=0;i<r;i++){var o=localStorage.key(i);0===o.indexOf(e.keyPrefix)&&n.push(o.substring(e.keyPrefix.length))}return n}));return c(r,e),r}function ze(e){var t=this.keys().then((function(e){return e.length}));return c(t,e),t}function He(e,t){var r=this;e=f(e);var n=r.ready().then((function(){var t=r._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return c(n,t),n}function qe(e,t,r){var n=this;e=f(e);var i=n.ready().then((function(){void 0===t&&(t=null);var r=t;return new u((function(i,o){var s=n._dbInfo;s.serializer.serialize(t,(function(t,n){if(n)o(n);else try{localStorage.setItem(s.keyPrefix+e,t),i(r)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||o(e),o(e)}}))}))}));return c(i,r),i}function $e(e,t){if(t=d.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var r=this.config();e.name=e.name||r.name,e.storeName=e.storeName||r.storeName}var n,i=this;return n=e.name?new u((function(t){e.storeName?t(Be(e,i._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}})):u.reject("Invalid arguments"),c(n,t),n}var Ke={_driver:"localStorageWrapper",_initStorage:Ne,_support:xe(),iterate:Fe,getItem:De,setItem:qe,removeItem:He,clear:je,length:ze,key:We,keys:Ve,dropInstance:$e},Ge=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Qe=function(e,t){for(var r=e.length,n=0;n<r;){if(Ge(e[n],t))return!0;n++}return!1},Ye=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Je={},Xe={},Ze={INDEXEDDB:K,WEBSQL:Pe,LOCALSTORAGE:Ke},et=[Ze.INDEXEDDB._driver,Ze.WEBSQL._driver,Ze.LOCALSTORAGE._driver],tt=["dropInstance"],rt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(tt),nt={description:"",driver:et.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function it(e,t){e[t]=function(){var r=arguments;return e.ready().then((function(){return e[t].apply(e,r)}))}}function ot(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var r in t)t.hasOwnProperty(r)&&(Ye(t[r])?arguments[0][r]=t[r].slice():arguments[0][r]=t[r])}return arguments[0]}var st=function(){function e(t){for(var r in i(this,e),Ze)if(Ze.hasOwnProperty(r)){var n=Ze[r],o=n._driver;this[r]=o,Je[o]||this.defineDriver(n)}this._defaultConfig=ot({},nt),this._config=ot({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":n(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,r){var n=new u((function(t,r){try{var n=e._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void r(i);for(var o=rt.concat("_initStorage"),s=0,a=o.length;s<a;s++){var l=o[s];if((!Qe(tt,l)||e[l])&&"function"!=typeof e[l])return void r(i)}var h=function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),r=u.reject(t);return c(r,arguments[arguments.length-1]),r}},r=0,n=tt.length;r<n;r++){var i=tt[r];e[i]||(e[i]=t(i))}};h();var f=function(r){Je[n]&&console.info("Redefining LocalForage driver: "+n),Je[n]=e,Xe[n]=r,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(f,r):f(!!e._support):f(!0)}catch(e){r(e)}}));return h(n,t,r),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,r){var n=Je[e]?u.resolve(Je[e]):u.reject(new Error("Driver not found."));return h(n,t,r),n},e.prototype.getSerializer=function(e){var t=u.resolve(be);return h(t,e),t},e.prototype.ready=function(e){var t=this,r=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return h(r,e,e),r},e.prototype.setDriver=function(e,t,r){var n=this;Ye(e)||(e=[e]);var i=this._getSupportedDrivers(e);function o(){n._config.driver=n.driver()}function s(e){return n._extend(e),o(),n._ready=n._initStorage(n._config),n._ready}function a(e){return function(){var t=0;function r(){for(;t<e.length;){var i=e[t];return t++,n._dbInfo=null,n._ready=null,n.getDriver(i).then(s).catch(r)}o();var a=new Error("No available storage method found.");return n._driverSet=u.reject(a),n._driverSet}return r()}}var l=null!==this._driverSet?this._driverSet.catch((function(){return u.resolve()})):u.resolve();return this._driverSet=l.then((function(){var e=i[0];return n._dbInfo=null,n._ready=null,n.getDriver(e).then((function(e){n._driver=e._driver,o(),n._wrapLibraryMethodsWithReady(),n._initDriver=a(i)}))})).catch((function(){o();var e=new Error("No available storage method found.");return n._driverSet=u.reject(e),n._driverSet})),h(this._driverSet,t,r),this._driverSet},e.prototype.supports=function(e){return!!Xe[e]},e.prototype._extend=function(e){ot(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],r=0,n=e.length;r<n;r++){var i=e[r];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=rt.length;e<t;e++)it(this,rt[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),at=new st;t.exports=at},{3:3}]},{},[4])(4)},3061:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>Ds});var n,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l=(e,t)=>()=>(e&&(t=e(e=0)),t),u=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},h=e=>((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of s(t))!a.call(e,l)&&l!==r&&i(e,l,{get:()=>t[l],enumerable:!(n=o(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),e),f=l((()=>{n={deviceMemory:8,hardwareConcurrency:8,language:"en-US"}})),d={};function p(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function g(){!M||!P||(M=!1,P.length?O=P.concat(O):x=-1,O.length&&y())}function y(){if(!M){var e=setTimeout(g,0);M=!0;for(var t=O.length;t;){for(P=O,O=[];++x<t;)P&&P[x].run();x=-1,t=O.length}P=null,M=!1,clearTimeout(e)}}function b(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];O.push(new v(e,t)),1===O.length&&!M&&setTimeout(y,0)}function v(e,t){this.fun=e,this.array=t}function m(){}function w(e){p("_linkedBinding")}function _(e){p("dlopen")}function E(){return[]}function S(){return[]}function k(e,t){if(!e)throw new Error(t||"assertion error")}function A(){return!1}function T(){return Ie.now()/1e3}function I(e){var t=Math.floor(.001*(Date.now()-Ie.now())),r=.001*Ie.now(),n=Math.floor(r)+t,i=Math.floor(r%1*1e9);return e&&(n-=e[0],(i-=e[1])<0&&(n--,i+=Re)),[n,i]}function C(){return We}function R(e){return[]}c(d,{_debugEnd:()=>de,_debugProcess:()=>fe,_events:()=>Me,_eventsCount:()=>Pe,_exiting:()=>J,_fatalExceptions:()=>ue,_getActiveHandles:()=>S,_getActiveRequests:()=>E,_kill:()=>ee,_linkedBinding:()=>w,_maxListeners:()=>Oe,_preload_modules:()=>Ae,_rawDebug:()=>G,_startProfilerIdleNotifier:()=>pe,_stopProfilerIdleNotifier:()=>ge,_tickCallback:()=>he,abort:()=>me,addListener:()=>xe,allowedNodeEnvironmentFlags:()=>ae,arch:()=>L,argv:()=>j,argv0:()=>ke,assert:()=>k,binding:()=>z,chdir:()=>$,config:()=>X,cpuUsage:()=>te,cwd:()=>q,debugPort:()=>Se,default:()=>We,dlopen:()=>_,domain:()=>Y,emit:()=>je,emitWarning:()=>V,env:()=>N,execArgv:()=>D,execPath:()=>Ee,exit:()=>oe,features:()=>le,hasUncaughtExceptionCaptureCallback:()=>A,hrtime:()=>I,kill:()=>ie,listeners:()=>R,memoryUsage:()=>ne,moduleLoadList:()=>Q,nextTick:()=>b,off:()=>Le,on:()=>C,once:()=>Be,openStdin:()=>se,pid:()=>we,platform:()=>U,ppid:()=>_e,prependListener:()=>De,prependOnceListener:()=>Fe,reallyExit:()=>Z,release:()=>K,removeAllListeners:()=>Ne,removeListener:()=>Ue,resourceUsage:()=>re,setSourceMapsEnabled:()=>Te,setUncaughtExceptionCaptureCallback:()=>ce,stderr:()=>be,stdin:()=>ve,stdout:()=>ye,title:()=>B,umask:()=>H,uptime:()=>T,version:()=>F,versions:()=>W});var O,M,P,x,B,L,U,N,j,D,F,W,V,z,H,q,$,K,G,Q,Y,J,X,Z,ee,te,re,ne,ie,oe,se,ae,le,ue,ce,he,fe,de,pe,ge,ye,be,ve,me,we,_e,Ee,Se,ke,Ae,Te,Ie,Ce,Re,Oe,Me,Pe,xe,Be,Le,Ue,Ne,je,De,Fe,We,Ve=l((()=>{nt(),ze(),f(),O=[],M=!1,x=-1,v.prototype.run=function(){this.fun.apply(null,this.array)},B="browser",L="x64",U="browser",N={PATH:"/usr/bin",LANG:n.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},j=["/usr/bin/node"],D=[],F="v16.8.0",W={},V=function(e,t){console.warn((t?t+": ":"")+e)},z=function(e){p("binding")},H=function(e){return 0},q=function(){return"/"},$=function(e){},K={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},G=m,Q=[],Y={},J=!1,X={},Z=m,ee=m,re=te=function(){return{}},ne=te,ie=m,oe=m,se=m,ae={},le={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ue=m,ce=m,he=m,fe=m,de=m,pe=m,ge=m,ye=void 0,be=void 0,ve=void 0,me=m,we=2,_e=1,Ee="/bin/usr/node",Se=9229,ke="node",Ae=[],Te=m,void 0===(Ie={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0}).now&&(Ce=Date.now(),Ie.timing&&Ie.timing.navigationStart&&(Ce=Ie.timing.navigationStart),Ie.now=()=>Date.now()-Ce),Re=1e9,I.bigint=function(e){var t=I(e);return typeof BigInt>"u"?t[0]*Re+t[1]:BigInt(t[0]*Re)+BigInt(t[1])},We={version:F,versions:W,arch:L,platform:U,release:K,_rawDebug:G,moduleLoadList:Q,binding:z,_linkedBinding:w,_events:Me={},_eventsCount:Pe=0,_maxListeners:Oe=10,on:C,addListener:xe=C,once:Be=C,off:Le=C,removeListener:Ue=C,removeAllListeners:Ne=C,emit:je=m,prependListener:De=C,prependOnceListener:Fe=C,listeners:R,domain:Y,_exiting:J,config:X,dlopen:_,uptime:T,_getActiveRequests:E,_getActiveHandles:S,reallyExit:Z,_kill:ee,cpuUsage:te,resourceUsage:re,memoryUsage:ne,kill:ie,exit:oe,openStdin:se,allowedNodeEnvironmentFlags:ae,assert:k,features:le,_fatalExceptions:ue,setUncaughtExceptionCaptureCallback:ce,hasUncaughtExceptionCaptureCallback:A,emitWarning:V,nextTick:b,_tickCallback:he,_debugProcess:fe,_debugEnd:de,_startProfilerIdleNotifier:pe,_stopProfilerIdleNotifier:ge,stdout:ye,stdin:ve,stderr:be,abort:me,umask:H,chdir:$,cwd:q,env:N,title:B,argv:j,execArgv:D,pid:we,ppid:_e,execPath:Ee,debugPort:Se,hrtime:I,argv0:ke,_preload_modules:Ae,setSourceMapsEnabled:Te}})),ze=l((()=>{Ve()})),He={};function qe(){if(Je)return Ye;Je=!0;let e=function(){if(Ke)return $e;Ke=!0,$e.byteLength=function(e){var t=o(e),r=t[0],n=t[1];return 3*(r+n)/4-n},$e.toByteArray=function(e){var n,i,s=o(e),a=s[0],l=s[1],u=new r(function(e,t,r){return 3*(t+r)/4-r}(0,a,l)),c=0,h=l>0?a-4:a;for(i=0;i<h;i+=4)n=t[e.charCodeAt(i)]<<18|t[e.charCodeAt(i+1)]<<12|t[e.charCodeAt(i+2)]<<6|t[e.charCodeAt(i+3)],u[c++]=n>>16&255,u[c++]=n>>8&255,u[c++]=255&n;return 2===l&&(n=t[e.charCodeAt(i)]<<2|t[e.charCodeAt(i+1)]>>4,u[c++]=255&n),1===l&&(n=t[e.charCodeAt(i)]<<10|t[e.charCodeAt(i+1)]<<4|t[e.charCodeAt(i+2)]>>2,u[c++]=n>>8&255,u[c++]=255&n),u},$e.fromByteArray=function(t){for(var r,n=t.length,i=n%3,o=[],s=16383,l=0,u=n-i;l<u;l+=s)o.push(a(t,l,l+s>u?u:l+s));return 1===i?(r=t[n-1],o.push(e[r>>2]+e[r<<4&63]+"==")):2===i&&(r=(t[n-2]<<8)+t[n-1],o.push(e[r>>10]+e[r>>4&63]+e[r<<2&63]+"=")),o.join("")};for(var e=[],t=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)e[i]=n[i],t[n.charCodeAt(i)]=i;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(t){return e[t>>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function a(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(s(n));return i.join("")}return t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63,$e}(),t=(Qe||(Qe=!0,Ge.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},Ge.write=function(e,t,r,n,i,o){var s,a,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+d]=255&s,d+=p,s/=256,u-=8);e[r+d-p]|=128*g}),Ge),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;Ye.Buffer=o,Ye.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},Ye.INSPECT_MAX_BYTES=50;let n=2147483647;function i(e){if(e>n)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=0|f(e,t),n=i(r),s=n.write(e,t);return s!==r&&(n=n.slice(0,s)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){let t=new Uint8Array(e);return c(t.buffer,t.byteOffset,t.byteLength)}return u(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return c(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);let s=function(e){if(o.isBuffer(e)){let t=0|h(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||K(e.length)?i(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(s)return s;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return a(e),i(e<0?0:0|h(e))}function u(e){let t=e.length<0?0:0|h(e.length),r=i(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function c(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,o.prototype),n}function h(e){if(e>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|e}function f(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function p(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),K(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){let o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function b(e,t,r,n){r=Number(r)||0;let i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;let o,s=t.length;for(n>s/2&&(n=s/2),o=0;o<n;++o){let n=parseInt(t.substr(2*o,2),16);if(K(n))return o;e[r+o]=n}return o}function v(e,t,r,n){return q(z(t,e.length-r),e,r,n)}function m(e,t,r,n){return q(function(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function w(e,t,r,n){return q(H(t),e,r,n)}function _(e,t,r,n){return q(function(e,t){let r,n,i,o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function E(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function S(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(o=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){let t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}Ye.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&"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(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return s(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return function(e,t,r){return a(e),e<=0?i(e):void 0!==t?"string"==typeof r?i(e).fill(t,r):i(e).fill(t):i(e)}(e,t,r)},o.allocUnsafe=function(e){return l(e)},o.allocUnsafeSlow=function(e){return l(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if($(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;let n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if($(t,Uint8Array))i+t.length>n.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!o.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},o.byteLength=f,o.prototype._isBuffer=!0,o.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)p(this,t,t+1);return this},o.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)p(this,t,t+3),p(this,t+1,t+2);return this},o.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)p(this,t,t+7),p(this,t+1,t+6),p(this,t+2,t+5),p(this,t+3,t+4);return this},o.prototype.toString=function(){let e=this.length;return 0===e?"":0===arguments.length?S(this,0,e):d.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){let e="",t=Ye.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if($(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),l=Math.min(s,a),u=this.slice(n,i),c=e.slice(t,r);for(let e=0;e<l;++e)if(u[e]!==c[e]){s=u[e],a=c[e];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}let i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":case"latin1":case"binary":return m(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};let k=4096;function A(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function T(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function I(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=G[e[n]];return i}function C(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function R(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,r,n,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function M(e,t,r,n,i){D(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function P(e,t,r,n,i){D(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function x(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,r,n,i,o){return r=+r,n>>>=0,o||x(e,0,n,4),t.write(e,r,n,i,23,4),n+4}function L(e,r,n,i,o){return r=+r,n>>>=0,o||x(e,0,n,8),t.write(e,r,n,i,52,8),n+8}o.prototype.slice=function(e,t){let r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=Q((function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),o.prototype.readBigUInt64BE=Q((function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=Q((function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),o.prototype.readBigInt64BE=Q((function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),o.prototype.readFloatLE=function(e,r){return e>>>=0,r||R(e,4,this.length),t.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,r){return e>>>=0,r||R(e,4,this.length),t.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,r){return e>>>=0,r||R(e,8,this.length),t.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,r){return e>>>=0,r||R(e,8,this.length),t.read(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){O(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){O(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigUInt64LE=Q((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=Q((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigInt64LE=Q((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=Q((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&0!==n&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{let s=o.isBuffer(e)?e:o.from(e,n),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this};let U={};function N(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function j(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function D(e,t,r,n,i,o){if(e>r||e<t){let n,i="bigint"==typeof t?"n":"";throw n=o>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(o+1)}${i}`:`>= -(2${i} ** ${8*(o+1)-1}${i}) and < 2 ** ${8*(o+1)-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new U.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,r){F(t,"offset"),(void 0===e[t]||void 0===e[t+r])&&W(t,e.length-(r+1))}(n,i,o)}function F(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,r){throw Math.floor(e)!==e?(F(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new U.ERR_BUFFER_OUT_OF_BOUNDS:new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}N("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),N("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),N("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=j(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=j(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);let V=/[^+/0-9A-Za-z-_]/g;function z(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){return e.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(t))}function q(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function K(e){return e!=e}let G=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Q(e){return typeof BigInt>"u"?Y:e}function Y(){throw new Error("BigInt not supported")}return Ye}c(He,{Buffer:()=>Ze,INSPECT_MAX_BYTES:()=>et,default:()=>Xe,kMaxLength:()=>tt});var $e,Ke,Ge,Qe,Ye,Je,Xe,Ze,et,tt,rt=l((()=>{nt(),ze(),f(),$e={},Ke=!1,Ge={},Qe=!1,Ye={},Je=!1,(Xe=qe()).Buffer,Xe.SlowBuffer,Xe.INSPECT_MAX_BYTES,Xe.kMaxLength,Ze=Xe.Buffer,et=Xe.INSPECT_MAX_BYTES,tt=Xe.kMaxLength})),nt=l((()=>{rt()})),it=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(e){this.aliasToTopic={},this.max=e}put(e,t){return!(0===t||t>this.max)&&(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(e){return this.aliasToTopic[e]}clear(){this.aliasToTopic={}}}})),ot=u(((e,t)=>{nt(),ze(),f(),t.exports={ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Uint8Array}})),st=u(((e,t)=>{nt(),ze(),f();var r=(rt(),h(He)),n=Object.getPrototypeOf((async function(){})).constructor,i=globalThis.Blob||r.Blob,o=typeof i<"u"?function(e){return e instanceof i}:function(e){return!1},s=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let r=0;r<e.length;r++)t+=` ${e[r].stack}\n`;super(t),this.name="AggregateError",this.errors=e}};t.exports={AggregateError:s,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise(((r,n)=>{e=r,t=n})),resolve:e,reject:t}},promisify:e=>new Promise(((t,r)=>{e(((e,...n)=>e?r(e):t(...n)))})),debuglog:()=>function(){},format:(e,...t)=>e.replace(/%([sdifj])/g,(function(...[e,r]){let n=t.shift();return"f"===r?n.toFixed(6):"j"===r?JSON.stringify(n):"s"===r&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},types:{isAsyncFunction:e=>e instanceof n,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:o},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})),at=u(((e,t)=>{nt(),ze(),f();var{AbortController:r,AbortSignal:n}=typeof self<"u"?self:typeof window<"u"?window:void 0;t.exports=r,t.exports.AbortSignal=n,t.exports.default=r})),lt=u(((e,t)=>{nt(),ze(),f();var{format:r,inspect:n,AggregateError:i}=st(),o=globalThis.AggregateError||i,s=Symbol("kIsNodeError"),a=["string","function","number","object","Function","Object","boolean","bigint","symbol"],l=/^([A-Z][a-z0-9]*)+$/,u={};function c(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function h(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function d(e,t,n){n||(n=Error);class i extends n{constructor(...n){super(function(e,t,n){if("function"==typeof t)return c(t.length<=n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${t.length}).`),t(...n);let i=(t.match(/%[dfijoOs]/g)||[]).length;return c(i===n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${i}).`),0===n.length?t:r(t,...n)}(e,t,n))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[s]=!0,u[e]=i}function p(e){let t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}var g=class extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new u.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}};d("ERR_ASSERTION","%s",Error),d("ERR_INVALID_ARG_TYPE",((e,t,r)=>{c("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let i="The ";e.endsWith(" argument")?i+=`${e} `:i+=`"${e}" ${e.includes(".")?"property":"argument"} `,i+="must be ";let o=[],s=[],u=[];for(let e of t)c("string"==typeof e,"All expected entries have to be of type string"),a.includes(e)?o.push(e.toLowerCase()):l.test(e)?s.push(e):(c("object"!==e,'The value "object" should be written as "Object"'),u.push(e));if(s.length>0){let e=o.indexOf("object");-1!==e&&(o.splice(o,e,1),s.push("Object"))}if(o.length>0){switch(o.length){case 1:i+=`of type ${o[0]}`;break;case 2:i+=`one of type ${o[0]} or ${o[1]}`;break;default:{let e=o.pop();i+=`one of type ${o.join(", ")}, or ${e}`}}(s.length>0||u.length>0)&&(i+=" or ")}if(s.length>0){switch(s.length){case 1:i+=`an instance of ${s[0]}`;break;case 2:i+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let e=s.pop();i+=`an instance of ${s.join(", ")}, or ${e}`}}u.length>0&&(i+=" or ")}switch(u.length){case 0:break;case 1:u[0].toLowerCase()!==u[0]&&(i+="an "),i+=`${u[0]}`;break;case 2:i+=`one of ${u[0]} or ${u[1]}`;break;default:{let e=u.pop();i+=`one of ${u.join(", ")}, or ${e}`}}if(null==r)i+=`. Received ${r}`;else if("function"==typeof r&&r.name)i+=`. Received function ${r.name}`;else if("object"==typeof r){var h;if(null!==(h=r.constructor)&&void 0!==h&&h.name)i+=`. Received an instance of ${r.constructor.name}`;else{i+=`. Received ${n(r,{depth:-1})}`}}else{let e=n(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),i+=`. Received type ${typeof r} (${e})`}return i}),TypeError),d("ERR_INVALID_ARG_VALUE",((e,t,r="is invalid")=>{let i=n(t);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${i}`}),TypeError),d("ERR_INVALID_RETURN_VALUE",((e,t,r)=>{var n;return`Expected ${e} to be returned from the "${t}" function but got ${null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?`instance of ${r.constructor.name}`:"type "+typeof r}.`}),TypeError),d("ERR_MISSING_ARGS",((...e)=>{c(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map((e=>`"${e}"`)).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`}),TypeError),d("ERR_OUT_OF_RANGE",((e,t,r)=>{let i;return c(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32?i=h(String(r)):"bigint"==typeof r?(i=String(r),(r>2n**32n||r<-(2n**32n))&&(i=h(i)),i+="n"):i=n(r),`The value of "${e}" is out of range. It must be ${t}. Received ${i}`}),RangeError),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),d("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),d("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),d("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),d("ERR_STREAM_WRITE_AFTER_END","write after end",Error),d("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:g,aggregateTwoErrors:p((function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new o([t,e],t.message);return r.code=t.code,r}return e||t})),hideStackFrames:p,codes:u}})),ut=u(((e,t)=>{nt(),ze(),f();var{ArrayIsArray:r,ArrayPrototypeIncludes:n,ArrayPrototypeJoin:i,ArrayPrototypeMap:o,NumberIsInteger:s,NumberIsNaN:a,NumberMAX_SAFE_INTEGER:l,NumberMIN_SAFE_INTEGER:u,NumberParseInt:c,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:d,String:p,StringPrototypeToUpperCase:g,StringPrototypeTrim:y}=ot(),{hideStackFrames:b,codes:{ERR_SOCKET_BAD_PORT:v,ERR_INVALID_ARG_TYPE:m,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:E}}=lt(),{normalizeEncoding:S}=st(),{isAsyncFunction:k,isArrayBufferView:A}=st().types,T={};var I=/^[0-7]+$/;var C=b(((e,t,r=u,n=l)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!s(e))throw new _(t,"an integer",e);if(e<r||e>n)throw new _(t,`>= ${r} && <= ${n}`,e)})),R=b(((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!s(e))throw new _(t,"an integer",e);if(e<r||e>n)throw new _(t,`>= ${r} && <= ${n}`,e)})),O=b(((e,t,r=!1)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!s(e))throw new _(t,"an integer",e);let n=r?1:0,i=4294967295;if(e<n||e>i)throw new _(t,`>= ${n} && <= ${i}`,e)}));function M(e,t){if("string"!=typeof e)throw new m(t,"string",e)}var P=b(((e,t,r)=>{if(!n(r,e)){let n="must be one of: "+i(o(r,(e=>"string"==typeof e?`'${e}'`:p(e))),", ");throw new w(t,e,n)}}));function x(e,t){if("boolean"!=typeof e)throw new m(t,"boolean",e)}function B(e,t,r){return null!=e&&h(e,t)?e[t]:r}var L=b(((e,t,n=null)=>{let i=B(n,"allowArray",!1),o=B(n,"allowFunction",!1);if(!B(n,"nullable",!1)&&null===e||!i&&r(e)||"object"!=typeof e&&(!o||"function"!=typeof e))throw new m(t,"Object",e)})),U=b(((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new m(t,"a dictionary",e)})),N=b(((e,t,n=0)=>{if(!r(e))throw new m(t,"Array",e);if(e.length<n){throw new w(t,e,`must be longer than ${n}`)}}));var j=b(((e,t="buffer")=>{if(!A(e))throw new m(t,["Buffer","TypedArray","DataView"],e)}));var D=b(((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new m(t,"AbortSignal",e)})),F=b(((e,t)=>{if("function"!=typeof e)throw new m(t,"Function",e)})),W=b(((e,t)=>{if("function"!=typeof e||k(e))throw new m(t,"Function",e)})),V=b(((e,t)=>{if(void 0!==e)throw new m(t,"undefined",e)}));var z=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function H(e,t){if(typeof e>"u"||!d(z,e))throw new w(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}t.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(typeof e>"u"&&(e=r),"string"==typeof e){if(null===d(I,e))throw new w(t,e,"must be a 32-bit unsigned integer or an octal string");e=c(e,8)}return O(e,t),e},validateArray:N,validateStringArray:function(e,t){N(e,t);for(let r=0;r<e.length;r++)M(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){N(e,t);for(let r=0;r<e.length;r++)x(e[r],`${t}[${r}]`)},validateBoolean:x,validateBuffer:j,validateDictionary:U,validateEncoding:function(e,t){let r=S(t),n=e.length;if("hex"===r&&n%2!=0)throw new w("encoding",t,`is invalid for data of length ${n}`)},validateFunction:F,validateInt32:R,validateInteger:C,validateNumber:function(e,t,r=void 0,n){if("number"!=typeof e)throw new m(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&a(e))throw new _(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:L,validateOneOf:P,validatePlainFunction:W,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===y(e).length||+e!=+e>>>0||e>65535||0===e&&!r)throw new v(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(M(e,t),void 0===T[e])throw void 0!==T[g(e)]?new E(e+" (signals must use all capital letters)"):new E(e)},validateString:M,validateUint32:O,validateUndefined:V,validateUnion:function(e,t,r){if(!n(r,e))throw new m(t,`('${i(r,"|")}')`,e)},validateAbortSignal:D,validateLinkHeaderValue:function(e){if("string"==typeof e)return H(e,"hints"),e;if(r(e)){let t=e.length,r="";if(0===t)return r;for(let n=0;n<t;n++){let i=e[n];H(i,"hints"),r+=i,n!==t-1&&(r+=", ")}return r}throw new w("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}})),ct=u(((e,t)=>{nt(),ze(),f();var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch{try{return r.call(null,e,0)}catch{return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch{r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch{n=s}}();var l,u=[],c=!1,h=-1;function d(){!c||!l||(c=!1,l.length?u=l.concat(u):h=-1,u.length&&p())}function p(){if(!c){var e=a(d);c=!0;for(var t=u.length;t;){for(l=u,u=[];++h<t;)l&&l[h].run();h=-1,t=u.length}l=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch{try{return n.call(null,e)}catch{return n.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function y(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new g(e,t)),1===u.length&&!c&&a(p)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}})),ht=u(((e,t)=>{nt(),ze(),f();var{Symbol:r,SymbolAsyncIterator:n,SymbolIterator:i,SymbolFor:o}=ot(),s=r("kDestroyed"),a=r("kIsErrored"),l=r("kIsReadable"),u=r("kIsDisturbed"),c=o("nodejs.webstream.isClosedPromise"),h=o("nodejs.webstream.controllerErrorFunction");function d(e,t=!1){var r;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(r=e._readableState)||void 0===r?void 0:r.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function g(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function y(e){return!(!e||g(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function b(e){return!(!e||g(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function v(e){return!(!e||g(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function m(e){if(!g(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[s]||null!=n&&n.destroyed)}function w(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;let t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof t?.ended?null:t.ended)}function _(e,t){if(!d(e))return null;let r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof r?.endEmitted?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function E(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof e?.readable?null:!m(e)&&(d(e)&&e.readable&&!_(e))}function S(e){return"boolean"!=typeof e?.writable?null:!m(e)&&(p(e)&&e.writable&&!w(e))}function k(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function A(e){return"boolean"==typeof e._sent100&&k(e)}t.exports={kDestroyed:s,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[u])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:u,isErrored:function(e){var t,r,n,i,o,s,l,u,c,h;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(i=null!==(o=null!==(s=e[a])&&void 0!==s?s:e.readableErrored)&&void 0!==o?o:e.writableErrored)&&void 0!==i?i:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(u=e._writableState)||void 0===u?void 0:u.errorEmitted)&&void 0!==r?r:null===(c=e._readableState)||void 0===c?void 0:c.errored)&&void 0!==t?t:null!==(h=e._writableState)&&void 0!==h&&h.errored))},kIsErrored:a,isReadable:E,kIsReadable:l,kIsClosedPromise:c,kControllerErrorFunction:h,isClosed:function(e){if(!g(e))return null;if("boolean"==typeof e.closed)return e.closed;let t=e._writableState,r=e._readableState;return"boolean"==typeof t?.closed||"boolean"==typeof r?.closed?t?.closed||r?.closed:"boolean"==typeof e._closed&&k(e)?e._closed:null},isDestroyed:m,isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return g(e)?!!m(e)||!(!1!==t?.readable&&E(e)||!1!==t?.writable&&S(e)):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[n]:!1===t?"function"==typeof e[i]:"function"==typeof e[n]||"function"==typeof e[i])},isReadableNodeStream:d,isReadableStream:y,isReadableEnded:function(e){if(!d(e))return null;if(!0===e.readableEnded)return!0;let t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof t?.ended?null:t.ended)},isReadableFinished:_,isReadableErrored:function(e){var t,r;return g(e)?e.readableErrored?e.readableErrored:null!==(t=null===(r=e._readableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isNodeStream:g,isWebStream:function(e){return y(e)||b(e)||v(e)},isWritable:S,isWritableNodeStream:p,isWritableStream:b,isWritableEnded:w,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;let r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof r?.finished?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return g(e)?e.writableErrored?e.writableErrored:null!==(t=null===(r=e._writableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:A,willEmitClose:function(e){if(!g(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!n&&A(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:v}})),ft=u(((e,t)=>{nt(),ze(),f();var r=ct(),{AbortError:n,codes:i}=lt(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_PREMATURE_CLOSE:s}=i,{kEmptyObject:a,once:l}=st(),{validateAbortSignal:u,validateFunction:c,validateObject:h,validateBoolean:d}=ut(),{Promise:p,PromisePrototypeThen:g}=ot(),{isClosed:y,isReadable:b,isReadableNodeStream:v,isReadableStream:m,isReadableFinished:w,isReadableErrored:_,isWritable:E,isWritableNodeStream:S,isWritableStream:k,isWritableFinished:A,isWritableErrored:T,isNodeStream:I,willEmitClose:C,kIsClosedPromise:R}=ht();var O=()=>{};function M(e,t,i){var f,d;if(2===arguments.length?(i=t,t=a):null==t?t=a:h(t,"options"),c(i,"callback"),u(t.signal,"options.signal"),i=l(i),m(e)||k(e))return function(e,t,i){let o=!1,s=O;if(t.signal)if(s=()=>{o=!0,i.call(e,new n(void 0,{cause:t.signal.reason}))},t.signal.aborted)r.nextTick(s);else{let r=i;i=l(((...n)=>{t.signal.removeEventListener("abort",s),r.apply(e,n)})),t.signal.addEventListener("abort",s)}let a=(...t)=>{o||r.nextTick((()=>i.apply(e,t)))};return g(e[R].promise,a,a),O}(e,t,i);if(!I(e))throw new o("stream",["ReadableStream","WritableStream","Stream"],e);let p=null!==(f=t.readable)&&void 0!==f?f:v(e),M=null!==(d=t.writable)&&void 0!==d?d:S(e),P=e._writableState,x=e._readableState,B=()=>{e.writable||N()},L=C(e)&&v(e)===p&&S(e)===M,U=A(e,!1),N=()=>{U=!0,e.destroyed&&(L=!1),(!L||e.readable&&!p)&&(!p||j)&&i.call(e)},j=w(e,!1),D=()=>{j=!0,e.destroyed&&(L=!1),(!L||e.writable&&!M)&&(!M||U)&&i.call(e)},F=t=>{i.call(e,t)},W=y(e),V=()=>{W=!0;let t=T(e)||_(e);return t&&"boolean"!=typeof t?i.call(e,t):p&&!j&&v(e,!0)&&!w(e,!1)?i.call(e,new s):!M||U||A(e,!1)?void i.call(e):i.call(e,new s)},z=()=>{W=!0;let t=T(e)||_(e);if(t&&"boolean"!=typeof t)return i.call(e,t);i.call(e)},H=()=>{e.req.on("finish",N)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?M&&!P&&(e.on("end",B),e.on("close",B)):(e.on("complete",N),L||e.on("abort",V),e.req?H():e.on("request",H)),!L&&"boolean"==typeof e.aborted&&e.on("aborted",V),e.on("end",D),e.on("finish",N),!1!==t.error&&e.on("error",F),e.on("close",V),W?r.nextTick(V):null!=P&&P.errorEmitted||null!=x&&x.errorEmitted?L||r.nextTick(z):(!p&&(!L||b(e))&&(U||!1===E(e))||!M&&(!L||E(e))&&(j||!1===b(e))||x&&e.req&&e.aborted)&&r.nextTick(z);let q=()=>{i=O,e.removeListener("aborted",V),e.removeListener("complete",N),e.removeListener("abort",V),e.removeListener("request",H),e.req&&e.req.removeListener("finish",N),e.removeListener("end",B),e.removeListener("close",B),e.removeListener("finish",N),e.removeListener("end",D),e.removeListener("error",F),e.removeListener("close",V)};if(t.signal&&!W){let o=()=>{let r=i;q(),r.call(e,new n(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)r.nextTick(o);else{let r=i;i=l(((...n)=>{t.signal.removeEventListener("abort",o),r.apply(e,n)})),t.signal.addEventListener("abort",o)}}return q}t.exports=M,t.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=a),null!==(r=t)&&void 0!==r&&r.cleanup&&(d(t.cleanup,"cleanup"),n=t.cleanup),new p(((r,i)=>{let o=M(e,t,(e=>{n&&o(),e?i(e):r()}))}))}})),dt=u(((e,t)=>{nt(),ze(),f();var r=ct(),{aggregateTwoErrors:n,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:o}=lt(),{Symbol:s}=ot(),{kDestroyed:a,isDestroyed:l,isFinished:u,isServerRequest:c}=ht(),h=s("kDestroy"),d=s("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function g(e,t,n){let i=!1;function o(t){if(i)return;i=!0;let o=e._readableState,s=e._writableState;p(t,s,o),s&&(s.closed=!0),o&&(o.closed=!0),"function"==typeof n&&n(t),t?r.nextTick(y,e,t):r.nextTick(b,e)}try{e._destroy(t||null,o)}catch(e){o(e)}}function y(e,t){v(e,t),b(e)}function b(e){let t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function v(e,t){let r=e._readableState,n=e._writableState;null!=n&&n.errorEmitted||null!=r&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function m(e,t,n){let i=e._readableState,o=e._writableState;if(null!=o&&o.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=o&&o.autoDestroy?e.destroy(t):t&&(t.stack,o&&!o.errored&&(o.errored=t),i&&!i.errored&&(i.errored=t),n?r.nextTick(v,e,t):v(e,t))}function w(e){let t=!1;function n(n){if(t)return void m(e,n??new i);t=!0;let o=e._readableState,s=e._writableState,a=s||o;o&&(o.constructed=!0),s&&(s.constructed=!0),a.destroyed?e.emit(h,n):n?m(e,n,!0):r.nextTick(_,e)}try{e._construct((e=>{r.nextTick(n,e)}))}catch(e){r.nextTick(n,e)}}function _(e){e.emit(d)}function E(e){return e?.setHeader&&"function"==typeof e.abort}function S(e){e.emit("close")}function k(e,t){e.emit("error",t),r.nextTick(S,e)}t.exports={construct:function(e,t){if("function"!=typeof e._construct)return;let n=e._readableState,i=e._writableState;n&&(n.constructed=!1),i&&(i.constructed=!1),e.once(d,t),!(e.listenerCount(d)>1)&&r.nextTick(w,e)},destroyer:function(e,t){!e||l(e)||(!t&&!u(e)&&(t=new o),c(e)?(e.socket=null,e.destroy(t)):E(e)?e.abort():E(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?r.nextTick(k,e,t):r.nextTick(S,e),e.destroyed||(e[a]=!0))},destroy:function(e,t){let r=this._readableState,i=this._writableState,o=i||r;return null!=i&&i.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(p(e,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),o.constructed?g(this,e,t):this.once(h,(function(r){g(this,n(r,e),t)})),this)},undestroy:function(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:m}}));function pt(){pt.init.call(this)}function gt(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function yt(e){return void 0===e._maxListeners?pt.defaultMaxListeners:e._maxListeners}function bt(e,t,r,n){var i,o,s,a;if(gt(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=yt(e))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,a=l,console&&console.warn&&console.warn(a)}return e}function vt(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function mt(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=vt.bind(n);return i.listener=r,n.wrapFn=i,i}function wt(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):Et(i,i.length)}function _t(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function Et(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}var St,kt,At,Tt,It,Ct,Rt,Ot=l((()=>{nt(),ze(),f(),At="object"==typeof Reflect?Reflect:null,Tt=At&&"function"==typeof At.apply?At.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)},kt=At&&"function"==typeof At.ownKeys?At.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)},It=Number.isNaN||function(e){return e!=e},St=pt,pt.EventEmitter=pt,pt.prototype._events=void 0,pt.prototype._eventsCount=0,pt.prototype._maxListeners=void 0,Ct=10,Object.defineProperty(pt,"defaultMaxListeners",{enumerable:!0,get:function(){return Ct},set:function(e){if("number"!=typeof e||e<0||It(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Ct=e}}),pt.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},pt.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||It(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},pt.prototype.getMaxListeners=function(){return yt(this)},pt.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[e];if(void 0===a)return!1;if("function"==typeof a)Tt(a,this,t);else{var l=a.length,u=Et(a,l);for(r=0;r<l;++r)Tt(u[r],this,t)}return!0},pt.prototype.addListener=function(e,t){return bt(this,e,t,!1)},pt.prototype.on=pt.prototype.addListener,pt.prototype.prependListener=function(e,t){return bt(this,e,t,!0)},pt.prototype.once=function(e,t){return gt(t),this.on(e,mt(this,e,t)),this},pt.prototype.prependOnceListener=function(e,t){return gt(t),this.prependListener(e,mt(this,e,t)),this},pt.prototype.removeListener=function(e,t){var r,n,i,o,s;if(gt(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},pt.prototype.off=pt.prototype.removeListener,pt.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},pt.prototype.listeners=function(e){return wt(this,e,!0)},pt.prototype.rawListeners=function(e){return wt(this,e,!1)},pt.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):_t.call(e,t)},pt.prototype.listenerCount=_t,pt.prototype.eventNames=function(){return this._eventsCount>0?kt(this._events):[]},(Rt=St).EventEmitter,Rt.defaultMaxListeners,Rt.init,Rt.listenerCount,Rt.EventEmitter,Rt.defaultMaxListeners,Rt.init,Rt.listenerCount})),Mt={};c(Mt,{EventEmitter:()=>Pt,default:()=>Rt,defaultMaxListeners:()=>xt,init:()=>Bt,listenerCount:()=>Lt,on:()=>Ut,once:()=>Nt});var Pt,xt,Bt,Lt,Ut,Nt,jt=l((()=>{nt(),ze(),f(),Ot(),Ot(),Rt.once=function(e,t){return new Promise(((r,n)=>{function i(...t){void 0!==o&&e.removeListener("error",o),r(t)}let o;"error"!==t&&(o=t=>{e.removeListener(name,i),n(t)},e.once("error",o)),e.once(t,i)}))},Rt.on=function(e,t){let r=[],n=[],i=null,o=!1,s={async next(){let e=r.shift();if(e)return createIterResult(e,!1);if(i){let e=Promise.reject(i);return i=null,e}return o?createIterResult(void 0,!0):new Promise(((e,t)=>n.push({resolve:e,reject:t})))},async return(){e.removeListener(t,a),e.removeListener("error",l),o=!0;for(let e of n)e.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(r){i=r,e.removeListener(t,a),e.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return e.on(t,a),e.on("error",l),s;function a(...e){let t=n.shift();t?t.resolve(createIterResult(e,!1)):r.push(e)}function l(e){o=!0;let t=n.shift();t?t.reject(e):i=e,s.return()}},({EventEmitter:Pt,defaultMaxListeners:xt,init:Bt,listenerCount:Lt,on:Ut,once:Nt}=Rt)})),Dt=u(((e,t)=>{nt(),ze(),f();var{ArrayIsArray:r,ObjectSetPrototypeOf:n}=ot(),{EventEmitter:i}=(jt(),h(Mt));function o(e){i.call(this,e)}function s(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}n(o.prototype,i.prototype),n(o,i),o.prototype.pipe=function(e,t){let r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",o),!e._isStdio&&(!t||!1!==t.end)&&(r.on("end",l),r.on("close",u));let a=!1;function l(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){h(),0===i.listenerCount(this,"error")&&this.emit("error",e)}function h(){r.removeListener("data",n),e.removeListener("drain",o),r.removeListener("end",l),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",h),r.removeListener("close",h),e.removeListener("close",h)}return s(r,"error",c),s(e,"error",c),r.on("end",h),r.on("close",h),e.on("close",h),e.emit("pipe",r),e},t.exports={Stream:o,prependListener:s}})),Ft=u(((e,t)=>{nt(),ze(),f();var{AbortError:r,codes:n}=lt(),{isNodeStream:i,isWebStream:o,kControllerErrorFunction:s}=ht(),a=ft(),{ERR_INVALID_ARG_TYPE:l}=n;t.exports.addAbortSignal=function(e,r){if(((e,t)=>{if("object"!=typeof e||!("aborted"in e))throw new l(t,"AbortSignal",e)})(e,"signal"),!i(r)&&!o(r))throw new l("stream",["ReadableStream","WritableStream","Stream"],r);return t.exports.addAbortSignalNoValidate(e,r)},t.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;let n=i(t)?()=>{t.destroy(new r(void 0,{cause:e.reason}))}:()=>{t[s](new r(void 0,{cause:e.reason}))};return e.aborted?n():(e.addEventListener("abort",n),a(t,(()=>e.removeEventListener("abort",n)))),t}})),Wt=u(((e,t)=>{nt(),ze(),f();var{StringPrototypeSlice:r,SymbolIterator:n,TypedArrayPrototypeSet:i,Uint8Array:o}=ot(),{Buffer:s}=(rt(),h(He)),{inspect:a}=st();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){let t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;let e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return s.alloc(0);let t=s.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)i(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){let r=this.head.data;if(e<r.length){let t=r.slice(0,e);return this.head.data=r.slice(e),t}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[n](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",n=this.head,i=0;do{let o=n.data;if(!(e>o.length)){e===o.length?(t+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(t+=r(o,0,e),this.head=n,n.data=r(o,e));break}t+=o,e-=o.length,++i}while(null!==(n=n.next));return this.length-=i,t}_getBuffer(e){let t=s.allocUnsafe(e),r=e,n=this.head,a=0;do{let s=n.data;if(!(e>s.length)){e===s.length?(i(t,s,r-e),++a,n.next?this.head=n.next:this.head=this.tail=null):(i(t,new o(s.buffer,s.byteOffset,e),r-e),this.head=n,n.data=s.slice(e));break}i(t,s,r-e),e-=s.length,++a}while(null!==(n=n.next));return this.length-=a,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return a(this,{...t,depth:0,customInspect:!1})}}})),Vt=u(((e,t)=>{nt(),ze(),f();var{MathFloor:r,NumberIsInteger:n}=ot(),{ERR_INVALID_ARG_VALUE:i}=lt().codes;function o(e){return e?16:16384}t.exports={getHighWaterMark:function(e,t,s,a){let l=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,a,s);if(null!=l){if(!n(l)||l<0){throw new i(a?`options.${s}`:"options.highWaterMark",l)}return r(l)}return o(e.objectMode)},getDefaultHighWaterMark:o}}));function zt(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function Ht(e,t,r){for(var n,i,o=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(Nr[(i=n)>>18&63]+Nr[i>>12&63]+Nr[i>>6&63]+Nr[63&i]);return o.join("")}function qt(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,$t.prototype),t}function $t(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return Qt(e)}return Kt(e,t,r)}function Kt(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!$t.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|Xt(e,t),n=qt(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return Yt(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Sr(e,ArrayBuffer)||e&&Sr(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Sr(e,SharedArrayBuffer)||e&&Sr(e.buffer,SharedArrayBuffer)))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,$t.prototype),n}(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return $t.from(n,t,r);var i=function(e){if($t.isBuffer(e)){var t=0|Jt(e.length),r=qt(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||kr(e.length)?qt(0):Yt(e):"Buffer"===e.type&&Array.isArray(e.data)?Yt(e.data):void 0}(e);if(i)return i;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return $t.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function Gt(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Qt(e){return Gt(e),qt(e<0?0:0|Jt(e))}function Yt(e){for(var t=e.length<0?0:0|Jt(e.length),r=qt(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function Jt(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function Xt(e,t){if($t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Sr(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return wr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return _r(e).length;default:if(i)return n?-1:wr(e).length;t=(""+t).toLowerCase(),i=!0}}function Zt(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return dr(this,t,r);case"utf8":case"utf-8":return cr(this,t,r);case"ascii":return hr(this,t,r);case"latin1":case"binary":return fr(this,t,r);case"base64":return ur(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pr(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function er(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function tr(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),kr(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=$t.from(t,n)),$t.isBuffer(t))return 0===t.length?-1:rr(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):rr(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function rr(e,t,r,n,i){var o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){for(var h=!0,f=0;f<l;f++)if(u(e,o+f)!==u(t,f)){h=!1;break}if(h)return o}return-1}function nr(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(kr(a))return s;e[r+s]=a}return s}function ir(e,t,r,n){return Er(wr(t,e.length-r),e,r,n)}function or(e,t,r,n){return Er(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function sr(e,t,r,n){return or(e,t,r,n)}function ar(e,t,r,n){return Er(_r(t),e,r,n)}function lr(e,t,r,n){return Er(function(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function ur(e,t,r){return 0===t&&r===e.length?zr.fromByteArray(e):zr.fromByteArray(e.slice(t,r))}function cr(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,l,u=e[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(l=(15&u)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}function hr(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function fr(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function dr(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=Kr[e[o]];return i}function pr(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function gr(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function yr(e,t,r,n,i,o){if(!$t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function br(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function vr(e,t,r,n,i){return t=+t,r>>>=0,i||br(e,0,r,4),Hr.write(e,t,r,n,23,4),r+4}function mr(e,t,r,n,i){return t=+t,r>>>=0,i||br(e,0,r,8),Hr.write(e,t,r,n,52,8),r+8}function wr(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function _r(e){return zr.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace($r,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Er(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Sr(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function kr(e){return e!=e}function Ar(e,t){for(var r in e)t[r]=e[r]}function Tr(e,t,r){return Yr(e,t,r)}function Ir(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(Xr.isEncoding===Zr||!Zr(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=Or,this.end=Mr,t=4;break;case"utf8":this.fillLast=Rr,t=4;break;case"base64":this.text=Pr,this.end=xr,t=3;break;default:return this.write=Br,void(this.end=Lr)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Xr.allocUnsafe(t)}function Cr(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function Rr(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function Or(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function Mr(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function Pr(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function xr(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Br(e){return e.toString(this.encoding)}function Lr(e){return e&&e.length?this.write(e):""}var Ur,Nr,jr,Dr,Fr,Wr,Vr,zr,Hr,qr,$r,Kr,Gr,Qr,Yr,Jr,Xr,Zr,en=l((()=>{for(nt(),ze(),f(),Ur={byteLength:function(e){var t=zt(e),r=t[0],n=t[1];return 3*(r+n)/4-n},toByteArray:function(e){var t,r,n,i=zt(e),o=i[0],s=i[1],a=new Dr(3*(o+(n=s))/4-n),l=0,u=s>0?o-4:o;for(r=0;r<u;r+=4)t=jr[e.charCodeAt(r)]<<18|jr[e.charCodeAt(r+1)]<<12|jr[e.charCodeAt(r+2)]<<6|jr[e.charCodeAt(r+3)],a[l++]=t>>16&255,a[l++]=t>>8&255,a[l++]=255&t;return 2===s&&(t=jr[e.charCodeAt(r)]<<2|jr[e.charCodeAt(r+1)]>>4,a[l++]=255&t),1===s&&(t=jr[e.charCodeAt(r)]<<10|jr[e.charCodeAt(r+1)]<<4|jr[e.charCodeAt(r+2)]>>2,a[l++]=t>>8&255,a[l++]=255&t),a},fromByteArray:function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;o<s;o+=16383)i.push(Ht(e,o,o+16383>s?s:o+16383));return 1===n?(t=e[r-1],i.push(Nr[t>>2]+Nr[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(Nr[t>>10]+Nr[t>>4&63]+Nr[t<<2&63]+"=")),i.join("")}},Nr=[],jr=[],Dr=typeof Uint8Array<"u"?Uint8Array:Array,Fr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wr=0,64;Wr<64;++Wr)Nr[Wr]=Fr[Wr],jr[Fr.charCodeAt(Wr)]=Wr;jr["-".charCodeAt(0)]=62,jr["_".charCodeAt(0)]=63,Vr={},zr=Ur,Hr={read:function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},write:function(e,t,r,n,i,o){var s,a,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+d]=255&s,d+=p,s/=256,u-=8);e[r+d-p]|=128*g}},qr="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null,Vr.Buffer=$t,Vr.SlowBuffer=function(e){return+e!=e&&(e=0),$t.alloc(+e)},Vr.INSPECT_MAX_BYTES=50,Vr.kMaxLength=2147483647,$t.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}(),$t.TYPED_ARRAY_SUPPORT||typeof console>"u"||"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($t.prototype,"parent",{enumerable:!0,get:function(){if($t.isBuffer(this))return this.buffer}}),Object.defineProperty($t.prototype,"offset",{enumerable:!0,get:function(){if($t.isBuffer(this))return this.byteOffset}}),$t.poolSize=8192,$t.from=function(e,t,r){return Kt(e,t,r)},Object.setPrototypeOf($t.prototype,Uint8Array.prototype),Object.setPrototypeOf($t,Uint8Array),$t.alloc=function(e,t,r){return i=t,o=r,Gt(n=e),n<=0?qt(n):void 0!==i?"string"==typeof o?qt(n).fill(i,o):qt(n).fill(i):qt(n);var n,i,o},$t.allocUnsafe=function(e){return Qt(e)},$t.allocUnsafeSlow=function(e){return Qt(e)},$t.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==$t.prototype},$t.compare=function(e,t){if(Sr(e,Uint8Array)&&(e=$t.from(e,e.offset,e.byteLength)),Sr(t,Uint8Array)&&(t=$t.from(t,t.offset,t.byteLength)),!$t.isBuffer(e)||!$t.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},$t.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},$t.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return $t.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=$t.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(Sr(o,Uint8Array)&&(o=$t.from(o)),!$t.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},$t.byteLength=Xt,$t.prototype._isBuffer=!0,$t.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)er(this,t,t+1);return this},$t.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)er(this,t,t+3),er(this,t+1,t+2);return this},$t.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)er(this,t,t+7),er(this,t+1,t+6),er(this,t+2,t+5),er(this,t+3,t+4);return this},$t.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?cr(this,0,e):Zt.apply(this,arguments)},$t.prototype.toLocaleString=$t.prototype.toString,$t.prototype.equals=function(e){if(!$t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===$t.compare(this,e)},$t.prototype.inspect=function(){var e="",t=Vr.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},qr&&($t.prototype[qr]=$t.prototype.inspect),$t.prototype.compare=function(e,t,r,n,i){if(Sr(e,Uint8Array)&&(e=$t.from(e,e.offset,e.byteLength)),!$t.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r),c=0;c<a;++c)if(l[c]!==u[c]){o=l[c],s=u[c];break}return o<s?-1:s<o?1:0},$t.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},$t.prototype.indexOf=function(e,t,r){return tr(this,e,t,r,!0)},$t.prototype.lastIndexOf=function(e,t,r){return tr(this,e,t,r,!1)},$t.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return nr(this,e,t,r);case"utf8":case"utf-8":return ir(this,e,t,r);case"ascii":return or(this,e,t,r);case"latin1":case"binary":return sr(this,e,t,r);case"base64":return ar(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lr(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},$t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},$t.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,$t.prototype),n},$t.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||gr(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},$t.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||gr(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},$t.prototype.readUInt8=function(e,t){return e>>>=0,t||gr(e,1,this.length),this[e]},$t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||gr(e,2,this.length),this[e]|this[e+1]<<8},$t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||gr(e,2,this.length),this[e]<<8|this[e+1]},$t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||gr(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},$t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||gr(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},$t.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||gr(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},$t.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||gr(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},$t.prototype.readInt8=function(e,t){return e>>>=0,t||gr(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},$t.prototype.readInt16LE=function(e,t){e>>>=0,t||gr(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},$t.prototype.readInt16BE=function(e,t){e>>>=0,t||gr(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},$t.prototype.readInt32LE=function(e,t){return e>>>=0,t||gr(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},$t.prototype.readInt32BE=function(e,t){return e>>>=0,t||gr(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},$t.prototype.readFloatLE=function(e,t){return e>>>=0,t||gr(e,4,this.length),Hr.read(this,e,!0,23,4)},$t.prototype.readFloatBE=function(e,t){return e>>>=0,t||gr(e,4,this.length),Hr.read(this,e,!1,23,4)},$t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||gr(e,8,this.length),Hr.read(this,e,!0,52,8)},$t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||gr(e,8,this.length),Hr.read(this,e,!1,52,8)},$t.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||yr(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},$t.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||yr(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},$t.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,1,255,0),this[t]=255&e,t+1},$t.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},$t.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},$t.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},$t.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},$t.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);yr(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},$t.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);yr(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},$t.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},$t.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},$t.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},$t.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},$t.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},$t.prototype.writeFloatLE=function(e,t,r){return vr(this,e,t,!0,r)},$t.prototype.writeFloatBE=function(e,t,r){return vr(this,e,t,!1,r)},$t.prototype.writeDoubleLE=function(e,t,r){return mr(this,e,t,!0,r)},$t.prototype.writeDoubleBE=function(e,t,r){return mr(this,e,t,!1,r)},$t.prototype.copy=function(e,t,r,n){if(!$t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var o=i-1;o>=0;--o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},$t.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!$t.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=$t.isBuffer(e)?e:$t.from(e,n),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this},$r=/[^+/0-9A-Za-z-_]/g,Kr=function(){for(var e=new Array(256),t=0;t<16;++t)for(var r=16*t,n=0;n<16;++n)e[r+n]="0123456789abcdef"[t]+"0123456789abcdef"[n];return e}(),Vr.Buffer,Vr.INSPECT_MAX_BYTES,Vr.kMaxLength,Gr={},(Yr=(Qr=Vr).Buffer).from&&Yr.alloc&&Yr.allocUnsafe&&Yr.allocUnsafeSlow?Gr=Qr:(Ar(Qr,Gr),Gr.Buffer=Tr),Tr.prototype=Object.create(Yr.prototype),Ar(Yr,Tr),Tr.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return Yr(e,t,r)},Tr.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=Yr(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},Tr.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return Yr(e)},Tr.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return Qr.SlowBuffer(e)},Jr={},Xr=Gr.Buffer,Zr=Xr.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},Jr.StringDecoder=Ir,Ir.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},Ir.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},Ir.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=Cr(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=Cr(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=Cr(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},Ir.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length},Jr.StringDecoder,Jr.StringDecoder})),tn={};c(tn,{StringDecoder:()=>rn,default:()=>Jr});var rn,nn=l((()=>{nt(),ze(),f(),en(),en(),rn=Jr.StringDecoder})),on=u(((e,t)=>{nt(),ze(),f();var r=ct(),{PromisePrototypeThen:n,SymbolAsyncIterator:i,SymbolIterator:o}=ot(),{Buffer:s}=(rt(),h(He)),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_NULL_VALUES:l}=lt().codes;t.exports=function(e,t,u){let c,h;if("string"==typeof t||t instanceof s)return new e({objectMode:!0,...u,read(){this.push(t),this.push(null)}});if(t&&t[i])h=!0,c=t[i]();else{if(!t||!t[o])throw new a("iterable",["Iterable"],t);h=!1,c=t[o]()}let f=new e({objectMode:!0,highWaterMark:1,...u}),d=!1;return f._read=function(){d||(d=!0,async function(){for(;;){try{let{value:e,done:t}=h?await c.next():c.next();if(t)f.push(null);else{let t=e&&"function"==typeof e.then?await e:e;if(null===t)throw d=!1,new l;if(f.push(t))continue;d=!1}}catch(e){f.destroy(e)}break}}())},f._destroy=function(e,t){n(async function(e){let t=null!=e,r="function"==typeof c.throw;if(t&&r){let{value:t,done:r}=await c.throw(e);if(await t,r)return}if("function"==typeof c.return){let{value:e}=await c.return();await e}}(e),(()=>r.nextTick(t,e)),(n=>r.nextTick(t,n||e)))},f}})),sn=u(((e,t)=>{nt(),ze(),f();var r=ct(),{ArrayPrototypeIndexOf:n,NumberIsInteger:i,NumberIsNaN:o,NumberParseInt:s,ObjectDefineProperties:a,ObjectKeys:l,ObjectSetPrototypeOf:u,Promise:c,SafeSet:d,SymbolAsyncIterator:p,Symbol:g}=ot();t.exports=F,F.ReadableState=D;var{EventEmitter:y}=(jt(),h(Mt)),{Stream:b,prependListener:v}=Dt(),{Buffer:m}=(rt(),h(He)),{addAbortSignal:w}=Ft(),_=ft(),E=st().debuglog("stream",(e=>{E=e})),S=Wt(),k=dt(),{getHighWaterMark:A,getDefaultHighWaterMark:T}=Vt(),{aggregateTwoErrors:I,codes:{ERR_INVALID_ARG_TYPE:C,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_OUT_OF_RANGE:O,ERR_STREAM_PUSH_AFTER_EOF:M,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:P}}=lt(),{validateObject:x}=ut(),B=g("kPaused"),{StringDecoder:L}=(nn(),h(tn)),U=on();u(F.prototype,b.prototype),u(F,b);var N=()=>{},{errorOrDestroy:j}=k;function D(e,t,r){"boolean"!=typeof r&&(r=t instanceof un()),this.objectMode=!(!e||!e.objectMode),r&&(this.objectMode=this.objectMode||!(!e||!e.readableObjectMode)),this.highWaterMark=e?A(this,e,"readableHighWaterMark",r):T(!1),this.buffer=new S,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[B]=null,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new L(e.encoding),this.encoding=e.encoding)}function F(e){if(!(this instanceof F))return new F(e);let t=this instanceof un();this._readableState=new D(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&w(e.signal,this)),b.call(this,e),k.construct(this,(()=>{this._readableState.needReadable&&K(this,this._readableState)}))}function W(e,t,r,n){E("readableAddChunk",t);let i,o=e._readableState;if(o.objectMode||("string"==typeof t?(r=r||o.defaultEncoding,o.encoding!==r&&(n&&o.encoding?t=m.from(t,r).toString(o.encoding):(t=m.from(t,r),r=""))):t instanceof m?r="":b._isUint8Array(t)?(t=b._uint8ArrayToBuffer(t),r=""):null!=t&&(i=new C("chunk",["string","Buffer","Uint8Array"],t))),i)j(e,i);else if(null===t)o.reading=!1,function(e,t){if(E("onEofChunk"),!t.ended){if(t.decoder){let e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?q(e):(t.needReadable=!1,t.emittedReadable=!0,$(e))}}(e,o);else if(o.objectMode||t&&t.length>0)if(n)if(o.endEmitted)j(e,new P);else{if(o.destroyed||o.errored)return!1;V(e,o,t,!0)}else if(o.ended)j(e,new M);else{if(o.destroyed||o.errored)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?V(e,o,t,!1):K(e,o)):V(e,o,t,!1)}else n||(o.reading=!1,K(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function V(e,t,r,n){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&q(e)),K(e,t)}F.prototype.destroy=k.destroy,F.prototype._undestroy=k.undestroy,F.prototype._destroy=function(e,t){t(e)},F.prototype[y.captureRejectionSymbol]=function(e){this.destroy(e)},F.prototype.push=function(e,t){return W(this,e,t,!1)},F.prototype.unshift=function(e,t){return W(this,e,t,!0)},F.prototype.isPaused=function(){let e=this._readableState;return!0===e[B]||!1===e.flowing},F.prototype.setEncoding=function(e){let t=new L(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this};var z;function H(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:o(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function q(e){let t=e._readableState;E("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(E("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick($,e))}function $(e){let t=e._readableState;E("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,X(e)}function K(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,r.nextTick(G,e,t))}function G(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){let r=t.length;if(E("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function Q(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[B]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function Y(e){E("readable nexttick read 0"),e.read(0)}function J(e,t){E("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),X(e),t.flowing&&!t.reading&&e.read(0)}function X(e){let t=e._readableState;for(E("flow",t.flowing);t.flowing&&null!==e.read(););}function Z(e,t){"function"!=typeof e.read&&(e=F.wrap(e,{objectMode:!0}));let r=async function*(e,t){let r=N;function n(t){this===e?(r(),r=N):r=t}e.on("readable",n);let i,o=_(e,{writable:!1},(e=>{i=e?I(i,e):null,r(),r=N}));try{for(;;){let t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(i)throw i;if(null===i)return;await new c(n)}}}catch(e){throw i=I(i,e),i}finally{!i&&!1===t?.destroyOnReturn||void 0!==i&&!e._readableState.autoDestroy?(e.off("readable",n),o()):k.destroyer(e,null)}}(e,t);return r.stream=e,r}function ee(e,t){if(0===t.length)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function te(e){let t=e._readableState;E("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(re,t,e))}function re(e,t){if(E("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)r.nextTick(ne,t);else if(e.autoDestroy){let e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function ne(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}function ie(){return void 0===z&&(z={}),z}F.prototype.read=function(e){E("read",e),void 0===e?e=NaN:i(e)||(e=s(e,10));let t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new O("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return E("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?te(this):q(this),null;if(0===(e=H(e,t))&&t.ended)return 0===t.length&&te(this),null;let n,o=t.needReadable;if(E("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&(o=!0,E("length less than watermark",o)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)o=!1,E("reading, ended or constructing",o);else if(o){E("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0);try{this._read(t.highWaterMark)}catch(e){j(this,e)}t.sync=!1,t.reading||(e=H(r,t))}return n=e>0?ee(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&te(this)),null!==n&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",n)),n},F.prototype._read=function(e){throw new R("_read()")},F.prototype.pipe=function(e,t){let n=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new d(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),E("pipe count=%d opts=%j",i.pipes.length,t);let o=t&&!1===t.end||e===r.stdout||e===r.stderr?y:a;function s(t,r){E("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,E("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),l&&e.removeListener("drain",l),e.removeListener("error",f),e.removeListener("unpipe",s),n.removeListener("end",a),n.removeListener("end",y),n.removeListener("data",h),u=!0,l&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&l())}function a(){E("onend"),e.end()}i.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",s);let l,u=!1;function c(){u||(1===i.pipes.length&&i.pipes[0]===e?(E("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(E("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),n.pause()),l||(l=function(e,t){return function(){let r=e._readableState;r.awaitDrainWriters===t?(E("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(E("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),(!r.awaitDrainWriters||0===r.awaitDrainWriters.size)&&e.listenerCount("data")&&e.resume()}}(n,e),e.on("drain",l))}function h(t){E("ondata");let r=e.write(t);E("dest.write",r),!1===r&&c()}function f(t){if(E("onerror",t),y(),e.removeListener("error",f),0===e.listenerCount("error")){let r=e._writableState||e._readableState;r&&!r.errorEmitted?j(e,t):e.emit("error",t)}}function p(){e.removeListener("finish",g),y()}function g(){E("onfinish"),e.removeListener("close",p),y()}function y(){E("unpipe"),n.unpipe(e)}return n.on("data",h),v(e,"error",f),e.once("close",p),e.once("finish",g),e.emit("pipe",n),!0===e.writableNeedDrain?i.flowing&&c():i.flowing||(E("pipe resume"),n.resume()),e},F.prototype.unpipe=function(e){let t=this._readableState;if(0===t.pipes.length)return this;if(!e){let e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}let r=n(t.pipes,e);return-1===r||(t.pipes.splice(r,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},F.prototype.on=function(e,t){let n=b.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,E("on readable",i.length,i.reading),i.length?q(this):i.reading||r.nextTick(Y,this)),n},F.prototype.addListener=F.prototype.on,F.prototype.removeListener=function(e,t){let n=b.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(Q,this),n},F.prototype.off=F.prototype.removeListener,F.prototype.removeAllListeners=function(e){let t=b.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&r.nextTick(Q,this),t},F.prototype.resume=function(){let e=this._readableState;return e.flowing||(E("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(J,e,t))}(this,e)),e[B]=!1,this},F.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[B]=!0,this},F.prototype.wrap=function(e){let t=!1;e.on("data",(r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())})),e.on("end",(()=>{this.push(null)})),e.on("error",(e=>{j(this,e)})),e.on("close",(()=>{this.destroy()})),e.on("destroy",(()=>{this.destroy()})),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=l(e);for(let t=1;t<r.length;t++){let n=r[t];void 0===this[n]&&"function"==typeof e[n]&&(this[n]=e[n].bind(e))}return this},F.prototype[p]=function(){return Z(this)},F.prototype.iterator=function(e){return void 0!==e&&x(e,"options"),Z(this,e)},a(F.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),a(D.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[B]},set(e){this[B]=!!e}}}),F._fromList=ee,F.from=function(e,t){return U(F,e,t)},F.fromWeb=function(e,t){return ie().newStreamReadableFromReadableStream(e,t)},F.toWeb=function(e,t){return ie().newReadableStreamFromStreamReadable(e,t)},F.wrap=function(e,t){var r,n;return new F({objectMode:null===(r=null!==(n=e.readableObjectMode)&&void 0!==n?n:e.objectMode)||void 0===r||r,...t,destroy(t,r){k.destroyer(e,t),r(t)}}).wrap(e)}})),an=u(((e,t)=>{nt(),ze(),f();var r=ct(),{ArrayPrototypeSlice:n,Error:i,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:s,ObjectDefineProperties:a,ObjectSetPrototypeOf:l,StringPrototypeToLowerCase:u,Symbol:c,SymbolHasInstance:d}=ot();t.exports=L,L.WritableState=x;var{EventEmitter:p}=(jt(),h(Mt)),g=Dt().Stream,{Buffer:y}=(rt(),h(He)),b=dt(),{addAbortSignal:v}=Ft(),{getHighWaterMark:m,getDefaultHighWaterMark:w}=Vt(),{ERR_INVALID_ARG_TYPE:_,ERR_METHOD_NOT_IMPLEMENTED:E,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:k,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:T,ERR_STREAM_NULL_VALUES:I,ERR_STREAM_WRITE_AFTER_END:C,ERR_UNKNOWN_ENCODING:R}=lt().codes,{errorOrDestroy:O}=b;function M(){}l(L.prototype,g.prototype),l(L,g);var P=c("kOnFinished");function x(e,t,r){"boolean"!=typeof r&&(r=t instanceof un()),this.objectMode=!(!e||!e.objectMode),r&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?m(this,e,"writableHighWaterMark",r):w(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!(!e||!1!==e.decodeStrings);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=D.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,B(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[P]=[]}function B(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function L(e){let t=this instanceof un();if(!t&&!o(L,this))return new L(e);this._writableState=new x(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&v(e.signal,this)),g.call(this,e),b.construct(this,(()=>{let e=this._writableState;e.writing||z(this,e),$(this,e)}))}function U(e,t,n,i){let o,s=e._writableState;if("function"==typeof n)i=n,n=s.defaultEncoding;else{if(n){if("buffer"!==n&&!y.isEncoding(n))throw new R(n)}else n=s.defaultEncoding;"function"!=typeof i&&(i=M)}if(null===t)throw new I;if(!s.objectMode)if("string"==typeof t)!1!==s.decodeStrings&&(t=y.from(t,n),n="buffer");else if(t instanceof y)n="buffer";else{if(!g._isUint8Array(t))throw new _("chunk",["string","Buffer","Uint8Array"],t);t=g._uint8ArrayToBuffer(t),n="buffer"}return s.ending?o=new C:s.destroyed&&(o=new A("write")),o?(r.nextTick(i,o),O(e,o,!0),o):(s.pendingcb++,function(e,t,r,n,i){let o=t.objectMode?1:r.length;t.length+=o;let s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:i}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&i!==M&&(t.allNoop=!1)):(t.writelen=o,t.writecb=i,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,s,t,n,i))}function N(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new A("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function j(e,t,r,n){--t.pendingcb,n(r),V(t),O(e,r)}function D(e,t){let n=e._writableState,i=n.sync,o=n.writecb;"function"==typeof o?(n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0,t?(t.stack,n.errored||(n.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?r.nextTick(j,e,n,t,o):j(e,n,t,o)):(n.buffered.length>n.bufferedIndex&&z(e,n),i?null!==n.afterWriteTickInfo&&n.afterWriteTickInfo.cb===o?n.afterWriteTickInfo.count++:(n.afterWriteTickInfo={count:1,cb:o,stream:e,state:n},r.nextTick(F,n.afterWriteTickInfo)):W(e,n,1,o))):O(e,new S)}function F({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,W(e,t,r,n)}function W(e,t,r,n){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&V(t),$(e,t)}function V(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;let{chunk:n,callback:i}=e.buffered[r],o=e.objectMode?1:n.length;e.length-=o,i(null!==(t=e.errored)&&void 0!==t?t:new A("write"))}let r=e[P].splice(0);for(let t=0;t<r.length;t++){var n;r[t](null!==(n=e.errored)&&void 0!==n?n:new A("end"))}B(e)}function z(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:r,bufferedIndex:i,objectMode:o}=t,s=r.length-i;if(!s)return;let a=i;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;let i=t.allNoop?M:e=>{for(let t=a;t<r.length;++t)r[t].callback(e)},o=t.allNoop&&0===a?r:n(r,a);o.allBuffers=t.allBuffers,N(e,t,!0,t.length,o,"",i),B(t)}else{do{let{chunk:n,encoding:i,callback:s}=r[a];r[a++]=null,N(e,t,!1,o?1:n.length,n,i,s)}while(a<r.length&&!t.writing);a===r.length?B(t):a>256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function H(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function q(e,t){!t.prefinished&&!t.finalCalled&&("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let n=!1;function i(i){if(n)O(e,i??S());else if(n=!0,t.pendingcb--,i){let r=t[P].splice(0);for(let e=0;e<r.length;e++)r[e](i);O(e,i,t.sync)}else H(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,r.nextTick(K,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(e){i(e)}t.sync=!1}(e,t)))}function $(e,t,n){H(t)&&(q(e,t),0===t.pendingcb&&(n?(t.pendingcb++,r.nextTick(((e,t)=>{H(t)?K(e,t):t.pendingcb--}),e,t)):H(t)&&(t.pendingcb++,K(e,t))))}function K(e,t){t.pendingcb--,t.finished=!0;let r=t[P].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){let t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}x.prototype.getBuffer=function(){return n(this.buffered,this.bufferedIndex)},s(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),s(L,d,{__proto__:null,value:function(e){return!!o(this,e)||this===L&&(e&&e._writableState instanceof x)}}),L.prototype.pipe=function(){O(this,new k)},L.prototype.write=function(e,t,r){return!0===U(this,e,t,r)},L.prototype.cork=function(){this._writableState.corked++},L.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||z(this,e))},L.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!y.isEncoding(e))throw new R(e);return this._writableState.defaultEncoding=e,this},L.prototype._write=function(e,t,r){if(!this._writev)throw new E("_write()");this._writev([{chunk:e,encoding:t}],r)},L.prototype._writev=null,L.prototype.end=function(e,t,n){let o,s=this._writableState;if("function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e){let r=U(this,e,t);r instanceof i&&(o=r)}return s.corked&&(s.corked=1,this.uncork()),o||(s.errored||s.ending?s.finished?o=new T("end"):s.destroyed&&(o=new A("end")):(s.ending=!0,$(this,s,!0),s.ended=!0)),"function"==typeof n&&(o||s.finished?r.nextTick(n,o):s[P].push(n)),this},a(L.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return!!e&&(!e.destroyed&&!e.ending&&e.needDrain)}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});var G,Q=b.destroy;function Y(){return void 0===G&&(G={}),G}L.prototype.destroy=function(e,t){let n=this._writableState;return!n.destroyed&&(n.bufferedIndex<n.buffered.length||n[P].length)&&r.nextTick(V,n),Q.call(this,e,t),this},L.prototype._undestroy=b.undestroy,L.prototype._destroy=function(e,t){t(e)},L.prototype[p.captureRejectionSymbol]=function(e){this.destroy(e)},L.fromWeb=function(e,t){return Y().newStreamWritableFromWritableStream(e,t)},L.toWeb=function(e){return Y().newWritableStreamFromStreamWritable(e)}})),ln=u(((e,t)=>{nt(),ze(),f();var r=ct(),n=(rt(),h(He)),{isReadable:i,isWritable:o,isIterable:s,isNodeStream:a,isReadableNodeStream:l,isWritableNodeStream:u,isDuplexNodeStream:c}=ht(),d=ft(),{AbortError:p,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:y}}=lt(),{destroyer:b}=dt(),v=un(),m=sn(),{createDeferredPromise:w}=st(),_=on(),E=globalThis.Blob||n.Blob,S=typeof E<"u"?function(e){return e instanceof E}:function(e){return!1},k=globalThis.AbortController||at().AbortController,{FunctionPrototypeCall:A}=ot(),T=class extends v{constructor(e){super(e),!1===e?.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e?.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};function I(e){let t,r,n,s,a,l=e.readable&&"function"!=typeof e.readable.read?m.wrap(e.readable):e.readable,u=e.writable,c=!!i(l),h=!!o(u);function f(e){let t=s;s=null,t?t(e):e&&a.destroy(e)}return a=new T({readableObjectMode:!(null==l||!l.readableObjectMode),writableObjectMode:!(null==u||!u.writableObjectMode),readable:c,writable:h}),h&&(d(u,(e=>{h=!1,e&&b(l,e),f(e)})),a._write=function(e,r,n){u.write(e,r)?n():t=n},a._final=function(e){u.end(),r=e},u.on("drain",(function(){if(t){let e=t;t=null,e()}})),u.on("finish",(function(){if(r){let e=r;r=null,e()}}))),c&&(d(l,(e=>{c=!1,e&&b(l,e),f(e)})),l.on("readable",(function(){if(n){let e=n;n=null,e()}})),l.on("end",(function(){a.push(null)})),a._read=function(){for(;;){let e=l.read();if(null===e)return void(n=a._read);if(!a.push(e))return}}),a._destroy=function(e,i){!e&&null!==s&&(e=new p),n=null,t=null,r=null,null===s?i(e):(s=i,b(u,e),b(l,e))},a}t.exports=function e(t,n){if(c(t))return t;if(l(t))return I({readable:t});if(u(t))return I({writable:t});if(a(t))return I({writable:!1,readable:!1});if("function"==typeof t){let{value:e,write:i,final:o,destroy:a}=function(e){let{promise:t,resolve:n}=w(),i=new k,o=i.signal;return{value:e(async function*(){for(;;){let e=t;t=null;let{chunk:i,done:s,cb:a}=await e;if(r.nextTick(a),s)return;if(o.aborted)throw new p(void 0,{cause:o.reason});({promise:t,resolve:n}=w()),yield i}}(),{signal:o}),write(e,t,r){let i=n;n=null,i({chunk:e,done:!1,cb:r})},final(e){let t=n;n=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(s(e))return _(T,e,{objectMode:!0,write:i,final:o,destroy:a});let l=e?.then;if("function"==typeof l){let t,n=A(l,e,(e=>{if(null!=e)throw new y("nully","body",e)}),(e=>{b(t,e)}));return t=new T({objectMode:!0,readable:!1,write:i,final(e){o((async()=>{try{await n,r.nextTick(e,null)}catch(t){r.nextTick(e,t)}}))},destroy:a})}throw new y("Iterable, AsyncIterable or AsyncFunction",n,e)}if(S(t))return e(t.arrayBuffer());if(s(t))return _(T,t,{objectMode:!0,writable:!1});if("object"==typeof t?.writable||"object"==typeof t?.readable){return I({readable:null!=t&&t.readable?l(t?.readable)?t?.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(t?.writable)?t?.writable:e(t.writable):void 0})}let i=t?.then;if("function"==typeof i){let e;return A(i,t,(t=>{null!=t&&e.push(t),e.push(null)}),(t=>{b(e,t)})),e=new T({objectMode:!0,writable:!1,read(){}})}throw new g(n,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}})),un=u(((e,t)=>{nt(),ze(),f();var{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:n,ObjectKeys:i,ObjectSetPrototypeOf:o}=ot();t.exports=c;var s,a,l=sn(),u=an();o(c.prototype,l.prototype),o(c,l);{let e=i(u.prototype);for(let t=0;t<e.length;t++){let r=e[t];c.prototype[r]||(c.prototype[r]=u.prototype[r])}}function c(e){if(!(this instanceof c))return new c(e);l.call(this,e),u.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}function h(){return void 0===s&&(s={}),s}r(c.prototype,{writable:{__proto__:null,...n(u.prototype,"writable")},writableHighWaterMark:{__proto__:null,...n(u.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...n(u.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...n(u.prototype,"writableBuffer")},writableLength:{__proto__:null,...n(u.prototype,"writableLength")},writableFinished:{__proto__:null,...n(u.prototype,"writableFinished")},writableCorked:{__proto__:null,...n(u.prototype,"writableCorked")},writableEnded:{__proto__:null,...n(u.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...n(u.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),c.fromWeb=function(e,t){return h().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return h().newReadableWritablePairFromDuplex(e)},c.from=function(e){return a||(a=ln()),a(e,"body")}})),cn=u(((e,t)=>{nt(),ze(),f();var{ObjectSetPrototypeOf:r,Symbol:n}=ot();t.exports=l;var{ERR_METHOD_NOT_IMPLEMENTED:i}=lt().codes,o=un(),{getHighWaterMark:s}=Vt();r(l.prototype,o.prototype),r(l,o);var a=n("kCallback");function l(e){if(!(this instanceof l))return new l(e);let t=e?s(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),o.call(this,e),this._readableState.sync=!1,this[a]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",c)}function u(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush(((t,r)=>{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())}))}function c(){this._final!==u&&u.call(this)}l.prototype._final=u,l.prototype._transform=function(e,t,r){throw new i("_transform()")},l.prototype._write=function(e,t,r){let n=this._readableState,i=this._writableState,o=n.length;this._transform(e,t,((e,t)=>{e?r(e):(null!=t&&this.push(t),i.ended||o===n.length||n.length<n.highWaterMark?r():this[a]=r)}))},l.prototype._read=function(){if(this[a]){let e=this[a];this[a]=null,e()}}})),hn=u(((e,t)=>{nt(),ze(),f();var{ObjectSetPrototypeOf:r}=ot();t.exports=i;var n=cn();function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(i.prototype,n.prototype),r(i,n),i.prototype._transform=function(e,t,r){r(null,e)}})),fn=u(((e,t)=>{nt(),ze(),f();var r,n,i=ct(),{ArrayIsArray:o,Promise:s,SymbolAsyncIterator:a}=ot(),l=ft(),{once:u}=st(),c=dt(),h=un(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:y,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:v},AbortError:m}=lt(),{validateFunction:w,validateAbortSignal:_}=ut(),{isIterable:E,isReadable:S,isReadableNodeStream:k,isNodeStream:A,isTransformStream:T,isWebStream:I,isReadableStream:C,isReadableEnded:R}=ht(),O=globalThis.AbortController||at().AbortController;function M(e,t,r){let n=!1;return e.on("close",(()=>{n=!0})),{destroy:t=>{n||(n=!0,c.destroyer(e,t||new b("pipe")))},cleanup:l(e,{readable:t,writable:r},(e=>{n=!e}))}}function P(e){if(E(e))return e;if(k(e))return async function*(e){n||(n=sn()),yield*n.prototype[a].call(e)}(e);throw new p("val",["Readable","Iterable","AsyncIterable"],e)}async function x(e,t,r,{end:n}){let i,o=null,a=e=>{if(e&&(i=e),o){let e=o;o=null,e()}},u=()=>new s(((e,t)=>{i?t(i):o=()=>{i?t(i):e()}}));t.on("drain",a);let c=l(t,{readable:!1},a);try{t.writableNeedDrain&&await u();for await(let r of e)t.write(r)||await u();n&&t.end(),await u(),r()}catch(e){r(i!==e?d(i,e):e)}finally{c(),t.off("drain",a)}}async function B(e,t,r,{end:n}){T(t)&&(t=t.writable);let i=t.getWriter();try{for await(let t of e)await i.ready,i.write(t).catch((()=>{}));await i.ready,n&&await i.close(),r()}catch(e){try{await i.abort(e),r(e)}catch(e){r(e)}}}function L(e,t,n){if(1===e.length&&o(e[0])&&(e=e[0]),e.length<2)throw new y("streams");let s=new O,a=s.signal,l=n?.signal,u=[];function c(){L(new m)}_(l,"options.signal"),l?.addEventListener("abort",c);let f,d,b,v=[],w=0;function R(e){L(e,0==--w)}function L(e,r){if(e&&(!f||"ERR_STREAM_PREMATURE_CLOSE"===f.code)&&(f=e),f||r){for(;v.length;)v.shift()(f);l?.removeEventListener("abort",c),s.abort(),r&&(f||u.forEach((e=>e())),i.nextTick(t,f,d))}}for(let t=0;t<e.length;t++){let o=e[t],s=t<e.length-1,l=t>0,c=s||!1!==n?.end,f=t===e.length-1;if(A(o)){let e=function(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&R(e)};if(c){let{destroy:e,cleanup:t}=M(o,s,l);v.push(e),S(o)&&f&&u.push(t)}o.on("error",e),S(o)&&f&&u.push((()=>{o.removeListener("error",e)}))}if(0===t)if("function"==typeof o){if(b=o({signal:a}),!E(b))throw new g("Iterable, AsyncIterable or Stream","source",b)}else b=E(o)||k(o)||T(o)?o:h.from(o);else if("function"==typeof o){var N;if(T(b))b=P(null===(N=b)||void 0===N?void 0:N.readable);else b=P(b);if(b=o(b,{signal:a}),s){if(!E(b,!0))throw new g("AsyncIterable",`transform[${t-1}]`,b)}else{var j;r||(r=hn());let e=new r({objectMode:!0}),t=null===(j=b)||void 0===j?void 0:j.then;if("function"==typeof t)w++,t.call(b,(t=>{d=t,null!=t&&e.write(t),c&&e.end(),i.nextTick(R)}),(t=>{e.destroy(t),i.nextTick(R,t)}));else if(E(b,!0))w++,x(b,e,R,{end:c});else{if(!C(b)&&!T(b))throw new g("AsyncIterable or Promise","destination",b);{let t=b.readable||b;w++,x(t,e,R,{end:c})}}b=e;let{destroy:n,cleanup:o}=M(b,!1,!0);v.push(n),f&&u.push(o)}}else if(A(o)){if(k(b)){w+=2;let e=U(b,o,R,{end:c});S(o)&&f&&u.push(e)}else if(T(b)||C(b)){let e=b.readable||b;w++,x(e,o,R,{end:c})}else{if(!E(b))throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);w++,x(b,o,R,{end:c})}b=o}else if(I(o)){if(k(b))w++,B(P(b),o,R,{end:c});else if(C(b)||E(b))w++,B(b,o,R,{end:c});else{if(!T(b))throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);w++,B(b.readable,o,R,{end:c})}b=o}else b=h.from(o)}return(null!=a&&a.aborted||null!=l&&l.aborted)&&i.nextTick(c),b}function U(e,t,r,{end:n}){let o=!1;if(t.on("close",(()=>{o||r(new v)})),e.pipe(t,{end:!1}),n){let r=function(){o=!0,t.end()};R(e)?i.nextTick(r):e.once("end",r)}else r();return l(e,{readable:!0,writable:!1},(t=>{let n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)})),l(t,{readable:!1,writable:!0},r)}t.exports={pipelineImpl:L,pipeline:function(...e){return L(e,u(function(e){return w(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}})),dn=u(((e,t)=>{nt(),ze(),f();var{pipeline:r}=fn(),n=un(),{destroyer:i}=dt(),{isNodeStream:o,isReadable:s,isWritable:a,isWebStream:l,isTransformStream:u,isWritableStream:c,isReadableStream:h}=ht(),{AbortError:d,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:g}}=lt(),y=ft();t.exports=function(...e){if(0===e.length)throw new g("streams");if(1===e.length)return n.from(e[0]);let t,f,b,v,m,w=[...e];if("function"==typeof e[0]&&(e[0]=n.from(e[0])),"function"==typeof e[e.length-1]){let t=e.length-1;e[t]=n.from(e[t])}for(let t=0;t<e.length;++t)if(o(e[t])||l(e[t])){if(t<e.length-1&&!(s(e[t])||h(e[t])||u(e[t])))throw new p(`streams[${t}]`,w[t],"must be readable");if(t>0&&!(a(e[t])||c(e[t])||u(e[t])))throw new p(`streams[${t}]`,w[t],"must be writable")}let _=e[0],E=r(e,(function(e){let t=v;v=null,t?t(e):e?m.destroy(e):!k&&!S&&m.destroy()})),S=!!(a(_)||c(_)||u(_)),k=!!(s(E)||h(E)||u(E));if(m=new n({writableObjectMode:!(null==_||!_.writableObjectMode),readableObjectMode:!(null==E||!E.writableObjectMode),writable:S,readable:k}),S){if(o(_))m._write=function(e,r,n){_.write(e,r)?n():t=n},m._final=function(e){_.end(),f=e},_.on("drain",(function(){if(t){let e=t;t=null,e()}}));else if(l(_)){let e=(u(_)?_.writable:_).getWriter();m._write=async function(t,r,n){try{await e.ready,e.write(t).catch((()=>{})),n()}catch(e){n(e)}},m._final=async function(t){try{await e.ready,e.close().catch((()=>{})),f=t}catch(e){t(e)}}}let e=u(E)?E.readable:E;y(e,(()=>{if(f){let e=f;f=null,e()}}))}if(k)if(o(E))E.on("readable",(function(){if(b){let e=b;b=null,e()}})),E.on("end",(function(){m.push(null)})),m._read=function(){for(;;){let e=E.read();if(null===e)return void(b=m._read);if(!m.push(e))return}};else if(l(E)){let e=(u(E)?E.readable:E).getReader();m._read=async function(){for(;;)try{let{value:t,done:r}=await e.read();if(!m.push(t))return;if(r)return void m.push(null)}catch{return}}}return m._destroy=function(e,r){!e&&null!==v&&(e=new d),b=null,t=null,f=null,null===v?r(e):(v=r,o(E)&&i(E,e))},m}})),pn=u(((e,t)=>{nt(),ze(),f();var r=globalThis.AbortController||at().AbortController,{codes:{ERR_INVALID_ARG_VALUE:n,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:s},AbortError:a}=lt(),{validateAbortSignal:l,validateInteger:u,validateObject:c}=ut(),h=ot().Symbol("kWeak"),{finished:d}=ft(),p=dn(),{addAbortSignalNoValidate:g}=Ft(),{isWritable:y,isNodeStream:b}=ht(),{ArrayPrototypePush:v,MathFloor:m,Number:w,NumberIsNaN:_,Promise:E,PromiseReject:S,PromisePrototypeThen:k,Symbol:A}=ot(),T=A("kEmpty"),I=A("kEof");function C(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);null!=t&&c(t,"options"),null!=t?.signal&&l(t.signal,"options.signal");let n=1;return null!=t?.concurrency&&(n=m(t.concurrency)),u(n,"concurrency",1),async function*(){var i,o;let s=new r,l=this,u=[],c=s.signal,h={signal:c},f=()=>s.abort();null!=t&&null!==(i=t.signal)&&void 0!==i&&i.aborted&&f(),null==t||null===(o=t.signal)||void 0===o||o.addEventListener("abort",f);let d,p,g=!1;function y(){g=!0}!async function(){try{for await(let t of l){var r;if(g)return;if(c.aborted)throw new a;try{t=e(t,h)}catch(e){t=S(e)}t!==T&&("function"==typeof(null===(r=t)||void 0===r?void 0:r.catch)&&t.catch(y),u.push(t),d&&(d(),d=null),!g&&u.length&&u.length>=n&&await new E((e=>{p=e})))}u.push(I)}catch(e){let t=S(e);k(t,void 0,y),u.push(t)}finally{var i;g=!0,d&&(d(),d=null),null==t||null===(i=t.signal)||void 0===i||i.removeEventListener("abort",f)}}();try{for(;;){for(;u.length>0;){let e=await u[0];if(e===I)return;if(c.aborted)throw new a;e!==T&&(yield e),u.shift(),p&&(p(),p=null)}await new E((e=>{d=e}))}}finally{s.abort(),g=!0,p&&(p(),p=null)}}.call(this)}async function R(e,t=void 0){for await(let r of O.call(this,e,t))return!0;return!1}function O(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return C.call(this,(async function(t,r){return await e(t,r)?t:T}),t)}var M=class extends o{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};function P(e){if(e=w(e),_(e))return 0;if(e<0)throw new s("number",">= 0",e);return e}t.exports.streamReturningOperators={asIndexedPairs:function(e=void 0){return null!=e&&c(e,"options"),null!=e?.signal&&l(e.signal,"options.signal"),async function*(){let t=0;for await(let n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new a({cause:e.signal.reason});yield[t++,n]}}.call(this)},drop:function(e,t=void 0){return null!=t&&c(t,"options"),null!=t?.signal&&l(t.signal,"options.signal"),e=P(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new a;for await(let r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new a;e--<=0&&(yield r)}}.call(this)},filter:O,flatMap:function(e,t){let r=C.call(this,e,t);return async function*(){for await(let e of r)yield*e}.call(this)},map:C,take:function(e,t=void 0){return null!=t&&c(t,"options"),null!=t?.signal&&l(t.signal,"options.signal"),e=P(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new a;for await(let r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new a;if(!(e-- >0))return;yield r}}.call(this)},compose:function(e,t){if(null!=t&&c(t,"options"),null!=t?.signal&&l(t.signal,"options.signal"),b(e)&&!y(e))throw new n("stream",e,"must be writable");let r=p(this,e);return null!=t&&t.signal&&g(t.signal,r),r}},t.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return!await R.call(this,(async(...t)=>!await e(...t)),t)},forEach:async function(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);for await(let r of C.call(this,(async function(t,r){return await e(t,r),T}),t));},reduce:async function(e,t,n){var o;if("function"!=typeof e)throw new i("reducer",["Function","AsyncFunction"],e);null!=n&&c(n,"options"),null!=n?.signal&&l(n.signal,"options.signal");let s=arguments.length>1;if(null!=n&&null!==(o=n.signal)&&void 0!==o&&o.aborted){let e=new a(void 0,{cause:n.signal.reason});throw this.once("error",(()=>{})),await d(this.destroy(e)),e}let u=new r,f=u.signal;if(null!=n&&n.signal){let e={once:!0,[h]:this};n.signal.addEventListener("abort",(()=>u.abort()),e)}let p=!1;try{for await(let r of this){var g;if(p=!0,null!=n&&null!==(g=n.signal)&&void 0!==g&&g.aborted)throw new a;s?t=await e(t,r,{signal:f}):(t=r,s=!0)}if(!p&&!s)throw new M}finally{u.abort()}return t},toArray:async function(e){null!=e&&c(e,"options"),null!=e?.signal&&l(e.signal,"options.signal");let t=[];for await(let n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new a(void 0,{cause:e.signal.reason});v(t,n)}return t},some:R,find:async function(e,t){for await(let r of O.call(this,e,t))return r}}})),gn=u(((e,t)=>{nt(),ze(),f();var{ArrayPrototypePop:r,Promise:n}=ot(),{isIterable:i,isNodeStream:o,isWebStream:s}=ht(),{pipelineImpl:a}=fn(),{finished:l}=ft();yn(),t.exports={finished:l,pipeline:function(...e){return new n(((t,n)=>{let l,u,c=e[e.length-1];if(c&&"object"==typeof c&&!o(c)&&!i(c)&&!s(c)){let t=r(e);l=t.signal,u=t.end}a(e,((e,r)=>{e?n(e):t(r)}),{signal:l,end:u})}))}}})),yn=u(((e,t)=>{nt(),ze(),f();var{Buffer:r}=(rt(),h(He)),{ObjectDefineProperty:n,ObjectKeys:i,ReflectApply:o}=ot(),{promisify:{custom:s}}=st(),{streamReturningOperators:a,promiseReturningOperators:l}=pn(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=lt(),c=dn(),{pipeline:d}=fn(),{destroyer:p}=dt(),g=ft(),y=gn(),b=ht(),v=t.exports=Dt().Stream;v.isDisturbed=b.isDisturbed,v.isErrored=b.isErrored,v.isReadable=b.isReadable,v.Readable=sn();for(let e of i(a)){let t=function(...e){if(new.target)throw u();return v.Readable.from(o(r,this,e))};t;let r=a[e];n(t,"name",{__proto__:null,value:r.name}),n(t,"length",{__proto__:null,value:r.length}),n(v.Readable.prototype,e,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}for(let e of i(l)){let t=function(...e){if(new.target)throw u();return o(r,this,e)};t;let r=l[e];n(t,"name",{__proto__:null,value:r.name}),n(t,"length",{__proto__:null,value:r.length}),n(v.Readable.prototype,e,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}v.Writable=an(),v.Duplex=un(),v.Transform=cn(),v.PassThrough=hn(),v.pipeline=d;var{addAbortSignal:m}=Ft();v.addAbortSignal=m,v.finished=g,v.destroy=p,v.compose=c,n(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>y}),n(d,s,{__proto__:null,enumerable:!0,get:()=>y.pipeline}),n(g,s,{__proto__:null,enumerable:!0,get:()=>y.finished}),v.Stream=v,v._isUint8Array=function(e){return e instanceof Uint8Array},v._uint8ArrayToBuffer=function(e){return r.from(e.buffer,e.byteOffset,e.byteLength)}})),bn=u(((e,t)=>{nt(),ze(),f();var r=yn(),n=gn(),i=r.Readable.destroy;t.exports=r.Readable,t.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer,t.exports._isUint8Array=r._isUint8Array,t.exports.isDisturbed=r.isDisturbed,t.exports.isErrored=r.isErrored,t.exports.isReadable=r.isReadable,t.exports.Readable=r.Readable,t.exports.Writable=r.Writable,t.exports.Duplex=r.Duplex,t.exports.Transform=r.Transform,t.exports.PassThrough=r.PassThrough,t.exports.addAbortSignal=r.addAbortSignal,t.exports.finished=r.finished,t.exports.destroy=r.destroy,t.exports.destroy=i,t.exports.pipeline=r.pipeline,t.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get:()=>n}),t.exports.Stream=r.Stream,t.exports.default=t.exports})),vn=u(((e,t)=>{nt(),ze(),f(),"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),mn=u(((e,t)=>{nt(),ze(),f();var{Buffer:r}=(rt(),h(He)),n=Symbol.for("BufferList");function i(e){if(!(this instanceof i))return new i(e);i._init.call(this,e)}i._init=function(e){Object.defineProperty(this,n,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},i.prototype._new=function(e){return new i(e)},i.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let r=0;r<this._bufs.length;r++){let n=t+this._bufs[r].length;if(e<n||r===this._bufs.length-1)return[r,e-t];t=n}},i.prototype._reverseOffset=function(e){let t=e[0],r=e[1];for(let e=0;e<t;e++)r+=this._bufs[e].length;return r},i.prototype.get=function(e){if(e>this.length||e<0)return;let t=this._offset(e);return this._bufs[t[0]][t[1]]},i.prototype.slice=function(e,t){return"number"==typeof e&&e<0&&(e+=this.length),"number"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},i.prototype.copy=function(e,t,n,i){if(("number"!=typeof n||n<0)&&(n=0),("number"!=typeof i||i>this.length)&&(i=this.length),n>=this.length||i<=0)return e||r.alloc(0);let o=!!e,s=this._offset(n),a=i-n,l=a,u=o&&t||0,c=s[1];if(0===n&&i===this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:r.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,u),u+=this._bufs[t].length;return e}if(l<=this._bufs[s[0]].length-c)return o?this._bufs[s[0]].copy(e,t,c,c+l):this._bufs[s[0]].slice(c,c+l);o||(e=r.allocUnsafe(a));for(let t=s[0];t<this._bufs.length;t++){let r=this._bufs[t].length-c;if(!(l>r)){this._bufs[t].copy(e,u,c,c+l),u+=r;break}this._bufs[t].copy(e,u,c),u+=r,l-=r,c&&(c=0)}return e.length>u?e.slice(0,u):e},i.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();let r=this._offset(e),n=this._offset(t),i=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,n[1]),0!==r[1]&&(i[0]=i[0].slice(r[1])),this._new(i)},i.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)},i.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},i.prototype.duplicate=function(){let e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},i.prototype.append=function(e){if(null==e)return this;if(e.buffer)this._appendBuffer(r.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let t=0;t<e.length;t++)this.append(e[t]);else if(this._isBufferList(e))for(let t=0;t<e._bufs.length;t++)this.append(e._bufs[t]);else"number"==typeof e&&(e=e.toString()),this._appendBuffer(r.from(e));return this},i.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},i.prototype.indexOf=function(e,t,n){if(void 0===n&&"string"==typeof t&&(n=t,t=void 0),"function"==typeof e||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof e?e=r.from([e]):"string"==typeof e?e=r.from(e,n):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=r.from(e.buffer,e.byteOffset,e.byteLength):r.isBuffer(e)||(e=r.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;let i=this._offset(t),o=i[0],s=i[1];for(;o<this._bufs.length;o++){let t=this._bufs[o];for(;s<t.length;)if(t.length-s>=e.length){let r=t.indexOf(e,s);if(-1!==r)return this._reverseOffset([o,r]);s=t.length-e.length+1}else{let t=this._reverseOffset([o,s]);if(this._match(t,e))return t;s++}s=0}return-1},i.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0},function(){let e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let t in e)!function(t){i.prototype[t]=null===e[t]?function(e,r){return this.slice(e,e+r)[t](0,r)}:function(r=0){return this.slice(r,r+e[t])[t](0)}}(t)}(),i.prototype._isBufferList=function(e){return e instanceof i||i.isBufferList(e)},i.isBufferList=function(e){return null!=e&&e[n]},t.exports=i})),wn=u(((e,t)=>{nt(),ze(),f();var r=bn().Duplex,n=vn(),i=mn();function o(e){if(!(this instanceof o))return new o(e);if("function"==typeof e){this._callback=e;let t=function(e){this._callback&&(this._callback(e),this._callback=null)}.bind(this);this.on("pipe",(function(e){e.on("error",t)})),this.on("unpipe",(function(e){e.removeListener("error",t)})),e=null}i._init.call(this,e),r.call(this)}n(o,r),Object.assign(o.prototype,i.prototype),o.prototype._new=function(e){return new o(e)},o.prototype._write=function(e,t,r){this._appendBuffer(e),"function"==typeof r&&r()},o.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)},o.prototype.end=function(e){r.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},o.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},o.prototype._isBufferList=function(e){return e instanceof o||e instanceof i||o.isBufferList(e)},o.isBufferList=i.isBufferList,t.exports=o,t.exports.BufferListStream=o,t.exports.BufferList=i})),_n=u(((e,t)=>{nt(),ze(),f();t.exports=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}})),En=u(((e,t)=>{nt(),ze(),f();var r=t.exports,{Buffer:n}=(rt(),h(He));r.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},r.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},r.requiredHeaderFlagsErrors={};for(let e in r.requiredHeaderFlags){let t=r.requiredHeaderFlags[e];r.requiredHeaderFlagsErrors[e]="Invalid header flag bits, must be 0x"+t.toString(16)+" for "+r.types[e]+" packet"}r.codes={};for(let e in r.types){let t=r.types[e];r.codes[t]=e}r.CMD_SHIFT=4,r.CMD_MASK=240,r.DUP_MASK=8,r.QOS_MASK=3,r.QOS_SHIFT=1,r.RETAIN_MASK=1,r.VARBYTEINT_MASK=127,r.VARBYTEINT_FIN_MASK=128,r.VARBYTEINT_MAX=268435455,r.SESSIONPRESENT_MASK=1,r.SESSIONPRESENT_HEADER=n.from([r.SESSIONPRESENT_MASK]),r.CONNACK_HEADER=n.from([r.codes.connack<<r.CMD_SHIFT]),r.USERNAME_MASK=128,r.PASSWORD_MASK=64,r.WILL_RETAIN_MASK=32,r.WILL_QOS_MASK=24,r.WILL_QOS_SHIFT=3,r.WILL_FLAG_MASK=4,r.CLEAN_SESSION_MASK=2,r.CONNECT_HEADER=n.from([r.codes.connect<<r.CMD_SHIFT]),r.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},r.propertiesCodes={};for(let e in r.properties){let t=r.properties[e];r.propertiesCodes[t]=e}function i(e){return[0,1,2].map((t=>[0,1].map((i=>[0,1].map((o=>{let s=n.alloc(1);return s.writeUInt8(r.codes[e]<<r.CMD_SHIFT|(i?r.DUP_MASK:0)|t<<r.QOS_SHIFT|o,0,!0),s}))))))}r.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"},r.PUBLISH_HEADER=i("publish"),r.SUBSCRIBE_HEADER=i("subscribe"),r.SUBSCRIBE_OPTIONS_QOS_MASK=3,r.SUBSCRIBE_OPTIONS_NL_MASK=1,r.SUBSCRIBE_OPTIONS_NL_SHIFT=2,r.SUBSCRIBE_OPTIONS_RAP_MASK=1,r.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,r.SUBSCRIBE_OPTIONS_RH_MASK=3,r.SUBSCRIBE_OPTIONS_RH_SHIFT=4,r.SUBSCRIBE_OPTIONS_RH=[0,16,32],r.SUBSCRIBE_OPTIONS_NL=4,r.SUBSCRIBE_OPTIONS_RAP=8,r.SUBSCRIBE_OPTIONS_QOS=[0,1,2],r.UNSUBSCRIBE_HEADER=i("unsubscribe"),r.ACKS={unsuback:i("unsuback"),puback:i("puback"),pubcomp:i("pubcomp"),pubrel:i("pubrel"),pubrec:i("pubrec")},r.SUBACK_HEADER=n.from([r.codes.suback<<r.CMD_SHIFT]),r.VERSION3=n.from([3]),r.VERSION4=n.from([4]),r.VERSION5=n.from([5]),r.VERSION131=n.from([131]),r.VERSION132=n.from([132]),r.QOS=[0,1,2].map((e=>n.from([e]))),r.EMPTY={pingreq:n.from([r.codes.pingreq<<4,0]),pingresp:n.from([r.codes.pingresp<<4,0]),disconnect:n.from([r.codes.disconnect<<4,0])},r.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},r.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},r.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},r.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},r.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},r.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}})),Sn=u(((e,t)=>{nt(),ze(),f();var r=1e3,n=6e4,i=60*n,o=24*i,s=7*o,a=365.25*o;function l(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}t.exports=function(e,t){t=t||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var l=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*a;case"weeks":case"week":case"w":return l*s;case"days":case"day":case"d":return l*o;case"hours":case"hour":case"hrs":case"hr":case"h":return l*i;case"minutes":case"minute":case"mins":case"min":case"m":return l*n;case"seconds":case"second":case"secs":case"sec":case"s":return l*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}}}(e);if("number"===u&&isFinite(e))return t.long?function(e){var t=Math.abs(e);return t>=o?l(e,t,o,"day"):t>=i?l(e,t,i,"hour"):t>=n?l(e,t,n,"minute"):t>=r?l(e,t,r,"second"):e+" ms"}(e):function(e){var t=Math.abs(e);return t>=o?Math.round(e/o)+"d":t>=i?Math.round(e/i)+"h":t>=n?Math.round(e/n)+"m":t>=r?Math.round(e/r)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}})),kn=u(((e,t)=>{nt(),ze(),f(),t.exports=function(e){function t(e){let n,i,o,s=null;function a(...e){if(!a.enabled)return;let r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;let o=t.formatters[i];if("function"==typeof o){let t=e[s];n=o.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){let n=t(this.namespace+(typeof r>"u"?":":r)+e);return n.log=this.log,n}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){let e=[...t.names.map(n),...t.skips.map(n).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];let r,n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=Sn(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}})),An=u(((e,t)=>{nt(),ze(),f(),e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch{}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch{}return!t&&typeof d<"u"&&"env"in d&&(t=d.env.DEBUG),t},e.useColors=function(){return!(!(typeof window<"u"&&window.process)||"renderer"!==window.process.type&&!window.process.__nwjs)||!(typeof n<"u"&&n.userAgent&&n.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&(typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof n<"u"&&n.userAgent&&n.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof n<"u"&&n.userAgent&&n.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch{}}(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=kn()(e);var{formatters:r}=t.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}})),Tn=u(((e,t)=>{nt(),ze(),f();var r=wn(),{EventEmitter:n}=(jt(),h(Mt)),i=_n(),o=En(),s=An()("mqtt-packet:parser");t.exports=class e extends n{constructor(){super(),this.parser=this.constructor.parser}static parser(t){return this instanceof e?(this.settings=t||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new e).parser(t)}_resetState(){s("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new i,this.error=null,this._list=r(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),s("parse: current state: %s",this._states[this._stateCounter]);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,s("parse: state complete. _stateCounter is now: %d",this._stateCounter),s("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return s("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let e=this._list.readUInt8(0),t=e>>o.CMD_SHIFT;this.packet.cmd=o.types[t];let r=15&e,n=o.requiredHeaderFlags[t];return null!=n&&r!==n?this._emitError(new Error(o.requiredHeaderFlagsErrors[t])):(this.packet.retain=!!(e&o.RETAIN_MASK),this.packet.qos=e>>o.QOS_SHIFT&o.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=!!(e&o.DUP_MASK),s("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),s("_parseLength %d",e.value),!!e}_parsePayload(){s("_parsePayload: payload %O",this._list);let e=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}e=!0}return s("_parsePayload complete result: %s",e),e}_parseConnect(){s("_parseConnect");let e,t,r,n,i={},a=this.packet,l=this._parseString();if(null===l)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==l&&"MQIsdp"!==l)return this._emitError(new Error("Invalid protocolId"));if(a.protocolId=l,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(a.protocolVersion=this._list.readUInt8(this._pos),a.protocolVersion>=128&&(a.bridgeMode=!0,a.protocolVersion=a.protocolVersion-128),3!==a.protocolVersion&&4!==a.protocolVersion&&5!==a.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(1&this._list.readUInt8(this._pos))return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));i.username=this._list.readUInt8(this._pos)&o.USERNAME_MASK,i.password=this._list.readUInt8(this._pos)&o.PASSWORD_MASK,i.will=this._list.readUInt8(this._pos)&o.WILL_FLAG_MASK;let u=!!(this._list.readUInt8(this._pos)&o.WILL_RETAIN_MASK),c=(this._list.readUInt8(this._pos)&o.WILL_QOS_MASK)>>o.WILL_QOS_SHIFT;if(i.will)a.will={},a.will.retain=u,a.will.qos=c;else{if(u)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(c)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(a.clean=!!(this._list.readUInt8(this._pos)&o.CLEAN_SESSION_MASK),this._pos++,a.keepalive=this._parseNum(),-1===a.keepalive)return this._emitError(new Error("Packet too short"));if(5===a.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(a.properties=e)}let h=this._parseString();if(null===h)return this._emitError(new Error("Packet too short"));if(a.clientId=h,s("_parseConnect: packet.clientId: %s",a.clientId),i.will){if(5===a.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(a.will.properties=e)}if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse will topic"));if(a.will.topic=e,s("_parseConnect: packet.will.topic: %s",a.will.topic),t=this._parseBuffer(),null===t)return this._emitError(new Error("Cannot parse will payload"));a.will.payload=t,s("_parseConnect: packet.will.paylaod: %s",a.will.payload)}if(i.username){if(n=this._parseString(),null===n)return this._emitError(new Error("Cannot parse username"));a.username=n,s("_parseConnect: packet.username: %s",a.username)}if(i.password){if(r=this._parseBuffer(),null===r)return this._emitError(new Error("Cannot parse password"));a.password=r}return this.settings=a,s("_parseConnect: complete"),a}_parseConnack(){s("_parseConnack");let e=this.packet;if(this._list.length<1)return null;let t=this._list.readUInt8(this._pos++);if(t>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(e.sessionPresent=!!(t&o.SESSIONPRESENT_MASK),5===this.settings.protocolVersion)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else{if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++)}if(-1===e.returnCode||-1===e.reasonCode)return this._emitError(new Error("Cannot parse return code"));if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}s("_parseConnack: complete")}_parsePublish(){s("_parsePublish");let e=this.packet;if(e.topic=this._parseString(),null===e.topic)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),s("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){s("_parseSubscribe");let e,t,r,n,i,a,l,u=this.packet;if(u.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(u.properties=e)}if(u.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<u.length;){if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=u.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(t=this._parseByte(),5===this.settings.protocolVersion){if(192&t)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(252&t)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(r=t&o.SUBSCRIBE_OPTIONS_QOS_MASK,r>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(a=!!(t>>o.SUBSCRIBE_OPTIONS_NL_SHIFT&o.SUBSCRIBE_OPTIONS_NL_MASK),i=!!(t>>o.SUBSCRIBE_OPTIONS_RAP_SHIFT&o.SUBSCRIBE_OPTIONS_RAP_MASK),n=t>>o.SUBSCRIBE_OPTIONS_RH_SHIFT&o.SUBSCRIBE_OPTIONS_RH_MASK,n>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));l={topic:e,qos:r},5===this.settings.protocolVersion?(l.nl=a,l.rap=i,l.rh=n):this.settings.bridgeMode&&(l.rh=0,l.rap=!0,l.nl=!0),s("_parseSubscribe: push subscription `%s` to subscription",l),u.subscriptions.push(l)}}}_parseSuback(){s("_parseSuback");let e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let e=this._list.readUInt8(this._pos++);if(5===this.settings.protocolVersion){if(!o.MQTT5_SUBACK_CODES[e])return this._emitError(new Error("Invalid suback code"))}else if(e>2&&128!==e)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(e)}}}_parseUnsubscribe(){s("_parseUnsubscribe");let e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<e.length;){let t=this._parseString();if(null===t)return this._emitError(new Error("Cannot parse topic"));s("_parseUnsubscribe: push topic `%s` to unsubscriptions",t),e.unsubscriptions.push(t)}}}_parseUnsuback(){s("_parseUnsuback");let e=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((3===this.settings.protocolVersion||4===this.settings.protocolVersion)&&2!==e.length)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(e.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(5===this.settings.protocolVersion){let t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;){let e=this._list.readUInt8(this._pos++);if(!o.MQTT5_UNSUBACK_CODES[e])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(e)}}}_parseConfirmation(){s("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let e=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion){if(e.length>2){switch(e.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!o.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!o.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"))}s("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)}else e.reasonCode=0;if(e.length>3){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}}return!0}_parseDisconnect(){let e=this.packet;if(s("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?(e.reasonCode=this._parseByte(),o.MQTT5_DISCONNECT_CODES[e.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):e.reasonCode=0;let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return s("_parseDisconnect result: true"),!0}_parseAuth(){s("_parseAuth");let e=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(e.reasonCode=this._parseByte(),!o.MQTT5_AUTH_CODES[e.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),s("_parseAuth: result: true"),!0}_parseMessageId(){let e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(s("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){let t=this._parseNum(),r=t+this._pos;if(-1===t||r>this._list.length||r>this.packet.length)return null;let n=this._list.toString("utf8",this._pos,r);return this._pos+=t,s("_parseString: result: %s",n),n}_parseStringPair(){return s("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;let r=this._list.slice(this._pos,t);return this._pos+=e,s("_parseBuffer: result: %o",r),r}_parseNum(){if(this._list.length-this._pos<2)return-1;let e=this._list.readUInt16BE(this._pos);return this._pos+=2,s("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let e=this._list.readUInt32BE(this._pos);return this._pos+=4,s("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){s("_parseVarByteNum");let t,r=0,n=1,i=0,a=!1,l=this._pos?this._pos:0;for(;r<4&&l+r<this._list.length;){if(t=this._list.readUInt8(l+r++),i+=n*(t&o.VARBYTEINT_MASK),n*=128,!(t&o.VARBYTEINT_FIN_MASK)){a=!0;break}if(this._list.length<=r)break}return!a&&4===r&&this._list.length>=r&&this._emitError(new Error("Invalid variable byte integer")),l&&(this._pos+=r),a=!!a&&(e?{bytes:r,value:i}:i),s("_parseVarByteNum: result: %o",a),a}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),s("_parseByte: result: %o",e),e}_parseByType(e){switch(s("_parseByType: type: %s",e),e){case"byte":return 0!==this._parseByte();case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){s("_parseProperties");let e=this._parseVarByteNum(),t=this._pos+e,r={};for(;this._pos<t;){let e=this._parseByte();if(!e)return this._emitError(new Error("Cannot parse property code type")),!1;let t=o.propertiesCodes[e];if(!t)return this._emitError(new Error("Unknown property")),!1;if("userProperties"!==t)r[t]?(Array.isArray(r[t])||(r[t]=[r[t]]),r[t].push(this._parseByType(o.propertiesTypes[t]))):r[t]=this._parseByType(o.propertiesTypes[t]);else{r[t]||(r[t]=Object.create(null));let e=this._parseByType(o.propertiesTypes[t]);if(r[t][e.name])if(Array.isArray(r[t][e.name]))r[t][e.name].push(e.value);else{let n=r[t][e.name];r[t][e.name]=[n],r[t][e.name].push(e.value)}else r[t][e.name]=e.value}}return r}_newPacket(){return s("_newPacket"),this.packet&&(this._list.consume(this.packet.length),s("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),s("_newPacket: new packet"),this.packet=new i,this._pos=0,!0}_emitError(e){s("_emitError",e),this.error=e,this.emit("error",e)}}})),In=u(((e,t)=>{nt(),ze(),f();var{Buffer:r}=(rt(),h(He)),n={},i=r.isBuffer(r.from([1,2]).subarray(0,1));function o(e){let t=r.allocUnsafe(2);return t.writeUInt8(e>>8,0),t.writeUInt8(255&e,1),t}t.exports={cache:n,generateCache:function(){for(let e=0;e<65536;e++)n[e]=o(e)},generateNumber:o,genBufVariableByteInt:function(e){let t=0,n=0,o=r.allocUnsafe(4);do{t=e%128|0,(e=e/128|0)>0&&(t|=128),o.writeUInt8(t,n++)}while(e>0&&n<4);return e>0&&(n=0),i?o.subarray(0,n):o.slice(0,n)},generate4ByteBuffer:function(e){let t=r.allocUnsafe(4);return t.writeUInt32BE(e,0),t}}})),Cn=u(((e,t)=>{nt(),ze(),f(),typeof d>"u"||!d.version||0===d.version.indexOf("v0.")||0===d.version.indexOf("v1.")&&0!==d.version.indexOf("v1.8.")?t.exports={nextTick:function(e,t,r,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,o,s=arguments.length;switch(s){case 0:case 1:return d.nextTick(e);case 2:return d.nextTick((function(){e.call(null,t)}));case 3:return d.nextTick((function(){e.call(null,t,r)}));case 4:return d.nextTick((function(){e.call(null,t,r,n)}));default:for(i=new Array(s-1),o=0;o<i.length;)i[o++]=arguments[o];return d.nextTick((function(){e.apply(null,i)}))}}}:t.exports=d})),Rn=u(((e,t)=>{nt(),ze(),f();var r=En(),{Buffer:n}=(rt(),h(He)),i=n.allocUnsafe(0),o=n.from([0]),s=In(),a=Cn().nextTick,l=An()("mqtt-packet:writeToStream"),u=s.cache,c=s.generateNumber,d=s.generateCache,p=s.genBufVariableByteInt,g=s.generate4ByteBuffer,y=k,b=!0;function v(e,t,s){switch(l("generate called"),t.cork&&(t.cork(),a(m,t)),b&&(b=!1,d()),l("generate: packet.cmd: %s",e.cmd),e.cmd){case"connect":return function(e,t,i){let o=e||{},s=o.protocolId||"MQTT",a=o.protocolVersion||4,l=o.will,u=o.clean,c=o.keepalive||0,h=o.clientId||"",f=o.username,d=o.password,p=o.properties;void 0===u&&(u=!0);let g,b,v=0;if(!s||"string"!=typeof s&&!n.isBuffer(s))return t.destroy(new Error("Invalid protocolId")),!1;if(v+=s.length+2,3!==a&&4!==a&&5!==a)return t.destroy(new Error("Invalid protocol version")),!1;if(v+=1,("string"==typeof h||n.isBuffer(h))&&(h||a>=4)&&(h||u))v+=n.byteLength(h)+2;else{if(a<4)return t.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(1*u==0)return t.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if("number"!=typeof c||c<0||c>65535||c%1!=0)return t.destroy(new Error("Invalid keepalive")),!1;if(v+=2,v+=1,5===a){if(g=I(t,p),!g)return!1;v+=g.length}if(l){if("object"!=typeof l)return t.destroy(new Error("Invalid will")),!1;if(!l.topic||"string"!=typeof l.topic)return t.destroy(new Error("Invalid will topic")),!1;if(v+=n.byteLength(l.topic)+2,v+=2,l.payload){if(!(l.payload.length>=0))return t.destroy(new Error("Invalid will payload")),!1;"string"==typeof l.payload?v+=n.byteLength(l.payload):v+=l.payload.length}if(b={},5===a){if(b=I(t,l.properties),!b)return!1;v+=b.length}}let m=!1;if(null!=f){if(!P(f))return t.destroy(new Error("Invalid username")),!1;m=!0,v+=n.byteLength(f)+2}if(null!=d){if(!m)return t.destroy(new Error("Username is required to use password")),!1;if(!P(d))return t.destroy(new Error("Invalid password")),!1;v+=M(d)+2}t.write(r.CONNECT_HEADER),_(t,v),T(t,s),o.bridgeMode&&(a+=128),t.write(131===a?r.VERSION131:132===a?r.VERSION132:4===a?r.VERSION4:5===a?r.VERSION5:r.VERSION3);let w=0;return w|=null!=f?r.USERNAME_MASK:0,w|=null!=d?r.PASSWORD_MASK:0,w|=l&&l.retain?r.WILL_RETAIN_MASK:0,w|=l&&l.qos?l.qos<<r.WILL_QOS_SHIFT:0,w|=l?r.WILL_FLAG_MASK:0,w|=u?r.CLEAN_SESSION_MASK:0,t.write(n.from([w])),y(t,c),5===a&&g.write(),T(t,h),l&&(5===a&&b.write(),E(t,l.topic),T(t,l.payload)),null!=f&&T(t,f),null!=d&&T(t,d),!0}(e,t);case"connack":return function(e,t,i){let s=i?i.protocolVersion:4,a=e||{},l=5===s?a.reasonCode:a.returnCode,u=a.properties,c=2;if("number"!=typeof l)return t.destroy(new Error("Invalid return code")),!1;let h=null;if(5===s){if(h=I(t,u),!h)return!1;c+=h.length}return t.write(r.CONNACK_HEADER),_(t,c),t.write(a.sessionPresent?r.SESSIONPRESENT_HEADER:o),t.write(n.from([l])),h?.write(),!0}(e,t,s);case"publish":return function(e,t,o){l("publish: packet: %o",e);let s=o?o.protocolVersion:4,a=e||{},u=a.qos||0,c=a.retain?r.RETAIN_MASK:0,h=a.topic,f=a.payload||i,d=a.messageId,p=a.properties,g=0;if("string"==typeof h)g+=n.byteLength(h)+2;else{if(!n.isBuffer(h))return t.destroy(new Error("Invalid topic")),!1;g+=h.length+2}if(n.isBuffer(f)?g+=f.length:g+=n.byteLength(f),u&&"number"!=typeof d)return t.destroy(new Error("Invalid messageId")),!1;u&&(g+=2);let b=null;if(5===s){if(b=I(t,p),!b)return!1;g+=b.length}return t.write(r.PUBLISH_HEADER[u][a.dup?1:0][c?1:0]),_(t,g),y(t,M(h)),t.write(h),u>0&&y(t,d),b?.write(),l("publish: payload: %o",f),t.write(f)}(e,t,s);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.cmd||"puback",l=s.messageId,u=s.dup&&"pubrel"===a?r.DUP_MASK:0,c=0,h=s.reasonCode,f=s.properties,d=5===o?3:2;if("pubrel"===a&&(c=1),"number"!=typeof l)return t.destroy(new Error("Invalid messageId")),!1;let p=null;if(5===o&&"object"==typeof f){if(p=C(t,f,i,d),!p)return!1;d+=p.length}return t.write(r.ACKS[a][c][u][0]),3===d&&(d+=0!==h?1:-1),_(t,d),y(t,l),5===o&&2!==d&&t.write(n.from([h])),null!==p?p.write():4===d&&t.write(n.from([0])),!0}(e,t,s);case"subscribe":return function(e,t,i){l("subscribe: packet: ");let o=i?i.protocolVersion:4,s=e||{},a=s.dup?r.DUP_MASK:0,u=s.messageId,c=s.subscriptions,h=s.properties,f=0;if("number"!=typeof u)return t.destroy(new Error("Invalid messageId")),!1;f+=2;let d=null;if(5===o){if(d=I(t,h),!d)return!1;f+=d.length}if("object"!=typeof c||!c.length)return t.destroy(new Error("Invalid subscriptions")),!1;for(let e=0;e<c.length;e+=1){let r=c[e].topic,i=c[e].qos;if("string"!=typeof r)return t.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof i)return t.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(5===o){if("boolean"!=typeof(c[e].nl||!1))return t.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(c[e].rap||!1))return t.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let r=c[e].rh||0;if("number"!=typeof r||r>2)return t.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}f+=n.byteLength(r)+2+1}l("subscribe: writing to stream: %o",r.SUBSCRIBE_HEADER),t.write(r.SUBSCRIBE_HEADER[1][a?1:0][0]),_(t,f),y(t,u),null!==d&&d.write();let p=!0;for(let e of c){let i,s=e.topic,a=e.qos,l=+e.nl,u=+e.rap,c=e.rh;E(t,s),i=r.SUBSCRIBE_OPTIONS_QOS[a],5===o&&(i|=l?r.SUBSCRIBE_OPTIONS_NL:0,i|=u?r.SUBSCRIBE_OPTIONS_RAP:0,i|=c?r.SUBSCRIBE_OPTIONS_RH[c]:0),p=t.write(n.from([i]))}return p}(e,t,s);case"suback":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.messageId,l=s.granted,u=s.properties,c=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(c+=2,"object"!=typeof l||!l.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<l.length;e+=1){if("number"!=typeof l[e])return t.destroy(new Error("Invalid qos vector")),!1;c+=1}let h=null;if(5===o){if(h=C(t,u,i,c),!h)return!1;c+=h.length}return t.write(r.SUBACK_HEADER),_(t,c),y(t,a),null!==h&&h.write(),t.write(n.from(l))}(e,t,s);case"unsubscribe":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?r.DUP_MASK:0,u=s.unsubscriptions,c=s.properties,h=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(h+=2,"object"!=typeof u||!u.length)return t.destroy(new Error("Invalid unsubscriptions")),!1;for(let e=0;e<u.length;e+=1){if("string"!=typeof u[e])return t.destroy(new Error("Invalid unsubscriptions")),!1;h+=n.byteLength(u[e])+2}let f=null;if(5===o){if(f=I(t,c),!f)return!1;h+=f.length}t.write(r.UNSUBSCRIBE_HEADER[1][l?1:0][0]),_(t,h),y(t,a),null!==f&&f.write();let d=!0;for(let e=0;e<u.length;e++)d=E(t,u[e]);return d}(e,t,s);case"unsuback":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?r.DUP_MASK:0,u=s.granted,c=s.properties,h=s.cmd,f=0,d=2;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(5===o){if("object"!=typeof u||!u.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<u.length;e+=1){if("number"!=typeof u[e])return t.destroy(new Error("Invalid qos vector")),!1;d+=1}}let p=null;if(5===o){if(p=C(t,c,i,d),!p)return!1;d+=p.length}return t.write(r.ACKS[h][f][l][0]),_(t,d),y(t,a),null!==p&&p.write(),5===o&&t.write(n.from(u)),!0}(e,t,s);case"pingreq":case"pingresp":return function(e,t,n){return t.write(r.EMPTY[e.cmd])}(e,t);case"disconnect":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties,u=5===o?1:0,c=null;if(5===o){if(c=C(t,l,i,u),!c)return!1;u+=c.length}return t.write(n.from([r.codes.disconnect<<4])),_(t,u),5===o&&t.write(n.from([a])),null!==c&&c.write(),!0}(e,t,s);case"auth":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties,u=5===o?1:0;5!==o&&t.destroy(new Error("Invalid mqtt version for auth packet"));let c=C(t,l,i,u);return!!c&&(u+=c.length,t.write(n.from([r.codes.auth<<4])),_(t,u),t.write(n.from([a])),null!==c&&c.write(),!0)}(e,t,s);default:return t.destroy(new Error("Unknown command")),!1}}function m(e){e.uncork()}Object.defineProperty(v,"cacheNumbers",{get:()=>y===k,set(e){e?((!u||0===Object.keys(u).length)&&(b=!0),y=k):(b=!1,y=A)}});var w={};function _(e,t){if(t>r.VARBYTEINT_MAX)return e.destroy(new Error(`Invalid variable byte integer: ${t}`)),!1;let n=w[t];return n||(n=p(t),t<16384&&(w[t]=n)),l("writeVarByteInt: writing to stream: %o",n),e.write(n)}function E(e,t){let r=n.byteLength(t);return y(e,r),l("writeString: %s",t),e.write(t,"utf8")}function S(e,t,r){E(e,t),E(e,r)}function k(e,t){return l("writeNumberCached: number: %d",t),l("writeNumberCached: %o",u[t]),e.write(u[t])}function A(e,t){let r=c(t);return l("writeNumberGenerated: %o",r),e.write(r)}function T(e,t){"string"==typeof t?E(e,t):t?(y(e,t.length),e.write(t)):y(e,0)}function I(e,t){if("object"!=typeof t||null!=t.length)return{length:1,write(){O(e,{},0)}};let i=0;function o(t,i){let o=0;switch(r.propertiesTypes[t]){case"byte":if("boolean"!=typeof i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=2;break;case"int8":if("number"!=typeof i||i<0||i>255)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=2;break;case"binary":if(i&&null===i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=1+n.byteLength(i)+2;break;case"int16":if("number"!=typeof i||i<0||i>65535)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=3;break;case"int32":if("number"!=typeof i||i<0||i>4294967295)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=5;break;case"var":if("number"!=typeof i||i<0||i>268435455)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=1+n.byteLength(p(i));break;case"string":if("string"!=typeof i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=3+n.byteLength(i.toString());break;case"pair":if("object"!=typeof i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=Object.getOwnPropertyNames(i).reduce(((e,t)=>{let r=i[t];return Array.isArray(r)?e+=r.reduce(((e,r)=>e+=3+n.byteLength(t.toString())+2+n.byteLength(r.toString())),0):e+=3+n.byteLength(t.toString())+2+n.byteLength(i[t].toString()),e}),0);break;default:return e.destroy(new Error(`Invalid property ${t}: ${i}`)),!1}return o}if(t)for(let e in t){let r=0,n=0,s=t[e];if(Array.isArray(s))for(let t=0;t<s.length;t++){if(n=o(e,s[t]),!n)return!1;r+=n}else{if(n=o(e,s),!n)return!1;r=n}if(!r)return!1;i+=r}return{length:n.byteLength(p(i))+i,write(){O(e,t,i)}}}function C(e,t,r,n){let i=["reasonString","userProperties"],o=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0,s=I(e,t);if(o)for(;n+s.length>o;){let r=i.shift();if(!r||!t[r])return!1;delete t[r],s=I(e,t)}return s}function R(e,t,i){switch(r.propertiesTypes[t]){case"byte":e.write(n.from([r.properties[t]])),e.write(n.from([+i]));break;case"int8":e.write(n.from([r.properties[t]])),e.write(n.from([i]));break;case"binary":e.write(n.from([r.properties[t]])),T(e,i);break;case"int16":e.write(n.from([r.properties[t]])),y(e,i);break;case"int32":e.write(n.from([r.properties[t]])),function(e,t){let r=g(t);l("write4ByteNumber: %o",r),e.write(r)}(e,i);break;case"var":e.write(n.from([r.properties[t]])),_(e,i);break;case"string":e.write(n.from([r.properties[t]])),E(e,i);break;case"pair":Object.getOwnPropertyNames(i).forEach((o=>{let s=i[o];Array.isArray(s)?s.forEach((i=>{e.write(n.from([r.properties[t]])),S(e,o.toString(),i.toString())})):(e.write(n.from([r.properties[t]])),S(e,o.toString(),s.toString()))}));break;default:return e.destroy(new Error(`Invalid property ${t} value: ${i}`)),!1}}function O(e,t,r){_(e,r);for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&null!==t[r]){let n=t[r];if(Array.isArray(n))for(let t=0;t<n.length;t++)R(e,r,n[t]);else R(e,r,n)}}function M(e){return e?e instanceof n?e.length:n.byteLength(e):0}function P(e){return"string"==typeof e||e instanceof n}t.exports=v})),On=u(((e,t)=>{nt(),ze(),f();var r=Rn(),{EventEmitter:n}=(jt(),h(Mt)),{Buffer:i}=(rt(),h(He));var o=class extends n{constructor(){super(),this._array=new Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e,t=0,r=new Array(this._array.length),n=this._array,o=0;for(e=0;e<n.length&&void 0!==n[e];e++)"string"!=typeof n[e]?r[e]=n[e].length:r[e]=i.byteLength(n[e]),t+=r[e];let s=i.allocUnsafe(t);for(e=0;e<n.length&&void 0!==n[e];e++)"string"!=typeof n[e]?(n[e].copy(s,o),o+=r[e]):(s.write(n[e],o),o+=r[e]);return s}destroy(e){e&&this.emit("error",e)}};t.exports=function(e,t){let n=new o;return r(e,n,t),n.concat()}})),Mn=u((e=>{nt(),ze(),f(),e.parser=Tn().parser,e.generate=On(),e.writeToStream=Rn()})),Pn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(){this.nextId=Math.max(1,Math.floor(65535*Math.random()))}allocate(){let e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e}getLastAllocated(){return 1===this.nextId?65535:this.nextId-1}register(e){return!0}deallocate(e){}clear(){}}})),xn=u(((e,t)=>{function r(e){return e instanceof Ze?Ze.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}nt(),ze(),f(),t.exports=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(o){if("object"!=typeof o||null===o)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return i(o,e);if(o instanceof Map)return new Map(i(Array.from(o),e));if(o instanceof Set)return new Set(i(Array.from(o),e));var s={};for(var a in t.push(o),n.push(s),o){var l=o[a];if("object"!=typeof l||null===l)s[a]=l;else if(l instanceof Date)s[a]=new Date(l);else if(l instanceof Map)s[a]=new Map(i(Array.from(l),e));else if(l instanceof Set)s[a]=new Set(i(Array.from(l),e));else if(ArrayBuffer.isView(l))s[a]=r(l);else{var u=t.indexOf(l);s[a]=-1!==u?n[u]:e(l)}}return t.pop(),n.pop(),s}:function e(o){if("object"!=typeof o||null===o)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return i(o,e);if(o instanceof Map)return new Map(i(Array.from(o),e));if(o instanceof Set)return new Set(i(Array.from(o),e));var s={};for(var a in t.push(o),n.push(s),o)if(!1!==Object.hasOwnProperty.call(o,a)){var l=o[a];if("object"!=typeof l||null===l)s[a]=l;else if(l instanceof Date)s[a]=new Date(l);else if(l instanceof Map)s[a]=new Map(i(Array.from(l),e));else if(l instanceof Set)s[a]=new Set(i(Array.from(l),e));else if(ArrayBuffer.isView(l))s[a]=r(l);else{var u=t.indexOf(l);s[a]=-1!==u?n[u]:e(l)}}return t.pop(),n.pop(),s};function i(e,i){for(var o=Object.keys(e),s=new Array(o.length),a=0;a<o.length;a++){var l=o[a],u=e[l];if("object"!=typeof u||null===u)s[l]=u;else if(u instanceof Date)s[l]=new Date(u);else if(ArrayBuffer.isView(u))s[l]=r(u);else{var c=t.indexOf(u);s[l]=-1!==c?n[c]:i(u)}}return s}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var i={};for(var o in n){var s=n[o];"object"!=typeof s||null===s?i[o]=s:s instanceof Date?i[o]=new Date(s):s instanceof Map?i[o]=new Map(t(Array.from(s),e)):s instanceof Set?i[o]=new Set(t(Array.from(s),e)):ArrayBuffer.isView(s)?i[o]=r(s):i[o]=e(s)}return i}:function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var i={};for(var o in n)if(!1!==Object.hasOwnProperty.call(n,o)){var s=n[o];"object"!=typeof s||null===s?i[o]=s:s instanceof Date?i[o]=new Date(s):s instanceof Map?i[o]=new Map(t(Array.from(s),e)):s instanceof Set?i[o]=new Set(t(Array.from(s),e)):ArrayBuffer.isView(s)?i[o]=r(s):i[o]=e(s)}return i};function t(e,t){for(var n=Object.keys(e),i=new Array(n.length),o=0;o<n.length;o++){var s=n[o],a=e[s];"object"!=typeof a||null===a?i[s]=a:a instanceof Date?i[s]=new Date(a):ArrayBuffer.isView(a)?i[s]=r(a):i[s]=t(a)}return i}}})),Bn=u(((e,t)=>{nt(),ze(),f(),t.exports=xn()()})),Ln=u((e=>{function t(e){let t=e.split("/");for(let e=0;e<t.length;e++)if("+"!==t[e]){if("#"===t[e])return e===t.length-1;if(-1!==t[e].indexOf("+")||-1!==t[e].indexOf("#"))return!1}return!0}nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0}),e.validateTopics=e.validateTopic=void 0,e.validateTopic=t,e.validateTopics=function(e){if(0===e.length)return"empty_topic_list";for(let r=0;r<e.length;r++)if(!t(e[r]))return e[r];return null}})),Un=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});var t=bn(),r={objectMode:!0},n={clean:!0};e.default=class{constructor(e){this.options=e||{},this.options=Object.assign(Object.assign({},n),e),this._inflights=new Map}put(e,t){return this._inflights.set(e.messageId,e),t&&t(),this}createStream(){let e=new t.Readable(r),n=[],i=!1,o=0;return this._inflights.forEach(((e,t)=>{n.push(e)})),e._read=()=>{!i&&o<n.length?e.push(n[o++]):e.push(null)},e.destroy=t=>{if(!i)return i=!0,setTimeout((()=>{e.emit("close")}),0),e},e}del(e,t){let r=this._inflights.get(e.messageId);return r?(this._inflights.delete(e.messageId),t(null,r)):t&&t(new Error("missing packet")),this}get(e,t){let r=this._inflights.get(e.messageId);return r?t(null,r):t&&t(new Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e()}}})),Nn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});var t=[0,16,128,131,135,144,145,151,153];e.default=(e,r,n)=>{e.log("handlePublish: packet %o",r),n=typeof n<"u"?n:e.noop;let i=r.topic.toString(),o=r.payload,{qos:s}=r,{messageId:a}=r,{options:l}=e;if(5===e.options.protocolVersion){let t;if(r.properties&&(t=r.properties.topicAlias),typeof t<"u")if(0===i.length){if(!(t>0&&t<=65535))return e.log("handlePublish :: topic alias out of range. alias: %d",t),void e.emit("error",new Error("Received Topic Alias is out of range"));{let r=e.topicAliasRecv.getTopicByAlias(t);if(!r)return e.log("handlePublish :: unregistered topic alias. alias: %d",t),void e.emit("error",new Error("Received unregistered Topic Alias"));i=r,e.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",i,t)}}else{if(!e.topicAliasRecv.put(i,t))return e.log("handlePublish :: topic alias out of range. alias: %d",t),void e.emit("error",new Error("Received Topic Alias is out of range"));e.log("handlePublish :: registered topic: %s - alias: %d",i,t)}}switch(e.log("handlePublish: qos %d",s),s){case 2:l.customHandleAcks(i,o,r,((i,o)=>("number"==typeof i&&(o=i,i=null),i?e.emit("error",i):-1===t.indexOf(o)?e.emit("error",new Error("Wrong reason code for pubrec")):void(o?e._sendPacket({cmd:"pubrec",messageId:a,reasonCode:o},n):e.incomingStore.put(r,(()=>{e._sendPacket({cmd:"pubrec",messageId:a},n)}))))));break;case 1:l.customHandleAcks(i,o,r,((s,l)=>("number"==typeof s&&(l=s,s=null),s?e.emit("error",s):-1===t.indexOf(l)?e.emit("error",new Error("Wrong reason code for puback")):(l||e.emit("message",i,o,r),void e.handleMessage(r,(t=>{if(t)return n&&n(t);e._sendPacket({cmd:"puback",messageId:a,reasonCode:l},n)}))))));break;case 0:e.emit("message",i,o,r),e.handleMessage(r,n);break;default:e.log("handlePublish: unknown QoS. Doing nothing.")}}})),jn=u(((e,t)=>{t.exports={version:"5.7.3"}})),Dn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0}),e.MQTTJS_VERSION=e.nextTick=e.applyMixin=e.ErrorWithReasonCode=void 0;var t=class e extends Error{constructor(t,r){super(t),this.code=r,Object.setPrototypeOf(this,e.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};e.ErrorWithReasonCode=t,e.applyMixin=function(e,t,r=!1){var n;let i=[t];for(;;){let e=i[0],t=Object.getPrototypeOf(e);if(!t?.prototype)break;i.unshift(t)}for(let t of i)for(let i of Object.getOwnPropertyNames(t.prototype))(r||"constructor"!==i)&&Object.defineProperty(e.prototype,i,null!==(n=Object.getOwnPropertyDescriptor(t.prototype,i))&&void 0!==n?n:Object.create(null))},e.nextTick="function"==typeof(null==d?void 0:d.nextTick)?d.nextTick:e=>{setTimeout(e,0)},e.MQTTJS_VERSION=jn().version})),Fn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=void 0,e.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};e.default=(t,r)=>{let{messageId:n}=r,i=r.cmd,o=null,s=t.outgoing[n]?t.outgoing[n].cb:null,a=null;if(s){switch(t.log("_handleAck :: packet type",i),i){case"pubcomp":case"puback":{let i=r.reasonCode;i&&i>0&&16!==i?(a=new Error(`Publish error: ${e.ReasonCodes[i]}`),a.code=i,t._removeOutgoingAndStoreMessage(n,(()=>{s(a,r)}))):t._removeOutgoingAndStoreMessage(n,s);break}case"pubrec":{o={cmd:"pubrel",qos:2,messageId:n};let i=r.reasonCode;i&&i>0&&16!==i?(a=new Error(`Publish error: ${e.ReasonCodes[i]}`),a.code=i,t._removeOutgoingAndStoreMessage(n,(()=>{s(a,r)}))):t._sendPacket(o);break}case"suback":{delete t.outgoing[n],t.messageIdProvider.deallocate(n);let i=r.granted;for(let r=0;r<i.length;r++){let o=i[r];if(128&o){a=new Error(`Subscribe error: ${e.ReasonCodes[o]}`),a.code=o;let r=t.messageIdToTopic[n];r&&r.forEach((e=>{delete t._resubscribeTopics[e]}))}}delete t.messageIdToTopic[n],t._invokeStoreProcessingQueue(),s(a,r);break}case"unsuback":delete t.outgoing[n],t.messageIdProvider.deallocate(n),t._invokeStoreProcessingQueue(),s(null);break;default:t.emit("error",new Error("unrecognized packet type"))}t.disconnecting&&0===Object.keys(t.outgoing).length&&t.emit("outgoingEmpty")}else t.log("_handleAck :: Server sent an ack in error. Ignoring.")}})),Wn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});var t=Dn(),r=Fn();e.default=(e,n)=>{let{options:i}=e,o=i.protocolVersion,s=5===o?n.reasonCode:n.returnCode;if(5===o)e.handleAuth(n,((n,i)=>{if(n)e.emit("error",n);else if(24===s)e.reconnecting=!1,e._sendPacket(i);else{let n=new t.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[s]}`,s);e.emit("error",n)}}));else{let r=new t.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${o}`,s);e.emit("error",r)}}})),Vn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var t="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,r=new Set,n="object"==typeof d&&d?d:{},i=(e,t,r,i)=>{"function"==typeof n.emitWarning?n.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)},o=globalThis.AbortController,s=globalThis.AbortSignal;if(typeof o>"u"){s=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},o=class{constructor(){t()}signal=new s;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==n.env?.LRU_CACHE_IGNORE_AC_WARNING,t=()=>{e&&(e=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}Symbol("type");var a=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),l=e=>a(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?u:null:null,u=class extends Array{constructor(e){super(e),this.fill(0)}},c=class e{heap;length;static#e=!1;static create(t){let r=l(t);if(!r)return[];e.#e=!0;let n=new e(t,r);return e.#e=!1,n}constructor(t,r){if(!e.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},h=class e{#e;#t;#r;#n;#i;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#s;#a;#l;#u;#c;#h;#f;#d;#p;#g;#y;#b;#v;#m;#w;#_;static unsafeExposeInternals(e){return{starts:e.#b,ttls:e.#v,sizes:e.#y,keyMap:e.#a,keyList:e.#l,valList:e.#u,next:e.#c,prev:e.#h,get head(){return e.#f},get tail(){return e.#d},free:e.#p,isBackgroundFetch:t=>e.#E(t),backgroundFetch:(t,r,n,i)=>e.#S(t,r,n,i),moveToTail:t=>e.#k(t),indexes:t=>e.#A(t),rindexes:t=>e.#T(t),isStale:t=>e.#I(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#s}get size(){return this.#o}get fetchMethod(){return this.#i}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(t){let{max:n=0,ttl:o,ttlResolution:s=1,ttlAutopurge:u,updateAgeOnGet:h,updateAgeOnHas:f,allowStale:d,dispose:p,disposeAfter:g,noDisposeOnSet:y,noUpdateTTL:b,maxSize:v=0,maxEntrySize:m=0,sizeCalculation:w,fetchMethod:_,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:A,ignoreFetchAbort:T}=t;if(0!==n&&!a(n))throw new TypeError("max option must be a nonnegative integer");let I=n?l(n):Array;if(!I)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=v,this.maxEntrySize=m||this.#t,this.sizeCalculation=w,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==_&&"function"!=typeof _)throw new TypeError("fetchMethod must be a function if specified");if(this.#i=_,this.#w=!!_,this.#a=new Map,this.#l=new Array(n).fill(void 0),this.#u=new Array(n).fill(void 0),this.#c=new I(n),this.#h=new I(n),this.#f=0,this.#d=0,this.#p=c.create(n),this.#o=0,this.#s=0,"function"==typeof p&&(this.#r=p),"function"==typeof g?(this.#n=g,this.#g=[]):(this.#n=void 0,this.#g=void 0),this.#m=!!this.#r,this.#_=!!this.#n,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!k,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!T,0!==this.maxEntrySize){if(0!==this.#t&&!a(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!a(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!d,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!f,this.ttlResolution=a(s)||0===s?s:1,this.ttlAutopurge=!!u,this.ttl=o||0,this.ttl){if(!a(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#R()}if(0===this.#e&&0===this.ttl&&0===this.#t)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t="LRU_CACHE_UNBOUNDED";(e=>!r.has(e))(t)&&(r.add(t),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,e))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#R(){let e=new u(this.#e),r=new u(this.#e);this.#v=e,this.#b=r,this.#O=(n,i,o=t.now())=>{if(r[n]=0!==i?o:0,e[n]=i,0!==i&&this.ttlAutopurge){let e=setTimeout((()=>{this.#I(n)&&this.delete(this.#l[n])}),i+1);e.unref&&e.unref()}},this.#M=n=>{r[n]=0!==e[n]?t.now():0},this.#P=(t,o)=>{if(e[o]){let s=e[o],a=r[o];t.ttl=s,t.start=a,t.now=n||i();let l=t.now-a;t.remainingTTL=s-l}};let n=0,i=()=>{let e=t.now();if(this.ttlResolution>0){n=e;let t=setTimeout((()=>n=0),this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=t=>{let o=this.#a.get(t);if(void 0===o)return 0;let s=e[o],a=r[o];return 0===s||0===a?1/0:s-((n||i())-a)},this.#I=t=>0!==e[t]&&0!==r[t]&&(n||i())-r[t]>e[t]}#M=()=>{};#P=()=>{};#O=()=>{};#I=()=>!1;#C(){let e=new u(this.#e);this.#s=0,this.#y=e,this.#x=t=>{this.#s-=e[t],e[t]=0},this.#B=(e,t,r,n)=>{if(this.#E(t))return 0;if(!a(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(t,e),!a(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#L=(t,r,n)=>{if(e[t]=r,this.#t){let r=this.#t-e[t];for(;this.#s>r;)this.#U(!0)}this.#s+=e[t],n&&(n.entrySize=r,n.totalCalculatedSize=this.#s)}}#x=e=>{};#L=(e,t,r)=>{};#B=(e,t,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#d;this.#N(t)&&((e||!this.#I(t))&&(yield t),t!==this.#f);)t=this.#h[t]}*#T({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#f;this.#N(t)&&((e||!this.#I(t))&&(yield t),t!==this.#d);)t=this.#c[t]}#N(e){return void 0!==e&&this.#a.get(this.#l[e])===e}*entries(){for(let e of this.#A())void 0!==this.#u[e]&&void 0!==this.#l[e]&&!this.#E(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*rentries(){for(let e of this.#T())void 0!==this.#u[e]&&void 0!==this.#l[e]&&!this.#E(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*keys(){for(let e of this.#A()){let t=this.#l[e];void 0!==t&&!this.#E(this.#u[e])&&(yield t)}}*rkeys(){for(let e of this.#T()){let t=this.#l[e];void 0!==t&&!this.#E(this.#u[e])&&(yield t)}}*values(){for(let e of this.#A())void 0!==this.#u[e]&&!this.#E(this.#u[e])&&(yield this.#u[e])}*rvalues(){for(let e of this.#T())void 0!==this.#u[e]&&!this.#E(this.#u[e])&&(yield this.#u[e])}[Symbol.iterator](){return this.entries()}find(e,t={}){for(let r of this.#A()){let n=this.#u[r],i=this.#E(n)?n.__staleWhileFetching:n;if(void 0!==i&&e(i,this.#l[r],this))return this.get(this.#l[r],t)}}forEach(e,t=this){for(let r of this.#A()){let n=this.#u[r],i=this.#E(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#l[r],this)}}rforEach(e,t=this){for(let r of this.#T()){let n=this.#u[r],i=this.#E(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#l[r],this)}}purgeStale(){let e=!1;for(let t of this.#T({allowStale:!0}))this.#I(t)&&(this.delete(this.#l[t]),e=!0);return e}dump(){let e=[];for(let r of this.#A({allowStale:!0})){let n=this.#l[r],i=this.#u[r],o=this.#E(i)?i.__staleWhileFetching:i;if(void 0===o||void 0===n)continue;let s={value:o};if(this.#v&&this.#b){s.ttl=this.#v[r];let e=t.now()-this.#b[r];s.start=Math.floor(Date.now()-e)}this.#y&&(s.size=this.#y[r]),e.unshift([n,s])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let e=Date.now()-n.start;n.start=t.now()-e}this.set(r,n.value,n)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;let{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,u=this.#B(e,t,r.size||0,s);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.delete(e),this;let c=0===this.#o?void 0:this.#a.get(e);if(void 0===c)c=0===this.#o?this.#d:0!==this.#p.length?this.#p.pop():this.#o===this.#e?this.#U(!1):this.#o,this.#l[c]=e,this.#u[c]=t,this.#a.set(e,c),this.#c[this.#d]=c,this.#h[c]=this.#d,this.#d=c,this.#o++,this.#L(c,u,a),a&&(a.set="add"),l=!1;else{this.#k(c);let r=this.#u[c];if(t!==r){if(this.#w&&this.#E(r)){r.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:t}=r;void 0!==t&&!o&&(this.#m&&this.#r?.(t,e,"set"),this.#_&&this.#g?.push([t,e,"set"]))}else o||(this.#m&&this.#r?.(r,e,"set"),this.#_&&this.#g?.push([r,e,"set"]));if(this.#x(c),this.#L(c,u,a),this.#u[c]=t,a){a.set="replace";let e=r&&this.#E(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0!==n&&!this.#v&&this.#R(),this.#v&&(l||this.#O(c,n,i),a&&this.#P(a,c)),!o&&this.#_&&this.#g){let e,t=this.#g;for(;e=t?.shift();)this.#n?.(...e)}return this}pop(){try{for(;this.#o;){let e=this.#u[this.#f];if(this.#U(!0),this.#E(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#_&&this.#g){let e,t=this.#g;for(;e=t?.shift();)this.#n?.(...e)}}}#U(e){let t=this.#f,r=this.#l[t],n=this.#u[t];return this.#w&&this.#E(n)?n.__abortController.abort(new Error("evicted")):(this.#m||this.#_)&&(this.#m&&this.#r?.(n,r,"evict"),this.#_&&this.#g?.push([n,r,"evict"])),this.#x(t),e&&(this.#l[t]=void 0,this.#u[t]=void 0,this.#p.push(t)),1===this.#o?(this.#f=this.#d=0,this.#p.length=0):this.#f=this.#c[t],this.#a.delete(r),this.#o--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,i=this.#a.get(e);if(void 0!==i){let e=this.#u[i];if(this.#E(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#I(i))return r&&this.#M(i),n&&(n.has="hit",this.#P(n,i)),!0;n&&(n.has="stale",this.#P(n,i))}else n&&(n.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,n=this.#a.get(e);if(void 0!==n&&(r||!this.#I(n))){let e=this.#u[n];return this.#E(e)?e.__staleWhileFetching:e}}#S(e,t,r,n){let i=void 0===t?void 0:this.#u[t];if(this.#E(i))return i;let s=new o,{signal:a}=r;a?.addEventListener("abort",(()=>s.abort(a.reason)),{signal:s.signal});let l={signal:s.signal,options:r,context:n},u=(n,i=!1)=>{let{aborted:o}=s.signal,a=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(o&&!i?(r.status.fetchAborted=!0,r.status.fetchError=s.signal.reason,a&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),o&&!a&&!i)return c(s.signal.reason);let u=h;return this.#u[t]===h&&(void 0===n?u.__staleWhileFetching?this.#u[t]=u.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,n,l.options))),n},c=n=>{let{aborted:i}=s.signal,o=i&&r.allowStaleOnFetchAbort,a=o||r.allowStaleOnFetchRejection,l=a||r.noDeleteOnFetchRejection,u=h;if(this.#u[t]===h&&(l&&void 0!==u.__staleWhileFetching?o||(this.#u[t]=u.__staleWhileFetching):this.delete(e)),a)return r.status&&void 0!==u.__staleWhileFetching&&(r.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw n};r.status&&(r.status.fetchDispatched=!0);let h=new Promise(((t,n)=>{let o=this.#i?.(e,i,l);o&&o instanceof Promise&&o.then((e=>t(void 0===e?void 0:e)),n),s.signal.addEventListener("abort",(()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>u(e,!0)))}))})).then(u,(e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),c(e)))),f=Object.assign(h,{__abortController:s,__staleWhileFetching:i,__returned:void 0});return void 0===t?(this.set(e,f,{...l.options,status:void 0}),t=this.#a.get(e)):this.#u[t]=f,f}#E(e){if(!this.#w)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof o}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:p,forceRefresh:g=!1,status:y,signal:b}=t;if(!this.#w)return y&&(y.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:y});let v={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:d,ignoreFetchAbort:f,status:y,signal:b},m=this.#a.get(e);if(void 0===m){y&&(y.fetch="miss");let t=this.#S(e,m,v,p);return t.__returned=t}{let t=this.#u[m];if(this.#E(t)){let e=r&&void 0!==t.__staleWhileFetching;return y&&(y.fetch="inflight",e&&(y.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#I(m);if(!g&&!i)return y&&(y.fetch="hit"),this.#k(m),n&&this.#M(m),y&&this.#P(y,m),t;let o=this.#S(e,m,v,p),s=void 0!==o.__staleWhileFetching&&r;return y&&(y.fetch=i?"stale":"refresh",s&&i&&(y.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=t,s=this.#a.get(e);if(void 0!==s){let t=this.#u[s],a=this.#E(t);return o&&this.#P(o,s),this.#I(s)?(o&&(o.get="stale"),a?(o&&r&&void 0!==t.__staleWhileFetching&&(o.returnedStale=!0),r?t.__staleWhileFetching:void 0):(i||this.delete(e),o&&r&&(o.returnedStale=!0),r?t:void 0)):(o&&(o.get="hit"),a?t.__staleWhileFetching:(this.#k(s),n&&this.#M(s),t))}o&&(o.get="miss")}#j(e,t){this.#h[t]=e,this.#c[e]=t}#k(e){e!==this.#d&&(e===this.#f?this.#f=this.#c[e]:this.#j(this.#h[e],this.#c[e]),this.#j(this.#d,e),this.#d=e)}delete(e){let t=!1;if(0!==this.#o){let r=this.#a.get(e);if(void 0!==r)if(t=!0,1===this.#o)this.clear();else{this.#x(r);let t=this.#u[r];this.#E(t)?t.__abortController.abort(new Error("deleted")):(this.#m||this.#_)&&(this.#m&&this.#r?.(t,e,"delete"),this.#_&&this.#g?.push([t,e,"delete"])),this.#a.delete(e),this.#l[r]=void 0,this.#u[r]=void 0,r===this.#d?this.#d=this.#h[r]:r===this.#f?this.#f=this.#c[r]:(this.#c[this.#h[r]]=this.#c[r],this.#h[this.#c[r]]=this.#h[r]),this.#o--,this.#p.push(r)}}if(this.#_&&this.#g?.length){let e,t=this.#g;for(;e=t?.shift();)this.#n?.(...e)}return t}clear(){for(let e of this.#T({allowStale:!0})){let t=this.#u[e];if(this.#E(t))t.__abortController.abort(new Error("deleted"));else{let r=this.#l[e];this.#m&&this.#r?.(t,r,"delete"),this.#_&&this.#g?.push([t,r,"delete"])}}if(this.#a.clear(),this.#u.fill(void 0),this.#l.fill(void 0),this.#v&&this.#b&&(this.#v.fill(0),this.#b.fill(0)),this.#y&&this.#y.fill(0),this.#f=0,this.#d=0,this.#p.length=0,this.#s=0,this.#o=0,this.#_&&this.#g){let e,t=this.#g;for(;e=t?.shift();)this.#n?.(...e)}}};e.LRUCache=h})),zn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.ContainerIterator=e.Container=e.Base=void 0;e.ContainerIterator=class{constructor(e=0){this.iteratorType=e}equals(e){return this.o===e.o}};var t=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return 0===this.i}};e.Base=t;e.Container=class extends t{}})),Hn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=zn(),r=class extends t.Base{constructor(e=[]){super(),this.S=[];let t=this;e.forEach((function(e){t.push(e)}))}clear(){this.i=0,this.S=[]}push(e){return this.S.push(e),this.i+=1,this.i}pop(){if(0!==this.i)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}};e.default=r})),qn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=zn(),r=class extends t.Base{constructor(e=[]){super(),this.j=0,this.q=[];let t=this;e.forEach((function(e){t.push(e)}))}clear(){this.q=[],this.i=this.j=0}push(e){let t=this.q.length;if(this.j/t>.5&&this.j+this.i>=t&&t>4096){let t=this.i;for(let e=0;e<t;++e)this.q[e]=this.q[this.j+e];this.j=0,this.q[this.i]=e}else this.q[this.j+this.i]=e;return++this.i}pop(){if(0===this.i)return;let e=this.q[this.j++];return this.i-=1,e}front(){if(0!==this.i)return this.q[this.j]}};e.default=r})),$n=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=zn(),r=class extends t.Base{constructor(e=[],t=function(e,t){return e>t?-1:e<t?1:0},r=!0){if(super(),this.v=t,Array.isArray(e))this.C=r?[...e]:e;else{this.C=[];let t=this;e.forEach((function(e){t.C.push(e)}))}this.i=this.C.length;let n=this.i>>1;for(let e=this.i-1>>1;e>=0;--e)this.k(e,n)}m(e){let t=this.C[e];for(;e>0;){let r=e-1>>1,n=this.C[r];if(this.v(n,t)<=0)break;this.C[e]=n,e=r}this.C[e]=t}k(e,t){let r=this.C[e];for(;e<t;){let t=e<<1|1,n=t+1,i=this.C[t];if(n<this.i&&this.v(i,this.C[n])>0&&(t=n,i=this.C[n]),this.v(i,r)>=0)break;this.C[e]=i,e=t}this.C[e]=r}clear(){this.i=0,this.C.length=0}push(e){this.C.push(e),this.m(this.i),this.i+=1}pop(){if(0===this.i)return;let e=this.C[0],t=this.C.pop();return this.i-=1,this.i&&(this.C[0]=t,this.k(0,this.i>>1)),e}top(){return this.C[0]}find(e){return this.C.indexOf(e)>=0}remove(e){let t=this.C.indexOf(e);return!(t<0)&&(0===t?this.pop():t===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(t,1,this.C.pop()),this.i-=1,this.m(t),this.k(t,this.i>>1)),!0)}updateItem(e){let t=this.C.indexOf(e);return!(t<0)&&(this.m(t),this.k(t,this.i>>1),!0)}toArray(){return[...this.C]}};e.default=r})),Kn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=zn(),r=class extends t.Container{};e.default=r})),Gn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.throwIteratorAccessError=function(){throw new RangeError("Iterator access denied!")}})),Qn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.RandomIterator=void 0;var t=zn(),r=Gn(),n=class extends t.ContainerIterator{constructor(e,t){super(t),this.o=e,0===this.iteratorType?(this.pre=function(){return 0===this.o&&(0,r.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,r.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,r.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return-1===this.o&&(0,r.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(e){this.container.setElementByPos(this.o,e)}};e.RandomIterator=n})),Yn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=Kn())&&t.t?t:{default:t},n=Qn();var i=class e extends n.RandomIterator{constructor(e,t,r){super(e,r),this.container=t}copy(){return new e(this.o,this.container,this.iteratorType)}},o=class extends r.default{constructor(e=[],t=!0){if(super(),Array.isArray(e))this.J=t?[...e]:e,this.i=e.length;else{this.J=[];let t=this;e.forEach((function(e){t.pushBack(e)}))}}clear(){this.i=0,this.J.length=0}begin(){return new i(0,this)}end(){return new i(this.i,this)}rBegin(){return new i(this.i-1,this,1)}rEnd(){return new i(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J[e]}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J.splice(e,1),this.i-=1,this.i}eraseElementByValue(e){let t=0;for(let r=0;r<this.i;++r)this.J[r]!==e&&(this.J[t++]=this.J[r]);return this.i=this.J.length=t,this.i}eraseElementByIterator(e){let t=e.o;return e=e.next(),this.eraseElementByPos(t),e}pushBack(e){return this.J.push(e),this.i+=1,this.i}popBack(){if(0!==this.i)return this.i-=1,this.J.pop()}setElementByPos(e,t){if(e<0||e>this.i-1)throw new RangeError;this.J[e]=t}insert(e,t,r=1){if(e<0||e>this.i)throw new RangeError;return this.J.splice(e,0,...new Array(r).fill(t)),this.i+=r,this.i}find(e){for(let t=0;t<this.i;++t)if(this.J[t]===e)return new i(t,this);return this.end()}reverse(){this.J.reverse()}unique(){let e=1;for(let t=1;t<this.i;++t)this.J[t]!==this.J[t-1]&&(this.J[e++]=this.J[t]);return this.i=this.J.length=e,this.i}sort(e){this.J.sort(e)}forEach(e){for(let t=0;t<this.i;++t)e(this.J[t],t,this)}[Symbol.iterator](){return function*(){yield*this.J}.bind(this)()}};e.default=o})),Jn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=Kn())&&t.t?t:{default:t},n=zn(),i=Gn();var o=class e extends n.ContainerIterator{constructor(e,t,r,n){super(n),this.o=e,this.h=t,this.container=r,0===this.iteratorType?(this.pre=function(){return this.o.L===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.l}set pointer(e){this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.l=e}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends r.default{constructor(e=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let t=this;e.forEach((function(e){t.pushBack(e)}))}V(e){let{L:t,B:r}=e;t.B=r,r.L=t,e===this.p&&(this.p=r),e===this._&&(this._=t),this.i-=1}G(e,t){let r=t.B,n={l:e,L:t,B:r};t.B=n,r.L=n,t===this.h&&(this.p=n),r===this.h&&(this._=n),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return t.l}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return this.V(t),this.i}eraseElementByValue(e){let t=this.p;for(;t!==this.h;)t.l===e&&this.V(t),t=t.B;return this.i}eraseElementByIterator(e){let t=e.o;return t===this.h&&(0,i.throwIteratorAccessError)(),e=e.next(),this.V(t),e}pushBack(e){return this.G(e,this._),this.i}popBack(){if(0===this.i)return;let e=this._.l;return this.V(this._),e}pushFront(e){return this.G(e,this.h),this.i}popFront(){if(0===this.i)return;let e=this.p.l;return this.V(this.p),e}setElementByPos(e,t){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;r.l=t}insert(e,t,r=1){if(e<0||e>this.i)throw new RangeError;if(r<=0)return this.i;if(0===e)for(;r--;)this.pushFront(t);else if(e===this.i)for(;r--;)this.pushBack(t);else{let n=this.p;for(let t=1;t<e;++t)n=n.B;let i=n.B;for(this.i+=r;r--;)n.B={l:t,L:n},n.B.L=n,n=n.B;n.B=i,i.L=n}return this.i}find(e){let t=this.p;for(;t!==this.h;){if(t.l===e)return new o(t,this.h,this);t=t.B}return this.end()}reverse(){if(this.i<=1)return;let e=this.p,t=this._,r=0;for(;r<<1<this.i;){let n=e.l;e.l=t.l,t.l=n,e=e.B,t=t.L,r+=1}}unique(){if(this.i<=1)return this.i;let e=this.p;for(;e!==this.h;){let t=e;for(;t.B!==this.h&&t.l===t.B.l;)t=t.B,this.i-=1;e.B=t.B,e.B.L=e,e=e.B}return this.i}sort(e){if(this.i<=1)return;let t=[];this.forEach((function(e){t.push(e)})),t.sort(e);let r=this.p;t.forEach((function(e){r.l=e,r=r.B}))}merge(e){let t=this;if(0===this.i)e.forEach((function(e){t.pushBack(e)}));else{let r=this.p;e.forEach((function(e){for(;r!==t.h&&r.l<=e;)r=r.B;t.G(e,r.L)}))}return this.i}forEach(e){let t=this.p,r=0;for(;t!==this.h;)e(t.l,r++,this),t=t.B}[Symbol.iterator](){return function*(){if(0===this.i)return;let e=this.p;for(;e!==this.h;)yield e.l,e=e.B}.bind(this)()}};e.default=s})),Xn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=Kn())&&t.t?t:{default:t},n=Qn();var i=class e extends n.RandomIterator{constructor(e,t,r){super(e,r),this.container=t}copy(){return new e(this.o,this.container,this.iteratorType)}},o=class extends r.default{constructor(e=[],t=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let r=(()=>{if("number"==typeof e.length)return e.length;if("number"==typeof e.size)return e.size;if("function"==typeof e.size)return e.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=t,this.P=Math.max(Math.ceil(r/this.F),1);for(let e=0;e<this.P;++e)this.A.push(new Array(this.F));let n=Math.ceil(r/this.F);this.j=this.R=(this.P>>1)-(n>>1),this.D=this.N=this.F-r%this.F>>1;let i=this;e.forEach((function(e){i.pushBack(e)}))}T(){let e=[],t=Math.max(this.P>>1,1);for(let r=0;r<t;++r)e[r]=new Array(this.F);for(let t=this.j;t<this.P;++t)e[e.length]=this.A[t];for(let t=0;t<this.R;++t)e[e.length]=this.A[t];e[e.length]=[...this.A[this.R]],this.j=t,this.R=e.length-1;for(let r=0;r<t;++r)e[e.length]=new Array(this.F);this.A=e,this.P=e.length}O(e){let t=this.D+e+1,r=t%this.F,n=r-1,i=this.j+(t-r)/this.F;return 0===r&&(i-=1),i%=this.P,n<0&&(n+=this.F),{curNodeBucketIndex:i,curNodePointerIndex:n}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new i(0,this)}end(){return new i(this.i,this)}rBegin(){return new i(this.i-1,this,1)}rEnd(){return new i(-1,this,1)}front(){if(0!==this.i)return this.A[this.j][this.D]}back(){if(0!==this.i)return this.A[this.R][this.N]}pushBack(e){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=e,this.i}popBack(){if(0===this.i)return;let e=this.A[this.R][this.N];return 1!==this.i&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,e}pushFront(e){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=e,this.i}popFront(){if(0===this.i)return;let e=this.A[this.j][this.D];return 1!==this.i&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,e}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:t,curNodePointerIndex:r}=this.O(e);return this.A[t][r]}setElementByPos(e,t){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:r,curNodePointerIndex:n}=this.O(e);this.A[r][n]=t}insert(e,t,r=1){if(e<0||e>this.i)throw new RangeError;if(0===e)for(;r--;)this.pushFront(t);else if(e===this.i)for(;r--;)this.pushBack(t);else{let n=[];for(let t=e;t<this.i;++t)n.push(this.getElementByPos(t));this.cut(e-1);for(let e=0;e<r;++e)this.pushBack(t);for(let e=0;e<n.length;++e)this.pushBack(n[e])}return this.i}cut(e){if(e<0)return this.clear(),0;let{curNodeBucketIndex:t,curNodePointerIndex:r}=this.O(e);return this.R=t,this.N=r,this.i=e+1,this.i}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;if(0===e)this.popFront();else if(e===this.i-1)this.popBack();else{let t=[];for(let r=e+1;r<this.i;++r)t.push(this.getElementByPos(r));this.cut(e),this.popBack();let r=this;t.forEach((function(e){r.pushBack(e)}))}return this.i}eraseElementByValue(e){if(0===this.i)return 0;let t=[];for(let r=0;r<this.i;++r){let n=this.getElementByPos(r);n!==e&&t.push(n)}let r=t.length;for(let e=0;e<r;++e)this.setElementByPos(e,t[e]);return this.cut(r-1)}eraseElementByIterator(e){let t=e.o;return this.eraseElementByPos(t),e=e.next()}find(e){for(let t=0;t<this.i;++t)if(this.getElementByPos(t)===e)return new i(t,this);return this.end()}reverse(){let e=0,t=this.i-1;for(;e<t;){let r=this.getElementByPos(e);this.setElementByPos(e,this.getElementByPos(t)),this.setElementByPos(t,r),e+=1,t-=1}}unique(){if(this.i<=1)return this.i;let e=1,t=this.getElementByPos(0);for(let r=1;r<this.i;++r){let n=this.getElementByPos(r);n!==t&&(t=n,this.setElementByPos(e++,n))}for(;this.i>e;)this.popBack();return this.i}sort(e){let t=[];for(let e=0;e<this.i;++e)t.push(this.getElementByPos(e));t.sort(e);for(let e=0;e<this.i;++e)this.setElementByPos(e,t[e])}shrinkToFit(){if(0===this.i)return;let e=[];this.forEach((function(t){e.push(t)})),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let e=0;e<this.P;++e)this.A.push(new Array(this.F));for(let t=0;t<e.length;++t)this.pushBack(e[t])}forEach(e){for(let t=0;t<this.i;++t)e(this.getElementByPos(t),t,this)}[Symbol.iterator](){return function*(){for(let e=0;e<this.i;++e)yield this.getElementByPos(e)}.bind(this)()}};e.default=o})),Zn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.TreeNodeEnableIndex=e.TreeNode=void 0;var t=class{constructor(e,t){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=e,this.l=t}L(){let e=this;if(1===e.ee&&e.tt.tt===e)e=e.W;else if(e.U)for(e=e.U;e.W;)e=e.W;else{let t=e.tt;for(;t.U===e;)e=t,t=e.tt;e=t}return e}B(){let e=this;if(e.W){for(e=e.W;e.U;)e=e.U;return e}{let t=e.tt;for(;t.W===e;)e=t,t=e.tt;return e.W!==t?t:e}}te(){let e=this.tt,t=this.W,r=t.U;return e.tt===this?e.tt=t:e.U===this?e.U=t:e.W=t,t.tt=e,t.U=this,this.tt=t,this.W=r,r&&(r.tt=this),t}se(){let e=this.tt,t=this.U,r=t.W;return e.tt===this?e.tt=t:e.U===this?e.U=t:e.W=t,t.tt=e,t.W=this,this.tt=t,this.U=r,r&&(r.tt=this),t}};e.TreeNode=t;e.TreeNodeEnableIndex=class extends t{constructor(){super(...arguments),this.rt=1}te(){let e=super.te();return this.ie(),e.ie(),e}se(){let e=super.se();return this.ie(),e.ie(),e}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}}})),ei=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Zn(),r=zn(),n=Gn(),i=class extends r.Container{constructor(e=function(e,t){return e<t?-1:e>t?1:0},r=!1){super(),this.Y=void 0,this.v=e,r?(this.re=t.TreeNodeEnableIndex,this.M=function(e,t,r){let n=this.ne(e,t,r);if(n){let e=n.tt;for(;e!==this.h;)e.rt+=1,e=e.tt;let t=this.he(n);if(t){let{parentNode:e,grandParent:r,curNode:n}=t;e.ie(),r.ie(),n.ie()}}return this.i},this.V=function(e){let t=this.fe(e);for(;t!==this.h;)t.rt-=1,t=t.tt}):(this.re=t.TreeNode,this.M=function(e,t,r){let n=this.ne(e,t,r);return n&&this.he(n),this.i},this.V=this.fe),this.h=new this.re}X(e,t){let r=this.h;for(;e;){let n=this.v(e.u,t);if(n<0)e=e.W;else{if(!(n>0))return e;r=e,e=e.U}}return r}Z(e,t){let r=this.h;for(;e;)this.v(e.u,t)<=0?e=e.W:(r=e,e=e.U);return r}$(e,t){let r=this.h;for(;e;){let n=this.v(e.u,t);if(n<0)r=e,e=e.W;else{if(!(n>0))return e;e=e.U}}return r}rr(e,t){let r=this.h;for(;e;)this.v(e.u,t)<0?(r=e,e=e.W):e=e.U;return r}ue(e){for(;;){let t=e.tt;if(t===this.h)return;if(1===e.ee)return void(e.ee=0);if(e===t.U){let r=t.W;if(1===r.ee)r.ee=0,t.ee=1,t===this.Y?this.Y=t.te():t.te();else{if(r.W&&1===r.W.ee)return r.ee=t.ee,t.ee=0,r.W.ee=0,void(t===this.Y?this.Y=t.te():t.te());r.U&&1===r.U.ee?(r.ee=1,r.U.ee=0,r.se()):(r.ee=1,e=t)}}else{let r=t.U;if(1===r.ee)r.ee=0,t.ee=1,t===this.Y?this.Y=t.se():t.se();else{if(r.U&&1===r.U.ee)return r.ee=t.ee,t.ee=0,r.U.ee=0,void(t===this.Y?this.Y=t.se():t.se());r.W&&1===r.W.ee?(r.ee=1,r.W.ee=0,r.te()):(r.ee=1,e=t)}}}}fe(e){if(1===this.i)return this.clear(),this.h;let t=e;for(;t.U||t.W;){if(t.W)for(t=t.W;t.U;)t=t.U;else t=t.U;[e.u,t.u]=[t.u,e.u],[e.l,t.l]=[t.l,e.l],e=t}this.h.U===t?this.h.U=t.tt:this.h.W===t&&(this.h.W=t.tt),this.ue(t);let r=t.tt;return t===r.U?r.U=void 0:r.W=void 0,this.i-=1,this.Y.ee=0,r}oe(e,t){return void 0!==e&&(!(!this.oe(e.U,t)&&!t(e))||this.oe(e.W,t))}he(e){for(;;){let t=e.tt;if(0===t.ee)return;let r=t.tt;if(t===r.U){let n=r.W;if(n&&1===n.ee){if(n.ee=t.ee=0,r===this.Y)return;r.ee=1,e=r;continue}if(e===t.W){if(e.ee=0,e.U&&(e.U.tt=t),e.W&&(e.W.tt=r),t.W=e.U,r.U=e.W,e.U=t,e.W=r,r===this.Y)this.Y=e,this.h.tt=e;else{let t=r.tt;t.U===r?t.U=e:t.W=e}return e.tt=r.tt,t.tt=e,r.tt=e,r.ee=1,{parentNode:t,grandParent:r,curNode:e}}t.ee=0,r===this.Y?this.Y=r.se():r.se(),r.ee=1}else{let n=r.U;if(n&&1===n.ee){if(n.ee=t.ee=0,r===this.Y)return;r.ee=1,e=r;continue}if(e===t.U){if(e.ee=0,e.U&&(e.U.tt=r),e.W&&(e.W.tt=t),r.W=e.U,t.U=e.W,e.U=r,e.W=t,r===this.Y)this.Y=e,this.h.tt=e;else{let t=r.tt;t.U===r?t.U=e:t.W=e}return e.tt=r.tt,t.tt=e,r.tt=e,r.ee=1,{parentNode:t,grandParent:r,curNode:e}}t.ee=0,r===this.Y?this.Y=r.te():r.te(),r.ee=1}return}}ne(e,t,r){if(void 0===this.Y)return this.i+=1,this.Y=new this.re(e,t),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,void(this.h.W=this.Y);let n,i=this.h.U,o=this.v(i.u,e);if(0!==o){if(o>0)i.U=new this.re(e,t),i.U.tt=i,n=i.U,this.h.U=n;else{let i=this.h.W,o=this.v(i.u,e);if(0===o)return void(i.l=t);if(o<0)i.W=new this.re(e,t),i.W.tt=i,n=i.W,this.h.W=n;else{if(void 0!==r){let i=r.o;if(i!==this.h){let r=this.v(i.u,e);if(0===r)return void(i.l=t);if(r>0){let r=i.L(),o=this.v(r.u,e);if(0===o)return void(r.l=t);o<0&&(n=new this.re(e,t),void 0===r.W?(r.W=n,n.tt=r):(i.U=n,n.tt=i))}}}if(void 0===n)for(n=this.Y;;){let r=this.v(n.u,e);if(r>0){if(void 0===n.U){n.U=new this.re(e,t),n.U.tt=n,n=n.U;break}n=n.U}else{if(!(r<0))return void(n.l=t);if(void 0===n.W){n.W=new this.re(e,t),n.W.tt=n,n=n.W;break}n=n.W}}}}return this.i+=1,n}i.l=t}I(e,t){for(;e;){let r=this.v(e.u,t);if(r<0)e=e.W;else{if(!(r>0))return e;e=e.U}}return e||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(e,t){let r=e.o;if(r===this.h&&(0,n.throwIteratorAccessError)(),1===this.i)return r.u=t,!0;if(r===this.h.U)return this.v(r.B().u,t)>0&&(r.u=t,!0);if(r===this.h.W)return this.v(r.L().u,t)<0&&(r.u=t,!0);let i=r.L().u;if(this.v(i,t)>=0)return!1;let o=r.B().u;return!(this.v(o,t)<=0)&&(r.u=t,!0)}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=0,r=this;return this.oe(this.Y,(function(n){return e===t?(r.V(n),!0):(t+=1,!1)})),this.i}eraseElementByKey(e){if(0===this.i)return!1;let t=this.I(this.Y,e);return t!==this.h&&(this.V(t),!0)}eraseElementByIterator(e){let t=e.o;t===this.h&&(0,n.throwIteratorAccessError)();let r=void 0===t.W;return 0===e.iteratorType?r&&e.next():(!r||void 0===t.U)&&e.next(),this.V(t),e}forEach(e){let t=0;for(let r of this)e(r,t++,this)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t,r=0;for(let n of this){if(r===e){t=n;break}r+=1}return t}getHeight(){if(0===this.i)return 0;let e=function(t){return t?Math.max(e(t.U),e(t.W))+1:0};return e(this.Y)}};e.default=i})),ti=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=zn(),r=Gn(),n=class extends t.ContainerIterator{constructor(e,t,n){super(n),this.o=e,this.h=t,0===this.iteratorType?(this.pre=function(){return this.o===this.h.U&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let e=this.o,t=this.h.tt;if(e===this.h)return t?t.rt-1:0;let r=0;for(e.U&&(r+=e.U.rt);e!==t;){let t=e.tt;e===t.W&&(r+=1,t.U&&(r+=t.U.rt)),e=t}return r}};e.default=n})),ri=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=i(ei()),r=i(ti()),n=Gn();function i(e){return e&&e.t?e:{default:e}}var o=class e extends r.default{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){return this.o===this.h&&(0,n.throwIteratorAccessError)(),this.o.u}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends t.default{constructor(e=[],t,r){super(t,r);let n=this;e.forEach((function(e){n.insert(e)}))}*K(e){void 0!==e&&(yield*this.K(e.U),yield e.u,yield*this.K(e.W))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(e,t){return this.M(e,void 0,t)}find(e){let t=this.I(this.Y,e);return new o(t,this.h,this)}lowerBound(e){let t=this.X(this.Y,e);return new o(t,this.h,this)}upperBound(e){let t=this.Z(this.Y,e);return new o(t,this.h,this)}reverseLowerBound(e){let t=this.$(this.Y,e);return new o(t,this.h,this)}reverseUpperBound(e){let t=this.rr(this.Y,e);return new o(t,this.h,this)}union(e){let t=this;return e.forEach((function(e){t.insert(e)})),this.i}[Symbol.iterator](){return this.K(this.Y)}};e.default=s})),ni=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=i(ei()),r=i(ti()),n=Gn();function i(e){return e&&e.t?e:{default:e}}var o=class e extends r.default{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){this.o===this.h&&(0,n.throwIteratorAccessError)();let e=this;return new Proxy([],{get:(t,r)=>"0"===r?e.o.u:"1"===r?e.o.l:void 0,set(t,r,n){if("1"!==r)throw new TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends t.default{constructor(e=[],t,r){super(t,r);let n=this;e.forEach((function(e){n.setElement(e[0],e[1])}))}*K(e){void 0!==e&&(yield*this.K(e.U),yield[e.u,e.l],yield*this.K(e.W))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(0===this.i)return;let e=this.h.U;return[e.u,e.l]}back(){if(0===this.i)return;let e=this.h.W;return[e.u,e.l]}lowerBound(e){let t=this.X(this.Y,e);return new o(t,this.h,this)}upperBound(e){let t=this.Z(this.Y,e);return new o(t,this.h,this)}reverseLowerBound(e){let t=this.$(this.Y,e);return new o(t,this.h,this)}reverseUpperBound(e){let t=this.rr(this.Y,e);return new o(t,this.h,this)}setElement(e,t,r){return this.M(e,t,r)}find(e){let t=this.I(this.Y,e);return new o(t,this.h,this)}getElementByKey(e){return this.I(this.Y,e).l}union(e){let t=this;return e.forEach((function(e){t.setElement(e[0],e[1])})),this.i}[Symbol.iterator](){return this.K(this.Y)}};e.default=s})),ii=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=function(e){let t=typeof e;return"object"===t&&null!==e||"function"===t}})),oi=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.HashContainerIterator=e.HashContainer=void 0;var t,r=zn(),n=(t=ii())&&t.t?t:{default:t},i=Gn();var o=class extends r.ContainerIterator{constructor(e,t,r){super(r),this.o=e,this.h=t,0===this.iteratorType?(this.pre=function(){return this.o.L===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this})}};e.HashContainerIterator=o;var s=class extends r.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(e){let{L:t,B:r}=e;t.B=r,r.L=t,e===this.p&&(this.p=r),e===this._&&(this._=t),this.i-=1}M(e,t,r){let i;if(void 0===r&&(r=(0,n.default)(e)),r){let r=e[this.HASH_TAG];if(void 0!==r)return this.H[r].l=t,this.i;Object.defineProperty(e,this.HASH_TAG,{value:this.H.length,configurable:!0}),i={u:e,l:t,L:this._,B:this.h},this.H.push(i)}else{let r=this.g[e];if(r)return r.l=t,this.i;i={u:e,l:t,L:this._,B:this.h},this.g[e]=i}return 0===this.i?(this.p=i,this.h.B=i):this._.B=i,this._=i,this.h.L=i,++this.i}I(e,t){if(void 0===t&&(t=(0,n.default)(e)),t){let t=e[this.HASH_TAG];return void 0===t?this.h:this.H[t]}return this.g[e]||this.h}clear(){let e=this.HASH_TAG;this.H.forEach((function(t){delete t.u[e]})),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(e,t){let r;if(void 0===t&&(t=(0,n.default)(e)),t){let t=e[this.HASH_TAG];if(void 0===t)return!1;delete e[this.HASH_TAG],r=this.H[t],delete this.H[t]}else{if(r=this.g[e],void 0===r)return!1;delete this.g[e]}return this.V(r),!0}eraseElementByIterator(e){let t=e.o;return t===this.h&&(0,i.throwIteratorAccessError)(),this.V(t),e.next()}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return this.V(t),this.i}};e.HashContainer=s})),si=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=oi(),r=Gn(),n=class e extends t.HashContainerIterator{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.u}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},i=class extends t.HashContainer{constructor(e=[]){super();let t=this;e.forEach((function(e){t.insert(e)}))}begin(){return new n(this.p,this.h,this)}end(){return new n(this.h,this.h,this)}rBegin(){return new n(this._,this.h,this,1)}rEnd(){return new n(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(e,t){return this.M(e,void 0,t)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return t.u}find(e,t){let r=this.I(e,t);return new n(r,this.h,this)}forEach(e){let t=0,r=this.p;for(;r!==this.h;)e(r.u,t++,this),r=r.B}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield e.u,e=e.B}.bind(this)()}};e.default=i})),ai=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=oi(),n=(t=ii())&&t.t?t:{default:t},i=Gn();var o=class e extends r.HashContainerIterator{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){this.o===this.h&&(0,i.throwIteratorAccessError)();let e=this;return new Proxy([],{get:(t,r)=>"0"===r?e.o.u:"1"===r?e.o.l:void 0,set(t,r,n){if("1"!==r)throw new TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends r.HashContainer{constructor(e=[]){super();let t=this;e.forEach((function(e){t.setElement(e[0],e[1])}))}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(0!==this.i)return[this.p.u,this.p.l]}back(){if(0!==this.i)return[this._.u,this._.l]}setElement(e,t,r){return this.M(e,t,r)}getElementByKey(e,t){if(void 0===t&&(t=(0,n.default)(e)),t){let t=e[this.HASH_TAG];return void 0!==t?this.H[t].l:void 0}let r=this.g[e];return r?r.l:void 0}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return[t.u,t.l]}find(e,t){let r=this.I(e,t);return new o(r,this.h,this)}forEach(e){let t=0,r=this.p;for(;r!==this.h;)e([r.u,r.l],t++,this),r=r.B}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield[e.u,e.l],e=e.B}.bind(this)()}};e.default=s})),li=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),Object.defineProperty(e,"Deque",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"HashMap",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"HashSet",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"LinkList",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"OrderedMap",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"OrderedSet",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"PriorityQueue",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"Queue",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"Stack",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"Vector",{enumerable:!0,get:function(){return i.default}});var t=h(Hn()),r=h(qn()),n=h($n()),i=h(Yn()),o=h(Jn()),s=h(Xn()),a=h(ri()),l=h(ni()),u=h(si()),c=h(ai());function h(e){return e&&e.t?e:{default:e}}})),ui=u(((e,t)=>{nt(),ze(),f();var r=li().OrderedSet,n=An()("number-allocator:trace"),i=An()("number-allocator:error");function o(e,t){this.low=e,this.high=t}function s(e,t){if(!(this instanceof s))return new s(e,t);this.min=e,this.max=t,this.ss=new r([],((e,t)=>e.compare(t))),n("Create"),this.clear()}o.prototype.equals=function(e){return this.low===e.low&&this.high===e.high},o.prototype.compare=function(e){return this.low<e.low&&this.high<e.low?-1:e.low<this.low&&e.high<this.low?1:0},s.prototype.firstVacant=function(){return 0===this.ss.size()?null:this.ss.front().low},s.prototype.alloc=function(){if(0===this.ss.size())return n("alloc():empty"),null;let e=this.ss.begin(),t=e.pointer.low,r=e.pointer.high,i=t;return i+1<=r?this.ss.updateKeyByIterator(e,new o(t+1,r)):this.ss.eraseElementByPos(0),n("alloc():"+i),i},s.prototype.use=function(e){let t=new o(e,e),r=this.ss.lowerBound(t);if(!r.equals(this.ss.end())){let i=r.pointer.low,s=r.pointer.high;return r.pointer.equals(t)?(this.ss.eraseElementByIterator(r),n("use():"+e),!0):!(i>e)&&(i===e?(this.ss.updateKeyByIterator(r,new o(i+1,s)),n("use():"+e),!0):s===e?(this.ss.updateKeyByIterator(r,new o(i,s-1)),n("use():"+e),!0):(this.ss.updateKeyByIterator(r,new o(e+1,s)),this.ss.insert(new o(i,e-1)),n("use():"+e),!0))}return n("use():failed"),!1},s.prototype.free=function(e){if(e<this.min||e>this.max)return void i("free():"+e+" is out of range");let t=new o(e,e),r=this.ss.upperBound(t);if(r.equals(this.ss.end())){if(r.equals(this.ss.begin()))return void this.ss.insert(t);r.pre();let n=r.pointer.high;r.pointer.high+1===e?this.ss.updateKeyByIterator(r,new o(n,e)):this.ss.insert(t)}else if(r.equals(this.ss.begin()))if(e+1===r.pointer.low){let t=r.pointer.high;this.ss.updateKeyByIterator(r,new o(e,t))}else this.ss.insert(t);else{let n=r.pointer.low,i=r.pointer.high;r.pre();let s=r.pointer.low;r.pointer.high+1===e?e+1===n?(this.ss.eraseElementByIterator(r),this.ss.updateKeyByIterator(r,new o(s,i))):this.ss.updateKeyByIterator(r,new o(s,e)):e+1===n?(this.ss.eraseElementByIterator(r.next()),this.ss.insert(new o(e,i))):this.ss.insert(t)}n("free():"+e)},s.prototype.clear=function(){n("clear()"),this.ss.clear(),this.ss.insert(new o(this.min,this.max))},s.prototype.intervalCount=function(){return this.ss.size()},s.prototype.dump=function(){console.log("length:"+this.ss.size());for(let e of this.ss)console.log(e)},t.exports=s})),ci=u(((e,t)=>{nt(),ze(),f();var r=ui();t.exports.NumberAllocator=r})),hi=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});var t=Vn(),r=ci();e.default=class{constructor(e){e>0&&(this.aliasToTopic=new t.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new r.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,t){if(0===t||t>this.max)return!1;let r=this.aliasToTopic.get(t);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(t,e),this.topicToAlias[e]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.size,!0}getTopicByAlias(e){return this.aliasToTopic.get(e)}getAliasByTopic(e){let t=this.topicToAlias[e];return typeof t<"u"&&this.aliasToTopic.get(t),t}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}}})),fi=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=Fn(),n=t(hi()),i=Dn();e.default=(e,t)=>{e.log("_handleConnack");let{options:o}=e,s=5===o.protocolVersion?t.reasonCode:t.returnCode;if(clearTimeout(e.connackTimer),delete e.topicAliasSend,t.properties){if(t.properties.topicAliasMaximum){if(t.properties.topicAliasMaximum>65535)return void e.emit("error",new Error("topicAliasMaximum from broker is out of range"));t.properties.topicAliasMaximum>0&&(e.topicAliasSend=new n.default(t.properties.topicAliasMaximum))}t.properties.serverKeepAlive&&o.keepalive&&(o.keepalive=t.properties.serverKeepAlive),t.properties.maximumPacketSize&&(o.properties||(o.properties={}),o.properties.maximumPacketSize=t.properties.maximumPacketSize)}if(0===s)e.reconnecting=!1,e._onConnect(t);else if(s>0){let t=new i.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[s]}`,s);e.emit("error",t)}}})),di=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});e.default=(e,t,r)=>{e.log("handling pubrel packet");let n=typeof r<"u"?r:e.noop,{messageId:i}=t,o={cmd:"pubcomp",messageId:i};e.incomingStore.get(t,((t,r)=>{t?e._sendPacket(o,n):(e.emit("message",r.topic,r.payload,r),e.handleMessage(r,(t=>{if(t)return n(t);e.incomingStore.del(r,e.noop),e._sendPacket(o,n)})))}))}})),pi=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(Nn()),n=t(Wn()),i=t(fi()),o=t(Fn()),s=t(di());e.default=(e,t,a)=>{let{options:l}=e;if(5===l.protocolVersion&&l.properties&&l.properties.maximumPacketSize&&l.properties.maximumPacketSize<t.length)return e.emit("error",new Error(`exceeding packets size ${t.cmd}`)),e.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",t),t.cmd){case"publish":(0,r.default)(e,t,a);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":e.reschedulePing(),(0,o.default)(e,t),a();break;case"pubrel":e.reschedulePing(),(0,s.default)(e,t,a);break;case"connack":(0,i.default)(e,t),a();break;case"auth":e.reschedulePing(),(0,n.default)(e,t),a();break;case"pingresp":e.log("_handlePacket :: received pingresp"),e.reschedulePing(),a();break;case"disconnect":e.emit("disconnect",t),a();break;default:e.log("_handlePacket :: unknown command"),a()}}})),gi=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.TypedEventEmitter=void 0;var r=t((jt(),h(Mt))),n=Dn(),i=class{};e.TypedEventEmitter=i,(0,n.applyMixin)(i,r.default)})),yi=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0}),e.isReactNativeBrowser=e.isWebWorker=void 0;var t,r=()=>{var e,t;return!("object"!=typeof self||null===(t=null===(e=self?.constructor)||void 0===e?void 0:e.name)||void 0===t||!t.includes("WorkerGlobalScope"))},i=()=>typeof n<"u"&&"ReactNative"===n.product,o=typeof window<"u"&&(typeof n<"u"&&(null===(t=n.userAgent)||void 0===t?void 0:t.toLowerCase().indexOf(" electron/"))>-1&&null!=d&&d.versions?!Object.prototype.hasOwnProperty.call(d.versions,"electron"):typeof window.document<"u")||r()||i();e.isWebWorker=r(),e.isReactNativeBrowser=i(),e.default=o})),bi=u(((e,t)=>{var n,i;nt(),ze(),f(),n=e,i=function(e){var t,r=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,n=536870912,i=2*n,o=new WeakMap,s=function(e,t){return function(o){var s=t.get(o),a=void 0===s?o.size:s<i?s+1:0;if(!o.has(a))return e(o,a);if(o.size<n){for(;o.has(a);)a=Math.floor(Math.random()*i);return e(o,a)}if(o.size>r)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;o.has(a);)a=Math.floor(Math.random()*r);return e(o,a)}}((t=o,function(e,r){return t.set(e,r),r}),o),a=function(e){return function(t){var r=e(t);return t.add(r),r}}(s);e.addUniqueNumber=a,e.generateUniqueNumber=s},"object"==typeof e&&typeof t<"u"?i(e):"function"==typeof define&&r.amdO?define(["exports"],i):i((n=typeof globalThis<"u"?globalThis:n||self).fastUniqueNumbers={})})),vi=u(((e,t)=>{var n,i;nt(),ze(),f(),n=e,i=function(e,t){e.load=function(e){var r=new Map([[0,function(){}]]),n=new Map([[0,function(){}]]),i=new Map,o=new Worker(e);return o.addEventListener("message",(function(e){var t=e.data;if(function(e){return void 0!==e.method&&"call"===e.method}(t)){var o=t.params,s=o.timerId,a=o.timerType;if("interval"===a){var l=r.get(s);if("number"==typeof l){var u=i.get(l);if(void 0===u||u.timerId!==s||u.timerType!==a)throw new Error("The timer is in an undefined state.")}else{if(!(typeof l<"u"))throw new Error("The timer is in an undefined state.");l()}}else if("timeout"===a){var c=n.get(s);if("number"==typeof c){var h=i.get(c);if(void 0===h||h.timerId!==s||h.timerType!==a)throw new Error("The timer is in an undefined state.")}else{if(!(typeof c<"u"))throw new Error("The timer is in an undefined state.");c(),n.delete(s)}}}else{if(!function(e){return null===e.error&&"number"==typeof e.id}(t)){var f=t.error.message;throw new Error(f)}var d=t.id,p=i.get(d);if(void 0===p)throw new Error("The timer is in an undefined state.");var g=p.timerId,y=p.timerType;i.delete(d),"interval"===y?r.delete(g):n.delete(g)}})),{clearInterval:function(e){var n=t.generateUniqueNumber(i);i.set(n,{timerId:e,timerType:"interval"}),r.set(e,n),o.postMessage({id:n,method:"clear",params:{timerId:e,timerType:"interval"}})},clearTimeout:function(e){var r=t.generateUniqueNumber(i);i.set(r,{timerId:e,timerType:"timeout"}),n.set(e,r),o.postMessage({id:r,method:"clear",params:{timerId:e,timerType:"timeout"}})},setInterval:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=t.generateUniqueNumber(r);return r.set(i,(function(){e(),"function"==typeof r.get(i)&&o.postMessage({id:null,method:"set",params:{delay:n,now:performance.now(),timerId:i,timerType:"interval"}})})),o.postMessage({id:null,method:"set",params:{delay:n,now:performance.now(),timerId:i,timerType:"interval"}}),i},setTimeout:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=t.generateUniqueNumber(n);return n.set(i,e),o.postMessage({id:null,method:"set",params:{delay:r,now:performance.now(),timerId:i,timerType:"timeout"}}),i}}}},"object"==typeof e&&typeof t<"u"?i(e,bi()):"function"==typeof define&&r.amdO?define(["exports","fast-unique-numbers"],i):i((n=typeof globalThis<"u"?globalThis:n||self).workerTimersBroker={},n.fastUniqueNumbers)})),mi=u(((e,t)=>{var n,i;nt(),ze(),f(),n=e,i=function(e,t){var r,n,i,o=(r=t.load,n='(()=>{var e={472:(e,t,r)=>{var o,i;void 0===(i="function"==typeof(o=function(){"use strict";var e=new Map,t=new Map,r=function(t){var r=e.get(t);if(void 0===r)throw new Error(\'There is no interval scheduled with the given id "\'.concat(t,\'".\'));clearTimeout(r),e.delete(t)},o=function(e){var r=t.get(e);if(void 0===r)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(r),t.delete(e)},i=function(e,t){var r,o=performance.now();return{expected:o+(r=e-Math.max(0,o-t)),remainingDelay:r}},n=function e(t,r,o,i){var n=performance.now();n>o?postMessage({id:null,method:"call",params:{timerId:r,timerType:i}}):t.set(r,setTimeout(e,o-n,t,r,o,i))},a=function(t,r,o){var a=i(t,o),s=a.expected,d=a.remainingDelay;e.set(r,setTimeout(n,d,e,r,s,"interval"))},s=function(e,r,o){var a=i(e,o),s=a.expected,d=a.remainingDelay;t.set(r,setTimeout(n,d,t,r,s,"timeout"))};addEventListener("message",(function(e){var t=e.data;try{if("clear"===t.method){var i=t.id,n=t.params,d=n.timerId,c=n.timerType;if("interval"===c)r(d),postMessage({error:null,id:i});else{if("timeout"!==c)throw new Error(\'The given type "\'.concat(c,\'" is not supported\'));o(d),postMessage({error:null,id:i})}}else{if("set"!==t.method)throw new Error(\'The given method "\'.concat(t.method,\'" is not supported\'));var u=t.params,l=u.delay,p=u.now,m=u.timerId,v=u.timerType;if("interval"===v)a(l,m,p);else{if("timeout"!==v)throw new Error(\'The given type "\'.concat(v,\'" is not supported\'));s(l,m,p)}}}catch(e){postMessage({error:{message:e.message},id:t.id,result:null})}}))})?o.call(t,r,t,e):o)||(e.exports=i)}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();',i=null,function(){if(null!==i)return i;var e=new Blob([n],{type:"application/javascript; charset=utf-8"}),t=URL.createObjectURL(e);return i=r(t),setTimeout((function(){return URL.revokeObjectURL(t)})),i});e.clearInterval=function(e){return o().clearInterval(e)},e.clearTimeout=function(e){return o().clearTimeout(e)},e.setInterval=function(){var e;return(e=o()).setInterval.apply(e,arguments)},e.setTimeout=function(){var e;return(e=o()).setTimeout.apply(e,arguments)}},"object"==typeof e&&typeof t<"u"?i(e,vi()):"function"==typeof define&&r.amdO?define(["exports","worker-timers-broker"],i):i((n=typeof globalThis<"u"?globalThis:n||self).workerTimers={},n.workerTimersBroker)})),wi=u((e=>{nt(),ze(),f();var t=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};Object.defineProperty(e,"__esModule",{value:!0});var i=n(yi()),o=mi(),s={set:o.setInterval,clear:o.clearInterval},a={set:(e,t)=>setInterval(e,t),clear:e=>clearInterval(e)};e.default=e=>{switch(e){case"native":return a;case"worker":return s;default:return!i.default||i.isWebWorker||i.isReactNativeBrowser?a:s}}})),_i=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(wi());e.default=class{get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(e,t){this.destroyed=!1,this.client=e,this.timer=(0,r.default)(t),this.setKeepalive(e.options.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(e){if(e*=1e3,isNaN(e)||e<=0||e>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${e}`);this._keepalive=e,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${e}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let e=Math.ceil(1.5*this._keepalive);this._keepaliveTimeoutTimestamp=Date.now()+e,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set((()=>{this.destroyed||(this.counter+=1,2===this.counter?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())}),this._intervalEvery)}}})),Ei=u((e=>{nt(),ze(),f();var t=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var o=i(it()),s=i(Mn()),a=i(Pn()),l=bn(),u=i(Bn()),c=n(Ln()),h=i(An()),d=i(Un()),p=i(pi()),g=Dn(),y=gi(),b=i(_i()),v=n(yi()),m=globalThis.setImmediate||((...e)=>{let t=e.shift();(0,g.nextTick)((()=>{t(...e)}))}),w={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0,writeCache:!0,timerVariant:"auto"},_=class e extends y.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(t,r){super(),this.options=r||{};for(let e in w)typeof this.options[e]>"u"?this.options[e]=w[e]:this.options[e]=r[e];this.log=this.options.log||(0,h.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",e.VERSION),v.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",v.default?"browser":"node"),this.log("MqttClient :: options.protocol",r.protocol),this.log("MqttClient :: options.protocolVersion",r.protocolVersion),this.log("MqttClient :: options.username",r.username),this.log("MqttClient :: options.keepalive",r.keepalive),this.log("MqttClient :: options.reconnectPeriod",r.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",r.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",r.properties?r.properties.topicAliasMaximum:void 0),this.options.clientId="string"==typeof r.clientId?r.clientId:e.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===r.protocolVersion&&r.customHandleAcks?r.customHandleAcks:(...e)=>{e[3](null,0)},this.options.writeCache||(s.default.writeToStream.cacheNumbers=!1),this.streamBuilder=t,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new a.default:this.options.messageIdProvider,this.outgoingStore=r.outgoingStore||new d.default,this.incomingStore=r.incomingStore||new d.default,this.queueQoSZero=void 0===r.queueQoSZero||r.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,r.properties&&r.properties.topicAliasMaximum>0&&(r.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new o.default(r.properties.topicAliasMaximum)),this.on("connect",(()=>{let{queue:e}=this,t=()=>{let r=e.shift();this.log("deliver :: entry %o",r);let n=null;if(!r)return void this._resubscribe();n=r.packet,this.log("deliver :: call _sendPacket for %o",n);let i=!0;n.messageId&&0!==n.messageId&&(this.messageIdProvider.register(n.messageId)||(i=!1)),i?this._sendPacket(n,(e=>{r.cb&&r.cb(e),t()})):(this.log("messageId: %d has already used. The message is skipped and removed.",n.messageId),t())};this.log("connect :: sending queued packets"),t()})),this.on("close",(()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()})),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(e,t){t()}handleMessage(e,t){t()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var e;let t=new l.Writable,r=s.default.parser(this.options),n=null,i=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),r.on("packet",(e=>{this.log("parser :: on packet push to packets array."),i.push(e)}));let o=()=>{this.log("work :: getting next packet in queue");let e=i.shift();if(e)this.log("work :: packet pulled from queue"),(0,p.default)(this,e,a);else{this.log("work :: no packets in queue");let e=n;n=null,this.log("work :: done flag is %s",!!e),e&&e()}},a=()=>{if(i.length)(0,g.nextTick)(o);else{let e=n;n=null,e()}};t._write=(e,t,i)=>{n=i,this.log("writable stream :: parsing buffer"),r.parse(e),o()};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(t),this.stream.on("error",(e=>{this.log("streamErrorHandler :: error",e.message),e.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",e)):this.noop(e)})),this.stream.on("close",(()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")})),this.log("connect: sending packet `connect`");let u={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(u.will=Object.assign(Object.assign({},this.options.will),{payload:null===(e=this.options.will)||void 0===e?void 0:e.payload})),this.topicAliasRecv&&(u.properties||(u.properties={}),this.topicAliasRecv&&(u.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(u),r.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end((()=>this.emit("error",new Error("Packet has no Authentication Method")))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket){let e=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(e)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout((()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0)}),this.options.connectTimeout),this}publish(e,t,r,n){this.log("publish :: message `%s` to topic `%s`",t,e);let{options:i}=this;"function"==typeof r&&(n=r,r=null),r=r||{},r=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),r);let{qos:o,retain:s,dup:a,properties:l,cbStorePut:u}=r;if(this._checkDisconnecting(n))return this;let c=()=>{let r=0;if((1===o||2===o)&&(r=this._nextId(),null===r))return this.log("No messageId left"),!1;let c={cmd:"publish",topic:e,payload:t,qos:o,retain:s,messageId:r,dup:a};switch(5===i.protocolVersion&&(c.properties=l),this.log("publish :: qos",o),o){case 1:case 2:this.outgoing[c.messageId]={volatile:!1,cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",c.cmd),this._sendPacket(c,void 0,u);break;default:this.log("MqttClient:publish: packet cmd: %s",c.cmd),this._sendPacket(c,n,u)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!c())&&this._storeProcessingQueue.push({invoke:c,cbStorePut:r.cbStorePut,callback:n}),this}publishAsync(e,t,r){return new Promise(((n,i)=>{this.publish(e,t,r,((e,t)=>{e?i(e):n(t)}))}))}subscribe(e,t,r){let n=this.options.protocolVersion;"function"==typeof t&&(r=t),r=r||this.noop;let i=!1,o=[];"string"==typeof e?o=e=[e]:Array.isArray(e)?o=e:"object"==typeof e&&(i=e.resubscribe,delete e.resubscribe,o=Object.keys(e));let s=c.validateTopics(o);if(null!==s)return m(r,new Error(`Invalid topic ${s}`)),this;if(this._checkDisconnecting(r))return this.log("subscribe: discconecting true"),this;let a={qos:0};5===n&&(a.nl=!1,a.rap=!1,a.rh=0);let l=(t=Object.assign(Object.assign({},a),t)).properties,u=[],h=(e,r)=>{if(r=r||t,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,e)||this._resubscribeTopics[e].qos<r.qos||i){let t={topic:e,qos:r.qos};5===n&&(t.nl=r.nl,t.rap=r.rap,t.rh=r.rh,t.properties=l),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",t.topic,t.qos),u.push(t)}};if(Array.isArray(e)?e.forEach((e=>{this.log("subscribe: array topic %s",e),h(e)})):Object.keys(e).forEach((t=>{this.log("subscribe: object topic %s, %o",t,e[t]),h(t,e[t])})),!u.length)return r(null,[]),this;let f=()=>{let e=this._nextId();if(null===e)return this.log("No messageId left"),!1;let t={cmd:"subscribe",subscriptions:u,messageId:e};if(l&&(t.properties=l),this.options.resubscribe){this.log("subscribe :: resubscribe true");let e=[];u.forEach((t=>{if(this.options.reconnectPeriod>0){let r={qos:t.qos};5===n&&(r.nl=t.nl||!1,r.rap=t.rap||!1,r.rh=t.rh||0,r.properties=t.properties),this._resubscribeTopics[t.topic]=r,e.push(t.topic)}})),this.messageIdToTopic[t.messageId]=e}return this.outgoing[t.messageId]={volatile:!0,cb(e,t){if(!e){let{granted:e}=t;for(let t=0;t<e.length;t+=1)u[t].qos=e[t]}r(e,u)}},this.log("subscribe :: call _sendPacket"),this._sendPacket(t),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!f())&&this._storeProcessingQueue.push({invoke:f,callback:r}),this}subscribeAsync(e,t){return new Promise(((r,n)=>{this.subscribe(e,t,((e,t)=>{e?n(e):r(t)}))}))}unsubscribe(e,t,r){"string"==typeof e&&(e=[e]),"function"==typeof t&&(r=t),r=r||this.noop;let n=c.validateTopics(e);if(null!==n)return m(r,new Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(r))return this;let i=()=>{let n=this._nextId();if(null===n)return this.log("No messageId left"),!1;let i={cmd:"unsubscribe",messageId:n,unsubscriptions:[]};return"string"==typeof e?i.unsubscriptions=[e]:Array.isArray(e)&&(i.unsubscriptions=e),this.options.resubscribe&&i.unsubscriptions.forEach((e=>{delete this._resubscribeTopics[e]})),"object"==typeof t&&t.properties&&(i.properties=t.properties),this.outgoing[i.messageId]={volatile:!0,cb:r},this.log("unsubscribe: call _sendPacket"),this._sendPacket(i),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!i())&&this._storeProcessingQueue.push({invoke:i,callback:r}),this}unsubscribeAsync(e,t){return new Promise(((r,n)=>{this.unsubscribe(e,t,((e,t)=>{e?n(e):r(t)}))}))}end(e,t,r){this.log("end :: (%s)",this.options.clientId),(null==e||"boolean"!=typeof e)&&(r=r||t,t=e,e=!1),"object"!=typeof t&&(r=r||t,t=null),this.log("end :: cb? %s",!!r),(!r||"function"!=typeof r)&&(r=this.noop);let n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close((e=>{this.outgoingStore.close((t=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),r){let n=e||t;this.log("end :: closeStores: invoking callback with args"),r(n)}}))})),this._deferredReconnect&&this._deferredReconnect()},i=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,e),this._cleanUp(e,(()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,g.nextTick)(n)}),t)};return this.disconnecting?(r(),this):(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,i,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),i()),this)}endAsync(e,t){return new Promise(((r,n)=>{this.end(e,t,(e=>{e?n(e):r()}))}))}removeOutgoingMessage(e){if(this.outgoing[e]){let{cb:t}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,(()=>{t(new Error("Message removed"))}))}return this}reconnect(e){this.log("client reconnect");let t=()=>{e?(this.options.incomingStore=e.incomingStore,this.options.outgoingStore=e.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new d.default,this.outgoingStore=this.options.outgoingStore||new d.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=t:t(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach((e=>{this.outgoing[e].volatile&&"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])})))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach((e=>{"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])})))}_removeTopicAliasAndRecoverTopicName(e){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",t,r),0===r.length){if(typeof t>"u")return new Error("Unregistered Topic Alias");if(r=this.topicAliasSend.getTopicByAlias(t),typeof r>"u")return new Error("Unregistered Topic Alias");e.topic=r}t&&delete e.properties.topicAlias}_checkDisconnecting(e){return this.disconnecting&&(e&&e!==this.noop?e(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end((()=>{this.connect()})),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval((()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()}),this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(e,t,r={}){if(t&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",t)),this.log("_cleanUp :: forced? %s",e),e)0===this.options.reconnectPeriod&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let e=Object.assign({cmd:"disconnect"},r);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(e,(()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),m((()=>{this.stream.end((()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)}))}))}))}!this.disconnecting&&!this.reconnecting&&(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),t&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",t),t())}_storeAndSend(e,t,r){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let n,i=e;if("publish"===i.cmd&&(i=(0,u.default)(e),n=this._removeTopicAliasAndRecoverTopicName(i),n))return t&&t(n);this.outgoingStore.put(i,(n=>{if(n)return t&&t(n);r(),this._writePacket(e,t)}))}_applyTopicAlias(e){if(5===this.options.protocolVersion&&"publish"===e.cmd){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.topicAliasSend)if(t){if(0!==r.length&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",r,t),!this.topicAliasSend.put(r,t)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}else 0!==r.length&&(this.options.autoAssignTopicAlias?(t=this.topicAliasSend.getAliasByTopic(r),t?(e.topic="",e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:t}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",r,t)):(t=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(r,t),e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:t}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",r,t))):this.options.autoUseTopicAlias&&(t=this.topicAliasSend.getAliasByTopic(r),t&&(e.topic="",e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:t}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",r,t))));else if(t)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}}_noop(e){this.log("noop ::",e)}_writePacket(e,t){this.log("_writePacket :: packet: %O",e),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",e),this.log("_writePacket :: writing to stream");let r=s.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",r),!r&&t&&t!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",t)):t&&(this.log("_writePacket :: invoking cb"),t())}_sendPacket(e,t,r,n){this.log("_sendPacket :: (%s) :: start",this.options.clientId),r=r||this.noop,t=t||this.noop;let i=this._applyTopicAlias(e);if(i)t(i);else{if(!this.connected)return"auth"===e.cmd?void this._writePacket(e,t):(this.log("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(e,t,r));if(n)this._writePacket(e,t);else{switch(e.cmd){case"publish":break;case"pubrel":return void this._storeAndSend(e,t,r);default:return void this._writePacket(e,t)}switch(e.qos){case 2:case 1:this._storeAndSend(e,t,r);break;default:this._writePacket(e,t)}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}}}_storePacket(e,t,r){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!t),r=r||this.noop;let n=e;if("publish"===n.cmd){n=(0,u.default)(e);let r=this._removeTopicAliasAndRecoverTopicName(n);if(r)return t&&t(r)}let i=n.qos||0;0===i&&this.queueQoSZero||"publish"!==n.cmd?this.queue.push({packet:n,cb:t}):i>0?(t=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,(e=>{if(e)return t&&t(e);r()}))):t&&t(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new b.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(){this.keepaliveManager&&this.options.keepalive&&this.options.reschedulePings&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.emit("error",new Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}_resubscribe(){this.log("_resubscribe");let e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&e.length>0)if(this.options.resubscribe)if(5===this.options.protocolVersion){this.log("_resubscribe: protocolVersion 5");for(let t=0;t<e.length;t++){let r={};r[e[t]]=this._resubscribeTopics[e[t]],r.resubscribe=!0,this.subscribe(r,{properties:r[e[t]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(e){if(this.disconnected)return void this.emit("connect",e);this.connackPacket=e,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let t=()=>{let r=this.outgoingStore.createStream(),n=()=>{r.destroy(),r=null,this._flushStoreProcessingQueue(),i()},i=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",n),r.on("error",(e=>{i(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",e)}));let o=()=>{if(!r)return;let e,t=r.read(1);t?(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[t.messageId]?o():this.disconnecting||this.reconnectTimer?r.destroy&&r.destroy():(e=this.outgoing[t.messageId]?this.outgoing[t.messageId].cb:null,this.outgoing[t.messageId]={volatile:!1,cb(t,r){e&&e(t,r),o()}},this._packetIdsDuringStoreProcessing[t.messageId]=!0,this.messageIdProvider.register(t.messageId)?this._sendPacket(t,void 0,void 0,!0):this.log("messageId: %d has already used.",t.messageId))):r.once("readable",o)};r.on("end",(()=>{let r=!0;for(let e in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[e]){r=!1;break}this.removeListener("close",n),r?(i(),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):t()})),o()};t()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let e of this._storeProcessingQueue)e.cbStorePut&&e.cbStorePut(new Error("Connection closed")),e.callback&&e.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(e,t){delete this.outgoing[e],this.outgoingStore.del({messageId:e},((r,n)=>{t(r,n),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue()}))}};_.VERSION=g.MQTTJS_VERSION,e.default=_})),Si=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});var t=ci();e.default=class{constructor(){this.numberAllocator=new t.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(e){return this.numberAllocator.use(e)}deallocate(e){this.numberAllocator.free(e)}clear(){this.numberAllocator.clear()}}}));function ki(e){throw new RangeError(Oi[e])}function Ai(e,t){let r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+function(e,t){let r=[],n=e.length;for(;n--;)r[n]=t(e[n]);return r}((e=e.replace(Ri,".")).split("."),t).join(".")}function Ti(e){let t=[],r=0,n=e.length;for(;r<n;){let i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){let n=e.charCodeAt(r++);56320==(64512&n)?t.push(((1023&i)<<10)+(1023&n)+65536):(t.push(i),r--)}else t.push(i)}return t}var Ii,Ci,Ri,Oi,Mi,Pi,xi,Bi,Li,Ui,Ni,ji=l((()=>{nt(),ze(),f(),Ii=/^xn--/,Ci=/[^\0-\x7E]/,Ri=/[\x2E\u3002\uFF0E\uFF61]/g,Oi={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Mi=Math.floor,Pi=String.fromCharCode,xi=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},Bi=function(e,t,r){let n=0;for(e=r?Mi(e/700):e>>1,e+=Mi(e/t);e>455;n+=36)e=Mi(e/35);return Mi(n+36*e/(e+38))},Ui=function(e){let t=[],r=(e=Ti(e)).length,n=128,i=0,o=72;for(let r of e)r<128&&t.push(Pi(r));let s=t.length,a=s;for(s&&t.push("-");a<r;){let r=2147483647;for(let t of e)t>=n&&t<r&&(r=t);let l=a+1;r-n>Mi((2147483647-i)/l)&&ki("overflow"),i+=(r-n)*l,n=r;for(let r of e)if(r<n&&++i>2147483647&&ki("overflow"),r==n){let e=i;for(let r=36;;r+=36){let n=r<=o?1:r>=o+26?26:r-o;if(e<n)break;let i=e-n,s=36-n;t.push(Pi(xi(n+i%s,0))),e=Mi(i/s)}t.push(Pi(xi(e,0))),o=Bi(i,l,a==s),i=0,++a}++i,++n}return t.join("")},Ni={version:"2.1.0",ucs2:{decode:Ti,encode:e=>String.fromCodePoint(...e)},decode:Li=function(e){let t=[],r=e.length,n=0,i=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(let r=0;r<s;++r)e.charCodeAt(r)>=128&&ki("not-basic"),t.push(e.charCodeAt(r));for(let l=s>0?s+1:0;l<r;){let s=n;for(let t=1,i=36;;i+=36){l>=r&&ki("invalid-input");let s=(a=e.charCodeAt(l++))-48<10?a-22:a-65<26?a-65:a-97<26?a-97:36;(s>=36||s>Mi((2147483647-n)/t))&&ki("overflow"),n+=s*t;let u=i<=o?1:i>=o+26?26:i-o;if(s<u)break;let c=36-u;t>Mi(2147483647/c)&&ki("overflow"),t*=c}let u=t.length+1;o=Bi(n-s,u,0==s),Mi(n/u)>2147483647-i&&ki("overflow"),i+=Mi(n/u),n%=u,t.splice(n++,0,i)}var a;return String.fromCodePoint(...t)},encode:Ui,toASCII:function(e){return Ai(e,(function(e){return Ci.test(e)?"xn--"+Ui(e):e}))},toUnicode:function(e){return Ai(e,(function(e){return Ii.test(e)?Li(e.slice(4).toLowerCase()):e}))}},Ni.encode,Ni.toASCII,Ni.toUnicode,Ni.ucs2,Ni.version}));function Di(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Fi,Wi,Vi,zi,Hi=l((()=>{nt(),ze(),f(),Fi=function(e,t,r,n){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var a=e.length;s>0&&a>s&&(a=s);for(var l=0;l<a;++l){var u,c,h,f,d=e[l].replace(o,"%20"),p=d.indexOf(r);p>=0?(u=d.substr(0,p),c=d.substr(p+1)):(u=d,c=""),h=decodeURIComponent(u),f=decodeURIComponent(c),Di(i,h)?Array.isArray(i[h])?i[h].push(f):i[h]=[i[h],f]:i[h]=f}return i},Wi=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},Vi=function(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(n){var i=encodeURIComponent(Wi(n))+r;return Array.isArray(e[n])?e[n].map((function(e){return i+encodeURIComponent(Wi(e))})).join(t):i+encodeURIComponent(Wi(e[n]))})).join(t):n?encodeURIComponent(Wi(n))+r+encodeURIComponent(Wi(e)):""},(zi={}).decode=zi.parse=Fi,zi.encode=zi.stringify=Vi,zi.decode,zi.encode,zi.parse,zi.stringify}));function qi(){throw new Error("setTimeout has not been defined")}function $i(){throw new Error("clearTimeout has not been defined")}function Ki(e){if(Zi===setTimeout)return setTimeout(e,0);if((Zi===qi||!Zi)&&setTimeout)return Zi=setTimeout,setTimeout(e,0);try{return Zi(e,0)}catch{try{return Zi.call(null,e,0)}catch{return Zi.call(this||to,e,0)}}}function Gi(){oo&&no&&(oo=!1,no.length?io=no.concat(io):so=-1,io.length&&Qi())}function Qi(){if(!oo){var e=Ki(Gi);oo=!0;for(var t=io.length;t;){for(no=io,io=[];++so<t;)no&&no[so].run();so=-1,t=io.length}no=null,oo=!1,function(e){if(eo===clearTimeout)return clearTimeout(e);if((eo===$i||!eo)&&clearTimeout)return eo=clearTimeout,clearTimeout(e);try{eo(e)}catch{try{return eo.call(null,e)}catch{return eo.call(this||to,e)}}}(e)}}function Yi(e,t){(this||to).fun=e,(this||to).array=t}function Ji(){}var Xi,Zi,eo,to,ro,no,io,oo,so,ao,lo=l((()=>{nt(),ze(),f(),to=typeof globalThis<"u"?globalThis:typeof self<"u"?self:r.g,ro=Xi={},function(){try{Zi="function"==typeof setTimeout?setTimeout:qi}catch{Zi=qi}try{eo="function"==typeof clearTimeout?clearTimeout:$i}catch{eo=$i}}(),io=[],oo=!1,so=-1,ro.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];io.push(new Yi(e,t)),1!==io.length||oo||Ki(Qi)},Yi.prototype.run=function(){(this||to).fun.apply(null,(this||to).array)},ro.title="browser",ro.browser=!0,ro.env={},ro.argv=[],ro.version="",ro.versions={},ro.on=Ji,ro.addListener=Ji,ro.once=Ji,ro.off=Ji,ro.removeListener=Ji,ro.removeAllListeners=Ji,ro.emit=Ji,ro.prependListener=Ji,ro.prependOnceListener=Ji,ro.listeners=function(e){return[]},ro.binding=function(e){throw new Error("process.binding is not supported")},ro.cwd=function(){return"/"},ro.chdir=function(e){throw new Error("process.chdir is not supported")},ro.umask=function(){return 0},ao=Xi,ao.argv,ao.binding,ao.browser,ao.chdir,ao.cwd,ao.emit,ao.env,ao.listeners,ao.nextTick,ao.off,ao.on,ao.once,ao.prependListener,ao.prependOnceListener,ao.removeAllListeners,ao.removeListener,ao.title,ao.umask,ao.version,ao.versions}));function uo(){if(ho)return co;ho=!0;var e,t,r=co={};function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(t){if(e===setTimeout)return setTimeout(t,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch{try{return e.call(null,t,0)}catch{return e.call(this||fo,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:n}catch{e=n}try{t="function"==typeof clearTimeout?clearTimeout:i}catch{t=i}}();var s,a=[],l=!1,u=-1;function c(){!l||!s||(l=!1,s.length?a=s.concat(a):u=-1,a.length&&h())}function h(){if(!l){var e=o(c);l=!0;for(var r=a.length;r;){for(s=a,a=[];++u<r;)s&&s[u].run();u=-1,r=a.length}s=null,l=!1,function(e){if(t===clearTimeout)return clearTimeout(e);if((t===i||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(e);try{return t(e)}catch{try{return t.call(null,e)}catch{return t.call(this||fo,e)}}}(e)}}function f(e,t){(this||fo).fun=e,(this||fo).array=t}function d(){}return r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];a.push(new f(e,t)),1===a.length&&!l&&o(h)},f.prototype.run=function(){(this||fo).fun.apply(null,(this||fo).array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=d,r.addListener=d,r.once=d,r.off=d,r.removeListener=d,r.removeAllListeners=d,r.emit=d,r.prependListener=d,r.prependOnceListener=d,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0},co}var co,ho,fo,po,go=l((()=>{nt(),ze(),f(),co={},ho=!1,fo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:r.g,(po=uo()).platform="browser",po.addListener,po.argv,po.binding,po.browser,po.chdir,po.cwd,po.emit,po.env,po.listeners,po.nextTick,po.off,po.on,po.once,po.prependListener,po.prependOnceListener,po.removeAllListeners,po.removeListener,po.title,po.umask,po.version,po.versions}));var yo,bo,vo,mo=l((()=>{nt(),ze(),f(),go(),yo={},bo=!1,vo=function(){if(bo)return yo;bo=!0;var e=po;function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)r=e.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o!==a-1&&1!==s)if(o!==a-1&&2===s){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",i=0):i=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var n={resolve:function(){for(var n,i="",o=!1,s=arguments.length-1;s>=-1&&!o;s--){var a;s>=0?a=arguments[s]:(void 0===n&&(n=e.cwd()),a=n),t(a),0!==a.length&&(i=a+"/"+i,o=47===a.charCodeAt(0))}return i=r(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0===(e=r(e,!n)).length&&!n&&(e="."),e.length>0&&i&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=n.resolve(e))===(r=n.resolve(r)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,s=o-i,a=1;a<r.length&&47===r.charCodeAt(a);++a);for(var l=r.length-a,u=s<l?s:l,c=-1,h=0;h<=u;++h){if(h===u){if(l>u){if(47===r.charCodeAt(a+h))return r.slice(a+h+1);if(0===h)return r.slice(a+h)}else s>u&&(47===e.charCodeAt(i+h)?c=h:0===h&&(c=0));break}var f=e.charCodeAt(i+h);if(f!==r.charCodeAt(a+h))break;47===f&&(c=h)}var d="";for(h=i+c+1;h<=o;++h)(h===o||47===e.charCodeAt(h))&&(0===d.length?d+="..":d+="/..");return d.length>0?d+r.slice(a+c):(a+=c,47===r.charCodeAt(a)&&++a,r.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(r=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,i=0,o=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var a=r.length-1,l=-1;for(n=e.length-1;n>=0;--n){var u=e.charCodeAt(n);if(47===u){if(!s){i=n+1;break}}else-1===l&&(s=!1,l=n+1),a>=0&&(u===r.charCodeAt(a)?-1==--a&&(o=n):(a=-1,o=l))}return i===o?o=l:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){i=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var r=-1,n=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===i&&(o=!1,i=a+1),46===l?-1===r?r=a:1!==s&&(s=1):-1!==r&&(s=-1);else if(!o){n=a+1;break}}return-1===r||-1===i||0===s||1===s&&r===i-1&&r===n+1?"":e.slice(r,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}("/",e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,i=e.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var s=-1,a=0,l=-1,u=!0,c=e.length-1,h=0;c>=n;--c)if(47!==(i=e.charCodeAt(c)))-1===l&&(u=!1,l=c+1),46===i?-1===s?s=c:1!==h&&(h=1):-1!==s&&(h=-1);else if(!u){a=c+1;break}return-1===s||-1===l||0===h||1===h&&s===l-1&&s===a+1?-1!==l&&(r.base=r.name=0===a&&o?e.slice(1,l):e.slice(a,l)):(0===a&&o?(r.name=e.slice(1,s),r.base=e.slice(1,l)):(r.name=e.slice(a,s),r.base=e.slice(a,l)),r.ext=e.slice(s,l)),a>0?r.dir=e.slice(0,a-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,yo=n}()})),wo={};function _o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function Eo(e,t,r){if(e&&Ro.isObject(e)&&e instanceof _o)return e;var n=new _o;return n.parse(e,t,r),n}function So(e){if("string"==typeof e)e=new URL(e);else if(!(e instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if("file:"!==e.protocol)throw new Deno.errors.InvalidData("invalid url scheme");return Jo?function(e){let t=e.hostname,r=e.pathname;for(let e=0;e<r.length;e++)if("%"===r[e]){let t=r.codePointAt(e+2)||32;if("2"===r[e+1]&&102===t||"5"===r[e+1]&&99===t)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(Xo,"\\"),r=decodeURIComponent(r),""!==t)return`\\\\${t}${r}`;{let e=32|r.codePointAt(1),t=r[2];if(e<Qo||e>Yo||":"!==t)throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}(e):function(e){if(""!==e.hostname)throw new Deno.errors.InvalidData("invalid file url hostname");let t=e.pathname;for(let e=0;e<t.length;e++)if("%"===t[e]){let r=t.codePointAt(e+2)||32;if("2"===t[e+1]&&102===r)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}(e)}function ko(e){let t=qo.resolve(e),r=e.charCodeAt(e.length-1);(r===Go||Jo&&r===Ko)&&t[t.length-1]!==qo.sep&&(t+="/");let n=new URL("file://");return t.includes("%")&&(t=t.replace(Zo,"%25")),!Jo&&t.includes("\\")&&(t=t.replace(es,"%5C")),t.includes("\n")&&(t=t.replace(ts,"%0A")),t.includes("\r")&&(t=t.replace(rs,"%0D")),t.includes("\t")&&(t=t.replace(ns,"%09")),n.pathname=t,n}function Ao(e){if("string"==typeof e)e=new URL(e);else if(!(e instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if("file:"!==e.protocol)throw new Deno.errors.InvalidData("invalid url scheme");return gs?function(e){let t=e.hostname,r=e.pathname;for(let e=0;e<r.length;e++)if("%"===r[e]){let t=r.codePointAt(e+2)||32;if("2"===r[e+1]&&102===t||"5"===r[e+1]&&99===t)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(ys,"\\"),r=decodeURIComponent(r),""!==t)return`\\\\${t}${r}`;{let e=32|r.codePointAt(1),t=r[2];if(e<ds||e>ps||":"!==t)throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}(e):function(e){if(""!==e.hostname)throw new Deno.errors.InvalidData("invalid file url hostname");let t=e.pathname;for(let e=0;e<t.length;e++)if("%"===t[e]){let r=t.codePointAt(e+2)||32;if("2"===t[e+1]&&102===r)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}(e)}function To(e){let t=vo.resolve(e),r=e.charCodeAt(e.length-1);(r===fs||gs&&r===hs)&&t[t.length-1]!==vo.sep&&(t+="/");let n=new URL("file://");return t.includes("%")&&(t=t.replace(bs,"%25")),!gs&&t.includes("\\")&&(t=t.replace(vs,"%5C")),t.includes("\n")&&(t=t.replace(ms,"%0A")),t.includes("\r")&&(t=t.replace(ws,"%0D")),t.includes("\t")&&(t=t.replace(_s,"%09")),n.pathname=t,n}c(wo,{URL:()=>cs,Url:()=>os,default:()=>Io,fileURLToPath:()=>Ao,format:()=>ss,parse:()=>us,pathToFileURL:()=>To,resolve:()=>as,resolveObject:()=>ls});var Io,Co,Ro,Oo,Mo,Po,xo,Bo,Lo,Uo,No,jo,Do,Fo,Wo,Vo,zo,Ho,qo,$o,Ko,Go,Qo,Yo,Jo,Xo,Zo,es,ts,rs,ns,is,os,ss,as,ls,us,cs,hs,fs,ds,ps,gs,ys,bs,vs,ms,ws,_s,Es=l((()=>{nt(),ze(),f(),ji(),Hi(),lo(),mo(),go(),Co=Ni,Ro={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}},(Io={}).parse=Eo,Io.resolve=function(e,t){return Eo(e,!1,!0).resolve(t)},Io.resolveObject=function(e,t){return e?Eo(e,!1,!0).resolveObject(t):t},Io.format=function(e){return Ro.isString(e)&&(e=Eo(e)),e instanceof _o?e.format():_o.prototype.format.call(e)},Io.Url=_o,Oo=/^([a-z0-9.+-]+:)/i,Mo=/:[0-9]*$/,Po=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,xo=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),Bo=["'"].concat(xo),Lo=["%","/","?",";","#"].concat(Bo),Uo=["/","?","#"],No=/^[+a-z0-9A-Z_-]{0,63}$/,jo=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Do={javascript:!0,"javascript:":!0},Fo={javascript:!0,"javascript:":!0},Wo={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Vo=zi,_o.prototype.parse=function(e,t,r){if(!Ro.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),i=-1!==n&&n<e.indexOf("#")?"?":"#",o=e.split(i);o[0]=o[0].replace(/\\/g,"/");var s=e=o.join(i);if(s=s.trim(),!r&&1===e.split("#").length){var a=Po.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=t?Vo.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var l=Oo.exec(s);if(l){var u=(l=l[0]).toLowerCase();this.protocol=u,s=s.substr(l.length)}if(r||l||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var c="//"===s.substr(0,2);!c||l&&Fo[l]||(s=s.substr(2),this.slashes=!0)}if(!Fo[l]&&(c||l&&!Wo[l])){for(var h,f,d=-1,p=0;p<Uo.length;p++)-1!==(g=s.indexOf(Uo[p]))&&(-1===d||g<d)&&(d=g);for(-1!==(f=-1===d?s.lastIndexOf("@"):s.lastIndexOf("@",d))&&(h=s.slice(0,f),s=s.slice(f+1),this.auth=decodeURIComponent(h)),d=-1,p=0;p<Lo.length;p++){var g;-1!==(g=s.indexOf(Lo[p]))&&(-1===d||g<d)&&(d=g)}-1===d&&(d=s.length),this.host=s.slice(0,d),s=s.slice(d),this.parseHost(),this.hostname=this.hostname||"";var y="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!y)for(var b=this.hostname.split(/\./),v=(p=0,b.length);p<v;p++){var m=b[p];if(m&&!m.match(No)){for(var w="",_=0,E=m.length;_<E;_++)m.charCodeAt(_)>127?w+="x":w+=m[_];if(!w.match(No)){var S=b.slice(0,p),k=b.slice(p+1),A=m.match(jo);A&&(S.push(A[1]),k.unshift(A[2])),k.length&&(s="/"+k.join(".")+s),this.hostname=S.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=Co.toASCII(this.hostname));var T=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+T,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!Do[u])for(p=0,v=Bo.length;p<v;p++){var C=Bo[p];if(-1!==s.indexOf(C)){var R=encodeURIComponent(C);R===C&&(R=escape(C)),s=s.split(C).join(R)}}var O=s.indexOf("#");-1!==O&&(this.hash=s.substr(O),s=s.slice(0,O));var M=s.indexOf("?");if(-1!==M?(this.search=s.substr(M),this.query=s.substr(M+1),t&&(this.query=Vo.parse(this.query)),s=s.slice(0,M)):t&&(this.search="",this.query={}),s&&(this.pathname=s),Wo[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){T=this.pathname||"";var P=this.search||"";this.path=T+P}return this.href=this.format(),this},_o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&Ro.isObject(this.query)&&Object.keys(this.query).length&&(o=Vo.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||Wo[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+n},_o.prototype.resolve=function(e){return this.resolveObject(Eo(e,!1,!0)).format()},_o.prototype.resolveObject=function(e){if(Ro.isString(e)){var t=new _o;t.parse(e,!1,!0),e=t}for(var r=new _o,n=Object.keys(this),i=0;i<n.length;i++){var o=n[i];r[o]=this[o]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),a=0;a<s.length;a++){var l=s[a];"protocol"!==l&&(r[l]=e[l])}return Wo[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!Wo[e.protocol]){for(var u=Object.keys(e),c=0;c<u.length;c++){var h=u[c];r[h]=e[h]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||Fo[e.protocol])r.pathname=e.pathname;else{for(var f=(e.pathname||"").split("/");f.length&&!(e.host=f.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==f[0]&&f.unshift(""),f.length<2&&f.unshift(""),r.pathname=f.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var d=r.pathname||"",p=r.search||"";r.path=d+p}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var g=r.pathname&&"/"===r.pathname.charAt(0),y=e.host||e.pathname&&"/"===e.pathname.charAt(0),b=y||g||r.host&&e.pathname,v=b,m=r.pathname&&r.pathname.split("/")||[],w=(f=e.pathname&&e.pathname.split("/")||[],r.protocol&&!Wo[r.protocol]);if(w&&(r.hostname="",r.port=null,r.host&&(""===m[0]?m[0]=r.host:m.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===f[0]?f[0]=e.host:f.unshift(e.host)),e.host=null),b=b&&(""===f[0]||""===m[0])),y)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,m=f;else if(f.length)m||(m=[]),m.pop(),m=m.concat(f),r.search=e.search,r.query=e.query;else if(!Ro.isNullOrUndefined(e.search))return w&&(r.hostname=r.host=m.shift(),(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift())),r.search=e.search,r.query=e.query,Ro.isNull(r.pathname)&&Ro.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!m.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var _=m.slice(-1)[0],E=(r.host||e.host||m.length>1)&&("."===_||".."===_)||""===_,S=0,k=m.length;k>=0;k--)"."===(_=m[k])?m.splice(k,1):".."===_?(m.splice(k,1),S++):S&&(m.splice(k,1),S--);if(!b&&!v)for(;S--;S)m.unshift("..");!b||""===m[0]||m[0]&&"/"===m[0].charAt(0)||m.unshift(""),E&&"/"!==m.join("/").substr(-1)&&m.push("");var A,T=""===m[0]||m[0]&&"/"===m[0].charAt(0);return w&&(r.hostname=r.host=T?"":m.length?m.shift():"",(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift())),(b=b||r.host&&m.length)&&!T&&m.unshift(""),m.length?r.pathname=m.join("/"):(r.pathname=null,r.path=null),Ro.isNull(r.pathname)&&Ro.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},_o.prototype.parseHost=function(){var e=this.host,t=Mo.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},Io.Url,Io.format,Io.resolve,Io.resolveObject,zo={},Ho=!1,qo=function(){if(Ho)return zo;Ho=!0;var e=ao;function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)r=e.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o!==a-1&&1!==s)if(o!==a-1&&2===s){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",i=0):i=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var n={resolve:function(){for(var n,i="",o=!1,s=arguments.length-1;s>=-1&&!o;s--){var a;s>=0?a=arguments[s]:(void 0===n&&(n=e.cwd()),a=n),t(a),0!==a.length&&(i=a+"/"+i,o=47===a.charCodeAt(0))}return i=r(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0===(e=r(e,!n)).length&&!n&&(e="."),e.length>0&&i&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=n.resolve(e))===(r=n.resolve(r)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,s=o-i,a=1;a<r.length&&47===r.charCodeAt(a);++a);for(var l=r.length-a,u=s<l?s:l,c=-1,h=0;h<=u;++h){if(h===u){if(l>u){if(47===r.charCodeAt(a+h))return r.slice(a+h+1);if(0===h)return r.slice(a+h)}else s>u&&(47===e.charCodeAt(i+h)?c=h:0===h&&(c=0));break}var f=e.charCodeAt(i+h);if(f!==r.charCodeAt(a+h))break;47===f&&(c=h)}var d="";for(h=i+c+1;h<=o;++h)(h===o||47===e.charCodeAt(h))&&(0===d.length?d+="..":d+="/..");return d.length>0?d+r.slice(a+c):(a+=c,47===r.charCodeAt(a)&&++a,r.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(r=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,i=0,o=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var a=r.length-1,l=-1;for(n=e.length-1;n>=0;--n){var u=e.charCodeAt(n);if(47===u){if(!s){i=n+1;break}}else-1===l&&(s=!1,l=n+1),a>=0&&(u===r.charCodeAt(a)?-1==--a&&(o=n):(a=-1,o=l))}return i===o?o=l:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){i=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var r=-1,n=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===i&&(o=!1,i=a+1),46===l?-1===r?r=a:1!==s&&(s=1):-1!==r&&(s=-1);else if(!o){n=a+1;break}}return-1===r||-1===i||0===s||1===s&&r===i-1&&r===n+1?"":e.slice(r,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}("/",e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,i=e.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var s=-1,a=0,l=-1,u=!0,c=e.length-1,h=0;c>=n;--c)if(47!==(i=e.charCodeAt(c)))-1===l&&(u=!1,l=c+1),46===i?-1===s?s=c:1!==h&&(h=1):-1!==s&&(h=-1);else if(!u){a=c+1;break}return-1===s||-1===l||0===h||1===h&&s===l-1&&s===a+1?-1!==l&&(r.base=r.name=0===a&&o?e.slice(1,l):e.slice(a,l)):(0===a&&o?(r.name=e.slice(1,s),r.base=e.slice(1,l)):(r.name=e.slice(a,s),r.base=e.slice(a,l)),r.ext=e.slice(s,l)),a>0?r.dir=e.slice(0,a-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,zo=n}(),$o=typeof Deno<"u"?"windows"===Deno.build.os?"win32":Deno.build.os:void 0,Io.URL=typeof URL<"u"?URL:null,Io.pathToFileURL=ko,Io.fileURLToPath=So,Io.Url,Io.format,Io.resolve,Io.resolveObject,Io.URL,Ko=92,Go=47,Qo=97,Yo=122,Jo="win32"===$o,Xo=/\//g,Zo=/%/g,es=/\\/g,ts=/\n/g,rs=/\r/g,ns=/\t/g,is=typeof Deno<"u"?"windows"===Deno.build.os?"win32":Deno.build.os:void 0,Io.URL=typeof URL<"u"?URL:null,Io.pathToFileURL=To,Io.fileURLToPath=Ao,os=Io.Url,ss=Io.format,as=Io.resolve,ls=Io.resolveObject,us=Io.parse,cs=Io.URL,hs=92,fs=47,ds=97,ps=122,gs="win32"===is,ys=/\//g,bs=/%/g,vs=/\\/g,ms=/\n/g,ws=/\r/g,_s=/\t/g})),Ss={};function ks(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}c(Ss,{Server:()=>ks,Socket:()=>ks,Stream:()=>ks,_createServerHandle:()=>ks,_normalizeArgs:()=>ks,_setSimultaneousAccepts:()=>ks,connect:()=>ks,createConnection:()=>ks,createServer:()=>ks,default:()=>As,isIP:()=>ks,isIPv4:()=>ks,isIPv6:()=>ks});var As,Ts=l((()=>{nt(),ze(),f(),As={_createServerHandle:ks,_normalizeArgs:ks,_setSimultaneousAccepts:ks,connect:ks,createConnection:ks,createServer:ks,isIP:ks,isIPv4:ks,isIPv6:ks,Server:ks,Socket:ks,Stream:ks}})),Is=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t((Ts(),h(Ss))),n=(0,t(An()).default)("mqttjs:tcp");e.default=(e,t)=>{t.port=t.port||1883,t.hostname=t.hostname||t.host||"localhost";let{port:i,path:o}=t,s=t.hostname;return n("port %d and host %s",i,s),r.default.createConnection({port:i,host:s,path:o})}})),Cs={};c(Cs,{default:()=>Rs});var Rs,Os=l((()=>{nt(),ze(),f(),Rs={}})),Ms=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t((Os(),h(Cs))),n=t((Ts(),h(Ss))),i=(0,t(An()).default)("mqttjs:tls");e.default=(e,t)=>{t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0===n.default.isIP(t.host)&&(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,i("port %d host %s rejectUnauthorized %b",t.port,t.host,t.rejectUnauthorized);let o=r.default.connect(t);function s(r){t.rejectUnauthorized&&e.emit("error",r),o.end()}return o.on("secureConnect",(()=>{t.rejectUnauthorized&&!o.authorized?o.emit("error",new Error("TLS not authorized")):o.removeListener("error",s)})),o.on("error",s),o}})),Ps=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferedDuplex=e.writev=void 0;var t=bn(),r=(rt(),h(He));function n(e,t){let n=new Array(e.length);for(let t=0;t<e.length;t++)"string"==typeof e[t].chunk?n[t]=r.Buffer.from(e[t].chunk,"utf8"):n[t]=e[t].chunk;this._write(r.Buffer.concat(n),"binary",t)}e.writev=n;var i=class extends t.Duplex{constructor(e,t,r){super({objectMode:!0}),this.proxy=t,this.socket=r,this.writeQueue=[],e.objectMode||(this._writev=n.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",(e=>{this.push(e)}))}_read(e){this.proxy.read(e)}_write(e,t,r){this.isSocketOpen?this.writeToProxy(e,t,r):this.writeQueue.push({chunk:e,encoding:t,cb:r})}_final(e){this.writeQueue=[],this.proxy.end(e)}_destroy(e,t){this.writeQueue=[],this.proxy.destroy(),t(e)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(e,t,r){!1===this.proxy.write(e,t)?this.proxy.once("drain",r):r()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:e,encoding:t,cb:r}=this.writeQueue.shift();this.writeToProxy(e,t,r)}}};e.BufferedDuplex=i})),xs=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});var t,r,n,i=(rt(),h(He)),o=bn(),s=Ps();e.default=(e,a)=>{if(a.hostname=a.hostname||a.host,!a.hostname)throw new Error("Could not determine host. Specify host manually.");let l="MQIsdp"===a.protocolId&&3===a.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(a);let u=function(e,t){let r="wxs"===e.protocol?"wss":"ws",n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(a,e);t=wx.connectSocket({url:u,protocols:[l]}),r=function(){let e=new o.Transform;return e._write=(e,r,n)=>{t.send({data:e.buffer,success(){n()},fail(e){n(new Error(e))}})},e._flush=e=>{t.close({success(){e()}})},e}(),(n=new s.BufferedDuplex(a,r,t))._destroy=(e,r)=>{t.close({success(){r&&r(e)}})};let c=n.destroy;return n.destroy=(e,r)=>(n.destroy=c,setTimeout((()=>{t.close({fail(){n._destroy(e,r)}})}),0),n),t.onOpen((()=>{n.socketReady()})),t.onMessage((e=>{let{data:t}=e;t=t instanceof ArrayBuffer?i.Buffer.from(t):i.Buffer.from(t,"utf8"),r.push(t)})),t.onClose((()=>{n.emit("close"),n.end(),n.destroy()})),t.onError((e=>{let t=new Error(e.errMsg);n.destroy(t)})),n}})),Bs=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});var t,r,n,i=(rt(),h(He)),o=bn(),s=Ps(),a=!1;e.default=(e,l)=>{if(l.hostname=l.hostname||l.host,!l.hostname)throw new Error("Could not determine host. Specify host manually.");let u="MQIsdp"===l.protocolId&&3===l.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(l);let c=function(e,t){let r="alis"===e.protocol?"wss":"ws",n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(l,e);return(t=l.my).connectSocket({url:c,protocols:u}),r=function(){let e=new o.Transform;return e._write=(e,r,n)=>{t.sendSocketMessage({data:e.buffer,success(){n()},fail(){n(new Error)}})},e._flush=e=>{t.closeSocket({success(){e()}})},e}(),n=new s.BufferedDuplex(l,r,t),a||(a=!0,t.onSocketOpen((()=>{n.socketReady()})),t.onSocketMessage((e=>{if("string"==typeof e.data){let t=i.Buffer.from(e.data,"base64");r.push(t)}else{let t=new FileReader;t.addEventListener("load",(()=>{let e=t.result;e=e instanceof ArrayBuffer?i.Buffer.from(e):i.Buffer.from(e,"utf8"),r.push(e)})),t.readAsArrayBuffer(e.data)}})),t.onSocketClose((()=>{n.end(),n.destroy()})),t.onSocketError((e=>{n.destroy(e)}))),n}})),Ls=u(((e,t)=>{nt(),ze(),f(),t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}})),Us=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=(rt(),h(He)),n=t(Ls()),i=t(An()),o=bn(),s=t(yi()),a=Ps(),l=(0,i.default)("mqttjs:ws"),u=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function c(e,t){let r=`${e.protocol}://${e.hostname}:${e.port}${e.path}`;return"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}function d(e){let t=e;return e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),!s.default&&"wss"===e.protocol&&u.forEach((r=>{Object.prototype.hasOwnProperty.call(e,r)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,r)&&(t.wsOptions[r]=e[r])})),t}e.default=s.default?(e,t)=>{l("browserStreamBuilder");let n,i=function(e){let t=d(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let e=new URL(document.URL);t.hostname=e.hostname,t.port||(t.port=Number(e.port))}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}(t).browserBufferSize||524288,s=t.browserBufferTimeout||1e3,u=!t.objectMode,h=function(e,t){let r,n="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",i=c(t,e);return r=t.createWebsocket?t.createWebsocket(i,[n],t):new WebSocket(i,[n]),r.binaryType="arraybuffer",r}(e,t),f=function(e,t,r){let n=new o.Transform({objectMode:e.objectMode});return n._write=t,n._flush=r,n}(t,(function e(t,n,o){if(h.bufferedAmount>i)return void setTimeout(e,s,t,n,o);u&&"string"==typeof t&&(t=r.Buffer.from(t,"utf8"));try{h.send(t)}catch(e){return o(e)}o()}),(function(e){h.close(),e()}));t.objectMode||(f._writev=a.writev.bind(f)),f.on("close",(()=>{h.close()}));let p=typeof h.addEventListener<"u";function g(){l("WebSocket onOpen"),n instanceof a.BufferedDuplex&&n.socketReady()}function y(e){l("WebSocket onClose",e),n.end(),n.destroy()}function b(e){l("WebSocket onError",e);let t=new Error("WebSocket error");t.event=e,n.destroy(t)}function v(e){let{data:t}=e;t=t instanceof ArrayBuffer?r.Buffer.from(t):r.Buffer.from(t,"utf8"),f.push(t)}return h.readyState===h.OPEN?(n=f,n.socket=h):(n=new a.BufferedDuplex(t,f,h),p?h.addEventListener("open",g):h.onopen=g),p?(h.addEventListener("close",y),h.addEventListener("error",b),h.addEventListener("message",v)):(h.onclose=y,h.onerror=b,h.onmessage=v),n}:(e,t)=>{l("streamBuilder");let r=d(t);r.hostname=r.hostname||r.host||"localhost";let i=c(r,e),o=function(e,t,r){l("createWebSocket"),l(`protocol: ${r.protocolId} ${r.protocolVersion}`);let i,o="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt";return l(`creating new Websocket for url: ${t} and protocol: ${o}`),i=r.createWebsocket?r.createWebsocket(t,[o],r):new n.default(t,[o],r.wsOptions),i}(0,i,r),s=n.default.createWebSocketStream(o,r.wsOptions);return s.url=i,o.on("close",(()=>{s.destroy()})),s}})),Ns=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.connectAsync=void 0;var r=t(An()),n=t((Es(),h(wo))),i=t(Ei()),o=t(yi());"function"!=typeof(null==d?void 0:d.nextTick)&&(d.nextTick=setImmediate);var s=(0,r.default)("mqttjs"),a={};function l(e,t){var r,o,l,u;if(s("connecting to an MQTT broker..."),"object"==typeof e&&!t&&(t=e,e=""),t=t||{},e&&"string"==typeof e){let i=n.default.parse(e,!0),o={};if(null!=i.port&&(o.port=Number(i.port)),o.host=i.hostname,o.query=i.query,o.auth=i.auth,o.protocol=i.protocol,o.path=i.path,o.protocol=null===(r=o.protocol)||void 0===r?void 0:r.replace(/:$/,""),!(t=Object.assign(Object.assign({},o),t)).protocol)throw new Error("Missing protocol")}if(t.unixSocket=t.unixSocket||(null===(o=t.protocol)||void 0===o?void 0:o.includes("+unix")),t.unixSocket?t.protocol=t.protocol.replace("+unix",""):null!==(l=t.protocol)&&void 0!==l&&l.startsWith("ws")||null!==(u=t.protocol)&&void 0!==u&&u.startsWith("wx")||delete t.path,function(e){let t;e.auth&&(t=e.auth.match(/^(.+):(.+)$/),t?(e.username=t[1],e.password=t[2]):e.username=e.auth)}(t),t.query&&"string"==typeof t.query.clientId&&(t.clientId=t.query.clientId),t.cert&&t.key){if(!t.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(t.protocol))switch(t.protocol){case"mqtt":t.protocol="mqtts";break;case"ws":t.protocol="wss";break;case"wx":t.protocol="wxs";break;case"ali":t.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${t.protocol}"!`)}}if(!a[t.protocol]){let e=-1!==["mqtts","wss"].indexOf(t.protocol);t.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(((t,r)=>(!e||r%2!=0)&&"function"==typeof a[t]))[0]}if(!1===t.clean&&!t.clientId)throw new Error("Missing clientId for unclean clients");t.protocol&&(t.defaultProtocol=t.protocol);let c=new i.default((function(e){return t.servers&&((!e._reconnectCount||e._reconnectCount===t.servers.length)&&(e._reconnectCount=0),t.host=t.servers[e._reconnectCount].host,t.port=t.servers[e._reconnectCount].port,t.protocol=t.servers[e._reconnectCount].protocol?t.servers[e._reconnectCount].protocol:t.defaultProtocol,t.hostname=t.host,e._reconnectCount++),s("calling streambuilder for",t.protocol),a[t.protocol](e,t)}),t);return c.on("error",(()=>{})),c}o.default?(a.wx=xs().default,a.wxs=xs().default,a.ali=Bs().default,a.alis=Bs().default):(a.mqtt=Is().default,a.tcp=Is().default,a.ssl=Ms().default,a.tls=a.ssl,a.mqtts=Ms().default),a.ws=Us().default,a.wss=Us().default,e.connectAsync=function(e,t,r=!0){return new Promise(((n,i)=>{let o=l(e,t),s={connect:e=>{a(),n(o)},end:()=>{a(),n(o)},error:e=>{a(),o.end(),i(e)}};function a(){Object.keys(s).forEach((e=>{o.off(e,s[e])}))}!1===r&&(s.close=()=>{s.error(new Error("Couldn't connect to server"))}),Object.keys(s).forEach((e=>{o.on(e,s[e])}))}))},e.default=l})),js=u((e=>{nt(),ze(),f();var t=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n},i=e&&e.__exportStar||function(e,r){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(r,n)&&t(r,e,n)},o=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=e.KeepaliveManager=e.UniqueMessageIdProvider=e.DefaultMessageIdProvider=e.Store=e.MqttClient=e.connectAsync=e.connect=e.Client=void 0;var s=o(Ei());e.MqttClient=s.default;var a=o(Pn());e.DefaultMessageIdProvider=a.default;var l=o(Si());e.UniqueMessageIdProvider=l.default;var u=o(Un());e.Store=u.default;var c=n(Ns());e.connect=c.default,Object.defineProperty(e,"connectAsync",{enumerable:!0,get:function(){return c.connectAsync}});var h=o(_i());e.KeepaliveManager=h.default,e.Client=s.default,i(Ei(),e),i(Dn(),e);var d=Fn();Object.defineProperty(e,"ReasonCodes",{enumerable:!0,get:function(){return d.ReasonCodes}})}));const Ds=u((e=>{nt(),ze(),f();var t=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n},i=e&&e.__exportStar||function(e,r){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(r,n)&&t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0});var o=n(js());e.default=o,i(js(),e)}))()},3405:(e,t,r)=>{"use strict";function n(e,t,r){var n,i,o;void 0===t&&(t=50),void 0===r&&(r={});var s=null!=(n=r.isImmediate)&&n,a=null!=(i=r.callback)&&i,l=r.maxWait,u=Date.now(),c=[];function h(){if(void 0!==l){var e=Date.now()-u;if(e+t>=l)return l-e}return t}var f=function(){var t=[].slice.call(arguments),r=this;return new Promise((function(n,i){var l=s&&void 0===o;if(void 0!==o&&clearTimeout(o),o=setTimeout((function(){if(o=void 0,u=Date.now(),!s){var n=e.apply(r,t);a&&a(n),c.forEach((function(e){return(0,e.resolve)(n)})),c=[]}}),h()),l){var f=e.apply(r,t);return a&&a(f),n(f)}c.push({resolve:n,reject:i})}))};return f.cancel=function(e){void 0!==o&&clearTimeout(o),c.forEach((function(t){return(0,t.reject)(e)})),c=[]},f}r.r(t),r.d(t,{debounce:()=>n})},5460:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRtcApi=void 0;const o=i(r(3793)),s=r(7130),a=r(86),l=r(7514);t.BaseRtcApi=class{constructor(e,t,r,n){this.appID=e,this.sid=t,this.clientKey=r,"/"!==n.substring(n.length-1)&&(n+="/"),this.serverPrefix=n+"v1/"}join(e){return n(this,void 0,void 0,(function*(){return yield this.req("channel/join",{device_type:e.deviceType,device_id:e.deviceID,version:e.version,netid:e.netID,sgid:e.sgID})}))}detail(e){return n(this,void 0,void 0,(function*(){let t=yield this.req("channel/detail",{with_userlist:e});if(e){let e=t.users;return delete t.users,{channelinfo:t,userinfos:e}}return{channelinfo:t,userinfos:null}}))}leave(){return n(this,void 0,void 0,(function*(){return this.req("channel/leave",{})}))}heartbeat(){return n(this,void 0,void 0,(function*(){return this.req("channel/heartbeat",{})}))}reconnect(e){return n(this,void 0,void 0,(function*(){return this.req("channel/reconnect",{type:e.type,netid:e.netID,sgid:e.sgID})}))}updateStream(e){return n(this,void 0,void 0,(function*(){return this.req("channel/update-stream",{stream_tracks:e})}))}req(e){return n(this,arguments,void 0,(function*(e,t={},r={}){const n=Math.floor(Date.now()/1e3),i=(0,a.genNonce)(16);r.app_id=this.appID,r.sid=this.sid,r.nonce=i,r.timestamp=n+"";let o=this.signature(t,i,n);r.signature=o;let u=Date.now(),c=(r,n)=>{l.logger[r]("rtc api: "+this.serverPrefix+e,t,n,Date.now()-u+"ms")};return this.http(e,t,Object.assign(Object.assign({},r),{"Content-Type":"application/json"})).then((e=>{if(c(0==e.code?l.LogLevel.DEBUG:l.LogLevel.WARN,e),0==e.code)return e.data;throw new s.SdkError(e.msg,e.code)})).catch((e=>{throw c(l.LogLevel.ERROR,e),e}))}))}signature(e,t,r){let n=`app_id=${this.appID}&sid=${this.sid}&nonce=${t}×tamp=${r}&`+JSON.stringify(e);return(0,o.default)(n,this.clientKey).toString()}}},4623:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseChannel=void 0;const o=i(r(7007)),s=r(7130),a=r(7514),l=r(3404),u=r(2977),c=r(2871),h=r(5951);class f{constructor(){this.ctn={},this.linkids={}}set(e,t){this.ctn[e]=t,t.link_id&&(this.linkids[t.link_id]=e)}get(e){return this.ctn[e]}getByLinkid(e){return this.get(this.linkids[e])}del(e){delete this.ctn[e]}clear(){this.ctn={},this.linkids={}}listInfo(){let e=[];for(const t in this.ctn)e.push(this.ctn[t].getInfo());return e}}var d;!function(e){e.INIT="init",e.CONNECTED="connected",e.RECONNECTING="reconnecting",e.LEAVED="leaved"}(d||(d={}));class p extends o.default{constructor(e,t,r,n,i=null){super(),this.joinRsp=e,this.users=new f,this.rtcApi=t,this.rtcSocket=n,this.rtcStreamEngine=r,this.eventCB=i,this.addSocketListeners(),this.connectState=d.INIT}refresh(){return n(this,void 0,void 0,(function*(){const{channelinfo:e,userinfos:t}=yield this.rtcApi.detail(!0);this.info=e,this.users.clear(),t&&t.forEach((e=>{let t=this.newUser(e);this.users.set(e.uid,t),e.sid==this.joinRsp.sid&&(this.me=t)})),this.heartbeatIntervalID&&clearInterval(this.heartbeatIntervalID);let r=this.heartbeatIntervalID=setInterval((()=>this.heartbeat()),3e4);a.logger.debug("heartbeat interval started",r),this.connectState=d.CONNECTED}))}checkConnected(){if(this.connectState!=d.CONNECTED)switch(this.connectState){case d.RECONNECTING:throw new s.SdkError("网络重连中,请稍后");case d.LEAVED:throw new s.SdkError("您已离开频道")}}addSocketListeners(){this.onConnected=this.onConnected.bind(this),this.onStartReconnect=this.onStartReconnect.bind(this),this.onChannelMessage=this.onChannelMessage.bind(this),this.rtcSocket.on(c.SocketEvent.CONNECTED,this.onConnected),this.rtcSocket.on(c.SocketEvent.RECONNECTING,this.onStartReconnect),this.rtcSocket.on(c.SocketEvent.CHANNEL_MESSAGE,this.onChannelMessage)}removeSocketListeners(){this.rtcSocket.off(c.SocketEvent.CONNECTED,this.onConnected),this.rtcSocket.off(c.SocketEvent.RECONNECTING,this.onStartReconnect),this.rtcSocket.off(c.SocketEvent.CHANNEL_MESSAGE,this.onChannelMessage)}triggerEvent(e,t){try{let r=new l.ChannelEvent(e,t);this.emit(e,r),this.eventCB&&this.eventCB(r)}catch(r){a.logger.error(`事件${e}上层响应出错,请sdk调用者检查`,r,t)}}heartbeat(){return n(this,void 0,void 0,(function*(){var e;let t=this.heartbeatIntervalID;if(this.connectState!=d.CONNECTED)return a.logger.info(`异常心跳,当前频道状态${this.connectState}`),clearInterval(t),Promise.reject(new s.SdkError(`异常心跳,频道状态为:${this.connectState}`));try{yield this.rtcApi.heartbeat()}catch(e){a.logger.error("心跳失败",e),e instanceof s.SdkError&&this.leave(l.DisconnectReason.Error,e)}a.logger.debug("heartbeat interval",t,null===(e=this.me)||void 0===e?void 0:e.uid)}))}onConnected(){return n(this,void 0,void 0,(function*(){let e=this.connectState;a.logger.warn(e==d.RECONNECTING?"会控socket重连成功":"会控socket连接成功");try{this.connectState=d.CONNECTED,yield this.refresh(),e==d.RECONNECTING?this.triggerEvent(l.CommonChannelEventType.RECONNECTED,this.getInfo()):this.triggerEvent(l.CommonChannelEventType.JOIN_SUCCEED,this.getInfo())}catch(e){this.leave(l.DisconnectReason.Error,e)}}))}onStartReconnect(){a.logger.warn("socket开始重连"),clearInterval(this.heartbeatIntervalID),this.connectState=d.RECONNECTING,this.triggerEvent(l.CommonChannelEventType.RECONNECTING)}onChannelMessage(e){switch(e.type){case u.RtcMsgType.ChannelUpdate:{const t=e.data;if(!t||t.channel!=this.joinRsp.channel)return;this.info.props=t.props,this.triggerEvent(l.CommonChannelEventType.CHANNEL_UPDATE,this.getInfo());break}case u.RtcMsgType.ChannelDestroy:{const t=e.data;if(!t||t.channel!=this.joinRsp.channel)return;this.leave(l.DisconnectReason.Destroy);break}case u.RtcMsgType.UserUpdate:{const t=e.data;if(!t||t.channel!=this.joinRsp.channel)return;let r=this.users.get(t.uid);r&&(r.updateInfo(t),this.triggerEvent(t.sid==this.joinRsp.sid?l.CommonChannelEventType.ME_UPDATE:l.CommonChannelEventType.USER_UPDATE,r.getInfo()));break}case u.RtcMsgType.UserLeave:{const t=e.data;if(!t||t.channel!=this.joinRsp.channel)return;if(t.sid==this.joinRsp.sid)this.leave(t.reason);else{let e=this.users.get(t.uid);if(!e)return void a.logger.error(`收到用户${t.uid}离开消息,但其不在频道内`);for(const t in e.getTracks()){let r=e.getTracks()[t];this.rtcStreamEngine.haveSubscribed(r)&&this.unsubscribeRemoteTrack(r)}this.users.del(t.uid),this.triggerEvent(l.CommonChannelEventType.USER_LEAVE,{uid:t.uid,reason:t.reason})}break}case u.RtcMsgType.UserJoin:{const t=e.data;if(!t||t.channel!=this.joinRsp.channel||t.sid==this.joinRsp.sid)return;let r=this.users.get(t.uid);r&&(a.logger.warn(`收到成员${t.uid}(${t.name})入会消息,但其已经在频道内,先模拟一次离开频道`),this.users.del(t.uid),this.triggerEvent(l.CommonChannelEventType.USER_LEAVE,{uid:t.uid,reason:l.DisconnectReason.Error})),r=this.newUser(t),this.users.set(t.uid,r),this.triggerEvent(l.CommonChannelEventType.USER_JOIN,r.getInfo());break}case u.RtcMsgType.StreamUpdate:{const t=e.data;if(!t||t.channel!=this.joinRsp.channel||t.sid==this.joinRsp.sid)return;let r=this.users.get(t.uid),{added:n,updated:i,deleted:o}=r.updateTracks(t.stream_tracks);n.forEach((e=>{this.triggerEvent(l.CommonChannelEventType.USER_TRACK_ADD,{user:r.getInfo(),track:e.getInfo()})})),i.forEach((e=>{this.triggerEvent(l.CommonChannelEventType.USER_TRACK_UPDATE,{user:r.getInfo(),track:e.getInfo()})})),o.forEach((e=>{this.rtcStreamEngine.haveSubscribed(e)&&this.unsubscribeRemoteTrack(e),this.triggerEvent(l.CommonChannelEventType.USER_TRACK_REMOVE,{user:r.getInfo(),track:e.getInfo()})}));break}case u.RtcMsgType.Custom:{const t=e.data;if(!t||t.channel!=this.joinRsp.channel)return;this.triggerEvent(l.CommonChannelEventType.CUSTOM_MSG,t);break}}}getMe(){if(!this.me)throw new s.SdkError("尚未获取到自己信息");return this.me}getUser(e){let t=this.users.get(e);if(!t)throw new s.SdkError(`频道内没有用户${e}`);return t}getUsersInfo(){return this.users.listInfo()}leave(e,t){return n(this,void 0,void 0,(function*(){var r;if(this.connectState!==d.LEAVED){clearInterval(this.heartbeatIntervalID),this.removeSocketListeners();try{yield this.rtcSocket.close()}catch(e){a.logger.error("断开会控socket报错",e)}try{yield this.rtcApi.leave()}catch(e){a.logger.error("调离开频道api报错",e)}try{yield this.rtcStreamEngine.disconnect()}catch(e){a.logger.error("断开流媒体引擎报错",e)}this.connectState=d.LEAVED,this.triggerEvent(l.CommonChannelEventType.DISCONNECTED,{reason:e,error:t}),this.removeAllListeners(),this.eventCB=null,null===(r=a.logger.center)||void 0===r||r.leavedChannel(),a.logger.info("leaved channel",this.joinRsp.channel)}}))}getInfo(){let e=Object.assign({},this.info);return e.props=Object.assign({},e.props),e}getPublishExOption(e,t){return n(this,void 0,void 0,(function*(){return{}}))}publishLocalTrack(e,t){return n(this,void 0,void 0,(function*(){if(!t.desc)throw new s.SdkError("轨道发布描述不能为空");let r=this.getMe(),n=yield this.getPublishExOption(e,t);if(yield this.rtcStreamEngine.publish(e,t,n),e.kind==h.TrackKind.Audio){let r=t;e.updateInfo({desc:r.desc,codec:r.codec,bitrate:r.maxBitrate,props:r.props})}else{let r=t;e.updateInfo({desc:r.desc,codec:r.codec,width:r.width,height:r.height,fps:r.maxFramerate,bitrate:r.maxBitrate,props:r.props})}try{let t=Object.values(r.getTracks()).map((e=>e.getInfo()));t.push(e.getInfo()),yield this.rtcApi.updateStream(t),r.getTracks()[e.id]=e}catch(t){throw this.unpublishLocalTrack(e),t}}))}unpublishLocalTrack(e){return n(this,void 0,void 0,(function*(){let t=this.getMe(),r=!1,n=Object.values(t.getTracks()).map((e=>e.getInfo())),i=n.filter((t=>(r=!0,t.id!==e.id)));if(r){yield this.rtcApi.updateStream(i);try{yield this.rtcStreamEngine.unpublish(e),delete t.getTracks()[e.id]}catch(e){throw yield this.rtcApi.updateStream(n),e}}else a.logger.warn(e.toString()+"已取消发布,无需再次取消发布")}))}getSubscribeExOption(e){return n(this,void 0,void 0,(function*(){return{}}))}subscribeRemoteAudioMixTrack(e){return n(this,void 0,void 0,(function*(){let t=this.newRemoteAudioMixTrack(e),r=yield this.getSubscribeExOption(t);return yield this.rtcStreamEngine.subscribe(t,r),t}))}subscribeRemoteAudioTrack(e,t){return n(this,void 0,void 0,(function*(){let r=this.getUser(e).getTrack(t);if(!r)throw new s.SdkError(e+"没有id为"+t+"的音频流");if(r.kind!=h.TrackKind.Audio)throw new s.SdkError(e+"id为"+t+"的流非音频,而是"+r.kind);let n=yield this.getSubscribeExOption(r);return yield this.rtcStreamEngine.subscribe(r,n),r}))}subscribeRemoteVideoTrack(e,t){return n(this,void 0,void 0,(function*(){let r=this.getUser(e).getTrack(t);if(!r)throw new s.SdkError(e+"没有id为"+t+"的视频流");if(r.kind!=h.TrackKind.Video)throw new s.SdkError(e+"id为"+t+"的流非视频,而是"+r.kind);let n=yield this.getSubscribeExOption(r);return yield this.rtcStreamEngine.subscribe(r,n),r}))}unsubscribeRemoteTrack(e){return n(this,void 0,void 0,(function*(){yield this.rtcStreamEngine.unsubscribe(e)}))}}t.BaseChannel=p},3404:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommonTrackEventType=t.CommonChannelEventType=t.DisconnectReason=t.ChannelEvent=void 0;var r;t.ChannelEvent=class{constructor(e,t){this.type=e,this.data=t}},function(e){e[e.Error=-1]="Error",e[e.Self=1]="Self",e[e.Kicked=2]="Kicked",e[e.Replace=3]="Replace",e[e.Timeout=4]="Timeout",e[e.Destroy=5]="Destroy"}(r||(t.DisconnectReason=r={}));class n{}t.CommonChannelEventType=n,n.CHANNEL_UPDATE="channel_update",n.JOIN_SUCCEED="join_succeed",n.ME_UPDATE="me_update",n.RECONNECTING="reconnecting",n.RECONNECTED="reconnected",n.DISCONNECTED="disconnected",n.USER_JOIN="user_join",n.USER_UPDATE="user_update",n.USER_LEAVE="user_leave",n.USER_TRACK_ADD="user_track_add",n.USER_TRACK_UPDATE="user_track_update",n.USER_TRACK_REMOVE="user_track_remove",n.CUSTOM_MSG="custom_msg",n.TRACK_MUTED="track_muted",n.TRACK_UNMUTED="track_unmuted",n.TRACK_ENDED="track_ended";class i{}t.CommonTrackEventType=i,i.MUTED="muted",i.UNMUTED="unmuted",i.ENDED="ended"},7620:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseSRTC=void 0;const i=r(3143),o=r(7130),s=r(86),a=r(7255),l=r(7514),u=r(7820),c=r(3404);t.BaseSRTC=class{constructor(e){this.onNotifyChannelEvent=null,this.isAppHide=!1,e.logLevel&&l.logger.setLevel(e.logLevel),e.logTarget&&((0,i.isWxxcx)()||e.logTarget!=l.LogTarget.WXREALTIME||(e.logTarget=l.LogTarget.CONSOLE,l.logger.warn("仅微信小程序支持实时日志")),l.logger.setTarget(e.logTarget));let t=this.buildInfo();l.logger.warn("srtc "+((0,i.isWxxcx)()?"wechat":"webrtc")+" sdk version:",t.version,"build time:",(0,s.dateFormat)("Y-m-d H:i:s",new Date(1e3*t.timestamp)))}join(e){return n(this,arguments,void 0,(function*(e,t={netID:"",sgID:""}){if(this.channel)throw new o.SdkError("请先退出频道");const r=Math.floor(Date.now()/1e3);let u=(0,s.decryptChannelToken)(e);if(u.exp_at&&u.exp_at<r)throw new o.SdkError("token已过期");u.log_center&&(l.logger.center=new a.RtcLogger(u,this.getStoredDeviceId(),this.getDeviceType(),!0));let h=this.rtcApi=this.newRtcApi(u),f=yield h.join({deviceType:this.getDeviceType(),deviceID:this.getStoredDeviceId(),version:this.buildInfo().version,netID:t.netID,sgID:t.sgID}),d=this.newStreamEngine(f);yield d.connect();let p=this.rtcSocket=this.newRtcSocket(((e,r,n)=>{const o=Math.floor(Date.now()/1e3);return f.mqtt.token_exp_at<o&&h.reconnect({type:0,netID:t.netID,sgID:t.sgID}).then((e=>{f.mqtt=e.mqtt,f.upload=e.upload,f.rtmp=e.rtmp,f.webrtc=e.webrtc})),n.options.username=f.mqtt.username,n.options.clientId=f.mqtt.client_id,n.options.password=f.mqtt.jwt_token,(0,i.isWxxcx)()?f.mqtt.ws.replace(/ws:/,"wx:").replace(/wss:/,"wxs:"):f.mqtt.ws})),g=this.channel=this.newChannel(f,h,d,p);return new Promise(((e,t)=>n(this,void 0,void 0,(function*(){g.once(c.CommonChannelEventType.JOIN_SUCCEED,(t=>{e(t)})),g.once(c.CommonChannelEventType.DISCONNECTED,(e=>{t(e)}));try{yield p.connect(f.mqtt)}catch(e){t(e)}}))))}))}leave(){return n(this,void 0,void 0,(function*(){if(this.channel)try{this.onNotifyChannelEvent=null;const e=this.channel;this.channel=null,yield e.leave(u.LeaveReason.Self),this.rtcSocket=null,this.rtcApi=null}catch(e){l.logger.error("离开频道报错,强制离开",e)}else l.logger.warn("您不在频道中,无需调用离开")}))}getChannelInfo(){return this.channel?this.channel.getInfo():null}getUserInfo(e){if(!this.channel)throw new o.SdkError("您不在频道内");return this.channel.getUser(e).getInfo()}getUsersInfo(){if(!this.channel)throw new o.SdkError("您不在频道内");return this.channel.getUsersInfo()}subscribeRemoteAudioMixTrack(e){return n(this,void 0,void 0,(function*(){if(!this.channel)throw new o.SdkError("您不在频道内");return yield this.channel.subscribeRemoteAudioMixTrack(e)}))}subscribeRemoteAudioTrack(e,t){return n(this,void 0,void 0,(function*(){if(!this.channel)throw new o.SdkError("您不在频道内");return yield this.channel.subscribeRemoteAudioTrack(e,t)}))}subscribeRemoteVideoTrack(e,t){return n(this,void 0,void 0,(function*(){if(!this.channel)throw new o.SdkError("您不在频道内");return yield this.channel.subscribeRemoteVideoTrack(e,t)}))}unsubscribeRemoteTrack(e){return n(this,void 0,void 0,(function*(){if(!this.channel)throw new o.SdkError("您不在频道内");yield this.channel.unsubscribeRemoteTrack(e)}))}onAppShow(e){e?l.logger.warn("页面恢复显示",e):l.logger.warn("页面恢复显示"),this.isAppHide=!1}onAppHide(){l.logger.warn("页面切后台或最小化"),this.isAppHide=!0}}},2977:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.RtcMsgType=void 0,function(e){e.UserJoin="user_join",e.UserUpdate="user_update",e.UserLeave="user_leave",e.StreamUpdate="stream_update",e.ChannelUpdate="channel_update",e.ChannelDestroy="channel_destroy",e.Custom="custom"}(r||(t.RtcMsgType=r={}))},2871:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRtcSocket=t.SocketEvent=void 0;const o=i(r(7007)),s=i(r(3061)),a=r(6526),l=r(3143),u=r(7130),c=r(7514);var h;!function(e){e.CONNECTED="connected",e.RECONNECTING="reconnection",e.CHANNEL_MESSAGE="channelmessage",e.IM_MESSAGE="immessage",e.CUSTOM_TOPIC_MESSAGE="custommessage"}(h||(t.SocketEvent=h={}));class f extends o.default{constructor(e){super(),this.version=1,this.ssTopics={},this.authReconnect=e,this.unpacker=new a.Unpackr({useRecords:!1,int64AsType:"number"})}connect(e){return n(this,void 0,void 0,(function*(){this.client&&(yield this.close(!0));let t=e.ws;return(0,l.isWxxcx)()&&(t=e.ws.replace(/ws:/,"wx:").replace(/wss:/,"wxs:")),new Promise(((r,i)=>{this.client=s.default.connect(t,{keepalive:30,clean:!1,connectTimeout:1e4,reconnectPeriod:3e3,resubscribe:!1,clientId:e.client_id,username:e.username,password:e.jwt_token,transformWsUrl:this.authReconnect});let o=e=>{l(),setTimeout((()=>{this.close(!0)}),0);let t=e?u.SdkError.fromError(e):new u.SdkError("会控服务连接失败");i(t)},a=t=>{l(),e.topics.forEach((e=>n(this,void 0,void 0,(function*(){try{yield this.subscribe(e,2)}catch(e){this.close(!0),i(e)}})))),this.addListeners(),this.client.emit("connect",t),r()},l=()=>{this.client.off("connect",a),this.client.off("error",o),this.client.off("offline",o),this.client.off("close",o)};this.client.once("connect",a),this.client.once("error",o),this.client.once("offline",o),this.client.once("close",o)}))}))}addListeners(){this.client.on("connect",(()=>{c.logger.info("socket connected"),this.emit(h.CONNECTED)})),this.client.on("reconnect",(()=>{c.logger.info("socket start reconnect"),this.emit(h.RECONNECTING)})),this.client.on("close",(()=>{c.logger.info("socket closed")})),this.client.on("offline",(()=>{c.logger.info("socket offline")})),this.client.on("error",(e=>{throw c.logger.error("socket error",e),u.SdkError.fromError(e)})),this.onMsg=this.onMsg.bind(this),this.client.on("message",this.onMsg)}subscribe(e,t=0){return new Promise(((r,n)=>{this.client.subscribe(e,{qos:t},((t,i)=>{t?(c.logger.error(`subscribe ${e} error`,t),n(u.SdkError.fromError(t))):i&&(c.logger.debug(`subscribe ${e} success`,i),i.forEach((e=>{this.ssTopics[e.topic]=e.qos})),r())}))}))}unsubscribe(e){return new Promise(((t,r)=>{this.client.unsubscribe(e,(n=>{if(n)c.logger.error(`unsubscribe ${e} error`,n),r(u.SdkError.fromError(n));else{("string"==typeof e?[e]:e).forEach((e=>{delete this.ssTopics[e]})),t()}}))}))}close(){return n(this,arguments,void 0,(function*(e=!1){return new Promise(((t,r)=>{this.client.end(e,(e=>{null!=e?r(u.SdkError.fromError(e)):t()}))}))}))}sendMsg(e,t,r=0){return new Promise(((n,i)=>{this.client.publish(t,e,{qos:r},(e=>{null!=e?i(u.SdkError.fromError(e)):n()}))}))}onMsg(e,t,r){try{if(0!==e.indexOf("/rtc/"))return void this.emit(h.CUSTOM_TOPIC_MESSAGE,e,t);let r=this.unpacker.unpack(t);if(null==r)return void c.logger.error("解析报文失败",e,t);c.logger.debug("收到会控消息",r),this.emit(r.data.channel?h.CHANNEL_MESSAGE:h.IM_MESSAGE,r)}catch(e){c.logger.error("消息处理报错",e)}}}t.BaseRtcSocket=f},8912:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseStreamEngine=t.StreamEngineVendor=void 0;const i=r(7130),o=r(86),s=r(7514),a=r(5951);var l;!function(e){e.OOK="ook",e.WangsuCDN="wangsucdn"}(l||(t.StreamEngineVendor=l={}));t.BaseStreamEngine=class{constructor(e,t){this.joinRsp=e,this.published={},this.subscribed={},t&&(this.ability?(0,o.propAssign)(this.ability,t):this.ability=t)}publish(e,t,r){return n(this,void 0,void 0,(function*(){let t=0;if(e.kind==a.TrackKind.Audio&&this.ability&&void 0!==this.ability.audioMaxPub&&-1!=this.ability.audioMaxPub){for(const e in this.published){this.published[e].kind==a.TrackKind.Audio&&t++}if(t>=this.ability.audioMaxPub)throw new i.SdkError("最多允许发布"+this.ability.audioMaxPub+"个音频轨道")}else if(e.kind==a.TrackKind.Video&&this.ability&&void 0!==this.ability.videoMaxPub&&-1!=this.ability.videoMaxPub){for(const e in this.published){this.published[e].kind==a.TrackKind.Video&&t++}if(t>=this.ability.videoMaxPub)throw new i.SdkError("最多允许发布"+this.ability.videoMaxPub+"个视频轨道")}}))}subscribe(e,t){return n(this,void 0,void 0,(function*(){let t=0;if(e.kind==a.TrackKind.Audio&&this.ability&&void 0!==this.ability.audioMaxSub&&-1!=this.ability.audioMaxSub){for(const e in this.subscribed){this.subscribed[e].kind==a.TrackKind.Audio&&t++}if(t>=this.ability.audioMaxSub)throw new i.SdkError("最多允许订阅"+this.ability.audioMaxSub+"个音频轨道")}else if(e.kind==a.TrackKind.Video&&this.ability&&void 0!==this.ability.videoMaxSub&&-1!=this.ability.videoMaxSub){for(const e in this.subscribed){this.subscribed[e].kind==a.TrackKind.Video&&t++}if(t>=this.ability.videoMaxSub)throw new i.SdkError("最多允许订阅"+this.ability.videoMaxSub+"个视频轨道")}}))}haveSubscribed(e){return!!this.subscribed[e.id]}disconnect(){return n(this,void 0,void 0,(function*(){for(const e in this.published){const t=this.published[e];try{yield this.unpublish(t.track)}catch(e){s.logger.error(t.track.toString(),"取消发布失败")}}for(const e in this.subscribed){const t=this.subscribed[e];try{yield this.unsubscribe(t.track)}catch(e){s.logger.error(t.track.toString(),"取消订阅失败")}}this.published={},this.subscribed={}}))}}},5951:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTrack=t.Codec=t.TrackKind=t.TRACK_MCU_ID=t.TRACK_AMIXER_ID=void 0;const i=n(r(7007)),o=r(86);var s,a;t.TRACK_AMIXER_ID="__amixer__",t.TRACK_MCU_ID="__mcu__",function(e){e.Video="video",e.Audio="audio"}(s||(t.TrackKind=s={})),function(e){e[e.Unknown=0]="Unknown",e[e.H264=27]="H264",e[e.H265=36]="H265",e[e.AAC=15]="AAC",e[e.OPUS=1398100047]="OPUS"}(a||(t.Codec=a={}));class l extends i.default{constructor(e,t){super(),this.info=e,this.uid=t}get id(){return this.info.id}get kind(){return this.info.kind}get desc(){return this.info.desc}getInfo(){let e=Object.assign({},this.info);return e.props=Object.assign({},e.props),e}updateInfo(e){return(0,o.propAssign)(this.info,e)}getUid(){return this.uid}strPrefix(){return"流轨道"}toString(){const e=[this.uid?`uid:${this.uid}`:null,this.info.desc?`desc:${this.info.desc}`:null,this.id?`id:${this.info.id}`:null].filter(Boolean);return this.strPrefix()+"["+e.join("; ")+"]"}}t.BaseTrack=l},6757:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceType=void 0,function(e){e[e.Unknown=0]="Unknown",e[e.Windows=1]="Windows",e[e.Android=2]="Android",e[e.IOS=3]="IOS",e[e.Linux=4]="Linux",e[e.MacOS=5]="MacOS",e[e.WebRTC=6]="WebRTC",e[e.XCX=7]="XCX"}(r||(t.DeviceType=r={}))},1381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseUser=void 0;const n=r(86);t.BaseUser=class{constructor(e){var t;this.info=e,this.tracks={},null===(t=e.stream_tracks)||void 0===t||t.forEach((e=>{let t=this.newTrack(e);this.tracks[e.id]=t}))}getTrack(e){return this.tracks[e]}getTracks(){return this.tracks}updateTracks(e){let t=[],r=[],n=[],i={},o={};for(let e in this.tracks)i[e]=!0,o[e]=this.tracks[e];e.forEach((e=>{let n=o[e.id];if(n){let t=n.updateInfo(e);delete i[e.id],t.length>0&&r.push(n)}else{let r=this.newTrack(e);this.tracks[e.id]=r,t.push(r)}}));for(let e in i){let t=this.tracks[e];t&&(delete this.tracks[e],n.push(t))}return this.info.stream_tracks=e,{added:t,updated:r,deleted:n}}get uid(){return this.info.uid}get sid(){return this.info.sid}get device_type(){return this.info.device_type}get device_id(){return this.info.device_id}get link_id(){return this.info.link_id}getInfo(){var e;let t=Object.assign({},this.info);return t.props=Object.assign({},t.props),t.stream_tracks=null===(e=t.stream_tracks)||void 0===e?void 0:e.map((e=>Object.assign({},e))),t}updateInfo(e){(0,n.propAssign)(this.info,e)}}},1758:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Ability=void 0;const i=r(3143),o=r(7130),s=r(7514);t.Ability=class{static checkCameraPermission(){return n(this,void 0,void 0,(function*(){if((0,i.isWxxcx)()){let e="scope.camera";return new Promise(((t,r)=>{wx.authorize({scope:e,success:()=>{t()},fail:()=>{r(new o.SdkError("获取摄像头授权失败",40001))}})}))}}))}static checkMicPermission(){return n(this,void 0,void 0,(function*(){if((0,i.isWxxcx)()){let e="scope.record";return new Promise(((t,r)=>{wx.authorize({scope:e,success:()=>{t()},fail:()=>{r(new o.SdkError("获取麦克风授权失败",40001))}})}))}}))}static videoEncCodecs(){return"getCapabilities"in RTCRtpSender?RTCRtpSender.getCapabilities("video"):(s.logger.warn("当前环境不支持getCapabilities获取支持的视频编码类型"),null)}static audioEncCodecs(){return"getCapabilities"in RTCRtpSender?RTCRtpSender.getCapabilities("audio"):(s.logger.warn("当前环境不支持getCapabilities获取支持的音频编码类型"),null)}static videoDecCodecs(){return"getCapabilities"in RTCRtpReceiver?RTCRtpReceiver.getCapabilities("video"):(s.logger.warn("当前环境不支持getCapabilities获取支持的视频解码类型"),null)}static audioDecCodecs(){return"getCapabilities"in RTCRtpReceiver?RTCRtpReceiver.getCapabilities("audio"):(s.logger.warn("当前环境不支持getCapabilities获取支持的音频解码类型"),null)}static checkVideoCodec(e,t=!0){const r=t?this.videoEncCodecs():this.videoDecCodecs();if(r)for(const t of r.codecs)if(t.mimeType.toLowerCase().replace("video/","")===e.toLowerCase())return!0;return!1}static checkAudioCodec(e,t=!0){const r=t?this.audioEncCodecs():this.audioDecCodecs();if(r)for(const t of r.codecs)if(t.mimeType.toLowerCase().replace("audio/","")===e.toLowerCase())return!0;return!1}}},3143:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isWxxcx=s,t.isChromiumBased=function(){var e,t,r;return"chrome"===(null===(r=null===(t=null===(e=c())||void 0===e?void 0:e.browser)||void 0===t?void 0:t.name)||void 0===r?void 0:r.toLowerCase())},t.isSafari=function(){var e,t,r;return"Safari"===(null===(r=null===(t=null===(e=c())||void 0===e?void 0:e.browser)||void 0===t?void 0:t.name)||void 0===r?void 0:r.toLowerCase())},t.isWebrtcSupport=a,t.getEnvInfo=c;const i=n(r(6880)),o=r(1758);function s(){return"undefined"!=typeof wx&&"function"==typeof wx.getSystemInfo}function a(){return"undefined"!=typeof RTCPeerConnection&&("addTransceiver"in RTCPeerConnection.prototype||"addTrack"in RTCPeerConnection.prototype)}let l,u;function c(e=!1){var t,r,n;if(s()){if(e||void 0===l){const e=wx.getSystemInfoSync(),t=wx.getDeviceInfo();l={system:e,device:t}}return l}return(e||void 0===u)&&(u=Object.assign(Object.assign({},i.default.parse(null===navigator||void 0===navigator?void 0:navigator.userAgent)),{supported:a(),secure:isSecureContext,mediaDevices:void 0!==(null===navigator||void 0===navigator?void 0:navigator.mediaDevices),screenshare:void 0!==(null===(t=null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||void 0===t?void 0:t.getDisplayMedia),h264Enc:o.Ability.checkVideoCodec("h264"),h264Dec:o.Ability.checkVideoCodec("h264",!1),vp8Enc:o.Ability.checkVideoCodec("vp8"),vp8Dec:o.Ability.checkVideoCodec("vp8",!1),opusEnc:o.Ability.checkAudioCodec("opus"),opusDec:o.Ability.checkAudioCodec("opus",!1),videoEncCodecs:o.Ability.videoEncCodecs(),videoDecCodecs:o.Ability.videoDecCodecs(),audeoEncCodecs:o.Ability.audioEncCodecs(),audeoDecCodecs:o.Ability.audioDecCodecs(),ua:null===navigator||void 0===navigator?void 0:navigator.userAgent,screenWidth:(null===screen||void 0===screen?void 0:screen.width)||0,screenHeight:(null===screen||void 0===screen?void 0:screen.height)||0,clientWidth:(null===(r=null===document||void 0===document?void 0:document.documentElement)||void 0===r?void 0:r.clientWidth)||0,clientHeight:(null===(n=null===document||void 0===document?void 0:document.documentElement)||void 0===n?void 0:n.clientHeight)||0,devicePixelRatio})),u}},7130:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SdkError=void 0;class r{constructor(e,t=0){this.msg=e,this.code=t}static fromError(e){return new r(e.name+":"+e.message)}toJSON(){return{code:this.code,msg:this.msg}}}t.SdkError=r},86:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=s,t.tpl=function(e,t){return e.replace(/\{\{([\w.]+)\}\}/g,(function(e,r){const n=r.split(".");let i=t;for(let e=0;e<n.length&&(i=i[n[e]],null!=i);e++);return null==i?"":i.toString()}))},t.propAssign=function(e,t,r){let n=[];return function(e){return Object.getOwnPropertyNames(e)}(t).forEach((i=>{let o=!0;s(e[i])?JSON.stringify(e[i])!==JSON.stringify(t[i])&&(o=!1):e[i]!==t[i]&&(o=!1),o||(n.push({prop:i.toString(),value:t[i],old:e[i]}),r&&r[i]?r[i](t[i],e[i]):e[i]=t[i])})),n},t.dateFormat=function(e,t=new Date){for(var r="",n=t.getMonth(),i=n+1,o=t.getDay(),s=t.getDate(),a=t.getFullYear(),l=t.getHours(),u=t.getMinutes(),c=t.getSeconds(),h=0,f=e.length;h<f;h++)switch(e[h]){case"j":r+=s;break;case"d":r+=s<10?"0"+s:s;break;case"l":var d=Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");r+=d[o];break;case"w":r+=o;break;case"D":r+=(d=Array("Sun","Mon","Tue","Wed","Thr","Fri","Sat"))[o];break;case"m":r+=i<10?"0"+i:i;break;case"n":r+=i;break;case"F":var p=Array("January","February","March","April","May","June","July","August","September","October","November","December");r+=p[n];break;case"M":r+=(p=Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"))[n];break;case"Y":r+=a;break;case"y":r+=a.toString().slice(-2);break;case"H":r+=l<10?"0"+l:l;break;case"g":var g=0===l?12:l;r+=g>12?g-12:g;break;case"h":r+=(g=(g=0===l?12:l)>12?g-12:g)<10?"0"+g:g;break;case"a":r+=l<12?"am":"pm";break;case"i":r+=u<10?"0"+u:u;break;case"s":r+=c<10?"0"+c:c;break;case"c":r+=t.toISOString();break;default:r+=e[h]}return r},t.genNonce=a,t.genDeviceId=function(){return a(18)},t.getHostnameFromUrl=function(e){const t=e.match(/^(?:.+?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n]+)/im);if(t&&t[1])return t[1];return""},t.decryptChannelToken=function(e){return JSON.parse(o.default.decrypt(e,i.enc.Utf8.parse(l),{iv:i.enc.Utf8.parse(u),padding:i.pad.Pkcs7,mode:i.mode.CBC}).toString(i.enc.Utf8))};const i=r(1396),o=n(r(955));function s(e){return null!=e&&"object"==typeof e}function a(e=18){e=e||32;let t="ABCDEFGHJKLMNOPQRSTUVWXYZabcdefghigklmnopqrstuvwxyz1234567890",r="";for(let n=0;n<e;n++)r+=t.charAt(Math.floor(61*Math.random()));return r}const l="6o30j79YRE39bEwI",u="2apW3WiFl72ZVS3x"},8949:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.localForageWxDriver=void 0,t.localForageWxDriver={keyPrefix:"",_driver:"localForageWxDriver",_initStorage:function(e){this.keyPrefix=e.name+"/"+e.storeName+"/"},_support:"undefined"!=typeof wx&&"function"==typeof wx.getSystemInfo,getItem:function(e,t){return new Promise(((t,r)=>{try{t(wx.getStorageSync(this.keyPrefix+e))}catch(e){r(e)}}))},setItem:function(e,t,r){return new Promise(((r,n)=>{try{wx.setStorageSync(this.keyPrefix+e,t),r(t)}catch(e){n(e)}}))},removeItem:function(e,t){return new Promise(((t,r)=>{try{wx.removeStorageSync(this.keyPrefix+e),t()}catch(e){r(e)}}))},clear:function(e){return r(this,void 0,void 0,(function*(){const e=(yield this.keys()).map((e=>this.removeItem(e)));yield Promise.all(e)}))},length:function(e){return r(this,void 0,void 0,(function*(){return(yield this.keys()).length}))},key:function(e,t){return r(this,void 0,void 0,(function*(){return(yield this.keys())[e]}))},keys:function(e){return new Promise(((e,t)=>{try{var r=this.keyPrefix.length;const t=wx.getStorageInfoSync();let i=[];for(let e=0;e<t.keys.length;e++){var n=t.keys[e];n.startsWith(this.keyPrefix)&&i.push(n.substring(r))}e(i)}catch(e){t(e)}}))},iterate:function(e,t){return r(this,void 0,void 0,(function*(){const t=yield this.keys();let r=1;for(var n=0;n<t.length;n++){const i=t[n];let o=yield this.getItem(i),s=e(o,i,r++);if(void 0!==s)return s}}))},dropInstance:function(e,t){return this.clear()}}},7255:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RtcLogger=t.RtcLogType=t.RtcLogLevel=void 0;const o=r(1396),s=i(r(3790)),a=r(6757),l=r(7130),u=r(86),c=r(8949),h=r(7514);var f,d,p;!function(e){e[e.Undefined=0]="Undefined",e[e.Trace=1]="Trace",e[e.Debug=5]="Debug",e[e.Info=9]="Info",e[e.Warn=13]="Warn",e[e.Error=17]="Error",e[e.FATAL=21]="FATAL"}(f||(t.RtcLogLevel=f={})),function(e){e.AppStart="app.start",e.AppResource="app.resource",e.AppNetwork="app.network",e.RtcEvtAudioInput="rtc.event.audioinput",e.RtcEvtAudioOutput="rtc.event.audiooutput",e.RtcEvtVideoInput="rtc.event.videoinput",e.RtcEvtVideoOutput="rtc.event.videooutput",e.RtcEvtRemoteStream="rtc.event.remotestream",e.RtcEvtConnection="rtc.event.connection",e.RtcMqtt="rtc.mqtt",e.RtcRequest="rtc.request",e.RtcOok="rtc.ook",e.RtcMarker="rtc.marker",e.RtcLog="rtc.log",e.AppLog="app.log"}(d||(t.RtcLogType=d={})),function(e){e[e.Log=0]="Log",e[e.Metric=1]="Metric"}(p||(p={}));t.RtcLogger=class{constructor(e,t,r,n){this.isWorking=!1,this.keyIdx=0,this.startTime=Date.now(),this.enabled=n,this.token=e,this.deviceID=t,this.deviceType=r,this.api=new g(e.app_id,e.log_center,t,r,"vaZ7MQ45m0KRjJ2u"),n&&(r==a.DeviceType.XCX&&s.default.defineDriver(c.localForageWxDriver),this.storage=s.default.createInstance({name:"rtcsdk",storeName:e.sid,driver:r==a.DeviceType.XCX?c.localForageWxDriver._driver:void 0}),this.storage.ready().then((()=>{console.debug("localforage initialized",this.storage.driver()),this.work()})).catch((e=>{console.debug("localforage initialize error",e),this.storage=void 0})),setInterval((()=>{this.work()}),6e4))}leavedChannel(){this.work()}work(){return n(this,void 0,void 0,(function*(){if(this.enabled&&!this.isWorking){this.isWorking=!0;try{yield this.upload()}catch(e){h.logger.error("rtc日志上传报错",e)}finally{this.isWorking=!1}}}))}makeKey(e){let t=[e==p.Log?"log":"metric",this.startTime,this.keyIdx].join("_");return this.keyIdx++,t}appendToStorage(e,t){return n(this,void 0,void 0,(function*(){if(!this.storage)return;let r=this.makeKey(e);yield this.storage.setItem(r,t);let n=yield this.storage.keys();if(n.length>=5e3){n.sort(((e,t)=>{let r=parseFloat(e.split("_").slice(1).join(".")),n=parseFloat(t.split("_").slice(1).join("."));return r<n?-1:r>n?1:0}));const e=n.slice(0,1e3).map((e=>this.storage.removeItem(e)));yield Promise.all(e)}}))}peekFromStorage(){return n(this,void 0,void 0,(function*(){if(!this.storage)return[];let e=yield this.storage.keys();e.sort(((e,t)=>{let r=parseFloat(e.split("_").slice(1).join(".")),n=parseFloat(t.split("_").slice(1).join("."));return r<n?-1:r>n?1:0})),console.debug("rtclog storage count="+e.length);let t=[];for(let r=0;r<e.length;r++){let n=e[r],i={type:p.Log,key:n,content:void 0};if(n.startsWith("log_"))i.type=p.Log;else{if(!n.startsWith("metric_"))continue;i.type=p.Metric}if(i.content=yield this.storage.getItem(n),i.content&&i.content.body&&Array.isArray(i.content.body)&&(i.content.body=JSON.stringify(i.content.body)),t.push(i),t.length>=500)break}return t}))}removeStorage(e){return n(this,void 0,void 0,(function*(){if(!this.storage)return;const t=e.map((e=>this.storage.removeItem(e.key)));yield Promise.all(t)}))}upload(){return n(this,void 0,void 0,(function*(){let e=yield this.peekFromStorage();if(0==e.length)return;let t={device_id:this.deviceID,device_type:this.deviceType,app_id:this.token.app_id,uid:this.token.uid,logs:[],metrics:[]};for(let r=0;r<e.length;r++){let n=e[r];n.type==p.Log?t.logs.push(n.content):n.type==p.Metric&&t.metrics.push(n.content)}yield this.api.push(t),yield this.removeStorage(e)}))}addLog(e){return n(this,arguments,void 0,(function*({body:e,level:t=f.Undefined,type:r=d.AppLog}){if(!this.enabled)return;let n={time:Date.now(),type:r,serverity:t,channel:this.token.channel,attr:(0,u.isObject)(e)?e:{},body:(0,u.isObject)(e)?"":e};return yield this.appendToStorage(p.Log,n)}))}addMetric(e){return n(this,void 0,void 0,(function*(){var t;if(this.enabled)return e.time=Date.now(),e.channel=null===(t=this.token)||void 0===t?void 0:t.channel,yield this.appendToStorage(p.Metric,e)}))}};class g{constructor(e,t,r,n,i){this.appID=e,"/"!==t.substring(t.length-1)&&(t+="/"),"/v1/"!==t.substring(t.length-4)&&(t+="log/api/v1/"),this.serverPrefix=t,this.deviceID=r,this.deviceType=n,this.logSecretKey=i}refreshToken(){return n(this,void 0,void 0,(function*(){let e={app_id:this.appID,device_id:this.deviceID,device_type:this.deviceType,requested_at:Date.now()};e.sign=this.signutreRequest(e);let t=yield this.request("auth/gettoken",e);if(0!=t.ret.code)throw new l.SdkError("获取rtc日志中心token失败: "+t.ret.cn,t.ret.code);this.logToken=t.data.token}))}push(e){return n(this,void 0,void 0,(function*(){this.logToken||(yield this.refreshToken());let t=yield this.request("data/push",e);if(10041==t.code||10042==t.code||10043==t.code)return this.logToken="",this.push(e);if(0!=t.ret.code)throw new l.SdkError(t.ret.cn,t.ret.code);console.debug("上传rtc日志成功")}))}signutreRequest(e){let t,r=[];for(t in e)r.push(t+"="+e[t]);r.sort();let n=r.join("&")+"&"+this.logSecretKey;return(0,o.SHA256)(n).toString()}request(e,t){let r=this.serverPrefix+e,n={"Content-Type":"application/json;charset=UTF-8"};return this.logToken&&(n.Authorization="Bearer "+this.logToken),this.deviceType==a.DeviceType.XCX?new Promise(((e,i)=>{wx.request({url:r,method:"POST",header:n,data:JSON.stringify(t),success(t){if(200!=t.statusCode)i(new l.SdkError(t.errMsg,t.statusCode));else{let r=t.data;e(r)}},fail:function(e){i(new l.SdkError(e.errMsg,e.errno))}})})):new Promise(((e,i)=>{fetch(r,{method:"POST",headers:n,body:JSON.stringify(t)}).then((t=>{200!=t.status?i(new l.SdkError(t.statusText,t.status)):t.json().then((t=>{e(t)})).catch((e=>{i(new l.SdkError(e.toString()))}))})).catch((e=>{i(new l.SdkError(e.toString()))}))}))}}},7514:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.LogLevel=t.LogTarget=void 0;const n=r(3143),i=r(86),o=r(7255);var s,a;!function(e){e.CONSOLE="console",e.WXREALTIME="wxrealtime",e.NONE="none"}(s||(t.LogTarget=s={})),function(e){e.DEBUG="debug",e.INFO="info",e.WARN="warn",e.ERROR="error"}(a||(t.LogLevel=a={}));t.logger=new class{constructor(){this.logTarget=s.CONSOLE,this.logLevel=a.INFO,this.logCss="border: 1px solid; padding:2px 5px; border-radius: 3px"}setTarget(e){this.logTarget=e}setLevel(e){this.logLevel=e}getPrefix(e){return`%c ${(0,i.dateFormat)("H:i:s")} sdk_${e}`}debug(...e){var t;if(this.logTarget!=s.NONE&&(this.snapshotArgs(e),(0,n.isWxxcx)()&&wx.getLogManager({level:1}).debug("sdk_debug",...e),null===(t=this.center)||void 0===t||t.addLog({level:o.RtcLogLevel.Debug,type:o.RtcLogType.RtcLog,body:e}),this.logLevel===a.DEBUG))switch(this.logTarget){case s.CONSOLE:return console.debug(this.getPrefix("debug"),this.logCss,...e);case s.WXREALTIME:return wx.getRealtimeLogManager().info("sdk_debug",...e)}}info(...e){var t;if(this.logTarget!=s.NONE&&(this.snapshotArgs(e),(0,n.isWxxcx)()&&wx.getLogManager({level:1}).info("sdk_info",...e),null===(t=this.center)||void 0===t||t.addLog({level:o.RtcLogLevel.Info,type:o.RtcLogType.RtcLog,body:e}),this.logLevel===a.DEBUG||this.logLevel===a.INFO))switch(this.logTarget){case s.CONSOLE:return console.log(this.getPrefix("info"),this.logCss,...e);case s.WXREALTIME:return wx.getRealtimeLogManager().info("sdk_info",...e)}}warn(...e){var t;if(this.logTarget!=s.NONE&&(this.snapshotArgs(e),(0,n.isWxxcx)()&&wx.getLogManager({level:1}).warn("sdk_warn",...e),null===(t=this.center)||void 0===t||t.addLog({level:o.RtcLogLevel.Warn,type:o.RtcLogType.RtcLog,body:e}),this.logLevel===a.DEBUG||this.logLevel===a.INFO||this.logLevel===a.WARN))switch(this.logTarget){case s.CONSOLE:return console.warn(this.getPrefix("warn"),this.logCss,...e);case s.WXREALTIME:return wx.getRealtimeLogManager().warn("sdk_warn",...e)}}error(...e){var t;if(this.logTarget!=s.NONE)switch(this.snapshotArgs(e),(0,n.isWxxcx)()&&wx.getLogManager({level:1}).warn("sdk_error",...e),console.error(this.getPrefix("error"),this.logCss,...e),null===(t=this.center)||void 0===t||t.addLog({level:o.RtcLogLevel.Error,type:o.RtcLogType.RtcLog,body:e}),this.logTarget){case s.CONSOLE:return;case s.WXREALTIME:return wx.getRealtimeLogManager().error("sdk_error",...e)}}snapshotArgs(e){e.forEach(((t,r)=>{!(0,i.isObject)(t)||t instanceof Error||(e[r]=JSON.parse(JSON.stringify(t)))}))}}},7820:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TrackKind=t.SRTC=t.ScreenPresets=t.RemoteVideoTrack=t.RemoteAudioTrack=t.RemoteAudioMixTrack=t.MicPresets=t.LogTarget=t.LogLevel=t.LocalVideoTrack=t.LocalScreenTrack=t.LocalMicTrack=t.LocalCameraTrack=t.LocalAudioTrack=t.LeaveReason=t.ChannelEventType=t.ChannelEvent=t.CameraPresets=void 0;const n=r(3404);Object.defineProperty(t,"ChannelEvent",{enumerable:!0,get:function(){return n.ChannelEvent}}),Object.defineProperty(t,"LeaveReason",{enumerable:!0,get:function(){return n.DisconnectReason}});const i=r(5951);Object.defineProperty(t,"TrackKind",{enumerable:!0,get:function(){return i.TrackKind}});const o=r(7514);Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return o.LogLevel}}),Object.defineProperty(t,"LogTarget",{enumerable:!0,get:function(){return o.LogTarget}});const s=r(5280);Object.defineProperty(t,"SRTC",{enumerable:!0,get:function(){return s.SRTC}});const a=r(3272);Object.defineProperty(t,"ChannelEventType",{enumerable:!0,get:function(){return a.ChannelEventType}});const l=r(8728);Object.defineProperty(t,"LocalAudioTrack",{enumerable:!0,get:function(){return l.LocalAudioTrack}}),Object.defineProperty(t,"LocalCameraTrack",{enumerable:!0,get:function(){return l.LocalCameraTrack}}),Object.defineProperty(t,"LocalMicTrack",{enumerable:!0,get:function(){return l.LocalMicTrack}}),Object.defineProperty(t,"LocalScreenTrack",{enumerable:!0,get:function(){return l.LocalScreenTrack}}),Object.defineProperty(t,"LocalVideoTrack",{enumerable:!0,get:function(){return l.LocalVideoTrack}});const u=r(8261);Object.defineProperty(t,"CameraPresets",{enumerable:!0,get:function(){return u.CameraPresets}}),Object.defineProperty(t,"MicPresets",{enumerable:!0,get:function(){return u.MicPresets}}),Object.defineProperty(t,"ScreenPresets",{enumerable:!0,get:function(){return u.ScreenPresets}});const c=r(6881);Object.defineProperty(t,"RemoteAudioMixTrack",{enumerable:!0,get:function(){return c.RemoteAudioMixTrack}}),Object.defineProperty(t,"RemoteAudioTrack",{enumerable:!0,get:function(){return c.RemoteAudioTrack}}),Object.defineProperty(t,"RemoteVideoTrack",{enumerable:!0,get:function(){return c.RemoteVideoTrack}})},8632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RtcApi=void 0;const n=r(5460),i=r(7130);class o extends n.BaseRtcApi{http(e,t,r){return new Promise(((n,o)=>{fetch(this.serverPrefix+e,{method:"POST",headers:r,body:JSON.stringify(t)}).then((e=>{200!=e.status?o(new i.SdkError(e.statusText,e.status)):e.json().then((e=>{n(e)})).catch((e=>{o(new i.SdkError(e.toString()))}))})).catch((e=>{o(new i.SdkError(e.toString()))}))}))}}t.RtcApi=o},5379:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Channel=void 0;const i=r(4623),o=r(8912),s=r(5951),a=r(6881),l=r(1105);class u extends i.BaseChannel{newUser(e){return new l.User(e)}getPublishExOption(e,t){return n(this,void 0,void 0,(function*(){let t={};if(this.rtcStreamEngine.vendor()===o.StreamEngineVendor.OOK){let r=-1;e.kind==s.TrackKind.Video&&(r=this.rtcStreamEngine.getAvailableVideoTrackNo()),t={track:r},e.updateInfo({track:r})}return t}))}getSubscribeExOption(e){return n(this,void 0,void 0,(function*(){let t={};if(this.rtcStreamEngine.vendor()===o.StreamEngineVendor.OOK)if(e instanceof a.RemoteAudioMixTrack){let r=this.getMe(),n=[];e.getFilterUids().forEach((e=>{if(e&&e!=r.uid)try{let t=this.getUser(e);n.push(t.link_id)}catch(e){}})),t={filter_link_ids:n}}else{let r=this.getUser(e.getUid()),n=e.getInfo();t={link_id:r.link_id,track:n.track}}return t}))}newRemoteAudioMixTrack(e){return new a.RemoteAudioMixTrack({id:s.TRACK_AMIXER_ID,desc:"频道混音流",kind:s.TrackKind.Audio},e)}}t.Channel=u},6921:function(e,t,r){"use strict";var n,i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultDeviceId=void 0;const s=o(r(7007)),a=r(3405),l=r(7514);t.DefaultDeviceId="default";class u extends s.default{static getInstance(){var e;if(void 0===n.instance){n.instance=new n;"undefined"==typeof window||window.isSecureContext||void 0!==(null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||l.logger.warn("当前非安全环境(https或localhost或127.0.0.1),将无法获取麦克风、摄像头等媒体设备进行枚举、音视频采集、推流"),null===(e=null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||void 0===e||e.addEventListener("devicechange",(()=>{n.debouncedDeviceChangeHandler()}))}return n.instance}addWaitMediaDevice(e){return i(this,void 0,void 0,(function*(){let t=n.waitingMediaDevicePromises;t.push(e);let r=yield e;return t.splice(t.indexOf(e),1),r}))}enum(){return i(this,void 0,void 0,(function*(){let e=navigator.mediaDevices.enumerateDevices();return this.addWaitMediaDevice(e)}))}getUserMedia(e){return i(this,void 0,void 0,(function*(){let t=navigator.mediaDevices.getUserMedia(e);return this.addWaitMediaDevice(t)}))}waitMediaDevices(){return i(this,void 0,void 0,(function*(){return Promise.allSettled(n.waitingMediaDevicePromises)}))}getDevices(e){return i(this,arguments,void 0,(function*(e,t=!0){let r=yield this.enum();if(t){if(0===r.length||r.some((t=>{const r=""===t.label,n=!e||t.kind===e;return r&&n}))){const t={video:"audioinput"!==e&&"audiooutput"!==e,audio:"videoinput"!==e},n=yield this.getUserMedia(t);r=yield this.enum(),n.getTracks().forEach((e=>{e.stop()}))}}return e?r=r.filter((t=>t.kind===e)):t&&(n.devices=r),r}))}normalizeDeviceId(e,r,n){return i(this,void 0,void 0,(function*(){if(r!==t.DefaultDeviceId)return r;const i=yield this.getDevices(e),o=new Map(i.map((e=>[e.groupId,0])));i.forEach((e=>{var t;return o.set(e.groupId,(null!==(t=o.get(e.groupId))&&void 0!==t?t:0)+1)}));const s=i.find((e=>{var r;return(n===e.groupId||(null!==(r=o.get(e.groupId))&&void 0!==r?r:0)>1)&&e.deviceId!==t.DefaultDeviceId}));return null==s?void 0:s.deviceId}))}}n=u,u.devices=[],u.debouncedDeviceChangeHandler=(0,a.debounce)((()=>i(void 0,void 0,void 0,(function*(){let e=n.devices,t=yield n.instance.getDevices();const r=t.filter((t=>!e.some((e=>e.deviceId===t.deviceId)))),i=e.filter((e=>!t.some((t=>e.deviceId===t.deviceId))));r.forEach((e=>{l.logger.info("新设备插入:",e),n.instance.emit("add",e)})),i.forEach((e=>{l.logger.info("设备被拔出:",e),n.instance.emit("remove",e)}))}))),100,{isImmediate:!0}),u.waitingMediaDevicePromises=[],t.default=u},3272:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TrackEventType=t.ChannelEventType=void 0;const n=r(3404);class i extends n.CommonChannelEventType{}t.ChannelEventType=i,i.DEVICE_ADD="device_add",i.DEVICE_REMOVE="device_remove",i.TRACK_AUTOPLAY_FAIL="track_autoplay_fail";class o extends n.CommonTrackEventType{}t.TrackEventType=o,o.AUTOPLAY_FAIL="autoplay_fail",o.MSTRACK_REPLACED="mstrack_replaced"},5280:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SRTC=void 0;const o=r(7620),s=r(3404),a=r(5951),l=r(6757),u=r(3143),c=r(7130),h=r(86),f=r(7514),d=r(8632),p=r(5379),g=i(r(6921)),y=r(3272),b=r(8728),v=r(8261),m=r(1883),w=r(6580);class _ extends o.BaseSRTC{buildInfo(){let{version:e}=r(6351);return{version:e,timestamp:1721392220}}getStoredDeviceId(){let e=localStorage.getItem("device_id");return e||(e=(0,h.genDeviceId)(),localStorage.setItem("device_id",e)),e}getDeviceType(){return l.DeviceType.WebRTC}newRtcApi(e){return new d.RtcApi(e.app_id,e.sid,e.client_key,e.client_api)}newRtcSocket(e){return new m.RtcSocket(e)}newChannel(e,t,r,n){return new p.Channel(e,t,r,n,this.onNotifyChannelEvent)}newStreamEngine(e){return new w.OokWebrtc(e)}constructor(e){super(e),this.muteCallback=e=>{if(this.onNotifyChannelEvent){let t=new s.ChannelEvent(y.ChannelEventType.TRACK_MUTED,e);this.onNotifyChannelEvent(t)}},this.unmuteCallback=e=>{if(this.onNotifyChannelEvent){let t=new s.ChannelEvent(y.ChannelEventType.TRACK_UNMUTED,e);this.onNotifyChannelEvent(t)}},this.endCallback=e=>{if(this.onNotifyChannelEvent){let t=new s.ChannelEvent(y.ChannelEventType.TRACK_ENDED,e);this.onNotifyChannelEvent(t)}},this.autoPlayFailCallback=e=>{if(this.onNotifyChannelEvent){let t=new s.ChannelEvent(y.ChannelEventType.TRACK_AUTOPLAY_FAIL,e);this.onNotifyChannelEvent(t)}},this.localTracks=new Map,g.default.getInstance().on("add",(e=>{if(this.onNotifyChannelEvent){let t=new s.ChannelEvent(y.ChannelEventType.DEVICE_ADD,e);this.onNotifyChannelEvent(t)}})),g.default.getInstance().on("remove",(e=>{if(this.onNotifyChannelEvent){let t=new s.ChannelEvent(y.ChannelEventType.DEVICE_REMOVE,e);this.onNotifyChannelEvent(t)}})),document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState?this.onAppShow():this.onAppHide()}))}leave(){const e=Object.create(null,{leave:{get:()=>super.leave}});return n(this,void 0,void 0,(function*(){if(yield e.leave.call(this),this.channel)for(let e of this.localTracks.keys())if(e instanceof b.LocalMicTrack||e instanceof b.LocalCameraTrack||e instanceof b.LocalScreenTrack)try{e.stopCapture(),f.logger.info("离开频道",e.toString(),"自动停止采集")}catch(e){}}))}getDevices(e){return n(this,arguments,void 0,(function*(e,t=!0){return g.default.getInstance().getDevices(e,t)}))}getEnvInfo(){return(0,u.getEnvInfo)()}addTrackListeners(e){e.listeners(s.CommonTrackEventType.MUTED).includes(this.muteCallback)||e.on(s.CommonTrackEventType.MUTED,this.muteCallback),e.listeners(s.CommonTrackEventType.UNMUTED).includes(this.unmuteCallback)||e.on(s.CommonTrackEventType.UNMUTED,this.unmuteCallback),e.listeners(s.CommonTrackEventType.ENDED).includes(this.endCallback)||e.on(s.CommonTrackEventType.ENDED,this.endCallback),e.listeners(y.TrackEventType.AUTOPLAY_FAIL).includes(this.endCallback)||e.on(y.TrackEventType.AUTOPLAY_FAIL,this.autoPlayFailCallback)}createLocalMicTrack(e=v.MicPresets.music){let t=new b.LocalMicTrack(e.capture);return this.localTracks.set(t,Object.assign({},e.publish)),this.addTrackListeners(t),t}createLocalCustomAudioTrack(e){if(e.kind!=a.TrackKind.Audio)throw new c.SdkError("MediaStreamTrack必须是音频轨");let t=new b.LocalAudioTrack;return t.setMediaStreamTrack(e),this.localTracks.set(t,void 0),this.addTrackListeners(t),t}createLocalCameraTrack(e=v.CameraPresets["720p"]){let t=new b.LocalCameraTrack(e.capture);return this.localTracks.set(t,Object.assign({},e.publish)),this.addTrackListeners(t),t}createLocalScreenTrack(e=v.ScreenPresets["1080p"]){let t=new b.LocalScreenTrack(e.capture);return this.localTracks.set(t,Object.assign({},e.publish)),this.addTrackListeners(t),t}createLocalCustomVideoTrack(e){if(e.kind!=a.TrackKind.Video)throw new c.SdkError("MediaStreamTrack必须是视频轨");let t=new b.LocalVideoTrack;return t.setMediaStreamTrack(e),this.localTracks.set(t,void 0),this.addTrackListeners(t),t}publishLocalTrack(e,t){return n(this,void 0,void 0,(function*(){if(!this.channel)throw new c.SdkError("您不在频道内");let r=this.localTracks.get(e);r&&((0,h.propAssign)(r,t),t=r),yield this.channel.publishLocalTrack(e,t)}))}unpublishLocalTrack(e){return n(this,void 0,void 0,(function*(){if(!this.channel)throw new c.SdkError("您不在频道内");yield this.channel.unpublishLocalTrack(e)}))}subscribeRemoteAudioMixTrack(e){const t=Object.create(null,{subscribeRemoteAudioMixTrack:{get:()=>super.subscribeRemoteAudioMixTrack}});return n(this,void 0,void 0,(function*(){let r=yield t.subscribeRemoteAudioMixTrack.call(this,e);return this.addTrackListeners(r),r}))}subscribeRemoteAudioTrack(e,t){const r=Object.create(null,{subscribeRemoteAudioTrack:{get:()=>super.subscribeRemoteAudioTrack}});return n(this,void 0,void 0,(function*(){let n=yield r.subscribeRemoteAudioTrack.call(this,e,t);return this.addTrackListeners(n),n}))}subscribeRemoteVideoTrack(e,t){const r=Object.create(null,{subscribeRemoteVideoTrack:{get:()=>super.subscribeRemoteVideoTrack}});return n(this,void 0,void 0,(function*(){let n=yield r.subscribeRemoteVideoTrack.call(this,e,t);return this.addTrackListeners(n),n}))}unsubscribeRemoteTrack(e){const t=Object.create(null,{unsubscribeRemoteTrack:{get:()=>super.unsubscribeRemoteTrack}});return n(this,void 0,void 0,(function*(){yield t.unsubscribeRemoteTrack.call(this,e)}))}}t.SRTC=_},8728:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.LocalScreenTrack=t.LocalCameraTrack=t.LocalVideoTrack=t.LocalMicTrack=t.LocalAudioTrack=void 0;const a=r(5951),l=r(7130),u=r(86),c=r(7514),h=o(r(6921)),f=r(3272),d=r(8261),p=r(4971);class g extends p.BaseWebrtcTrack{constructor(){super({id:(0,u.genNonce)(20),kind:a.TrackKind.Audio,codec:d.DEFAULT_AUDIO_CODEC,track:-1},""),this.playTrait=new p.AudioPlayTrait(this)}getVolume(){return 0}strPrefix(){return"本地音频流轨道"}startPlay(e){return s(this,void 0,void 0,(function*(){(yield this.playTrait.startPlay(e))||(e&&e.disableAutoPlayDialog?this.emit(f.TrackEventType.AUTOPLAY_FAIL,this):p.AutoPlayDialog.show(this.id,this.desc,(()=>{this.startPlay(e)})))}))}stopPlay(){this.playTrait.stopPlay()}}t.LocalAudioTrack=g;t.LocalMicTrack=class extends g{constructor(e){super(),this.captureOptions=Object.assign({},e)}strPrefix(){return"本地麦克风流轨道"}onEnded(){super.onEnded(),c.logger.warn(this.toString(),"自动尝试默认麦克风"),this.changeDeviceId(h.DefaultDeviceId).catch((e=>{c.logger.error(this.toString(),"自动尝试默认麦克风失败",e)}))}startCapture(e){return s(this,void 0,void 0,(function*(){e&&(0,u.propAssign)(this.captureOptions,e);let t=yield h.default.getInstance().getUserMedia({audio:this.captureOptions,video:!1});this.setMediaStreamTrack(t.getTracks()[0])}))}stopCapture(){return s(this,void 0,void 0,(function*(){let e=this.getMediaStreamTrack();e?e.stop():c.logger.warn(this.toString()+"的mediaStreamTrack不存在,无需停止采集")}))}changeDeviceId(e){return s(this,void 0,void 0,(function*(){if(this.captureOptions.deviceId===e&&e!=h.DefaultDeviceId)return;return this.captureOptions.deviceId=e,this.getMediaStreamTrack()?(this.stopCapture(),this.startCapture()):void 0}))}};class y extends p.BaseWebrtcTrack{constructor(){super({id:(0,u.genNonce)(20),kind:a.TrackKind.Video,codec:d.DEFAULT_VIDEO_CODEC,track:-1},""),this.playTrait=new p.VideoPlayTrait(this)}strPrefix(){return"本地视频流轨道"}addSimulcastTrack(e){this.getInfo();return new y}addPlayView(e){this.playTrait.addPlayView(e)}removePlayView(e){this.playTrait.removePlayView(e)}removeAllPlayViews(){this.playTrait.removeAllPlayViews()}}t.LocalVideoTrack=y;t.LocalCameraTrack=class extends y{constructor(e){super(),this.captureOptions=Object.assign({},e)}strPrefix(){return"本地摄像头视频流轨道"}onEnded(){super.onEnded(),c.logger.warn(this.toString(),"自动尝试默认摄像头"),this.changeDeviceId(h.DefaultDeviceId).catch((e=>{c.logger.error(this.toString(),"自动尝试默认摄像头失败",e)}))}startCapture(e){return s(this,void 0,void 0,(function*(){e&&(0,u.propAssign)(this.captureOptions,e);let t=yield h.default.getInstance().getUserMedia({audio:!1,video:this.captureOptions});this.setMediaStreamTrack(t.getTracks()[0])}))}stopCapture(){let e=this.getMediaStreamTrack();e?e.stop():c.logger.warn(this.toString()+"的mediaStreamTrack不存在,无需停止采集")}changeDeviceId(e){return s(this,void 0,void 0,(function*(){if(this.captureOptions.deviceId===e&&e!=h.DefaultDeviceId)return;return this.captureOptions.deviceId=e,this.getMediaStreamTrack()?(this.stopCapture(),this.startCapture()):void 0}))}switchFacingMode(){return s(this,void 0,void 0,(function*(){this.captureOptions.facingMode="environment"==this.captureOptions.facingMode?"user":"environment";let e=this.getMediaStreamTrack();if(e)return e.applyConstraints(this.captureOptions)}))}};t.LocalScreenTrack=class extends y{constructor(e){super(),this.captureOptions=Object.assign({},e)}strPrefix(){return"本地屏幕分享视频流轨道"}startCapture(e){return s(this,void 0,void 0,(function*(){if(e&&(0,u.propAssign)(this.captureOptions,e),void 0===navigator.mediaDevices.getDisplayMedia)throw new l.SdkError("getDisplayMedia not supported");let t=yield navigator.mediaDevices.getDisplayMedia({audio:!1,video:this.captureOptions});this.setMediaStreamTrack(t.getTracks()[0])}))}stopCapture(){let e=this.getMediaStreamTrack();e?e.stop():c.logger.warn(this.toString()+"的mediaStreamTrack不存在,无需停止采集")}}},8261:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenPresets=t.CameraPresets=t.MicPresets=t.DEFAULT_VIDEO_CODEC=t.DEFAULT_AUDIO_CODEC=void 0;const n=r(5951);t.DEFAULT_AUDIO_CODEC=n.Codec.OPUS,t.DEFAULT_VIDEO_CODEC=n.Codec.H264,t.MicPresets={speech:{capture:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,channelCount:1,sampleRate:48e3},publish:{maxBitrate:24e3,priority:"high"}},music:{capture:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,channelCount:1,sampleRate:48e3},publish:{maxBitrate:32e3,priority:"high"}},musicStereo:{capture:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,channelCount:2,sampleRate:48e3},publish:{maxBitrate:48e3,priority:"high"}},musicHighQuality:{capture:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,channelCount:1,sampleRate:48e3},publish:{maxBitrate:64e3,priority:"high"}},musicHighQualityStereo:{capture:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,channelCount:2,sampleRate:48e3},publish:{maxBitrate:96e3,priority:"high"}}},t.CameraPresets={"1080p":{capture:{width:1920,height:1080,frameRate:15},publish:{maxBitrate:25e5}},"720p":{capture:{width:1280,height:720,frameRate:15},publish:{maxBitrate:12e5}},"360p":{capture:{width:640,height:360,frameRate:15},publish:{maxBitrate:55e4}},"180p":{capture:{width:320,height:180,frameRate:15},publish:{maxBitrate:25e4}}},t.ScreenPresets={"1080p":{capture:{width:1920,height:1080,frameRate:10},publish:{maxBitrate:2e6}},"720p":{capture:{width:1280,height:720,frameRate:10},publish:{maxBitrate:15e5}}}},6881:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteVideoTrack=t.RemoteAudioMixTrack=t.RemoteAudioTrack=void 0;const i=r(3272),o=r(4971);class s extends o.BaseWebrtcTrack{constructor(e,t){super(e,t),this.playTrait=new o.AudioPlayTrait(this)}strPrefix(){return"远端音频流轨道"}startPlay(e){return n(this,void 0,void 0,(function*(){(yield this.playTrait.startPlay(e))||(e&&e.disableAutoPlayDialog?this.emit(i.TrackEventType.AUTOPLAY_FAIL,this):o.AutoPlayDialog.show(this.id,this.desc,(()=>{this.startPlay(e)})))}))}stopPlay(){this.playTrait.stopPlay()}}t.RemoteAudioTrack=s;t.RemoteAudioMixTrack=class extends s{constructor(e,t){super(e,""),this.filterUids=t||[]}getFilterUids(){return this.filterUids}strPrefix(){return"远端频道混音流轨道"}};class a extends o.BaseWebrtcTrack{constructor(e,t){super(e,t),this.playTrait=new o.VideoPlayTrait(this)}strPrefix(){return"远端视频流轨道"}addPlayView(e){this.playTrait.addPlayView(e)}removePlayView(e){this.playTrait.removePlayView(e)}removeAllPlayViews(){this.playTrait.removeAllPlayViews()}}t.RemoteVideoTrack=a},1883:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RtcSocket=void 0;const n=r(2871);class i extends n.BaseRtcSocket{}t.RtcSocket=i},4730:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.StreamEngine=void 0;const i=r(3404),o=r(8912),s=r(5951),a=r(1758),l=r(7130),u=r(7514),c=r(3272);class h extends o.BaseStreamEngine{constructor(){super(...arguments),this.onMsTrackReplace=e=>{var t,r;if(!this.published[e.id])return;null===(t=this.published[e.id].sender)||void 0===t||t.replaceTrack(null!==(r=e.getMediaStreamTrack())&&void 0!==r?r:null)}}publish(e,t,r){const i=Object.create(null,{publish:{get:()=>super.publish}});return n(this,void 0,void 0,(function*(){if(this.published[e.id])return void u.logger.warn("推流",e.toString(),"进行中,当前状态",this.published[e.id].pc.connectionState);yield i.publish.call(this,e,t,r);let h=e.getMediaStreamTrack();if(!h)throw new l.SdkError(e.toString()+"的mediaStreamTrack不存在,无法发布");if(e.kind==s.TrackKind.Audio&&!a.Ability.checkAudioCodec("OPUS"))throw new l.SdkError("当前环境不支持OPUS音频编解码,"+e.toString()+"无法发布");if(e.kind==s.TrackKind.Video&&!a.Ability.checkVideoCodec("H264"))throw new l.SdkError("当前环境不支持H264视频编解码,"+e.toString()+"无法发布");if(!("addTransceiver"in RTCPeerConnection.prototype)&&!("addTrack"in RTCPeerConnection.prototype))throw new l.SdkError("当前环境不支持addTransceiver或addTrack,无法发布");let f=new RTCPeerConnection,d={kind:e.kind,pc:f,track:e,exopt:r||{}};this.published[e.id]=d;let p={maxBitrate:t.maxBitrate,priority:t.priority};if(e.kind==s.TrackKind.Video&&(p.maxFramerate=t.maxFramerate),"addTransceiver"in RTCPeerConnection.prototype&&this.vendor()!=o.StreamEngineVendor.OOK){let e=f.addTransceiver(h,{direction:"sendonly",sendEncodings:[p]});d.sender=e.sender}else{let e=f.addTrack(h),t=e.getParameters();t.encodings=[p],e.setParameters(t),d.sender=e}return new Promise(((t,r)=>n(this,void 0,void 0,(function*(){let n=setTimeout((()=>{this.unpublish(e),r("发布超时")}),6e4);f.addEventListener("negotiationneeded",(()=>{u.logger.info("推流",e.toString(),"重新协商"),this.negotiateSDP(d,"publish")})),f.addEventListener("icecandidate",(t=>{u.logger.debug("推流",e.toString(),"icecandidate",t.candidate)})),f.addEventListener("iceconnectionstatechange",(t=>{u.logger.debug("推流",e.toString(),"ICE connection state change",f.iceConnectionState)})),f.addEventListener("connectionstatechange",(r=>{switch(u.logger.debug("推流",e.toString(),"connection state",f.connectionState),f.connectionState){case"failed":case"closed":f.restartIce(),u.logger.error("推流",e.toString(),"已断开,将自动尝试重连");break;case"connected":u.logger.info("推流",e.toString(),"connected",f.getTransceivers()),clearTimeout(n),e.on(c.TrackEventType.MSTRACK_REPLACED,this.onMsTrackReplace),t()}}))}))))}))}unpublish(e){return n(this,void 0,void 0,(function*(){if(!this.published[e.id])return void u.logger.warn("推流",e.toString(),"已取消,无需取消发布");e.off(c.TrackEventType.MSTRACK_REPLACED,this.onMsTrackReplace);this.published[e.id].pc.close(),delete this.published[e.id]}))}subscribe(e,t){const r=Object.create(null,{subscribe:{get:()=>super.subscribe}});return n(this,void 0,void 0,(function*(){if(this.subscribed[e.id])return void u.logger.warn("拉流",e.toString(),"进行中,当前状态",this.subscribed[e.id].pc.connectionState);yield r.subscribe.call(this,e,t);let o=new RTCPeerConnection,s={kind:e.kind,pc:o,track:e,exopt:t||{}};return this.subscribed[e.id]=s,new Promise(((t,r)=>n(this,void 0,void 0,(function*(){let n=setTimeout((()=>{this.unsubscribe(e),r("订阅超时")}),6e4);this.negotiateSDP(s,"subscribe"),o.addEventListener("negotiationneeded",(()=>{u.logger.info("拉流",e.toString(),"重新协商"),this.negotiateSDP(s,"subscribe")})),o.addEventListener("icecandidate",(t=>{u.logger.debug("拉流",e.toString(),"icecandidate",t.candidate)})),o.addEventListener("iceconnectionstatechange",(t=>{u.logger.debug("拉流",e.toString(),"ICE connection state change",o.iceConnectionState)})),o.addEventListener("track",(t=>{e.setMediaStreamTrack(t.track),t.streams[0].onremovetrack=t=>{u.logger.info("拉流",e.toString(),"mstrack removed",t.track),e.emit(i.CommonTrackEventType.ENDED,e)},u.logger.info("拉流",e.toString(),"mstrack got",t.track,t.streams)})),o.addEventListener("connectionstatechange",(r=>{switch(u.logger.debug("拉流",e.toString(),"connection state",o.connectionState),o.connectionState){case"failed":case"closed":o.restartIce(),u.logger.error("拉流",e.toString(),"已断开,将自动尝试重连");break;case"connected":u.logger.info("拉流",e.toString(),"connected",o.getTransceivers()),clearTimeout(n),t()}}))}))))}))}unsubscribe(e){return n(this,void 0,void 0,(function*(){if(!this.subscribed[e.id])return void u.logger.warn("拉流",e.toString(),"未订阅或已取消,无需取消订阅");this.subscribed[e.id].pc.close(),delete this.subscribed[e.id]}))}}t.StreamEngine=h},6580:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OokWebrtc=void 0;const i=r(8912),o=r(5951),s=r(7130),a=r(86),l=r(7514),u=r(6881),c=r(4730);class h extends c.StreamEngine{constructor(){super(...arguments),this.ability={audioCodecs:[o.Codec.OPUS,o.Codec.AAC],videoCodecs:[o.Codec.H264,o.Codec.H265],audioMaxPub:1,videoMaxPub:7,audioMaxSub:9,videoMaxSub:32}}vendor(){return i.StreamEngineVendor.OOK}connect(){return n(this,void 0,void 0,(function*(){yield this.create()}))}disconnect(){const e=Object.create(null,{disconnect:{get:()=>super.disconnect}});return n(this,void 0,void 0,(function*(){yield e.disconnect.call(this),yield this.free()}))}unpublish(e){const t=Object.create(null,{unpublish:{get:()=>super.unpublish}});return n(this,void 0,void 0,(function*(){try{if(this.published[e.id]){let t=this.published[e.id];yield this.freshAVState(t.exopt.session),yield this.hangup(t.exopt.session)}}catch(e){l.logger.error("ook取消发布接口报错",e)}yield t.unpublish.call(this,e)}))}unsubscribe(e){const t=Object.create(null,{unsubscribe:{get:()=>super.unsubscribe}});return n(this,void 0,void 0,(function*(){try{if(this.subscribed[e.id]){let t=this.subscribed[e.id];yield this.hangup(t.exopt.session)}}catch(e){l.logger.error("ook取消订阅接口报错",e)}yield t.unsubscribe.call(this,e)}))}negotiateSDP(e,t){return n(this,void 0,void 0,(function*(){if(e.exopt.session)try{yield this.hangup(e.exopt.session)}catch(e){l.logger.error("ook取消挂断接口报错",e)}let r=this.genSessionId();e.exopt.session=r;let n=e.pc,i="";if("publish"==t&&e.kind==o.TrackKind.Audio)i=yield this.offerWithRetry((()=>this.offerPushAudio(r)));else if("publish"==t&&e.kind==o.TrackKind.Video)i=yield this.offerWithRetry((()=>this.offerPushVideo(r,e.exopt.track)));else if("subscribe"==t&&e.kind==o.TrackKind.Audio)i=e.track instanceof u.RemoteAudioMixTrack?yield this.offerWithRetry((()=>this.offerPullAmixer(r,e.exopt.filter_link_ids.join(",")))):yield this.offerWithRetry((()=>this.offerPullAudio(r,e.exopt.link_id)));else{if("subscribe"!=t||e.kind!=o.TrackKind.Video)throw new s.SdkError("未知SDP操作:"+t+":"+e.track.toString());i=yield this.offerWithRetry((()=>this.offerPullVideo(r,e.exopt.link_id,e.exopt.track)))}yield n.setRemoteDescription({sdp:i,type:"offer"});let a=yield n.createAnswer();yield n.setLocalDescription(a),yield this.answer(r,a.sdp),yield this.freshAVState(r)}))}freshAVState(e){return n(this,void 0,void 0,(function*(){let t=!1,r=!1;for(const e in this.published){const n=this.published[e];n.kind==o.TrackKind.Audio?t=!0:n.kind==o.TrackKind.Video&&(r=!0)}yield this.setAVState(e,t,r)}))}getAvailableVideoTrackNo(){let e=-1,t=[];for(const e in this.published){const r=this.published[e];r.kind==o.TrackKind.Video&&t.push(r.track.getInfo().track)}for(let r=0;r<this.ability.videoMaxPub;r++)if(-1==t.indexOf(r)){e=r;break}return e}create(){return this.req("create/"+this.joinRsp.link_id,{serv:this.joinRsp.upload.address+":"+this.joinRsp.upload.port,conf:this.joinRsp.channel_link_id,token:this.joinRsp.session_key,amixer:1})}free(){return this.req("free/"+this.joinRsp.link_id)}offerWithRetry(e){return n(this,void 0,void 0,(function*(){try{return yield e()}catch(t){return yield this.create(),e()}}))}offerPushVideo(e,t){return n(this,void 0,void 0,(function*(){return(yield this.req("offer/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e,track:t+""}),{mode:"recvonly",type:"video"})).sdp}))}offerPushAudio(e){return n(this,void 0,void 0,(function*(){return(yield this.req("offer/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e}),{mode:"recvonly",type:"audio"})).sdp}))}offerPullVideo(e,t,r){return n(this,void 0,void 0,(function*(){return(yield this.req("offer/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e,peer:t+"",track:r+""}),{mode:"sendonly",type:"video"})).sdp}))}switchPullVideoTrack(e,t){return this.req("setting/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e}),{type:"track",setting:{track:t}})}offerPullAudio(e,t){return n(this,void 0,void 0,(function*(){return(yield this.req("offer/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e,peer:t+""}),{mode:"sendonly",type:"audio"})).sdp}))}offerPullAmixer(e){return n(this,arguments,void 0,(function*(e,t=""){return(yield this.req("offer/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e,peer:"amixer",filter:t}),{mode:"sendonly",type:"audio"})).sdp}))}answer(e,t){return this.req("answer/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e}),{totalBody:t})}setAVState(e,t,r){return this.req("setting/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e}),{totalBody:JSON.stringify({type:"media",setting:{audio:t?1:0,video:r?1:0}})})}hangup(e){return this.req("hangup/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e}))}req(e,t={},r={}){let n=this.joinRsp.webrtc.cmd_url;"/"!==n.substring(n.length-1)&&(n+="/");let i=t.totalBody;return i||(i=Object.keys(t).filter((e=>void 0!==t[e]&&null!==t[e])).map((e=>`${e}=${t[e]}`)).join("\r\n")),new Promise(((o,a)=>{fetch(n+e,{method:"POST",headers:Object.assign(Object.assign({},r),{Accept:"application/json"}),body:i}).then((r=>{l.logger.debug("webrtc gateway api: "+e,t,r),200!=r.status?a(new s.SdkError(r.statusText,r.status)):r.json().then((e=>{0==e.code?o(e):a(new s.SdkError(e.msg,e.code))})).catch((e=>{a(new s.SdkError(e.toString()))}))})).catch((r=>{l.logger.error("webrtc gateway api: "+e,t,r),a(new s.SdkError(r.toString()))}))}))}genSessionId(){return`${`${this.joinRsp.app_id}`}-${(0,a.genNonce)(6)}`}}t.OokWebrtc=h},4971:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AutoPlayDialog=t.VideoPlayTrait=t.AudioPlayTrait=t.BaseWebrtcTrack=void 0;const i=r(3404),o=r(5951),s=r(7130),a=r(7514),l=r(3272);class u extends o.BaseTrack{constructor(e,t){super(e,t),this.onMute=this.onMute.bind(this),this.onUnmute=this.onUnmute.bind(this),this.onEnded=this.onEnded.bind(this)}addMsTrackListeners(e){e.addEventListener("mute",this.onMute),e.addEventListener("unmute",this.onUnmute),e.addEventListener("ended",this.onEnded)}removeMsTrackListeners(e){e.removeEventListener("mute",this.onMute),e.removeEventListener("unmute",this.onUnmute),e.removeEventListener("ended",this.onEnded)}onMute(){a.logger.info(this.toString(),"muted"),this.emit(i.CommonTrackEventType.MUTED,this)}onUnmute(){a.logger.info(this.toString(),"unmuted"),this.emit(i.CommonTrackEventType.UNMUTED,this)}onEnded(){a.logger.info(this.toString(),"ended"),this.emit(i.CommonTrackEventType.ENDED,this)}setMediaStreamTrack(e){this.mediaStreamTrack!=e&&(this.mediaStreamTrack&&this.removeMsTrackListeners(this.mediaStreamTrack),this.mediaStreamTrack=e,e&&this.addMsTrackListeners(e),this.emit(l.TrackEventType.MSTRACK_REPLACED,this))}getMediaStreamTrack(){return this.mediaStreamTrack}}t.BaseWebrtcTrack=u;t.AudioPlayTrait=class{constructor(e){this.track=e,this.audioElements=[],this.track.on(l.TrackEventType.MSTRACK_REPLACED,(()=>{let e=this.track.getMediaStreamTrack(),t=e?new MediaStream([e]):null;this.audioElements.forEach((e=>{e.srcObject=t}))}))}startPlay(e){return n(this,void 0,void 0,(function*(){this.stopPlay();let t=this.track.getMediaStreamTrack();if(!t)throw new s.SdkError(this.track.toString()+"的mediaStreamTrack不存在,无法播放声音");let r=document.createElement("audio");return r.autoplay=!1,r.srcObject=new MediaStream([t]),r.style.display="none",document.body.appendChild(r),(null==e?void 0:e.deviceId)&&("setSinkId"in r?yield r.setSinkId(e.deviceId):a.logger.error("当前环境不支持setSinkId,将从默认扬声器播放")),new Promise(((e,t)=>n(this,void 0,void 0,(function*(){let n=setTimeout((()=>{a.logger.warn("音频play超时未响应,默认视为浏览器权限问题处理"),r.remove(),e(!1)}),1e3);try{yield r.play(),clearTimeout(n),this.audioElements.push(r),e(!0)}catch(i){clearTimeout(n),r.remove(),i instanceof DOMException&&"NotAllowedError"===i.name?e(!1):t(new s.SdkError(this.track.toString()+"自动播放失败:"+i))}}))))}))}stopPlay(){this.audioElements.forEach((e=>e.remove())),this.audioElements=[]}};t.VideoPlayTrait=class{constructor(e){this.track=e,this.videoElements=[],this.track.on(l.TrackEventType.MSTRACK_REPLACED,(()=>{let e=this.track.getMediaStreamTrack(),t=e?new MediaStream([e]):null;this.videoElements.forEach((e=>{e.srcObject=t}))}))}addPlayView(e){let t=this.track.getMediaStreamTrack();if(!t)throw new s.SdkError(this.track.toString()+"的mediaStreamTrack不存在,无法添加播放view");let r=document.createElement("video");r.autoplay=!0,r.muted=!0,r.controls=!1,r.playsInline=!0,r.style.width="100%",r.style.height="100%",r.style.objectFit="contain",r.onloadedmetadata=()=>{let e=this.track.getInfo().angle,t=1*r.videoHeight/r.videoWidth;switch(e){case 1129136434:r.style.transform=`rotate(270deg) scale(${t},${t})`;break;case 1129136433:r.style.transform="rotate(-180deg)";break;case 1129136441:r.style.transform=`scale(${t},${t}) rotate(-90deg)`;break;default:r.style.transform=""}},r.srcObject=new MediaStream([t]),e.appendChild(r),this.videoElements.push(r)}removePlayView(e){let t=this.videoElements.findIndex((t=>t.parentElement==e));t>=0&&(this.videoElements[t].remove(),this.videoElements.splice(t,1))}removeAllPlayViews(){this.videoElements.forEach((e=>e.remove())),this.videoElements=[]}};class c{static show(e,t,r){const n=document.createElement("style");n.textContent=this.cssTpl,document.head.appendChild(n);let i="autoplay-"+e,o=document.createElement("div");document.body.append(o),o.outerHTML=this.htmlTpl.replace("$id$",i).replace("$desc$",t),document.getElementById(i).onclick=e=>{n.remove(),e.currentTarget.remove(),r()}}}t.AutoPlayDialog=c,c.htmlTpl='<div id="$id$" class="autoplay-dialog-container">\n <div class="autoplay-dialog">\n <div class="autoplay-dialog-content">\n <p>因浏览器权限问题自动播放$desc$失败,点击恢复自动播放</p>\n </div>\n <div class="autoplay-dialog-actions">\n <button class="autoplay-dialog-button">确定</button>\n </div>\n </div>\n</div>',c.cssTpl=".autoplay-dialog-container {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 9999;\n}\n\n.autoplay-dialog {\n background-color: white;\n padding: 20px;\n border-radius: 5px;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);\n text-align: center;\n}\n\n.autoplay-dialog-content {\n margin-bottom: 20px;\n}\n\n.autoplay-dialog-button {\n background-color: #007bff;\n color: white;\n border: none;\n padding: 10px 20px;\n border-radius: 5px;\n cursor: pointer;\n}"},1105:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.User=void 0;const n=r(5951),i=r(1381),o=r(6881);class s extends i.BaseUser{newTrack(e){switch(e.kind){case n.TrackKind.Video:return new o.RemoteVideoTrack(e,this.uid);case n.TrackKind.Audio:return new o.RemoteAudioTrack(e,this.uid)}}}t.User=s},477:()=>{},6526:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ALWAYS:()=>qe,C1:()=>E,DECIMAL_FIT:()=>Ke,DECIMAL_ROUND:()=>$e,Decoder:()=>ae,Encoder:()=>ze,FLOAT32_OPTIONS:()=>fe,NEVER:()=>He,Packr:()=>xe,REUSE_BUFFER_MODE:()=>Ge,Unpackr:()=>C,addExtension:()=>je,clearSource:()=>oe,decode:()=>he,decodeIter:()=>Xe,encode:()=>Ve,encodeIter:()=>Ze,isNativeAccelerationEnabled:()=>F,mapsAsObjects:()=>tt,pack:()=>We,roundFloat32:()=>ge,unpack:()=>ue,unpackMultiple:()=>ce,useRecords:()=>et});var n,i,o,s=r(8287).hp;try{n=new TextDecoder}catch(e){}var a=0;const l=[];var u,c,h,f,d,p=l,g=0,y={},b=0,v=0,m=[],w={useRecords:!1,mapsAsObjects:!0};class _{}const E=new _;E.name="MessagePack 0xC1";var S,k,A,T=!1,I=2;try{new Function("")}catch(e){I=1/0}class C{constructor(e){e&&(!1===e.useRecords&&void 0===e.mapsAsObjects&&(e.mapsAsObjects=!0),e.sequential&&!1!==e.trusted&&(e.trusted=!0,e.structures||0==e.useRecords||(e.structures=[],e.maxSharedStructures||(e.maxSharedStructures=0))),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType="number")),Object.assign(this,e)}unpack(e,t){if(i)return ie((()=>(oe(),this?this.unpack(e,t):C.prototype.unpack.call(w,e,t))));e.buffer||e.constructor!==ArrayBuffer||(e=void 0!==s?s.from(e):new Uint8Array(e)),"object"==typeof t?(o=t.end||e.length,a=t.start||0):(a=0,o=t>-1?t:e.length),g=0,v=0,c=null,p=l,h=null,i=e;try{d=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(t){if(i=null,e instanceof Uint8Array)throw t;throw new Error("Source must be a Uint8Array or Buffer but was a "+(e&&"object"==typeof e?e.constructor.name:typeof e))}if(this instanceof C){if(y=this,this.structures)return u=this.structures,R(t);(!u||u.length>0)&&(u=[])}else y=w,(!u||u.length>0)&&(u=[]);return R(t)}unpackMultiple(e,t){let r,n=0;try{T=!0;let i=e.length,o=this?this.unpack(e,i):le.unpack(e,i);if(!t){for(r=[o];a<i;)n=a,r.push(R());return r}if(!1===t(o,n,a))return;for(;a<i;)if(n=a,!1===t(R(),n,a))return}catch(e){throw e.lastPosition=n,e.values=r,e}finally{T=!1,oe()}}_mergeStructures(e,t){k&&(e=k.call(this,e)),e=e||[],Object.isFrozen(e)&&(e=e.map((e=>e.slice(0))));for(let t=0,r=e.length;t<r;t++){let r=e[t];r&&(r.isShared=!0,t>=32&&(r.highByte=t-32>>5))}e.sharedLength=e.length;for(let r in t||[])if(r>=0){let n=e[r],i=t[r];i&&(n&&((e.restoreStructures||(e.restoreStructures=[]))[r]=n),e[r]=i)}return this.structures=e}decode(e,t){return this.unpack(e,t)}}function R(e){try{if(!y.trusted&&!T){let e=u.sharedLength||0;e<u.length&&(u.length=e)}let t;if(y.randomAccessStructure&&i[a]<64&&i[a]>=32&&S?(t=S(i,a,o,y),i=null,e&&e.lazy||!t||(t=t.toJSON()),a=o):t=M(),h&&(a=h.postBundlePosition,h=null),T&&(u.restoreStructures=null),a==o)u&&u.restoreStructures&&O(),u=null,i=null,f&&(f=null);else{if(a>o)throw new Error("Unexpected end of MessagePack data");if(!T){let e;try{e=JSON.stringify(t,((e,t)=>"bigint"==typeof t?`${t}n`:t)).slice(0,100)}catch(t){e="(JSON view not available "+t+")"}throw new Error("Data read, but end of buffer not reached "+e)}}return t}catch(e){throw u&&u.restoreStructures&&O(),oe(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer")||a>o)&&(e.incomplete=!0),e}}function O(){for(let e in u.restoreStructures)u[e]=u.restoreStructures[e];u.restoreStructures=null}function M(){let e=i[a++];if(e<160){if(e<128){if(e<64)return e;{let t=u[63&e]||y.getStructures&&L()[63&e];return t?(t.read||(t.read=x(t,63&e)),t.read()):e}}if(e<144){if(e-=128,y.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=J();"__proto__"===e&&(e="__proto_"),t[e]=M()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(M(),M());return t}}{e-=144;let t=new Array(e);for(let r=0;r<e;r++)t[r]=M();return y.freezeData?Object.freeze(t):t}}if(e<192){let t=e-160;if(v>=a)return c.slice(a-b,(a+=t)-b);if(0==v&&o<140){let e=t<16?$(t):q(t);if(null!=e)return e}return U(t)}{let t;switch(e){case 192:return null;case 193:return h?(t=M(),t>0?h[1].slice(h.position1,h.position1+=t):h[0].slice(h.position0,h.position0-=t)):E;case 194:return!1;case 195:return!0;case 196:if(t=i[a++],void 0===t)throw new Error("Unexpected end of buffer");return G(t);case 197:return t=d.getUint16(a),a+=2,G(t);case 198:return t=d.getUint32(a),a+=4,G(t);case 199:return Q(i[a++]);case 200:return t=d.getUint16(a),a+=2,Q(t);case 201:return t=d.getUint32(a),a+=4,Q(t);case 202:if(t=d.getFloat32(a),y.useFloat32>2){let e=se[(127&i[a])<<1|i[a+1]>>7];return a+=4,(e*t+(t>0?.5:-.5)|0)/e}return a+=4,t;case 203:return t=d.getFloat64(a),a+=8,t;case 204:return i[a++];case 205:return t=d.getUint16(a),a+=2,t;case 206:return t=d.getUint32(a),a+=4,t;case 207:return"number"===y.int64AsType?(t=4294967296*d.getUint32(a),t+=d.getUint32(a+4)):"string"===y.int64AsType?t=d.getBigUint64(a).toString():"auto"===y.int64AsType?(t=d.getBigUint64(a),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=d.getBigUint64(a),a+=8,t;case 208:return d.getInt8(a++);case 209:return t=d.getInt16(a),a+=2,t;case 210:return t=d.getInt32(a),a+=4,t;case 211:return"number"===y.int64AsType?(t=4294967296*d.getInt32(a),t+=d.getUint32(a+4)):"string"===y.int64AsType?t=d.getBigInt64(a).toString():"auto"===y.int64AsType?(t=d.getBigInt64(a),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=d.getBigInt64(a),a+=8,t;case 212:if(t=i[a++],114==t)return Z(63&i[a++]);{let e=m[t];if(e)return e.read?(a++,e.read(M())):e.noBuffer?(a++,e()):e(i.subarray(a,++a));throw new Error("Unknown extension "+t)}case 213:return t=i[a],114==t?(a++,Z(63&i[a++],i[a++])):Q(2);case 214:return Q(4);case 215:return Q(8);case 216:return Q(16);case 217:return t=i[a++],v>=a?c.slice(a-b,(a+=t)-b):N(t);case 218:return t=d.getUint16(a),v>=(a+=2)?c.slice(a-b,(a+=t)-b):j(t);case 219:return t=d.getUint32(a),v>=(a+=4)?c.slice(a-b,(a+=t)-b):D(t);case 220:return t=d.getUint16(a),a+=2,V(t);case 221:return t=d.getUint32(a),a+=4,V(t);case 222:return t=d.getUint16(a),a+=2,z(t);case 223:return t=d.getUint32(a),a+=4,z(t);default:if(e>=224)return e-256;if(void 0===e){let e=new Error("Unexpected end of MessagePack data");throw e.incomplete=!0,e}throw new Error("Unknown MessagePack token "+e)}}}const P=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function x(e,t){function r(){if(r.count++>I){let r=e.read=new Function("r","return function(){return "+(y.freezeData?"Object.freeze":"")+"({"+e.map((e=>"__proto__"===e?"__proto_:r()":P.test(e)?e+":r()":"["+JSON.stringify(e)+"]:r()")).join(",")+"})}")(M);return 0===e.highByte&&(e.read=B(t,e.read)),r()}let n={};for(let t=0,r=e.length;t<r;t++){let r=e[t];"__proto__"===r&&(r="__proto_"),n[r]=M()}return y.freezeData?Object.freeze(n):n}return r.count=0,0===e.highByte?B(t,r):r}const B=(e,t)=>function(){let r=i[a++];if(0===r)return t();let n=e<32?-(e+(r<<5)):e+(r<<5),o=u[n]||L()[n];if(!o)throw new Error("Record id is not defined for "+n);return o.read||(o.read=x(o,e)),o.read()};function L(){let e=ie((()=>(i=null,y.getStructures())));return u=y._mergeStructures(e,u)}var U=W,N=W,j=W,D=W;let F=!1;function W(e){let t;if(e<16&&(t=$(e)))return t;if(e>64&&n)return n.decode(i.subarray(a,a+=e));const r=a+e,o=[];for(t="";a<r;){const e=i[a++];if(128&e)if(192==(224&e)){const t=63&i[a++];o.push((31&e)<<6|t)}else if(224==(240&e)){const t=63&i[a++],r=63&i[a++];o.push((31&e)<<12|t<<6|r)}else if(240==(248&e)){let t=(7&e)<<18|(63&i[a++])<<12|(63&i[a++])<<6|63&i[a++];t>65535&&(t-=65536,o.push(t>>>10&1023|55296),t=56320|1023&t),o.push(t)}else o.push(e);else o.push(e);o.length>=4096&&(t+=H.apply(String,o),o.length=0)}return o.length>0&&(t+=H.apply(String,o)),t}function V(e){let t=new Array(e);for(let r=0;r<e;r++)t[r]=M();return y.freezeData?Object.freeze(t):t}function z(e){if(y.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=J();"__proto__"===e&&(e="__proto_"),t[e]=M()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(M(),M());return t}}var H=String.fromCharCode;function q(e){let t=a,r=new Array(e);for(let n=0;n<e;n++){const e=i[a++];if((128&e)>0)return void(a=t);r[n]=e}return H.apply(String,r)}function $(e){if(e<4){if(e<2){if(0===e)return"";{let e=i[a++];return(128&e)>1?void(a-=1):H(e)}}{let t=i[a++],r=i[a++];if((128&t)>0||(128&r)>0)return void(a-=2);if(e<3)return H(t,r);let n=i[a++];return(128&n)>0?void(a-=3):H(t,r,n)}}{let t=i[a++],r=i[a++],n=i[a++],o=i[a++];if((128&t)>0||(128&r)>0||(128&n)>0||(128&o)>0)return void(a-=4);if(e<6){if(4===e)return H(t,r,n,o);{let e=i[a++];return(128&e)>0?void(a-=5):H(t,r,n,o,e)}}if(e<8){let s=i[a++],l=i[a++];if((128&s)>0||(128&l)>0)return void(a-=6);if(e<7)return H(t,r,n,o,s,l);let u=i[a++];return(128&u)>0?void(a-=7):H(t,r,n,o,s,l,u)}{let s=i[a++],l=i[a++],u=i[a++],c=i[a++];if((128&s)>0||(128&l)>0||(128&u)>0||(128&c)>0)return void(a-=8);if(e<10){if(8===e)return H(t,r,n,o,s,l,u,c);{let e=i[a++];return(128&e)>0?void(a-=9):H(t,r,n,o,s,l,u,c,e)}}if(e<12){let h=i[a++],f=i[a++];if((128&h)>0||(128&f)>0)return void(a-=10);if(e<11)return H(t,r,n,o,s,l,u,c,h,f);let d=i[a++];return(128&d)>0?void(a-=11):H(t,r,n,o,s,l,u,c,h,f,d)}{let h=i[a++],f=i[a++],d=i[a++],p=i[a++];if((128&h)>0||(128&f)>0||(128&d)>0||(128&p)>0)return void(a-=12);if(e<14){if(12===e)return H(t,r,n,o,s,l,u,c,h,f,d,p);{let e=i[a++];return(128&e)>0?void(a-=13):H(t,r,n,o,s,l,u,c,h,f,d,p,e)}}{let g=i[a++],y=i[a++];if((128&g)>0||(128&y)>0)return void(a-=14);if(e<15)return H(t,r,n,o,s,l,u,c,h,f,d,p,g,y);let b=i[a++];return(128&b)>0?void(a-=15):H(t,r,n,o,s,l,u,c,h,f,d,p,g,y,b)}}}}}function K(){let e,t=i[a++];if(t<192)e=t-160;else switch(t){case 217:e=i[a++];break;case 218:e=d.getUint16(a),a+=2;break;case 219:e=d.getUint32(a),a+=4;break;default:throw new Error("Expected string")}return W(e)}function G(e){return y.copyBuffers?Uint8Array.prototype.slice.call(i,a,a+=e):i.subarray(a,a+=e)}function Q(e){let t=i[a++];if(m[t]){let r;return m[t](i.subarray(a,r=a+=e),(e=>{a=e;try{return M()}finally{a=r}}))}throw new Error("Unknown extension type "+t)}var Y=new Array(4096);function J(){let e=i[a++];if(!(e>=160&&e<192))return a--,X(M());if(e-=160,v>=a)return c.slice(a-b,(a+=e)-b);if(!(0==v&&o<180))return U(e);let t,r=4095&(e<<5^(e>1?d.getUint16(a):e>0?i[a]:0)),n=Y[r],s=a,l=a+e-3,u=0;if(n&&n.bytes==e){for(;s<l;){if(t=d.getUint32(s),t!=n[u++]){s=1879048192;break}s+=4}for(l+=3;s<l;)if(t=i[s++],t!=n[u++]){s=1879048192;break}if(s===l)return a=s,n.string;l-=3,s=a}for(n=[],Y[r]=n,n.bytes=e;s<l;)t=d.getUint32(s),n.push(t),s+=4;for(l+=3;s<l;)t=i[s++],n.push(t);let h=e<16?$(e):q(e);return n.string=null!=h?h:U(e)}function X(e){if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e||"bigint"==typeof e)return e.toString();if(null==e)return e+"";throw new Error("Invalid property type for record",typeof e)}const Z=(e,t)=>{let r=M().map(X),n=e;void 0!==t&&(e=e<32?-((t<<5)+e):(t<<5)+e,r.highByte=t);let i=u[e];return i&&(i.isShared||T)&&((u.restoreStructures||(u.restoreStructures=[]))[e]=i),u[e]=r,r.read=x(r,n),r.read()};m[0]=()=>{},m[0].noBuffer=!0,m[66]=e=>{let t=e.length,r=BigInt(128&e[0]?e[0]-256:e[0]);for(let n=1;n<t;n++)r<<=8n,r+=BigInt(e[n]);return r};let ee={Error,TypeError,ReferenceError};m[101]=()=>{let e=M();return(ee[e[0]]||Error)(e[1],{cause:e[2]})},m[105]=e=>{if(!1===y.structuredClone)throw new Error("Structured clone extension is disabled");let t=d.getUint32(a-4);f||(f=new Map);let r,n=i[a];r=n>=144&&n<160||220==n||221==n?[]:{};let o={target:r};f.set(t,o);let s=M();return o.used?Object.assign(r,s):(o.target=s,s)},m[112]=e=>{if(!1===y.structuredClone)throw new Error("Structured clone extension is disabled");let t=d.getUint32(a-4),r=f.get(t);return r.used=!0,r.target},m[115]=()=>new Set(M());const te=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map((e=>e+"Array"));let re="object"==typeof globalThis?globalThis:window;m[116]=e=>{let t=e[0],r=te[t];if(!r){if(16===t){let t=new ArrayBuffer(e.length-1);return new Uint8Array(t).set(e.subarray(1)),t}throw new Error("Could not find typed array for code "+t)}return new re[r](Uint8Array.prototype.slice.call(e,1).buffer)},m[120]=()=>{let e=M();return new RegExp(e[0],e[1])};const ne=[];function ie(e){A&&A();let t=o,r=a,n=g,s=b,l=v,m=c,w=p,_=f,E=h,S=new Uint8Array(i.slice(0,o)),k=u,I=u.slice(0,u.length),C=y,R=T,O=e();return o=t,a=r,g=n,b=s,v=l,c=m,p=w,f=_,h=E,i=S,T=R,(u=k).splice(0,u.length,...I),y=C,d=new DataView(i.buffer,i.byteOffset,i.byteLength),O}function oe(){i=null,f=null,u=null}m[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],r=a;return a+=t-e.length,h=ne,(h=[K(),K()]).position0=0,h.position1=0,h.postBundlePosition=a,a=r,M()},m[255]=e=>4==e.length?new Date(1e3*(16777216*e[0]+(e[1]<<16)+(e[2]<<8)+e[3])):8==e.length?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+1e3*(4294967296*(3&e[3])+16777216*e[4]+(e[5]<<16)+(e[6]<<8)+e[7])):12==e.length?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+1e3*((128&e[4]?-281474976710656:0)+1099511627776*e[6]+4294967296*e[7]+16777216*e[8]+(e[9]<<16)+(e[10]<<8)+e[11])):new Date("invalid");const se=new Array(147);for(let e=0;e<256;e++)se[e]=+("1e"+Math.floor(45.15-.30103*e));const ae=C;var le=new C({useRecords:!1});const ue=le.unpack,ce=le.unpackMultiple,he=le.unpack,fe={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let de=new Float32Array(1),pe=new Uint8Array(de.buffer,0,4);function ge(e){de[0]=e;let t=se[(127&pe[3])<<1|pe[2]>>7];return(t*e+(e>0?.5:-.5)|0)/t}var ye=r(8287).hp;let be,ve,me;try{be=new TextEncoder}catch(e){}const we=void 0!==ye,_e=we?function(e){return ye.allocUnsafeSlow(e)}:Uint8Array,Ee=we?ye:Uint8Array,Se=we?4294967296:2144337920;let ke,Ae,Te,Ie,Ce,Re=0,Oe=null;const Me=/[\u0080-\uFFFF]/,Pe=Symbol("record-id");class xe extends C{constructor(e){let t,r,n,i;super(e),this.offset=0;let o=Ee.prototype.utf8Write?function(e,t){return ke.utf8Write(e,t,4294967295)}:!(!be||!be.encodeInto)&&function(e,t){return be.encodeInto(e,ke.subarray(t)).written},s=this;e||(e={});let a=e&&e.sequential,l=e.structures||e.saveStructures,u=e.maxSharedStructures;if(null==u&&(u=l?32:0),u>8160)throw new Error("Maximum maxSharedStructure is 8160");e.structuredClone&&null==e.moreTypes&&(this.moreTypes=!0);let c=e.maxOwnStructures;null==c&&(c=l?32:64),this.structures||0==e.useRecords||(this.structures=[]);let h=u>32||c+u>64,f=u+64,d=u+c+64;if(d>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let p=[],g=0,y=0;this.pack=this.encode=function(e,o){if(ke||(ke=new _e(8192),Te=ke.dataView||(ke.dataView=new DataView(ke.buffer,0,8192)),Re=0),Ie=ke.length-10,Ie-Re<2048?(ke=new _e(ke.length),Te=ke.dataView||(ke.dataView=new DataView(ke.buffer,0,ke.length)),Ie=ke.length-10,Re=0):Re=Re+7&2147483640,t=Re,o&Ye&&(Re+=255&o),i=s.structuredClone?new Map:null,s.bundleStrings&&"string"!=typeof e?(Oe=[],Oe.size=1/0):Oe=null,n=s.structures,n){n.uninitialized&&(n=s._mergeStructures(s.getStructures()));let e=n.sharedLength||0;if(e>u)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+n.sharedLength);if(!n.transitions){n.transitions=Object.create(null);for(let t=0;t<e;t++){let e=n[t];if(!e)continue;let r,i=n.transitions;for(let t=0,n=e.length;t<n;t++){let n=e[t];r=i[n],r||(r=i[n]=Object.create(null)),i=r}i[Pe]=t+64}this.lastNamedStructuresLength=e}a||(n.nextId=e+64)}let l;r&&(r=!1);try{s.randomAccessStructure&&e&&e.constructor&&e.constructor===Object?I(e):m(e);let r=Oe;if(Oe&&Ne(t,m,0),i&&i.idsToInsert){let e=i.idsToInsert.sort(((e,t)=>e.offset>t.offset?1:-1)),n=e.length,o=-1;for(;r&&n>0;){let i=e[--n].offset+t;i<r.stringsPosition+t&&-1===o&&(o=0),i>r.position+t?o>=0&&(o+=6):(o>=0&&(Te.setUint32(r.position+t,Te.getUint32(r.position+t)+o),o=-1),r=r.previous,n++)}o>=0&&r&&Te.setUint32(r.position+t,Te.getUint32(r.position+t)+o),Re+=6*e.length,Re>Ie&&k(Re),s.offset=Re;let a=function(e,t){let r,n=6*t.length,i=e.length-n;for(;r=t.pop();){let t=r.offset,o=r.id;e.copyWithin(t+n,t,i),n-=6;let s=t+n;e[s++]=214,e[s++]=105,e[s++]=o>>24,e[s++]=o>>16&255,e[s++]=o>>8&255,e[s++]=255&o,i=t}return e}(ke.subarray(t,Re),e);return i=null,a}return s.offset=Re,o&Ge?(ke.start=t,ke.end=Re,ke):ke.subarray(t,Re)}catch(e){throw l=e,e}finally{if(n&&(b(),r&&s.saveStructures)){let r=n.sharedLength||0,i=ke.subarray(t,Re),a=De(n,s);if(!l)return!1===s.saveStructures(a,a.isCompatible)?s.pack(e,o):(s.lastNamedStructuresLength=r,ke.length>1073741824&&(ke=null),i)}ke.length>1073741824&&(ke=null),o&Qe&&(Re=t)}};const b=()=>{y<10&&y++;let e=n.sharedLength||0;if(n.length>e&&!a&&(n.length=e),g>1e4)n.transitions=null,y=0,g=0,p.length>0&&(p=[]);else if(p.length>0&&!a){for(let e=0,t=p.length;e<t;e++)p[e][Pe]=0;p=[]}},v=e=>{var t=e.length;t<16?ke[Re++]=144|t:t<65536?(ke[Re++]=220,ke[Re++]=t>>8,ke[Re++]=255&t):(ke[Re++]=221,Te.setUint32(Re,t),Re+=4);for(let r=0;r<t;r++)m(e[r])},m=e=>{Re>Ie&&(ke=k(Re));var r,n=typeof e;if("string"===n){let n,i=e.length;if(Oe&&i>=4&&i<4096){if((Oe.size+=i)>21760){let e,r,n=(Oe[0]?3*Oe[0].length+Oe[1].length:0)+10;Re+n>Ie&&(ke=k(Re+n)),Oe.position?(r=Oe,ke[Re]=200,Re+=3,ke[Re++]=98,e=Re-t,Re+=4,Ne(t,m,0),Te.setUint16(e+t-3,Re-t-e)):(ke[Re++]=214,ke[Re++]=98,e=Re-t,Re+=4),Oe=["",""],Oe.previous=r,Oe.size=0,Oe.position=e}let r=Me.test(e);return Oe[r?0:1]+=e,ke[Re++]=193,void m(r?-i:i)}n=i<32?1:i<256?2:i<65536?3:5;let s=3*i;if(Re+s>Ie&&(ke=k(Re+s)),i<64||!o){let t,o,s,a=Re+n;for(t=0;t<i;t++)o=e.charCodeAt(t),o<128?ke[a++]=o:o<2048?(ke[a++]=o>>6|192,ke[a++]=63&o|128):55296==(64512&o)&&56320==(64512&(s=e.charCodeAt(t+1)))?(o=65536+((1023&o)<<10)+(1023&s),t++,ke[a++]=o>>18|240,ke[a++]=o>>12&63|128,ke[a++]=o>>6&63|128,ke[a++]=63&o|128):(ke[a++]=o>>12|224,ke[a++]=o>>6&63|128,ke[a++]=63&o|128);r=a-Re-n}else r=o(e,Re+n);r<32?ke[Re++]=160|r:r<256?(n<2&&ke.copyWithin(Re+2,Re+1,Re+1+r),ke[Re++]=217,ke[Re++]=r):r<65536?(n<3&&ke.copyWithin(Re+3,Re+2,Re+2+r),ke[Re++]=218,ke[Re++]=r>>8,ke[Re++]=255&r):(n<5&&ke.copyWithin(Re+5,Re+3,Re+3+r),ke[Re++]=219,Te.setUint32(Re,r),Re+=4),Re+=r}else if("number"===n)if(e>>>0===e)e<32||e<128&&!1===this.useRecords||e<64&&!this.randomAccessStructure?ke[Re++]=e:e<256?(ke[Re++]=204,ke[Re++]=e):e<65536?(ke[Re++]=205,ke[Re++]=e>>8,ke[Re++]=255&e):(ke[Re++]=206,Te.setUint32(Re,e),Re+=4);else if((e|0)===e)e>=-32?ke[Re++]=256+e:e>=-128?(ke[Re++]=208,ke[Re++]=e+256):e>=-32768?(ke[Re++]=209,Te.setInt16(Re,e),Re+=2):(ke[Re++]=210,Te.setInt32(Re,e),Re+=4);else{let t;if((t=this.useFloat32)>0&&e<4294967296&&e>=-2147483648){let r;if(ke[Re++]=202,Te.setFloat32(Re,e),t<4||((r=e*se[(127&ke[Re])<<1|ke[Re+1]>>7])|0)===r)return void(Re+=4);Re--}ke[Re++]=203,Te.setFloat64(Re,e),Re+=8}else if("object"===n||"function"===n)if(e){if(i){let r=i.get(e);if(r){if(!r.id){let e=i.idsToInsert||(i.idsToInsert=[]);r.id=e.push(r)}return ke[Re++]=214,ke[Re++]=112,Te.setUint32(Re,r.id),void(Re+=4)}i.set(e,{offset:Re-t})}let o=e.constructor;if(o===Object)S(e);else if(o===Array)v(e);else if(o===Map)if(this.mapAsEmptyObject)ke[Re++]=128;else{(r=e.size)<16?ke[Re++]=128|r:r<65536?(ke[Re++]=222,ke[Re++]=r>>8,ke[Re++]=255&r):(ke[Re++]=223,Te.setUint32(Re,r),Re+=4);for(let[t,r]of e)m(t),m(r)}else{for(let t=0,r=ve.length;t<r;t++){if(e instanceof me[t]){let r=ve[t];if(r.write){r.type&&(ke[Re++]=212,ke[Re++]=r.type,ke[Re++]=0);let t=r.write.call(this,e);return void(t===e?Array.isArray(e)?v(e):S(e):m(t))}let n,i=ke,o=Te,s=Re;ke=null;try{n=r.pack.call(this,e,(e=>(ke=i,i=null,Re+=e,Re>Ie&&k(Re),{target:ke,targetView:Te,position:Re-e})),m)}finally{i&&(ke=i,Te=o,Re=s,Ie=ke.length-10)}return void(n&&(n.length+Re>Ie&&k(n.length+Re),Re=Ue(n,ke,Re,r.type)))}}if(Array.isArray(e))v(e);else{if(e.toJSON){const t=e.toJSON();if(t!==e)return m(t)}if("function"===n)return m(this.writeFunction&&this.writeFunction(e));S(e)}}}else ke[Re++]=192;else if("boolean"===n)ke[Re++]=e?195:194;else if("bigint"===n){if(e<BigInt(1)<<BigInt(63)&&e>=-(BigInt(1)<<BigInt(63)))ke[Re++]=211,Te.setBigInt64(Re,e);else if(e<BigInt(1)<<BigInt(64)&&e>0)ke[Re++]=207,Te.setBigUint64(Re,e);else{if(!this.largeBigIntToFloat){if(this.useBigIntExtension&&e<2n**1023n&&e>-(2n**1023n)){ke[Re++]=199,Re++,ke[Re++]=66;let t,r=[];do{let n=0xffn&e;t=(0x80n&n)===(e<0n?0x80n:0n),r.push(n),e>>=8n}while(0n!==e&&-1n!==e||!t);ke[Re-2]=r.length;for(let e=r.length;e>0;)ke[Re++]=Number(r[--e]);return}throw new RangeError(e+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension or set largeBigIntToFloat to convert to float-64")}ke[Re++]=203,Te.setFloat64(Re,Number(e))}Re+=8}else{if("undefined"!==n)throw new Error("Unknown type: "+n);this.encodeUndefinedAsNil?ke[Re++]=192:(ke[Re++]=212,ke[Re++]=0,ke[Re++]=0)}},w=this.variableMapSize||this.coercibleKeyAsNumber?e=>{let t,r=Object.keys(e),n=r.length;if(n<16?ke[Re++]=128|n:n<65536?(ke[Re++]=222,ke[Re++]=n>>8,ke[Re++]=255&n):(ke[Re++]=223,Te.setUint32(Re,n),Re+=4),this.coercibleKeyAsNumber)for(let i=0;i<n;i++){t=r[i];let n=Number(t);m(isNaN(n)?t:n),m(e[t])}else for(let i=0;i<n;i++)m(t=r[i]),m(e[t])}:e=>{ke[Re++]=222;let r=Re-t;Re+=2;let n=0;for(let t in e)("function"!=typeof e.hasOwnProperty||e.hasOwnProperty(t))&&(m(t),m(e[t]),n++);ke[r+++t]=n>>8,ke[r+t]=255&n},_=!1===this.useRecords?w:e.progressiveRecords&&!h?e=>{let r,i,o=n.transitions||(n.transitions=Object.create(null)),s=Re++-t;for(let a in e)if("function"!=typeof e.hasOwnProperty||e.hasOwnProperty(a)){if(r=o[a],r)o=r;else{let l=Object.keys(e),u=o;o=n.transitions;let c=0;for(let e=0,t=l.length;e<t;e++){let t=l[e];r=o[t],r||(r=o[t]=Object.create(null),c++),o=r}s+t+1==Re?(Re--,A(o,l,c)):T(o,l,s,c),i=!0,o=u[a]}m(e[a])}if(!i){let r=o[Pe];r?ke[s+t]=r:T(o,Object.keys(e),s,0)}}:e=>{let t,r=n.transitions||(n.transitions=Object.create(null)),i=0;for(let n in e)("function"!=typeof e.hasOwnProperty||e.hasOwnProperty(n))&&(t=r[n],t||(t=r[n]=Object.create(null),i++),r=t);let o=r[Pe];o?o>=96&&h?(ke[Re++]=96+(31&(o-=96)),ke[Re++]=o>>5):ke[Re++]=o:A(r,r.__keys__||Object.keys(e),i);for(let t in e)("function"!=typeof e.hasOwnProperty||e.hasOwnProperty(t))&&m(e[t])},E="function"==typeof this.useRecords&&this.useRecords,S=E?e=>{E(e)?_(e):w(e)}:_,k=e=>{let r;if(e>16777216){if(e-t>Se)throw new Error("Packed buffer would be larger than maximum buffer size");r=Math.min(Se,4096*Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096))}else r=1+(Math.max(e-t<<2,ke.length-1)>>12)<<12;let n=new _e(r);return Te=n.dataView||(n.dataView=new DataView(n.buffer,0,r)),e=Math.min(e,ke.length),ke.copy?ke.copy(n,0,t,e):n.set(ke.slice(t,e)),Re-=t,t=0,Ie=n.length-10,ke=n},A=(e,t,i)=>{let o=n.nextId;o||(o=64),o<f&&this.shouldShareStructure&&!this.shouldShareStructure(t)?(o=n.nextOwnId,o<d||(o=f),n.nextOwnId=o+1):(o>=d&&(o=f),n.nextId=o+1);let s=t.highByte=o>=96&&h?o-96>>5:-1;e[Pe]=o,e.__keys__=t,n[o-64]=t,o<f?(t.isShared=!0,n.sharedLength=o-63,r=!0,s>=0?(ke[Re++]=96+(31&o),ke[Re++]=s):ke[Re++]=o):(s>=0?(ke[Re++]=213,ke[Re++]=114,ke[Re++]=96+(31&o),ke[Re++]=s):(ke[Re++]=212,ke[Re++]=114,ke[Re++]=o),i&&(g+=y*i),p.length>=c&&(p.shift()[Pe]=0),p.push(e),m(t))},T=(e,r,n,i)=>{let o=ke,s=Re,a=Ie,l=t;ke=Ae,Re=0,t=0,ke||(Ae=ke=new _e(8192)),Ie=ke.length-10,A(e,r,i),Ae=ke;let u=Re;if(ke=o,Re=s,Ie=a,t=l,u>1){let e=Re+u-1;e>Ie&&k(e);let r=n+t;ke.copyWithin(r+u,r+1,Re),ke.set(Ae.slice(0,u),r),Re=e}else ke[n+t]=Ae[0]},I=e=>{let i=Ce(e,ke,t,Re,n,k,((e,t,n)=>{if(n)return r=!0;Re=t;let i=ke;return m(e),b(),i!==ke?{position:Re,targetView:Te,target:ke}:Re}),this);if(0===i)return S(e);Re=i}}useBuffer(e){ke=e,Te=new DataView(ke.buffer,ke.byteOffset,ke.byteLength),Re=0}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}function Be(e,t,r,n){let i=e.byteLength;if(i+1<256){var{target:o,position:s}=r(4+i);o[s++]=199,o[s++]=i+1}else if(i+1<65536){var{target:o,position:s}=r(5+i);o[s++]=200,o[s++]=i+1>>8,o[s++]=i+1&255}else{var{target:o,position:s,targetView:a}=r(7+i);o[s++]=201,a.setUint32(s,i+1),s+=4}o[s++]=116,o[s++]=t,e.buffer||(e=new Uint8Array(e)),o.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),s)}function Le(e,t){let r=e.byteLength;var n,i;if(r<256){var{target:n,position:i}=t(r+2);n[i++]=196,n[i++]=r}else if(r<65536){var{target:n,position:i}=t(r+3);n[i++]=197,n[i++]=r>>8,n[i++]=255&r}else{var{target:n,position:i,targetView:o}=t(r+5);n[i++]=198,o.setUint32(i,r),i+=4}n.set(e,i)}function Ue(e,t,r,n){let i=e.length;switch(i){case 1:t[r++]=212;break;case 2:t[r++]=213;break;case 4:t[r++]=214;break;case 8:t[r++]=215;break;case 16:t[r++]=216;break;default:i<256?(t[r++]=199,t[r++]=i):i<65536?(t[r++]=200,t[r++]=i>>8,t[r++]=255&i):(t[r++]=201,t[r++]=i>>24,t[r++]=i>>16&255,t[r++]=i>>8&255,t[r++]=255&i)}return t[r++]=n,t.set(e,r),r+=i}function Ne(e,t,r){if(Oe.length>0){Te.setUint32(Oe.position+e,Re+r-Oe.position-e),Oe.stringsPosition=Re-e;let n=Oe;Oe=null,t(n[0]),t(n[1])}}function je(e){if(e.Class){if(!e.pack&&!e.write)throw new Error("Extension has no pack or write function");if(e.pack&&!e.type)throw new Error("Extension has no type (numeric code to identify the extension)");me.unshift(e.Class),ve.unshift(e)}!function(e){e.unpack?m[e.type]=e.unpack:m[e.type]=e}(e)}function De(e,t){return e.isCompatible=e=>{let r=!e||(t.lastNamedStructuresLength||0)===e.length;return r||t._mergeStructures(e),r},e}me=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,_],ve=[{pack(e,t,r){let n=e.getTime()/1e3;if((this.useTimestamp32||0===e.getMilliseconds())&&n>=0&&n<4294967296){let{target:e,targetView:r,position:i}=t(6);e[i++]=214,e[i++]=255,r.setUint32(i,n)}else if(n>0&&n<4294967296){let{target:r,targetView:i,position:o}=t(10);r[o++]=215,r[o++]=255,i.setUint32(o,4e6*e.getMilliseconds()+(n/1e3/4294967296|0)),i.setUint32(o+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return t(0),r(this.onInvalidDate());let{target:e,targetView:n,position:i}=t(3);e[i++]=212,e[i++]=255,e[i++]=255}else{let{target:r,targetView:i,position:o}=t(15);r[o++]=199,r[o++]=12,r[o++]=255,i.setUint32(o,1e6*e.getMilliseconds()),i.setBigInt64(o+4,BigInt(Math.floor(n)))}}},{pack(e,t,r){if(this.setAsEmptyObject)return t(0),r({});let n=Array.from(e),{target:i,position:o}=t(this.moreTypes?3:0);this.moreTypes&&(i[o++]=212,i[o++]=115,i[o++]=0),r(n)}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=101,n[i++]=0),r([e.name,e.message,e.cause])}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=120,n[i++]=0),r([e.source,e.flags])}},{pack(e,t){this.moreTypes?Be(e,16,t):Le(we?ye.from(e):new Uint8Array(e),t)}},{pack(e,t){let r=e.constructor;r!==Ee&&this.moreTypes?Be(e,te.indexOf(r.name),t):Le(e,t)}},{pack(e,t){let{target:r,position:n}=t(1);r[n]=193}}];let Fe=new xe({useRecords:!1});const We=Fe.pack,Ve=Fe.pack,ze=xe,{NEVER:He,ALWAYS:qe,DECIMAL_ROUND:$e,DECIMAL_FIT:Ke}=fe,Ge=512,Qe=1024,Ye=2048;var Je=r(8287).hp;const Xe=function(e,t={}){if(!e||"object"!=typeof e)throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a promise");const r=new C(t);let n;const i=e=>{let t;n&&(e=Je.concat([n,e]),n=void 0);try{t=r.unpackMultiple(e)}catch(r){if(!r.incomplete)throw r;n=e.slice(r.lastPosition),t=r.values}return t};return"function"==typeof e[Symbol.iterator]?function*(){for(const t of e)yield*i(t)}():"function"==typeof e[Symbol.asyncIterator]?async function*(){for await(const t of e)yield*i(t)}():void 0},Ze=function(e,t={}){if(e&&"object"==typeof e){if("function"==typeof e[Symbol.iterator])return function*(e,t){const r=new xe(t);for(const t of e)yield r.pack(t)}(e,t);if("function"==typeof e.then||"function"==typeof e[Symbol.asyncIterator])return async function*(e,t){const r=new xe(t);for await(const t of e)yield r.pack(t)}(e,t);throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a Promise")}throw new Error("first argument must be an Iterable, Async Iterable, or a Promise for an Async Iterable")},et=!1,tt=!0},6351:e=>{"use strict";e.exports={version:"0.0.1"}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}return r.amdO={},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(7820)})()));
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(()=>(()=>{var e={7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],l=o[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,l)),c=0,h=l>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t);1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(l(e,a,a+s>u?u:a+s));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},6880:function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=r(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,n){void 0===n&&(n=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(r),s=Math.max(i,o),a=0,l=e.map([t,r],(function(t){var r=s-e.getVersionPrecision(t),n=t+new Array(r+1).join(".0");return e.map(n.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(n&&(a=s-Math.min(i,o)),s-=1;s>=a;){if(l[0][s]>l[1][s])return 1;if(l[0][s]===l[1][s]){if(s===a)return 0;s-=1}else if(l[0][s]<l[1][s])return-1}},e.map=function(e,t){var r,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n},e.find=function(e,t){var r,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(r=0,n=e.length;r<n;r+=1){var i=e[r];if(t(i,r))return i}},e.assign=function(e){for(var t,r,n=e,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];if(Object.assign)return Object.assign.apply(Object,[e].concat(o));var a=function(){var e=o[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){n[t]=e[t]}))};for(t=0,r=o.length;t<r;t+=1)a();return e},e.getBrowserAlias=function(e){return n.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return n.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,r){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(91))&&n.__esModule?n:{default:n},o=r(18);function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=function(){function e(){}var t,r,n;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,n=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}],(r=null)&&s(t.prototype,r),n&&s(t,n),e}();t.default=a,e.exports=t.default},91:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=l(r(92)),i=l(r(93)),o=l(r(94)),s=l(r(95)),a=l(r(17));function l(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=a.default.find(n.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=a.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=a.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=a.default.find(s.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return a.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,r={},n=0,i={},o=0;if(Object.keys(e).forEach((function(t){var s=e[t];"string"==typeof s?(i[t]=s,o+=1):"object"==typeof s&&(r[t]=s,n+=1)})),n>0){var s=Object.keys(r),l=a.default.find(s,(function(e){return t.isOS(e)}));if(l){var u=this.satisfies(r[l]);if(void 0!==u)return u}var c=a.default.find(s,(function(e){return t.isPlatform(e)}));if(c){var h=this.satisfies(r[c]);if(void 0!==h)return h}}if(o>0){var f=Object.keys(i),d=a.default.find(f,(function(e){return t.isBrowser(e,!0)}));if(void 0!==d)return this.compareVersion(i[d])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),i=a.default.getBrowserTypeByAlias(n);return t&&i&&(n=i.toLowerCase()),n===r},t.compareVersion=function(e){var t=[0],r=e,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(n=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(n=!0,r=e.substr(1)),t.indexOf(a.default.compareVersions(i,r,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=u,e.exports=t.default},92:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=/version\/(\d+(\.?_?\d+)+)/i,s=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=s,e.exports=t.default},93:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},r=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=i.default.getMacOSVersionName(t),n={name:o.OS_MAP.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=i.default.getAndroidVersionName(t),n={name:o.OS_MAP.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:o.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=s,e.exports=t.default},94:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=s,e.exports=t.default},95:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},r=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},r=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},r=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=s,e.exports=t.default}})},8287:(e,t,r)=>{"use strict";const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=l,t.IS=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|g(e,t);let n=a(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);const i=function(e){if(l.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Y(e.length)?a(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return c(e),a(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,l.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(i)return n?-1:$(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){let o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Y(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return G($(t,e.length-r),e,r,n)}function E(e,t,r,n){return G(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return G(K(t),e,r,n)}function k(e,t,r,n){return G(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(o=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=I));return r}(n)}l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.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(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},l.allocUnsafe=function(e){return h(e)},l.allocUnsafeSlow=function(e){return h(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=l.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,Uint8Array))i+t.length>n.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):y.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,i){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),u=this.slice(n,i),c=e.slice(t,r);for(let e=0;e<a;++e)if(u[e]!==c[e]){o=u[e],s=c[e];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function C(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function O(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=J[e[n]];return i}function M(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function P(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function B(e,t,r,n,i){V(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function L(e,t,r,n,i){V(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function U(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,o){return t=+t,r>>>=0,o||U(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function j(e,t,r,n,o){return t=+t,r>>>=0,o||U(e,0,r,8),i.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),l.prototype.readBigUInt64BE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),l.prototype.readBigInt64BE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=X((function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=X((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=X((function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=X((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return j(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return j(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},l.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=l.isBuffer(e)?e:l.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const D={};function F(e,t,r){D[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function W(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function V(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new D.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,o)}function z(e,t){if("number"!=typeof e)throw new D.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new D.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=W(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=W(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function $(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function K(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},955:function(e,t,r){var n;e.exports=(n=r(9021),r(754),r(4636),r(9506),r(7165),function(){var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],o=[],s=[],a=[],l=[],u=[],c=[],h=[],f=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,o[p]=r;var g=e[r],y=e[g],b=e[y],v=257*e[p]^16843008*p;s[r]=v<<24|v>>>8,a[r]=v<<16|v>>>16,l[r]=v<<8|v>>>24,u[r]=v,v=16843009*b^65537*y^257*g^16843008*r,c[p]=v<<24|v>>>8,h[p]=v<<16|v>>>16,f[p]=v<<8|v>>>24,d[p]=v,r?(r=g^e[e[e[b^g]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],g=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],s=0;s<n;s++)s<r?o[s]=t[s]:(u=o[s-1],s%r?r>6&&s%r==4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u]):(u=i[(u=u<<8|u>>>24)>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u],u^=p[s/r|0]<<24),o[s]=o[s-r]^u);for(var a=this._invKeySchedule=[],l=0;l<n;l++){if(s=n-l,l%4)var u=o[s];else u=o[s-4];a[l]=l<4||s<=4?u:c[i[u>>>24]]^h[i[u>>>16&255]]^f[i[u>>>8&255]]^d[i[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,l,u,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,c,h,f,d,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,s,a){for(var l=this._nRounds,u=e[t]^r[0],c=e[t+1]^r[1],h=e[t+2]^r[2],f=e[t+3]^r[3],d=4,p=1;p<l;p++){var g=n[u>>>24]^i[c>>>16&255]^o[h>>>8&255]^s[255&f]^r[d++],y=n[c>>>24]^i[h>>>16&255]^o[f>>>8&255]^s[255&u]^r[d++],b=n[h>>>24]^i[f>>>16&255]^o[u>>>8&255]^s[255&c]^r[d++],v=n[f>>>24]^i[u>>>16&255]^o[c>>>8&255]^s[255&h]^r[d++];u=g,c=y,h=b,f=v}g=(a[u>>>24]<<24|a[c>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^r[d++],y=(a[c>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&u])^r[d++],b=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[u>>>8&255]<<8|a[255&c])^r[d++],v=(a[f>>>24]<<24|a[u>>>16&255]<<16|a[c>>>8&255]<<8|a[255&h])^r[d++],e[t]=g,e[t+1]=y,e[t+2]=b,e[t+3]=v},keySize:8});e.AES=t._createHelper(g)}(),n.AES)},3128:function(e,t,r){var n;e.exports=(n=r(9021),r(754),r(4636),r(9506),r(7165),function(){var e=n,t=e.lib.BlockCipher,r=e.algo;const i=16,o=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var a={pbox:[],sbox:[]};function l(e,t){let r=t>>24&255,n=t>>16&255,i=t>>8&255,o=255&t,s=e.sbox[0][r]+e.sbox[1][n];return s^=e.sbox[2][i],s+=e.sbox[3][o],s}function u(e,t,r){let n,o=t,s=r;for(let t=0;t<i;++t)o^=e.pbox[t],s=l(e,o)^s,n=o,o=s,s=n;return n=o,o=s,s=n,s^=e.pbox[i],o^=e.pbox[i+1],{left:o,right:s}}function c(e,t,r){let n,o=t,s=r;for(let t=i+1;t>1;--t)o^=e.pbox[t],s=l(e,o)^s,n=o,o=s,s=n;return n=o,o=s,s=n,s^=e.pbox[1],o^=e.pbox[0],{left:o,right:s}}function h(e,t,r){for(let t=0;t<4;t++){e.sbox[t]=[];for(let r=0;r<256;r++)e.sbox[t][r]=s[t][r]}let n=0;for(let s=0;s<i+2;s++)e.pbox[s]=o[s]^t[n],n++,n>=r&&(n=0);let a=0,l=0,c=0;for(let t=0;t<i+2;t+=2)c=u(e,a,l),a=c.left,l=c.right,e.pbox[t]=a,e.pbox[t+1]=l;for(let t=0;t<4;t++)for(let r=0;r<256;r+=2)c=u(e,a,l),a=c.left,l=c.right,e.sbox[t][r]=a,e.sbox[t][r+1]=l;return!0}var f=r.Blowfish=t.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4;h(a,t,r)}},encryptBlock:function(e,t){var r=u(a,e[t],e[t+1]);e[t]=r.left,e[t+1]=r.right},decryptBlock:function(e,t){var r=c(a,e[t],e[t+1]);e[t]=r.left,e[t+1]=r.right},blockSize:2,keySize:4,ivSize:2});e.Blowfish=t._createHelper(f)}(),n.Blowfish)},7165:function(e,t,r){var n;e.exports=(n=r(9021),r(9506),void(n.lib.Cipher||function(e){var t=n,r=t.lib,i=r.Base,o=r.WordArray,s=r.BufferedBlockAlgorithm,a=t.enc,l=(a.Utf8,a.Base64),u=t.algo.EvpKDF,c=r.Cipher=s.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?m:b}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),h=(r.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),t.mode={}),f=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),d=h.CBC=function(){var t=f.extend();function r(t,r,n){var i,o=this._iv;o?(i=o,this._iv=e):i=this._prevBlock;for(var s=0;s<n;s++)t[r+s]^=i[s]}return t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize;r.call(this,e,t,i),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,o=e.slice(t,t+i);n.decryptBlock(e,t),r.call(this,e,t,i),this._prevBlock=o}}),t}(),p=(t.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,i=n<<24|n<<16|n<<8|n,s=[],a=0;a<n;a+=4)s.push(i);var l=o.create(s,n);e.concat(l)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},g=(r.BlockCipher=c.extend({cfg:c.cfg.extend({mode:d,padding:p}),reset:function(){var e;c.reset.call(this);var t=this.cfg,r=t.iv,n=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=n.createEncryptor:(e=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(n,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),y=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?o.create([1398893684,1701076831]).concat(r).concat(t):t).toString(l)},parse:function(e){var t,r=l.parse(e),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(t=o.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),g.create({ciphertext:r,salt:t})}},b=r.SerializableCipher=i.extend({cfg:i.extend({format:y}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),o=i.finalize(t),s=i.cfg;return g.create({ciphertext:o,key:r,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,n,i){if(n||(n=o.random(8)),i)s=u.create({keySize:t+r,hasher:i}).compute(e,n);else var s=u.create({keySize:t+r}).compute(e,n);var a=o.create(s.words.slice(t),4*r);return s.sigBytes=4*t,g.create({key:s,iv:a,salt:n})}},m=r.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:v}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize,n.salt,n.hasher);n.iv=i.iv;var o=b.encrypt.call(this,e,t,i.key,n);return o.mixIn(i),o},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt,n.hasher);return n.iv=i.iv,b.decrypt.call(this,e,t,i.key,n)}})}()))},9021:function(e,t,r){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==r.g&&r.g.crypto&&(n=r.g.crypto),!n)try{n=r(477)}catch(e){}var i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),s={},a=s.lib={},l=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=l.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o<i;o++){var s=r[o>>>2]>>>24-o%4*8&255;t[n+o>>>2]|=s<<24-(n+o)%4*8}else for(var a=0;a<i;a+=4)t[n+a>>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=l.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(i());return new u.init(t,e)}}),c=s.enc={},h=c.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new u.init(r,t/2)}},f=c.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new u.init(r,t)}},d=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,i=n.words,o=n.sigBytes,s=this.blockSize,a=o/(4*s),l=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,c=e.min(4*l,o);if(l){for(var h=0;h<l;h+=s)this._doProcessBlock(i,h);r=i.splice(0,l),n.sigBytes-=c}return new u.init(r,c)},clone:function(){var e=l.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),g=(a.Hasher=p.extend({cfg:l.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new g.HMAC.init(e,r).finalize(t)}}}),s.algo={});return s}(Math),n)},754:function(e,t,r){var n;e.exports=(n=r(9021),function(){var e=n,t=e.lib.WordArray;function r(e,r,n){for(var i=[],o=0,s=0;s<r;s++)if(s%4){var a=n[e.charCodeAt(s-1)]<<s%4*2|n[e.charCodeAt(s)]>>>6-s%4*2;i[o>>>2]|=a<<24-o%4*8,o++}return t.create(i,o)}e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],o=0;o<r;o+=3)for(var s=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<r;a++)i.push(n.charAt(s>>>6*(3-a)&63));var l=n.charAt(64);if(l)for(;i.length%4;)i.push(l);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<n.length;o++)i[n.charCodeAt(o)]=o}var s=n.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return r(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),n.enc.Base64)},4725:function(e,t,r){var n;e.exports=(n=r(9021),function(){var e=n,t=e.lib.WordArray;function r(e,r,n){for(var i=[],o=0,s=0;s<r;s++)if(s%4){var a=n[e.charCodeAt(s-1)]<<s%4*2|n[e.charCodeAt(s)]>>>6-s%4*2;i[o>>>2]|=a<<24-o%4*8,o++}return t.create(i,o)}e.enc.Base64url={stringify:function(e,t){void 0===t&&(t=!0);var r=e.words,n=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var o=[],s=0;s<n;s+=3)for(var a=(r[s>>>2]>>>24-s%4*8&255)<<16|(r[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|r[s+2>>>2]>>>24-(s+2)%4*8&255,l=0;l<4&&s+.75*l<n;l++)o.push(i.charAt(a>>>6*(3-l)&63));var u=i.charAt(64);if(u)for(;o.length%4;)o.push(u);return o.join("")},parse:function(e,t){void 0===t&&(t=!0);var n=e.length,i=t?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var s=0;s<i.length;s++)o[i.charCodeAt(s)]=s}var a=i.charAt(64);if(a){var l=e.indexOf(a);-1!==l&&(n=l)}return r(e,n,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),n.enc.Base64url)},5503:function(e,t,r){var n;e.exports=(n=r(9021),function(){var e=n,t=e.lib.WordArray,r=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var o=t[i>>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i<r;i++)n[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},r.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o+=2){var s=i(t[o>>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o<r;o++)n[o>>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return t.create(n,2*r)}}}(),n.enc.Utf16)},9506:function(e,t,r){var n,i,o,s,a,l,u,c;e.exports=(c=r(9021),r(5471),r(1025),i=(n=c).lib,o=i.Base,s=i.WordArray,a=n.algo,l=a.MD5,u=a.EvpKDF=o.extend({cfg:o.extend({keySize:4,hasher:l,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,i=n.hasher.create(),o=s.create(),a=o.words,l=n.keySize,u=n.iterations;a.length<l;){r&&i.update(r),r=i.update(e).finalize(t),i.reset();for(var c=1;c<u;c++)r=i.finalize(r),i.reset();o.concat(r)}return o.sigBytes=4*l,o}}),n.EvpKDF=function(e,t,r){return u.create(r).compute(e,t)},c.EvpKDF)},25:function(e,t,r){var n,i,o,s;e.exports=(s=r(9021),r(7165),i=(n=s).lib.CipherParams,o=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(o)},parse:function(e){var t=o.parse(e);return i.create({ciphertext:t})}},s.format.Hex)},3793:function(e,t,r){var n;e.exports=(n=r(9021),r(3009),r(1025),n.HmacSHA256)},1025:function(e,t,r){var n,i,o,s;e.exports=(n=r(9021),o=(i=n).lib.Base,s=i.enc.Utf8,void(i.algo.HMAC=o.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=s.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),a=i.words,l=o.words,u=0;u<r;u++)a[u]^=1549556828,l[u]^=909522486;i.sigBytes=o.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))},1396:function(e,t,r){var n;e.exports=(n=r(9021),r(3240),r(6440),r(5503),r(754),r(4725),r(4636),r(5471),r(3009),r(6308),r(1380),r(9557),r(5953),r(8056),r(1025),r(19),r(9506),r(7165),r(2169),r(6939),r(6372),r(3797),r(8454),r(2073),r(4905),r(482),r(2155),r(8124),r(25),r(955),r(7628),r(7193),r(6298),r(2696),r(3128),n)},6440:function(e,t,r){var n;e.exports=(n=r(9021),function(){if("function"==typeof ArrayBuffer){var e=n.lib.WordArray,t=e.init,r=e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var r=e.byteLength,n=[],i=0;i<r;i++)n[i>>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)};r.prototype=e}}(),n.lib.WordArray)},4636:function(e,t,r){var n;e.exports=(n=r(9021),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,s=e[t+0],l=e[t+1],d=e[t+2],p=e[t+3],g=e[t+4],y=e[t+5],b=e[t+6],v=e[t+7],m=e[t+8],w=e[t+9],_=e[t+10],E=e[t+11],S=e[t+12],k=e[t+13],A=e[t+14],T=e[t+15],I=o[0],C=o[1],R=o[2],O=o[3];I=u(I,C,R,O,s,7,a[0]),O=u(O,I,C,R,l,12,a[1]),R=u(R,O,I,C,d,17,a[2]),C=u(C,R,O,I,p,22,a[3]),I=u(I,C,R,O,g,7,a[4]),O=u(O,I,C,R,y,12,a[5]),R=u(R,O,I,C,b,17,a[6]),C=u(C,R,O,I,v,22,a[7]),I=u(I,C,R,O,m,7,a[8]),O=u(O,I,C,R,w,12,a[9]),R=u(R,O,I,C,_,17,a[10]),C=u(C,R,O,I,E,22,a[11]),I=u(I,C,R,O,S,7,a[12]),O=u(O,I,C,R,k,12,a[13]),R=u(R,O,I,C,A,17,a[14]),I=c(I,C=u(C,R,O,I,T,22,a[15]),R,O,l,5,a[16]),O=c(O,I,C,R,b,9,a[17]),R=c(R,O,I,C,E,14,a[18]),C=c(C,R,O,I,s,20,a[19]),I=c(I,C,R,O,y,5,a[20]),O=c(O,I,C,R,_,9,a[21]),R=c(R,O,I,C,T,14,a[22]),C=c(C,R,O,I,g,20,a[23]),I=c(I,C,R,O,w,5,a[24]),O=c(O,I,C,R,A,9,a[25]),R=c(R,O,I,C,p,14,a[26]),C=c(C,R,O,I,m,20,a[27]),I=c(I,C,R,O,k,5,a[28]),O=c(O,I,C,R,d,9,a[29]),R=c(R,O,I,C,v,14,a[30]),I=h(I,C=c(C,R,O,I,S,20,a[31]),R,O,y,4,a[32]),O=h(O,I,C,R,m,11,a[33]),R=h(R,O,I,C,E,16,a[34]),C=h(C,R,O,I,A,23,a[35]),I=h(I,C,R,O,l,4,a[36]),O=h(O,I,C,R,g,11,a[37]),R=h(R,O,I,C,v,16,a[38]),C=h(C,R,O,I,_,23,a[39]),I=h(I,C,R,O,k,4,a[40]),O=h(O,I,C,R,s,11,a[41]),R=h(R,O,I,C,p,16,a[42]),C=h(C,R,O,I,b,23,a[43]),I=h(I,C,R,O,w,4,a[44]),O=h(O,I,C,R,S,11,a[45]),R=h(R,O,I,C,T,16,a[46]),I=f(I,C=h(C,R,O,I,d,23,a[47]),R,O,s,6,a[48]),O=f(O,I,C,R,v,10,a[49]),R=f(R,O,I,C,A,15,a[50]),C=f(C,R,O,I,y,21,a[51]),I=f(I,C,R,O,S,6,a[52]),O=f(O,I,C,R,p,10,a[53]),R=f(R,O,I,C,_,15,a[54]),C=f(C,R,O,I,l,21,a[55]),I=f(I,C,R,O,m,6,a[56]),O=f(O,I,C,R,T,10,a[57]),R=f(R,O,I,C,b,15,a[58]),C=f(C,R,O,I,k,21,a[59]),I=f(I,C,R,O,g,6,a[60]),O=f(O,I,C,R,E,10,a[61]),R=f(R,O,I,C,d,15,a[62]),C=f(C,R,O,I,w,21,a[63]),o[0]=o[0]+I|0,o[1]=o[1]+C|0,o[2]=o[2]+R|0,o[3]=o[3]+O|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),s=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,l=a.words,u=0;u<4;u++){var c=l[u];l[u]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,n,i,o,s){var a=e+(t&r|~t&n)+i+s;return(a<<o|a>>>32-o)+t}function c(e,t,r,n,i,o,s){var a=e+(t&n|r&~n)+i+s;return(a<<o|a>>>32-o)+t}function h(e,t,r,n,i,o,s){var a=e+(t^r^n)+i+s;return(a<<o|a>>>32-o)+t}function f(e,t,r,n,i,o,s){var a=e+(r^(t|~n))+i+s;return(a<<o|a>>>32-o)+t}t.MD5=o._createHelper(l),t.HmacMD5=o._createHmacHelper(l)}(Math),n.MD5)},2169:function(e,t,r){var n;e.exports=(n=r(9021),r(7165),n.mode.CFB=function(){var e=n.lib.BlockCipherMode.extend();function t(e,t,r,n){var i,o=this._iv;o?(i=o.slice(0),this._iv=void 0):i=this._prevBlock,n.encryptBlock(i,0);for(var s=0;s<r;s++)e[t+s]^=i[s]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize;t.call(this,e,r,i,n),this._prevBlock=e.slice(r,r+i)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,o=e.slice(r,r+i);t.call(this,e,r,i,n),this._prevBlock=o}}),e}(),n.mode.CFB)},6372:function(e,t,r){var n;e.exports=(n=r(9021),r(7165),n.mode.CTRGladman=function(){var e=n.lib.BlockCipherMode.extend();function t(e){if(255&~(e>>24))e+=1<<24;else{var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}return e}function r(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var i=e.Encryptor=e.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,o=this._iv,s=this._counter;o&&(s=this._counter=o.slice(0),this._iv=void 0),r(s);var a=s.slice(0);n.encryptBlock(a,0);for(var l=0;l<i;l++)e[t+l]^=a[l]}});return e.Decryptor=i,e}(),n.mode.CTRGladman)},6939:function(e,t,r){var n,i,o;e.exports=(o=r(9021),r(7165),o.mode.CTR=(n=o.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,o=this._counter;i&&(o=this._counter=i.slice(0),this._iv=void 0);var s=o.slice(0);r.encryptBlock(s,0),o[n-1]=o[n-1]+1|0;for(var a=0;a<n;a++)e[t+a]^=s[a]}}),n.Decryptor=i,n),o.mode.CTR)},8454:function(e,t,r){var n,i;e.exports=(i=r(9021),r(7165),i.mode.ECB=((n=i.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),n.Decryptor=n.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),n),i.mode.ECB)},3797:function(e,t,r){var n,i,o;e.exports=(o=r(9021),r(7165),o.mode.OFB=(n=o.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,o=this._keystream;i&&(o=this._keystream=i.slice(0),this._iv=void 0),r.encryptBlock(o,0);for(var s=0;s<n;s++)e[t+s]^=o[s]}}),n.Decryptor=i,n),o.mode.OFB)},2073:function(e,t,r){var n;e.exports=(n=r(9021),r(7165),n.pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,i=n-r%n,o=r+i-1;e.clamp(),e.words[o>>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Ansix923)},4905:function(e,t,r){var n;e.exports=(n=r(9021),r(7165),n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126)},482:function(e,t,r){var n;e.exports=(n=r(9021),r(7165),n.pad.Iso97971={pad:function(e,t){e.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(e,t)},unpad:function(e){n.pad.ZeroPadding.unpad(e),e.sigBytes--}},n.pad.Iso97971)},8124:function(e,t,r){var n;e.exports=(n=r(9021),r(7165),n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)},2155:function(e,t,r){var n;e.exports=(n=r(9021),r(7165),n.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){var t=e.words,r=e.sigBytes-1;for(r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},n.pad.ZeroPadding)},19:function(e,t,r){var n,i,o,s,a,l,u,c,h;e.exports=(h=r(9021),r(3009),r(1025),i=(n=h).lib,o=i.Base,s=i.WordArray,a=n.algo,l=a.SHA256,u=a.HMAC,c=a.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:l,iterations:25e4}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=u.create(r.hasher,e),i=s.create(),o=s.create([1]),a=i.words,l=o.words,c=r.keySize,h=r.iterations;a.length<c;){var f=n.update(t).finalize(o);n.reset();for(var d=f.words,p=d.length,g=f,y=1;y<h;y++){g=n.finalize(g),n.reset();for(var b=g.words,v=0;v<p;v++)d[v]^=b[v]}i.concat(f),l[0]++}return i.sigBytes=4*c,i}}),n.PBKDF2=function(e,t,r){return c.create(r).compute(e,t)},h.PBKDF2)},2696:function(e,t,r){var n;e.exports=(n=r(9021),r(754),r(4636),r(9506),r(7165),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],o=[],s=[],a=r.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)l.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var o=t.words,s=o[0],a=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),h=u>>>16|4294901760&c,f=c<<16|65535&u;for(n[0]^=u,n[1]^=h,n[2]^=c,n[3]^=f,n[4]^=u,n[5]^=h,n[6]^=c,n[7]^=f,i=0;i<4;i++)l.call(this)}},_doProcessBlock:function(e,t){var r=this._X;l.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function l(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,l=((i*i>>>17)+i*a>>>15)+a*a,u=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=l^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=t._createHelper(a)}(),n.RabbitLegacy)},6298:function(e,t,r){var n;e.exports=(n=r(9021),r(754),r(4636),r(9506),r(7165),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],o=[],s=[],a=r.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)l.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var o=t.words,s=o[0],a=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),h=u>>>16|4294901760&c,f=c<<16|65535&u;for(i[0]^=u,i[1]^=h,i[2]^=c,i[3]^=f,i[4]^=u,i[5]^=h,i[6]^=c,i[7]^=f,r=0;r<4;r++)l.call(this)}},_doProcessBlock:function(e,t){var r=this._X;l.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function l(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,a=n>>>16,l=((i*i>>>17)+i*a>>>15)+a*a,u=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=l^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=t._createHelper(a)}(),n.Rabbit)},7193:function(e,t,r){var n;e.exports=(n=r(9021),r(754),r(4636),r(9506),r(7165),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var o=0;i<256;i++){var s=i%r,a=t[s>>>2]>>>24-s%4*8&255;o=(o+n[i]+a)%256;var l=n[i];n[i]=n[o],n[o]=l}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[r],e[r]=o,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var s=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(s)}(),n.RC4)},8056:function(e,t,r){var n;e.exports=(n=r(9021),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.algo,a=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=i.create([0,1518500249,1859775393,2400959708,2840853838]),f=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=s.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,s,d,w,_,E,S,k,A,T,I,C=this._hash.words,R=h.words,O=f.words,M=a.words,P=l.words,x=u.words,B=c.words;for(E=o=C[0],S=s=C[1],k=d=C[2],A=w=C[3],T=_=C[4],r=0;r<80;r+=1)I=o+e[t+M[r]]|0,I+=r<16?p(s,d,w)+R[0]:r<32?g(s,d,w)+R[1]:r<48?y(s,d,w)+R[2]:r<64?b(s,d,w)+R[3]:v(s,d,w)+R[4],I=(I=m(I|=0,x[r]))+_|0,o=_,_=w,w=m(d,10),d=s,s=I,I=E+e[t+P[r]]|0,I+=r<16?v(S,k,A)+O[0]:r<32?b(S,k,A)+O[1]:r<48?y(S,k,A)+O[2]:r<64?g(S,k,A)+O[3]:p(S,k,A)+O[4],I=(I=m(I|=0,B[r]))+T|0,E=T,T=A,A=m(k,10),k=S,S=I;I=C[1]+d+A|0,C[1]=C[2]+w+T|0,C[2]=C[3]+_+E|0,C[3]=C[4]+o+S|0,C[4]=C[0]+s+k|0,C[0]=I},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,s=0;s<5;s++){var a=o[s];o[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,r){return e^t^r}function g(e,t,r){return e&t|~e&r}function y(e,t,r){return(e|~t)^r}function b(e,t,r){return e&r|t&~r}function v(e,t,r){return e^(t|~r)}function m(e,t){return e<<t|e>>>32-t}t.RIPEMD160=o._createHelper(d),t.HmacRIPEMD160=o._createHmacHelper(d)}(Math),n.RIPEMD160)},5471:function(e,t,r){var n,i,o,s,a,l,u,c;e.exports=(c=r(9021),i=(n=c).lib,o=i.WordArray,s=i.Hasher,a=n.algo,l=[],u=a.SHA1=s.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],u=0;u<80;u++){if(u<16)l[u]=0|e[t+u];else{var c=l[u-3]^l[u-8]^l[u-14]^l[u-16];l[u]=c<<1|c>>>31}var h=(n<<5|n>>>27)+a+l[u];h+=u<20?1518500249+(i&o|~i&s):u<40?1859775393+(i^o^s):u<60?(i&o|i&s|o&s)-1894007588:(i^o^s)-899497514,a=s,s=o,o=i<<30|i>>>2,i=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=s._createHelper(u),n.HmacSHA1=s._createHmacHelper(u),c.SHA1)},6308:function(e,t,r){var n,i,o,s,a,l;e.exports=(l=r(9021),r(3009),i=(n=l).lib.WordArray,o=n.algo,s=o.SHA256,a=o.SHA224=s.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=s._createHelper(a),n.HmacSHA224=s._createHmacHelper(a),l.SHA224)},3009:function(e,t,r){var n;e.exports=(n=r(9021),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.algo,a=[],l=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(a[i]=r(e.pow(n,.5))),l[i]=r(e.pow(n,1/3)),i++),n++}();var u=[],c=s.SHA256=o.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],c=r[5],h=r[6],f=r[7],d=0;d<64;d++){if(d<16)u[d]=0|e[t+d];else{var p=u[d-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,y=u[d-2],b=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;u[d]=g+u[d-7]+b+u[d-16]}var v=n&i^n&o^i&o,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=f+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&c^~a&h)+l[d]+u[d];f=h,h=c,c=a,a=s+w|0,s=o,o=i,i=n,n=w+(m+v)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+c|0,r[6]=r[6]+h|0,r[7]=r[7]+f|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(c),t.HmacSHA256=o._createHmacHelper(c)}(Math),n.SHA256)},5953:function(e,t,r){var n;e.exports=(n=r(9021),r(3240),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.x64.Word,a=t.algo,l=[],u=[],c=[];!function(){for(var e=1,t=0,r=0;r<24;r++){l[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var a=0,h=0,f=0;f<7;f++){if(1&i){var d=(1<<f)-1;d<32?h^=1<<d:a^=1<<d-32}128&i?i=i<<1^113:i<<=1}c[o]=s.create(a,h)}}();var h=[];!function(){for(var e=0;e<25;e++)h[e]=s.create()}();var f=a.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new s.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var r=this._state,n=this.blockSize/2,i=0;i<n;i++){var o=e[t+2*i],s=e[t+2*i+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(C=r[i]).high^=s,C.low^=o}for(var a=0;a<24;a++){for(var f=0;f<5;f++){for(var d=0,p=0,g=0;g<5;g++)d^=(C=r[f+5*g]).high,p^=C.low;var y=h[f];y.high=d,y.low=p}for(f=0;f<5;f++){var b=h[(f+4)%5],v=h[(f+1)%5],m=v.high,w=v.low;for(d=b.high^(m<<1|w>>>31),p=b.low^(w<<1|m>>>31),g=0;g<5;g++)(C=r[f+5*g]).high^=d,C.low^=p}for(var _=1;_<25;_++){var E=(C=r[_]).high,S=C.low,k=l[_];k<32?(d=E<<k|S>>>32-k,p=S<<k|E>>>32-k):(d=S<<k-32|E>>>64-k,p=E<<k-32|S>>>64-k);var A=h[u[_]];A.high=d,A.low=p}var T=h[0],I=r[0];for(T.high=I.high,T.low=I.low,f=0;f<5;f++)for(g=0;g<5;g++){var C=r[_=f+5*g],R=h[_],O=h[(f+1)%5+5*g],M=h[(f+2)%5+5*g];C.high=R.high^~O.high&M.high,C.low=R.low^~O.low&M.low}C=r[0];var P=c[a];C.high^=P.high,C.low^=P.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,l=a/8,u=[],c=0;c<l;c++){var h=s[c],f=h.high,d=h.low;f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),u.push(d),u.push(f)}return new i.init(u,a)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=o._createHelper(f),t.HmacSHA3=o._createHmacHelper(f)}(Math),n.SHA3)},9557:function(e,t,r){var n,i,o,s,a,l,u,c;e.exports=(c=r(9021),r(3240),r(1380),i=(n=c).x64,o=i.Word,s=i.WordArray,a=n.algo,l=a.SHA512,u=a.SHA384=l.extend({_doReset:function(){this._hash=new s.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=l._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=l._createHelper(u),n.HmacSHA384=l._createHmacHelper(u),c.SHA384)},1380:function(e,t,r){var n;e.exports=(n=r(9021),r(3240),function(){var e=n,t=e.lib.Hasher,r=e.x64,i=r.Word,o=r.WordArray,s=e.algo;function a(){return i.create.apply(i,arguments)}var l=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=a()}();var c=s.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],c=r[5],h=r[6],f=r[7],d=n.high,p=n.low,g=i.high,y=i.low,b=o.high,v=o.low,m=s.high,w=s.low,_=a.high,E=a.low,S=c.high,k=c.low,A=h.high,T=h.low,I=f.high,C=f.low,R=d,O=p,M=g,P=y,x=b,B=v,L=m,U=w,N=_,j=E,D=S,F=k,W=A,V=T,z=I,H=C,q=0;q<80;q++){var $,K,G=u[q];if(q<16)K=G.high=0|e[t+2*q],$=G.low=0|e[t+2*q+1];else{var Q=u[q-15],Y=Q.high,J=Q.low,X=(Y>>>1|J<<31)^(Y>>>8|J<<24)^Y>>>7,Z=(J>>>1|Y<<31)^(J>>>8|Y<<24)^(J>>>7|Y<<25),ee=u[q-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=u[q-7],se=oe.high,ae=oe.low,le=u[q-16],ue=le.high,ce=le.low;K=(K=(K=X+se+(($=Z+ae)>>>0<Z>>>0?1:0))+ne+(($+=ie)>>>0<ie>>>0?1:0))+ue+(($+=ce)>>>0<ce>>>0?1:0),G.high=K,G.low=$}var he,fe=N&D^~N&W,de=j&F^~j&V,pe=R&M^R&x^M&x,ge=O&P^O&B^P&B,ye=(R>>>28|O<<4)^(R<<30|O>>>2)^(R<<25|O>>>7),be=(O>>>28|R<<4)^(O<<30|R>>>2)^(O<<25|R>>>7),ve=(N>>>14|j<<18)^(N>>>18|j<<14)^(N<<23|j>>>9),me=(j>>>14|N<<18)^(j>>>18|N<<14)^(j<<23|N>>>9),we=l[q],_e=we.high,Ee=we.low,Se=z+ve+((he=H+me)>>>0<H>>>0?1:0),ke=be+ge;z=W,H=V,W=D,V=F,D=N,F=j,N=L+(Se=(Se=(Se=Se+fe+((he+=de)>>>0<de>>>0?1:0))+_e+((he+=Ee)>>>0<Ee>>>0?1:0))+K+((he+=$)>>>0<$>>>0?1:0))+((j=U+he|0)>>>0<U>>>0?1:0)|0,L=x,U=B,x=M,B=P,M=R,P=O,R=Se+(ye+pe+(ke>>>0<be>>>0?1:0))+((O=he+ke|0)>>>0<he>>>0?1:0)|0}p=n.low=p+O,n.high=d+R+(p>>>0<O>>>0?1:0),y=i.low=y+P,i.high=g+M+(y>>>0<P>>>0?1:0),v=o.low=v+B,o.high=b+x+(v>>>0<B>>>0?1:0),w=s.low=w+U,s.high=m+L+(w>>>0<U>>>0?1:0),E=a.low=E+j,a.high=_+N+(E>>>0<j>>>0?1:0),k=c.low=k+F,c.high=S+D+(k>>>0<F>>>0?1:0),T=h.low=T+V,h.high=A+W+(T>>>0<V>>>0?1:0),C=f.low=C+H,f.high=I+z+(C>>>0<H>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(c),e.HmacSHA512=t._createHmacHelper(c)}(),n.SHA512)},7628:function(e,t,r){var n;e.exports=(n=r(9021),r(754),r(4636),r(9506),r(7165),function(){var e=n,t=e.lib,r=t.WordArray,i=t.BlockCipher,o=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],c=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=s[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var u=i[o]=[],c=l[o];for(r=0;r<24;r++)u[r/6|0]|=t[(a[r]-1+c)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(a[r+24]-1+c)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var h=this._invSubKeys=[];for(r=0;r<16;r++)h[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),f.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,s=this._rBlock,a=0,l=0;l<8;l++)a|=u[l][((s^i[l])&c[l])>>>0];this._lBlock=s,this._rBlock=o^a}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,f.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function f(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<<e}function d(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=i._createHelper(h);var p=o.TripleDES=i.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=h.createEncryptor(r.create(t)),this._des2=h.createEncryptor(r.create(n)),this._des3=h.createEncryptor(r.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(p)}(),n.TripleDES)},3240:function(e,t,r){var n;e.exports=(n=r(9021),function(e){var t=n,r=t.lib,i=r.Base,o=r.WordArray,s=t.x64={};s.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),s.WordArray=i.extend({init:function(t,r){t=this.words=t||[],this.sigBytes=r!=e?r:8*t.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var i=e[n];r.push(i.high),r.push(i.low)}return o.create(r,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}})}(),n)},7007:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,r)}(e,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,o,s,u;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,u=c,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function f(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var u=l.length,c=p(l,u);for(r=0;r<u;++r)n(c[r],this,t)}return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,h(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,h(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return f(this,e,!0)},o.prototype.rawListeners=function(e){return f(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+d]=255&s,d+=p,s/=256,u-=8);e[r+d-p]|=128*g}},3790:(e,t,r)=>{e.exports=function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[s]={exports:{}};t[s][0].call(u.exports,(function(e){var r=t[s][1][e];return i(r||e)}),u,u.exports,e,t,r,n)}return r[s].exports}for(var o=void 0,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t,n){(function(e){"use strict";var r,n,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,s=new i(c),a=e.document.createTextNode("");s.observe(a,{characterData:!0}),r=function(){a.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){c(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(c,0)};else{var l=new e.MessageChannel;l.port1.onmessage=c,r=function(){l.port2.postMessage(0)}}var u=[];function c(){var e,t;n=!0;for(var r=u.length;r;){for(t=u,u=[],e=-1;++e<r;)t[e]();r=u.length}n=!1}function h(e){1!==u.push(e)||n||r()}t.exports=h}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,r){"use strict";var n=e(1);function i(){}var o={},s=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==i&&d(this,e)}function c(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function h(e,t,r){n((function(){var n;try{n=t(r)}catch(t){return o.reject(e,t)}n===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,n)}))}function f(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function d(e,t){var r=!1;function n(t){r||(r=!0,o.reject(e,t))}function i(t){r||(r=!0,o.resolve(e,t))}function s(){t(i,n)}var a=p(s);"error"===a.status&&n(a.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}function g(e){return e instanceof this?e:o.resolve(new this(i),e)}function y(e){var t=new this(i);return o.reject(t,e)}function b(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var s=new Array(r),a=0,l=-1,u=new this(i);++l<r;)c(e[l],l);return u;function c(e,i){function l(e){s[i]=e,++a!==r||n||(n=!0,o.resolve(u,s))}t.resolve(e).then(l,(function(e){n||(n=!0,o.reject(u,e))}))}}function v(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var s=-1,a=new this(i);++s<r;)l(e[s]);return a;function l(e){t.resolve(e).then((function(e){n||(n=!0,o.resolve(a,e))}),(function(e){n||(n=!0,o.reject(a,e))}))}}t.exports=u,u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===s)return this;var r=new this.constructor(i);return this.state!==l?h(r,this.state===a?e:t,this.outcome):this.queue.push(new c(r,e,t)),r},c.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},c.prototype.otherCallFulfilled=function(e){h(this.promise,this.onFulfilled,e)},c.prototype.callRejected=function(e){o.reject(this.promise,e)},c.prototype.otherCallRejected=function(e){h(this.promise,this.onRejected,e)},o.resolve=function(e,t){var r=p(f,t);if("error"===r.status)return o.reject(e,r.value);var n=r.value;if(n)d(e,n);else{e.state=a,e.outcome=t;for(var i=-1,s=e.queue.length;++i<s;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=s,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},u.resolve=g,u.reject=y,u.all=b,u.race=v},{1:1}],3:[function(e,t,n){(function(t){"use strict";"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}var s=o();function a(){try{if(!s||!s.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}function l(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var u=Promise;function c(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function h(e,t,r){"function"==typeof t&&e.then(t),"function"==typeof r&&e.catch(r)}function f(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function d(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var p="local-forage-detect-blob-support",g=void 0,y={},b=Object.prototype.toString,v="readonly",m="readwrite";function w(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;i<t;i++)n[i]=e.charCodeAt(i);return r}function _(e){return new u((function(t){var r=e.transaction(p,m),n=l([""]);r.objectStore(p).put(n,"key"),r.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},r.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);t(r||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}function E(e){return"boolean"==typeof g?u.resolve(g):_(e).then((function(e){return g=e}))}function S(e){var t=y[e.name],r={};r.promise=new u((function(e,t){r.resolve=e,r.reject=t})),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then((function(){return r.promise})):t.dbReady=r.promise}function k(e){var t=y[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function A(e,t){var r=y[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function T(e,t){return new u((function(r,n){if(y[e.name]=y[e.name]||U(),e.db){if(!t)return r(e.db);S(e),e.db.close()}var i=[e.name];t&&i.push(e.version);var o=s.open.apply(s,i);t&&(o.onupgradeneeded=function(t){var r=o.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(p)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),o.onerror=function(e){e.preventDefault(),n(o.error)},o.onsuccess=function(){var t=o.result;t.onversionchange=function(e){e.target.close()},r(t),k(e)}}))}function I(e){return T(e,!1)}function C(e){return T(e,!0)}function R(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.version<e.db.version,i=e.version>e.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||r){if(r){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function O(e){return new u((function(t,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");t({__local_forage_encoded_blob:!0,data:n,type:e.type})},n.readAsBinaryString(e)}))}function M(e){return l([w(atob(e.data))],{type:e.type})}function P(e){return e&&e.__local_forage_encoded_blob}function x(e){var t=this,r=t._initReady().then((function(){var e=y[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return h(r,e,e),r}function B(e){S(e);for(var t=y[e.name],r=t.forages,n=0;n<r.length;n++){var i=r[n];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,I(e).then((function(t){return e.db=t,R(e)?C(e):t})).then((function(n){e.db=t.db=n;for(var i=0;i<r.length;i++)r[i]._dbInfo.db=n})).catch((function(t){throw A(e,t),t}))}function L(e,t,r,n){void 0===n&&(n=1);try{var i=e.db.transaction(e.storeName,t);r(null,i)}catch(i){if(n>0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return u.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),C(e)})).then((function(){return B(e).then((function(){L(e,t,r,n-1)}))})).catch(r);r(i)}}function U(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function N(e){var t=this,r={db:null};if(e)for(var n in e)r[n]=e[n];var i=y[r.name];i||(i=U(),y[r.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=x);var o=[];function s(){return u.resolve()}for(var a=0;a<i.forages.length;a++){var l=i.forages[a];l!==t&&o.push(l._initReady().catch(s))}var c=i.forages.slice(0);return u.all(o).then((function(){return r.db=i.db,I(r)})).then((function(e){return r.db=e,R(r,t._defaultConfig.version)?C(r):e})).then((function(e){r.db=i.db=e,t._dbInfo=r;for(var n=0;n<c.length;n++){var o=c[n];o!==t&&(o._dbInfo.db=r.db,o._dbInfo.version=r.version)}}))}function j(e,t){var r=this;e=f(e);var n=new u((function(t,n){r.ready().then((function(){L(r._dbInfo,v,(function(i,o){if(i)return n(i);try{var s=o.objectStore(r._dbInfo.storeName).get(e);s.onsuccess=function(){var e=s.result;void 0===e&&(e=null),P(e)&&(e=M(e)),t(e)},s.onerror=function(){n(s.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function D(e,t){var r=this,n=new u((function(t,n){r.ready().then((function(){L(r._dbInfo,v,(function(i,o){if(i)return n(i);try{var s=o.objectStore(r._dbInfo.storeName).openCursor(),a=1;s.onsuccess=function(){var r=s.result;if(r){var n=r.value;P(n)&&(n=M(n));var i=e(n,r.key,a++);void 0!==i?t(i):r.continue()}else t()},s.onerror=function(){n(s.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function F(e,t,r){var n=this;e=f(e);var i=new u((function(r,i){var o;n.ready().then((function(){return o=n._dbInfo,"[object Blob]"===b.call(t)?E(o.db).then((function(e){return e?t:O(t)})):t})).then((function(t){L(n._dbInfo,m,(function(o,s){if(o)return i(o);try{var a=s.objectStore(n._dbInfo.storeName);null===t&&(t=void 0);var l=a.put(t,e);s.oncomplete=function(){void 0===t&&(t=null),r(t)},s.onabort=s.onerror=function(){var e=l.error?l.error:l.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return c(i,r),i}function W(e,t){var r=this;e=f(e);var n=new u((function(t,n){r.ready().then((function(){L(r._dbInfo,m,(function(i,o){if(i)return n(i);try{var s=o.objectStore(r._dbInfo.storeName).delete(e);o.oncomplete=function(){t()},o.onerror=function(){n(s.error)},o.onabort=function(){var e=s.error?s.error:s.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function V(e){var t=this,r=new u((function(e,r){t.ready().then((function(){L(t._dbInfo,m,(function(n,i){if(n)return r(n);try{var o=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=o.error?o.error:o.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return c(r,e),r}function z(e){var t=this,r=new u((function(e,r){t.ready().then((function(){L(t._dbInfo,v,(function(n,i){if(n)return r(n);try{var o=i.objectStore(t._dbInfo.storeName).count();o.onsuccess=function(){e(o.result)},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return c(r,e),r}function H(e,t){var r=this,n=new u((function(t,n){e<0?t(null):r.ready().then((function(){L(r._dbInfo,v,(function(i,o){if(i)return n(i);try{var s=o.objectStore(r._dbInfo.storeName),a=!1,l=s.openKeyCursor();l.onsuccess=function(){var r=l.result;r?0===e||a?t(r.key):(a=!0,r.advance(e)):t(null)},l.onerror=function(){n(l.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function q(e){var t=this,r=new u((function(e,r){t.ready().then((function(){L(t._dbInfo,v,(function(n,i){if(n)return r(n);try{var o=i.objectStore(t._dbInfo.storeName).openKeyCursor(),s=[];o.onsuccess=function(){var t=o.result;t?(s.push(t.key),t.continue()):e(s)},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return c(r,e),r}function $(e,t){t=d.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var n,i=this;if(e.name){var o=e.name===r.name&&i._dbInfo.db?u.resolve(i._dbInfo.db):I(e).then((function(t){var r=y[e.name],n=r.forages;r.db=t;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=t;return t}));n=e.storeName?o.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var r=t.version+1;S(e);var n=y[e.name],i=n.forages;t.close();for(var o=0;o<i.length;o++){var a=i[o];a._dbInfo.db=null,a._dbInfo.version=r}var l=new u((function(t,n){var i=s.open(e.name,r);i.onerror=function(e){i.result.close(),n(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),t(e)}}));return l.then((function(e){n.db=e;for(var t=0;t<i.length;t++){var r=i[t];r._dbInfo.db=e,k(r._dbInfo)}})).catch((function(t){throw(A(e,t)||u.resolve()).catch((function(){})),t}))}})):o.then((function(t){S(e);var r=y[e.name],n=r.forages;t.close();for(var i=0;i<n.length;i++)n[i]._dbInfo.db=null;var o=new u((function(t,r){var n=s.deleteDatabase(e.name);n.onerror=function(){var e=n.result;e&&e.close(),r(n.error)},n.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},n.onsuccess=function(){var e=n.result;e&&e.close(),t(e)}}));return o.then((function(e){r.db=e;for(var t=0;t<n.length;t++)k(n[t]._dbInfo)})).catch((function(t){throw(A(e,t)||u.resolve()).catch((function(){})),t}))}))}else n=u.reject("Invalid arguments");return c(n,t),n}var K={_driver:"asyncStorage",_initStorage:N,_support:a(),iterate:D,getItem:j,setItem:F,removeItem:W,clear:V,length:z,key:H,keys:q,dropInstance:$};function G(){return"function"==typeof openDatabase}var Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Y="~~local_forage_type~",J=/^~~local_forage_type~([^~]+)~/,X="__lfsc__:",Z=X.length,ee="arbf",te="blob",re="si08",ne="ui08",ie="uic8",oe="si16",se="si32",ae="ur16",le="ui32",ue="fl32",ce="fl64",he=Z+ee.length,fe=Object.prototype.toString;function de(e){var t,r,n,i,o,s=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var u=new ArrayBuffer(s),c=new Uint8Array(u);for(t=0;t<a;t+=4)r=Q.indexOf(e[t]),n=Q.indexOf(e[t+1]),i=Q.indexOf(e[t+2]),o=Q.indexOf(e[t+3]),c[l++]=r<<2|n>>4,c[l++]=(15&n)<<4|i>>2,c[l++]=(3&i)<<6|63&o;return u}function pe(e){var t,r=new Uint8Array(e),n="";for(t=0;t<r.length;t+=3)n+=Q[r[t]>>2],n+=Q[(3&r[t])<<4|r[t+1]>>4],n+=Q[(15&r[t+1])<<2|r[t+2]>>6],n+=Q[63&r[t+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function ge(e,t){var r="";if(e&&(r=fe.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===fe.call(e.buffer))){var n,i=X;e instanceof ArrayBuffer?(n=e,i+=ee):(n=e.buffer,"[object Int8Array]"===r?i+=re:"[object Uint8Array]"===r?i+=ne:"[object Uint8ClampedArray]"===r?i+=ie:"[object Int16Array]"===r?i+=oe:"[object Uint16Array]"===r?i+=ae:"[object Int32Array]"===r?i+=se:"[object Uint32Array]"===r?i+=le:"[object Float32Array]"===r?i+=ue:"[object Float64Array]"===r?i+=ce:t(new Error("Failed to get type for BinaryArray"))),t(i+pe(n))}else if("[object Blob]"===r){var o=new FileReader;o.onload=function(){var r=Y+e.type+"~"+pe(this.result);t(X+te+r)},o.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}}function ye(e){if(e.substring(0,Z)!==X)return JSON.parse(e);var t,r=e.substring(he),n=e.substring(Z,he);if(n===te&&J.test(r)){var i=r.match(J);t=i[1],r=r.substring(i[0].length)}var o=de(r);switch(n){case ee:return o;case te:return l([o],{type:t});case re:return new Int8Array(o);case ne:return new Uint8Array(o);case ie:return new Uint8ClampedArray(o);case oe:return new Int16Array(o);case ae:return new Uint16Array(o);case se:return new Int32Array(o);case le:return new Uint32Array(o);case ue:return new Float32Array(o);case ce:return new Float64Array(o);default:throw new Error("Unkown type: "+n)}}var be={serialize:ge,deserialize:ye,stringToBuffer:de,bufferToString:pe};function ve(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function me(e){var t=this,r={db:null};if(e)for(var n in e)r[n]="string"!=typeof e[n]?e[n].toString():e[n];var i=new u((function(e,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(e){return n(e)}r.db.transaction((function(i){ve(i,r,(function(){t._dbInfo=r,e()}),(function(e,t){n(t)}))}),n)}));return r.serializer=be,i}function we(e,t,r,n,i,o){e.executeSql(r,n,i,(function(e,s){s.code===s.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,a){a.rows.length?o(e,s):ve(e,t,(function(){e.executeSql(r,n,i,o)}),o)}),o):o(e,s)}),o)}function _e(e,t){var r=this;e=f(e);var n=new u((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){we(r,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=i.serializer.deserialize(n)),t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function Ee(e,t){var r=this,n=new u((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){we(r,i,"SELECT * FROM "+i.storeName,[],(function(r,n){for(var o=n.rows,s=o.length,a=0;a<s;a++){var l=o.item(a),u=l.value;if(u&&(u=i.serializer.deserialize(u)),void 0!==(u=e(u,l.key,a+1)))return void t(u)}t()}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function Se(e,t,r,n){var i=this;e=f(e);var o=new u((function(o,s){i.ready().then((function(){void 0===t&&(t=null);var a=t,l=i._dbInfo;l.serializer.serialize(t,(function(t,u){u?s(u):l.db.transaction((function(r){we(r,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){o(a)}),(function(e,t){s(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(n>0)return void o(Se.apply(i,[e,a,r,n-1]));s(t)}}))}))})).catch(s)}));return c(o,r),o}function ke(e,t,r){return Se.apply(this,[e,t,r,1])}function Ae(e,t){var r=this;e=f(e);var n=new u((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){we(r,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function Te(e){var t=this,r=new u((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"DELETE FROM "+n.storeName,[],(function(){e()}),(function(e,t){r(t)}))}))})).catch(r)}));return c(r,e),r}function Ie(e){var t=this,r=new u((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],(function(t,r){var n=r.rows.item(0).c;e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return c(r,e),r}function Ce(e,t){var r=this,n=new u((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){we(r,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,r){var n=r.rows.length?r.rows.item(0).key:null;t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function Re(e){var t=this,r=new u((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"SELECT key FROM "+n.storeName,[],(function(t,r){for(var n=[],i=0;i<r.rows.length;i++)n.push(r.rows.item(i).key);e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return c(r,e),r}function Oe(e){return new u((function(t,r){e.transaction((function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(r,n){for(var i=[],o=0;o<n.rows.length;o++)i.push(n.rows.item(o).name);t({db:e,storeNames:i})}),(function(e,t){r(t)}))}),(function(e){r(e)}))}))}function Me(e,t){t=d.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var n,i=this;return c(n=e.name?new u((function(t){var n;n=e.name===r.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:n,storeNames:[e.storeName]}):t(Oe(n))})).then((function(e){return new u((function(t,r){e.db.transaction((function(n){function i(e){return new u((function(t,r){n.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){r(t)}))}))}for(var o=[],s=0,a=e.storeNames.length;s<a;s++)o.push(i(e.storeNames[s]));u.all(o).then((function(){t()})).catch((function(e){r(e)}))}),(function(e){r(e)}))}))})):u.reject("Invalid arguments"),t),n}var Pe={_driver:"webSQLStorage",_initStorage:me,_support:G(),iterate:Ee,getItem:_e,setItem:ke,removeItem:Ae,clear:Te,length:Ie,key:Ce,keys:Re,dropInstance:Me};function xe(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}function Be(e,t){var r=e.name+"/";return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}function Le(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}function Ue(){return!Le()||localStorage.length>0}function Ne(e){var t=this,r={};if(e)for(var n in e)r[n]=e[n];return r.keyPrefix=Be(e,t._defaultConfig),Ue()?(t._dbInfo=r,r.serializer=be,u.resolve()):u.reject()}function je(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return c(r,e),r}function De(e,t){var r=this;e=f(e);var n=r.ready().then((function(){var t=r._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n}));return c(n,t),n}function Fe(e,t){var r=this,n=r.ready().then((function(){for(var t=r._dbInfo,n=t.keyPrefix,i=n.length,o=localStorage.length,s=1,a=0;a<o;a++){var l=localStorage.key(a);if(0===l.indexOf(n)){var u=localStorage.getItem(l);if(u&&(u=t.serializer.deserialize(u)),void 0!==(u=e(u,l.substring(i),s++)))return u}}}));return c(n,t),n}function We(e,t){var r=this,n=r.ready().then((function(){var t,n=r._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t}));return c(n,t),n}function Ve(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo,r=localStorage.length,n=[],i=0;i<r;i++){var o=localStorage.key(i);0===o.indexOf(e.keyPrefix)&&n.push(o.substring(e.keyPrefix.length))}return n}));return c(r,e),r}function ze(e){var t=this.keys().then((function(e){return e.length}));return c(t,e),t}function He(e,t){var r=this;e=f(e);var n=r.ready().then((function(){var t=r._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return c(n,t),n}function qe(e,t,r){var n=this;e=f(e);var i=n.ready().then((function(){void 0===t&&(t=null);var r=t;return new u((function(i,o){var s=n._dbInfo;s.serializer.serialize(t,(function(t,n){if(n)o(n);else try{localStorage.setItem(s.keyPrefix+e,t),i(r)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||o(e),o(e)}}))}))}));return c(i,r),i}function $e(e,t){if(t=d.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var r=this.config();e.name=e.name||r.name,e.storeName=e.storeName||r.storeName}var n,i=this;return n=e.name?new u((function(t){e.storeName?t(Be(e,i._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}})):u.reject("Invalid arguments"),c(n,t),n}var Ke={_driver:"localStorageWrapper",_initStorage:Ne,_support:xe(),iterate:Fe,getItem:De,setItem:qe,removeItem:He,clear:je,length:ze,key:We,keys:Ve,dropInstance:$e},Ge=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Qe=function(e,t){for(var r=e.length,n=0;n<r;){if(Ge(e[n],t))return!0;n++}return!1},Ye=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Je={},Xe={},Ze={INDEXEDDB:K,WEBSQL:Pe,LOCALSTORAGE:Ke},et=[Ze.INDEXEDDB._driver,Ze.WEBSQL._driver,Ze.LOCALSTORAGE._driver],tt=["dropInstance"],rt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(tt),nt={description:"",driver:et.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function it(e,t){e[t]=function(){var r=arguments;return e.ready().then((function(){return e[t].apply(e,r)}))}}function ot(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var r in t)t.hasOwnProperty(r)&&(Ye(t[r])?arguments[0][r]=t[r].slice():arguments[0][r]=t[r])}return arguments[0]}var st=function(){function e(t){for(var r in i(this,e),Ze)if(Ze.hasOwnProperty(r)){var n=Ze[r],o=n._driver;this[r]=o,Je[o]||this.defineDriver(n)}this._defaultConfig=ot({},nt),this._config=ot({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":n(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,r){var n=new u((function(t,r){try{var n=e._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void r(i);for(var o=rt.concat("_initStorage"),s=0,a=o.length;s<a;s++){var l=o[s];if((!Qe(tt,l)||e[l])&&"function"!=typeof e[l])return void r(i)}var h=function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),r=u.reject(t);return c(r,arguments[arguments.length-1]),r}},r=0,n=tt.length;r<n;r++){var i=tt[r];e[i]||(e[i]=t(i))}};h();var f=function(r){Je[n]&&console.info("Redefining LocalForage driver: "+n),Je[n]=e,Xe[n]=r,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(f,r):f(!!e._support):f(!0)}catch(e){r(e)}}));return h(n,t,r),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,r){var n=Je[e]?u.resolve(Je[e]):u.reject(new Error("Driver not found."));return h(n,t,r),n},e.prototype.getSerializer=function(e){var t=u.resolve(be);return h(t,e),t},e.prototype.ready=function(e){var t=this,r=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return h(r,e,e),r},e.prototype.setDriver=function(e,t,r){var n=this;Ye(e)||(e=[e]);var i=this._getSupportedDrivers(e);function o(){n._config.driver=n.driver()}function s(e){return n._extend(e),o(),n._ready=n._initStorage(n._config),n._ready}function a(e){return function(){var t=0;function r(){for(;t<e.length;){var i=e[t];return t++,n._dbInfo=null,n._ready=null,n.getDriver(i).then(s).catch(r)}o();var a=new Error("No available storage method found.");return n._driverSet=u.reject(a),n._driverSet}return r()}}var l=null!==this._driverSet?this._driverSet.catch((function(){return u.resolve()})):u.resolve();return this._driverSet=l.then((function(){var e=i[0];return n._dbInfo=null,n._ready=null,n.getDriver(e).then((function(e){n._driver=e._driver,o(),n._wrapLibraryMethodsWithReady(),n._initDriver=a(i)}))})).catch((function(){o();var e=new Error("No available storage method found.");return n._driverSet=u.reject(e),n._driverSet})),h(this._driverSet,t,r),this._driverSet},e.prototype.supports=function(e){return!!Xe[e]},e.prototype._extend=function(e){ot(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],r=0,n=e.length;r<n;r++){var i=e[r];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=rt.length;e<t;e++)it(this,rt[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),at=new st;t.exports=at},{3:3}]},{},[4])(4)},3061:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>Ds});var n,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l=(e,t)=>()=>(e&&(t=e(e=0)),t),u=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},h=e=>((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of s(t))!a.call(e,l)&&l!==r&&i(e,l,{get:()=>t[l],enumerable:!(n=o(t,l))||n.enumerable});return e})(i({},"__esModule",{value:!0}),e),f=l((()=>{n={deviceMemory:8,hardwareConcurrency:8,language:"en-US"}})),d={};function p(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function g(){!M||!P||(M=!1,P.length?O=P.concat(O):x=-1,O.length&&y())}function y(){if(!M){var e=setTimeout(g,0);M=!0;for(var t=O.length;t;){for(P=O,O=[];++x<t;)P&&P[x].run();x=-1,t=O.length}P=null,M=!1,clearTimeout(e)}}function b(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];O.push(new v(e,t)),1===O.length&&!M&&setTimeout(y,0)}function v(e,t){this.fun=e,this.array=t}function m(){}function w(e){p("_linkedBinding")}function _(e){p("dlopen")}function E(){return[]}function S(){return[]}function k(e,t){if(!e)throw new Error(t||"assertion error")}function A(){return!1}function T(){return Ie.now()/1e3}function I(e){var t=Math.floor(.001*(Date.now()-Ie.now())),r=.001*Ie.now(),n=Math.floor(r)+t,i=Math.floor(r%1*1e9);return e&&(n-=e[0],(i-=e[1])<0&&(n--,i+=Re)),[n,i]}function C(){return We}function R(e){return[]}c(d,{_debugEnd:()=>de,_debugProcess:()=>fe,_events:()=>Me,_eventsCount:()=>Pe,_exiting:()=>J,_fatalExceptions:()=>ue,_getActiveHandles:()=>S,_getActiveRequests:()=>E,_kill:()=>ee,_linkedBinding:()=>w,_maxListeners:()=>Oe,_preload_modules:()=>Ae,_rawDebug:()=>G,_startProfilerIdleNotifier:()=>pe,_stopProfilerIdleNotifier:()=>ge,_tickCallback:()=>he,abort:()=>me,addListener:()=>xe,allowedNodeEnvironmentFlags:()=>ae,arch:()=>L,argv:()=>j,argv0:()=>ke,assert:()=>k,binding:()=>z,chdir:()=>$,config:()=>X,cpuUsage:()=>te,cwd:()=>q,debugPort:()=>Se,default:()=>We,dlopen:()=>_,domain:()=>Y,emit:()=>je,emitWarning:()=>V,env:()=>N,execArgv:()=>D,execPath:()=>Ee,exit:()=>oe,features:()=>le,hasUncaughtExceptionCaptureCallback:()=>A,hrtime:()=>I,kill:()=>ie,listeners:()=>R,memoryUsage:()=>ne,moduleLoadList:()=>Q,nextTick:()=>b,off:()=>Le,on:()=>C,once:()=>Be,openStdin:()=>se,pid:()=>we,platform:()=>U,ppid:()=>_e,prependListener:()=>De,prependOnceListener:()=>Fe,reallyExit:()=>Z,release:()=>K,removeAllListeners:()=>Ne,removeListener:()=>Ue,resourceUsage:()=>re,setSourceMapsEnabled:()=>Te,setUncaughtExceptionCaptureCallback:()=>ce,stderr:()=>be,stdin:()=>ve,stdout:()=>ye,title:()=>B,umask:()=>H,uptime:()=>T,version:()=>F,versions:()=>W});var O,M,P,x,B,L,U,N,j,D,F,W,V,z,H,q,$,K,G,Q,Y,J,X,Z,ee,te,re,ne,ie,oe,se,ae,le,ue,ce,he,fe,de,pe,ge,ye,be,ve,me,we,_e,Ee,Se,ke,Ae,Te,Ie,Ce,Re,Oe,Me,Pe,xe,Be,Le,Ue,Ne,je,De,Fe,We,Ve=l((()=>{nt(),ze(),f(),O=[],M=!1,x=-1,v.prototype.run=function(){this.fun.apply(null,this.array)},B="browser",L="x64",U="browser",N={PATH:"/usr/bin",LANG:n.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},j=["/usr/bin/node"],D=[],F="v16.8.0",W={},V=function(e,t){console.warn((t?t+": ":"")+e)},z=function(e){p("binding")},H=function(e){return 0},q=function(){return"/"},$=function(e){},K={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},G=m,Q=[],Y={},J=!1,X={},Z=m,ee=m,re=te=function(){return{}},ne=te,ie=m,oe=m,se=m,ae={},le={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ue=m,ce=m,he=m,fe=m,de=m,pe=m,ge=m,ye=void 0,be=void 0,ve=void 0,me=m,we=2,_e=1,Ee="/bin/usr/node",Se=9229,ke="node",Ae=[],Te=m,void 0===(Ie={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0}).now&&(Ce=Date.now(),Ie.timing&&Ie.timing.navigationStart&&(Ce=Ie.timing.navigationStart),Ie.now=()=>Date.now()-Ce),Re=1e9,I.bigint=function(e){var t=I(e);return typeof BigInt>"u"?t[0]*Re+t[1]:BigInt(t[0]*Re)+BigInt(t[1])},We={version:F,versions:W,arch:L,platform:U,release:K,_rawDebug:G,moduleLoadList:Q,binding:z,_linkedBinding:w,_events:Me={},_eventsCount:Pe=0,_maxListeners:Oe=10,on:C,addListener:xe=C,once:Be=C,off:Le=C,removeListener:Ue=C,removeAllListeners:Ne=C,emit:je=m,prependListener:De=C,prependOnceListener:Fe=C,listeners:R,domain:Y,_exiting:J,config:X,dlopen:_,uptime:T,_getActiveRequests:E,_getActiveHandles:S,reallyExit:Z,_kill:ee,cpuUsage:te,resourceUsage:re,memoryUsage:ne,kill:ie,exit:oe,openStdin:se,allowedNodeEnvironmentFlags:ae,assert:k,features:le,_fatalExceptions:ue,setUncaughtExceptionCaptureCallback:ce,hasUncaughtExceptionCaptureCallback:A,emitWarning:V,nextTick:b,_tickCallback:he,_debugProcess:fe,_debugEnd:de,_startProfilerIdleNotifier:pe,_stopProfilerIdleNotifier:ge,stdout:ye,stdin:ve,stderr:be,abort:me,umask:H,chdir:$,cwd:q,env:N,title:B,argv:j,execArgv:D,pid:we,ppid:_e,execPath:Ee,debugPort:Se,hrtime:I,argv0:ke,_preload_modules:Ae,setSourceMapsEnabled:Te}})),ze=l((()=>{Ve()})),He={};function qe(){if(Je)return Ye;Je=!0;let e=function(){if(Ke)return $e;Ke=!0,$e.byteLength=function(e){var t=o(e),r=t[0],n=t[1];return 3*(r+n)/4-n},$e.toByteArray=function(e){var n,i,s=o(e),a=s[0],l=s[1],u=new r(function(e,t,r){return 3*(t+r)/4-r}(0,a,l)),c=0,h=l>0?a-4:a;for(i=0;i<h;i+=4)n=t[e.charCodeAt(i)]<<18|t[e.charCodeAt(i+1)]<<12|t[e.charCodeAt(i+2)]<<6|t[e.charCodeAt(i+3)],u[c++]=n>>16&255,u[c++]=n>>8&255,u[c++]=255&n;return 2===l&&(n=t[e.charCodeAt(i)]<<2|t[e.charCodeAt(i+1)]>>4,u[c++]=255&n),1===l&&(n=t[e.charCodeAt(i)]<<10|t[e.charCodeAt(i+1)]<<4|t[e.charCodeAt(i+2)]>>2,u[c++]=n>>8&255,u[c++]=255&n),u},$e.fromByteArray=function(t){for(var r,n=t.length,i=n%3,o=[],s=16383,l=0,u=n-i;l<u;l+=s)o.push(a(t,l,l+s>u?u:l+s));return 1===i?(r=t[n-1],o.push(e[r>>2]+e[r<<4&63]+"==")):2===i&&(r=(t[n-2]<<8)+t[n-1],o.push(e[r>>10]+e[r>>4&63]+e[r<<2&63]+"=")),o.join("")};for(var e=[],t=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)e[i]=n[i],t[n.charCodeAt(i)]=i;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(t){return e[t>>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function a(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(s(n));return i.join("")}return t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63,$e}(),t=(Qe||(Qe=!0,Ge.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},Ge.write=function(e,t,r,n,i,o){var s,a,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+d]=255&s,d+=p,s/=256,u-=8);e[r+d-p]|=128*g}),Ge),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;Ye.Buffer=o,Ye.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},Ye.INSPECT_MAX_BYTES=50;let n=2147483647;function i(e){if(e>n)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=0|f(e,t),n=i(r),s=n.write(e,t);return s!==r&&(n=n.slice(0,s)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){let t=new Uint8Array(e);return c(t.buffer,t.byteOffset,t.byteLength)}return u(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return c(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);let s=function(e){if(o.isBuffer(e)){let t=0|h(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||K(e.length)?i(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(s)return s;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return a(e),i(e<0?0:0|h(e))}function u(e){let t=e.length<0?0:0|h(e.length),r=i(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function c(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,o.prototype),n}function h(e){if(e>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|e}function f(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function p(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),K(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){let o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function b(e,t,r,n){r=Number(r)||0;let i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;let o,s=t.length;for(n>s/2&&(n=s/2),o=0;o<n;++o){let n=parseInt(t.substr(2*o,2),16);if(K(n))return o;e[r+o]=n}return o}function v(e,t,r,n){return q(z(t,e.length-r),e,r,n)}function m(e,t,r,n){return q(function(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function w(e,t,r,n){return q(H(t),e,r,n)}function _(e,t,r,n){return q(function(e,t){let r,n,i,o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function E(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function S(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(o=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){let t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}Ye.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&"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(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return s(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return function(e,t,r){return a(e),e<=0?i(e):void 0!==t?"string"==typeof r?i(e).fill(t,r):i(e).fill(t):i(e)}(e,t,r)},o.allocUnsafe=function(e){return l(e)},o.allocUnsafeSlow=function(e){return l(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if($(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;let n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if($(t,Uint8Array))i+t.length>n.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!o.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},o.byteLength=f,o.prototype._isBuffer=!0,o.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)p(this,t,t+1);return this},o.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)p(this,t,t+3),p(this,t+1,t+2);return this},o.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)p(this,t,t+7),p(this,t+1,t+6),p(this,t+2,t+5),p(this,t+3,t+4);return this},o.prototype.toString=function(){let e=this.length;return 0===e?"":0===arguments.length?S(this,0,e):d.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){let e="",t=Ye.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if($(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),l=Math.min(s,a),u=this.slice(n,i),c=e.slice(t,r);for(let e=0;e<l;++e)if(u[e]!==c[e]){s=u[e],a=c[e];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}let i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":case"latin1":case"binary":return m(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};let k=4096;function A(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function T(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function I(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=G[e[n]];return i}function C(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function R(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,r,n,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function M(e,t,r,n,i){D(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function P(e,t,r,n,i){D(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function x(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,r,n,i,o){return r=+r,n>>>=0,o||x(e,0,n,4),t.write(e,r,n,i,23,4),n+4}function L(e,r,n,i,o){return r=+r,n>>>=0,o||x(e,0,n,8),t.write(e,r,n,i,52,8),n+8}o.prototype.slice=function(e,t){let r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=Q((function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),o.prototype.readBigUInt64BE=Q((function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=Q((function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),o.prototype.readBigInt64BE=Q((function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),o.prototype.readFloatLE=function(e,r){return e>>>=0,r||R(e,4,this.length),t.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,r){return e>>>=0,r||R(e,4,this.length),t.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,r){return e>>>=0,r||R(e,8,this.length),t.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,r){return e>>>=0,r||R(e,8,this.length),t.read(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){O(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){O(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigUInt64LE=Q((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=Q((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);O(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigInt64LE=Q((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=Q((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&0!==n&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{let s=o.isBuffer(e)?e:o.from(e,n),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this};let U={};function N(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function j(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function D(e,t,r,n,i,o){if(e>r||e<t){let n,i="bigint"==typeof t?"n":"";throw n=o>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(o+1)}${i}`:`>= -(2${i} ** ${8*(o+1)-1}${i}) and < 2 ** ${8*(o+1)-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new U.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,r){F(t,"offset"),(void 0===e[t]||void 0===e[t+r])&&W(t,e.length-(r+1))}(n,i,o)}function F(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,r){throw Math.floor(e)!==e?(F(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new U.ERR_BUFFER_OUT_OF_BOUNDS:new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}N("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),N("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),N("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=j(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=j(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);let V=/[^+/0-9A-Za-z-_]/g;function z(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){return e.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(t))}function q(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function K(e){return e!=e}let G=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Q(e){return typeof BigInt>"u"?Y:e}function Y(){throw new Error("BigInt not supported")}return Ye}c(He,{Buffer:()=>Ze,INSPECT_MAX_BYTES:()=>et,default:()=>Xe,kMaxLength:()=>tt});var $e,Ke,Ge,Qe,Ye,Je,Xe,Ze,et,tt,rt=l((()=>{nt(),ze(),f(),$e={},Ke=!1,Ge={},Qe=!1,Ye={},Je=!1,(Xe=qe()).Buffer,Xe.SlowBuffer,Xe.INSPECT_MAX_BYTES,Xe.kMaxLength,Ze=Xe.Buffer,et=Xe.INSPECT_MAX_BYTES,tt=Xe.kMaxLength})),nt=l((()=>{rt()})),it=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(e){this.aliasToTopic={},this.max=e}put(e,t){return!(0===t||t>this.max)&&(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(e){return this.aliasToTopic[e]}clear(){this.aliasToTopic={}}}})),ot=u(((e,t)=>{nt(),ze(),f(),t.exports={ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Uint8Array}})),st=u(((e,t)=>{nt(),ze(),f();var r=(rt(),h(He)),n=Object.getPrototypeOf((async function(){})).constructor,i=globalThis.Blob||r.Blob,o=typeof i<"u"?function(e){return e instanceof i}:function(e){return!1},s=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let r=0;r<e.length;r++)t+=` ${e[r].stack}\n`;super(t),this.name="AggregateError",this.errors=e}};t.exports={AggregateError:s,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise(((r,n)=>{e=r,t=n})),resolve:e,reject:t}},promisify:e=>new Promise(((t,r)=>{e(((e,...n)=>e?r(e):t(...n)))})),debuglog:()=>function(){},format:(e,...t)=>e.replace(/%([sdifj])/g,(function(...[e,r]){let n=t.shift();return"f"===r?n.toFixed(6):"j"===r?JSON.stringify(n):"s"===r&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},types:{isAsyncFunction:e=>e instanceof n,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:o},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})),at=u(((e,t)=>{nt(),ze(),f();var{AbortController:r,AbortSignal:n}=typeof self<"u"?self:typeof window<"u"?window:void 0;t.exports=r,t.exports.AbortSignal=n,t.exports.default=r})),lt=u(((e,t)=>{nt(),ze(),f();var{format:r,inspect:n,AggregateError:i}=st(),o=globalThis.AggregateError||i,s=Symbol("kIsNodeError"),a=["string","function","number","object","Function","Object","boolean","bigint","symbol"],l=/^([A-Z][a-z0-9]*)+$/,u={};function c(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function h(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function d(e,t,n){n||(n=Error);class i extends n{constructor(...n){super(function(e,t,n){if("function"==typeof t)return c(t.length<=n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${t.length}).`),t(...n);let i=(t.match(/%[dfijoOs]/g)||[]).length;return c(i===n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${i}).`),0===n.length?t:r(t,...n)}(e,t,n))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[s]=!0,u[e]=i}function p(e){let t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}var g=class extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new u.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}};d("ERR_ASSERTION","%s",Error),d("ERR_INVALID_ARG_TYPE",((e,t,r)=>{c("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let i="The ";e.endsWith(" argument")?i+=`${e} `:i+=`"${e}" ${e.includes(".")?"property":"argument"} `,i+="must be ";let o=[],s=[],u=[];for(let e of t)c("string"==typeof e,"All expected entries have to be of type string"),a.includes(e)?o.push(e.toLowerCase()):l.test(e)?s.push(e):(c("object"!==e,'The value "object" should be written as "Object"'),u.push(e));if(s.length>0){let e=o.indexOf("object");-1!==e&&(o.splice(o,e,1),s.push("Object"))}if(o.length>0){switch(o.length){case 1:i+=`of type ${o[0]}`;break;case 2:i+=`one of type ${o[0]} or ${o[1]}`;break;default:{let e=o.pop();i+=`one of type ${o.join(", ")}, or ${e}`}}(s.length>0||u.length>0)&&(i+=" or ")}if(s.length>0){switch(s.length){case 1:i+=`an instance of ${s[0]}`;break;case 2:i+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let e=s.pop();i+=`an instance of ${s.join(", ")}, or ${e}`}}u.length>0&&(i+=" or ")}switch(u.length){case 0:break;case 1:u[0].toLowerCase()!==u[0]&&(i+="an "),i+=`${u[0]}`;break;case 2:i+=`one of ${u[0]} or ${u[1]}`;break;default:{let e=u.pop();i+=`one of ${u.join(", ")}, or ${e}`}}if(null==r)i+=`. Received ${r}`;else if("function"==typeof r&&r.name)i+=`. Received function ${r.name}`;else if("object"==typeof r){var h;if(null!==(h=r.constructor)&&void 0!==h&&h.name)i+=`. Received an instance of ${r.constructor.name}`;else{i+=`. Received ${n(r,{depth:-1})}`}}else{let e=n(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),i+=`. Received type ${typeof r} (${e})`}return i}),TypeError),d("ERR_INVALID_ARG_VALUE",((e,t,r="is invalid")=>{let i=n(t);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${i}`}),TypeError),d("ERR_INVALID_RETURN_VALUE",((e,t,r)=>{var n;return`Expected ${e} to be returned from the "${t}" function but got ${null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?`instance of ${r.constructor.name}`:"type "+typeof r}.`}),TypeError),d("ERR_MISSING_ARGS",((...e)=>{c(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map((e=>`"${e}"`)).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`}),TypeError),d("ERR_OUT_OF_RANGE",((e,t,r)=>{let i;return c(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32?i=h(String(r)):"bigint"==typeof r?(i=String(r),(r>2n**32n||r<-(2n**32n))&&(i=h(i)),i+="n"):i=n(r),`The value of "${e}" is out of range. It must be ${t}. Received ${i}`}),RangeError),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),d("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),d("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),d("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),d("ERR_STREAM_WRITE_AFTER_END","write after end",Error),d("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:g,aggregateTwoErrors:p((function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new o([t,e],t.message);return r.code=t.code,r}return e||t})),hideStackFrames:p,codes:u}})),ut=u(((e,t)=>{nt(),ze(),f();var{ArrayIsArray:r,ArrayPrototypeIncludes:n,ArrayPrototypeJoin:i,ArrayPrototypeMap:o,NumberIsInteger:s,NumberIsNaN:a,NumberMAX_SAFE_INTEGER:l,NumberMIN_SAFE_INTEGER:u,NumberParseInt:c,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:d,String:p,StringPrototypeToUpperCase:g,StringPrototypeTrim:y}=ot(),{hideStackFrames:b,codes:{ERR_SOCKET_BAD_PORT:v,ERR_INVALID_ARG_TYPE:m,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:E}}=lt(),{normalizeEncoding:S}=st(),{isAsyncFunction:k,isArrayBufferView:A}=st().types,T={};var I=/^[0-7]+$/;var C=b(((e,t,r=u,n=l)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!s(e))throw new _(t,"an integer",e);if(e<r||e>n)throw new _(t,`>= ${r} && <= ${n}`,e)})),R=b(((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!s(e))throw new _(t,"an integer",e);if(e<r||e>n)throw new _(t,`>= ${r} && <= ${n}`,e)})),O=b(((e,t,r=!1)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!s(e))throw new _(t,"an integer",e);let n=r?1:0,i=4294967295;if(e<n||e>i)throw new _(t,`>= ${n} && <= ${i}`,e)}));function M(e,t){if("string"!=typeof e)throw new m(t,"string",e)}var P=b(((e,t,r)=>{if(!n(r,e)){let n="must be one of: "+i(o(r,(e=>"string"==typeof e?`'${e}'`:p(e))),", ");throw new w(t,e,n)}}));function x(e,t){if("boolean"!=typeof e)throw new m(t,"boolean",e)}function B(e,t,r){return null!=e&&h(e,t)?e[t]:r}var L=b(((e,t,n=null)=>{let i=B(n,"allowArray",!1),o=B(n,"allowFunction",!1);if(!B(n,"nullable",!1)&&null===e||!i&&r(e)||"object"!=typeof e&&(!o||"function"!=typeof e))throw new m(t,"Object",e)})),U=b(((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new m(t,"a dictionary",e)})),N=b(((e,t,n=0)=>{if(!r(e))throw new m(t,"Array",e);if(e.length<n){throw new w(t,e,`must be longer than ${n}`)}}));var j=b(((e,t="buffer")=>{if(!A(e))throw new m(t,["Buffer","TypedArray","DataView"],e)}));var D=b(((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new m(t,"AbortSignal",e)})),F=b(((e,t)=>{if("function"!=typeof e)throw new m(t,"Function",e)})),W=b(((e,t)=>{if("function"!=typeof e||k(e))throw new m(t,"Function",e)})),V=b(((e,t)=>{if(void 0!==e)throw new m(t,"undefined",e)}));var z=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function H(e,t){if(typeof e>"u"||!d(z,e))throw new w(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}t.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(typeof e>"u"&&(e=r),"string"==typeof e){if(null===d(I,e))throw new w(t,e,"must be a 32-bit unsigned integer or an octal string");e=c(e,8)}return O(e,t),e},validateArray:N,validateStringArray:function(e,t){N(e,t);for(let r=0;r<e.length;r++)M(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){N(e,t);for(let r=0;r<e.length;r++)x(e[r],`${t}[${r}]`)},validateBoolean:x,validateBuffer:j,validateDictionary:U,validateEncoding:function(e,t){let r=S(t),n=e.length;if("hex"===r&&n%2!=0)throw new w("encoding",t,`is invalid for data of length ${n}`)},validateFunction:F,validateInt32:R,validateInteger:C,validateNumber:function(e,t,r=void 0,n){if("number"!=typeof e)throw new m(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&a(e))throw new _(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:L,validateOneOf:P,validatePlainFunction:W,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===y(e).length||+e!=+e>>>0||e>65535||0===e&&!r)throw new v(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(M(e,t),void 0===T[e])throw void 0!==T[g(e)]?new E(e+" (signals must use all capital letters)"):new E(e)},validateString:M,validateUint32:O,validateUndefined:V,validateUnion:function(e,t,r){if(!n(r,e))throw new m(t,`('${i(r,"|")}')`,e)},validateAbortSignal:D,validateLinkHeaderValue:function(e){if("string"==typeof e)return H(e,"hints"),e;if(r(e)){let t=e.length,r="";if(0===t)return r;for(let n=0;n<t;n++){let i=e[n];H(i,"hints"),r+=i,n!==t-1&&(r+=", ")}return r}throw new w("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}})),ct=u(((e,t)=>{nt(),ze(),f();var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch{try{return r.call(null,e,0)}catch{return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch{r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch{n=s}}();var l,u=[],c=!1,h=-1;function d(){!c||!l||(c=!1,l.length?u=l.concat(u):h=-1,u.length&&p())}function p(){if(!c){var e=a(d);c=!0;for(var t=u.length;t;){for(l=u,u=[];++h<t;)l&&l[h].run();h=-1,t=u.length}l=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch{try{return n.call(null,e)}catch{return n.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function y(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new g(e,t)),1===u.length&&!c&&a(p)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}})),ht=u(((e,t)=>{nt(),ze(),f();var{Symbol:r,SymbolAsyncIterator:n,SymbolIterator:i,SymbolFor:o}=ot(),s=r("kDestroyed"),a=r("kIsErrored"),l=r("kIsReadable"),u=r("kIsDisturbed"),c=o("nodejs.webstream.isClosedPromise"),h=o("nodejs.webstream.controllerErrorFunction");function d(e,t=!1){var r;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(r=e._readableState)||void 0===r?void 0:r.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function g(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function y(e){return!(!e||g(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function b(e){return!(!e||g(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function v(e){return!(!e||g(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function m(e){if(!g(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[s]||null!=n&&n.destroyed)}function w(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;let t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof t?.ended?null:t.ended)}function _(e,t){if(!d(e))return null;let r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof r?.endEmitted?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function E(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof e?.readable?null:!m(e)&&(d(e)&&e.readable&&!_(e))}function S(e){return"boolean"!=typeof e?.writable?null:!m(e)&&(p(e)&&e.writable&&!w(e))}function k(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function A(e){return"boolean"==typeof e._sent100&&k(e)}t.exports={kDestroyed:s,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[u])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:u,isErrored:function(e){var t,r,n,i,o,s,l,u,c,h;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(i=null!==(o=null!==(s=e[a])&&void 0!==s?s:e.readableErrored)&&void 0!==o?o:e.writableErrored)&&void 0!==i?i:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(u=e._writableState)||void 0===u?void 0:u.errorEmitted)&&void 0!==r?r:null===(c=e._readableState)||void 0===c?void 0:c.errored)&&void 0!==t?t:null!==(h=e._writableState)&&void 0!==h&&h.errored))},kIsErrored:a,isReadable:E,kIsReadable:l,kIsClosedPromise:c,kControllerErrorFunction:h,isClosed:function(e){if(!g(e))return null;if("boolean"==typeof e.closed)return e.closed;let t=e._writableState,r=e._readableState;return"boolean"==typeof t?.closed||"boolean"==typeof r?.closed?t?.closed||r?.closed:"boolean"==typeof e._closed&&k(e)?e._closed:null},isDestroyed:m,isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return g(e)?!!m(e)||!(!1!==t?.readable&&E(e)||!1!==t?.writable&&S(e)):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[n]:!1===t?"function"==typeof e[i]:"function"==typeof e[n]||"function"==typeof e[i])},isReadableNodeStream:d,isReadableStream:y,isReadableEnded:function(e){if(!d(e))return null;if(!0===e.readableEnded)return!0;let t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof t?.ended?null:t.ended)},isReadableFinished:_,isReadableErrored:function(e){var t,r;return g(e)?e.readableErrored?e.readableErrored:null!==(t=null===(r=e._readableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isNodeStream:g,isWebStream:function(e){return y(e)||b(e)||v(e)},isWritable:S,isWritableNodeStream:p,isWritableStream:b,isWritableEnded:w,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;let r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof r?.finished?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return g(e)?e.writableErrored?e.writableErrored:null!==(t=null===(r=e._writableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:A,willEmitClose:function(e){if(!g(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!n&&A(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:v}})),ft=u(((e,t)=>{nt(),ze(),f();var r=ct(),{AbortError:n,codes:i}=lt(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_PREMATURE_CLOSE:s}=i,{kEmptyObject:a,once:l}=st(),{validateAbortSignal:u,validateFunction:c,validateObject:h,validateBoolean:d}=ut(),{Promise:p,PromisePrototypeThen:g}=ot(),{isClosed:y,isReadable:b,isReadableNodeStream:v,isReadableStream:m,isReadableFinished:w,isReadableErrored:_,isWritable:E,isWritableNodeStream:S,isWritableStream:k,isWritableFinished:A,isWritableErrored:T,isNodeStream:I,willEmitClose:C,kIsClosedPromise:R}=ht();var O=()=>{};function M(e,t,i){var f,d;if(2===arguments.length?(i=t,t=a):null==t?t=a:h(t,"options"),c(i,"callback"),u(t.signal,"options.signal"),i=l(i),m(e)||k(e))return function(e,t,i){let o=!1,s=O;if(t.signal)if(s=()=>{o=!0,i.call(e,new n(void 0,{cause:t.signal.reason}))},t.signal.aborted)r.nextTick(s);else{let r=i;i=l(((...n)=>{t.signal.removeEventListener("abort",s),r.apply(e,n)})),t.signal.addEventListener("abort",s)}let a=(...t)=>{o||r.nextTick((()=>i.apply(e,t)))};return g(e[R].promise,a,a),O}(e,t,i);if(!I(e))throw new o("stream",["ReadableStream","WritableStream","Stream"],e);let p=null!==(f=t.readable)&&void 0!==f?f:v(e),M=null!==(d=t.writable)&&void 0!==d?d:S(e),P=e._writableState,x=e._readableState,B=()=>{e.writable||N()},L=C(e)&&v(e)===p&&S(e)===M,U=A(e,!1),N=()=>{U=!0,e.destroyed&&(L=!1),(!L||e.readable&&!p)&&(!p||j)&&i.call(e)},j=w(e,!1),D=()=>{j=!0,e.destroyed&&(L=!1),(!L||e.writable&&!M)&&(!M||U)&&i.call(e)},F=t=>{i.call(e,t)},W=y(e),V=()=>{W=!0;let t=T(e)||_(e);return t&&"boolean"!=typeof t?i.call(e,t):p&&!j&&v(e,!0)&&!w(e,!1)?i.call(e,new s):!M||U||A(e,!1)?void i.call(e):i.call(e,new s)},z=()=>{W=!0;let t=T(e)||_(e);if(t&&"boolean"!=typeof t)return i.call(e,t);i.call(e)},H=()=>{e.req.on("finish",N)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?M&&!P&&(e.on("end",B),e.on("close",B)):(e.on("complete",N),L||e.on("abort",V),e.req?H():e.on("request",H)),!L&&"boolean"==typeof e.aborted&&e.on("aborted",V),e.on("end",D),e.on("finish",N),!1!==t.error&&e.on("error",F),e.on("close",V),W?r.nextTick(V):null!=P&&P.errorEmitted||null!=x&&x.errorEmitted?L||r.nextTick(z):(!p&&(!L||b(e))&&(U||!1===E(e))||!M&&(!L||E(e))&&(j||!1===b(e))||x&&e.req&&e.aborted)&&r.nextTick(z);let q=()=>{i=O,e.removeListener("aborted",V),e.removeListener("complete",N),e.removeListener("abort",V),e.removeListener("request",H),e.req&&e.req.removeListener("finish",N),e.removeListener("end",B),e.removeListener("close",B),e.removeListener("finish",N),e.removeListener("end",D),e.removeListener("error",F),e.removeListener("close",V)};if(t.signal&&!W){let o=()=>{let r=i;q(),r.call(e,new n(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)r.nextTick(o);else{let r=i;i=l(((...n)=>{t.signal.removeEventListener("abort",o),r.apply(e,n)})),t.signal.addEventListener("abort",o)}}return q}t.exports=M,t.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=a),null!==(r=t)&&void 0!==r&&r.cleanup&&(d(t.cleanup,"cleanup"),n=t.cleanup),new p(((r,i)=>{let o=M(e,t,(e=>{n&&o(),e?i(e):r()}))}))}})),dt=u(((e,t)=>{nt(),ze(),f();var r=ct(),{aggregateTwoErrors:n,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:o}=lt(),{Symbol:s}=ot(),{kDestroyed:a,isDestroyed:l,isFinished:u,isServerRequest:c}=ht(),h=s("kDestroy"),d=s("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function g(e,t,n){let i=!1;function o(t){if(i)return;i=!0;let o=e._readableState,s=e._writableState;p(t,s,o),s&&(s.closed=!0),o&&(o.closed=!0),"function"==typeof n&&n(t),t?r.nextTick(y,e,t):r.nextTick(b,e)}try{e._destroy(t||null,o)}catch(e){o(e)}}function y(e,t){v(e,t),b(e)}function b(e){let t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function v(e,t){let r=e._readableState,n=e._writableState;null!=n&&n.errorEmitted||null!=r&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function m(e,t,n){let i=e._readableState,o=e._writableState;if(null!=o&&o.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=o&&o.autoDestroy?e.destroy(t):t&&(t.stack,o&&!o.errored&&(o.errored=t),i&&!i.errored&&(i.errored=t),n?r.nextTick(v,e,t):v(e,t))}function w(e){let t=!1;function n(n){if(t)return void m(e,n??new i);t=!0;let o=e._readableState,s=e._writableState,a=s||o;o&&(o.constructed=!0),s&&(s.constructed=!0),a.destroyed?e.emit(h,n):n?m(e,n,!0):r.nextTick(_,e)}try{e._construct((e=>{r.nextTick(n,e)}))}catch(e){r.nextTick(n,e)}}function _(e){e.emit(d)}function E(e){return e?.setHeader&&"function"==typeof e.abort}function S(e){e.emit("close")}function k(e,t){e.emit("error",t),r.nextTick(S,e)}t.exports={construct:function(e,t){if("function"!=typeof e._construct)return;let n=e._readableState,i=e._writableState;n&&(n.constructed=!1),i&&(i.constructed=!1),e.once(d,t),!(e.listenerCount(d)>1)&&r.nextTick(w,e)},destroyer:function(e,t){!e||l(e)||(!t&&!u(e)&&(t=new o),c(e)?(e.socket=null,e.destroy(t)):E(e)?e.abort():E(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?r.nextTick(k,e,t):r.nextTick(S,e),e.destroyed||(e[a]=!0))},destroy:function(e,t){let r=this._readableState,i=this._writableState,o=i||r;return null!=i&&i.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(p(e,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),o.constructed?g(this,e,t):this.once(h,(function(r){g(this,n(r,e),t)})),this)},undestroy:function(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:m}}));function pt(){pt.init.call(this)}function gt(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function yt(e){return void 0===e._maxListeners?pt.defaultMaxListeners:e._maxListeners}function bt(e,t,r,n){var i,o,s,a;if(gt(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=yt(e))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,a=l,console&&console.warn&&console.warn(a)}return e}function vt(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function mt(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=vt.bind(n);return i.listener=r,n.wrapFn=i,i}function wt(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):Et(i,i.length)}function _t(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function Et(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}var St,kt,At,Tt,It,Ct,Rt,Ot=l((()=>{nt(),ze(),f(),At="object"==typeof Reflect?Reflect:null,Tt=At&&"function"==typeof At.apply?At.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)},kt=At&&"function"==typeof At.ownKeys?At.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)},It=Number.isNaN||function(e){return e!=e},St=pt,pt.EventEmitter=pt,pt.prototype._events=void 0,pt.prototype._eventsCount=0,pt.prototype._maxListeners=void 0,Ct=10,Object.defineProperty(pt,"defaultMaxListeners",{enumerable:!0,get:function(){return Ct},set:function(e){if("number"!=typeof e||e<0||It(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Ct=e}}),pt.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},pt.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||It(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},pt.prototype.getMaxListeners=function(){return yt(this)},pt.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[e];if(void 0===a)return!1;if("function"==typeof a)Tt(a,this,t);else{var l=a.length,u=Et(a,l);for(r=0;r<l;++r)Tt(u[r],this,t)}return!0},pt.prototype.addListener=function(e,t){return bt(this,e,t,!1)},pt.prototype.on=pt.prototype.addListener,pt.prototype.prependListener=function(e,t){return bt(this,e,t,!0)},pt.prototype.once=function(e,t){return gt(t),this.on(e,mt(this,e,t)),this},pt.prototype.prependOnceListener=function(e,t){return gt(t),this.prependListener(e,mt(this,e,t)),this},pt.prototype.removeListener=function(e,t){var r,n,i,o,s;if(gt(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},pt.prototype.off=pt.prototype.removeListener,pt.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},pt.prototype.listeners=function(e){return wt(this,e,!0)},pt.prototype.rawListeners=function(e){return wt(this,e,!1)},pt.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):_t.call(e,t)},pt.prototype.listenerCount=_t,pt.prototype.eventNames=function(){return this._eventsCount>0?kt(this._events):[]},(Rt=St).EventEmitter,Rt.defaultMaxListeners,Rt.init,Rt.listenerCount,Rt.EventEmitter,Rt.defaultMaxListeners,Rt.init,Rt.listenerCount})),Mt={};c(Mt,{EventEmitter:()=>Pt,default:()=>Rt,defaultMaxListeners:()=>xt,init:()=>Bt,listenerCount:()=>Lt,on:()=>Ut,once:()=>Nt});var Pt,xt,Bt,Lt,Ut,Nt,jt=l((()=>{nt(),ze(),f(),Ot(),Ot(),Rt.once=function(e,t){return new Promise(((r,n)=>{function i(...t){void 0!==o&&e.removeListener("error",o),r(t)}let o;"error"!==t&&(o=t=>{e.removeListener(name,i),n(t)},e.once("error",o)),e.once(t,i)}))},Rt.on=function(e,t){let r=[],n=[],i=null,o=!1,s={async next(){let e=r.shift();if(e)return createIterResult(e,!1);if(i){let e=Promise.reject(i);return i=null,e}return o?createIterResult(void 0,!0):new Promise(((e,t)=>n.push({resolve:e,reject:t})))},async return(){e.removeListener(t,a),e.removeListener("error",l),o=!0;for(let e of n)e.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(r){i=r,e.removeListener(t,a),e.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return e.on(t,a),e.on("error",l),s;function a(...e){let t=n.shift();t?t.resolve(createIterResult(e,!1)):r.push(e)}function l(e){o=!0;let t=n.shift();t?t.reject(e):i=e,s.return()}},({EventEmitter:Pt,defaultMaxListeners:xt,init:Bt,listenerCount:Lt,on:Ut,once:Nt}=Rt)})),Dt=u(((e,t)=>{nt(),ze(),f();var{ArrayIsArray:r,ObjectSetPrototypeOf:n}=ot(),{EventEmitter:i}=(jt(),h(Mt));function o(e){i.call(this,e)}function s(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}n(o.prototype,i.prototype),n(o,i),o.prototype.pipe=function(e,t){let r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",o),!e._isStdio&&(!t||!1!==t.end)&&(r.on("end",l),r.on("close",u));let a=!1;function l(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){h(),0===i.listenerCount(this,"error")&&this.emit("error",e)}function h(){r.removeListener("data",n),e.removeListener("drain",o),r.removeListener("end",l),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",h),r.removeListener("close",h),e.removeListener("close",h)}return s(r,"error",c),s(e,"error",c),r.on("end",h),r.on("close",h),e.on("close",h),e.emit("pipe",r),e},t.exports={Stream:o,prependListener:s}})),Ft=u(((e,t)=>{nt(),ze(),f();var{AbortError:r,codes:n}=lt(),{isNodeStream:i,isWebStream:o,kControllerErrorFunction:s}=ht(),a=ft(),{ERR_INVALID_ARG_TYPE:l}=n;t.exports.addAbortSignal=function(e,r){if(((e,t)=>{if("object"!=typeof e||!("aborted"in e))throw new l(t,"AbortSignal",e)})(e,"signal"),!i(r)&&!o(r))throw new l("stream",["ReadableStream","WritableStream","Stream"],r);return t.exports.addAbortSignalNoValidate(e,r)},t.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;let n=i(t)?()=>{t.destroy(new r(void 0,{cause:e.reason}))}:()=>{t[s](new r(void 0,{cause:e.reason}))};return e.aborted?n():(e.addEventListener("abort",n),a(t,(()=>e.removeEventListener("abort",n)))),t}})),Wt=u(((e,t)=>{nt(),ze(),f();var{StringPrototypeSlice:r,SymbolIterator:n,TypedArrayPrototypeSet:i,Uint8Array:o}=ot(),{Buffer:s}=(rt(),h(He)),{inspect:a}=st();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){let t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;let e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return s.alloc(0);let t=s.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)i(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){let r=this.head.data;if(e<r.length){let t=r.slice(0,e);return this.head.data=r.slice(e),t}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[n](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",n=this.head,i=0;do{let o=n.data;if(!(e>o.length)){e===o.length?(t+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(t+=r(o,0,e),this.head=n,n.data=r(o,e));break}t+=o,e-=o.length,++i}while(null!==(n=n.next));return this.length-=i,t}_getBuffer(e){let t=s.allocUnsafe(e),r=e,n=this.head,a=0;do{let s=n.data;if(!(e>s.length)){e===s.length?(i(t,s,r-e),++a,n.next?this.head=n.next:this.head=this.tail=null):(i(t,new o(s.buffer,s.byteOffset,e),r-e),this.head=n,n.data=s.slice(e));break}i(t,s,r-e),e-=s.length,++a}while(null!==(n=n.next));return this.length-=a,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return a(this,{...t,depth:0,customInspect:!1})}}})),Vt=u(((e,t)=>{nt(),ze(),f();var{MathFloor:r,NumberIsInteger:n}=ot(),{ERR_INVALID_ARG_VALUE:i}=lt().codes;function o(e){return e?16:16384}t.exports={getHighWaterMark:function(e,t,s,a){let l=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,a,s);if(null!=l){if(!n(l)||l<0){throw new i(a?`options.${s}`:"options.highWaterMark",l)}return r(l)}return o(e.objectMode)},getDefaultHighWaterMark:o}}));function zt(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function Ht(e,t,r){for(var n,i,o=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(Nr[(i=n)>>18&63]+Nr[i>>12&63]+Nr[i>>6&63]+Nr[63&i]);return o.join("")}function qt(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,$t.prototype),t}function $t(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return Qt(e)}return Kt(e,t,r)}function Kt(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!$t.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|Xt(e,t),n=qt(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return Yt(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Sr(e,ArrayBuffer)||e&&Sr(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Sr(e,SharedArrayBuffer)||e&&Sr(e.buffer,SharedArrayBuffer)))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,$t.prototype),n}(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return $t.from(n,t,r);var i=function(e){if($t.isBuffer(e)){var t=0|Jt(e.length),r=qt(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||kr(e.length)?qt(0):Yt(e):"Buffer"===e.type&&Array.isArray(e.data)?Yt(e.data):void 0}(e);if(i)return i;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return $t.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function Gt(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Qt(e){return Gt(e),qt(e<0?0:0|Jt(e))}function Yt(e){for(var t=e.length<0?0:0|Jt(e.length),r=qt(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function Jt(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function Xt(e,t){if($t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Sr(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return wr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return _r(e).length;default:if(i)return n?-1:wr(e).length;t=(""+t).toLowerCase(),i=!0}}function Zt(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return dr(this,t,r);case"utf8":case"utf-8":return cr(this,t,r);case"ascii":return hr(this,t,r);case"latin1":case"binary":return fr(this,t,r);case"base64":return ur(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pr(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function er(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function tr(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),kr(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=$t.from(t,n)),$t.isBuffer(t))return 0===t.length?-1:rr(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):rr(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function rr(e,t,r,n,i){var o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){for(var h=!0,f=0;f<l;f++)if(u(e,o+f)!==u(t,f)){h=!1;break}if(h)return o}return-1}function nr(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(kr(a))return s;e[r+s]=a}return s}function ir(e,t,r,n){return Er(wr(t,e.length-r),e,r,n)}function or(e,t,r,n){return Er(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function sr(e,t,r,n){return or(e,t,r,n)}function ar(e,t,r,n){return Er(_r(t),e,r,n)}function lr(e,t,r,n){return Er(function(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function ur(e,t,r){return 0===t&&r===e.length?zr.fromByteArray(e):zr.fromByteArray(e.slice(t,r))}function cr(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,l,u=e[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(l=(15&u)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}function hr(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function fr(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function dr(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=Kr[e[o]];return i}function pr(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function gr(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function yr(e,t,r,n,i,o){if(!$t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function br(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function vr(e,t,r,n,i){return t=+t,r>>>=0,i||br(e,0,r,4),Hr.write(e,t,r,n,23,4),r+4}function mr(e,t,r,n,i){return t=+t,r>>>=0,i||br(e,0,r,8),Hr.write(e,t,r,n,52,8),r+8}function wr(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function _r(e){return zr.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace($r,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Er(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Sr(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function kr(e){return e!=e}function Ar(e,t){for(var r in e)t[r]=e[r]}function Tr(e,t,r){return Yr(e,t,r)}function Ir(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(Xr.isEncoding===Zr||!Zr(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=Or,this.end=Mr,t=4;break;case"utf8":this.fillLast=Rr,t=4;break;case"base64":this.text=Pr,this.end=xr,t=3;break;default:return this.write=Br,void(this.end=Lr)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Xr.allocUnsafe(t)}function Cr(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function Rr(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function Or(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function Mr(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function Pr(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function xr(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Br(e){return e.toString(this.encoding)}function Lr(e){return e&&e.length?this.write(e):""}var Ur,Nr,jr,Dr,Fr,Wr,Vr,zr,Hr,qr,$r,Kr,Gr,Qr,Yr,Jr,Xr,Zr,en=l((()=>{for(nt(),ze(),f(),Ur={byteLength:function(e){var t=zt(e),r=t[0],n=t[1];return 3*(r+n)/4-n},toByteArray:function(e){var t,r,n,i=zt(e),o=i[0],s=i[1],a=new Dr(3*(o+(n=s))/4-n),l=0,u=s>0?o-4:o;for(r=0;r<u;r+=4)t=jr[e.charCodeAt(r)]<<18|jr[e.charCodeAt(r+1)]<<12|jr[e.charCodeAt(r+2)]<<6|jr[e.charCodeAt(r+3)],a[l++]=t>>16&255,a[l++]=t>>8&255,a[l++]=255&t;return 2===s&&(t=jr[e.charCodeAt(r)]<<2|jr[e.charCodeAt(r+1)]>>4,a[l++]=255&t),1===s&&(t=jr[e.charCodeAt(r)]<<10|jr[e.charCodeAt(r+1)]<<4|jr[e.charCodeAt(r+2)]>>2,a[l++]=t>>8&255,a[l++]=255&t),a},fromByteArray:function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;o<s;o+=16383)i.push(Ht(e,o,o+16383>s?s:o+16383));return 1===n?(t=e[r-1],i.push(Nr[t>>2]+Nr[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(Nr[t>>10]+Nr[t>>4&63]+Nr[t<<2&63]+"=")),i.join("")}},Nr=[],jr=[],Dr=typeof Uint8Array<"u"?Uint8Array:Array,Fr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wr=0,64;Wr<64;++Wr)Nr[Wr]=Fr[Wr],jr[Fr.charCodeAt(Wr)]=Wr;jr["-".charCodeAt(0)]=62,jr["_".charCodeAt(0)]=63,Vr={},zr=Ur,Hr={read:function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},write:function(e,t,r,n,i,o){var s,a,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+d]=255&s,d+=p,s/=256,u-=8);e[r+d-p]|=128*g}},qr="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null,Vr.Buffer=$t,Vr.SlowBuffer=function(e){return+e!=e&&(e=0),$t.alloc(+e)},Vr.INSPECT_MAX_BYTES=50,Vr.kMaxLength=2147483647,$t.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}(),$t.TYPED_ARRAY_SUPPORT||typeof console>"u"||"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($t.prototype,"parent",{enumerable:!0,get:function(){if($t.isBuffer(this))return this.buffer}}),Object.defineProperty($t.prototype,"offset",{enumerable:!0,get:function(){if($t.isBuffer(this))return this.byteOffset}}),$t.poolSize=8192,$t.from=function(e,t,r){return Kt(e,t,r)},Object.setPrototypeOf($t.prototype,Uint8Array.prototype),Object.setPrototypeOf($t,Uint8Array),$t.alloc=function(e,t,r){return i=t,o=r,Gt(n=e),n<=0?qt(n):void 0!==i?"string"==typeof o?qt(n).fill(i,o):qt(n).fill(i):qt(n);var n,i,o},$t.allocUnsafe=function(e){return Qt(e)},$t.allocUnsafeSlow=function(e){return Qt(e)},$t.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==$t.prototype},$t.compare=function(e,t){if(Sr(e,Uint8Array)&&(e=$t.from(e,e.offset,e.byteLength)),Sr(t,Uint8Array)&&(t=$t.from(t,t.offset,t.byteLength)),!$t.isBuffer(e)||!$t.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},$t.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},$t.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return $t.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=$t.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(Sr(o,Uint8Array)&&(o=$t.from(o)),!$t.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},$t.byteLength=Xt,$t.prototype._isBuffer=!0,$t.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)er(this,t,t+1);return this},$t.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)er(this,t,t+3),er(this,t+1,t+2);return this},$t.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)er(this,t,t+7),er(this,t+1,t+6),er(this,t+2,t+5),er(this,t+3,t+4);return this},$t.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?cr(this,0,e):Zt.apply(this,arguments)},$t.prototype.toLocaleString=$t.prototype.toString,$t.prototype.equals=function(e){if(!$t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===$t.compare(this,e)},$t.prototype.inspect=function(){var e="",t=Vr.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},qr&&($t.prototype[qr]=$t.prototype.inspect),$t.prototype.compare=function(e,t,r,n,i){if(Sr(e,Uint8Array)&&(e=$t.from(e,e.offset,e.byteLength)),!$t.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r),c=0;c<a;++c)if(l[c]!==u[c]){o=l[c],s=u[c];break}return o<s?-1:s<o?1:0},$t.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},$t.prototype.indexOf=function(e,t,r){return tr(this,e,t,r,!0)},$t.prototype.lastIndexOf=function(e,t,r){return tr(this,e,t,r,!1)},$t.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return nr(this,e,t,r);case"utf8":case"utf-8":return ir(this,e,t,r);case"ascii":return or(this,e,t,r);case"latin1":case"binary":return sr(this,e,t,r);case"base64":return ar(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lr(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},$t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},$t.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,$t.prototype),n},$t.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||gr(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},$t.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||gr(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},$t.prototype.readUInt8=function(e,t){return e>>>=0,t||gr(e,1,this.length),this[e]},$t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||gr(e,2,this.length),this[e]|this[e+1]<<8},$t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||gr(e,2,this.length),this[e]<<8|this[e+1]},$t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||gr(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},$t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||gr(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},$t.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||gr(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},$t.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||gr(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},$t.prototype.readInt8=function(e,t){return e>>>=0,t||gr(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},$t.prototype.readInt16LE=function(e,t){e>>>=0,t||gr(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},$t.prototype.readInt16BE=function(e,t){e>>>=0,t||gr(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},$t.prototype.readInt32LE=function(e,t){return e>>>=0,t||gr(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},$t.prototype.readInt32BE=function(e,t){return e>>>=0,t||gr(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},$t.prototype.readFloatLE=function(e,t){return e>>>=0,t||gr(e,4,this.length),Hr.read(this,e,!0,23,4)},$t.prototype.readFloatBE=function(e,t){return e>>>=0,t||gr(e,4,this.length),Hr.read(this,e,!1,23,4)},$t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||gr(e,8,this.length),Hr.read(this,e,!0,52,8)},$t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||gr(e,8,this.length),Hr.read(this,e,!1,52,8)},$t.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||yr(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},$t.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||yr(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},$t.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,1,255,0),this[t]=255&e,t+1},$t.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},$t.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},$t.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},$t.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},$t.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);yr(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},$t.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);yr(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},$t.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},$t.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},$t.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},$t.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},$t.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||yr(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},$t.prototype.writeFloatLE=function(e,t,r){return vr(this,e,t,!0,r)},$t.prototype.writeFloatBE=function(e,t,r){return vr(this,e,t,!1,r)},$t.prototype.writeDoubleLE=function(e,t,r){return mr(this,e,t,!0,r)},$t.prototype.writeDoubleBE=function(e,t,r){return mr(this,e,t,!1,r)},$t.prototype.copy=function(e,t,r,n){if(!$t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var o=i-1;o>=0;--o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},$t.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!$t.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=$t.isBuffer(e)?e:$t.from(e,n),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this},$r=/[^+/0-9A-Za-z-_]/g,Kr=function(){for(var e=new Array(256),t=0;t<16;++t)for(var r=16*t,n=0;n<16;++n)e[r+n]="0123456789abcdef"[t]+"0123456789abcdef"[n];return e}(),Vr.Buffer,Vr.INSPECT_MAX_BYTES,Vr.kMaxLength,Gr={},(Yr=(Qr=Vr).Buffer).from&&Yr.alloc&&Yr.allocUnsafe&&Yr.allocUnsafeSlow?Gr=Qr:(Ar(Qr,Gr),Gr.Buffer=Tr),Tr.prototype=Object.create(Yr.prototype),Ar(Yr,Tr),Tr.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return Yr(e,t,r)},Tr.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=Yr(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},Tr.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return Yr(e)},Tr.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return Qr.SlowBuffer(e)},Jr={},Xr=Gr.Buffer,Zr=Xr.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},Jr.StringDecoder=Ir,Ir.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},Ir.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},Ir.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=Cr(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=Cr(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=Cr(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},Ir.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length},Jr.StringDecoder,Jr.StringDecoder})),tn={};c(tn,{StringDecoder:()=>rn,default:()=>Jr});var rn,nn=l((()=>{nt(),ze(),f(),en(),en(),rn=Jr.StringDecoder})),on=u(((e,t)=>{nt(),ze(),f();var r=ct(),{PromisePrototypeThen:n,SymbolAsyncIterator:i,SymbolIterator:o}=ot(),{Buffer:s}=(rt(),h(He)),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_NULL_VALUES:l}=lt().codes;t.exports=function(e,t,u){let c,h;if("string"==typeof t||t instanceof s)return new e({objectMode:!0,...u,read(){this.push(t),this.push(null)}});if(t&&t[i])h=!0,c=t[i]();else{if(!t||!t[o])throw new a("iterable",["Iterable"],t);h=!1,c=t[o]()}let f=new e({objectMode:!0,highWaterMark:1,...u}),d=!1;return f._read=function(){d||(d=!0,async function(){for(;;){try{let{value:e,done:t}=h?await c.next():c.next();if(t)f.push(null);else{let t=e&&"function"==typeof e.then?await e:e;if(null===t)throw d=!1,new l;if(f.push(t))continue;d=!1}}catch(e){f.destroy(e)}break}}())},f._destroy=function(e,t){n(async function(e){let t=null!=e,r="function"==typeof c.throw;if(t&&r){let{value:t,done:r}=await c.throw(e);if(await t,r)return}if("function"==typeof c.return){let{value:e}=await c.return();await e}}(e),(()=>r.nextTick(t,e)),(n=>r.nextTick(t,n||e)))},f}})),sn=u(((e,t)=>{nt(),ze(),f();var r=ct(),{ArrayPrototypeIndexOf:n,NumberIsInteger:i,NumberIsNaN:o,NumberParseInt:s,ObjectDefineProperties:a,ObjectKeys:l,ObjectSetPrototypeOf:u,Promise:c,SafeSet:d,SymbolAsyncIterator:p,Symbol:g}=ot();t.exports=F,F.ReadableState=D;var{EventEmitter:y}=(jt(),h(Mt)),{Stream:b,prependListener:v}=Dt(),{Buffer:m}=(rt(),h(He)),{addAbortSignal:w}=Ft(),_=ft(),E=st().debuglog("stream",(e=>{E=e})),S=Wt(),k=dt(),{getHighWaterMark:A,getDefaultHighWaterMark:T}=Vt(),{aggregateTwoErrors:I,codes:{ERR_INVALID_ARG_TYPE:C,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_OUT_OF_RANGE:O,ERR_STREAM_PUSH_AFTER_EOF:M,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:P}}=lt(),{validateObject:x}=ut(),B=g("kPaused"),{StringDecoder:L}=(nn(),h(tn)),U=on();u(F.prototype,b.prototype),u(F,b);var N=()=>{},{errorOrDestroy:j}=k;function D(e,t,r){"boolean"!=typeof r&&(r=t instanceof un()),this.objectMode=!(!e||!e.objectMode),r&&(this.objectMode=this.objectMode||!(!e||!e.readableObjectMode)),this.highWaterMark=e?A(this,e,"readableHighWaterMark",r):T(!1),this.buffer=new S,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[B]=null,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new L(e.encoding),this.encoding=e.encoding)}function F(e){if(!(this instanceof F))return new F(e);let t=this instanceof un();this._readableState=new D(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&w(e.signal,this)),b.call(this,e),k.construct(this,(()=>{this._readableState.needReadable&&K(this,this._readableState)}))}function W(e,t,r,n){E("readableAddChunk",t);let i,o=e._readableState;if(o.objectMode||("string"==typeof t?(r=r||o.defaultEncoding,o.encoding!==r&&(n&&o.encoding?t=m.from(t,r).toString(o.encoding):(t=m.from(t,r),r=""))):t instanceof m?r="":b._isUint8Array(t)?(t=b._uint8ArrayToBuffer(t),r=""):null!=t&&(i=new C("chunk",["string","Buffer","Uint8Array"],t))),i)j(e,i);else if(null===t)o.reading=!1,function(e,t){if(E("onEofChunk"),!t.ended){if(t.decoder){let e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?q(e):(t.needReadable=!1,t.emittedReadable=!0,$(e))}}(e,o);else if(o.objectMode||t&&t.length>0)if(n)if(o.endEmitted)j(e,new P);else{if(o.destroyed||o.errored)return!1;V(e,o,t,!0)}else if(o.ended)j(e,new M);else{if(o.destroyed||o.errored)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?V(e,o,t,!1):K(e,o)):V(e,o,t,!1)}else n||(o.reading=!1,K(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function V(e,t,r,n){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&q(e)),K(e,t)}F.prototype.destroy=k.destroy,F.prototype._undestroy=k.undestroy,F.prototype._destroy=function(e,t){t(e)},F.prototype[y.captureRejectionSymbol]=function(e){this.destroy(e)},F.prototype.push=function(e,t){return W(this,e,t,!1)},F.prototype.unshift=function(e,t){return W(this,e,t,!0)},F.prototype.isPaused=function(){let e=this._readableState;return!0===e[B]||!1===e.flowing},F.prototype.setEncoding=function(e){let t=new L(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this};var z;function H(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:o(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function q(e){let t=e._readableState;E("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(E("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick($,e))}function $(e){let t=e._readableState;E("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,X(e)}function K(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,r.nextTick(G,e,t))}function G(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){let r=t.length;if(E("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function Q(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[B]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function Y(e){E("readable nexttick read 0"),e.read(0)}function J(e,t){E("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),X(e),t.flowing&&!t.reading&&e.read(0)}function X(e){let t=e._readableState;for(E("flow",t.flowing);t.flowing&&null!==e.read(););}function Z(e,t){"function"!=typeof e.read&&(e=F.wrap(e,{objectMode:!0}));let r=async function*(e,t){let r=N;function n(t){this===e?(r(),r=N):r=t}e.on("readable",n);let i,o=_(e,{writable:!1},(e=>{i=e?I(i,e):null,r(),r=N}));try{for(;;){let t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(i)throw i;if(null===i)return;await new c(n)}}}catch(e){throw i=I(i,e),i}finally{!i&&!1===t?.destroyOnReturn||void 0!==i&&!e._readableState.autoDestroy?(e.off("readable",n),o()):k.destroyer(e,null)}}(e,t);return r.stream=e,r}function ee(e,t){if(0===t.length)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function te(e){let t=e._readableState;E("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(re,t,e))}function re(e,t){if(E("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)r.nextTick(ne,t);else if(e.autoDestroy){let e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function ne(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}function ie(){return void 0===z&&(z={}),z}F.prototype.read=function(e){E("read",e),void 0===e?e=NaN:i(e)||(e=s(e,10));let t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new O("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return E("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?te(this):q(this),null;if(0===(e=H(e,t))&&t.ended)return 0===t.length&&te(this),null;let n,o=t.needReadable;if(E("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&(o=!0,E("length less than watermark",o)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)o=!1,E("reading, ended or constructing",o);else if(o){E("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0);try{this._read(t.highWaterMark)}catch(e){j(this,e)}t.sync=!1,t.reading||(e=H(r,t))}return n=e>0?ee(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&te(this)),null!==n&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",n)),n},F.prototype._read=function(e){throw new R("_read()")},F.prototype.pipe=function(e,t){let n=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new d(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),E("pipe count=%d opts=%j",i.pipes.length,t);let o=t&&!1===t.end||e===r.stdout||e===r.stderr?y:a;function s(t,r){E("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,E("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),l&&e.removeListener("drain",l),e.removeListener("error",f),e.removeListener("unpipe",s),n.removeListener("end",a),n.removeListener("end",y),n.removeListener("data",h),u=!0,l&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&l())}function a(){E("onend"),e.end()}i.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",s);let l,u=!1;function c(){u||(1===i.pipes.length&&i.pipes[0]===e?(E("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(E("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),n.pause()),l||(l=function(e,t){return function(){let r=e._readableState;r.awaitDrainWriters===t?(E("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(E("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),(!r.awaitDrainWriters||0===r.awaitDrainWriters.size)&&e.listenerCount("data")&&e.resume()}}(n,e),e.on("drain",l))}function h(t){E("ondata");let r=e.write(t);E("dest.write",r),!1===r&&c()}function f(t){if(E("onerror",t),y(),e.removeListener("error",f),0===e.listenerCount("error")){let r=e._writableState||e._readableState;r&&!r.errorEmitted?j(e,t):e.emit("error",t)}}function p(){e.removeListener("finish",g),y()}function g(){E("onfinish"),e.removeListener("close",p),y()}function y(){E("unpipe"),n.unpipe(e)}return n.on("data",h),v(e,"error",f),e.once("close",p),e.once("finish",g),e.emit("pipe",n),!0===e.writableNeedDrain?i.flowing&&c():i.flowing||(E("pipe resume"),n.resume()),e},F.prototype.unpipe=function(e){let t=this._readableState;if(0===t.pipes.length)return this;if(!e){let e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}let r=n(t.pipes,e);return-1===r||(t.pipes.splice(r,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},F.prototype.on=function(e,t){let n=b.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,E("on readable",i.length,i.reading),i.length?q(this):i.reading||r.nextTick(Y,this)),n},F.prototype.addListener=F.prototype.on,F.prototype.removeListener=function(e,t){let n=b.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(Q,this),n},F.prototype.off=F.prototype.removeListener,F.prototype.removeAllListeners=function(e){let t=b.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&r.nextTick(Q,this),t},F.prototype.resume=function(){let e=this._readableState;return e.flowing||(E("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(J,e,t))}(this,e)),e[B]=!1,this},F.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[B]=!0,this},F.prototype.wrap=function(e){let t=!1;e.on("data",(r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())})),e.on("end",(()=>{this.push(null)})),e.on("error",(e=>{j(this,e)})),e.on("close",(()=>{this.destroy()})),e.on("destroy",(()=>{this.destroy()})),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=l(e);for(let t=1;t<r.length;t++){let n=r[t];void 0===this[n]&&"function"==typeof e[n]&&(this[n]=e[n].bind(e))}return this},F.prototype[p]=function(){return Z(this)},F.prototype.iterator=function(e){return void 0!==e&&x(e,"options"),Z(this,e)},a(F.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),a(D.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[B]},set(e){this[B]=!!e}}}),F._fromList=ee,F.from=function(e,t){return U(F,e,t)},F.fromWeb=function(e,t){return ie().newStreamReadableFromReadableStream(e,t)},F.toWeb=function(e,t){return ie().newReadableStreamFromStreamReadable(e,t)},F.wrap=function(e,t){var r,n;return new F({objectMode:null===(r=null!==(n=e.readableObjectMode)&&void 0!==n?n:e.objectMode)||void 0===r||r,...t,destroy(t,r){k.destroyer(e,t),r(t)}}).wrap(e)}})),an=u(((e,t)=>{nt(),ze(),f();var r=ct(),{ArrayPrototypeSlice:n,Error:i,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:s,ObjectDefineProperties:a,ObjectSetPrototypeOf:l,StringPrototypeToLowerCase:u,Symbol:c,SymbolHasInstance:d}=ot();t.exports=L,L.WritableState=x;var{EventEmitter:p}=(jt(),h(Mt)),g=Dt().Stream,{Buffer:y}=(rt(),h(He)),b=dt(),{addAbortSignal:v}=Ft(),{getHighWaterMark:m,getDefaultHighWaterMark:w}=Vt(),{ERR_INVALID_ARG_TYPE:_,ERR_METHOD_NOT_IMPLEMENTED:E,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:k,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:T,ERR_STREAM_NULL_VALUES:I,ERR_STREAM_WRITE_AFTER_END:C,ERR_UNKNOWN_ENCODING:R}=lt().codes,{errorOrDestroy:O}=b;function M(){}l(L.prototype,g.prototype),l(L,g);var P=c("kOnFinished");function x(e,t,r){"boolean"!=typeof r&&(r=t instanceof un()),this.objectMode=!(!e||!e.objectMode),r&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?m(this,e,"writableHighWaterMark",r):w(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!(!e||!1!==e.decodeStrings);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=D.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,B(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[P]=[]}function B(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function L(e){let t=this instanceof un();if(!t&&!o(L,this))return new L(e);this._writableState=new x(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&v(e.signal,this)),g.call(this,e),b.construct(this,(()=>{let e=this._writableState;e.writing||z(this,e),$(this,e)}))}function U(e,t,n,i){let o,s=e._writableState;if("function"==typeof n)i=n,n=s.defaultEncoding;else{if(n){if("buffer"!==n&&!y.isEncoding(n))throw new R(n)}else n=s.defaultEncoding;"function"!=typeof i&&(i=M)}if(null===t)throw new I;if(!s.objectMode)if("string"==typeof t)!1!==s.decodeStrings&&(t=y.from(t,n),n="buffer");else if(t instanceof y)n="buffer";else{if(!g._isUint8Array(t))throw new _("chunk",["string","Buffer","Uint8Array"],t);t=g._uint8ArrayToBuffer(t),n="buffer"}return s.ending?o=new C:s.destroyed&&(o=new A("write")),o?(r.nextTick(i,o),O(e,o,!0),o):(s.pendingcb++,function(e,t,r,n,i){let o=t.objectMode?1:r.length;t.length+=o;let s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:i}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&i!==M&&(t.allNoop=!1)):(t.writelen=o,t.writecb=i,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,s,t,n,i))}function N(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new A("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function j(e,t,r,n){--t.pendingcb,n(r),V(t),O(e,r)}function D(e,t){let n=e._writableState,i=n.sync,o=n.writecb;"function"==typeof o?(n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0,t?(t.stack,n.errored||(n.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?r.nextTick(j,e,n,t,o):j(e,n,t,o)):(n.buffered.length>n.bufferedIndex&&z(e,n),i?null!==n.afterWriteTickInfo&&n.afterWriteTickInfo.cb===o?n.afterWriteTickInfo.count++:(n.afterWriteTickInfo={count:1,cb:o,stream:e,state:n},r.nextTick(F,n.afterWriteTickInfo)):W(e,n,1,o))):O(e,new S)}function F({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,W(e,t,r,n)}function W(e,t,r,n){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&V(t),$(e,t)}function V(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;let{chunk:n,callback:i}=e.buffered[r],o=e.objectMode?1:n.length;e.length-=o,i(null!==(t=e.errored)&&void 0!==t?t:new A("write"))}let r=e[P].splice(0);for(let t=0;t<r.length;t++){var n;r[t](null!==(n=e.errored)&&void 0!==n?n:new A("end"))}B(e)}function z(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:r,bufferedIndex:i,objectMode:o}=t,s=r.length-i;if(!s)return;let a=i;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;let i=t.allNoop?M:e=>{for(let t=a;t<r.length;++t)r[t].callback(e)},o=t.allNoop&&0===a?r:n(r,a);o.allBuffers=t.allBuffers,N(e,t,!0,t.length,o,"",i),B(t)}else{do{let{chunk:n,encoding:i,callback:s}=r[a];r[a++]=null,N(e,t,!1,o?1:n.length,n,i,s)}while(a<r.length&&!t.writing);a===r.length?B(t):a>256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function H(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function q(e,t){!t.prefinished&&!t.finalCalled&&("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let n=!1;function i(i){if(n)O(e,i??S());else if(n=!0,t.pendingcb--,i){let r=t[P].splice(0);for(let e=0;e<r.length;e++)r[e](i);O(e,i,t.sync)}else H(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,r.nextTick(K,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(e){i(e)}t.sync=!1}(e,t)))}function $(e,t,n){H(t)&&(q(e,t),0===t.pendingcb&&(n?(t.pendingcb++,r.nextTick(((e,t)=>{H(t)?K(e,t):t.pendingcb--}),e,t)):H(t)&&(t.pendingcb++,K(e,t))))}function K(e,t){t.pendingcb--,t.finished=!0;let r=t[P].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){let t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}x.prototype.getBuffer=function(){return n(this.buffered,this.bufferedIndex)},s(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),s(L,d,{__proto__:null,value:function(e){return!!o(this,e)||this===L&&(e&&e._writableState instanceof x)}}),L.prototype.pipe=function(){O(this,new k)},L.prototype.write=function(e,t,r){return!0===U(this,e,t,r)},L.prototype.cork=function(){this._writableState.corked++},L.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||z(this,e))},L.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!y.isEncoding(e))throw new R(e);return this._writableState.defaultEncoding=e,this},L.prototype._write=function(e,t,r){if(!this._writev)throw new E("_write()");this._writev([{chunk:e,encoding:t}],r)},L.prototype._writev=null,L.prototype.end=function(e,t,n){let o,s=this._writableState;if("function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e){let r=U(this,e,t);r instanceof i&&(o=r)}return s.corked&&(s.corked=1,this.uncork()),o||(s.errored||s.ending?s.finished?o=new T("end"):s.destroyed&&(o=new A("end")):(s.ending=!0,$(this,s,!0),s.ended=!0)),"function"==typeof n&&(o||s.finished?r.nextTick(n,o):s[P].push(n)),this},a(L.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return!!e&&(!e.destroyed&&!e.ending&&e.needDrain)}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});var G,Q=b.destroy;function Y(){return void 0===G&&(G={}),G}L.prototype.destroy=function(e,t){let n=this._writableState;return!n.destroyed&&(n.bufferedIndex<n.buffered.length||n[P].length)&&r.nextTick(V,n),Q.call(this,e,t),this},L.prototype._undestroy=b.undestroy,L.prototype._destroy=function(e,t){t(e)},L.prototype[p.captureRejectionSymbol]=function(e){this.destroy(e)},L.fromWeb=function(e,t){return Y().newStreamWritableFromWritableStream(e,t)},L.toWeb=function(e){return Y().newWritableStreamFromStreamWritable(e)}})),ln=u(((e,t)=>{nt(),ze(),f();var r=ct(),n=(rt(),h(He)),{isReadable:i,isWritable:o,isIterable:s,isNodeStream:a,isReadableNodeStream:l,isWritableNodeStream:u,isDuplexNodeStream:c}=ht(),d=ft(),{AbortError:p,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:y}}=lt(),{destroyer:b}=dt(),v=un(),m=sn(),{createDeferredPromise:w}=st(),_=on(),E=globalThis.Blob||n.Blob,S=typeof E<"u"?function(e){return e instanceof E}:function(e){return!1},k=globalThis.AbortController||at().AbortController,{FunctionPrototypeCall:A}=ot(),T=class extends v{constructor(e){super(e),!1===e?.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e?.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};function I(e){let t,r,n,s,a,l=e.readable&&"function"!=typeof e.readable.read?m.wrap(e.readable):e.readable,u=e.writable,c=!!i(l),h=!!o(u);function f(e){let t=s;s=null,t?t(e):e&&a.destroy(e)}return a=new T({readableObjectMode:!(null==l||!l.readableObjectMode),writableObjectMode:!(null==u||!u.writableObjectMode),readable:c,writable:h}),h&&(d(u,(e=>{h=!1,e&&b(l,e),f(e)})),a._write=function(e,r,n){u.write(e,r)?n():t=n},a._final=function(e){u.end(),r=e},u.on("drain",(function(){if(t){let e=t;t=null,e()}})),u.on("finish",(function(){if(r){let e=r;r=null,e()}}))),c&&(d(l,(e=>{c=!1,e&&b(l,e),f(e)})),l.on("readable",(function(){if(n){let e=n;n=null,e()}})),l.on("end",(function(){a.push(null)})),a._read=function(){for(;;){let e=l.read();if(null===e)return void(n=a._read);if(!a.push(e))return}}),a._destroy=function(e,i){!e&&null!==s&&(e=new p),n=null,t=null,r=null,null===s?i(e):(s=i,b(u,e),b(l,e))},a}t.exports=function e(t,n){if(c(t))return t;if(l(t))return I({readable:t});if(u(t))return I({writable:t});if(a(t))return I({writable:!1,readable:!1});if("function"==typeof t){let{value:e,write:i,final:o,destroy:a}=function(e){let{promise:t,resolve:n}=w(),i=new k,o=i.signal;return{value:e(async function*(){for(;;){let e=t;t=null;let{chunk:i,done:s,cb:a}=await e;if(r.nextTick(a),s)return;if(o.aborted)throw new p(void 0,{cause:o.reason});({promise:t,resolve:n}=w()),yield i}}(),{signal:o}),write(e,t,r){let i=n;n=null,i({chunk:e,done:!1,cb:r})},final(e){let t=n;n=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(s(e))return _(T,e,{objectMode:!0,write:i,final:o,destroy:a});let l=e?.then;if("function"==typeof l){let t,n=A(l,e,(e=>{if(null!=e)throw new y("nully","body",e)}),(e=>{b(t,e)}));return t=new T({objectMode:!0,readable:!1,write:i,final(e){o((async()=>{try{await n,r.nextTick(e,null)}catch(t){r.nextTick(e,t)}}))},destroy:a})}throw new y("Iterable, AsyncIterable or AsyncFunction",n,e)}if(S(t))return e(t.arrayBuffer());if(s(t))return _(T,t,{objectMode:!0,writable:!1});if("object"==typeof t?.writable||"object"==typeof t?.readable){return I({readable:null!=t&&t.readable?l(t?.readable)?t?.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(t?.writable)?t?.writable:e(t.writable):void 0})}let i=t?.then;if("function"==typeof i){let e;return A(i,t,(t=>{null!=t&&e.push(t),e.push(null)}),(t=>{b(e,t)})),e=new T({objectMode:!0,writable:!1,read(){}})}throw new g(n,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}})),un=u(((e,t)=>{nt(),ze(),f();var{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:n,ObjectKeys:i,ObjectSetPrototypeOf:o}=ot();t.exports=c;var s,a,l=sn(),u=an();o(c.prototype,l.prototype),o(c,l);{let e=i(u.prototype);for(let t=0;t<e.length;t++){let r=e[t];c.prototype[r]||(c.prototype[r]=u.prototype[r])}}function c(e){if(!(this instanceof c))return new c(e);l.call(this,e),u.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}function h(){return void 0===s&&(s={}),s}r(c.prototype,{writable:{__proto__:null,...n(u.prototype,"writable")},writableHighWaterMark:{__proto__:null,...n(u.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...n(u.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...n(u.prototype,"writableBuffer")},writableLength:{__proto__:null,...n(u.prototype,"writableLength")},writableFinished:{__proto__:null,...n(u.prototype,"writableFinished")},writableCorked:{__proto__:null,...n(u.prototype,"writableCorked")},writableEnded:{__proto__:null,...n(u.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...n(u.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),c.fromWeb=function(e,t){return h().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return h().newReadableWritablePairFromDuplex(e)},c.from=function(e){return a||(a=ln()),a(e,"body")}})),cn=u(((e,t)=>{nt(),ze(),f();var{ObjectSetPrototypeOf:r,Symbol:n}=ot();t.exports=l;var{ERR_METHOD_NOT_IMPLEMENTED:i}=lt().codes,o=un(),{getHighWaterMark:s}=Vt();r(l.prototype,o.prototype),r(l,o);var a=n("kCallback");function l(e){if(!(this instanceof l))return new l(e);let t=e?s(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),o.call(this,e),this._readableState.sync=!1,this[a]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",c)}function u(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush(((t,r)=>{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())}))}function c(){this._final!==u&&u.call(this)}l.prototype._final=u,l.prototype._transform=function(e,t,r){throw new i("_transform()")},l.prototype._write=function(e,t,r){let n=this._readableState,i=this._writableState,o=n.length;this._transform(e,t,((e,t)=>{e?r(e):(null!=t&&this.push(t),i.ended||o===n.length||n.length<n.highWaterMark?r():this[a]=r)}))},l.prototype._read=function(){if(this[a]){let e=this[a];this[a]=null,e()}}})),hn=u(((e,t)=>{nt(),ze(),f();var{ObjectSetPrototypeOf:r}=ot();t.exports=i;var n=cn();function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(i.prototype,n.prototype),r(i,n),i.prototype._transform=function(e,t,r){r(null,e)}})),fn=u(((e,t)=>{nt(),ze(),f();var r,n,i=ct(),{ArrayIsArray:o,Promise:s,SymbolAsyncIterator:a}=ot(),l=ft(),{once:u}=st(),c=dt(),h=un(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:y,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:v},AbortError:m}=lt(),{validateFunction:w,validateAbortSignal:_}=ut(),{isIterable:E,isReadable:S,isReadableNodeStream:k,isNodeStream:A,isTransformStream:T,isWebStream:I,isReadableStream:C,isReadableEnded:R}=ht(),O=globalThis.AbortController||at().AbortController;function M(e,t,r){let n=!1;return e.on("close",(()=>{n=!0})),{destroy:t=>{n||(n=!0,c.destroyer(e,t||new b("pipe")))},cleanup:l(e,{readable:t,writable:r},(e=>{n=!e}))}}function P(e){if(E(e))return e;if(k(e))return async function*(e){n||(n=sn()),yield*n.prototype[a].call(e)}(e);throw new p("val",["Readable","Iterable","AsyncIterable"],e)}async function x(e,t,r,{end:n}){let i,o=null,a=e=>{if(e&&(i=e),o){let e=o;o=null,e()}},u=()=>new s(((e,t)=>{i?t(i):o=()=>{i?t(i):e()}}));t.on("drain",a);let c=l(t,{readable:!1},a);try{t.writableNeedDrain&&await u();for await(let r of e)t.write(r)||await u();n&&t.end(),await u(),r()}catch(e){r(i!==e?d(i,e):e)}finally{c(),t.off("drain",a)}}async function B(e,t,r,{end:n}){T(t)&&(t=t.writable);let i=t.getWriter();try{for await(let t of e)await i.ready,i.write(t).catch((()=>{}));await i.ready,n&&await i.close(),r()}catch(e){try{await i.abort(e),r(e)}catch(e){r(e)}}}function L(e,t,n){if(1===e.length&&o(e[0])&&(e=e[0]),e.length<2)throw new y("streams");let s=new O,a=s.signal,l=n?.signal,u=[];function c(){L(new m)}_(l,"options.signal"),l?.addEventListener("abort",c);let f,d,b,v=[],w=0;function R(e){L(e,0==--w)}function L(e,r){if(e&&(!f||"ERR_STREAM_PREMATURE_CLOSE"===f.code)&&(f=e),f||r){for(;v.length;)v.shift()(f);l?.removeEventListener("abort",c),s.abort(),r&&(f||u.forEach((e=>e())),i.nextTick(t,f,d))}}for(let t=0;t<e.length;t++){let o=e[t],s=t<e.length-1,l=t>0,c=s||!1!==n?.end,f=t===e.length-1;if(A(o)){let e=function(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&R(e)};if(c){let{destroy:e,cleanup:t}=M(o,s,l);v.push(e),S(o)&&f&&u.push(t)}o.on("error",e),S(o)&&f&&u.push((()=>{o.removeListener("error",e)}))}if(0===t)if("function"==typeof o){if(b=o({signal:a}),!E(b))throw new g("Iterable, AsyncIterable or Stream","source",b)}else b=E(o)||k(o)||T(o)?o:h.from(o);else if("function"==typeof o){var N;if(T(b))b=P(null===(N=b)||void 0===N?void 0:N.readable);else b=P(b);if(b=o(b,{signal:a}),s){if(!E(b,!0))throw new g("AsyncIterable",`transform[${t-1}]`,b)}else{var j;r||(r=hn());let e=new r({objectMode:!0}),t=null===(j=b)||void 0===j?void 0:j.then;if("function"==typeof t)w++,t.call(b,(t=>{d=t,null!=t&&e.write(t),c&&e.end(),i.nextTick(R)}),(t=>{e.destroy(t),i.nextTick(R,t)}));else if(E(b,!0))w++,x(b,e,R,{end:c});else{if(!C(b)&&!T(b))throw new g("AsyncIterable or Promise","destination",b);{let t=b.readable||b;w++,x(t,e,R,{end:c})}}b=e;let{destroy:n,cleanup:o}=M(b,!1,!0);v.push(n),f&&u.push(o)}}else if(A(o)){if(k(b)){w+=2;let e=U(b,o,R,{end:c});S(o)&&f&&u.push(e)}else if(T(b)||C(b)){let e=b.readable||b;w++,x(e,o,R,{end:c})}else{if(!E(b))throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);w++,x(b,o,R,{end:c})}b=o}else if(I(o)){if(k(b))w++,B(P(b),o,R,{end:c});else if(C(b)||E(b))w++,B(b,o,R,{end:c});else{if(!T(b))throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],b);w++,B(b.readable,o,R,{end:c})}b=o}else b=h.from(o)}return(null!=a&&a.aborted||null!=l&&l.aborted)&&i.nextTick(c),b}function U(e,t,r,{end:n}){let o=!1;if(t.on("close",(()=>{o||r(new v)})),e.pipe(t,{end:!1}),n){let r=function(){o=!0,t.end()};R(e)?i.nextTick(r):e.once("end",r)}else r();return l(e,{readable:!0,writable:!1},(t=>{let n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)})),l(t,{readable:!1,writable:!0},r)}t.exports={pipelineImpl:L,pipeline:function(...e){return L(e,u(function(e){return w(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}})),dn=u(((e,t)=>{nt(),ze(),f();var{pipeline:r}=fn(),n=un(),{destroyer:i}=dt(),{isNodeStream:o,isReadable:s,isWritable:a,isWebStream:l,isTransformStream:u,isWritableStream:c,isReadableStream:h}=ht(),{AbortError:d,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:g}}=lt(),y=ft();t.exports=function(...e){if(0===e.length)throw new g("streams");if(1===e.length)return n.from(e[0]);let t,f,b,v,m,w=[...e];if("function"==typeof e[0]&&(e[0]=n.from(e[0])),"function"==typeof e[e.length-1]){let t=e.length-1;e[t]=n.from(e[t])}for(let t=0;t<e.length;++t)if(o(e[t])||l(e[t])){if(t<e.length-1&&!(s(e[t])||h(e[t])||u(e[t])))throw new p(`streams[${t}]`,w[t],"must be readable");if(t>0&&!(a(e[t])||c(e[t])||u(e[t])))throw new p(`streams[${t}]`,w[t],"must be writable")}let _=e[0],E=r(e,(function(e){let t=v;v=null,t?t(e):e?m.destroy(e):!k&&!S&&m.destroy()})),S=!!(a(_)||c(_)||u(_)),k=!!(s(E)||h(E)||u(E));if(m=new n({writableObjectMode:!(null==_||!_.writableObjectMode),readableObjectMode:!(null==E||!E.writableObjectMode),writable:S,readable:k}),S){if(o(_))m._write=function(e,r,n){_.write(e,r)?n():t=n},m._final=function(e){_.end(),f=e},_.on("drain",(function(){if(t){let e=t;t=null,e()}}));else if(l(_)){let e=(u(_)?_.writable:_).getWriter();m._write=async function(t,r,n){try{await e.ready,e.write(t).catch((()=>{})),n()}catch(e){n(e)}},m._final=async function(t){try{await e.ready,e.close().catch((()=>{})),f=t}catch(e){t(e)}}}let e=u(E)?E.readable:E;y(e,(()=>{if(f){let e=f;f=null,e()}}))}if(k)if(o(E))E.on("readable",(function(){if(b){let e=b;b=null,e()}})),E.on("end",(function(){m.push(null)})),m._read=function(){for(;;){let e=E.read();if(null===e)return void(b=m._read);if(!m.push(e))return}};else if(l(E)){let e=(u(E)?E.readable:E).getReader();m._read=async function(){for(;;)try{let{value:t,done:r}=await e.read();if(!m.push(t))return;if(r)return void m.push(null)}catch{return}}}return m._destroy=function(e,r){!e&&null!==v&&(e=new d),b=null,t=null,f=null,null===v?r(e):(v=r,o(E)&&i(E,e))},m}})),pn=u(((e,t)=>{nt(),ze(),f();var r=globalThis.AbortController||at().AbortController,{codes:{ERR_INVALID_ARG_VALUE:n,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:s},AbortError:a}=lt(),{validateAbortSignal:l,validateInteger:u,validateObject:c}=ut(),h=ot().Symbol("kWeak"),{finished:d}=ft(),p=dn(),{addAbortSignalNoValidate:g}=Ft(),{isWritable:y,isNodeStream:b}=ht(),{ArrayPrototypePush:v,MathFloor:m,Number:w,NumberIsNaN:_,Promise:E,PromiseReject:S,PromisePrototypeThen:k,Symbol:A}=ot(),T=A("kEmpty"),I=A("kEof");function C(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);null!=t&&c(t,"options"),null!=t?.signal&&l(t.signal,"options.signal");let n=1;return null!=t?.concurrency&&(n=m(t.concurrency)),u(n,"concurrency",1),async function*(){var i,o;let s=new r,l=this,u=[],c=s.signal,h={signal:c},f=()=>s.abort();null!=t&&null!==(i=t.signal)&&void 0!==i&&i.aborted&&f(),null==t||null===(o=t.signal)||void 0===o||o.addEventListener("abort",f);let d,p,g=!1;function y(){g=!0}!async function(){try{for await(let t of l){var r;if(g)return;if(c.aborted)throw new a;try{t=e(t,h)}catch(e){t=S(e)}t!==T&&("function"==typeof(null===(r=t)||void 0===r?void 0:r.catch)&&t.catch(y),u.push(t),d&&(d(),d=null),!g&&u.length&&u.length>=n&&await new E((e=>{p=e})))}u.push(I)}catch(e){let t=S(e);k(t,void 0,y),u.push(t)}finally{var i;g=!0,d&&(d(),d=null),null==t||null===(i=t.signal)||void 0===i||i.removeEventListener("abort",f)}}();try{for(;;){for(;u.length>0;){let e=await u[0];if(e===I)return;if(c.aborted)throw new a;e!==T&&(yield e),u.shift(),p&&(p(),p=null)}await new E((e=>{d=e}))}}finally{s.abort(),g=!0,p&&(p(),p=null)}}.call(this)}async function R(e,t=void 0){for await(let r of O.call(this,e,t))return!0;return!1}function O(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return C.call(this,(async function(t,r){return await e(t,r)?t:T}),t)}var M=class extends o{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};function P(e){if(e=w(e),_(e))return 0;if(e<0)throw new s("number",">= 0",e);return e}t.exports.streamReturningOperators={asIndexedPairs:function(e=void 0){return null!=e&&c(e,"options"),null!=e?.signal&&l(e.signal,"options.signal"),async function*(){let t=0;for await(let n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new a({cause:e.signal.reason});yield[t++,n]}}.call(this)},drop:function(e,t=void 0){return null!=t&&c(t,"options"),null!=t?.signal&&l(t.signal,"options.signal"),e=P(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new a;for await(let r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new a;e--<=0&&(yield r)}}.call(this)},filter:O,flatMap:function(e,t){let r=C.call(this,e,t);return async function*(){for await(let e of r)yield*e}.call(this)},map:C,take:function(e,t=void 0){return null!=t&&c(t,"options"),null!=t?.signal&&l(t.signal,"options.signal"),e=P(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new a;for await(let r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new a;if(!(e-- >0))return;yield r}}.call(this)},compose:function(e,t){if(null!=t&&c(t,"options"),null!=t?.signal&&l(t.signal,"options.signal"),b(e)&&!y(e))throw new n("stream",e,"must be writable");let r=p(this,e);return null!=t&&t.signal&&g(t.signal,r),r}},t.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return!await R.call(this,(async(...t)=>!await e(...t)),t)},forEach:async function(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);for await(let r of C.call(this,(async function(t,r){return await e(t,r),T}),t));},reduce:async function(e,t,n){var o;if("function"!=typeof e)throw new i("reducer",["Function","AsyncFunction"],e);null!=n&&c(n,"options"),null!=n?.signal&&l(n.signal,"options.signal");let s=arguments.length>1;if(null!=n&&null!==(o=n.signal)&&void 0!==o&&o.aborted){let e=new a(void 0,{cause:n.signal.reason});throw this.once("error",(()=>{})),await d(this.destroy(e)),e}let u=new r,f=u.signal;if(null!=n&&n.signal){let e={once:!0,[h]:this};n.signal.addEventListener("abort",(()=>u.abort()),e)}let p=!1;try{for await(let r of this){var g;if(p=!0,null!=n&&null!==(g=n.signal)&&void 0!==g&&g.aborted)throw new a;s?t=await e(t,r,{signal:f}):(t=r,s=!0)}if(!p&&!s)throw new M}finally{u.abort()}return t},toArray:async function(e){null!=e&&c(e,"options"),null!=e?.signal&&l(e.signal,"options.signal");let t=[];for await(let n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new a(void 0,{cause:e.signal.reason});v(t,n)}return t},some:R,find:async function(e,t){for await(let r of O.call(this,e,t))return r}}})),gn=u(((e,t)=>{nt(),ze(),f();var{ArrayPrototypePop:r,Promise:n}=ot(),{isIterable:i,isNodeStream:o,isWebStream:s}=ht(),{pipelineImpl:a}=fn(),{finished:l}=ft();yn(),t.exports={finished:l,pipeline:function(...e){return new n(((t,n)=>{let l,u,c=e[e.length-1];if(c&&"object"==typeof c&&!o(c)&&!i(c)&&!s(c)){let t=r(e);l=t.signal,u=t.end}a(e,((e,r)=>{e?n(e):t(r)}),{signal:l,end:u})}))}}})),yn=u(((e,t)=>{nt(),ze(),f();var{Buffer:r}=(rt(),h(He)),{ObjectDefineProperty:n,ObjectKeys:i,ReflectApply:o}=ot(),{promisify:{custom:s}}=st(),{streamReturningOperators:a,promiseReturningOperators:l}=pn(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=lt(),c=dn(),{pipeline:d}=fn(),{destroyer:p}=dt(),g=ft(),y=gn(),b=ht(),v=t.exports=Dt().Stream;v.isDisturbed=b.isDisturbed,v.isErrored=b.isErrored,v.isReadable=b.isReadable,v.Readable=sn();for(let e of i(a)){let t=function(...e){if(new.target)throw u();return v.Readable.from(o(r,this,e))};t;let r=a[e];n(t,"name",{__proto__:null,value:r.name}),n(t,"length",{__proto__:null,value:r.length}),n(v.Readable.prototype,e,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}for(let e of i(l)){let t=function(...e){if(new.target)throw u();return o(r,this,e)};t;let r=l[e];n(t,"name",{__proto__:null,value:r.name}),n(t,"length",{__proto__:null,value:r.length}),n(v.Readable.prototype,e,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}v.Writable=an(),v.Duplex=un(),v.Transform=cn(),v.PassThrough=hn(),v.pipeline=d;var{addAbortSignal:m}=Ft();v.addAbortSignal=m,v.finished=g,v.destroy=p,v.compose=c,n(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>y}),n(d,s,{__proto__:null,enumerable:!0,get:()=>y.pipeline}),n(g,s,{__proto__:null,enumerable:!0,get:()=>y.finished}),v.Stream=v,v._isUint8Array=function(e){return e instanceof Uint8Array},v._uint8ArrayToBuffer=function(e){return r.from(e.buffer,e.byteOffset,e.byteLength)}})),bn=u(((e,t)=>{nt(),ze(),f();var r=yn(),n=gn(),i=r.Readable.destroy;t.exports=r.Readable,t.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer,t.exports._isUint8Array=r._isUint8Array,t.exports.isDisturbed=r.isDisturbed,t.exports.isErrored=r.isErrored,t.exports.isReadable=r.isReadable,t.exports.Readable=r.Readable,t.exports.Writable=r.Writable,t.exports.Duplex=r.Duplex,t.exports.Transform=r.Transform,t.exports.PassThrough=r.PassThrough,t.exports.addAbortSignal=r.addAbortSignal,t.exports.finished=r.finished,t.exports.destroy=r.destroy,t.exports.destroy=i,t.exports.pipeline=r.pipeline,t.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get:()=>n}),t.exports.Stream=r.Stream,t.exports.default=t.exports})),vn=u(((e,t)=>{nt(),ze(),f(),"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),mn=u(((e,t)=>{nt(),ze(),f();var{Buffer:r}=(rt(),h(He)),n=Symbol.for("BufferList");function i(e){if(!(this instanceof i))return new i(e);i._init.call(this,e)}i._init=function(e){Object.defineProperty(this,n,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},i.prototype._new=function(e){return new i(e)},i.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let r=0;r<this._bufs.length;r++){let n=t+this._bufs[r].length;if(e<n||r===this._bufs.length-1)return[r,e-t];t=n}},i.prototype._reverseOffset=function(e){let t=e[0],r=e[1];for(let e=0;e<t;e++)r+=this._bufs[e].length;return r},i.prototype.get=function(e){if(e>this.length||e<0)return;let t=this._offset(e);return this._bufs[t[0]][t[1]]},i.prototype.slice=function(e,t){return"number"==typeof e&&e<0&&(e+=this.length),"number"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},i.prototype.copy=function(e,t,n,i){if(("number"!=typeof n||n<0)&&(n=0),("number"!=typeof i||i>this.length)&&(i=this.length),n>=this.length||i<=0)return e||r.alloc(0);let o=!!e,s=this._offset(n),a=i-n,l=a,u=o&&t||0,c=s[1];if(0===n&&i===this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:r.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,u),u+=this._bufs[t].length;return e}if(l<=this._bufs[s[0]].length-c)return o?this._bufs[s[0]].copy(e,t,c,c+l):this._bufs[s[0]].slice(c,c+l);o||(e=r.allocUnsafe(a));for(let t=s[0];t<this._bufs.length;t++){let r=this._bufs[t].length-c;if(!(l>r)){this._bufs[t].copy(e,u,c,c+l),u+=r;break}this._bufs[t].copy(e,u,c),u+=r,l-=r,c&&(c=0)}return e.length>u?e.slice(0,u):e},i.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();let r=this._offset(e),n=this._offset(t),i=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,n[1]),0!==r[1]&&(i[0]=i[0].slice(r[1])),this._new(i)},i.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)},i.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},i.prototype.duplicate=function(){let e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},i.prototype.append=function(e){if(null==e)return this;if(e.buffer)this._appendBuffer(r.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let t=0;t<e.length;t++)this.append(e[t]);else if(this._isBufferList(e))for(let t=0;t<e._bufs.length;t++)this.append(e._bufs[t]);else"number"==typeof e&&(e=e.toString()),this._appendBuffer(r.from(e));return this},i.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},i.prototype.indexOf=function(e,t,n){if(void 0===n&&"string"==typeof t&&(n=t,t=void 0),"function"==typeof e||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof e?e=r.from([e]):"string"==typeof e?e=r.from(e,n):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=r.from(e.buffer,e.byteOffset,e.byteLength):r.isBuffer(e)||(e=r.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;let i=this._offset(t),o=i[0],s=i[1];for(;o<this._bufs.length;o++){let t=this._bufs[o];for(;s<t.length;)if(t.length-s>=e.length){let r=t.indexOf(e,s);if(-1!==r)return this._reverseOffset([o,r]);s=t.length-e.length+1}else{let t=this._reverseOffset([o,s]);if(this._match(t,e))return t;s++}s=0}return-1},i.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0},function(){let e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let t in e)!function(t){i.prototype[t]=null===e[t]?function(e,r){return this.slice(e,e+r)[t](0,r)}:function(r=0){return this.slice(r,r+e[t])[t](0)}}(t)}(),i.prototype._isBufferList=function(e){return e instanceof i||i.isBufferList(e)},i.isBufferList=function(e){return null!=e&&e[n]},t.exports=i})),wn=u(((e,t)=>{nt(),ze(),f();var r=bn().Duplex,n=vn(),i=mn();function o(e){if(!(this instanceof o))return new o(e);if("function"==typeof e){this._callback=e;let t=function(e){this._callback&&(this._callback(e),this._callback=null)}.bind(this);this.on("pipe",(function(e){e.on("error",t)})),this.on("unpipe",(function(e){e.removeListener("error",t)})),e=null}i._init.call(this,e),r.call(this)}n(o,r),Object.assign(o.prototype,i.prototype),o.prototype._new=function(e){return new o(e)},o.prototype._write=function(e,t,r){this._appendBuffer(e),"function"==typeof r&&r()},o.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)},o.prototype.end=function(e){r.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},o.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},o.prototype._isBufferList=function(e){return e instanceof o||e instanceof i||o.isBufferList(e)},o.isBufferList=i.isBufferList,t.exports=o,t.exports.BufferListStream=o,t.exports.BufferList=i})),_n=u(((e,t)=>{nt(),ze(),f();t.exports=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}})),En=u(((e,t)=>{nt(),ze(),f();var r=t.exports,{Buffer:n}=(rt(),h(He));r.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},r.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},r.requiredHeaderFlagsErrors={};for(let e in r.requiredHeaderFlags){let t=r.requiredHeaderFlags[e];r.requiredHeaderFlagsErrors[e]="Invalid header flag bits, must be 0x"+t.toString(16)+" for "+r.types[e]+" packet"}r.codes={};for(let e in r.types){let t=r.types[e];r.codes[t]=e}r.CMD_SHIFT=4,r.CMD_MASK=240,r.DUP_MASK=8,r.QOS_MASK=3,r.QOS_SHIFT=1,r.RETAIN_MASK=1,r.VARBYTEINT_MASK=127,r.VARBYTEINT_FIN_MASK=128,r.VARBYTEINT_MAX=268435455,r.SESSIONPRESENT_MASK=1,r.SESSIONPRESENT_HEADER=n.from([r.SESSIONPRESENT_MASK]),r.CONNACK_HEADER=n.from([r.codes.connack<<r.CMD_SHIFT]),r.USERNAME_MASK=128,r.PASSWORD_MASK=64,r.WILL_RETAIN_MASK=32,r.WILL_QOS_MASK=24,r.WILL_QOS_SHIFT=3,r.WILL_FLAG_MASK=4,r.CLEAN_SESSION_MASK=2,r.CONNECT_HEADER=n.from([r.codes.connect<<r.CMD_SHIFT]),r.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},r.propertiesCodes={};for(let e in r.properties){let t=r.properties[e];r.propertiesCodes[t]=e}function i(e){return[0,1,2].map((t=>[0,1].map((i=>[0,1].map((o=>{let s=n.alloc(1);return s.writeUInt8(r.codes[e]<<r.CMD_SHIFT|(i?r.DUP_MASK:0)|t<<r.QOS_SHIFT|o,0,!0),s}))))))}r.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"},r.PUBLISH_HEADER=i("publish"),r.SUBSCRIBE_HEADER=i("subscribe"),r.SUBSCRIBE_OPTIONS_QOS_MASK=3,r.SUBSCRIBE_OPTIONS_NL_MASK=1,r.SUBSCRIBE_OPTIONS_NL_SHIFT=2,r.SUBSCRIBE_OPTIONS_RAP_MASK=1,r.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,r.SUBSCRIBE_OPTIONS_RH_MASK=3,r.SUBSCRIBE_OPTIONS_RH_SHIFT=4,r.SUBSCRIBE_OPTIONS_RH=[0,16,32],r.SUBSCRIBE_OPTIONS_NL=4,r.SUBSCRIBE_OPTIONS_RAP=8,r.SUBSCRIBE_OPTIONS_QOS=[0,1,2],r.UNSUBSCRIBE_HEADER=i("unsubscribe"),r.ACKS={unsuback:i("unsuback"),puback:i("puback"),pubcomp:i("pubcomp"),pubrel:i("pubrel"),pubrec:i("pubrec")},r.SUBACK_HEADER=n.from([r.codes.suback<<r.CMD_SHIFT]),r.VERSION3=n.from([3]),r.VERSION4=n.from([4]),r.VERSION5=n.from([5]),r.VERSION131=n.from([131]),r.VERSION132=n.from([132]),r.QOS=[0,1,2].map((e=>n.from([e]))),r.EMPTY={pingreq:n.from([r.codes.pingreq<<4,0]),pingresp:n.from([r.codes.pingresp<<4,0]),disconnect:n.from([r.codes.disconnect<<4,0])},r.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},r.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},r.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},r.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},r.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},r.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}})),Sn=u(((e,t)=>{nt(),ze(),f();var r=1e3,n=6e4,i=60*n,o=24*i,s=7*o,a=365.25*o;function l(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}t.exports=function(e,t){t=t||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var l=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*a;case"weeks":case"week":case"w":return l*s;case"days":case"day":case"d":return l*o;case"hours":case"hour":case"hrs":case"hr":case"h":return l*i;case"minutes":case"minute":case"mins":case"min":case"m":return l*n;case"seconds":case"second":case"secs":case"sec":case"s":return l*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}}}(e);if("number"===u&&isFinite(e))return t.long?function(e){var t=Math.abs(e);return t>=o?l(e,t,o,"day"):t>=i?l(e,t,i,"hour"):t>=n?l(e,t,n,"minute"):t>=r?l(e,t,r,"second"):e+" ms"}(e):function(e){var t=Math.abs(e);return t>=o?Math.round(e/o)+"d":t>=i?Math.round(e/i)+"h":t>=n?Math.round(e/n)+"m":t>=r?Math.round(e/r)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}})),kn=u(((e,t)=>{nt(),ze(),f(),t.exports=function(e){function t(e){let n,i,o,s=null;function a(...e){if(!a.enabled)return;let r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;let o=t.formatters[i];if("function"==typeof o){let t=e[s];n=o.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){let n=t(this.namespace+(typeof r>"u"?":":r)+e);return n.log=this.log,n}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){let e=[...t.names.map(n),...t.skips.map(n).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];let r,n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=Sn(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}})),An=u(((e,t)=>{nt(),ze(),f(),e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch{}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch{}return!t&&typeof d<"u"&&"env"in d&&(t=d.env.DEBUG),t},e.useColors=function(){return!(!(typeof window<"u"&&window.process)||"renderer"!==window.process.type&&!window.process.__nwjs)||!(typeof n<"u"&&n.userAgent&&n.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&(typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof n<"u"&&n.userAgent&&n.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof n<"u"&&n.userAgent&&n.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch{}}(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=kn()(e);var{formatters:r}=t.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}})),Tn=u(((e,t)=>{nt(),ze(),f();var r=wn(),{EventEmitter:n}=(jt(),h(Mt)),i=_n(),o=En(),s=An()("mqtt-packet:parser");t.exports=class e extends n{constructor(){super(),this.parser=this.constructor.parser}static parser(t){return this instanceof e?(this.settings=t||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new e).parser(t)}_resetState(){s("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new i,this.error=null,this._list=r(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),s("parse: current state: %s",this._states[this._stateCounter]);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,s("parse: state complete. _stateCounter is now: %d",this._stateCounter),s("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return s("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let e=this._list.readUInt8(0),t=e>>o.CMD_SHIFT;this.packet.cmd=o.types[t];let r=15&e,n=o.requiredHeaderFlags[t];return null!=n&&r!==n?this._emitError(new Error(o.requiredHeaderFlagsErrors[t])):(this.packet.retain=!!(e&o.RETAIN_MASK),this.packet.qos=e>>o.QOS_SHIFT&o.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=!!(e&o.DUP_MASK),s("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),s("_parseLength %d",e.value),!!e}_parsePayload(){s("_parsePayload: payload %O",this._list);let e=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}e=!0}return s("_parsePayload complete result: %s",e),e}_parseConnect(){s("_parseConnect");let e,t,r,n,i={},a=this.packet,l=this._parseString();if(null===l)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==l&&"MQIsdp"!==l)return this._emitError(new Error("Invalid protocolId"));if(a.protocolId=l,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(a.protocolVersion=this._list.readUInt8(this._pos),a.protocolVersion>=128&&(a.bridgeMode=!0,a.protocolVersion=a.protocolVersion-128),3!==a.protocolVersion&&4!==a.protocolVersion&&5!==a.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(1&this._list.readUInt8(this._pos))return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));i.username=this._list.readUInt8(this._pos)&o.USERNAME_MASK,i.password=this._list.readUInt8(this._pos)&o.PASSWORD_MASK,i.will=this._list.readUInt8(this._pos)&o.WILL_FLAG_MASK;let u=!!(this._list.readUInt8(this._pos)&o.WILL_RETAIN_MASK),c=(this._list.readUInt8(this._pos)&o.WILL_QOS_MASK)>>o.WILL_QOS_SHIFT;if(i.will)a.will={},a.will.retain=u,a.will.qos=c;else{if(u)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(c)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(a.clean=!!(this._list.readUInt8(this._pos)&o.CLEAN_SESSION_MASK),this._pos++,a.keepalive=this._parseNum(),-1===a.keepalive)return this._emitError(new Error("Packet too short"));if(5===a.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(a.properties=e)}let h=this._parseString();if(null===h)return this._emitError(new Error("Packet too short"));if(a.clientId=h,s("_parseConnect: packet.clientId: %s",a.clientId),i.will){if(5===a.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(a.will.properties=e)}if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse will topic"));if(a.will.topic=e,s("_parseConnect: packet.will.topic: %s",a.will.topic),t=this._parseBuffer(),null===t)return this._emitError(new Error("Cannot parse will payload"));a.will.payload=t,s("_parseConnect: packet.will.paylaod: %s",a.will.payload)}if(i.username){if(n=this._parseString(),null===n)return this._emitError(new Error("Cannot parse username"));a.username=n,s("_parseConnect: packet.username: %s",a.username)}if(i.password){if(r=this._parseBuffer(),null===r)return this._emitError(new Error("Cannot parse password"));a.password=r}return this.settings=a,s("_parseConnect: complete"),a}_parseConnack(){s("_parseConnack");let e=this.packet;if(this._list.length<1)return null;let t=this._list.readUInt8(this._pos++);if(t>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(e.sessionPresent=!!(t&o.SESSIONPRESENT_MASK),5===this.settings.protocolVersion)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else{if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++)}if(-1===e.returnCode||-1===e.reasonCode)return this._emitError(new Error("Cannot parse return code"));if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}s("_parseConnack: complete")}_parsePublish(){s("_parsePublish");let e=this.packet;if(e.topic=this._parseString(),null===e.topic)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),s("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){s("_parseSubscribe");let e,t,r,n,i,a,l,u=this.packet;if(u.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(u.properties=e)}if(u.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<u.length;){if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=u.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(t=this._parseByte(),5===this.settings.protocolVersion){if(192&t)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(252&t)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(r=t&o.SUBSCRIBE_OPTIONS_QOS_MASK,r>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(a=!!(t>>o.SUBSCRIBE_OPTIONS_NL_SHIFT&o.SUBSCRIBE_OPTIONS_NL_MASK),i=!!(t>>o.SUBSCRIBE_OPTIONS_RAP_SHIFT&o.SUBSCRIBE_OPTIONS_RAP_MASK),n=t>>o.SUBSCRIBE_OPTIONS_RH_SHIFT&o.SUBSCRIBE_OPTIONS_RH_MASK,n>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));l={topic:e,qos:r},5===this.settings.protocolVersion?(l.nl=a,l.rap=i,l.rh=n):this.settings.bridgeMode&&(l.rh=0,l.rap=!0,l.nl=!0),s("_parseSubscribe: push subscription `%s` to subscription",l),u.subscriptions.push(l)}}}_parseSuback(){s("_parseSuback");let e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let e=this._list.readUInt8(this._pos++);if(5===this.settings.protocolVersion){if(!o.MQTT5_SUBACK_CODES[e])return this._emitError(new Error("Invalid suback code"))}else if(e>2&&128!==e)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(e)}}}_parseUnsubscribe(){s("_parseUnsubscribe");let e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<e.length;){let t=this._parseString();if(null===t)return this._emitError(new Error("Cannot parse topic"));s("_parseUnsubscribe: push topic `%s` to unsubscriptions",t),e.unsubscriptions.push(t)}}}_parseUnsuback(){s("_parseUnsuback");let e=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((3===this.settings.protocolVersion||4===this.settings.protocolVersion)&&2!==e.length)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(e.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(5===this.settings.protocolVersion){let t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;){let e=this._list.readUInt8(this._pos++);if(!o.MQTT5_UNSUBACK_CODES[e])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(e)}}}_parseConfirmation(){s("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let e=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion){if(e.length>2){switch(e.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!o.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!o.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"))}s("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)}else e.reasonCode=0;if(e.length>3){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}}return!0}_parseDisconnect(){let e=this.packet;if(s("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?(e.reasonCode=this._parseByte(),o.MQTT5_DISCONNECT_CODES[e.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):e.reasonCode=0;let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return s("_parseDisconnect result: true"),!0}_parseAuth(){s("_parseAuth");let e=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(e.reasonCode=this._parseByte(),!o.MQTT5_AUTH_CODES[e.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),s("_parseAuth: result: true"),!0}_parseMessageId(){let e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(s("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){let t=this._parseNum(),r=t+this._pos;if(-1===t||r>this._list.length||r>this.packet.length)return null;let n=this._list.toString("utf8",this._pos,r);return this._pos+=t,s("_parseString: result: %s",n),n}_parseStringPair(){return s("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;let r=this._list.slice(this._pos,t);return this._pos+=e,s("_parseBuffer: result: %o",r),r}_parseNum(){if(this._list.length-this._pos<2)return-1;let e=this._list.readUInt16BE(this._pos);return this._pos+=2,s("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let e=this._list.readUInt32BE(this._pos);return this._pos+=4,s("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){s("_parseVarByteNum");let t,r=0,n=1,i=0,a=!1,l=this._pos?this._pos:0;for(;r<4&&l+r<this._list.length;){if(t=this._list.readUInt8(l+r++),i+=n*(t&o.VARBYTEINT_MASK),n*=128,!(t&o.VARBYTEINT_FIN_MASK)){a=!0;break}if(this._list.length<=r)break}return!a&&4===r&&this._list.length>=r&&this._emitError(new Error("Invalid variable byte integer")),l&&(this._pos+=r),a=!!a&&(e?{bytes:r,value:i}:i),s("_parseVarByteNum: result: %o",a),a}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),s("_parseByte: result: %o",e),e}_parseByType(e){switch(s("_parseByType: type: %s",e),e){case"byte":return 0!==this._parseByte();case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){s("_parseProperties");let e=this._parseVarByteNum(),t=this._pos+e,r={};for(;this._pos<t;){let e=this._parseByte();if(!e)return this._emitError(new Error("Cannot parse property code type")),!1;let t=o.propertiesCodes[e];if(!t)return this._emitError(new Error("Unknown property")),!1;if("userProperties"!==t)r[t]?(Array.isArray(r[t])||(r[t]=[r[t]]),r[t].push(this._parseByType(o.propertiesTypes[t]))):r[t]=this._parseByType(o.propertiesTypes[t]);else{r[t]||(r[t]=Object.create(null));let e=this._parseByType(o.propertiesTypes[t]);if(r[t][e.name])if(Array.isArray(r[t][e.name]))r[t][e.name].push(e.value);else{let n=r[t][e.name];r[t][e.name]=[n],r[t][e.name].push(e.value)}else r[t][e.name]=e.value}}return r}_newPacket(){return s("_newPacket"),this.packet&&(this._list.consume(this.packet.length),s("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),s("_newPacket: new packet"),this.packet=new i,this._pos=0,!0}_emitError(e){s("_emitError",e),this.error=e,this.emit("error",e)}}})),In=u(((e,t)=>{nt(),ze(),f();var{Buffer:r}=(rt(),h(He)),n={},i=r.isBuffer(r.from([1,2]).subarray(0,1));function o(e){let t=r.allocUnsafe(2);return t.writeUInt8(e>>8,0),t.writeUInt8(255&e,1),t}t.exports={cache:n,generateCache:function(){for(let e=0;e<65536;e++)n[e]=o(e)},generateNumber:o,genBufVariableByteInt:function(e){let t=0,n=0,o=r.allocUnsafe(4);do{t=e%128|0,(e=e/128|0)>0&&(t|=128),o.writeUInt8(t,n++)}while(e>0&&n<4);return e>0&&(n=0),i?o.subarray(0,n):o.slice(0,n)},generate4ByteBuffer:function(e){let t=r.allocUnsafe(4);return t.writeUInt32BE(e,0),t}}})),Cn=u(((e,t)=>{nt(),ze(),f(),typeof d>"u"||!d.version||0===d.version.indexOf("v0.")||0===d.version.indexOf("v1.")&&0!==d.version.indexOf("v1.8.")?t.exports={nextTick:function(e,t,r,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,o,s=arguments.length;switch(s){case 0:case 1:return d.nextTick(e);case 2:return d.nextTick((function(){e.call(null,t)}));case 3:return d.nextTick((function(){e.call(null,t,r)}));case 4:return d.nextTick((function(){e.call(null,t,r,n)}));default:for(i=new Array(s-1),o=0;o<i.length;)i[o++]=arguments[o];return d.nextTick((function(){e.apply(null,i)}))}}}:t.exports=d})),Rn=u(((e,t)=>{nt(),ze(),f();var r=En(),{Buffer:n}=(rt(),h(He)),i=n.allocUnsafe(0),o=n.from([0]),s=In(),a=Cn().nextTick,l=An()("mqtt-packet:writeToStream"),u=s.cache,c=s.generateNumber,d=s.generateCache,p=s.genBufVariableByteInt,g=s.generate4ByteBuffer,y=k,b=!0;function v(e,t,s){switch(l("generate called"),t.cork&&(t.cork(),a(m,t)),b&&(b=!1,d()),l("generate: packet.cmd: %s",e.cmd),e.cmd){case"connect":return function(e,t,i){let o=e||{},s=o.protocolId||"MQTT",a=o.protocolVersion||4,l=o.will,u=o.clean,c=o.keepalive||0,h=o.clientId||"",f=o.username,d=o.password,p=o.properties;void 0===u&&(u=!0);let g,b,v=0;if(!s||"string"!=typeof s&&!n.isBuffer(s))return t.destroy(new Error("Invalid protocolId")),!1;if(v+=s.length+2,3!==a&&4!==a&&5!==a)return t.destroy(new Error("Invalid protocol version")),!1;if(v+=1,("string"==typeof h||n.isBuffer(h))&&(h||a>=4)&&(h||u))v+=n.byteLength(h)+2;else{if(a<4)return t.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(1*u==0)return t.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if("number"!=typeof c||c<0||c>65535||c%1!=0)return t.destroy(new Error("Invalid keepalive")),!1;if(v+=2,v+=1,5===a){if(g=I(t,p),!g)return!1;v+=g.length}if(l){if("object"!=typeof l)return t.destroy(new Error("Invalid will")),!1;if(!l.topic||"string"!=typeof l.topic)return t.destroy(new Error("Invalid will topic")),!1;if(v+=n.byteLength(l.topic)+2,v+=2,l.payload){if(!(l.payload.length>=0))return t.destroy(new Error("Invalid will payload")),!1;"string"==typeof l.payload?v+=n.byteLength(l.payload):v+=l.payload.length}if(b={},5===a){if(b=I(t,l.properties),!b)return!1;v+=b.length}}let m=!1;if(null!=f){if(!P(f))return t.destroy(new Error("Invalid username")),!1;m=!0,v+=n.byteLength(f)+2}if(null!=d){if(!m)return t.destroy(new Error("Username is required to use password")),!1;if(!P(d))return t.destroy(new Error("Invalid password")),!1;v+=M(d)+2}t.write(r.CONNECT_HEADER),_(t,v),T(t,s),o.bridgeMode&&(a+=128),t.write(131===a?r.VERSION131:132===a?r.VERSION132:4===a?r.VERSION4:5===a?r.VERSION5:r.VERSION3);let w=0;return w|=null!=f?r.USERNAME_MASK:0,w|=null!=d?r.PASSWORD_MASK:0,w|=l&&l.retain?r.WILL_RETAIN_MASK:0,w|=l&&l.qos?l.qos<<r.WILL_QOS_SHIFT:0,w|=l?r.WILL_FLAG_MASK:0,w|=u?r.CLEAN_SESSION_MASK:0,t.write(n.from([w])),y(t,c),5===a&&g.write(),T(t,h),l&&(5===a&&b.write(),E(t,l.topic),T(t,l.payload)),null!=f&&T(t,f),null!=d&&T(t,d),!0}(e,t);case"connack":return function(e,t,i){let s=i?i.protocolVersion:4,a=e||{},l=5===s?a.reasonCode:a.returnCode,u=a.properties,c=2;if("number"!=typeof l)return t.destroy(new Error("Invalid return code")),!1;let h=null;if(5===s){if(h=I(t,u),!h)return!1;c+=h.length}return t.write(r.CONNACK_HEADER),_(t,c),t.write(a.sessionPresent?r.SESSIONPRESENT_HEADER:o),t.write(n.from([l])),h?.write(),!0}(e,t,s);case"publish":return function(e,t,o){l("publish: packet: %o",e);let s=o?o.protocolVersion:4,a=e||{},u=a.qos||0,c=a.retain?r.RETAIN_MASK:0,h=a.topic,f=a.payload||i,d=a.messageId,p=a.properties,g=0;if("string"==typeof h)g+=n.byteLength(h)+2;else{if(!n.isBuffer(h))return t.destroy(new Error("Invalid topic")),!1;g+=h.length+2}if(n.isBuffer(f)?g+=f.length:g+=n.byteLength(f),u&&"number"!=typeof d)return t.destroy(new Error("Invalid messageId")),!1;u&&(g+=2);let b=null;if(5===s){if(b=I(t,p),!b)return!1;g+=b.length}return t.write(r.PUBLISH_HEADER[u][a.dup?1:0][c?1:0]),_(t,g),y(t,M(h)),t.write(h),u>0&&y(t,d),b?.write(),l("publish: payload: %o",f),t.write(f)}(e,t,s);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.cmd||"puback",l=s.messageId,u=s.dup&&"pubrel"===a?r.DUP_MASK:0,c=0,h=s.reasonCode,f=s.properties,d=5===o?3:2;if("pubrel"===a&&(c=1),"number"!=typeof l)return t.destroy(new Error("Invalid messageId")),!1;let p=null;if(5===o&&"object"==typeof f){if(p=C(t,f,i,d),!p)return!1;d+=p.length}return t.write(r.ACKS[a][c][u][0]),3===d&&(d+=0!==h?1:-1),_(t,d),y(t,l),5===o&&2!==d&&t.write(n.from([h])),null!==p?p.write():4===d&&t.write(n.from([0])),!0}(e,t,s);case"subscribe":return function(e,t,i){l("subscribe: packet: ");let o=i?i.protocolVersion:4,s=e||{},a=s.dup?r.DUP_MASK:0,u=s.messageId,c=s.subscriptions,h=s.properties,f=0;if("number"!=typeof u)return t.destroy(new Error("Invalid messageId")),!1;f+=2;let d=null;if(5===o){if(d=I(t,h),!d)return!1;f+=d.length}if("object"!=typeof c||!c.length)return t.destroy(new Error("Invalid subscriptions")),!1;for(let e=0;e<c.length;e+=1){let r=c[e].topic,i=c[e].qos;if("string"!=typeof r)return t.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof i)return t.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(5===o){if("boolean"!=typeof(c[e].nl||!1))return t.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(c[e].rap||!1))return t.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let r=c[e].rh||0;if("number"!=typeof r||r>2)return t.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}f+=n.byteLength(r)+2+1}l("subscribe: writing to stream: %o",r.SUBSCRIBE_HEADER),t.write(r.SUBSCRIBE_HEADER[1][a?1:0][0]),_(t,f),y(t,u),null!==d&&d.write();let p=!0;for(let e of c){let i,s=e.topic,a=e.qos,l=+e.nl,u=+e.rap,c=e.rh;E(t,s),i=r.SUBSCRIBE_OPTIONS_QOS[a],5===o&&(i|=l?r.SUBSCRIBE_OPTIONS_NL:0,i|=u?r.SUBSCRIBE_OPTIONS_RAP:0,i|=c?r.SUBSCRIBE_OPTIONS_RH[c]:0),p=t.write(n.from([i]))}return p}(e,t,s);case"suback":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.messageId,l=s.granted,u=s.properties,c=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(c+=2,"object"!=typeof l||!l.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<l.length;e+=1){if("number"!=typeof l[e])return t.destroy(new Error("Invalid qos vector")),!1;c+=1}let h=null;if(5===o){if(h=C(t,u,i,c),!h)return!1;c+=h.length}return t.write(r.SUBACK_HEADER),_(t,c),y(t,a),null!==h&&h.write(),t.write(n.from(l))}(e,t,s);case"unsubscribe":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?r.DUP_MASK:0,u=s.unsubscriptions,c=s.properties,h=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(h+=2,"object"!=typeof u||!u.length)return t.destroy(new Error("Invalid unsubscriptions")),!1;for(let e=0;e<u.length;e+=1){if("string"!=typeof u[e])return t.destroy(new Error("Invalid unsubscriptions")),!1;h+=n.byteLength(u[e])+2}let f=null;if(5===o){if(f=I(t,c),!f)return!1;h+=f.length}t.write(r.UNSUBSCRIBE_HEADER[1][l?1:0][0]),_(t,h),y(t,a),null!==f&&f.write();let d=!0;for(let e=0;e<u.length;e++)d=E(t,u[e]);return d}(e,t,s);case"unsuback":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?r.DUP_MASK:0,u=s.granted,c=s.properties,h=s.cmd,f=0,d=2;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(5===o){if("object"!=typeof u||!u.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<u.length;e+=1){if("number"!=typeof u[e])return t.destroy(new Error("Invalid qos vector")),!1;d+=1}}let p=null;if(5===o){if(p=C(t,c,i,d),!p)return!1;d+=p.length}return t.write(r.ACKS[h][f][l][0]),_(t,d),y(t,a),null!==p&&p.write(),5===o&&t.write(n.from(u)),!0}(e,t,s);case"pingreq":case"pingresp":return function(e,t,n){return t.write(r.EMPTY[e.cmd])}(e,t);case"disconnect":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties,u=5===o?1:0,c=null;if(5===o){if(c=C(t,l,i,u),!c)return!1;u+=c.length}return t.write(n.from([r.codes.disconnect<<4])),_(t,u),5===o&&t.write(n.from([a])),null!==c&&c.write(),!0}(e,t,s);case"auth":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties,u=5===o?1:0;5!==o&&t.destroy(new Error("Invalid mqtt version for auth packet"));let c=C(t,l,i,u);return!!c&&(u+=c.length,t.write(n.from([r.codes.auth<<4])),_(t,u),t.write(n.from([a])),null!==c&&c.write(),!0)}(e,t,s);default:return t.destroy(new Error("Unknown command")),!1}}function m(e){e.uncork()}Object.defineProperty(v,"cacheNumbers",{get:()=>y===k,set(e){e?((!u||0===Object.keys(u).length)&&(b=!0),y=k):(b=!1,y=A)}});var w={};function _(e,t){if(t>r.VARBYTEINT_MAX)return e.destroy(new Error(`Invalid variable byte integer: ${t}`)),!1;let n=w[t];return n||(n=p(t),t<16384&&(w[t]=n)),l("writeVarByteInt: writing to stream: %o",n),e.write(n)}function E(e,t){let r=n.byteLength(t);return y(e,r),l("writeString: %s",t),e.write(t,"utf8")}function S(e,t,r){E(e,t),E(e,r)}function k(e,t){return l("writeNumberCached: number: %d",t),l("writeNumberCached: %o",u[t]),e.write(u[t])}function A(e,t){let r=c(t);return l("writeNumberGenerated: %o",r),e.write(r)}function T(e,t){"string"==typeof t?E(e,t):t?(y(e,t.length),e.write(t)):y(e,0)}function I(e,t){if("object"!=typeof t||null!=t.length)return{length:1,write(){O(e,{},0)}};let i=0;function o(t,i){let o=0;switch(r.propertiesTypes[t]){case"byte":if("boolean"!=typeof i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=2;break;case"int8":if("number"!=typeof i||i<0||i>255)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=2;break;case"binary":if(i&&null===i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=1+n.byteLength(i)+2;break;case"int16":if("number"!=typeof i||i<0||i>65535)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=3;break;case"int32":if("number"!=typeof i||i<0||i>4294967295)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=5;break;case"var":if("number"!=typeof i||i<0||i>268435455)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=1+n.byteLength(p(i));break;case"string":if("string"!=typeof i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=3+n.byteLength(i.toString());break;case"pair":if("object"!=typeof i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=Object.getOwnPropertyNames(i).reduce(((e,t)=>{let r=i[t];return Array.isArray(r)?e+=r.reduce(((e,r)=>e+=3+n.byteLength(t.toString())+2+n.byteLength(r.toString())),0):e+=3+n.byteLength(t.toString())+2+n.byteLength(i[t].toString()),e}),0);break;default:return e.destroy(new Error(`Invalid property ${t}: ${i}`)),!1}return o}if(t)for(let e in t){let r=0,n=0,s=t[e];if(Array.isArray(s))for(let t=0;t<s.length;t++){if(n=o(e,s[t]),!n)return!1;r+=n}else{if(n=o(e,s),!n)return!1;r=n}if(!r)return!1;i+=r}return{length:n.byteLength(p(i))+i,write(){O(e,t,i)}}}function C(e,t,r,n){let i=["reasonString","userProperties"],o=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0,s=I(e,t);if(o)for(;n+s.length>o;){let r=i.shift();if(!r||!t[r])return!1;delete t[r],s=I(e,t)}return s}function R(e,t,i){switch(r.propertiesTypes[t]){case"byte":e.write(n.from([r.properties[t]])),e.write(n.from([+i]));break;case"int8":e.write(n.from([r.properties[t]])),e.write(n.from([i]));break;case"binary":e.write(n.from([r.properties[t]])),T(e,i);break;case"int16":e.write(n.from([r.properties[t]])),y(e,i);break;case"int32":e.write(n.from([r.properties[t]])),function(e,t){let r=g(t);l("write4ByteNumber: %o",r),e.write(r)}(e,i);break;case"var":e.write(n.from([r.properties[t]])),_(e,i);break;case"string":e.write(n.from([r.properties[t]])),E(e,i);break;case"pair":Object.getOwnPropertyNames(i).forEach((o=>{let s=i[o];Array.isArray(s)?s.forEach((i=>{e.write(n.from([r.properties[t]])),S(e,o.toString(),i.toString())})):(e.write(n.from([r.properties[t]])),S(e,o.toString(),s.toString()))}));break;default:return e.destroy(new Error(`Invalid property ${t} value: ${i}`)),!1}}function O(e,t,r){_(e,r);for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&null!==t[r]){let n=t[r];if(Array.isArray(n))for(let t=0;t<n.length;t++)R(e,r,n[t]);else R(e,r,n)}}function M(e){return e?e instanceof n?e.length:n.byteLength(e):0}function P(e){return"string"==typeof e||e instanceof n}t.exports=v})),On=u(((e,t)=>{nt(),ze(),f();var r=Rn(),{EventEmitter:n}=(jt(),h(Mt)),{Buffer:i}=(rt(),h(He));var o=class extends n{constructor(){super(),this._array=new Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e,t=0,r=new Array(this._array.length),n=this._array,o=0;for(e=0;e<n.length&&void 0!==n[e];e++)"string"!=typeof n[e]?r[e]=n[e].length:r[e]=i.byteLength(n[e]),t+=r[e];let s=i.allocUnsafe(t);for(e=0;e<n.length&&void 0!==n[e];e++)"string"!=typeof n[e]?(n[e].copy(s,o),o+=r[e]):(s.write(n[e],o),o+=r[e]);return s}destroy(e){e&&this.emit("error",e)}};t.exports=function(e,t){let n=new o;return r(e,n,t),n.concat()}})),Mn=u((e=>{nt(),ze(),f(),e.parser=Tn().parser,e.generate=On(),e.writeToStream=Rn()})),Pn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(){this.nextId=Math.max(1,Math.floor(65535*Math.random()))}allocate(){let e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e}getLastAllocated(){return 1===this.nextId?65535:this.nextId-1}register(e){return!0}deallocate(e){}clear(){}}})),xn=u(((e,t)=>{function r(e){return e instanceof Ze?Ze.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}nt(),ze(),f(),t.exports=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(o){if("object"!=typeof o||null===o)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return i(o,e);if(o instanceof Map)return new Map(i(Array.from(o),e));if(o instanceof Set)return new Set(i(Array.from(o),e));var s={};for(var a in t.push(o),n.push(s),o){var l=o[a];if("object"!=typeof l||null===l)s[a]=l;else if(l instanceof Date)s[a]=new Date(l);else if(l instanceof Map)s[a]=new Map(i(Array.from(l),e));else if(l instanceof Set)s[a]=new Set(i(Array.from(l),e));else if(ArrayBuffer.isView(l))s[a]=r(l);else{var u=t.indexOf(l);s[a]=-1!==u?n[u]:e(l)}}return t.pop(),n.pop(),s}:function e(o){if("object"!=typeof o||null===o)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return i(o,e);if(o instanceof Map)return new Map(i(Array.from(o),e));if(o instanceof Set)return new Set(i(Array.from(o),e));var s={};for(var a in t.push(o),n.push(s),o)if(!1!==Object.hasOwnProperty.call(o,a)){var l=o[a];if("object"!=typeof l||null===l)s[a]=l;else if(l instanceof Date)s[a]=new Date(l);else if(l instanceof Map)s[a]=new Map(i(Array.from(l),e));else if(l instanceof Set)s[a]=new Set(i(Array.from(l),e));else if(ArrayBuffer.isView(l))s[a]=r(l);else{var u=t.indexOf(l);s[a]=-1!==u?n[u]:e(l)}}return t.pop(),n.pop(),s};function i(e,i){for(var o=Object.keys(e),s=new Array(o.length),a=0;a<o.length;a++){var l=o[a],u=e[l];if("object"!=typeof u||null===u)s[l]=u;else if(u instanceof Date)s[l]=new Date(u);else if(ArrayBuffer.isView(u))s[l]=r(u);else{var c=t.indexOf(u);s[l]=-1!==c?n[c]:i(u)}}return s}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var i={};for(var o in n){var s=n[o];"object"!=typeof s||null===s?i[o]=s:s instanceof Date?i[o]=new Date(s):s instanceof Map?i[o]=new Map(t(Array.from(s),e)):s instanceof Set?i[o]=new Set(t(Array.from(s),e)):ArrayBuffer.isView(s)?i[o]=r(s):i[o]=e(s)}return i}:function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var i={};for(var o in n)if(!1!==Object.hasOwnProperty.call(n,o)){var s=n[o];"object"!=typeof s||null===s?i[o]=s:s instanceof Date?i[o]=new Date(s):s instanceof Map?i[o]=new Map(t(Array.from(s),e)):s instanceof Set?i[o]=new Set(t(Array.from(s),e)):ArrayBuffer.isView(s)?i[o]=r(s):i[o]=e(s)}return i};function t(e,t){for(var n=Object.keys(e),i=new Array(n.length),o=0;o<n.length;o++){var s=n[o],a=e[s];"object"!=typeof a||null===a?i[s]=a:a instanceof Date?i[s]=new Date(a):ArrayBuffer.isView(a)?i[s]=r(a):i[s]=t(a)}return i}}})),Bn=u(((e,t)=>{nt(),ze(),f(),t.exports=xn()()})),Ln=u((e=>{function t(e){let t=e.split("/");for(let e=0;e<t.length;e++)if("+"!==t[e]){if("#"===t[e])return e===t.length-1;if(-1!==t[e].indexOf("+")||-1!==t[e].indexOf("#"))return!1}return!0}nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0}),e.validateTopics=e.validateTopic=void 0,e.validateTopic=t,e.validateTopics=function(e){if(0===e.length)return"empty_topic_list";for(let r=0;r<e.length;r++)if(!t(e[r]))return e[r];return null}})),Un=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});var t=bn(),r={objectMode:!0},n={clean:!0};e.default=class{constructor(e){this.options=e||{},this.options=Object.assign(Object.assign({},n),e),this._inflights=new Map}put(e,t){return this._inflights.set(e.messageId,e),t&&t(),this}createStream(){let e=new t.Readable(r),n=[],i=!1,o=0;return this._inflights.forEach(((e,t)=>{n.push(e)})),e._read=()=>{!i&&o<n.length?e.push(n[o++]):e.push(null)},e.destroy=t=>{if(!i)return i=!0,setTimeout((()=>{e.emit("close")}),0),e},e}del(e,t){let r=this._inflights.get(e.messageId);return r?(this._inflights.delete(e.messageId),t(null,r)):t&&t(new Error("missing packet")),this}get(e,t){let r=this._inflights.get(e.messageId);return r?t(null,r):t&&t(new Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e()}}})),Nn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});var t=[0,16,128,131,135,144,145,151,153];e.default=(e,r,n)=>{e.log("handlePublish: packet %o",r),n=typeof n<"u"?n:e.noop;let i=r.topic.toString(),o=r.payload,{qos:s}=r,{messageId:a}=r,{options:l}=e;if(5===e.options.protocolVersion){let t;if(r.properties&&(t=r.properties.topicAlias),typeof t<"u")if(0===i.length){if(!(t>0&&t<=65535))return e.log("handlePublish :: topic alias out of range. alias: %d",t),void e.emit("error",new Error("Received Topic Alias is out of range"));{let r=e.topicAliasRecv.getTopicByAlias(t);if(!r)return e.log("handlePublish :: unregistered topic alias. alias: %d",t),void e.emit("error",new Error("Received unregistered Topic Alias"));i=r,e.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",i,t)}}else{if(!e.topicAliasRecv.put(i,t))return e.log("handlePublish :: topic alias out of range. alias: %d",t),void e.emit("error",new Error("Received Topic Alias is out of range"));e.log("handlePublish :: registered topic: %s - alias: %d",i,t)}}switch(e.log("handlePublish: qos %d",s),s){case 2:l.customHandleAcks(i,o,r,((i,o)=>("number"==typeof i&&(o=i,i=null),i?e.emit("error",i):-1===t.indexOf(o)?e.emit("error",new Error("Wrong reason code for pubrec")):void(o?e._sendPacket({cmd:"pubrec",messageId:a,reasonCode:o},n):e.incomingStore.put(r,(()=>{e._sendPacket({cmd:"pubrec",messageId:a},n)}))))));break;case 1:l.customHandleAcks(i,o,r,((s,l)=>("number"==typeof s&&(l=s,s=null),s?e.emit("error",s):-1===t.indexOf(l)?e.emit("error",new Error("Wrong reason code for puback")):(l||e.emit("message",i,o,r),void e.handleMessage(r,(t=>{if(t)return n&&n(t);e._sendPacket({cmd:"puback",messageId:a,reasonCode:l},n)}))))));break;case 0:e.emit("message",i,o,r),e.handleMessage(r,n);break;default:e.log("handlePublish: unknown QoS. Doing nothing.")}}})),jn=u(((e,t)=>{t.exports={version:"5.7.3"}})),Dn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0}),e.MQTTJS_VERSION=e.nextTick=e.applyMixin=e.ErrorWithReasonCode=void 0;var t=class e extends Error{constructor(t,r){super(t),this.code=r,Object.setPrototypeOf(this,e.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};e.ErrorWithReasonCode=t,e.applyMixin=function(e,t,r=!1){var n;let i=[t];for(;;){let e=i[0],t=Object.getPrototypeOf(e);if(!t?.prototype)break;i.unshift(t)}for(let t of i)for(let i of Object.getOwnPropertyNames(t.prototype))(r||"constructor"!==i)&&Object.defineProperty(e.prototype,i,null!==(n=Object.getOwnPropertyDescriptor(t.prototype,i))&&void 0!==n?n:Object.create(null))},e.nextTick="function"==typeof(null==d?void 0:d.nextTick)?d.nextTick:e=>{setTimeout(e,0)},e.MQTTJS_VERSION=jn().version})),Fn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=void 0,e.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};e.default=(t,r)=>{let{messageId:n}=r,i=r.cmd,o=null,s=t.outgoing[n]?t.outgoing[n].cb:null,a=null;if(s){switch(t.log("_handleAck :: packet type",i),i){case"pubcomp":case"puback":{let i=r.reasonCode;i&&i>0&&16!==i?(a=new Error(`Publish error: ${e.ReasonCodes[i]}`),a.code=i,t._removeOutgoingAndStoreMessage(n,(()=>{s(a,r)}))):t._removeOutgoingAndStoreMessage(n,s);break}case"pubrec":{o={cmd:"pubrel",qos:2,messageId:n};let i=r.reasonCode;i&&i>0&&16!==i?(a=new Error(`Publish error: ${e.ReasonCodes[i]}`),a.code=i,t._removeOutgoingAndStoreMessage(n,(()=>{s(a,r)}))):t._sendPacket(o);break}case"suback":{delete t.outgoing[n],t.messageIdProvider.deallocate(n);let i=r.granted;for(let r=0;r<i.length;r++){let o=i[r];if(128&o){a=new Error(`Subscribe error: ${e.ReasonCodes[o]}`),a.code=o;let r=t.messageIdToTopic[n];r&&r.forEach((e=>{delete t._resubscribeTopics[e]}))}}delete t.messageIdToTopic[n],t._invokeStoreProcessingQueue(),s(a,r);break}case"unsuback":delete t.outgoing[n],t.messageIdProvider.deallocate(n),t._invokeStoreProcessingQueue(),s(null);break;default:t.emit("error",new Error("unrecognized packet type"))}t.disconnecting&&0===Object.keys(t.outgoing).length&&t.emit("outgoingEmpty")}else t.log("_handleAck :: Server sent an ack in error. Ignoring.")}})),Wn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});var t=Dn(),r=Fn();e.default=(e,n)=>{let{options:i}=e,o=i.protocolVersion,s=5===o?n.reasonCode:n.returnCode;if(5===o)e.handleAuth(n,((n,i)=>{if(n)e.emit("error",n);else if(24===s)e.reconnecting=!1,e._sendPacket(i);else{let n=new t.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[s]}`,s);e.emit("error",n)}}));else{let r=new t.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${o}`,s);e.emit("error",r)}}})),Vn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var t="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,r=new Set,n="object"==typeof d&&d?d:{},i=(e,t,r,i)=>{"function"==typeof n.emitWarning?n.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)},o=globalThis.AbortController,s=globalThis.AbortSignal;if(typeof o>"u"){s=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},o=class{constructor(){t()}signal=new s;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==n.env?.LRU_CACHE_IGNORE_AC_WARNING,t=()=>{e&&(e=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}Symbol("type");var a=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),l=e=>a(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?u:null:null,u=class extends Array{constructor(e){super(e),this.fill(0)}},c=class e{heap;length;static#e=!1;static create(t){let r=l(t);if(!r)return[];e.#e=!0;let n=new e(t,r);return e.#e=!1,n}constructor(t,r){if(!e.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},h=class e{#e;#t;#r;#n;#i;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#s;#a;#l;#u;#c;#h;#f;#d;#p;#g;#y;#b;#v;#m;#w;#_;static unsafeExposeInternals(e){return{starts:e.#b,ttls:e.#v,sizes:e.#y,keyMap:e.#a,keyList:e.#l,valList:e.#u,next:e.#c,prev:e.#h,get head(){return e.#f},get tail(){return e.#d},free:e.#p,isBackgroundFetch:t=>e.#E(t),backgroundFetch:(t,r,n,i)=>e.#S(t,r,n,i),moveToTail:t=>e.#k(t),indexes:t=>e.#A(t),rindexes:t=>e.#T(t),isStale:t=>e.#I(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#s}get size(){return this.#o}get fetchMethod(){return this.#i}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(t){let{max:n=0,ttl:o,ttlResolution:s=1,ttlAutopurge:u,updateAgeOnGet:h,updateAgeOnHas:f,allowStale:d,dispose:p,disposeAfter:g,noDisposeOnSet:y,noUpdateTTL:b,maxSize:v=0,maxEntrySize:m=0,sizeCalculation:w,fetchMethod:_,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:A,ignoreFetchAbort:T}=t;if(0!==n&&!a(n))throw new TypeError("max option must be a nonnegative integer");let I=n?l(n):Array;if(!I)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=v,this.maxEntrySize=m||this.#t,this.sizeCalculation=w,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==_&&"function"!=typeof _)throw new TypeError("fetchMethod must be a function if specified");if(this.#i=_,this.#w=!!_,this.#a=new Map,this.#l=new Array(n).fill(void 0),this.#u=new Array(n).fill(void 0),this.#c=new I(n),this.#h=new I(n),this.#f=0,this.#d=0,this.#p=c.create(n),this.#o=0,this.#s=0,"function"==typeof p&&(this.#r=p),"function"==typeof g?(this.#n=g,this.#g=[]):(this.#n=void 0,this.#g=void 0),this.#m=!!this.#r,this.#_=!!this.#n,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!k,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!T,0!==this.maxEntrySize){if(0!==this.#t&&!a(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!a(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!d,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!f,this.ttlResolution=a(s)||0===s?s:1,this.ttlAutopurge=!!u,this.ttl=o||0,this.ttl){if(!a(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#R()}if(0===this.#e&&0===this.ttl&&0===this.#t)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t="LRU_CACHE_UNBOUNDED";(e=>!r.has(e))(t)&&(r.add(t),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,e))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#R(){let e=new u(this.#e),r=new u(this.#e);this.#v=e,this.#b=r,this.#O=(n,i,o=t.now())=>{if(r[n]=0!==i?o:0,e[n]=i,0!==i&&this.ttlAutopurge){let e=setTimeout((()=>{this.#I(n)&&this.delete(this.#l[n])}),i+1);e.unref&&e.unref()}},this.#M=n=>{r[n]=0!==e[n]?t.now():0},this.#P=(t,o)=>{if(e[o]){let s=e[o],a=r[o];t.ttl=s,t.start=a,t.now=n||i();let l=t.now-a;t.remainingTTL=s-l}};let n=0,i=()=>{let e=t.now();if(this.ttlResolution>0){n=e;let t=setTimeout((()=>n=0),this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=t=>{let o=this.#a.get(t);if(void 0===o)return 0;let s=e[o],a=r[o];return 0===s||0===a?1/0:s-((n||i())-a)},this.#I=t=>0!==e[t]&&0!==r[t]&&(n||i())-r[t]>e[t]}#M=()=>{};#P=()=>{};#O=()=>{};#I=()=>!1;#C(){let e=new u(this.#e);this.#s=0,this.#y=e,this.#x=t=>{this.#s-=e[t],e[t]=0},this.#B=(e,t,r,n)=>{if(this.#E(t))return 0;if(!a(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(t,e),!a(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#L=(t,r,n)=>{if(e[t]=r,this.#t){let r=this.#t-e[t];for(;this.#s>r;)this.#U(!0)}this.#s+=e[t],n&&(n.entrySize=r,n.totalCalculatedSize=this.#s)}}#x=e=>{};#L=(e,t,r)=>{};#B=(e,t,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#d;this.#N(t)&&((e||!this.#I(t))&&(yield t),t!==this.#f);)t=this.#h[t]}*#T({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#f;this.#N(t)&&((e||!this.#I(t))&&(yield t),t!==this.#d);)t=this.#c[t]}#N(e){return void 0!==e&&this.#a.get(this.#l[e])===e}*entries(){for(let e of this.#A())void 0!==this.#u[e]&&void 0!==this.#l[e]&&!this.#E(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*rentries(){for(let e of this.#T())void 0!==this.#u[e]&&void 0!==this.#l[e]&&!this.#E(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*keys(){for(let e of this.#A()){let t=this.#l[e];void 0!==t&&!this.#E(this.#u[e])&&(yield t)}}*rkeys(){for(let e of this.#T()){let t=this.#l[e];void 0!==t&&!this.#E(this.#u[e])&&(yield t)}}*values(){for(let e of this.#A())void 0!==this.#u[e]&&!this.#E(this.#u[e])&&(yield this.#u[e])}*rvalues(){for(let e of this.#T())void 0!==this.#u[e]&&!this.#E(this.#u[e])&&(yield this.#u[e])}[Symbol.iterator](){return this.entries()}find(e,t={}){for(let r of this.#A()){let n=this.#u[r],i=this.#E(n)?n.__staleWhileFetching:n;if(void 0!==i&&e(i,this.#l[r],this))return this.get(this.#l[r],t)}}forEach(e,t=this){for(let r of this.#A()){let n=this.#u[r],i=this.#E(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#l[r],this)}}rforEach(e,t=this){for(let r of this.#T()){let n=this.#u[r],i=this.#E(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#l[r],this)}}purgeStale(){let e=!1;for(let t of this.#T({allowStale:!0}))this.#I(t)&&(this.delete(this.#l[t]),e=!0);return e}dump(){let e=[];for(let r of this.#A({allowStale:!0})){let n=this.#l[r],i=this.#u[r],o=this.#E(i)?i.__staleWhileFetching:i;if(void 0===o||void 0===n)continue;let s={value:o};if(this.#v&&this.#b){s.ttl=this.#v[r];let e=t.now()-this.#b[r];s.start=Math.floor(Date.now()-e)}this.#y&&(s.size=this.#y[r]),e.unshift([n,s])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let e=Date.now()-n.start;n.start=t.now()-e}this.set(r,n.value,n)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;let{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,u=this.#B(e,t,r.size||0,s);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.delete(e),this;let c=0===this.#o?void 0:this.#a.get(e);if(void 0===c)c=0===this.#o?this.#d:0!==this.#p.length?this.#p.pop():this.#o===this.#e?this.#U(!1):this.#o,this.#l[c]=e,this.#u[c]=t,this.#a.set(e,c),this.#c[this.#d]=c,this.#h[c]=this.#d,this.#d=c,this.#o++,this.#L(c,u,a),a&&(a.set="add"),l=!1;else{this.#k(c);let r=this.#u[c];if(t!==r){if(this.#w&&this.#E(r)){r.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:t}=r;void 0!==t&&!o&&(this.#m&&this.#r?.(t,e,"set"),this.#_&&this.#g?.push([t,e,"set"]))}else o||(this.#m&&this.#r?.(r,e,"set"),this.#_&&this.#g?.push([r,e,"set"]));if(this.#x(c),this.#L(c,u,a),this.#u[c]=t,a){a.set="replace";let e=r&&this.#E(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0!==n&&!this.#v&&this.#R(),this.#v&&(l||this.#O(c,n,i),a&&this.#P(a,c)),!o&&this.#_&&this.#g){let e,t=this.#g;for(;e=t?.shift();)this.#n?.(...e)}return this}pop(){try{for(;this.#o;){let e=this.#u[this.#f];if(this.#U(!0),this.#E(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#_&&this.#g){let e,t=this.#g;for(;e=t?.shift();)this.#n?.(...e)}}}#U(e){let t=this.#f,r=this.#l[t],n=this.#u[t];return this.#w&&this.#E(n)?n.__abortController.abort(new Error("evicted")):(this.#m||this.#_)&&(this.#m&&this.#r?.(n,r,"evict"),this.#_&&this.#g?.push([n,r,"evict"])),this.#x(t),e&&(this.#l[t]=void 0,this.#u[t]=void 0,this.#p.push(t)),1===this.#o?(this.#f=this.#d=0,this.#p.length=0):this.#f=this.#c[t],this.#a.delete(r),this.#o--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,i=this.#a.get(e);if(void 0!==i){let e=this.#u[i];if(this.#E(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#I(i))return r&&this.#M(i),n&&(n.has="hit",this.#P(n,i)),!0;n&&(n.has="stale",this.#P(n,i))}else n&&(n.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,n=this.#a.get(e);if(void 0!==n&&(r||!this.#I(n))){let e=this.#u[n];return this.#E(e)?e.__staleWhileFetching:e}}#S(e,t,r,n){let i=void 0===t?void 0:this.#u[t];if(this.#E(i))return i;let s=new o,{signal:a}=r;a?.addEventListener("abort",(()=>s.abort(a.reason)),{signal:s.signal});let l={signal:s.signal,options:r,context:n},u=(n,i=!1)=>{let{aborted:o}=s.signal,a=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(o&&!i?(r.status.fetchAborted=!0,r.status.fetchError=s.signal.reason,a&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),o&&!a&&!i)return c(s.signal.reason);let u=h;return this.#u[t]===h&&(void 0===n?u.__staleWhileFetching?this.#u[t]=u.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,n,l.options))),n},c=n=>{let{aborted:i}=s.signal,o=i&&r.allowStaleOnFetchAbort,a=o||r.allowStaleOnFetchRejection,l=a||r.noDeleteOnFetchRejection,u=h;if(this.#u[t]===h&&(l&&void 0!==u.__staleWhileFetching?o||(this.#u[t]=u.__staleWhileFetching):this.delete(e)),a)return r.status&&void 0!==u.__staleWhileFetching&&(r.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw n};r.status&&(r.status.fetchDispatched=!0);let h=new Promise(((t,n)=>{let o=this.#i?.(e,i,l);o&&o instanceof Promise&&o.then((e=>t(void 0===e?void 0:e)),n),s.signal.addEventListener("abort",(()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>u(e,!0)))}))})).then(u,(e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),c(e)))),f=Object.assign(h,{__abortController:s,__staleWhileFetching:i,__returned:void 0});return void 0===t?(this.set(e,f,{...l.options,status:void 0}),t=this.#a.get(e)):this.#u[t]=f,f}#E(e){if(!this.#w)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof o}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:p,forceRefresh:g=!1,status:y,signal:b}=t;if(!this.#w)return y&&(y.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:y});let v={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:d,ignoreFetchAbort:f,status:y,signal:b},m=this.#a.get(e);if(void 0===m){y&&(y.fetch="miss");let t=this.#S(e,m,v,p);return t.__returned=t}{let t=this.#u[m];if(this.#E(t)){let e=r&&void 0!==t.__staleWhileFetching;return y&&(y.fetch="inflight",e&&(y.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#I(m);if(!g&&!i)return y&&(y.fetch="hit"),this.#k(m),n&&this.#M(m),y&&this.#P(y,m),t;let o=this.#S(e,m,v,p),s=void 0!==o.__staleWhileFetching&&r;return y&&(y.fetch=i?"stale":"refresh",s&&i&&(y.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=t,s=this.#a.get(e);if(void 0!==s){let t=this.#u[s],a=this.#E(t);return o&&this.#P(o,s),this.#I(s)?(o&&(o.get="stale"),a?(o&&r&&void 0!==t.__staleWhileFetching&&(o.returnedStale=!0),r?t.__staleWhileFetching:void 0):(i||this.delete(e),o&&r&&(o.returnedStale=!0),r?t:void 0)):(o&&(o.get="hit"),a?t.__staleWhileFetching:(this.#k(s),n&&this.#M(s),t))}o&&(o.get="miss")}#j(e,t){this.#h[t]=e,this.#c[e]=t}#k(e){e!==this.#d&&(e===this.#f?this.#f=this.#c[e]:this.#j(this.#h[e],this.#c[e]),this.#j(this.#d,e),this.#d=e)}delete(e){let t=!1;if(0!==this.#o){let r=this.#a.get(e);if(void 0!==r)if(t=!0,1===this.#o)this.clear();else{this.#x(r);let t=this.#u[r];this.#E(t)?t.__abortController.abort(new Error("deleted")):(this.#m||this.#_)&&(this.#m&&this.#r?.(t,e,"delete"),this.#_&&this.#g?.push([t,e,"delete"])),this.#a.delete(e),this.#l[r]=void 0,this.#u[r]=void 0,r===this.#d?this.#d=this.#h[r]:r===this.#f?this.#f=this.#c[r]:(this.#c[this.#h[r]]=this.#c[r],this.#h[this.#c[r]]=this.#h[r]),this.#o--,this.#p.push(r)}}if(this.#_&&this.#g?.length){let e,t=this.#g;for(;e=t?.shift();)this.#n?.(...e)}return t}clear(){for(let e of this.#T({allowStale:!0})){let t=this.#u[e];if(this.#E(t))t.__abortController.abort(new Error("deleted"));else{let r=this.#l[e];this.#m&&this.#r?.(t,r,"delete"),this.#_&&this.#g?.push([t,r,"delete"])}}if(this.#a.clear(),this.#u.fill(void 0),this.#l.fill(void 0),this.#v&&this.#b&&(this.#v.fill(0),this.#b.fill(0)),this.#y&&this.#y.fill(0),this.#f=0,this.#d=0,this.#p.length=0,this.#s=0,this.#o=0,this.#_&&this.#g){let e,t=this.#g;for(;e=t?.shift();)this.#n?.(...e)}}};e.LRUCache=h})),zn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.ContainerIterator=e.Container=e.Base=void 0;e.ContainerIterator=class{constructor(e=0){this.iteratorType=e}equals(e){return this.o===e.o}};var t=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return 0===this.i}};e.Base=t;e.Container=class extends t{}})),Hn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=zn(),r=class extends t.Base{constructor(e=[]){super(),this.S=[];let t=this;e.forEach((function(e){t.push(e)}))}clear(){this.i=0,this.S=[]}push(e){return this.S.push(e),this.i+=1,this.i}pop(){if(0!==this.i)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}};e.default=r})),qn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=zn(),r=class extends t.Base{constructor(e=[]){super(),this.j=0,this.q=[];let t=this;e.forEach((function(e){t.push(e)}))}clear(){this.q=[],this.i=this.j=0}push(e){let t=this.q.length;if(this.j/t>.5&&this.j+this.i>=t&&t>4096){let t=this.i;for(let e=0;e<t;++e)this.q[e]=this.q[this.j+e];this.j=0,this.q[this.i]=e}else this.q[this.j+this.i]=e;return++this.i}pop(){if(0===this.i)return;let e=this.q[this.j++];return this.i-=1,e}front(){if(0!==this.i)return this.q[this.j]}};e.default=r})),$n=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=zn(),r=class extends t.Base{constructor(e=[],t=function(e,t){return e>t?-1:e<t?1:0},r=!0){if(super(),this.v=t,Array.isArray(e))this.C=r?[...e]:e;else{this.C=[];let t=this;e.forEach((function(e){t.C.push(e)}))}this.i=this.C.length;let n=this.i>>1;for(let e=this.i-1>>1;e>=0;--e)this.k(e,n)}m(e){let t=this.C[e];for(;e>0;){let r=e-1>>1,n=this.C[r];if(this.v(n,t)<=0)break;this.C[e]=n,e=r}this.C[e]=t}k(e,t){let r=this.C[e];for(;e<t;){let t=e<<1|1,n=t+1,i=this.C[t];if(n<this.i&&this.v(i,this.C[n])>0&&(t=n,i=this.C[n]),this.v(i,r)>=0)break;this.C[e]=i,e=t}this.C[e]=r}clear(){this.i=0,this.C.length=0}push(e){this.C.push(e),this.m(this.i),this.i+=1}pop(){if(0===this.i)return;let e=this.C[0],t=this.C.pop();return this.i-=1,this.i&&(this.C[0]=t,this.k(0,this.i>>1)),e}top(){return this.C[0]}find(e){return this.C.indexOf(e)>=0}remove(e){let t=this.C.indexOf(e);return!(t<0)&&(0===t?this.pop():t===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(t,1,this.C.pop()),this.i-=1,this.m(t),this.k(t,this.i>>1)),!0)}updateItem(e){let t=this.C.indexOf(e);return!(t<0)&&(this.m(t),this.k(t,this.i>>1),!0)}toArray(){return[...this.C]}};e.default=r})),Kn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=zn(),r=class extends t.Container{};e.default=r})),Gn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.throwIteratorAccessError=function(){throw new RangeError("Iterator access denied!")}})),Qn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.RandomIterator=void 0;var t=zn(),r=Gn(),n=class extends t.ContainerIterator{constructor(e,t){super(t),this.o=e,0===this.iteratorType?(this.pre=function(){return 0===this.o&&(0,r.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,r.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,r.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return-1===this.o&&(0,r.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(e){this.container.setElementByPos(this.o,e)}};e.RandomIterator=n})),Yn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=Kn())&&t.t?t:{default:t},n=Qn();var i=class e extends n.RandomIterator{constructor(e,t,r){super(e,r),this.container=t}copy(){return new e(this.o,this.container,this.iteratorType)}},o=class extends r.default{constructor(e=[],t=!0){if(super(),Array.isArray(e))this.J=t?[...e]:e,this.i=e.length;else{this.J=[];let t=this;e.forEach((function(e){t.pushBack(e)}))}}clear(){this.i=0,this.J.length=0}begin(){return new i(0,this)}end(){return new i(this.i,this)}rBegin(){return new i(this.i-1,this,1)}rEnd(){return new i(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J[e]}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J.splice(e,1),this.i-=1,this.i}eraseElementByValue(e){let t=0;for(let r=0;r<this.i;++r)this.J[r]!==e&&(this.J[t++]=this.J[r]);return this.i=this.J.length=t,this.i}eraseElementByIterator(e){let t=e.o;return e=e.next(),this.eraseElementByPos(t),e}pushBack(e){return this.J.push(e),this.i+=1,this.i}popBack(){if(0!==this.i)return this.i-=1,this.J.pop()}setElementByPos(e,t){if(e<0||e>this.i-1)throw new RangeError;this.J[e]=t}insert(e,t,r=1){if(e<0||e>this.i)throw new RangeError;return this.J.splice(e,0,...new Array(r).fill(t)),this.i+=r,this.i}find(e){for(let t=0;t<this.i;++t)if(this.J[t]===e)return new i(t,this);return this.end()}reverse(){this.J.reverse()}unique(){let e=1;for(let t=1;t<this.i;++t)this.J[t]!==this.J[t-1]&&(this.J[e++]=this.J[t]);return this.i=this.J.length=e,this.i}sort(e){this.J.sort(e)}forEach(e){for(let t=0;t<this.i;++t)e(this.J[t],t,this)}[Symbol.iterator](){return function*(){yield*this.J}.bind(this)()}};e.default=o})),Jn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=Kn())&&t.t?t:{default:t},n=zn(),i=Gn();var o=class e extends n.ContainerIterator{constructor(e,t,r,n){super(n),this.o=e,this.h=t,this.container=r,0===this.iteratorType?(this.pre=function(){return this.o.L===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.l}set pointer(e){this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.l=e}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends r.default{constructor(e=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let t=this;e.forEach((function(e){t.pushBack(e)}))}V(e){let{L:t,B:r}=e;t.B=r,r.L=t,e===this.p&&(this.p=r),e===this._&&(this._=t),this.i-=1}G(e,t){let r=t.B,n={l:e,L:t,B:r};t.B=n,r.L=n,t===this.h&&(this.p=n),r===this.h&&(this._=n),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return t.l}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return this.V(t),this.i}eraseElementByValue(e){let t=this.p;for(;t!==this.h;)t.l===e&&this.V(t),t=t.B;return this.i}eraseElementByIterator(e){let t=e.o;return t===this.h&&(0,i.throwIteratorAccessError)(),e=e.next(),this.V(t),e}pushBack(e){return this.G(e,this._),this.i}popBack(){if(0===this.i)return;let e=this._.l;return this.V(this._),e}pushFront(e){return this.G(e,this.h),this.i}popFront(){if(0===this.i)return;let e=this.p.l;return this.V(this.p),e}setElementByPos(e,t){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;r.l=t}insert(e,t,r=1){if(e<0||e>this.i)throw new RangeError;if(r<=0)return this.i;if(0===e)for(;r--;)this.pushFront(t);else if(e===this.i)for(;r--;)this.pushBack(t);else{let n=this.p;for(let t=1;t<e;++t)n=n.B;let i=n.B;for(this.i+=r;r--;)n.B={l:t,L:n},n.B.L=n,n=n.B;n.B=i,i.L=n}return this.i}find(e){let t=this.p;for(;t!==this.h;){if(t.l===e)return new o(t,this.h,this);t=t.B}return this.end()}reverse(){if(this.i<=1)return;let e=this.p,t=this._,r=0;for(;r<<1<this.i;){let n=e.l;e.l=t.l,t.l=n,e=e.B,t=t.L,r+=1}}unique(){if(this.i<=1)return this.i;let e=this.p;for(;e!==this.h;){let t=e;for(;t.B!==this.h&&t.l===t.B.l;)t=t.B,this.i-=1;e.B=t.B,e.B.L=e,e=e.B}return this.i}sort(e){if(this.i<=1)return;let t=[];this.forEach((function(e){t.push(e)})),t.sort(e);let r=this.p;t.forEach((function(e){r.l=e,r=r.B}))}merge(e){let t=this;if(0===this.i)e.forEach((function(e){t.pushBack(e)}));else{let r=this.p;e.forEach((function(e){for(;r!==t.h&&r.l<=e;)r=r.B;t.G(e,r.L)}))}return this.i}forEach(e){let t=this.p,r=0;for(;t!==this.h;)e(t.l,r++,this),t=t.B}[Symbol.iterator](){return function*(){if(0===this.i)return;let e=this.p;for(;e!==this.h;)yield e.l,e=e.B}.bind(this)()}};e.default=s})),Xn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=Kn())&&t.t?t:{default:t},n=Qn();var i=class e extends n.RandomIterator{constructor(e,t,r){super(e,r),this.container=t}copy(){return new e(this.o,this.container,this.iteratorType)}},o=class extends r.default{constructor(e=[],t=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let r=(()=>{if("number"==typeof e.length)return e.length;if("number"==typeof e.size)return e.size;if("function"==typeof e.size)return e.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=t,this.P=Math.max(Math.ceil(r/this.F),1);for(let e=0;e<this.P;++e)this.A.push(new Array(this.F));let n=Math.ceil(r/this.F);this.j=this.R=(this.P>>1)-(n>>1),this.D=this.N=this.F-r%this.F>>1;let i=this;e.forEach((function(e){i.pushBack(e)}))}T(){let e=[],t=Math.max(this.P>>1,1);for(let r=0;r<t;++r)e[r]=new Array(this.F);for(let t=this.j;t<this.P;++t)e[e.length]=this.A[t];for(let t=0;t<this.R;++t)e[e.length]=this.A[t];e[e.length]=[...this.A[this.R]],this.j=t,this.R=e.length-1;for(let r=0;r<t;++r)e[e.length]=new Array(this.F);this.A=e,this.P=e.length}O(e){let t=this.D+e+1,r=t%this.F,n=r-1,i=this.j+(t-r)/this.F;return 0===r&&(i-=1),i%=this.P,n<0&&(n+=this.F),{curNodeBucketIndex:i,curNodePointerIndex:n}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new i(0,this)}end(){return new i(this.i,this)}rBegin(){return new i(this.i-1,this,1)}rEnd(){return new i(-1,this,1)}front(){if(0!==this.i)return this.A[this.j][this.D]}back(){if(0!==this.i)return this.A[this.R][this.N]}pushBack(e){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=e,this.i}popBack(){if(0===this.i)return;let e=this.A[this.R][this.N];return 1!==this.i&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,e}pushFront(e){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=e,this.i}popFront(){if(0===this.i)return;let e=this.A[this.j][this.D];return 1!==this.i&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,e}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:t,curNodePointerIndex:r}=this.O(e);return this.A[t][r]}setElementByPos(e,t){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:r,curNodePointerIndex:n}=this.O(e);this.A[r][n]=t}insert(e,t,r=1){if(e<0||e>this.i)throw new RangeError;if(0===e)for(;r--;)this.pushFront(t);else if(e===this.i)for(;r--;)this.pushBack(t);else{let n=[];for(let t=e;t<this.i;++t)n.push(this.getElementByPos(t));this.cut(e-1);for(let e=0;e<r;++e)this.pushBack(t);for(let e=0;e<n.length;++e)this.pushBack(n[e])}return this.i}cut(e){if(e<0)return this.clear(),0;let{curNodeBucketIndex:t,curNodePointerIndex:r}=this.O(e);return this.R=t,this.N=r,this.i=e+1,this.i}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;if(0===e)this.popFront();else if(e===this.i-1)this.popBack();else{let t=[];for(let r=e+1;r<this.i;++r)t.push(this.getElementByPos(r));this.cut(e),this.popBack();let r=this;t.forEach((function(e){r.pushBack(e)}))}return this.i}eraseElementByValue(e){if(0===this.i)return 0;let t=[];for(let r=0;r<this.i;++r){let n=this.getElementByPos(r);n!==e&&t.push(n)}let r=t.length;for(let e=0;e<r;++e)this.setElementByPos(e,t[e]);return this.cut(r-1)}eraseElementByIterator(e){let t=e.o;return this.eraseElementByPos(t),e=e.next()}find(e){for(let t=0;t<this.i;++t)if(this.getElementByPos(t)===e)return new i(t,this);return this.end()}reverse(){let e=0,t=this.i-1;for(;e<t;){let r=this.getElementByPos(e);this.setElementByPos(e,this.getElementByPos(t)),this.setElementByPos(t,r),e+=1,t-=1}}unique(){if(this.i<=1)return this.i;let e=1,t=this.getElementByPos(0);for(let r=1;r<this.i;++r){let n=this.getElementByPos(r);n!==t&&(t=n,this.setElementByPos(e++,n))}for(;this.i>e;)this.popBack();return this.i}sort(e){let t=[];for(let e=0;e<this.i;++e)t.push(this.getElementByPos(e));t.sort(e);for(let e=0;e<this.i;++e)this.setElementByPos(e,t[e])}shrinkToFit(){if(0===this.i)return;let e=[];this.forEach((function(t){e.push(t)})),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let e=0;e<this.P;++e)this.A.push(new Array(this.F));for(let t=0;t<e.length;++t)this.pushBack(e[t])}forEach(e){for(let t=0;t<this.i;++t)e(this.getElementByPos(t),t,this)}[Symbol.iterator](){return function*(){for(let e=0;e<this.i;++e)yield this.getElementByPos(e)}.bind(this)()}};e.default=o})),Zn=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.TreeNodeEnableIndex=e.TreeNode=void 0;var t=class{constructor(e,t){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=e,this.l=t}L(){let e=this;if(1===e.ee&&e.tt.tt===e)e=e.W;else if(e.U)for(e=e.U;e.W;)e=e.W;else{let t=e.tt;for(;t.U===e;)e=t,t=e.tt;e=t}return e}B(){let e=this;if(e.W){for(e=e.W;e.U;)e=e.U;return e}{let t=e.tt;for(;t.W===e;)e=t,t=e.tt;return e.W!==t?t:e}}te(){let e=this.tt,t=this.W,r=t.U;return e.tt===this?e.tt=t:e.U===this?e.U=t:e.W=t,t.tt=e,t.U=this,this.tt=t,this.W=r,r&&(r.tt=this),t}se(){let e=this.tt,t=this.U,r=t.W;return e.tt===this?e.tt=t:e.U===this?e.U=t:e.W=t,t.tt=e,t.W=this,this.tt=t,this.U=r,r&&(r.tt=this),t}};e.TreeNode=t;e.TreeNodeEnableIndex=class extends t{constructor(){super(...arguments),this.rt=1}te(){let e=super.te();return this.ie(),e.ie(),e}se(){let e=super.se();return this.ie(),e.ie(),e}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}}})),ei=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Zn(),r=zn(),n=Gn(),i=class extends r.Container{constructor(e=function(e,t){return e<t?-1:e>t?1:0},r=!1){super(),this.Y=void 0,this.v=e,r?(this.re=t.TreeNodeEnableIndex,this.M=function(e,t,r){let n=this.ne(e,t,r);if(n){let e=n.tt;for(;e!==this.h;)e.rt+=1,e=e.tt;let t=this.he(n);if(t){let{parentNode:e,grandParent:r,curNode:n}=t;e.ie(),r.ie(),n.ie()}}return this.i},this.V=function(e){let t=this.fe(e);for(;t!==this.h;)t.rt-=1,t=t.tt}):(this.re=t.TreeNode,this.M=function(e,t,r){let n=this.ne(e,t,r);return n&&this.he(n),this.i},this.V=this.fe),this.h=new this.re}X(e,t){let r=this.h;for(;e;){let n=this.v(e.u,t);if(n<0)e=e.W;else{if(!(n>0))return e;r=e,e=e.U}}return r}Z(e,t){let r=this.h;for(;e;)this.v(e.u,t)<=0?e=e.W:(r=e,e=e.U);return r}$(e,t){let r=this.h;for(;e;){let n=this.v(e.u,t);if(n<0)r=e,e=e.W;else{if(!(n>0))return e;e=e.U}}return r}rr(e,t){let r=this.h;for(;e;)this.v(e.u,t)<0?(r=e,e=e.W):e=e.U;return r}ue(e){for(;;){let t=e.tt;if(t===this.h)return;if(1===e.ee)return void(e.ee=0);if(e===t.U){let r=t.W;if(1===r.ee)r.ee=0,t.ee=1,t===this.Y?this.Y=t.te():t.te();else{if(r.W&&1===r.W.ee)return r.ee=t.ee,t.ee=0,r.W.ee=0,void(t===this.Y?this.Y=t.te():t.te());r.U&&1===r.U.ee?(r.ee=1,r.U.ee=0,r.se()):(r.ee=1,e=t)}}else{let r=t.U;if(1===r.ee)r.ee=0,t.ee=1,t===this.Y?this.Y=t.se():t.se();else{if(r.U&&1===r.U.ee)return r.ee=t.ee,t.ee=0,r.U.ee=0,void(t===this.Y?this.Y=t.se():t.se());r.W&&1===r.W.ee?(r.ee=1,r.W.ee=0,r.te()):(r.ee=1,e=t)}}}}fe(e){if(1===this.i)return this.clear(),this.h;let t=e;for(;t.U||t.W;){if(t.W)for(t=t.W;t.U;)t=t.U;else t=t.U;[e.u,t.u]=[t.u,e.u],[e.l,t.l]=[t.l,e.l],e=t}this.h.U===t?this.h.U=t.tt:this.h.W===t&&(this.h.W=t.tt),this.ue(t);let r=t.tt;return t===r.U?r.U=void 0:r.W=void 0,this.i-=1,this.Y.ee=0,r}oe(e,t){return void 0!==e&&(!(!this.oe(e.U,t)&&!t(e))||this.oe(e.W,t))}he(e){for(;;){let t=e.tt;if(0===t.ee)return;let r=t.tt;if(t===r.U){let n=r.W;if(n&&1===n.ee){if(n.ee=t.ee=0,r===this.Y)return;r.ee=1,e=r;continue}if(e===t.W){if(e.ee=0,e.U&&(e.U.tt=t),e.W&&(e.W.tt=r),t.W=e.U,r.U=e.W,e.U=t,e.W=r,r===this.Y)this.Y=e,this.h.tt=e;else{let t=r.tt;t.U===r?t.U=e:t.W=e}return e.tt=r.tt,t.tt=e,r.tt=e,r.ee=1,{parentNode:t,grandParent:r,curNode:e}}t.ee=0,r===this.Y?this.Y=r.se():r.se(),r.ee=1}else{let n=r.U;if(n&&1===n.ee){if(n.ee=t.ee=0,r===this.Y)return;r.ee=1,e=r;continue}if(e===t.U){if(e.ee=0,e.U&&(e.U.tt=r),e.W&&(e.W.tt=t),r.W=e.U,t.U=e.W,e.U=r,e.W=t,r===this.Y)this.Y=e,this.h.tt=e;else{let t=r.tt;t.U===r?t.U=e:t.W=e}return e.tt=r.tt,t.tt=e,r.tt=e,r.ee=1,{parentNode:t,grandParent:r,curNode:e}}t.ee=0,r===this.Y?this.Y=r.te():r.te(),r.ee=1}return}}ne(e,t,r){if(void 0===this.Y)return this.i+=1,this.Y=new this.re(e,t),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,void(this.h.W=this.Y);let n,i=this.h.U,o=this.v(i.u,e);if(0!==o){if(o>0)i.U=new this.re(e,t),i.U.tt=i,n=i.U,this.h.U=n;else{let i=this.h.W,o=this.v(i.u,e);if(0===o)return void(i.l=t);if(o<0)i.W=new this.re(e,t),i.W.tt=i,n=i.W,this.h.W=n;else{if(void 0!==r){let i=r.o;if(i!==this.h){let r=this.v(i.u,e);if(0===r)return void(i.l=t);if(r>0){let r=i.L(),o=this.v(r.u,e);if(0===o)return void(r.l=t);o<0&&(n=new this.re(e,t),void 0===r.W?(r.W=n,n.tt=r):(i.U=n,n.tt=i))}}}if(void 0===n)for(n=this.Y;;){let r=this.v(n.u,e);if(r>0){if(void 0===n.U){n.U=new this.re(e,t),n.U.tt=n,n=n.U;break}n=n.U}else{if(!(r<0))return void(n.l=t);if(void 0===n.W){n.W=new this.re(e,t),n.W.tt=n,n=n.W;break}n=n.W}}}}return this.i+=1,n}i.l=t}I(e,t){for(;e;){let r=this.v(e.u,t);if(r<0)e=e.W;else{if(!(r>0))return e;e=e.U}}return e||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(e,t){let r=e.o;if(r===this.h&&(0,n.throwIteratorAccessError)(),1===this.i)return r.u=t,!0;if(r===this.h.U)return this.v(r.B().u,t)>0&&(r.u=t,!0);if(r===this.h.W)return this.v(r.L().u,t)<0&&(r.u=t,!0);let i=r.L().u;if(this.v(i,t)>=0)return!1;let o=r.B().u;return!(this.v(o,t)<=0)&&(r.u=t,!0)}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=0,r=this;return this.oe(this.Y,(function(n){return e===t?(r.V(n),!0):(t+=1,!1)})),this.i}eraseElementByKey(e){if(0===this.i)return!1;let t=this.I(this.Y,e);return t!==this.h&&(this.V(t),!0)}eraseElementByIterator(e){let t=e.o;t===this.h&&(0,n.throwIteratorAccessError)();let r=void 0===t.W;return 0===e.iteratorType?r&&e.next():(!r||void 0===t.U)&&e.next(),this.V(t),e}forEach(e){let t=0;for(let r of this)e(r,t++,this)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t,r=0;for(let n of this){if(r===e){t=n;break}r+=1}return t}getHeight(){if(0===this.i)return 0;let e=function(t){return t?Math.max(e(t.U),e(t.W))+1:0};return e(this.Y)}};e.default=i})),ti=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=zn(),r=Gn(),n=class extends t.ContainerIterator{constructor(e,t,n){super(n),this.o=e,this.h=t,0===this.iteratorType?(this.pre=function(){return this.o===this.h.U&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let e=this.o,t=this.h.tt;if(e===this.h)return t?t.rt-1:0;let r=0;for(e.U&&(r+=e.U.rt);e!==t;){let t=e.tt;e===t.W&&(r+=1,t.U&&(r+=t.U.rt)),e=t}return r}};e.default=n})),ri=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=i(ei()),r=i(ti()),n=Gn();function i(e){return e&&e.t?e:{default:e}}var o=class e extends r.default{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){return this.o===this.h&&(0,n.throwIteratorAccessError)(),this.o.u}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends t.default{constructor(e=[],t,r){super(t,r);let n=this;e.forEach((function(e){n.insert(e)}))}*K(e){void 0!==e&&(yield*this.K(e.U),yield e.u,yield*this.K(e.W))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(e,t){return this.M(e,void 0,t)}find(e){let t=this.I(this.Y,e);return new o(t,this.h,this)}lowerBound(e){let t=this.X(this.Y,e);return new o(t,this.h,this)}upperBound(e){let t=this.Z(this.Y,e);return new o(t,this.h,this)}reverseLowerBound(e){let t=this.$(this.Y,e);return new o(t,this.h,this)}reverseUpperBound(e){let t=this.rr(this.Y,e);return new o(t,this.h,this)}union(e){let t=this;return e.forEach((function(e){t.insert(e)})),this.i}[Symbol.iterator](){return this.K(this.Y)}};e.default=s})),ni=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=i(ei()),r=i(ti()),n=Gn();function i(e){return e&&e.t?e:{default:e}}var o=class e extends r.default{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){this.o===this.h&&(0,n.throwIteratorAccessError)();let e=this;return new Proxy([],{get:(t,r)=>"0"===r?e.o.u:"1"===r?e.o.l:void 0,set(t,r,n){if("1"!==r)throw new TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends t.default{constructor(e=[],t,r){super(t,r);let n=this;e.forEach((function(e){n.setElement(e[0],e[1])}))}*K(e){void 0!==e&&(yield*this.K(e.U),yield[e.u,e.l],yield*this.K(e.W))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(0===this.i)return;let e=this.h.U;return[e.u,e.l]}back(){if(0===this.i)return;let e=this.h.W;return[e.u,e.l]}lowerBound(e){let t=this.X(this.Y,e);return new o(t,this.h,this)}upperBound(e){let t=this.Z(this.Y,e);return new o(t,this.h,this)}reverseLowerBound(e){let t=this.$(this.Y,e);return new o(t,this.h,this)}reverseUpperBound(e){let t=this.rr(this.Y,e);return new o(t,this.h,this)}setElement(e,t,r){return this.M(e,t,r)}find(e){let t=this.I(this.Y,e);return new o(t,this.h,this)}getElementByKey(e){return this.I(this.Y,e).l}union(e){let t=this;return e.forEach((function(e){t.setElement(e[0],e[1])})),this.i}[Symbol.iterator](){return this.K(this.Y)}};e.default=s})),ii=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=function(e){let t=typeof e;return"object"===t&&null!==e||"function"===t}})),oi=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.HashContainerIterator=e.HashContainer=void 0;var t,r=zn(),n=(t=ii())&&t.t?t:{default:t},i=Gn();var o=class extends r.ContainerIterator{constructor(e,t,r){super(r),this.o=e,this.h=t,0===this.iteratorType?(this.pre=function(){return this.o.L===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this})}};e.HashContainerIterator=o;var s=class extends r.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(e){let{L:t,B:r}=e;t.B=r,r.L=t,e===this.p&&(this.p=r),e===this._&&(this._=t),this.i-=1}M(e,t,r){let i;if(void 0===r&&(r=(0,n.default)(e)),r){let r=e[this.HASH_TAG];if(void 0!==r)return this.H[r].l=t,this.i;Object.defineProperty(e,this.HASH_TAG,{value:this.H.length,configurable:!0}),i={u:e,l:t,L:this._,B:this.h},this.H.push(i)}else{let r=this.g[e];if(r)return r.l=t,this.i;i={u:e,l:t,L:this._,B:this.h},this.g[e]=i}return 0===this.i?(this.p=i,this.h.B=i):this._.B=i,this._=i,this.h.L=i,++this.i}I(e,t){if(void 0===t&&(t=(0,n.default)(e)),t){let t=e[this.HASH_TAG];return void 0===t?this.h:this.H[t]}return this.g[e]||this.h}clear(){let e=this.HASH_TAG;this.H.forEach((function(t){delete t.u[e]})),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(e,t){let r;if(void 0===t&&(t=(0,n.default)(e)),t){let t=e[this.HASH_TAG];if(void 0===t)return!1;delete e[this.HASH_TAG],r=this.H[t],delete this.H[t]}else{if(r=this.g[e],void 0===r)return!1;delete this.g[e]}return this.V(r),!0}eraseElementByIterator(e){let t=e.o;return t===this.h&&(0,i.throwIteratorAccessError)(),this.V(t),e.next()}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return this.V(t),this.i}};e.HashContainer=s})),si=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=oi(),r=Gn(),n=class e extends t.HashContainerIterator{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.u}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},i=class extends t.HashContainer{constructor(e=[]){super();let t=this;e.forEach((function(e){t.insert(e)}))}begin(){return new n(this.p,this.h,this)}end(){return new n(this.h,this.h,this)}rBegin(){return new n(this._,this.h,this,1)}rEnd(){return new n(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(e,t){return this.M(e,void 0,t)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return t.u}find(e,t){let r=this.I(e,t);return new n(r,this.h,this)}forEach(e){let t=0,r=this.p;for(;r!==this.h;)e(r.u,t++,this),r=r.B}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield e.u,e=e.B}.bind(this)()}};e.default=i})),ai=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=oi(),n=(t=ii())&&t.t?t:{default:t},i=Gn();var o=class e extends r.HashContainerIterator{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){this.o===this.h&&(0,i.throwIteratorAccessError)();let e=this;return new Proxy([],{get:(t,r)=>"0"===r?e.o.u:"1"===r?e.o.l:void 0,set(t,r,n){if("1"!==r)throw new TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends r.HashContainer{constructor(e=[]){super();let t=this;e.forEach((function(e){t.setElement(e[0],e[1])}))}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(0!==this.i)return[this.p.u,this.p.l]}back(){if(0!==this.i)return[this._.u,this._.l]}setElement(e,t,r){return this.M(e,t,r)}getElementByKey(e,t){if(void 0===t&&(t=(0,n.default)(e)),t){let t=e[this.HASH_TAG];return void 0!==t?this.H[t].l:void 0}let r=this.g[e];return r?r.l:void 0}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return[t.u,t.l]}find(e,t){let r=this.I(e,t);return new o(r,this.h,this)}forEach(e){let t=0,r=this.p;for(;r!==this.h;)e([r.u,r.l],t++,this),r=r.B}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield[e.u,e.l],e=e.B}.bind(this)()}};e.default=s})),li=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"t",{value:!0}),Object.defineProperty(e,"Deque",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"HashMap",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"HashSet",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"LinkList",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"OrderedMap",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"OrderedSet",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"PriorityQueue",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"Queue",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"Stack",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"Vector",{enumerable:!0,get:function(){return i.default}});var t=h(Hn()),r=h(qn()),n=h($n()),i=h(Yn()),o=h(Jn()),s=h(Xn()),a=h(ri()),l=h(ni()),u=h(si()),c=h(ai());function h(e){return e&&e.t?e:{default:e}}})),ui=u(((e,t)=>{nt(),ze(),f();var r=li().OrderedSet,n=An()("number-allocator:trace"),i=An()("number-allocator:error");function o(e,t){this.low=e,this.high=t}function s(e,t){if(!(this instanceof s))return new s(e,t);this.min=e,this.max=t,this.ss=new r([],((e,t)=>e.compare(t))),n("Create"),this.clear()}o.prototype.equals=function(e){return this.low===e.low&&this.high===e.high},o.prototype.compare=function(e){return this.low<e.low&&this.high<e.low?-1:e.low<this.low&&e.high<this.low?1:0},s.prototype.firstVacant=function(){return 0===this.ss.size()?null:this.ss.front().low},s.prototype.alloc=function(){if(0===this.ss.size())return n("alloc():empty"),null;let e=this.ss.begin(),t=e.pointer.low,r=e.pointer.high,i=t;return i+1<=r?this.ss.updateKeyByIterator(e,new o(t+1,r)):this.ss.eraseElementByPos(0),n("alloc():"+i),i},s.prototype.use=function(e){let t=new o(e,e),r=this.ss.lowerBound(t);if(!r.equals(this.ss.end())){let i=r.pointer.low,s=r.pointer.high;return r.pointer.equals(t)?(this.ss.eraseElementByIterator(r),n("use():"+e),!0):!(i>e)&&(i===e?(this.ss.updateKeyByIterator(r,new o(i+1,s)),n("use():"+e),!0):s===e?(this.ss.updateKeyByIterator(r,new o(i,s-1)),n("use():"+e),!0):(this.ss.updateKeyByIterator(r,new o(e+1,s)),this.ss.insert(new o(i,e-1)),n("use():"+e),!0))}return n("use():failed"),!1},s.prototype.free=function(e){if(e<this.min||e>this.max)return void i("free():"+e+" is out of range");let t=new o(e,e),r=this.ss.upperBound(t);if(r.equals(this.ss.end())){if(r.equals(this.ss.begin()))return void this.ss.insert(t);r.pre();let n=r.pointer.high;r.pointer.high+1===e?this.ss.updateKeyByIterator(r,new o(n,e)):this.ss.insert(t)}else if(r.equals(this.ss.begin()))if(e+1===r.pointer.low){let t=r.pointer.high;this.ss.updateKeyByIterator(r,new o(e,t))}else this.ss.insert(t);else{let n=r.pointer.low,i=r.pointer.high;r.pre();let s=r.pointer.low;r.pointer.high+1===e?e+1===n?(this.ss.eraseElementByIterator(r),this.ss.updateKeyByIterator(r,new o(s,i))):this.ss.updateKeyByIterator(r,new o(s,e)):e+1===n?(this.ss.eraseElementByIterator(r.next()),this.ss.insert(new o(e,i))):this.ss.insert(t)}n("free():"+e)},s.prototype.clear=function(){n("clear()"),this.ss.clear(),this.ss.insert(new o(this.min,this.max))},s.prototype.intervalCount=function(){return this.ss.size()},s.prototype.dump=function(){console.log("length:"+this.ss.size());for(let e of this.ss)console.log(e)},t.exports=s})),ci=u(((e,t)=>{nt(),ze(),f();var r=ui();t.exports.NumberAllocator=r})),hi=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});var t=Vn(),r=ci();e.default=class{constructor(e){e>0&&(this.aliasToTopic=new t.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new r.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,t){if(0===t||t>this.max)return!1;let r=this.aliasToTopic.get(t);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(t,e),this.topicToAlias[e]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.size,!0}getTopicByAlias(e){return this.aliasToTopic.get(e)}getAliasByTopic(e){let t=this.topicToAlias[e];return typeof t<"u"&&this.aliasToTopic.get(t),t}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}}})),fi=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=Fn(),n=t(hi()),i=Dn();e.default=(e,t)=>{e.log("_handleConnack");let{options:o}=e,s=5===o.protocolVersion?t.reasonCode:t.returnCode;if(clearTimeout(e.connackTimer),delete e.topicAliasSend,t.properties){if(t.properties.topicAliasMaximum){if(t.properties.topicAliasMaximum>65535)return void e.emit("error",new Error("topicAliasMaximum from broker is out of range"));t.properties.topicAliasMaximum>0&&(e.topicAliasSend=new n.default(t.properties.topicAliasMaximum))}t.properties.serverKeepAlive&&o.keepalive&&(o.keepalive=t.properties.serverKeepAlive),t.properties.maximumPacketSize&&(o.properties||(o.properties={}),o.properties.maximumPacketSize=t.properties.maximumPacketSize)}if(0===s)e.reconnecting=!1,e._onConnect(t);else if(s>0){let t=new i.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[s]}`,s);e.emit("error",t)}}})),di=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});e.default=(e,t,r)=>{e.log("handling pubrel packet");let n=typeof r<"u"?r:e.noop,{messageId:i}=t,o={cmd:"pubcomp",messageId:i};e.incomingStore.get(t,((t,r)=>{t?e._sendPacket(o,n):(e.emit("message",r.topic,r.payload,r),e.handleMessage(r,(t=>{if(t)return n(t);e.incomingStore.del(r,e.noop),e._sendPacket(o,n)})))}))}})),pi=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(Nn()),n=t(Wn()),i=t(fi()),o=t(Fn()),s=t(di());e.default=(e,t,a)=>{let{options:l}=e;if(5===l.protocolVersion&&l.properties&&l.properties.maximumPacketSize&&l.properties.maximumPacketSize<t.length)return e.emit("error",new Error(`exceeding packets size ${t.cmd}`)),e.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",t),t.cmd){case"publish":(0,r.default)(e,t,a);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":e.reschedulePing(),(0,o.default)(e,t),a();break;case"pubrel":e.reschedulePing(),(0,s.default)(e,t,a);break;case"connack":(0,i.default)(e,t),a();break;case"auth":e.reschedulePing(),(0,n.default)(e,t),a();break;case"pingresp":e.log("_handlePacket :: received pingresp"),e.reschedulePing(),a();break;case"disconnect":e.emit("disconnect",t),a();break;default:e.log("_handlePacket :: unknown command"),a()}}})),gi=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.TypedEventEmitter=void 0;var r=t((jt(),h(Mt))),n=Dn(),i=class{};e.TypedEventEmitter=i,(0,n.applyMixin)(i,r.default)})),yi=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0}),e.isReactNativeBrowser=e.isWebWorker=void 0;var t,r=()=>{var e,t;return!("object"!=typeof self||null===(t=null===(e=self?.constructor)||void 0===e?void 0:e.name)||void 0===t||!t.includes("WorkerGlobalScope"))},i=()=>typeof n<"u"&&"ReactNative"===n.product,o=typeof window<"u"&&(typeof n<"u"&&(null===(t=n.userAgent)||void 0===t?void 0:t.toLowerCase().indexOf(" electron/"))>-1&&null!=d&&d.versions?!Object.prototype.hasOwnProperty.call(d.versions,"electron"):typeof window.document<"u")||r()||i();e.isWebWorker=r(),e.isReactNativeBrowser=i(),e.default=o})),bi=u(((e,t)=>{var n,i;nt(),ze(),f(),n=e,i=function(e){var t,r=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,n=536870912,i=2*n,o=new WeakMap,s=function(e,t){return function(o){var s=t.get(o),a=void 0===s?o.size:s<i?s+1:0;if(!o.has(a))return e(o,a);if(o.size<n){for(;o.has(a);)a=Math.floor(Math.random()*i);return e(o,a)}if(o.size>r)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;o.has(a);)a=Math.floor(Math.random()*r);return e(o,a)}}((t=o,function(e,r){return t.set(e,r),r}),o),a=function(e){return function(t){var r=e(t);return t.add(r),r}}(s);e.addUniqueNumber=a,e.generateUniqueNumber=s},"object"==typeof e&&typeof t<"u"?i(e):"function"==typeof define&&r.amdO?define(["exports"],i):i((n=typeof globalThis<"u"?globalThis:n||self).fastUniqueNumbers={})})),vi=u(((e,t)=>{var n,i;nt(),ze(),f(),n=e,i=function(e,t){e.load=function(e){var r=new Map([[0,function(){}]]),n=new Map([[0,function(){}]]),i=new Map,o=new Worker(e);return o.addEventListener("message",(function(e){var t=e.data;if(function(e){return void 0!==e.method&&"call"===e.method}(t)){var o=t.params,s=o.timerId,a=o.timerType;if("interval"===a){var l=r.get(s);if("number"==typeof l){var u=i.get(l);if(void 0===u||u.timerId!==s||u.timerType!==a)throw new Error("The timer is in an undefined state.")}else{if(!(typeof l<"u"))throw new Error("The timer is in an undefined state.");l()}}else if("timeout"===a){var c=n.get(s);if("number"==typeof c){var h=i.get(c);if(void 0===h||h.timerId!==s||h.timerType!==a)throw new Error("The timer is in an undefined state.")}else{if(!(typeof c<"u"))throw new Error("The timer is in an undefined state.");c(),n.delete(s)}}}else{if(!function(e){return null===e.error&&"number"==typeof e.id}(t)){var f=t.error.message;throw new Error(f)}var d=t.id,p=i.get(d);if(void 0===p)throw new Error("The timer is in an undefined state.");var g=p.timerId,y=p.timerType;i.delete(d),"interval"===y?r.delete(g):n.delete(g)}})),{clearInterval:function(e){var n=t.generateUniqueNumber(i);i.set(n,{timerId:e,timerType:"interval"}),r.set(e,n),o.postMessage({id:n,method:"clear",params:{timerId:e,timerType:"interval"}})},clearTimeout:function(e){var r=t.generateUniqueNumber(i);i.set(r,{timerId:e,timerType:"timeout"}),n.set(e,r),o.postMessage({id:r,method:"clear",params:{timerId:e,timerType:"timeout"}})},setInterval:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=t.generateUniqueNumber(r);return r.set(i,(function(){e(),"function"==typeof r.get(i)&&o.postMessage({id:null,method:"set",params:{delay:n,now:performance.now(),timerId:i,timerType:"interval"}})})),o.postMessage({id:null,method:"set",params:{delay:n,now:performance.now(),timerId:i,timerType:"interval"}}),i},setTimeout:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=t.generateUniqueNumber(n);return n.set(i,e),o.postMessage({id:null,method:"set",params:{delay:r,now:performance.now(),timerId:i,timerType:"timeout"}}),i}}}},"object"==typeof e&&typeof t<"u"?i(e,bi()):"function"==typeof define&&r.amdO?define(["exports","fast-unique-numbers"],i):i((n=typeof globalThis<"u"?globalThis:n||self).workerTimersBroker={},n.fastUniqueNumbers)})),mi=u(((e,t)=>{var n,i;nt(),ze(),f(),n=e,i=function(e,t){var r,n,i,o=(r=t.load,n='(()=>{var e={472:(e,t,r)=>{var o,i;void 0===(i="function"==typeof(o=function(){"use strict";var e=new Map,t=new Map,r=function(t){var r=e.get(t);if(void 0===r)throw new Error(\'There is no interval scheduled with the given id "\'.concat(t,\'".\'));clearTimeout(r),e.delete(t)},o=function(e){var r=t.get(e);if(void 0===r)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(r),t.delete(e)},i=function(e,t){var r,o=performance.now();return{expected:o+(r=e-Math.max(0,o-t)),remainingDelay:r}},n=function e(t,r,o,i){var n=performance.now();n>o?postMessage({id:null,method:"call",params:{timerId:r,timerType:i}}):t.set(r,setTimeout(e,o-n,t,r,o,i))},a=function(t,r,o){var a=i(t,o),s=a.expected,d=a.remainingDelay;e.set(r,setTimeout(n,d,e,r,s,"interval"))},s=function(e,r,o){var a=i(e,o),s=a.expected,d=a.remainingDelay;t.set(r,setTimeout(n,d,t,r,s,"timeout"))};addEventListener("message",(function(e){var t=e.data;try{if("clear"===t.method){var i=t.id,n=t.params,d=n.timerId,c=n.timerType;if("interval"===c)r(d),postMessage({error:null,id:i});else{if("timeout"!==c)throw new Error(\'The given type "\'.concat(c,\'" is not supported\'));o(d),postMessage({error:null,id:i})}}else{if("set"!==t.method)throw new Error(\'The given method "\'.concat(t.method,\'" is not supported\'));var u=t.params,l=u.delay,p=u.now,m=u.timerId,v=u.timerType;if("interval"===v)a(l,m,p);else{if("timeout"!==v)throw new Error(\'The given type "\'.concat(v,\'" is not supported\'));s(l,m,p)}}}catch(e){postMessage({error:{message:e.message},id:t.id,result:null})}}))})?o.call(t,r,t,e):o)||(e.exports=i)}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();',i=null,function(){if(null!==i)return i;var e=new Blob([n],{type:"application/javascript; charset=utf-8"}),t=URL.createObjectURL(e);return i=r(t),setTimeout((function(){return URL.revokeObjectURL(t)})),i});e.clearInterval=function(e){return o().clearInterval(e)},e.clearTimeout=function(e){return o().clearTimeout(e)},e.setInterval=function(){var e;return(e=o()).setInterval.apply(e,arguments)},e.setTimeout=function(){var e;return(e=o()).setTimeout.apply(e,arguments)}},"object"==typeof e&&typeof t<"u"?i(e,vi()):"function"==typeof define&&r.amdO?define(["exports","worker-timers-broker"],i):i((n=typeof globalThis<"u"?globalThis:n||self).workerTimers={},n.workerTimersBroker)})),wi=u((e=>{nt(),ze(),f();var t=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};Object.defineProperty(e,"__esModule",{value:!0});var i=n(yi()),o=mi(),s={set:o.setInterval,clear:o.clearInterval},a={set:(e,t)=>setInterval(e,t),clear:e=>clearInterval(e)};e.default=e=>{switch(e){case"native":return a;case"worker":return s;default:return!i.default||i.isWebWorker||i.isReactNativeBrowser?a:s}}})),_i=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(wi());e.default=class{get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(e,t){this.destroyed=!1,this.client=e,this.timer=(0,r.default)(t),this.setKeepalive(e.options.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(e){if(e*=1e3,isNaN(e)||e<=0||e>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${e}`);this._keepalive=e,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${e}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let e=Math.ceil(1.5*this._keepalive);this._keepaliveTimeoutTimestamp=Date.now()+e,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set((()=>{this.destroyed||(this.counter+=1,2===this.counter?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())}),this._intervalEvery)}}})),Ei=u((e=>{nt(),ze(),f();var t=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var o=i(it()),s=i(Mn()),a=i(Pn()),l=bn(),u=i(Bn()),c=n(Ln()),h=i(An()),d=i(Un()),p=i(pi()),g=Dn(),y=gi(),b=i(_i()),v=n(yi()),m=globalThis.setImmediate||((...e)=>{let t=e.shift();(0,g.nextTick)((()=>{t(...e)}))}),w={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0,writeCache:!0,timerVariant:"auto"},_=class e extends y.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(t,r){super(),this.options=r||{};for(let e in w)typeof this.options[e]>"u"?this.options[e]=w[e]:this.options[e]=r[e];this.log=this.options.log||(0,h.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",e.VERSION),v.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",v.default?"browser":"node"),this.log("MqttClient :: options.protocol",r.protocol),this.log("MqttClient :: options.protocolVersion",r.protocolVersion),this.log("MqttClient :: options.username",r.username),this.log("MqttClient :: options.keepalive",r.keepalive),this.log("MqttClient :: options.reconnectPeriod",r.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",r.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",r.properties?r.properties.topicAliasMaximum:void 0),this.options.clientId="string"==typeof r.clientId?r.clientId:e.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===r.protocolVersion&&r.customHandleAcks?r.customHandleAcks:(...e)=>{e[3](null,0)},this.options.writeCache||(s.default.writeToStream.cacheNumbers=!1),this.streamBuilder=t,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new a.default:this.options.messageIdProvider,this.outgoingStore=r.outgoingStore||new d.default,this.incomingStore=r.incomingStore||new d.default,this.queueQoSZero=void 0===r.queueQoSZero||r.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,r.properties&&r.properties.topicAliasMaximum>0&&(r.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new o.default(r.properties.topicAliasMaximum)),this.on("connect",(()=>{let{queue:e}=this,t=()=>{let r=e.shift();this.log("deliver :: entry %o",r);let n=null;if(!r)return void this._resubscribe();n=r.packet,this.log("deliver :: call _sendPacket for %o",n);let i=!0;n.messageId&&0!==n.messageId&&(this.messageIdProvider.register(n.messageId)||(i=!1)),i?this._sendPacket(n,(e=>{r.cb&&r.cb(e),t()})):(this.log("messageId: %d has already used. The message is skipped and removed.",n.messageId),t())};this.log("connect :: sending queued packets"),t()})),this.on("close",(()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()})),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(e,t){t()}handleMessage(e,t){t()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var e;let t=new l.Writable,r=s.default.parser(this.options),n=null,i=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),r.on("packet",(e=>{this.log("parser :: on packet push to packets array."),i.push(e)}));let o=()=>{this.log("work :: getting next packet in queue");let e=i.shift();if(e)this.log("work :: packet pulled from queue"),(0,p.default)(this,e,a);else{this.log("work :: no packets in queue");let e=n;n=null,this.log("work :: done flag is %s",!!e),e&&e()}},a=()=>{if(i.length)(0,g.nextTick)(o);else{let e=n;n=null,e()}};t._write=(e,t,i)=>{n=i,this.log("writable stream :: parsing buffer"),r.parse(e),o()};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(t),this.stream.on("error",(e=>{this.log("streamErrorHandler :: error",e.message),e.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",e)):this.noop(e)})),this.stream.on("close",(()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")})),this.log("connect: sending packet `connect`");let u={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(u.will=Object.assign(Object.assign({},this.options.will),{payload:null===(e=this.options.will)||void 0===e?void 0:e.payload})),this.topicAliasRecv&&(u.properties||(u.properties={}),this.topicAliasRecv&&(u.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(u),r.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end((()=>this.emit("error",new Error("Packet has no Authentication Method")))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket){let e=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(e)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout((()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0)}),this.options.connectTimeout),this}publish(e,t,r,n){this.log("publish :: message `%s` to topic `%s`",t,e);let{options:i}=this;"function"==typeof r&&(n=r,r=null),r=r||{},r=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),r);let{qos:o,retain:s,dup:a,properties:l,cbStorePut:u}=r;if(this._checkDisconnecting(n))return this;let c=()=>{let r=0;if((1===o||2===o)&&(r=this._nextId(),null===r))return this.log("No messageId left"),!1;let c={cmd:"publish",topic:e,payload:t,qos:o,retain:s,messageId:r,dup:a};switch(5===i.protocolVersion&&(c.properties=l),this.log("publish :: qos",o),o){case 1:case 2:this.outgoing[c.messageId]={volatile:!1,cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",c.cmd),this._sendPacket(c,void 0,u);break;default:this.log("MqttClient:publish: packet cmd: %s",c.cmd),this._sendPacket(c,n,u)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!c())&&this._storeProcessingQueue.push({invoke:c,cbStorePut:r.cbStorePut,callback:n}),this}publishAsync(e,t,r){return new Promise(((n,i)=>{this.publish(e,t,r,((e,t)=>{e?i(e):n(t)}))}))}subscribe(e,t,r){let n=this.options.protocolVersion;"function"==typeof t&&(r=t),r=r||this.noop;let i=!1,o=[];"string"==typeof e?o=e=[e]:Array.isArray(e)?o=e:"object"==typeof e&&(i=e.resubscribe,delete e.resubscribe,o=Object.keys(e));let s=c.validateTopics(o);if(null!==s)return m(r,new Error(`Invalid topic ${s}`)),this;if(this._checkDisconnecting(r))return this.log("subscribe: discconecting true"),this;let a={qos:0};5===n&&(a.nl=!1,a.rap=!1,a.rh=0);let l=(t=Object.assign(Object.assign({},a),t)).properties,u=[],h=(e,r)=>{if(r=r||t,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,e)||this._resubscribeTopics[e].qos<r.qos||i){let t={topic:e,qos:r.qos};5===n&&(t.nl=r.nl,t.rap=r.rap,t.rh=r.rh,t.properties=l),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",t.topic,t.qos),u.push(t)}};if(Array.isArray(e)?e.forEach((e=>{this.log("subscribe: array topic %s",e),h(e)})):Object.keys(e).forEach((t=>{this.log("subscribe: object topic %s, %o",t,e[t]),h(t,e[t])})),!u.length)return r(null,[]),this;let f=()=>{let e=this._nextId();if(null===e)return this.log("No messageId left"),!1;let t={cmd:"subscribe",subscriptions:u,messageId:e};if(l&&(t.properties=l),this.options.resubscribe){this.log("subscribe :: resubscribe true");let e=[];u.forEach((t=>{if(this.options.reconnectPeriod>0){let r={qos:t.qos};5===n&&(r.nl=t.nl||!1,r.rap=t.rap||!1,r.rh=t.rh||0,r.properties=t.properties),this._resubscribeTopics[t.topic]=r,e.push(t.topic)}})),this.messageIdToTopic[t.messageId]=e}return this.outgoing[t.messageId]={volatile:!0,cb(e,t){if(!e){let{granted:e}=t;for(let t=0;t<e.length;t+=1)u[t].qos=e[t]}r(e,u)}},this.log("subscribe :: call _sendPacket"),this._sendPacket(t),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!f())&&this._storeProcessingQueue.push({invoke:f,callback:r}),this}subscribeAsync(e,t){return new Promise(((r,n)=>{this.subscribe(e,t,((e,t)=>{e?n(e):r(t)}))}))}unsubscribe(e,t,r){"string"==typeof e&&(e=[e]),"function"==typeof t&&(r=t),r=r||this.noop;let n=c.validateTopics(e);if(null!==n)return m(r,new Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(r))return this;let i=()=>{let n=this._nextId();if(null===n)return this.log("No messageId left"),!1;let i={cmd:"unsubscribe",messageId:n,unsubscriptions:[]};return"string"==typeof e?i.unsubscriptions=[e]:Array.isArray(e)&&(i.unsubscriptions=e),this.options.resubscribe&&i.unsubscriptions.forEach((e=>{delete this._resubscribeTopics[e]})),"object"==typeof t&&t.properties&&(i.properties=t.properties),this.outgoing[i.messageId]={volatile:!0,cb:r},this.log("unsubscribe: call _sendPacket"),this._sendPacket(i),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!i())&&this._storeProcessingQueue.push({invoke:i,callback:r}),this}unsubscribeAsync(e,t){return new Promise(((r,n)=>{this.unsubscribe(e,t,((e,t)=>{e?n(e):r(t)}))}))}end(e,t,r){this.log("end :: (%s)",this.options.clientId),(null==e||"boolean"!=typeof e)&&(r=r||t,t=e,e=!1),"object"!=typeof t&&(r=r||t,t=null),this.log("end :: cb? %s",!!r),(!r||"function"!=typeof r)&&(r=this.noop);let n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close((e=>{this.outgoingStore.close((t=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),r){let n=e||t;this.log("end :: closeStores: invoking callback with args"),r(n)}}))})),this._deferredReconnect&&this._deferredReconnect()},i=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,e),this._cleanUp(e,(()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,g.nextTick)(n)}),t)};return this.disconnecting?(r(),this):(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,i,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),i()),this)}endAsync(e,t){return new Promise(((r,n)=>{this.end(e,t,(e=>{e?n(e):r()}))}))}removeOutgoingMessage(e){if(this.outgoing[e]){let{cb:t}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,(()=>{t(new Error("Message removed"))}))}return this}reconnect(e){this.log("client reconnect");let t=()=>{e?(this.options.incomingStore=e.incomingStore,this.options.outgoingStore=e.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new d.default,this.outgoingStore=this.options.outgoingStore||new d.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=t:t(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach((e=>{this.outgoing[e].volatile&&"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])})))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach((e=>{"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])})))}_removeTopicAliasAndRecoverTopicName(e){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",t,r),0===r.length){if(typeof t>"u")return new Error("Unregistered Topic Alias");if(r=this.topicAliasSend.getTopicByAlias(t),typeof r>"u")return new Error("Unregistered Topic Alias");e.topic=r}t&&delete e.properties.topicAlias}_checkDisconnecting(e){return this.disconnecting&&(e&&e!==this.noop?e(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end((()=>{this.connect()})),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval((()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()}),this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(e,t,r={}){if(t&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",t)),this.log("_cleanUp :: forced? %s",e),e)0===this.options.reconnectPeriod&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let e=Object.assign({cmd:"disconnect"},r);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(e,(()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),m((()=>{this.stream.end((()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)}))}))}))}!this.disconnecting&&!this.reconnecting&&(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),t&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",t),t())}_storeAndSend(e,t,r){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let n,i=e;if("publish"===i.cmd&&(i=(0,u.default)(e),n=this._removeTopicAliasAndRecoverTopicName(i),n))return t&&t(n);this.outgoingStore.put(i,(n=>{if(n)return t&&t(n);r(),this._writePacket(e,t)}))}_applyTopicAlias(e){if(5===this.options.protocolVersion&&"publish"===e.cmd){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.topicAliasSend)if(t){if(0!==r.length&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",r,t),!this.topicAliasSend.put(r,t)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}else 0!==r.length&&(this.options.autoAssignTopicAlias?(t=this.topicAliasSend.getAliasByTopic(r),t?(e.topic="",e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:t}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",r,t)):(t=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(r,t),e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:t}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",r,t))):this.options.autoUseTopicAlias&&(t=this.topicAliasSend.getAliasByTopic(r),t&&(e.topic="",e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:t}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",r,t))));else if(t)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}}_noop(e){this.log("noop ::",e)}_writePacket(e,t){this.log("_writePacket :: packet: %O",e),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",e),this.log("_writePacket :: writing to stream");let r=s.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",r),!r&&t&&t!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",t)):t&&(this.log("_writePacket :: invoking cb"),t())}_sendPacket(e,t,r,n){this.log("_sendPacket :: (%s) :: start",this.options.clientId),r=r||this.noop,t=t||this.noop;let i=this._applyTopicAlias(e);if(i)t(i);else{if(!this.connected)return"auth"===e.cmd?void this._writePacket(e,t):(this.log("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(e,t,r));if(n)this._writePacket(e,t);else{switch(e.cmd){case"publish":break;case"pubrel":return void this._storeAndSend(e,t,r);default:return void this._writePacket(e,t)}switch(e.qos){case 2:case 1:this._storeAndSend(e,t,r);break;default:this._writePacket(e,t)}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}}}_storePacket(e,t,r){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!t),r=r||this.noop;let n=e;if("publish"===n.cmd){n=(0,u.default)(e);let r=this._removeTopicAliasAndRecoverTopicName(n);if(r)return t&&t(r)}let i=n.qos||0;0===i&&this.queueQoSZero||"publish"!==n.cmd?this.queue.push({packet:n,cb:t}):i>0?(t=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,(e=>{if(e)return t&&t(e);r()}))):t&&t(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new b.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(){this.keepaliveManager&&this.options.keepalive&&this.options.reschedulePings&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.emit("error",new Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}_resubscribe(){this.log("_resubscribe");let e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&e.length>0)if(this.options.resubscribe)if(5===this.options.protocolVersion){this.log("_resubscribe: protocolVersion 5");for(let t=0;t<e.length;t++){let r={};r[e[t]]=this._resubscribeTopics[e[t]],r.resubscribe=!0,this.subscribe(r,{properties:r[e[t]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(e){if(this.disconnected)return void this.emit("connect",e);this.connackPacket=e,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let t=()=>{let r=this.outgoingStore.createStream(),n=()=>{r.destroy(),r=null,this._flushStoreProcessingQueue(),i()},i=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",n),r.on("error",(e=>{i(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",e)}));let o=()=>{if(!r)return;let e,t=r.read(1);t?(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[t.messageId]?o():this.disconnecting||this.reconnectTimer?r.destroy&&r.destroy():(e=this.outgoing[t.messageId]?this.outgoing[t.messageId].cb:null,this.outgoing[t.messageId]={volatile:!1,cb(t,r){e&&e(t,r),o()}},this._packetIdsDuringStoreProcessing[t.messageId]=!0,this.messageIdProvider.register(t.messageId)?this._sendPacket(t,void 0,void 0,!0):this.log("messageId: %d has already used.",t.messageId))):r.once("readable",o)};r.on("end",(()=>{let r=!0;for(let e in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[e]){r=!1;break}this.removeListener("close",n),r?(i(),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):t()})),o()};t()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let e of this._storeProcessingQueue)e.cbStorePut&&e.cbStorePut(new Error("Connection closed")),e.callback&&e.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(e,t){delete this.outgoing[e],this.outgoingStore.del({messageId:e},((r,n)=>{t(r,n),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue()}))}};_.VERSION=g.MQTTJS_VERSION,e.default=_})),Si=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});var t=ci();e.default=class{constructor(){this.numberAllocator=new t.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(e){return this.numberAllocator.use(e)}deallocate(e){this.numberAllocator.free(e)}clear(){this.numberAllocator.clear()}}}));function ki(e){throw new RangeError(Oi[e])}function Ai(e,t){let r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+function(e,t){let r=[],n=e.length;for(;n--;)r[n]=t(e[n]);return r}((e=e.replace(Ri,".")).split("."),t).join(".")}function Ti(e){let t=[],r=0,n=e.length;for(;r<n;){let i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){let n=e.charCodeAt(r++);56320==(64512&n)?t.push(((1023&i)<<10)+(1023&n)+65536):(t.push(i),r--)}else t.push(i)}return t}var Ii,Ci,Ri,Oi,Mi,Pi,xi,Bi,Li,Ui,Ni,ji=l((()=>{nt(),ze(),f(),Ii=/^xn--/,Ci=/[^\0-\x7E]/,Ri=/[\x2E\u3002\uFF0E\uFF61]/g,Oi={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Mi=Math.floor,Pi=String.fromCharCode,xi=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},Bi=function(e,t,r){let n=0;for(e=r?Mi(e/700):e>>1,e+=Mi(e/t);e>455;n+=36)e=Mi(e/35);return Mi(n+36*e/(e+38))},Ui=function(e){let t=[],r=(e=Ti(e)).length,n=128,i=0,o=72;for(let r of e)r<128&&t.push(Pi(r));let s=t.length,a=s;for(s&&t.push("-");a<r;){let r=2147483647;for(let t of e)t>=n&&t<r&&(r=t);let l=a+1;r-n>Mi((2147483647-i)/l)&&ki("overflow"),i+=(r-n)*l,n=r;for(let r of e)if(r<n&&++i>2147483647&&ki("overflow"),r==n){let e=i;for(let r=36;;r+=36){let n=r<=o?1:r>=o+26?26:r-o;if(e<n)break;let i=e-n,s=36-n;t.push(Pi(xi(n+i%s,0))),e=Mi(i/s)}t.push(Pi(xi(e,0))),o=Bi(i,l,a==s),i=0,++a}++i,++n}return t.join("")},Ni={version:"2.1.0",ucs2:{decode:Ti,encode:e=>String.fromCodePoint(...e)},decode:Li=function(e){let t=[],r=e.length,n=0,i=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(let r=0;r<s;++r)e.charCodeAt(r)>=128&&ki("not-basic"),t.push(e.charCodeAt(r));for(let l=s>0?s+1:0;l<r;){let s=n;for(let t=1,i=36;;i+=36){l>=r&&ki("invalid-input");let s=(a=e.charCodeAt(l++))-48<10?a-22:a-65<26?a-65:a-97<26?a-97:36;(s>=36||s>Mi((2147483647-n)/t))&&ki("overflow"),n+=s*t;let u=i<=o?1:i>=o+26?26:i-o;if(s<u)break;let c=36-u;t>Mi(2147483647/c)&&ki("overflow"),t*=c}let u=t.length+1;o=Bi(n-s,u,0==s),Mi(n/u)>2147483647-i&&ki("overflow"),i+=Mi(n/u),n%=u,t.splice(n++,0,i)}var a;return String.fromCodePoint(...t)},encode:Ui,toASCII:function(e){return Ai(e,(function(e){return Ci.test(e)?"xn--"+Ui(e):e}))},toUnicode:function(e){return Ai(e,(function(e){return Ii.test(e)?Li(e.slice(4).toLowerCase()):e}))}},Ni.encode,Ni.toASCII,Ni.toUnicode,Ni.ucs2,Ni.version}));function Di(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Fi,Wi,Vi,zi,Hi=l((()=>{nt(),ze(),f(),Fi=function(e,t,r,n){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var a=e.length;s>0&&a>s&&(a=s);for(var l=0;l<a;++l){var u,c,h,f,d=e[l].replace(o,"%20"),p=d.indexOf(r);p>=0?(u=d.substr(0,p),c=d.substr(p+1)):(u=d,c=""),h=decodeURIComponent(u),f=decodeURIComponent(c),Di(i,h)?Array.isArray(i[h])?i[h].push(f):i[h]=[i[h],f]:i[h]=f}return i},Wi=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},Vi=function(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(n){var i=encodeURIComponent(Wi(n))+r;return Array.isArray(e[n])?e[n].map((function(e){return i+encodeURIComponent(Wi(e))})).join(t):i+encodeURIComponent(Wi(e[n]))})).join(t):n?encodeURIComponent(Wi(n))+r+encodeURIComponent(Wi(e)):""},(zi={}).decode=zi.parse=Fi,zi.encode=zi.stringify=Vi,zi.decode,zi.encode,zi.parse,zi.stringify}));function qi(){throw new Error("setTimeout has not been defined")}function $i(){throw new Error("clearTimeout has not been defined")}function Ki(e){if(Zi===setTimeout)return setTimeout(e,0);if((Zi===qi||!Zi)&&setTimeout)return Zi=setTimeout,setTimeout(e,0);try{return Zi(e,0)}catch{try{return Zi.call(null,e,0)}catch{return Zi.call(this||to,e,0)}}}function Gi(){oo&&no&&(oo=!1,no.length?io=no.concat(io):so=-1,io.length&&Qi())}function Qi(){if(!oo){var e=Ki(Gi);oo=!0;for(var t=io.length;t;){for(no=io,io=[];++so<t;)no&&no[so].run();so=-1,t=io.length}no=null,oo=!1,function(e){if(eo===clearTimeout)return clearTimeout(e);if((eo===$i||!eo)&&clearTimeout)return eo=clearTimeout,clearTimeout(e);try{eo(e)}catch{try{return eo.call(null,e)}catch{return eo.call(this||to,e)}}}(e)}}function Yi(e,t){(this||to).fun=e,(this||to).array=t}function Ji(){}var Xi,Zi,eo,to,ro,no,io,oo,so,ao,lo=l((()=>{nt(),ze(),f(),to=typeof globalThis<"u"?globalThis:typeof self<"u"?self:r.g,ro=Xi={},function(){try{Zi="function"==typeof setTimeout?setTimeout:qi}catch{Zi=qi}try{eo="function"==typeof clearTimeout?clearTimeout:$i}catch{eo=$i}}(),io=[],oo=!1,so=-1,ro.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];io.push(new Yi(e,t)),1!==io.length||oo||Ki(Qi)},Yi.prototype.run=function(){(this||to).fun.apply(null,(this||to).array)},ro.title="browser",ro.browser=!0,ro.env={},ro.argv=[],ro.version="",ro.versions={},ro.on=Ji,ro.addListener=Ji,ro.once=Ji,ro.off=Ji,ro.removeListener=Ji,ro.removeAllListeners=Ji,ro.emit=Ji,ro.prependListener=Ji,ro.prependOnceListener=Ji,ro.listeners=function(e){return[]},ro.binding=function(e){throw new Error("process.binding is not supported")},ro.cwd=function(){return"/"},ro.chdir=function(e){throw new Error("process.chdir is not supported")},ro.umask=function(){return 0},ao=Xi,ao.argv,ao.binding,ao.browser,ao.chdir,ao.cwd,ao.emit,ao.env,ao.listeners,ao.nextTick,ao.off,ao.on,ao.once,ao.prependListener,ao.prependOnceListener,ao.removeAllListeners,ao.removeListener,ao.title,ao.umask,ao.version,ao.versions}));function uo(){if(ho)return co;ho=!0;var e,t,r=co={};function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(t){if(e===setTimeout)return setTimeout(t,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch{try{return e.call(null,t,0)}catch{return e.call(this||fo,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:n}catch{e=n}try{t="function"==typeof clearTimeout?clearTimeout:i}catch{t=i}}();var s,a=[],l=!1,u=-1;function c(){!l||!s||(l=!1,s.length?a=s.concat(a):u=-1,a.length&&h())}function h(){if(!l){var e=o(c);l=!0;for(var r=a.length;r;){for(s=a,a=[];++u<r;)s&&s[u].run();u=-1,r=a.length}s=null,l=!1,function(e){if(t===clearTimeout)return clearTimeout(e);if((t===i||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(e);try{return t(e)}catch{try{return t.call(null,e)}catch{return t.call(this||fo,e)}}}(e)}}function f(e,t){(this||fo).fun=e,(this||fo).array=t}function d(){}return r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];a.push(new f(e,t)),1===a.length&&!l&&o(h)},f.prototype.run=function(){(this||fo).fun.apply(null,(this||fo).array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=d,r.addListener=d,r.once=d,r.off=d,r.removeListener=d,r.removeAllListeners=d,r.emit=d,r.prependListener=d,r.prependOnceListener=d,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0},co}var co,ho,fo,po,go=l((()=>{nt(),ze(),f(),co={},ho=!1,fo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:r.g,(po=uo()).platform="browser",po.addListener,po.argv,po.binding,po.browser,po.chdir,po.cwd,po.emit,po.env,po.listeners,po.nextTick,po.off,po.on,po.once,po.prependListener,po.prependOnceListener,po.removeAllListeners,po.removeListener,po.title,po.umask,po.version,po.versions}));var yo,bo,vo,mo=l((()=>{nt(),ze(),f(),go(),yo={},bo=!1,vo=function(){if(bo)return yo;bo=!0;var e=po;function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)r=e.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o!==a-1&&1!==s)if(o!==a-1&&2===s){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",i=0):i=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var n={resolve:function(){for(var n,i="",o=!1,s=arguments.length-1;s>=-1&&!o;s--){var a;s>=0?a=arguments[s]:(void 0===n&&(n=e.cwd()),a=n),t(a),0!==a.length&&(i=a+"/"+i,o=47===a.charCodeAt(0))}return i=r(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0===(e=r(e,!n)).length&&!n&&(e="."),e.length>0&&i&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=n.resolve(e))===(r=n.resolve(r)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,s=o-i,a=1;a<r.length&&47===r.charCodeAt(a);++a);for(var l=r.length-a,u=s<l?s:l,c=-1,h=0;h<=u;++h){if(h===u){if(l>u){if(47===r.charCodeAt(a+h))return r.slice(a+h+1);if(0===h)return r.slice(a+h)}else s>u&&(47===e.charCodeAt(i+h)?c=h:0===h&&(c=0));break}var f=e.charCodeAt(i+h);if(f!==r.charCodeAt(a+h))break;47===f&&(c=h)}var d="";for(h=i+c+1;h<=o;++h)(h===o||47===e.charCodeAt(h))&&(0===d.length?d+="..":d+="/..");return d.length>0?d+r.slice(a+c):(a+=c,47===r.charCodeAt(a)&&++a,r.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(r=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,i=0,o=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var a=r.length-1,l=-1;for(n=e.length-1;n>=0;--n){var u=e.charCodeAt(n);if(47===u){if(!s){i=n+1;break}}else-1===l&&(s=!1,l=n+1),a>=0&&(u===r.charCodeAt(a)?-1==--a&&(o=n):(a=-1,o=l))}return i===o?o=l:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){i=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var r=-1,n=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===i&&(o=!1,i=a+1),46===l?-1===r?r=a:1!==s&&(s=1):-1!==r&&(s=-1);else if(!o){n=a+1;break}}return-1===r||-1===i||0===s||1===s&&r===i-1&&r===n+1?"":e.slice(r,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}("/",e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,i=e.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var s=-1,a=0,l=-1,u=!0,c=e.length-1,h=0;c>=n;--c)if(47!==(i=e.charCodeAt(c)))-1===l&&(u=!1,l=c+1),46===i?-1===s?s=c:1!==h&&(h=1):-1!==s&&(h=-1);else if(!u){a=c+1;break}return-1===s||-1===l||0===h||1===h&&s===l-1&&s===a+1?-1!==l&&(r.base=r.name=0===a&&o?e.slice(1,l):e.slice(a,l)):(0===a&&o?(r.name=e.slice(1,s),r.base=e.slice(1,l)):(r.name=e.slice(a,s),r.base=e.slice(a,l)),r.ext=e.slice(s,l)),a>0?r.dir=e.slice(0,a-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,yo=n}()})),wo={};function _o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function Eo(e,t,r){if(e&&Ro.isObject(e)&&e instanceof _o)return e;var n=new _o;return n.parse(e,t,r),n}function So(e){if("string"==typeof e)e=new URL(e);else if(!(e instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if("file:"!==e.protocol)throw new Deno.errors.InvalidData("invalid url scheme");return Jo?function(e){let t=e.hostname,r=e.pathname;for(let e=0;e<r.length;e++)if("%"===r[e]){let t=r.codePointAt(e+2)||32;if("2"===r[e+1]&&102===t||"5"===r[e+1]&&99===t)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(Xo,"\\"),r=decodeURIComponent(r),""!==t)return`\\\\${t}${r}`;{let e=32|r.codePointAt(1),t=r[2];if(e<Qo||e>Yo||":"!==t)throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}(e):function(e){if(""!==e.hostname)throw new Deno.errors.InvalidData("invalid file url hostname");let t=e.pathname;for(let e=0;e<t.length;e++)if("%"===t[e]){let r=t.codePointAt(e+2)||32;if("2"===t[e+1]&&102===r)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}(e)}function ko(e){let t=qo.resolve(e),r=e.charCodeAt(e.length-1);(r===Go||Jo&&r===Ko)&&t[t.length-1]!==qo.sep&&(t+="/");let n=new URL("file://");return t.includes("%")&&(t=t.replace(Zo,"%25")),!Jo&&t.includes("\\")&&(t=t.replace(es,"%5C")),t.includes("\n")&&(t=t.replace(ts,"%0A")),t.includes("\r")&&(t=t.replace(rs,"%0D")),t.includes("\t")&&(t=t.replace(ns,"%09")),n.pathname=t,n}function Ao(e){if("string"==typeof e)e=new URL(e);else if(!(e instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if("file:"!==e.protocol)throw new Deno.errors.InvalidData("invalid url scheme");return gs?function(e){let t=e.hostname,r=e.pathname;for(let e=0;e<r.length;e++)if("%"===r[e]){let t=r.codePointAt(e+2)||32;if("2"===r[e+1]&&102===t||"5"===r[e+1]&&99===t)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(ys,"\\"),r=decodeURIComponent(r),""!==t)return`\\\\${t}${r}`;{let e=32|r.codePointAt(1),t=r[2];if(e<ds||e>ps||":"!==t)throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}(e):function(e){if(""!==e.hostname)throw new Deno.errors.InvalidData("invalid file url hostname");let t=e.pathname;for(let e=0;e<t.length;e++)if("%"===t[e]){let r=t.codePointAt(e+2)||32;if("2"===t[e+1]&&102===r)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}(e)}function To(e){let t=vo.resolve(e),r=e.charCodeAt(e.length-1);(r===fs||gs&&r===hs)&&t[t.length-1]!==vo.sep&&(t+="/");let n=new URL("file://");return t.includes("%")&&(t=t.replace(bs,"%25")),!gs&&t.includes("\\")&&(t=t.replace(vs,"%5C")),t.includes("\n")&&(t=t.replace(ms,"%0A")),t.includes("\r")&&(t=t.replace(ws,"%0D")),t.includes("\t")&&(t=t.replace(_s,"%09")),n.pathname=t,n}c(wo,{URL:()=>cs,Url:()=>os,default:()=>Io,fileURLToPath:()=>Ao,format:()=>ss,parse:()=>us,pathToFileURL:()=>To,resolve:()=>as,resolveObject:()=>ls});var Io,Co,Ro,Oo,Mo,Po,xo,Bo,Lo,Uo,No,jo,Do,Fo,Wo,Vo,zo,Ho,qo,$o,Ko,Go,Qo,Yo,Jo,Xo,Zo,es,ts,rs,ns,is,os,ss,as,ls,us,cs,hs,fs,ds,ps,gs,ys,bs,vs,ms,ws,_s,Es=l((()=>{nt(),ze(),f(),ji(),Hi(),lo(),mo(),go(),Co=Ni,Ro={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}},(Io={}).parse=Eo,Io.resolve=function(e,t){return Eo(e,!1,!0).resolve(t)},Io.resolveObject=function(e,t){return e?Eo(e,!1,!0).resolveObject(t):t},Io.format=function(e){return Ro.isString(e)&&(e=Eo(e)),e instanceof _o?e.format():_o.prototype.format.call(e)},Io.Url=_o,Oo=/^([a-z0-9.+-]+:)/i,Mo=/:[0-9]*$/,Po=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,xo=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),Bo=["'"].concat(xo),Lo=["%","/","?",";","#"].concat(Bo),Uo=["/","?","#"],No=/^[+a-z0-9A-Z_-]{0,63}$/,jo=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Do={javascript:!0,"javascript:":!0},Fo={javascript:!0,"javascript:":!0},Wo={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Vo=zi,_o.prototype.parse=function(e,t,r){if(!Ro.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),i=-1!==n&&n<e.indexOf("#")?"?":"#",o=e.split(i);o[0]=o[0].replace(/\\/g,"/");var s=e=o.join(i);if(s=s.trim(),!r&&1===e.split("#").length){var a=Po.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=t?Vo.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var l=Oo.exec(s);if(l){var u=(l=l[0]).toLowerCase();this.protocol=u,s=s.substr(l.length)}if(r||l||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var c="//"===s.substr(0,2);!c||l&&Fo[l]||(s=s.substr(2),this.slashes=!0)}if(!Fo[l]&&(c||l&&!Wo[l])){for(var h,f,d=-1,p=0;p<Uo.length;p++)-1!==(g=s.indexOf(Uo[p]))&&(-1===d||g<d)&&(d=g);for(-1!==(f=-1===d?s.lastIndexOf("@"):s.lastIndexOf("@",d))&&(h=s.slice(0,f),s=s.slice(f+1),this.auth=decodeURIComponent(h)),d=-1,p=0;p<Lo.length;p++){var g;-1!==(g=s.indexOf(Lo[p]))&&(-1===d||g<d)&&(d=g)}-1===d&&(d=s.length),this.host=s.slice(0,d),s=s.slice(d),this.parseHost(),this.hostname=this.hostname||"";var y="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!y)for(var b=this.hostname.split(/\./),v=(p=0,b.length);p<v;p++){var m=b[p];if(m&&!m.match(No)){for(var w="",_=0,E=m.length;_<E;_++)m.charCodeAt(_)>127?w+="x":w+=m[_];if(!w.match(No)){var S=b.slice(0,p),k=b.slice(p+1),A=m.match(jo);A&&(S.push(A[1]),k.unshift(A[2])),k.length&&(s="/"+k.join(".")+s),this.hostname=S.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=Co.toASCII(this.hostname));var T=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+T,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!Do[u])for(p=0,v=Bo.length;p<v;p++){var C=Bo[p];if(-1!==s.indexOf(C)){var R=encodeURIComponent(C);R===C&&(R=escape(C)),s=s.split(C).join(R)}}var O=s.indexOf("#");-1!==O&&(this.hash=s.substr(O),s=s.slice(0,O));var M=s.indexOf("?");if(-1!==M?(this.search=s.substr(M),this.query=s.substr(M+1),t&&(this.query=Vo.parse(this.query)),s=s.slice(0,M)):t&&(this.search="",this.query={}),s&&(this.pathname=s),Wo[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){T=this.pathname||"";var P=this.search||"";this.path=T+P}return this.href=this.format(),this},_o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&Ro.isObject(this.query)&&Object.keys(this.query).length&&(o=Vo.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||Wo[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+n},_o.prototype.resolve=function(e){return this.resolveObject(Eo(e,!1,!0)).format()},_o.prototype.resolveObject=function(e){if(Ro.isString(e)){var t=new _o;t.parse(e,!1,!0),e=t}for(var r=new _o,n=Object.keys(this),i=0;i<n.length;i++){var o=n[i];r[o]=this[o]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),a=0;a<s.length;a++){var l=s[a];"protocol"!==l&&(r[l]=e[l])}return Wo[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!Wo[e.protocol]){for(var u=Object.keys(e),c=0;c<u.length;c++){var h=u[c];r[h]=e[h]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||Fo[e.protocol])r.pathname=e.pathname;else{for(var f=(e.pathname||"").split("/");f.length&&!(e.host=f.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==f[0]&&f.unshift(""),f.length<2&&f.unshift(""),r.pathname=f.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var d=r.pathname||"",p=r.search||"";r.path=d+p}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var g=r.pathname&&"/"===r.pathname.charAt(0),y=e.host||e.pathname&&"/"===e.pathname.charAt(0),b=y||g||r.host&&e.pathname,v=b,m=r.pathname&&r.pathname.split("/")||[],w=(f=e.pathname&&e.pathname.split("/")||[],r.protocol&&!Wo[r.protocol]);if(w&&(r.hostname="",r.port=null,r.host&&(""===m[0]?m[0]=r.host:m.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===f[0]?f[0]=e.host:f.unshift(e.host)),e.host=null),b=b&&(""===f[0]||""===m[0])),y)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,m=f;else if(f.length)m||(m=[]),m.pop(),m=m.concat(f),r.search=e.search,r.query=e.query;else if(!Ro.isNullOrUndefined(e.search))return w&&(r.hostname=r.host=m.shift(),(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift())),r.search=e.search,r.query=e.query,Ro.isNull(r.pathname)&&Ro.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!m.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var _=m.slice(-1)[0],E=(r.host||e.host||m.length>1)&&("."===_||".."===_)||""===_,S=0,k=m.length;k>=0;k--)"."===(_=m[k])?m.splice(k,1):".."===_?(m.splice(k,1),S++):S&&(m.splice(k,1),S--);if(!b&&!v)for(;S--;S)m.unshift("..");!b||""===m[0]||m[0]&&"/"===m[0].charAt(0)||m.unshift(""),E&&"/"!==m.join("/").substr(-1)&&m.push("");var A,T=""===m[0]||m[0]&&"/"===m[0].charAt(0);return w&&(r.hostname=r.host=T?"":m.length?m.shift():"",(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift())),(b=b||r.host&&m.length)&&!T&&m.unshift(""),m.length?r.pathname=m.join("/"):(r.pathname=null,r.path=null),Ro.isNull(r.pathname)&&Ro.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},_o.prototype.parseHost=function(){var e=this.host,t=Mo.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},Io.Url,Io.format,Io.resolve,Io.resolveObject,zo={},Ho=!1,qo=function(){if(Ho)return zo;Ho=!0;var e=ao;function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)r=e.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o!==a-1&&1!==s)if(o!==a-1&&2===s){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",i=0):i=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var n={resolve:function(){for(var n,i="",o=!1,s=arguments.length-1;s>=-1&&!o;s--){var a;s>=0?a=arguments[s]:(void 0===n&&(n=e.cwd()),a=n),t(a),0!==a.length&&(i=a+"/"+i,o=47===a.charCodeAt(0))}return i=r(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0===(e=r(e,!n)).length&&!n&&(e="."),e.length>0&&i&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=n.resolve(e))===(r=n.resolve(r)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,s=o-i,a=1;a<r.length&&47===r.charCodeAt(a);++a);for(var l=r.length-a,u=s<l?s:l,c=-1,h=0;h<=u;++h){if(h===u){if(l>u){if(47===r.charCodeAt(a+h))return r.slice(a+h+1);if(0===h)return r.slice(a+h)}else s>u&&(47===e.charCodeAt(i+h)?c=h:0===h&&(c=0));break}var f=e.charCodeAt(i+h);if(f!==r.charCodeAt(a+h))break;47===f&&(c=h)}var d="";for(h=i+c+1;h<=o;++h)(h===o||47===e.charCodeAt(h))&&(0===d.length?d+="..":d+="/..");return d.length>0?d+r.slice(a+c):(a+=c,47===r.charCodeAt(a)&&++a,r.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(r=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,i=0,o=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var a=r.length-1,l=-1;for(n=e.length-1;n>=0;--n){var u=e.charCodeAt(n);if(47===u){if(!s){i=n+1;break}}else-1===l&&(s=!1,l=n+1),a>=0&&(u===r.charCodeAt(a)?-1==--a&&(o=n):(a=-1,o=l))}return i===o?o=l:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){i=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var r=-1,n=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===i&&(o=!1,i=a+1),46===l?-1===r?r=a:1!==s&&(s=1):-1!==r&&(s=-1);else if(!o){n=a+1;break}}return-1===r||-1===i||0===s||1===s&&r===i-1&&r===n+1?"":e.slice(r,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}("/",e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,i=e.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var s=-1,a=0,l=-1,u=!0,c=e.length-1,h=0;c>=n;--c)if(47!==(i=e.charCodeAt(c)))-1===l&&(u=!1,l=c+1),46===i?-1===s?s=c:1!==h&&(h=1):-1!==s&&(h=-1);else if(!u){a=c+1;break}return-1===s||-1===l||0===h||1===h&&s===l-1&&s===a+1?-1!==l&&(r.base=r.name=0===a&&o?e.slice(1,l):e.slice(a,l)):(0===a&&o?(r.name=e.slice(1,s),r.base=e.slice(1,l)):(r.name=e.slice(a,s),r.base=e.slice(a,l)),r.ext=e.slice(s,l)),a>0?r.dir=e.slice(0,a-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,zo=n}(),$o=typeof Deno<"u"?"windows"===Deno.build.os?"win32":Deno.build.os:void 0,Io.URL=typeof URL<"u"?URL:null,Io.pathToFileURL=ko,Io.fileURLToPath=So,Io.Url,Io.format,Io.resolve,Io.resolveObject,Io.URL,Ko=92,Go=47,Qo=97,Yo=122,Jo="win32"===$o,Xo=/\//g,Zo=/%/g,es=/\\/g,ts=/\n/g,rs=/\r/g,ns=/\t/g,is=typeof Deno<"u"?"windows"===Deno.build.os?"win32":Deno.build.os:void 0,Io.URL=typeof URL<"u"?URL:null,Io.pathToFileURL=To,Io.fileURLToPath=Ao,os=Io.Url,ss=Io.format,as=Io.resolve,ls=Io.resolveObject,us=Io.parse,cs=Io.URL,hs=92,fs=47,ds=97,ps=122,gs="win32"===is,ys=/\//g,bs=/%/g,vs=/\\/g,ms=/\n/g,ws=/\r/g,_s=/\t/g})),Ss={};function ks(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}c(Ss,{Server:()=>ks,Socket:()=>ks,Stream:()=>ks,_createServerHandle:()=>ks,_normalizeArgs:()=>ks,_setSimultaneousAccepts:()=>ks,connect:()=>ks,createConnection:()=>ks,createServer:()=>ks,default:()=>As,isIP:()=>ks,isIPv4:()=>ks,isIPv6:()=>ks});var As,Ts=l((()=>{nt(),ze(),f(),As={_createServerHandle:ks,_normalizeArgs:ks,_setSimultaneousAccepts:ks,connect:ks,createConnection:ks,createServer:ks,isIP:ks,isIPv4:ks,isIPv6:ks,Server:ks,Socket:ks,Stream:ks}})),Is=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t((Ts(),h(Ss))),n=(0,t(An()).default)("mqttjs:tcp");e.default=(e,t)=>{t.port=t.port||1883,t.hostname=t.hostname||t.host||"localhost";let{port:i,path:o}=t,s=t.hostname;return n("port %d and host %s",i,s),r.default.createConnection({port:i,host:s,path:o})}})),Cs={};c(Cs,{default:()=>Rs});var Rs,Os=l((()=>{nt(),ze(),f(),Rs={}})),Ms=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t((Os(),h(Cs))),n=t((Ts(),h(Ss))),i=(0,t(An()).default)("mqttjs:tls");e.default=(e,t)=>{t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0===n.default.isIP(t.host)&&(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,i("port %d host %s rejectUnauthorized %b",t.port,t.host,t.rejectUnauthorized);let o=r.default.connect(t);function s(r){t.rejectUnauthorized&&e.emit("error",r),o.end()}return o.on("secureConnect",(()=>{t.rejectUnauthorized&&!o.authorized?o.emit("error",new Error("TLS not authorized")):o.removeListener("error",s)})),o.on("error",s),o}})),Ps=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferedDuplex=e.writev=void 0;var t=bn(),r=(rt(),h(He));function n(e,t){let n=new Array(e.length);for(let t=0;t<e.length;t++)"string"==typeof e[t].chunk?n[t]=r.Buffer.from(e[t].chunk,"utf8"):n[t]=e[t].chunk;this._write(r.Buffer.concat(n),"binary",t)}e.writev=n;var i=class extends t.Duplex{constructor(e,t,r){super({objectMode:!0}),this.proxy=t,this.socket=r,this.writeQueue=[],e.objectMode||(this._writev=n.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",(e=>{this.push(e)}))}_read(e){this.proxy.read(e)}_write(e,t,r){this.isSocketOpen?this.writeToProxy(e,t,r):this.writeQueue.push({chunk:e,encoding:t,cb:r})}_final(e){this.writeQueue=[],this.proxy.end(e)}_destroy(e,t){this.writeQueue=[],this.proxy.destroy(),t(e)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(e,t,r){!1===this.proxy.write(e,t)?this.proxy.once("drain",r):r()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:e,encoding:t,cb:r}=this.writeQueue.shift();this.writeToProxy(e,t,r)}}};e.BufferedDuplex=i})),xs=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});var t,r,n,i=(rt(),h(He)),o=bn(),s=Ps();e.default=(e,a)=>{if(a.hostname=a.hostname||a.host,!a.hostname)throw new Error("Could not determine host. Specify host manually.");let l="MQIsdp"===a.protocolId&&3===a.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(a);let u=function(e,t){let r="wxs"===e.protocol?"wss":"ws",n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(a,e);t=wx.connectSocket({url:u,protocols:[l]}),r=function(){let e=new o.Transform;return e._write=(e,r,n)=>{t.send({data:e.buffer,success(){n()},fail(e){n(new Error(e))}})},e._flush=e=>{t.close({success(){e()}})},e}(),(n=new s.BufferedDuplex(a,r,t))._destroy=(e,r)=>{t.close({success(){r&&r(e)}})};let c=n.destroy;return n.destroy=(e,r)=>(n.destroy=c,setTimeout((()=>{t.close({fail(){n._destroy(e,r)}})}),0),n),t.onOpen((()=>{n.socketReady()})),t.onMessage((e=>{let{data:t}=e;t=t instanceof ArrayBuffer?i.Buffer.from(t):i.Buffer.from(t,"utf8"),r.push(t)})),t.onClose((()=>{n.emit("close"),n.end(),n.destroy()})),t.onError((e=>{let t=new Error(e.errMsg);n.destroy(t)})),n}})),Bs=u((e=>{nt(),ze(),f(),Object.defineProperty(e,"__esModule",{value:!0});var t,r,n,i=(rt(),h(He)),o=bn(),s=Ps(),a=!1;e.default=(e,l)=>{if(l.hostname=l.hostname||l.host,!l.hostname)throw new Error("Could not determine host. Specify host manually.");let u="MQIsdp"===l.protocolId&&3===l.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(l);let c=function(e,t){let r="alis"===e.protocol?"wss":"ws",n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(l,e);return(t=l.my).connectSocket({url:c,protocols:u}),r=function(){let e=new o.Transform;return e._write=(e,r,n)=>{t.sendSocketMessage({data:e.buffer,success(){n()},fail(){n(new Error)}})},e._flush=e=>{t.closeSocket({success(){e()}})},e}(),n=new s.BufferedDuplex(l,r,t),a||(a=!0,t.onSocketOpen((()=>{n.socketReady()})),t.onSocketMessage((e=>{if("string"==typeof e.data){let t=i.Buffer.from(e.data,"base64");r.push(t)}else{let t=new FileReader;t.addEventListener("load",(()=>{let e=t.result;e=e instanceof ArrayBuffer?i.Buffer.from(e):i.Buffer.from(e,"utf8"),r.push(e)})),t.readAsArrayBuffer(e.data)}})),t.onSocketClose((()=>{n.end(),n.destroy()})),t.onSocketError((e=>{n.destroy(e)}))),n}})),Ls=u(((e,t)=>{nt(),ze(),f(),t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}})),Us=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=(rt(),h(He)),n=t(Ls()),i=t(An()),o=bn(),s=t(yi()),a=Ps(),l=(0,i.default)("mqttjs:ws"),u=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function c(e,t){let r=`${e.protocol}://${e.hostname}:${e.port}${e.path}`;return"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}function d(e){let t=e;return e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),!s.default&&"wss"===e.protocol&&u.forEach((r=>{Object.prototype.hasOwnProperty.call(e,r)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,r)&&(t.wsOptions[r]=e[r])})),t}e.default=s.default?(e,t)=>{l("browserStreamBuilder");let n,i=function(e){let t=d(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let e=new URL(document.URL);t.hostname=e.hostname,t.port||(t.port=Number(e.port))}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}(t).browserBufferSize||524288,s=t.browserBufferTimeout||1e3,u=!t.objectMode,h=function(e,t){let r,n="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",i=c(t,e);return r=t.createWebsocket?t.createWebsocket(i,[n],t):new WebSocket(i,[n]),r.binaryType="arraybuffer",r}(e,t),f=function(e,t,r){let n=new o.Transform({objectMode:e.objectMode});return n._write=t,n._flush=r,n}(t,(function e(t,n,o){if(h.bufferedAmount>i)return void setTimeout(e,s,t,n,o);u&&"string"==typeof t&&(t=r.Buffer.from(t,"utf8"));try{h.send(t)}catch(e){return o(e)}o()}),(function(e){h.close(),e()}));t.objectMode||(f._writev=a.writev.bind(f)),f.on("close",(()=>{h.close()}));let p=typeof h.addEventListener<"u";function g(){l("WebSocket onOpen"),n instanceof a.BufferedDuplex&&n.socketReady()}function y(e){l("WebSocket onClose",e),n.end(),n.destroy()}function b(e){l("WebSocket onError",e);let t=new Error("WebSocket error");t.event=e,n.destroy(t)}function v(e){let{data:t}=e;t=t instanceof ArrayBuffer?r.Buffer.from(t):r.Buffer.from(t,"utf8"),f.push(t)}return h.readyState===h.OPEN?(n=f,n.socket=h):(n=new a.BufferedDuplex(t,f,h),p?h.addEventListener("open",g):h.onopen=g),p?(h.addEventListener("close",y),h.addEventListener("error",b),h.addEventListener("message",v)):(h.onclose=y,h.onerror=b,h.onmessage=v),n}:(e,t)=>{l("streamBuilder");let r=d(t);r.hostname=r.hostname||r.host||"localhost";let i=c(r,e),o=function(e,t,r){l("createWebSocket"),l(`protocol: ${r.protocolId} ${r.protocolVersion}`);let i,o="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt";return l(`creating new Websocket for url: ${t} and protocol: ${o}`),i=r.createWebsocket?r.createWebsocket(t,[o],r):new n.default(t,[o],r.wsOptions),i}(0,i,r),s=n.default.createWebSocketStream(o,r.wsOptions);return s.url=i,o.on("close",(()=>{s.destroy()})),s}})),Ns=u((e=>{nt(),ze(),f();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.connectAsync=void 0;var r=t(An()),n=t((Es(),h(wo))),i=t(Ei()),o=t(yi());"function"!=typeof(null==d?void 0:d.nextTick)&&(d.nextTick=setImmediate);var s=(0,r.default)("mqttjs"),a={};function l(e,t){var r,o,l,u;if(s("connecting to an MQTT broker..."),"object"==typeof e&&!t&&(t=e,e=""),t=t||{},e&&"string"==typeof e){let i=n.default.parse(e,!0),o={};if(null!=i.port&&(o.port=Number(i.port)),o.host=i.hostname,o.query=i.query,o.auth=i.auth,o.protocol=i.protocol,o.path=i.path,o.protocol=null===(r=o.protocol)||void 0===r?void 0:r.replace(/:$/,""),!(t=Object.assign(Object.assign({},o),t)).protocol)throw new Error("Missing protocol")}if(t.unixSocket=t.unixSocket||(null===(o=t.protocol)||void 0===o?void 0:o.includes("+unix")),t.unixSocket?t.protocol=t.protocol.replace("+unix",""):null!==(l=t.protocol)&&void 0!==l&&l.startsWith("ws")||null!==(u=t.protocol)&&void 0!==u&&u.startsWith("wx")||delete t.path,function(e){let t;e.auth&&(t=e.auth.match(/^(.+):(.+)$/),t?(e.username=t[1],e.password=t[2]):e.username=e.auth)}(t),t.query&&"string"==typeof t.query.clientId&&(t.clientId=t.query.clientId),t.cert&&t.key){if(!t.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(t.protocol))switch(t.protocol){case"mqtt":t.protocol="mqtts";break;case"ws":t.protocol="wss";break;case"wx":t.protocol="wxs";break;case"ali":t.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${t.protocol}"!`)}}if(!a[t.protocol]){let e=-1!==["mqtts","wss"].indexOf(t.protocol);t.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(((t,r)=>(!e||r%2!=0)&&"function"==typeof a[t]))[0]}if(!1===t.clean&&!t.clientId)throw new Error("Missing clientId for unclean clients");t.protocol&&(t.defaultProtocol=t.protocol);let c=new i.default((function(e){return t.servers&&((!e._reconnectCount||e._reconnectCount===t.servers.length)&&(e._reconnectCount=0),t.host=t.servers[e._reconnectCount].host,t.port=t.servers[e._reconnectCount].port,t.protocol=t.servers[e._reconnectCount].protocol?t.servers[e._reconnectCount].protocol:t.defaultProtocol,t.hostname=t.host,e._reconnectCount++),s("calling streambuilder for",t.protocol),a[t.protocol](e,t)}),t);return c.on("error",(()=>{})),c}o.default?(a.wx=xs().default,a.wxs=xs().default,a.ali=Bs().default,a.alis=Bs().default):(a.mqtt=Is().default,a.tcp=Is().default,a.ssl=Ms().default,a.tls=a.ssl,a.mqtts=Ms().default),a.ws=Us().default,a.wss=Us().default,e.connectAsync=function(e,t,r=!0){return new Promise(((n,i)=>{let o=l(e,t),s={connect:e=>{a(),n(o)},end:()=>{a(),n(o)},error:e=>{a(),o.end(),i(e)}};function a(){Object.keys(s).forEach((e=>{o.off(e,s[e])}))}!1===r&&(s.close=()=>{s.error(new Error("Couldn't connect to server"))}),Object.keys(s).forEach((e=>{o.on(e,s[e])}))}))},e.default=l})),js=u((e=>{nt(),ze(),f();var t=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n},i=e&&e.__exportStar||function(e,r){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(r,n)&&t(r,e,n)},o=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=e.KeepaliveManager=e.UniqueMessageIdProvider=e.DefaultMessageIdProvider=e.Store=e.MqttClient=e.connectAsync=e.connect=e.Client=void 0;var s=o(Ei());e.MqttClient=s.default;var a=o(Pn());e.DefaultMessageIdProvider=a.default;var l=o(Si());e.UniqueMessageIdProvider=l.default;var u=o(Un());e.Store=u.default;var c=n(Ns());e.connect=c.default,Object.defineProperty(e,"connectAsync",{enumerable:!0,get:function(){return c.connectAsync}});var h=o(_i());e.KeepaliveManager=h.default,e.Client=s.default,i(Ei(),e),i(Dn(),e);var d=Fn();Object.defineProperty(e,"ReasonCodes",{enumerable:!0,get:function(){return d.ReasonCodes}})}));const Ds=u((e=>{nt(),ze(),f();var t=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n},i=e&&e.__exportStar||function(e,r){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(r,n)&&t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0});var o=n(js());e.default=o,i(js(),e)}))()},3405:(e,t,r)=>{"use strict";function n(e,t,r){var n,i,o;void 0===t&&(t=50),void 0===r&&(r={});var s=null!=(n=r.isImmediate)&&n,a=null!=(i=r.callback)&&i,l=r.maxWait,u=Date.now(),c=[];function h(){if(void 0!==l){var e=Date.now()-u;if(e+t>=l)return l-e}return t}var f=function(){var t=[].slice.call(arguments),r=this;return new Promise((function(n,i){var l=s&&void 0===o;if(void 0!==o&&clearTimeout(o),o=setTimeout((function(){if(o=void 0,u=Date.now(),!s){var n=e.apply(r,t);a&&a(n),c.forEach((function(e){return(0,e.resolve)(n)})),c=[]}}),h()),l){var f=e.apply(r,t);return a&&a(f),n(f)}c.push({resolve:n,reject:i})}))};return f.cancel=function(e){void 0!==o&&clearTimeout(o),c.forEach((function(t){return(0,t.reject)(e)})),c=[]},f}r.r(t),r.d(t,{debounce:()=>n})},5460:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRtcApi=void 0;const o=i(r(3793)),s=r(7130),a=r(86),l=r(7514);t.BaseRtcApi=class{constructor(e,t,r,n){this.appID=e,this.sid=t,this.clientKey=r,"/"!==n.substring(n.length-1)&&(n+="/"),this.serverPrefix=n+"v1/"}join(e){return n(this,void 0,void 0,(function*(){return yield this.req("channel/join",{device_type:e.deviceType,device_id:e.deviceID,version:e.version,netid:e.netID,sgid:e.sgID})}))}detail(e){return n(this,void 0,void 0,(function*(){let t=yield this.req("channel/detail",{with_userlist:e});if(e){let e=t.users;return delete t.users,{channelinfo:t,userinfos:e}}return{channelinfo:t,userinfos:null}}))}leave(){return n(this,void 0,void 0,(function*(){return this.req("channel/leave",{})}))}heartbeat(){return n(this,void 0,void 0,(function*(){return this.req("channel/heartbeat",{})}))}reconnect(e){return n(this,void 0,void 0,(function*(){return this.req("channel/reconnect",{type:e.type,netid:e.netID,sgid:e.sgID})}))}updateStream(e){return n(this,void 0,void 0,(function*(){return this.req("channel/update-stream",{stream_tracks:e})}))}req(e){return n(this,arguments,void 0,(function*(e,t={},r={}){const n=Math.floor(Date.now()/1e3),i=(0,a.genNonce)(16);r.app_id=this.appID,r.sid=this.sid,r.nonce=i,r.timestamp=n+"";let o=this.signature(t,i,n);r.signature=o;let u=Date.now(),c=(r,n)=>{l.logger[r]("rtc api: "+this.serverPrefix+e,t,n,Date.now()-u+"ms")};return this.http(e,t,Object.assign(Object.assign({},r),{"Content-Type":"application/json"})).then((e=>{if(c(0==e.code?l.LogLevel.DEBUG:l.LogLevel.WARN,e),0==e.code)return e.data;throw new s.SdkError(e.msg,e.code)})).catch((e=>{throw c(l.LogLevel.ERROR,e),e}))}))}signature(e,t,r){let n=`app_id=${this.appID}&sid=${this.sid}&nonce=${t}×tamp=${r}&`+JSON.stringify(e);return(0,o.default)(n,this.clientKey).toString()}}},4623:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseChannel=void 0;const o=i(r(7007)),s=r(7130),a=r(7514),l=r(3404),u=r(2977),c=r(2871),h=r(5951);class f{constructor(){this.ctn={},this.linkids={}}set(e,t){this.ctn[e]=t,t.link_id&&(this.linkids[t.link_id]=e)}get(e){return this.ctn[e]}getByLinkid(e){return this.get(this.linkids[e])}del(e){delete this.ctn[e]}clear(){this.ctn={},this.linkids={}}listInfo(){let e=[];for(const t in this.ctn)e.push(this.ctn[t].getInfo());return e}}var d;!function(e){e.INIT="init",e.CONNECTED="connected",e.RECONNECTING="reconnecting",e.LEAVED="leaved"}(d||(d={}));class p extends o.default{constructor(e,t,r,n,i=null){super(),this.joinRsp=e,this.users=new f,this.rtcApi=t,this.rtcSocket=n,this.rtcStreamEngine=r,this.eventCB=i,this.addSocketListeners(),this.connectState=d.INIT}refresh(){return n(this,void 0,void 0,(function*(){const{channelinfo:e,userinfos:t}=yield this.rtcApi.detail(!0);this.info=e,this.users.clear(),t&&t.forEach((e=>{let t=this.newUser(e);this.users.set(e.uid,t),e.sid==this.joinRsp.sid&&(this.me=t)})),this.heartbeatIntervalID&&clearInterval(this.heartbeatIntervalID);let r=this.heartbeatIntervalID=setInterval((()=>this.heartbeat()),3e4);a.logger.debug("heartbeat interval started",r),this.connectState=d.CONNECTED}))}checkConnected(){if(this.connectState!=d.CONNECTED)switch(this.connectState){case d.RECONNECTING:throw new s.SdkError("网络重连中,请稍后");case d.LEAVED:throw new s.SdkError("您已离开频道")}}addSocketListeners(){this.onConnected=this.onConnected.bind(this),this.onStartReconnect=this.onStartReconnect.bind(this),this.onChannelMessage=this.onChannelMessage.bind(this),this.rtcSocket.on(c.SocketEvent.CONNECTED,this.onConnected),this.rtcSocket.on(c.SocketEvent.RECONNECTING,this.onStartReconnect),this.rtcSocket.on(c.SocketEvent.CHANNEL_MESSAGE,this.onChannelMessage)}removeSocketListeners(){this.rtcSocket.off(c.SocketEvent.CONNECTED,this.onConnected),this.rtcSocket.off(c.SocketEvent.RECONNECTING,this.onStartReconnect),this.rtcSocket.off(c.SocketEvent.CHANNEL_MESSAGE,this.onChannelMessage)}triggerEvent(e,t){try{let r=new l.ChannelEvent(e,t);this.emit(e,r),this.eventCB&&this.eventCB(r)}catch(r){a.logger.error(`事件${e}上层响应出错,请sdk调用者检查`,r,t)}}heartbeat(){return n(this,void 0,void 0,(function*(){var e;let t=this.heartbeatIntervalID;if(this.connectState!=d.CONNECTED)return a.logger.info(`异常心跳,当前频道状态${this.connectState}`),clearInterval(t),Promise.reject(new s.SdkError(`异常心跳,频道状态为:${this.connectState}`));try{yield this.rtcApi.heartbeat()}catch(e){a.logger.error("心跳失败",e),e instanceof s.SdkError&&this.leave(l.DisconnectReason.Error,e)}a.logger.debug("heartbeat interval",t,null===(e=this.me)||void 0===e?void 0:e.uid)}))}onConnected(){return n(this,void 0,void 0,(function*(){let e=this.connectState;a.logger.warn(e==d.RECONNECTING?"会控socket重连成功":"会控socket连接成功");try{this.connectState=d.CONNECTED,yield this.refresh(),e==d.RECONNECTING?this.triggerEvent(l.CommonChannelEventType.RECONNECTED,this.getInfo()):this.triggerEvent(l.CommonChannelEventType.JOIN_SUCCEED,this.getInfo())}catch(e){this.leave(l.DisconnectReason.Error,e)}}))}onStartReconnect(){a.logger.warn("socket开始重连"),clearInterval(this.heartbeatIntervalID),this.connectState=d.RECONNECTING,this.triggerEvent(l.CommonChannelEventType.RECONNECTING)}onChannelMessage(e){switch(e.type){case u.RtcMsgType.ChannelUpdate:{const t=e.data;if(!t||t.channel!=this.joinRsp.channel)return;this.info.props=t.props,this.triggerEvent(l.CommonChannelEventType.CHANNEL_UPDATE,this.getInfo());break}case u.RtcMsgType.ChannelDestroy:{const t=e.data;if(!t||t.channel!=this.joinRsp.channel)return;this.leave(l.DisconnectReason.Destroy);break}case u.RtcMsgType.UserUpdate:{const t=e.data;if(!t||t.channel!=this.joinRsp.channel)return;let r=this.users.get(t.uid);r&&(r.updateInfo(t),this.triggerEvent(t.sid==this.joinRsp.sid?l.CommonChannelEventType.ME_UPDATE:l.CommonChannelEventType.USER_UPDATE,r.getInfo()));break}case u.RtcMsgType.UserLeave:{const t=e.data;if(!t||t.channel!=this.joinRsp.channel)return;if(t.sid==this.joinRsp.sid)this.leave(t.reason);else{let e=this.users.get(t.uid);if(!e)return void a.logger.error(`收到用户${t.uid}离开消息,但其不在频道内`);for(const t in e.getTracks()){let r=e.getTracks()[t];this.rtcStreamEngine.haveSubscribed(r)&&this.unsubscribeRemoteTrack(r)}this.users.del(t.uid),this.triggerEvent(l.CommonChannelEventType.USER_LEAVE,{uid:t.uid,reason:t.reason})}break}case u.RtcMsgType.UserJoin:{const t=e.data;if(!t||t.channel!=this.joinRsp.channel||t.sid==this.joinRsp.sid)return;let r=this.users.get(t.uid);r&&(a.logger.warn(`收到成员${t.uid}(${t.name})入会消息,但其已经在频道内,先模拟一次离开频道`),this.users.del(t.uid),this.triggerEvent(l.CommonChannelEventType.USER_LEAVE,{uid:t.uid,reason:l.DisconnectReason.Error})),r=this.newUser(t),this.users.set(t.uid,r),this.triggerEvent(l.CommonChannelEventType.USER_JOIN,r.getInfo());break}case u.RtcMsgType.StreamUpdate:{const t=e.data;if(!t||t.channel!=this.joinRsp.channel||t.sid==this.joinRsp.sid)return;let r=this.users.get(t.uid),{added:n,updated:i,deleted:o}=r.updateTracks(t.stream_tracks);n.forEach((e=>{this.triggerEvent(l.CommonChannelEventType.USER_TRACK_ADD,{user:r.getInfo(),track:e.getInfo()})})),i.forEach((e=>{this.triggerEvent(l.CommonChannelEventType.USER_TRACK_UPDATE,{user:r.getInfo(),track:e.getInfo()})})),o.forEach((e=>{this.rtcStreamEngine.haveSubscribed(e)&&this.unsubscribeRemoteTrack(e),this.triggerEvent(l.CommonChannelEventType.USER_TRACK_REMOVE,{user:r.getInfo(),track:e.getInfo()})}));break}case u.RtcMsgType.Custom:{const t=e.data;if(!t||t.channel!=this.joinRsp.channel)return;this.triggerEvent(l.CommonChannelEventType.CUSTOM_MSG,t);break}}}getMe(){if(!this.me)throw new s.SdkError("尚未获取到自己信息");return this.me}getUser(e){let t=this.users.get(e);if(!t)throw new s.SdkError(`频道内没有用户${e}`);return t}getUsersInfo(){return this.users.listInfo()}leave(e,t){return n(this,void 0,void 0,(function*(){var r;if(this.connectState!==d.LEAVED){clearInterval(this.heartbeatIntervalID),this.removeSocketListeners();try{yield this.rtcSocket.close()}catch(e){a.logger.error("断开会控socket报错",e)}try{yield this.rtcApi.leave()}catch(e){a.logger.error("调离开频道api报错",e)}try{yield this.rtcStreamEngine.disconnect()}catch(e){a.logger.error("断开流媒体引擎报错",e)}this.connectState=d.LEAVED,this.triggerEvent(l.CommonChannelEventType.DISCONNECTED,{reason:e,error:t}),this.removeAllListeners(),this.eventCB=null,null===(r=a.logger.center)||void 0===r||r.leavedChannel(),a.logger.info("leaved channel",this.joinRsp.channel)}}))}getInfo(){let e=Object.assign({},this.info);return e.props=Object.assign({},e.props),e}getPublishExOption(e,t){return n(this,void 0,void 0,(function*(){return{}}))}publishLocalTrack(e,t){return n(this,void 0,void 0,(function*(){if(!t.desc)throw new s.SdkError("轨道发布描述不能为空");let r=this.getMe(),n=yield this.getPublishExOption(e,t);if(yield this.rtcStreamEngine.publish(e,t,n),e.kind==h.TrackKind.Audio){let r=t;e.updateInfo({desc:r.desc,codec:r.codec,bitrate:r.maxBitrate,props:r.props})}else{let r=t;e.updateInfo({desc:r.desc,codec:r.codec,width:r.width,height:r.height,fps:r.maxFramerate,bitrate:r.maxBitrate,props:r.props})}try{let t=Object.values(r.getTracks()).map((e=>e.getInfo()));t.push(e.getInfo()),yield this.rtcApi.updateStream(t),r.getTracks()[e.id]=e}catch(t){throw this.unpublishLocalTrack(e),t}}))}unpublishLocalTrack(e){return n(this,void 0,void 0,(function*(){let t=this.getMe(),r=!1,n=Object.values(t.getTracks()).map((e=>e.getInfo())),i=n.filter((t=>(r=!0,t.id!==e.id)));if(r){yield this.rtcApi.updateStream(i);try{yield this.rtcStreamEngine.unpublish(e),delete t.getTracks()[e.id]}catch(e){throw yield this.rtcApi.updateStream(n),e}}else a.logger.warn(e.toString()+"已取消发布,无需再次取消发布")}))}getSubscribeExOption(e){return n(this,void 0,void 0,(function*(){return{}}))}subscribeRemoteAudioMixTrack(e){return n(this,void 0,void 0,(function*(){let t=this.newRemoteAudioMixTrack(e),r=yield this.getSubscribeExOption(t);return yield this.rtcStreamEngine.subscribe(t,r),t}))}subscribeRemoteAudioTrack(e,t){return n(this,void 0,void 0,(function*(){let r=this.getUser(e).getTrack(t);if(!r)throw new s.SdkError(e+"没有id为"+t+"的音频流");if(r.kind!=h.TrackKind.Audio)throw new s.SdkError(e+"id为"+t+"的流非音频,而是"+r.kind);let n=yield this.getSubscribeExOption(r);return yield this.rtcStreamEngine.subscribe(r,n),r}))}subscribeRemoteVideoTrack(e,t){return n(this,void 0,void 0,(function*(){let r=this.getUser(e).getTrack(t);if(!r)throw new s.SdkError(e+"没有id为"+t+"的视频流");if(r.kind!=h.TrackKind.Video)throw new s.SdkError(e+"id为"+t+"的流非视频,而是"+r.kind);let n=yield this.getSubscribeExOption(r);return yield this.rtcStreamEngine.subscribe(r,n),r}))}unsubscribeRemoteTrack(e){return n(this,void 0,void 0,(function*(){yield this.rtcStreamEngine.unsubscribe(e)}))}}t.BaseChannel=p},3404:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommonTrackEventType=t.CommonChannelEventType=t.DisconnectReason=t.ChannelEvent=void 0;var r;t.ChannelEvent=class{constructor(e,t){this.type=e,this.data=t}},function(e){e[e.Error=-1]="Error",e[e.Self=1]="Self",e[e.Kicked=2]="Kicked",e[e.Replace=3]="Replace",e[e.Timeout=4]="Timeout",e[e.Destroy=5]="Destroy"}(r||(t.DisconnectReason=r={}));class n{}t.CommonChannelEventType=n,n.CHANNEL_UPDATE="channel_update",n.JOIN_SUCCEED="join_succeed",n.ME_UPDATE="me_update",n.RECONNECTING="reconnecting",n.RECONNECTED="reconnected",n.DISCONNECTED="disconnected",n.USER_JOIN="user_join",n.USER_UPDATE="user_update",n.USER_LEAVE="user_leave",n.USER_TRACK_ADD="user_track_add",n.USER_TRACK_UPDATE="user_track_update",n.USER_TRACK_REMOVE="user_track_remove",n.CUSTOM_MSG="custom_msg",n.TRACK_MUTED="track_muted",n.TRACK_UNMUTED="track_unmuted",n.TRACK_ENDED="track_ended";class i{}t.CommonTrackEventType=i,i.MUTED="muted",i.UNMUTED="unmuted",i.ENDED="ended"},7620:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseSRTC=void 0;const i=r(3143),o=r(7130),s=r(86),a=r(7255),l=r(7514),u=r(7820),c=r(3404);t.BaseSRTC=class{constructor(e){this.onNotifyChannelEvent=null,this.isAppHide=!1,e.logLevel&&l.logger.setLevel(e.logLevel),e.logTarget&&((0,i.isWxxcx)()||e.logTarget!=l.LogTarget.WXREALTIME||(e.logTarget=l.LogTarget.CONSOLE,l.logger.warn("仅微信小程序支持实时日志")),l.logger.setTarget(e.logTarget));let t=this.buildInfo();l.logger.warn("srtc "+((0,i.isWxxcx)()?"wechat":"webrtc")+" sdk version:",t.version,"build time:",(0,s.dateFormat)("Y-m-d H:i:s",new Date(1e3*t.timestamp)))}join(e){return n(this,arguments,void 0,(function*(e,t={netID:"",sgID:""}){if(this.channel)throw new o.SdkError("请先退出频道");const r=Math.floor(Date.now()/1e3);let u=(0,s.decryptChannelToken)(e);if(u.exp_at&&u.exp_at<r)throw new o.SdkError("token已过期");u.log_center&&(l.logger.center=new a.RtcLogger(u,this.getStoredDeviceId(),this.getDeviceType(),!0));let h=this.rtcApi=this.newRtcApi(u),f=yield h.join({deviceType:this.getDeviceType(),deviceID:this.getStoredDeviceId(),version:this.buildInfo().version,netID:t.netID,sgID:t.sgID}),d=this.newStreamEngine(f);yield d.connect();let p=this.rtcSocket=this.newRtcSocket(((e,r,n)=>{const o=Math.floor(Date.now()/1e3);return f.mqtt.token_exp_at<o&&h.reconnect({type:0,netID:t.netID,sgID:t.sgID}).then((e=>{f.mqtt=e.mqtt,f.upload=e.upload,f.rtmp=e.rtmp,f.webrtc=e.webrtc})),n.options.username=f.mqtt.username,n.options.clientId=f.mqtt.client_id,n.options.password=f.mqtt.jwt_token,(0,i.isWxxcx)()?f.mqtt.ws.replace(/ws:/,"wx:").replace(/wss:/,"wxs:"):f.mqtt.ws})),g=this.channel=this.newChannel(f,h,d,p);return new Promise(((e,t)=>n(this,void 0,void 0,(function*(){g.once(c.CommonChannelEventType.JOIN_SUCCEED,(t=>{e(t)})),g.once(c.CommonChannelEventType.DISCONNECTED,(e=>{t(e)}));try{yield p.connect(f.mqtt)}catch(e){t(e)}}))))}))}leave(){return n(this,void 0,void 0,(function*(){if(this.channel)try{this.onNotifyChannelEvent=null;const e=this.channel;this.channel=null,yield e.leave(u.LeaveReason.Self),this.rtcSocket=null,this.rtcApi=null}catch(e){l.logger.error("离开频道报错,强制离开",e)}else l.logger.warn("您不在频道中,无需调用离开")}))}getChannelInfo(){return this.channel?this.channel.getInfo():null}getUserInfo(e){if(!this.channel)throw new o.SdkError("您不在频道内");return this.channel.getUser(e).getInfo()}getUsersInfo(){if(!this.channel)throw new o.SdkError("您不在频道内");return this.channel.getUsersInfo()}subscribeRemoteAudioMixTrack(e){return n(this,void 0,void 0,(function*(){if(!this.channel)throw new o.SdkError("您不在频道内");return yield this.channel.subscribeRemoteAudioMixTrack(e)}))}subscribeRemoteAudioTrack(e,t){return n(this,void 0,void 0,(function*(){if(!this.channel)throw new o.SdkError("您不在频道内");return yield this.channel.subscribeRemoteAudioTrack(e,t)}))}subscribeRemoteVideoTrack(e,t){return n(this,void 0,void 0,(function*(){if(!this.channel)throw new o.SdkError("您不在频道内");return yield this.channel.subscribeRemoteVideoTrack(e,t)}))}unsubscribeRemoteTrack(e){return n(this,void 0,void 0,(function*(){if(!this.channel)throw new o.SdkError("您不在频道内");yield this.channel.unsubscribeRemoteTrack(e)}))}onAppShow(e){e?l.logger.warn("页面恢复显示",e):l.logger.warn("页面恢复显示"),this.isAppHide=!1}onAppHide(){l.logger.warn("页面切后台或最小化"),this.isAppHide=!0}}},2977:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.RtcMsgType=void 0,function(e){e.UserJoin="user_join",e.UserUpdate="user_update",e.UserLeave="user_leave",e.StreamUpdate="stream_update",e.ChannelUpdate="channel_update",e.ChannelDestroy="channel_destroy",e.Custom="custom"}(r||(t.RtcMsgType=r={}))},2871:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRtcSocket=t.SocketEvent=void 0;const o=i(r(7007)),s=i(r(3061)),a=r(6526),l=r(3143),u=r(7130),c=r(7514);var h;!function(e){e.CONNECTED="connected",e.RECONNECTING="reconnection",e.CHANNEL_MESSAGE="channelmessage",e.IM_MESSAGE="immessage",e.CUSTOM_TOPIC_MESSAGE="custommessage"}(h||(t.SocketEvent=h={}));class f extends o.default{constructor(e){super(),this.version=1,this.ssTopics={},this.authReconnect=e,this.unpacker=new a.Unpackr({useRecords:!1,int64AsType:"number"})}connect(e){return n(this,void 0,void 0,(function*(){this.client&&(yield this.close(!0));let t=e.ws;return(0,l.isWxxcx)()&&(t=e.ws.replace(/ws:/,"wx:").replace(/wss:/,"wxs:")),new Promise(((r,i)=>{this.client=s.default.connect(t,{keepalive:30,clean:!1,connectTimeout:1e4,reconnectPeriod:3e3,resubscribe:!1,clientId:e.client_id,username:e.username,password:e.jwt_token,transformWsUrl:this.authReconnect});let o=e=>{l(),setTimeout((()=>{this.close(!0)}),0);let t=e?u.SdkError.fromError(e):new u.SdkError("会控服务连接失败");i(t)},a=t=>{l(),e.topics.forEach((e=>n(this,void 0,void 0,(function*(){try{yield this.subscribe(e,2)}catch(e){this.close(!0),i(e)}})))),this.addListeners(),this.client.emit("connect",t),r()},l=()=>{this.client.off("connect",a),this.client.off("error",o),this.client.off("offline",o),this.client.off("close",o)};this.client.once("connect",a),this.client.once("error",o),this.client.once("offline",o),this.client.once("close",o)}))}))}addListeners(){this.client.on("connect",(()=>{c.logger.info("socket connected"),this.emit(h.CONNECTED)})),this.client.on("reconnect",(()=>{c.logger.info("socket start reconnect"),this.emit(h.RECONNECTING)})),this.client.on("close",(()=>{c.logger.info("socket closed")})),this.client.on("offline",(()=>{c.logger.info("socket offline")})),this.client.on("error",(e=>{throw c.logger.error("socket error",e),u.SdkError.fromError(e)})),this.onMsg=this.onMsg.bind(this),this.client.on("message",this.onMsg)}subscribe(e,t=0){return new Promise(((r,n)=>{this.client.subscribe(e,{qos:t},((t,i)=>{t?(c.logger.error(`subscribe ${e} error`,t),n(u.SdkError.fromError(t))):i&&(c.logger.debug(`subscribe ${e} success`,i),i.forEach((e=>{this.ssTopics[e.topic]=e.qos})),r())}))}))}unsubscribe(e){return new Promise(((t,r)=>{this.client.unsubscribe(e,(n=>{if(n)c.logger.error(`unsubscribe ${e} error`,n),r(u.SdkError.fromError(n));else{("string"==typeof e?[e]:e).forEach((e=>{delete this.ssTopics[e]})),t()}}))}))}close(){return n(this,arguments,void 0,(function*(e=!1){return new Promise(((t,r)=>{this.client.end(e,(e=>{null!=e?r(u.SdkError.fromError(e)):t()}))}))}))}sendMsg(e,t,r=0){return new Promise(((n,i)=>{this.client.publish(t,e,{qos:r},(e=>{null!=e?i(u.SdkError.fromError(e)):n()}))}))}onMsg(e,t,r){try{if(0!==e.indexOf("/rtc/"))return void this.emit(h.CUSTOM_TOPIC_MESSAGE,e,t);let r=this.unpacker.unpack(t);if(null==r)return void c.logger.error("解析报文失败",e,t);c.logger.debug("收到会控消息",r),this.emit(r.data.channel?h.CHANNEL_MESSAGE:h.IM_MESSAGE,r)}catch(e){c.logger.error("消息处理报错",e)}}}t.BaseRtcSocket=f},8912:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseStreamEngine=t.StreamEngineVendor=void 0;const i=r(7130),o=r(86),s=r(7514),a=r(5951);var l;!function(e){e.OOK="ook",e.WangsuCDN="wangsucdn"}(l||(t.StreamEngineVendor=l={}));t.BaseStreamEngine=class{constructor(e,t){this.joinRsp=e,this.published={},this.subscribed={},t&&(this.ability?(0,o.propAssign)(this.ability,t):this.ability=t)}publish(e,t,r){return n(this,void 0,void 0,(function*(){let t=0;if(e.kind==a.TrackKind.Audio&&this.ability&&void 0!==this.ability.audioMaxPub&&-1!=this.ability.audioMaxPub){for(const e in this.published){this.published[e].kind==a.TrackKind.Audio&&t++}if(t>=this.ability.audioMaxPub)throw new i.SdkError("最多允许发布"+this.ability.audioMaxPub+"个音频轨道")}else if(e.kind==a.TrackKind.Video&&this.ability&&void 0!==this.ability.videoMaxPub&&-1!=this.ability.videoMaxPub){for(const e in this.published){this.published[e].kind==a.TrackKind.Video&&t++}if(t>=this.ability.videoMaxPub)throw new i.SdkError("最多允许发布"+this.ability.videoMaxPub+"个视频轨道")}}))}subscribe(e,t){return n(this,void 0,void 0,(function*(){let t=0;if(e.kind==a.TrackKind.Audio&&this.ability&&void 0!==this.ability.audioMaxSub&&-1!=this.ability.audioMaxSub){for(const e in this.subscribed){this.subscribed[e].kind==a.TrackKind.Audio&&t++}if(t>=this.ability.audioMaxSub)throw new i.SdkError("最多允许订阅"+this.ability.audioMaxSub+"个音频轨道")}else if(e.kind==a.TrackKind.Video&&this.ability&&void 0!==this.ability.videoMaxSub&&-1!=this.ability.videoMaxSub){for(const e in this.subscribed){this.subscribed[e].kind==a.TrackKind.Video&&t++}if(t>=this.ability.videoMaxSub)throw new i.SdkError("最多允许订阅"+this.ability.videoMaxSub+"个视频轨道")}}))}haveSubscribed(e){return!!this.subscribed[e.id]}disconnect(){return n(this,void 0,void 0,(function*(){for(const e in this.published){const t=this.published[e];try{yield this.unpublish(t.track)}catch(e){s.logger.error(t.track.toString(),"取消发布失败")}}for(const e in this.subscribed){const t=this.subscribed[e];try{yield this.unsubscribe(t.track)}catch(e){s.logger.error(t.track.toString(),"取消订阅失败")}}this.published={},this.subscribed={}}))}}},5951:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTrack=t.Codec=t.TrackKind=t.TRACK_MCU_ID=t.TRACK_AMIXER_ID=void 0;const i=n(r(7007)),o=r(86);var s,a;t.TRACK_AMIXER_ID="__amixer__",t.TRACK_MCU_ID="__mcu__",function(e){e.Video="video",e.Audio="audio"}(s||(t.TrackKind=s={})),function(e){e[e.Unknown=0]="Unknown",e[e.H264=27]="H264",e[e.H265=36]="H265",e[e.AAC=15]="AAC",e[e.OPUS=1398100047]="OPUS"}(a||(t.Codec=a={}));class l extends i.default{constructor(e,t){super(),this.info=e,this.uid=t}get id(){return this.info.id}get kind(){return this.info.kind}get desc(){return this.info.desc}getInfo(){let e=Object.assign({},this.info);return e.props=Object.assign({},e.props),e}updateInfo(e){return(0,o.propAssign)(this.info,e)}getUid(){return this.uid}strPrefix(){return"流轨道"}toString(){const e=[this.uid?`uid:${this.uid}`:null,this.info.desc?`desc:${this.info.desc}`:null,this.id?`id:${this.info.id}`:null].filter(Boolean);return this.strPrefix()+"["+e.join("; ")+"]"}}t.BaseTrack=l},6757:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceType=void 0,function(e){e[e.Unknown=0]="Unknown",e[e.Windows=1]="Windows",e[e.Android=2]="Android",e[e.IOS=3]="IOS",e[e.Linux=4]="Linux",e[e.MacOS=5]="MacOS",e[e.WebRTC=6]="WebRTC",e[e.XCX=7]="XCX"}(r||(t.DeviceType=r={}))},1381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseUser=void 0;const n=r(86);t.BaseUser=class{constructor(e){var t;this.info=e,this.tracks={},null===(t=e.stream_tracks)||void 0===t||t.forEach((e=>{let t=this.newTrack(e);this.tracks[e.id]=t}))}getTrack(e){return this.tracks[e]}getTracks(){return this.tracks}updateTracks(e){let t=[],r=[],n=[],i={},o={};for(let e in this.tracks)i[e]=!0,o[e]=this.tracks[e];e.forEach((e=>{let n=o[e.id];if(n){let t=n.updateInfo(e);delete i[e.id],t.length>0&&r.push(n)}else{let r=this.newTrack(e);this.tracks[e.id]=r,t.push(r)}}));for(let e in i){let t=this.tracks[e];t&&(delete this.tracks[e],n.push(t))}return this.info.stream_tracks=e,{added:t,updated:r,deleted:n}}get uid(){return this.info.uid}get sid(){return this.info.sid}get device_type(){return this.info.device_type}get device_id(){return this.info.device_id}get link_id(){return this.info.link_id}getInfo(){var e;let t=Object.assign({},this.info);return t.props=Object.assign({},t.props),t.stream_tracks=null===(e=t.stream_tracks)||void 0===e?void 0:e.map((e=>Object.assign({},e))),t}updateInfo(e){(0,n.propAssign)(this.info,e)}}},1758:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Ability=void 0;const i=r(3143),o=r(7130),s=r(7514);t.Ability=class{static checkCameraPermission(){return n(this,void 0,void 0,(function*(){if((0,i.isWxxcx)()){let e="scope.camera";return new Promise(((t,r)=>{wx.authorize({scope:e,success:()=>{t()},fail:()=>{r(new o.SdkError("获取摄像头授权失败",40001))}})}))}}))}static checkMicPermission(){return n(this,void 0,void 0,(function*(){if((0,i.isWxxcx)()){let e="scope.record";return new Promise(((t,r)=>{wx.authorize({scope:e,success:()=>{t()},fail:()=>{r(new o.SdkError("获取麦克风授权失败",40001))}})}))}}))}static videoEncCodecs(){return"getCapabilities"in RTCRtpSender?RTCRtpSender.getCapabilities("video"):(s.logger.warn("当前环境不支持getCapabilities获取支持的视频编码类型"),null)}static audioEncCodecs(){return"getCapabilities"in RTCRtpSender?RTCRtpSender.getCapabilities("audio"):(s.logger.warn("当前环境不支持getCapabilities获取支持的音频编码类型"),null)}static videoDecCodecs(){return"getCapabilities"in RTCRtpReceiver?RTCRtpReceiver.getCapabilities("video"):(s.logger.warn("当前环境不支持getCapabilities获取支持的视频解码类型"),null)}static audioDecCodecs(){return"getCapabilities"in RTCRtpReceiver?RTCRtpReceiver.getCapabilities("audio"):(s.logger.warn("当前环境不支持getCapabilities获取支持的音频解码类型"),null)}static checkVideoCodec(e,t=!0){const r=t?this.videoEncCodecs():this.videoDecCodecs();if(r)for(const t of r.codecs)if(t.mimeType.toLowerCase().replace("video/","")===e.toLowerCase())return!0;return!1}static checkAudioCodec(e,t=!0){const r=t?this.audioEncCodecs():this.audioDecCodecs();if(r)for(const t of r.codecs)if(t.mimeType.toLowerCase().replace("audio/","")===e.toLowerCase())return!0;return!1}}},3143:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isWxxcx=s,t.isChromiumBased=function(){var e,t,r;return"chrome"===(null===(r=null===(t=null===(e=c())||void 0===e?void 0:e.browser)||void 0===t?void 0:t.name)||void 0===r?void 0:r.toLowerCase())},t.isSafari=function(){var e,t,r;return"Safari"===(null===(r=null===(t=null===(e=c())||void 0===e?void 0:e.browser)||void 0===t?void 0:t.name)||void 0===r?void 0:r.toLowerCase())},t.isWebrtcSupport=a,t.getEnvInfo=c;const i=n(r(6880)),o=r(1758);function s(){return"undefined"!=typeof wx&&"function"==typeof wx.getSystemInfo}function a(){return"undefined"!=typeof RTCPeerConnection&&("addTransceiver"in RTCPeerConnection.prototype||"addTrack"in RTCPeerConnection.prototype)}let l,u;function c(e=!1){var t,r,n;if(s()){if(e||void 0===l){const e=wx.getSystemInfoSync(),t=wx.getDeviceInfo();l={system:e,device:t}}return l}return(e||void 0===u)&&(u=Object.assign(Object.assign({},i.default.parse(null===navigator||void 0===navigator?void 0:navigator.userAgent)),{supported:a(),secure:isSecureContext,mediaDevices:void 0!==(null===navigator||void 0===navigator?void 0:navigator.mediaDevices),screenshare:void 0!==(null===(t=null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||void 0===t?void 0:t.getDisplayMedia),h264Enc:o.Ability.checkVideoCodec("h264"),h264Dec:o.Ability.checkVideoCodec("h264",!1),vp8Enc:o.Ability.checkVideoCodec("vp8"),vp8Dec:o.Ability.checkVideoCodec("vp8",!1),opusEnc:o.Ability.checkAudioCodec("opus"),opusDec:o.Ability.checkAudioCodec("opus",!1),videoEncCodecs:o.Ability.videoEncCodecs(),videoDecCodecs:o.Ability.videoDecCodecs(),audeoEncCodecs:o.Ability.audioEncCodecs(),audeoDecCodecs:o.Ability.audioDecCodecs(),ua:null===navigator||void 0===navigator?void 0:navigator.userAgent,screenWidth:(null===screen||void 0===screen?void 0:screen.width)||0,screenHeight:(null===screen||void 0===screen?void 0:screen.height)||0,clientWidth:(null===(r=null===document||void 0===document?void 0:document.documentElement)||void 0===r?void 0:r.clientWidth)||0,clientHeight:(null===(n=null===document||void 0===document?void 0:document.documentElement)||void 0===n?void 0:n.clientHeight)||0,devicePixelRatio})),u}},7130:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SdkError=void 0;class r{constructor(e,t=0){this.msg=e,this.code=t}static fromError(e){return new r(e.name+":"+e.message)}toJSON(){return{code:this.code,msg:this.msg}}}t.SdkError=r},86:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=s,t.tpl=function(e,t){return e.replace(/\{\{([\w.]+)\}\}/g,(function(e,r){const n=r.split(".");let i=t;for(let e=0;e<n.length&&(i=i[n[e]],null!=i);e++);return null==i?"":i.toString()}))},t.propAssign=function(e,t,r){let n=[];return function(e){return Object.getOwnPropertyNames(e)}(t).forEach((i=>{let o=!0;s(e[i])?JSON.stringify(e[i])!==JSON.stringify(t[i])&&(o=!1):e[i]!==t[i]&&(o=!1),o||(n.push({prop:i.toString(),value:t[i],old:e[i]}),r&&r[i]?r[i](t[i],e[i]):e[i]=t[i])})),n},t.dateFormat=function(e,t=new Date){for(var r="",n=t.getMonth(),i=n+1,o=t.getDay(),s=t.getDate(),a=t.getFullYear(),l=t.getHours(),u=t.getMinutes(),c=t.getSeconds(),h=0,f=e.length;h<f;h++)switch(e[h]){case"j":r+=s;break;case"d":r+=s<10?"0"+s:s;break;case"l":var d=Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");r+=d[o];break;case"w":r+=o;break;case"D":r+=(d=Array("Sun","Mon","Tue","Wed","Thr","Fri","Sat"))[o];break;case"m":r+=i<10?"0"+i:i;break;case"n":r+=i;break;case"F":var p=Array("January","February","March","April","May","June","July","August","September","October","November","December");r+=p[n];break;case"M":r+=(p=Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"))[n];break;case"Y":r+=a;break;case"y":r+=a.toString().slice(-2);break;case"H":r+=l<10?"0"+l:l;break;case"g":var g=0===l?12:l;r+=g>12?g-12:g;break;case"h":r+=(g=(g=0===l?12:l)>12?g-12:g)<10?"0"+g:g;break;case"a":r+=l<12?"am":"pm";break;case"i":r+=u<10?"0"+u:u;break;case"s":r+=c<10?"0"+c:c;break;case"c":r+=t.toISOString();break;default:r+=e[h]}return r},t.genNonce=a,t.genDeviceId=function(){return a(18)},t.getHostnameFromUrl=function(e){const t=e.match(/^(?:.+?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n]+)/im);if(t&&t[1])return t[1];return""},t.decryptChannelToken=function(e){return JSON.parse(o.default.decrypt(e,i.enc.Utf8.parse(l),{iv:i.enc.Utf8.parse(u),padding:i.pad.Pkcs7,mode:i.mode.CBC}).toString(i.enc.Utf8))};const i=r(1396),o=n(r(955));function s(e){return null!=e&&"object"==typeof e}function a(e=18){e=e||32;let t="ABCDEFGHJKLMNOPQRSTUVWXYZabcdefghigklmnopqrstuvwxyz1234567890",r="";for(let n=0;n<e;n++)r+=t.charAt(Math.floor(61*Math.random()));return r}const l="6o30j79YRE39bEwI",u="2apW3WiFl72ZVS3x"},8949:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.localForageWxDriver=void 0,t.localForageWxDriver={keyPrefix:"",_driver:"localForageWxDriver",_initStorage:function(e){this.keyPrefix=e.name+"/"+e.storeName+"/"},_support:"undefined"!=typeof wx&&"function"==typeof wx.getSystemInfo,getItem:function(e,t){return new Promise(((t,r)=>{try{t(wx.getStorageSync(this.keyPrefix+e))}catch(e){r(e)}}))},setItem:function(e,t,r){return new Promise(((r,n)=>{try{wx.setStorageSync(this.keyPrefix+e,t),r(t)}catch(e){n(e)}}))},removeItem:function(e,t){return new Promise(((t,r)=>{try{wx.removeStorageSync(this.keyPrefix+e),t()}catch(e){r(e)}}))},clear:function(e){return r(this,void 0,void 0,(function*(){const e=(yield this.keys()).map((e=>this.removeItem(e)));yield Promise.all(e)}))},length:function(e){return r(this,void 0,void 0,(function*(){return(yield this.keys()).length}))},key:function(e,t){return r(this,void 0,void 0,(function*(){return(yield this.keys())[e]}))},keys:function(e){return new Promise(((e,t)=>{try{var r=this.keyPrefix.length;const t=wx.getStorageInfoSync();let i=[];for(let e=0;e<t.keys.length;e++){var n=t.keys[e];n.startsWith(this.keyPrefix)&&i.push(n.substring(r))}e(i)}catch(e){t(e)}}))},iterate:function(e,t){return r(this,void 0,void 0,(function*(){const t=yield this.keys();let r=1;for(var n=0;n<t.length;n++){const i=t[n];let o=yield this.getItem(i),s=e(o,i,r++);if(void 0!==s)return s}}))},dropInstance:function(e,t){return this.clear()}}},7255:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RtcLogger=t.RtcLogType=t.RtcLogLevel=void 0;const o=r(1396),s=i(r(3790)),a=r(6757),l=r(7130),u=r(86),c=r(8949),h=r(7514);var f,d,p;!function(e){e[e.Undefined=0]="Undefined",e[e.Trace=1]="Trace",e[e.Debug=5]="Debug",e[e.Info=9]="Info",e[e.Warn=13]="Warn",e[e.Error=17]="Error",e[e.FATAL=21]="FATAL"}(f||(t.RtcLogLevel=f={})),function(e){e.AppStart="app.start",e.AppResource="app.resource",e.AppNetwork="app.network",e.RtcEvtAudioInput="rtc.event.audioinput",e.RtcEvtAudioOutput="rtc.event.audiooutput",e.RtcEvtVideoInput="rtc.event.videoinput",e.RtcEvtVideoOutput="rtc.event.videooutput",e.RtcEvtRemoteStream="rtc.event.remotestream",e.RtcEvtConnection="rtc.event.connection",e.RtcMqtt="rtc.mqtt",e.RtcRequest="rtc.request",e.RtcOok="rtc.ook",e.RtcMarker="rtc.marker",e.RtcLog="rtc.log",e.AppLog="app.log"}(d||(t.RtcLogType=d={})),function(e){e[e.Log=0]="Log",e[e.Metric=1]="Metric"}(p||(p={}));t.RtcLogger=class{constructor(e,t,r,n){this.isWorking=!1,this.keyIdx=0,this.startTime=Date.now(),this.enabled=n,this.token=e,this.deviceID=t,this.deviceType=r,this.api=new g(e.app_id,e.log_center,t,r,"vaZ7MQ45m0KRjJ2u"),n&&(r==a.DeviceType.XCX&&s.default.defineDriver(c.localForageWxDriver),this.storage=s.default.createInstance({name:"rtcsdk",storeName:e.sid,driver:r==a.DeviceType.XCX?c.localForageWxDriver._driver:void 0}),this.storage.ready().then((()=>{console.debug("localforage initialized",this.storage.driver()),this.work()})).catch((e=>{console.debug("localforage initialize error",e),this.storage=void 0})),setInterval((()=>{this.work()}),6e4))}leavedChannel(){this.work()}work(){return n(this,void 0,void 0,(function*(){if(this.enabled&&!this.isWorking){this.isWorking=!0;try{yield this.upload()}catch(e){h.logger.error("rtc日志上传报错",e)}finally{this.isWorking=!1}}}))}makeKey(e){let t=[e==p.Log?"log":"metric",this.startTime,this.keyIdx].join("_");return this.keyIdx++,t}appendToStorage(e,t){return n(this,void 0,void 0,(function*(){if(!this.storage)return;let r=this.makeKey(e);yield this.storage.setItem(r,t);let n=yield this.storage.keys();if(n.length>=5e3){n.sort(((e,t)=>{let r=parseFloat(e.split("_").slice(1).join(".")),n=parseFloat(t.split("_").slice(1).join("."));return r<n?-1:r>n?1:0}));const e=n.slice(0,1e3).map((e=>this.storage.removeItem(e)));yield Promise.all(e)}}))}peekFromStorage(){return n(this,void 0,void 0,(function*(){if(!this.storage)return[];let e=yield this.storage.keys();e.sort(((e,t)=>{let r=parseFloat(e.split("_").slice(1).join(".")),n=parseFloat(t.split("_").slice(1).join("."));return r<n?-1:r>n?1:0})),console.debug("rtclog storage count="+e.length);let t=[];for(let r=0;r<e.length;r++){let n=e[r],i={type:p.Log,key:n,content:void 0};if(n.startsWith("log_"))i.type=p.Log;else{if(!n.startsWith("metric_"))continue;i.type=p.Metric}if(i.content=yield this.storage.getItem(n),i.content&&i.content.body&&Array.isArray(i.content.body)&&(i.content.body=JSON.stringify(i.content.body)),t.push(i),t.length>=500)break}return t}))}removeStorage(e){return n(this,void 0,void 0,(function*(){if(!this.storage)return;const t=e.map((e=>this.storage.removeItem(e.key)));yield Promise.all(t)}))}upload(){return n(this,void 0,void 0,(function*(){let e=yield this.peekFromStorage();if(0==e.length)return;let t={device_id:this.deviceID,device_type:this.deviceType,app_id:this.token.app_id,uid:this.token.uid,logs:[],metrics:[]};for(let r=0;r<e.length;r++){let n=e[r];n.type==p.Log?t.logs.push(n.content):n.type==p.Metric&&t.metrics.push(n.content)}yield this.api.push(t),yield this.removeStorage(e)}))}addLog(e){return n(this,arguments,void 0,(function*({body:e,level:t=f.Undefined,type:r=d.AppLog}){if(!this.enabled)return;let n={time:Date.now(),type:r,serverity:t,channel:this.token.channel,attr:(0,u.isObject)(e)?e:{},body:(0,u.isObject)(e)?"":e};return yield this.appendToStorage(p.Log,n)}))}addMetric(e){return n(this,void 0,void 0,(function*(){var t;if(this.enabled)return e.time=Date.now(),e.channel=null===(t=this.token)||void 0===t?void 0:t.channel,yield this.appendToStorage(p.Metric,e)}))}};class g{constructor(e,t,r,n,i){this.appID=e,"/"!==t.substring(t.length-1)&&(t+="/"),"/v1/"!==t.substring(t.length-4)&&(t+="log/api/v1/"),this.serverPrefix=t,this.deviceID=r,this.deviceType=n,this.logSecretKey=i}refreshToken(){return n(this,void 0,void 0,(function*(){let e={app_id:this.appID,device_id:this.deviceID,device_type:this.deviceType,requested_at:Date.now()};e.sign=this.signutreRequest(e);let t=yield this.request("auth/gettoken",e);if(0!=t.ret.code)throw new l.SdkError("获取rtc日志中心token失败: "+t.ret.cn,t.ret.code);this.logToken=t.data.token}))}push(e){return n(this,void 0,void 0,(function*(){this.logToken||(yield this.refreshToken());let t=yield this.request("data/push",e);if(10041==t.code||10042==t.code||10043==t.code)return this.logToken="",this.push(e);if(0!=t.ret.code)throw new l.SdkError(t.ret.cn,t.ret.code);console.debug("上传rtc日志成功")}))}signutreRequest(e){let t,r=[];for(t in e)r.push(t+"="+e[t]);r.sort();let n=r.join("&")+"&"+this.logSecretKey;return(0,o.SHA256)(n).toString()}request(e,t){let r=this.serverPrefix+e,n={"Content-Type":"application/json;charset=UTF-8"};return this.logToken&&(n.Authorization="Bearer "+this.logToken),this.deviceType==a.DeviceType.XCX?new Promise(((e,i)=>{wx.request({url:r,method:"POST",header:n,data:JSON.stringify(t),success(t){if(200!=t.statusCode)i(new l.SdkError(t.errMsg,t.statusCode));else{let r=t.data;e(r)}},fail:function(e){i(new l.SdkError(e.errMsg,e.errno))}})})):new Promise(((e,i)=>{fetch(r,{method:"POST",headers:n,body:JSON.stringify(t)}).then((t=>{200!=t.status?i(new l.SdkError(t.statusText,t.status)):t.json().then((t=>{e(t)})).catch((e=>{i(new l.SdkError(e.toString()))}))})).catch((e=>{i(new l.SdkError(e.toString()))}))}))}}},7514:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.LogLevel=t.LogTarget=void 0;const n=r(3143),i=r(86),o=r(7255);var s,a;!function(e){e.CONSOLE="console",e.WXREALTIME="wxrealtime",e.NONE="none"}(s||(t.LogTarget=s={})),function(e){e.DEBUG="debug",e.INFO="info",e.WARN="warn",e.ERROR="error"}(a||(t.LogLevel=a={}));t.logger=new class{constructor(){this.logTarget=s.CONSOLE,this.logLevel=a.INFO,this.logCss="border: 1px solid; padding:2px 5px; border-radius: 3px"}setTarget(e){this.logTarget=e}setLevel(e){this.logLevel=e}getPrefix(e){return`%c ${(0,i.dateFormat)("H:i:s")} sdk_${e}`}debug(...e){var t;if(this.logTarget!=s.NONE&&(this.snapshotArgs(e),(0,n.isWxxcx)()&&wx.getLogManager({level:1}).debug("sdk_debug",...e),null===(t=this.center)||void 0===t||t.addLog({level:o.RtcLogLevel.Debug,type:o.RtcLogType.RtcLog,body:e}),this.logLevel===a.DEBUG))switch(this.logTarget){case s.CONSOLE:return console.debug(this.getPrefix("debug"),this.logCss,...e);case s.WXREALTIME:return wx.getRealtimeLogManager().info("sdk_debug",...e)}}info(...e){var t;if(this.logTarget!=s.NONE&&(this.snapshotArgs(e),(0,n.isWxxcx)()&&wx.getLogManager({level:1}).info("sdk_info",...e),null===(t=this.center)||void 0===t||t.addLog({level:o.RtcLogLevel.Info,type:o.RtcLogType.RtcLog,body:e}),this.logLevel===a.DEBUG||this.logLevel===a.INFO))switch(this.logTarget){case s.CONSOLE:return console.log(this.getPrefix("info"),this.logCss,...e);case s.WXREALTIME:return wx.getRealtimeLogManager().info("sdk_info",...e)}}warn(...e){var t;if(this.logTarget!=s.NONE&&(this.snapshotArgs(e),(0,n.isWxxcx)()&&wx.getLogManager({level:1}).warn("sdk_warn",...e),null===(t=this.center)||void 0===t||t.addLog({level:o.RtcLogLevel.Warn,type:o.RtcLogType.RtcLog,body:e}),this.logLevel===a.DEBUG||this.logLevel===a.INFO||this.logLevel===a.WARN))switch(this.logTarget){case s.CONSOLE:return console.warn(this.getPrefix("warn"),this.logCss,...e);case s.WXREALTIME:return wx.getRealtimeLogManager().warn("sdk_warn",...e)}}error(...e){var t;if(this.logTarget!=s.NONE)switch(this.snapshotArgs(e),(0,n.isWxxcx)()&&wx.getLogManager({level:1}).warn("sdk_error",...e),console.error(this.getPrefix("error"),this.logCss,...e),null===(t=this.center)||void 0===t||t.addLog({level:o.RtcLogLevel.Error,type:o.RtcLogType.RtcLog,body:e}),this.logTarget){case s.CONSOLE:return;case s.WXREALTIME:return wx.getRealtimeLogManager().error("sdk_error",...e)}}snapshotArgs(e){e.forEach(((t,r)=>{!(0,i.isObject)(t)||t instanceof Error||(e[r]=JSON.parse(JSON.stringify(t)))}))}}},7820:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TrackKind=t.SRTC=t.ScreenPresets=t.RemoteVideoTrack=t.RemoteAudioTrack=t.RemoteAudioMixTrack=t.MicPresets=t.LogTarget=t.LogLevel=t.LocalVideoTrack=t.LocalScreenTrack=t.LocalMicTrack=t.LocalCameraTrack=t.LocalAudioTrack=t.LeaveReason=t.ChannelEventType=t.ChannelEvent=t.CameraPresets=void 0;const n=r(3404);Object.defineProperty(t,"ChannelEvent",{enumerable:!0,get:function(){return n.ChannelEvent}}),Object.defineProperty(t,"LeaveReason",{enumerable:!0,get:function(){return n.DisconnectReason}});const i=r(5951);Object.defineProperty(t,"TrackKind",{enumerable:!0,get:function(){return i.TrackKind}});const o=r(7514);Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return o.LogLevel}}),Object.defineProperty(t,"LogTarget",{enumerable:!0,get:function(){return o.LogTarget}});const s=r(5280);Object.defineProperty(t,"SRTC",{enumerable:!0,get:function(){return s.SRTC}});const a=r(3272);Object.defineProperty(t,"ChannelEventType",{enumerable:!0,get:function(){return a.ChannelEventType}});const l=r(8728);Object.defineProperty(t,"LocalAudioTrack",{enumerable:!0,get:function(){return l.LocalAudioTrack}}),Object.defineProperty(t,"LocalCameraTrack",{enumerable:!0,get:function(){return l.LocalCameraTrack}}),Object.defineProperty(t,"LocalMicTrack",{enumerable:!0,get:function(){return l.LocalMicTrack}}),Object.defineProperty(t,"LocalScreenTrack",{enumerable:!0,get:function(){return l.LocalScreenTrack}}),Object.defineProperty(t,"LocalVideoTrack",{enumerable:!0,get:function(){return l.LocalVideoTrack}});const u=r(8261);Object.defineProperty(t,"CameraPresets",{enumerable:!0,get:function(){return u.CameraPresets}}),Object.defineProperty(t,"MicPresets",{enumerable:!0,get:function(){return u.MicPresets}}),Object.defineProperty(t,"ScreenPresets",{enumerable:!0,get:function(){return u.ScreenPresets}});const c=r(6881);Object.defineProperty(t,"RemoteAudioMixTrack",{enumerable:!0,get:function(){return c.RemoteAudioMixTrack}}),Object.defineProperty(t,"RemoteAudioTrack",{enumerable:!0,get:function(){return c.RemoteAudioTrack}}),Object.defineProperty(t,"RemoteVideoTrack",{enumerable:!0,get:function(){return c.RemoteVideoTrack}})},8632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RtcApi=void 0;const n=r(5460),i=r(7130);class o extends n.BaseRtcApi{http(e,t,r){return new Promise(((n,o)=>{fetch(this.serverPrefix+e,{method:"POST",headers:r,body:JSON.stringify(t)}).then((e=>{200!=e.status?o(new i.SdkError(e.statusText,e.status)):e.json().then((e=>{n(e)})).catch((e=>{o(new i.SdkError(e.toString()))}))})).catch((e=>{o(new i.SdkError(e.toString()))}))}))}}t.RtcApi=o},5379:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Channel=void 0;const i=r(4623),o=r(8912),s=r(5951),a=r(6881),l=r(1105);class u extends i.BaseChannel{newUser(e){return new l.User(e)}getPublishExOption(e,t){return n(this,void 0,void 0,(function*(){let t={};if(this.rtcStreamEngine.vendor()===o.StreamEngineVendor.OOK){let r=-1;e.kind==s.TrackKind.Video&&(r=this.rtcStreamEngine.getAvailableVideoTrackNo()),t={track:r},e.updateInfo({track:r})}return t}))}getSubscribeExOption(e){return n(this,void 0,void 0,(function*(){let t={};if(this.rtcStreamEngine.vendor()===o.StreamEngineVendor.OOK)if(e instanceof a.RemoteAudioMixTrack){let r=this.getMe(),n=[];e.getFilterUids().forEach((e=>{if(e&&e!=r.uid)try{let t=this.getUser(e);n.push(t.link_id)}catch(e){}})),t={filter_link_ids:n}}else{let r=this.getUser(e.getUid()),n=e.getInfo();t={link_id:r.link_id,track:n.track}}return t}))}newRemoteAudioMixTrack(e){return new a.RemoteAudioMixTrack({id:s.TRACK_AMIXER_ID,desc:"频道混音流",kind:s.TrackKind.Audio},e)}}t.Channel=u},6921:function(e,t,r){"use strict";var n,i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultDeviceId=void 0;const s=o(r(7007)),a=r(3405),l=r(7514);t.DefaultDeviceId="default";class u extends s.default{static getInstance(){var e;if(void 0===n.instance){n.instance=new n;"undefined"==typeof window||window.isSecureContext||void 0!==(null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||l.logger.warn("当前非安全环境(https或localhost或127.0.0.1),将无法获取麦克风、摄像头等媒体设备进行枚举、音视频采集、推流"),null===(e=null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||void 0===e||e.addEventListener("devicechange",(()=>{n.debouncedDeviceChangeHandler()}))}return n.instance}addWaitMediaDevice(e){return i(this,void 0,void 0,(function*(){let t=n.waitingMediaDevicePromises;t.push(e);let r=yield e;return t.splice(t.indexOf(e),1),r}))}enum(){return i(this,void 0,void 0,(function*(){let e=navigator.mediaDevices.enumerateDevices();return this.addWaitMediaDevice(e)}))}getUserMedia(e){return i(this,void 0,void 0,(function*(){let t=navigator.mediaDevices.getUserMedia(e);return this.addWaitMediaDevice(t)}))}waitMediaDevices(){return i(this,void 0,void 0,(function*(){return Promise.allSettled(n.waitingMediaDevicePromises)}))}getDevices(e){return i(this,arguments,void 0,(function*(e,t=!0){let r=yield this.enum();if(t){if(0===r.length||r.some((t=>{const r=""===t.label,n=!e||t.kind===e;return r&&n}))){const t={video:"audioinput"!==e&&"audiooutput"!==e,audio:"videoinput"!==e},n=yield this.getUserMedia(t);r=yield this.enum(),n.getTracks().forEach((e=>{e.stop()}))}}return e?r=r.filter((t=>t.kind===e)):t&&(n.devices=r),r}))}normalizeDeviceId(e,r,n){return i(this,void 0,void 0,(function*(){if(r!==t.DefaultDeviceId)return r;const i=yield this.getDevices(e),o=new Map(i.map((e=>[e.groupId,0])));i.forEach((e=>{var t;return o.set(e.groupId,(null!==(t=o.get(e.groupId))&&void 0!==t?t:0)+1)}));const s=i.find((e=>{var r;return(n===e.groupId||(null!==(r=o.get(e.groupId))&&void 0!==r?r:0)>1)&&e.deviceId!==t.DefaultDeviceId}));return null==s?void 0:s.deviceId}))}}n=u,u.devices=[],u.debouncedDeviceChangeHandler=(0,a.debounce)((()=>i(void 0,void 0,void 0,(function*(){let e=n.devices,t=yield n.instance.getDevices();const r=t.filter((t=>!e.some((e=>e.deviceId===t.deviceId)))),i=e.filter((e=>!t.some((t=>e.deviceId===t.deviceId))));r.forEach((e=>{l.logger.info("新设备插入:",e),n.instance.emit("add",e)})),i.forEach((e=>{l.logger.info("设备被拔出:",e),n.instance.emit("remove",e)}))}))),100,{isImmediate:!0}),u.waitingMediaDevicePromises=[],t.default=u},3272:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TrackEventType=t.ChannelEventType=void 0;const n=r(3404);class i extends n.CommonChannelEventType{}t.ChannelEventType=i,i.DEVICE_ADD="device_add",i.DEVICE_REMOVE="device_remove",i.TRACK_AUTOPLAY_FAIL="track_autoplay_fail";class o extends n.CommonTrackEventType{}t.TrackEventType=o,o.AUTOPLAY_FAIL="autoplay_fail",o.MSTRACK_REPLACED="mstrack_replaced"},5280:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SRTC=void 0;const o=r(7620),s=r(3404),a=r(5951),l=r(6757),u=r(3143),c=r(7130),h=r(86),f=r(7514),d=r(8632),p=r(5379),g=i(r(6921)),y=r(3272),b=r(8728),v=r(8261),m=r(1883),w=r(6580);class _ extends o.BaseSRTC{buildInfo(){let{version:e}=r(6351);return{version:e,timestamp:1721394934}}getStoredDeviceId(){let e=localStorage.getItem("device_id");return e||(e=(0,h.genDeviceId)(),localStorage.setItem("device_id",e)),e}getDeviceType(){return l.DeviceType.WebRTC}newRtcApi(e){return new d.RtcApi(e.app_id,e.sid,e.client_key,e.client_api)}newRtcSocket(e){return new m.RtcSocket(e)}newChannel(e,t,r,n){return new p.Channel(e,t,r,n,this.onNotifyChannelEvent)}newStreamEngine(e){return new w.OokWebrtc(e)}constructor(e){super(e),this.muteCallback=e=>{if(this.onNotifyChannelEvent){let t=new s.ChannelEvent(y.ChannelEventType.TRACK_MUTED,e);this.onNotifyChannelEvent(t)}},this.unmuteCallback=e=>{if(this.onNotifyChannelEvent){let t=new s.ChannelEvent(y.ChannelEventType.TRACK_UNMUTED,e);this.onNotifyChannelEvent(t)}},this.endCallback=e=>{if(this.onNotifyChannelEvent){let t=new s.ChannelEvent(y.ChannelEventType.TRACK_ENDED,e);this.onNotifyChannelEvent(t)}},this.autoPlayFailCallback=e=>{if(this.onNotifyChannelEvent){let t=new s.ChannelEvent(y.ChannelEventType.TRACK_AUTOPLAY_FAIL,e);this.onNotifyChannelEvent(t)}},this.localTracks=new Map,g.default.getInstance().on("add",(e=>{if(this.onNotifyChannelEvent){let t=new s.ChannelEvent(y.ChannelEventType.DEVICE_ADD,e);this.onNotifyChannelEvent(t)}})),g.default.getInstance().on("remove",(e=>{if(this.onNotifyChannelEvent){let t=new s.ChannelEvent(y.ChannelEventType.DEVICE_REMOVE,e);this.onNotifyChannelEvent(t)}})),document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState?this.onAppShow():this.onAppHide()}))}leave(){const e=Object.create(null,{leave:{get:()=>super.leave}});return n(this,void 0,void 0,(function*(){if(yield e.leave.call(this),this.channel)for(let e of this.localTracks.keys())if(e instanceof b.LocalMicTrack||e instanceof b.LocalCameraTrack||e instanceof b.LocalScreenTrack)try{e.stopCapture(),f.logger.info("离开频道",e.toString(),"自动停止采集")}catch(e){}}))}getDevices(e){return n(this,arguments,void 0,(function*(e,t=!0){return g.default.getInstance().getDevices(e,t)}))}getEnvInfo(){return(0,u.getEnvInfo)()}addTrackListeners(e){e.listeners(s.CommonTrackEventType.MUTED).includes(this.muteCallback)||e.on(s.CommonTrackEventType.MUTED,this.muteCallback),e.listeners(s.CommonTrackEventType.UNMUTED).includes(this.unmuteCallback)||e.on(s.CommonTrackEventType.UNMUTED,this.unmuteCallback),e.listeners(s.CommonTrackEventType.ENDED).includes(this.endCallback)||e.on(s.CommonTrackEventType.ENDED,this.endCallback),e.listeners(y.TrackEventType.AUTOPLAY_FAIL).includes(this.endCallback)||e.on(y.TrackEventType.AUTOPLAY_FAIL,this.autoPlayFailCallback)}createLocalMicTrack(e=v.MicPresets.music){let t=new b.LocalMicTrack(e.capture);return this.localTracks.set(t,Object.assign({},e.publish)),this.addTrackListeners(t),t}createLocalCustomAudioTrack(e){if(e.kind!=a.TrackKind.Audio)throw new c.SdkError("MediaStreamTrack必须是音频轨");let t=new b.LocalAudioTrack;return t.setMediaStreamTrack(e),this.localTracks.set(t,void 0),this.addTrackListeners(t),t}createLocalCameraTrack(e=v.CameraPresets["720p"]){let t=new b.LocalCameraTrack(e.capture);return this.localTracks.set(t,Object.assign({},e.publish)),this.addTrackListeners(t),t}createLocalScreenTrack(e=v.ScreenPresets["1080p"]){let t=new b.LocalScreenTrack(e.capture);return this.localTracks.set(t,Object.assign({},e.publish)),this.addTrackListeners(t),t}createLocalCustomVideoTrack(e){if(e.kind!=a.TrackKind.Video)throw new c.SdkError("MediaStreamTrack必须是视频轨");let t=new b.LocalVideoTrack;return t.setMediaStreamTrack(e),this.localTracks.set(t,void 0),this.addTrackListeners(t),t}publishLocalTrack(e,t){return n(this,void 0,void 0,(function*(){if(!this.channel)throw new c.SdkError("您不在频道内");let r=this.localTracks.get(e);r&&((0,h.propAssign)(r,t),t=r),yield this.channel.publishLocalTrack(e,t)}))}unpublishLocalTrack(e){return n(this,void 0,void 0,(function*(){if(!this.channel)throw new c.SdkError("您不在频道内");yield this.channel.unpublishLocalTrack(e)}))}subscribeRemoteAudioMixTrack(e){const t=Object.create(null,{subscribeRemoteAudioMixTrack:{get:()=>super.subscribeRemoteAudioMixTrack}});return n(this,void 0,void 0,(function*(){let r=yield t.subscribeRemoteAudioMixTrack.call(this,e);return this.addTrackListeners(r),r}))}subscribeRemoteAudioTrack(e,t){const r=Object.create(null,{subscribeRemoteAudioTrack:{get:()=>super.subscribeRemoteAudioTrack}});return n(this,void 0,void 0,(function*(){let n=yield r.subscribeRemoteAudioTrack.call(this,e,t);return this.addTrackListeners(n),n}))}subscribeRemoteVideoTrack(e,t){const r=Object.create(null,{subscribeRemoteVideoTrack:{get:()=>super.subscribeRemoteVideoTrack}});return n(this,void 0,void 0,(function*(){let n=yield r.subscribeRemoteVideoTrack.call(this,e,t);return this.addTrackListeners(n),n}))}unsubscribeRemoteTrack(e){const t=Object.create(null,{unsubscribeRemoteTrack:{get:()=>super.unsubscribeRemoteTrack}});return n(this,void 0,void 0,(function*(){yield t.unsubscribeRemoteTrack.call(this,e)}))}}t.SRTC=_},8728:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.LocalScreenTrack=t.LocalCameraTrack=t.LocalVideoTrack=t.LocalMicTrack=t.LocalAudioTrack=void 0;const a=r(5951),l=r(7130),u=r(86),c=r(7514),h=o(r(6921)),f=r(3272),d=r(8261),p=r(4971);class g extends p.BaseWebrtcTrack{constructor(){super({id:(0,u.genNonce)(20),kind:a.TrackKind.Audio,codec:d.DEFAULT_AUDIO_CODEC,track:-1},""),this.playTrait=new p.AudioPlayTrait(this)}getVolume(){return 0}strPrefix(){return"本地音频流轨道"}startPlay(e){return s(this,void 0,void 0,(function*(){(yield this.playTrait.startPlay(e))||(e&&e.disableAutoPlayDialog?this.emit(f.TrackEventType.AUTOPLAY_FAIL,this):p.AutoPlayDialog.show(this.id,this.desc,(()=>{this.startPlay(e)})))}))}stopPlay(){this.playTrait.stopPlay()}}t.LocalAudioTrack=g;t.LocalMicTrack=class extends g{constructor(e){super(),this.captureOptions=Object.assign({},e)}strPrefix(){return"本地麦克风流轨道"}onEnded(){super.onEnded(),c.logger.warn(this.toString(),"自动尝试默认麦克风"),this.changeDeviceId(h.DefaultDeviceId).catch((e=>{c.logger.error(this.toString(),"自动尝试默认麦克风失败",e)}))}startCapture(e){return s(this,void 0,void 0,(function*(){e&&(0,u.propAssign)(this.captureOptions,e);let t=yield h.default.getInstance().getUserMedia({audio:this.captureOptions,video:!1});this.setMediaStreamTrack(t.getTracks()[0])}))}stopCapture(){return s(this,void 0,void 0,(function*(){let e=this.getMediaStreamTrack();e?e.stop():c.logger.warn(this.toString()+"的mediaStreamTrack不存在,无需停止采集")}))}changeDeviceId(e){return s(this,void 0,void 0,(function*(){if(this.captureOptions.deviceId===e&&e!=h.DefaultDeviceId)return;return this.captureOptions.deviceId=e,this.getMediaStreamTrack()?(this.stopCapture(),this.startCapture()):void 0}))}};class y extends p.BaseWebrtcTrack{constructor(){super({id:(0,u.genNonce)(20),kind:a.TrackKind.Video,codec:d.DEFAULT_VIDEO_CODEC,track:-1},""),this.playTrait=new p.VideoPlayTrait(this)}strPrefix(){return"本地视频流轨道"}addSimulcastTrack(e){this.getInfo();return new y}addPlayView(e){this.playTrait.addPlayView(e)}removePlayView(e){this.playTrait.removePlayView(e)}removeAllPlayViews(){this.playTrait.removeAllPlayViews()}}t.LocalVideoTrack=y;t.LocalCameraTrack=class extends y{constructor(e){super(),this.captureOptions=Object.assign({},e)}strPrefix(){return"本地摄像头视频流轨道"}onEnded(){super.onEnded(),c.logger.warn(this.toString(),"自动尝试默认摄像头"),this.changeDeviceId(h.DefaultDeviceId).catch((e=>{c.logger.error(this.toString(),"自动尝试默认摄像头失败",e)}))}startCapture(e){return s(this,void 0,void 0,(function*(){e&&(0,u.propAssign)(this.captureOptions,e);let t=yield h.default.getInstance().getUserMedia({audio:!1,video:this.captureOptions});this.setMediaStreamTrack(t.getTracks()[0])}))}stopCapture(){let e=this.getMediaStreamTrack();e?e.stop():c.logger.warn(this.toString()+"的mediaStreamTrack不存在,无需停止采集")}changeDeviceId(e){return s(this,void 0,void 0,(function*(){if(this.captureOptions.deviceId===e&&e!=h.DefaultDeviceId)return;return this.captureOptions.deviceId=e,this.getMediaStreamTrack()?(this.stopCapture(),this.startCapture()):void 0}))}switchFacingMode(){return s(this,void 0,void 0,(function*(){this.captureOptions.facingMode="environment"==this.captureOptions.facingMode?"user":"environment";let e=this.getMediaStreamTrack();if(e)return e.applyConstraints(this.captureOptions)}))}};t.LocalScreenTrack=class extends y{constructor(e){super(),this.captureOptions=Object.assign({},e)}strPrefix(){return"本地屏幕分享视频流轨道"}startCapture(e){return s(this,void 0,void 0,(function*(){if(e&&(0,u.propAssign)(this.captureOptions,e),void 0===navigator.mediaDevices.getDisplayMedia)throw new l.SdkError("getDisplayMedia not supported");let t=yield navigator.mediaDevices.getDisplayMedia({audio:!1,video:this.captureOptions});this.setMediaStreamTrack(t.getTracks()[0])}))}stopCapture(){let e=this.getMediaStreamTrack();e?e.stop():c.logger.warn(this.toString()+"的mediaStreamTrack不存在,无需停止采集")}}},8261:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenPresets=t.CameraPresets=t.MicPresets=t.DEFAULT_VIDEO_CODEC=t.DEFAULT_AUDIO_CODEC=void 0;const n=r(5951);t.DEFAULT_AUDIO_CODEC=n.Codec.OPUS,t.DEFAULT_VIDEO_CODEC=n.Codec.H264,t.MicPresets={speech:{capture:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,channelCount:1,sampleRate:48e3},publish:{maxBitrate:24e3,priority:"high"}},music:{capture:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,channelCount:1,sampleRate:48e3},publish:{maxBitrate:32e3,priority:"high"}},musicStereo:{capture:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,channelCount:2,sampleRate:48e3},publish:{maxBitrate:48e3,priority:"high"}},musicHighQuality:{capture:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,channelCount:1,sampleRate:48e3},publish:{maxBitrate:64e3,priority:"high"}},musicHighQualityStereo:{capture:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,channelCount:2,sampleRate:48e3},publish:{maxBitrate:96e3,priority:"high"}}},t.CameraPresets={"1080p":{capture:{width:1920,height:1080,frameRate:15},publish:{maxBitrate:25e5}},"720p":{capture:{width:1280,height:720,frameRate:15},publish:{maxBitrate:12e5}},"360p":{capture:{width:640,height:360,frameRate:15},publish:{maxBitrate:55e4}},"180p":{capture:{width:320,height:180,frameRate:15},publish:{maxBitrate:25e4}}},t.ScreenPresets={"1080p":{capture:{width:1920,height:1080,frameRate:10},publish:{maxBitrate:2e6}},"720p":{capture:{width:1280,height:720,frameRate:10},publish:{maxBitrate:15e5}}}},6881:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteVideoTrack=t.RemoteAudioMixTrack=t.RemoteAudioTrack=void 0;const i=r(3272),o=r(4971);class s extends o.BaseWebrtcTrack{constructor(e,t){super(e,t),this.playTrait=new o.AudioPlayTrait(this)}strPrefix(){return"远端音频流轨道"}startPlay(e){return n(this,void 0,void 0,(function*(){(yield this.playTrait.startPlay(e))||(e&&e.disableAutoPlayDialog?this.emit(i.TrackEventType.AUTOPLAY_FAIL,this):o.AutoPlayDialog.show(this.id,this.desc,(()=>{this.startPlay(e)})))}))}stopPlay(){this.playTrait.stopPlay()}}t.RemoteAudioTrack=s;t.RemoteAudioMixTrack=class extends s{constructor(e,t){super(e,""),this.filterUids=t||[]}getFilterUids(){return this.filterUids}strPrefix(){return"远端频道混音流轨道"}};class a extends o.BaseWebrtcTrack{constructor(e,t){super(e,t),this.playTrait=new o.VideoPlayTrait(this)}strPrefix(){return"远端视频流轨道"}addPlayView(e){this.playTrait.addPlayView(e)}removePlayView(e){this.playTrait.removePlayView(e)}removeAllPlayViews(){this.playTrait.removeAllPlayViews()}}t.RemoteVideoTrack=a},1883:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RtcSocket=void 0;const n=r(2871);class i extends n.BaseRtcSocket{}t.RtcSocket=i},4730:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.StreamEngine=void 0;const i=r(3404),o=r(8912),s=r(5951),a=r(1758),l=r(7130),u=r(7514),c=r(3272);class h extends o.BaseStreamEngine{constructor(){super(...arguments),this.onMsTrackReplace=e=>{var t,r;if(!this.published[e.id])return;null===(t=this.published[e.id].sender)||void 0===t||t.replaceTrack(null!==(r=e.getMediaStreamTrack())&&void 0!==r?r:null)}}publish(e,t,r){const i=Object.create(null,{publish:{get:()=>super.publish}});return n(this,void 0,void 0,(function*(){if(this.published[e.id])return void u.logger.warn("推流",e.toString(),"进行中,当前状态",this.published[e.id].pc.connectionState);yield i.publish.call(this,e,t,r);let h=e.getMediaStreamTrack();if(!h)throw new l.SdkError(e.toString()+"的mediaStreamTrack不存在,无法发布");if(e.kind==s.TrackKind.Audio&&!a.Ability.checkAudioCodec("OPUS"))throw new l.SdkError("当前环境不支持OPUS音频编解码,"+e.toString()+"无法发布");if(e.kind==s.TrackKind.Video&&!a.Ability.checkVideoCodec("H264"))throw new l.SdkError("当前环境不支持H264视频编解码,"+e.toString()+"无法发布");if(!("addTransceiver"in RTCPeerConnection.prototype)&&!("addTrack"in RTCPeerConnection.prototype))throw new l.SdkError("当前环境不支持addTransceiver或addTrack,无法发布");let f=new RTCPeerConnection,d={kind:e.kind,pc:f,track:e,exopt:r||{}};this.published[e.id]=d;let p={maxBitrate:t.maxBitrate,priority:t.priority};if(e.kind==s.TrackKind.Video&&(p.maxFramerate=t.maxFramerate),"addTransceiver"in RTCPeerConnection.prototype&&this.vendor()!=o.StreamEngineVendor.OOK){let e=f.addTransceiver(h,{direction:"sendonly",sendEncodings:[p]});d.sender=e.sender}else{let e=f.addTrack(h),t=e.getParameters();t.encodings=[p],e.setParameters(t),d.sender=e}return new Promise(((t,r)=>n(this,void 0,void 0,(function*(){let n=setTimeout((()=>{this.unpublish(e),r("发布超时")}),6e4);f.addEventListener("negotiationneeded",(()=>{u.logger.info("推流",e.toString(),"重新协商"),this.negotiateSDP(d,"publish")})),f.addEventListener("icecandidate",(t=>{u.logger.debug("推流",e.toString(),"icecandidate",t.candidate)})),f.addEventListener("iceconnectionstatechange",(t=>{u.logger.debug("推流",e.toString(),"ICE connection state change",f.iceConnectionState)})),f.addEventListener("connectionstatechange",(r=>{switch(u.logger.debug("推流",e.toString(),"connection state",f.connectionState),f.connectionState){case"failed":case"closed":f.restartIce(),u.logger.error("推流",e.toString(),"已断开,将自动尝试重连");break;case"connected":u.logger.info("推流",e.toString(),"connected",f.getTransceivers()),clearTimeout(n),e.on(c.TrackEventType.MSTRACK_REPLACED,this.onMsTrackReplace),t()}}))}))))}))}unpublish(e){return n(this,void 0,void 0,(function*(){if(!this.published[e.id])return void u.logger.warn("推流",e.toString(),"已取消,无需取消发布");e.off(c.TrackEventType.MSTRACK_REPLACED,this.onMsTrackReplace);this.published[e.id].pc.close(),delete this.published[e.id]}))}subscribe(e,t){const r=Object.create(null,{subscribe:{get:()=>super.subscribe}});return n(this,void 0,void 0,(function*(){if(this.subscribed[e.id])return void u.logger.warn("拉流",e.toString(),"进行中,当前状态",this.subscribed[e.id].pc.connectionState);yield r.subscribe.call(this,e,t);let o=new RTCPeerConnection,s={kind:e.kind,pc:o,track:e,exopt:t||{}};return this.subscribed[e.id]=s,new Promise(((t,r)=>n(this,void 0,void 0,(function*(){let n=setTimeout((()=>{this.unsubscribe(e),r("订阅超时")}),6e4);this.negotiateSDP(s,"subscribe"),o.addEventListener("negotiationneeded",(()=>{u.logger.info("拉流",e.toString(),"重新协商"),this.negotiateSDP(s,"subscribe")})),o.addEventListener("icecandidate",(t=>{u.logger.debug("拉流",e.toString(),"icecandidate",t.candidate)})),o.addEventListener("iceconnectionstatechange",(t=>{u.logger.debug("拉流",e.toString(),"ICE connection state change",o.iceConnectionState)})),o.addEventListener("track",(t=>{e.setMediaStreamTrack(t.track),t.streams[0].onremovetrack=t=>{u.logger.info("拉流",e.toString(),"mstrack removed",t.track),e.emit(i.CommonTrackEventType.ENDED,e)},u.logger.info("拉流",e.toString(),"mstrack got",t.track,t.streams)})),o.addEventListener("connectionstatechange",(r=>{switch(u.logger.debug("拉流",e.toString(),"connection state",o.connectionState),o.connectionState){case"failed":case"closed":o.restartIce(),u.logger.error("拉流",e.toString(),"已断开,将自动尝试重连");break;case"connected":u.logger.info("拉流",e.toString(),"connected",o.getTransceivers()),clearTimeout(n),t()}}))}))))}))}unsubscribe(e){return n(this,void 0,void 0,(function*(){if(!this.subscribed[e.id])return void u.logger.warn("拉流",e.toString(),"未订阅或已取消,无需取消订阅");this.subscribed[e.id].pc.close(),delete this.subscribed[e.id]}))}}t.StreamEngine=h},6580:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OokWebrtc=void 0;const i=r(8912),o=r(5951),s=r(7130),a=r(86),l=r(7514),u=r(6881),c=r(4730);class h extends c.StreamEngine{constructor(){super(...arguments),this.ability={audioCodecs:[o.Codec.OPUS,o.Codec.AAC],videoCodecs:[o.Codec.H264,o.Codec.H265],audioMaxPub:1,videoMaxPub:7,audioMaxSub:9,videoMaxSub:32}}vendor(){return i.StreamEngineVendor.OOK}connect(){return n(this,void 0,void 0,(function*(){yield this.create()}))}disconnect(){const e=Object.create(null,{disconnect:{get:()=>super.disconnect}});return n(this,void 0,void 0,(function*(){yield e.disconnect.call(this),yield this.free()}))}unpublish(e){const t=Object.create(null,{unpublish:{get:()=>super.unpublish}});return n(this,void 0,void 0,(function*(){try{if(this.published[e.id]){let t=this.published[e.id];yield this.freshAVState(t.exopt.session),yield this.hangup(t.exopt.session)}}catch(e){l.logger.error("ook取消发布接口报错",e)}yield t.unpublish.call(this,e)}))}unsubscribe(e){const t=Object.create(null,{unsubscribe:{get:()=>super.unsubscribe}});return n(this,void 0,void 0,(function*(){try{if(this.subscribed[e.id]){let t=this.subscribed[e.id];yield this.hangup(t.exopt.session)}}catch(e){l.logger.error("ook取消订阅接口报错",e)}yield t.unsubscribe.call(this,e)}))}negotiateSDP(e,t){return n(this,void 0,void 0,(function*(){if(e.exopt.session)try{yield this.hangup(e.exopt.session)}catch(e){l.logger.error("ook取消挂断接口报错",e)}let r=this.genSessionId();e.exopt.session=r;let n=e.pc,i="";if("publish"==t&&e.kind==o.TrackKind.Audio)i=yield this.offerWithRetry((()=>this.offerPushAudio(r)));else if("publish"==t&&e.kind==o.TrackKind.Video)i=yield this.offerWithRetry((()=>this.offerPushVideo(r,e.exopt.track)));else if("subscribe"==t&&e.kind==o.TrackKind.Audio)i=e.track instanceof u.RemoteAudioMixTrack?yield this.offerWithRetry((()=>this.offerPullAmixer(r,e.exopt.filter_link_ids.join(",")))):yield this.offerWithRetry((()=>this.offerPullAudio(r,e.exopt.link_id)));else{if("subscribe"!=t||e.kind!=o.TrackKind.Video)throw new s.SdkError("未知SDP操作:"+t+":"+e.track.toString());i=yield this.offerWithRetry((()=>this.offerPullVideo(r,e.exopt.link_id,e.exopt.track)))}yield n.setRemoteDescription({sdp:i,type:"offer"});let a=yield n.createAnswer();yield n.setLocalDescription(a),yield this.answer(r,a.sdp),yield this.freshAVState(r)}))}freshAVState(e){return n(this,void 0,void 0,(function*(){let t=!1,r=!1;for(const e in this.published){const n=this.published[e];n.kind==o.TrackKind.Audio?t=!0:n.kind==o.TrackKind.Video&&(r=!0)}yield this.setAVState(e,t,r)}))}getAvailableVideoTrackNo(){let e=-1,t=[];for(const e in this.published){const r=this.published[e];r.kind==o.TrackKind.Video&&t.push(r.track.getInfo().track)}for(let r=0;r<this.ability.videoMaxPub;r++)if(-1==t.indexOf(r)){e=r;break}return e}create(){return this.req("create/"+this.joinRsp.link_id,{serv:this.joinRsp.upload.address+":"+this.joinRsp.upload.port,conf:this.joinRsp.channel_link_id,token:this.joinRsp.session_key,amixer:1})}free(){return this.req("free/"+this.joinRsp.link_id)}offerWithRetry(e){return n(this,void 0,void 0,(function*(){try{return yield e()}catch(t){return yield this.create(),e()}}))}offerPushVideo(e,t){return n(this,void 0,void 0,(function*(){return(yield this.req("offer/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e,track:t+""}),{mode:"recvonly",type:"video"})).sdp}))}offerPushAudio(e){return n(this,void 0,void 0,(function*(){return(yield this.req("offer/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e}),{mode:"recvonly",type:"audio"})).sdp}))}offerPullVideo(e,t,r){return n(this,void 0,void 0,(function*(){return(yield this.req("offer/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e,peer:t+"",track:r+""}),{mode:"sendonly",type:"video"})).sdp}))}switchPullVideoTrack(e,t){return this.req("setting/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e}),{type:"track",setting:{track:t}})}offerPullAudio(e,t){return n(this,void 0,void 0,(function*(){return(yield this.req("offer/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e,peer:t+""}),{mode:"sendonly",type:"audio"})).sdp}))}offerPullAmixer(e){return n(this,arguments,void 0,(function*(e,t=""){return(yield this.req("offer/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e,peer:"amixer",filter:t}),{mode:"sendonly",type:"audio"})).sdp}))}answer(e,t){return this.req("answer/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e}),{totalBody:t})}setAVState(e,t,r){return this.req("setting/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e}),{totalBody:JSON.stringify({type:"media",setting:{audio:t?1:0,video:r?1:0}})})}hangup(e){return this.req("hangup/"+this.joinRsp.link_id+"?"+new URLSearchParams({session:e}))}req(e,t={},r={}){let n=this.joinRsp.webrtc.cmd_url;"/"!==n.substring(n.length-1)&&(n+="/");let i=t.totalBody;return i||(i=Object.keys(t).filter((e=>void 0!==t[e]&&null!==t[e])).map((e=>`${e}=${t[e]}`)).join("\r\n")),new Promise(((o,a)=>{fetch(n+e,{method:"POST",headers:Object.assign(Object.assign({},r),{Accept:"application/json"}),body:i}).then((r=>{l.logger.debug("webrtc gateway api: "+e,t,r),200!=r.status?a(new s.SdkError(r.statusText,r.status)):r.json().then((e=>{0==e.code?o(e):a(new s.SdkError(e.msg,e.code))})).catch((e=>{a(new s.SdkError(e.toString()))}))})).catch((r=>{l.logger.error("webrtc gateway api: "+e,t,r),a(new s.SdkError(r.toString()))}))}))}genSessionId(){return`${`${this.joinRsp.app_id}`}-${(0,a.genNonce)(6)}`}}t.OokWebrtc=h},4971:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AutoPlayDialog=t.VideoPlayTrait=t.AudioPlayTrait=t.BaseWebrtcTrack=void 0;const i=r(3404),o=r(5951),s=r(7130),a=r(7514),l=r(3272);class u extends o.BaseTrack{constructor(e,t){super(e,t),this.onMute=this.onMute.bind(this),this.onUnmute=this.onUnmute.bind(this),this.onEnded=this.onEnded.bind(this)}addMsTrackListeners(e){e.addEventListener("mute",this.onMute),e.addEventListener("unmute",this.onUnmute),e.addEventListener("ended",this.onEnded)}removeMsTrackListeners(e){e.removeEventListener("mute",this.onMute),e.removeEventListener("unmute",this.onUnmute),e.removeEventListener("ended",this.onEnded)}onMute(){a.logger.info(this.toString(),"muted"),this.emit(i.CommonTrackEventType.MUTED,this)}onUnmute(){a.logger.info(this.toString(),"unmuted"),this.emit(i.CommonTrackEventType.UNMUTED,this)}onEnded(){a.logger.info(this.toString(),"ended"),this.emit(i.CommonTrackEventType.ENDED,this)}setMediaStreamTrack(e){this.mediaStreamTrack!=e&&(this.mediaStreamTrack&&this.removeMsTrackListeners(this.mediaStreamTrack),this.mediaStreamTrack=e,e&&this.addMsTrackListeners(e),this.emit(l.TrackEventType.MSTRACK_REPLACED,this))}getMediaStreamTrack(){return this.mediaStreamTrack}}t.BaseWebrtcTrack=u;t.AudioPlayTrait=class{constructor(e){this.track=e,this.audioElements=[],this.track.on(l.TrackEventType.MSTRACK_REPLACED,(()=>{let e=this.track.getMediaStreamTrack(),t=e?new MediaStream([e]):null;this.audioElements.forEach((e=>{e.srcObject=t}))}))}startPlay(e){return n(this,void 0,void 0,(function*(){this.stopPlay();let t=this.track.getMediaStreamTrack();if(!t)throw new s.SdkError(this.track.toString()+"的mediaStreamTrack不存在,无法播放声音");let r=document.createElement("audio");return r.autoplay=!1,r.srcObject=new MediaStream([t]),r.style.display="none",document.body.appendChild(r),(null==e?void 0:e.deviceId)&&("setSinkId"in r?yield r.setSinkId(e.deviceId):a.logger.error("当前环境不支持setSinkId,将从默认扬声器播放")),new Promise(((e,t)=>n(this,void 0,void 0,(function*(){let n=setTimeout((()=>{a.logger.warn("音频play超时未响应,默认视为浏览器权限问题处理"),r.remove(),e(!1)}),1e3);try{yield r.play(),clearTimeout(n),this.audioElements.push(r),e(!0)}catch(i){clearTimeout(n),r.remove(),i instanceof DOMException&&"NotAllowedError"===i.name?e(!1):t(new s.SdkError(this.track.toString()+"自动播放失败:"+i))}}))))}))}stopPlay(){this.audioElements.forEach((e=>e.remove())),this.audioElements=[]}};t.VideoPlayTrait=class{constructor(e){this.track=e,this.videoElements=[],this.track.on(l.TrackEventType.MSTRACK_REPLACED,(()=>{let e=this.track.getMediaStreamTrack(),t=e?new MediaStream([e]):null;this.videoElements.forEach((e=>{e.srcObject=t}))}))}addPlayView(e){let t=this.track.getMediaStreamTrack();if(!t)throw new s.SdkError(this.track.toString()+"的mediaStreamTrack不存在,无法添加播放view");let r=document.createElement("video");r.autoplay=!0,r.muted=!0,r.controls=!1,r.playsInline=!0,r.style.width="100%",r.style.height="100%",r.style.objectFit="contain",r.onloadedmetadata=()=>{let e=this.track.getInfo().angle,t=1*r.videoHeight/r.videoWidth;switch(e){case 1129136434:r.style.transform=`rotate(270deg) scale(${t},${t})`;break;case 1129136433:r.style.transform="rotate(-180deg)";break;case 1129136441:r.style.transform=`scale(${t},${t}) rotate(-90deg)`;break;default:r.style.transform=""}},r.srcObject=new MediaStream([t]),e.appendChild(r),this.videoElements.push(r)}removePlayView(e){let t=this.videoElements.findIndex((t=>t.parentElement==e));t>=0&&(this.videoElements[t].remove(),this.videoElements.splice(t,1))}removeAllPlayViews(){this.videoElements.forEach((e=>e.remove())),this.videoElements=[]}};class c{static show(e,t,r){const n=document.createElement("style");n.textContent=this.cssTpl,document.head.appendChild(n);let i="autoplay-"+e,o=document.createElement("div");document.body.append(o),o.outerHTML=this.htmlTpl.replace("$id$",i).replace("$desc$",t),document.getElementById(i).onclick=e=>{n.remove(),e.currentTarget.remove(),r()}}}t.AutoPlayDialog=c,c.htmlTpl='<div id="$id$" class="autoplay-dialog-container">\n <div class="autoplay-dialog">\n <div class="autoplay-dialog-content">\n <p>因浏览器权限问题自动播放$desc$失败,点击恢复自动播放</p>\n </div>\n <div class="autoplay-dialog-actions">\n <button class="autoplay-dialog-button">确定</button>\n </div>\n </div>\n</div>',c.cssTpl=".autoplay-dialog-container {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 9999;\n}\n\n.autoplay-dialog {\n background-color: white;\n padding: 20px;\n border-radius: 5px;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);\n text-align: center;\n}\n\n.autoplay-dialog-content {\n margin-bottom: 20px;\n}\n\n.autoplay-dialog-button {\n background-color: #007bff;\n color: white;\n border: none;\n padding: 10px 20px;\n border-radius: 5px;\n cursor: pointer;\n}"},1105:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.User=void 0;const n=r(5951),i=r(1381),o=r(6881);class s extends i.BaseUser{newTrack(e){switch(e.kind){case n.TrackKind.Video:return new o.RemoteVideoTrack(e,this.uid);case n.TrackKind.Audio:return new o.RemoteAudioTrack(e,this.uid)}}}t.User=s},477:()=>{},6526:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ALWAYS:()=>qe,C1:()=>E,DECIMAL_FIT:()=>Ke,DECIMAL_ROUND:()=>$e,Decoder:()=>ae,Encoder:()=>ze,FLOAT32_OPTIONS:()=>fe,NEVER:()=>He,Packr:()=>xe,REUSE_BUFFER_MODE:()=>Ge,Unpackr:()=>C,addExtension:()=>je,clearSource:()=>oe,decode:()=>he,decodeIter:()=>Xe,encode:()=>Ve,encodeIter:()=>Ze,isNativeAccelerationEnabled:()=>F,mapsAsObjects:()=>tt,pack:()=>We,roundFloat32:()=>ge,unpack:()=>ue,unpackMultiple:()=>ce,useRecords:()=>et});var n,i,o,s=r(8287).hp;try{n=new TextDecoder}catch(e){}var a=0;const l=[];var u,c,h,f,d,p=l,g=0,y={},b=0,v=0,m=[],w={useRecords:!1,mapsAsObjects:!0};class _{}const E=new _;E.name="MessagePack 0xC1";var S,k,A,T=!1,I=2;try{new Function("")}catch(e){I=1/0}class C{constructor(e){e&&(!1===e.useRecords&&void 0===e.mapsAsObjects&&(e.mapsAsObjects=!0),e.sequential&&!1!==e.trusted&&(e.trusted=!0,e.structures||0==e.useRecords||(e.structures=[],e.maxSharedStructures||(e.maxSharedStructures=0))),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType="number")),Object.assign(this,e)}unpack(e,t){if(i)return ie((()=>(oe(),this?this.unpack(e,t):C.prototype.unpack.call(w,e,t))));e.buffer||e.constructor!==ArrayBuffer||(e=void 0!==s?s.from(e):new Uint8Array(e)),"object"==typeof t?(o=t.end||e.length,a=t.start||0):(a=0,o=t>-1?t:e.length),g=0,v=0,c=null,p=l,h=null,i=e;try{d=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(t){if(i=null,e instanceof Uint8Array)throw t;throw new Error("Source must be a Uint8Array or Buffer but was a "+(e&&"object"==typeof e?e.constructor.name:typeof e))}if(this instanceof C){if(y=this,this.structures)return u=this.structures,R(t);(!u||u.length>0)&&(u=[])}else y=w,(!u||u.length>0)&&(u=[]);return R(t)}unpackMultiple(e,t){let r,n=0;try{T=!0;let i=e.length,o=this?this.unpack(e,i):le.unpack(e,i);if(!t){for(r=[o];a<i;)n=a,r.push(R());return r}if(!1===t(o,n,a))return;for(;a<i;)if(n=a,!1===t(R(),n,a))return}catch(e){throw e.lastPosition=n,e.values=r,e}finally{T=!1,oe()}}_mergeStructures(e,t){k&&(e=k.call(this,e)),e=e||[],Object.isFrozen(e)&&(e=e.map((e=>e.slice(0))));for(let t=0,r=e.length;t<r;t++){let r=e[t];r&&(r.isShared=!0,t>=32&&(r.highByte=t-32>>5))}e.sharedLength=e.length;for(let r in t||[])if(r>=0){let n=e[r],i=t[r];i&&(n&&((e.restoreStructures||(e.restoreStructures=[]))[r]=n),e[r]=i)}return this.structures=e}decode(e,t){return this.unpack(e,t)}}function R(e){try{if(!y.trusted&&!T){let e=u.sharedLength||0;e<u.length&&(u.length=e)}let t;if(y.randomAccessStructure&&i[a]<64&&i[a]>=32&&S?(t=S(i,a,o,y),i=null,e&&e.lazy||!t||(t=t.toJSON()),a=o):t=M(),h&&(a=h.postBundlePosition,h=null),T&&(u.restoreStructures=null),a==o)u&&u.restoreStructures&&O(),u=null,i=null,f&&(f=null);else{if(a>o)throw new Error("Unexpected end of MessagePack data");if(!T){let e;try{e=JSON.stringify(t,((e,t)=>"bigint"==typeof t?`${t}n`:t)).slice(0,100)}catch(t){e="(JSON view not available "+t+")"}throw new Error("Data read, but end of buffer not reached "+e)}}return t}catch(e){throw u&&u.restoreStructures&&O(),oe(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer")||a>o)&&(e.incomplete=!0),e}}function O(){for(let e in u.restoreStructures)u[e]=u.restoreStructures[e];u.restoreStructures=null}function M(){let e=i[a++];if(e<160){if(e<128){if(e<64)return e;{let t=u[63&e]||y.getStructures&&L()[63&e];return t?(t.read||(t.read=x(t,63&e)),t.read()):e}}if(e<144){if(e-=128,y.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=J();"__proto__"===e&&(e="__proto_"),t[e]=M()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(M(),M());return t}}{e-=144;let t=new Array(e);for(let r=0;r<e;r++)t[r]=M();return y.freezeData?Object.freeze(t):t}}if(e<192){let t=e-160;if(v>=a)return c.slice(a-b,(a+=t)-b);if(0==v&&o<140){let e=t<16?$(t):q(t);if(null!=e)return e}return U(t)}{let t;switch(e){case 192:return null;case 193:return h?(t=M(),t>0?h[1].slice(h.position1,h.position1+=t):h[0].slice(h.position0,h.position0-=t)):E;case 194:return!1;case 195:return!0;case 196:if(t=i[a++],void 0===t)throw new Error("Unexpected end of buffer");return G(t);case 197:return t=d.getUint16(a),a+=2,G(t);case 198:return t=d.getUint32(a),a+=4,G(t);case 199:return Q(i[a++]);case 200:return t=d.getUint16(a),a+=2,Q(t);case 201:return t=d.getUint32(a),a+=4,Q(t);case 202:if(t=d.getFloat32(a),y.useFloat32>2){let e=se[(127&i[a])<<1|i[a+1]>>7];return a+=4,(e*t+(t>0?.5:-.5)|0)/e}return a+=4,t;case 203:return t=d.getFloat64(a),a+=8,t;case 204:return i[a++];case 205:return t=d.getUint16(a),a+=2,t;case 206:return t=d.getUint32(a),a+=4,t;case 207:return"number"===y.int64AsType?(t=4294967296*d.getUint32(a),t+=d.getUint32(a+4)):"string"===y.int64AsType?t=d.getBigUint64(a).toString():"auto"===y.int64AsType?(t=d.getBigUint64(a),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=d.getBigUint64(a),a+=8,t;case 208:return d.getInt8(a++);case 209:return t=d.getInt16(a),a+=2,t;case 210:return t=d.getInt32(a),a+=4,t;case 211:return"number"===y.int64AsType?(t=4294967296*d.getInt32(a),t+=d.getUint32(a+4)):"string"===y.int64AsType?t=d.getBigInt64(a).toString():"auto"===y.int64AsType?(t=d.getBigInt64(a),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=d.getBigInt64(a),a+=8,t;case 212:if(t=i[a++],114==t)return Z(63&i[a++]);{let e=m[t];if(e)return e.read?(a++,e.read(M())):e.noBuffer?(a++,e()):e(i.subarray(a,++a));throw new Error("Unknown extension "+t)}case 213:return t=i[a],114==t?(a++,Z(63&i[a++],i[a++])):Q(2);case 214:return Q(4);case 215:return Q(8);case 216:return Q(16);case 217:return t=i[a++],v>=a?c.slice(a-b,(a+=t)-b):N(t);case 218:return t=d.getUint16(a),v>=(a+=2)?c.slice(a-b,(a+=t)-b):j(t);case 219:return t=d.getUint32(a),v>=(a+=4)?c.slice(a-b,(a+=t)-b):D(t);case 220:return t=d.getUint16(a),a+=2,V(t);case 221:return t=d.getUint32(a),a+=4,V(t);case 222:return t=d.getUint16(a),a+=2,z(t);case 223:return t=d.getUint32(a),a+=4,z(t);default:if(e>=224)return e-256;if(void 0===e){let e=new Error("Unexpected end of MessagePack data");throw e.incomplete=!0,e}throw new Error("Unknown MessagePack token "+e)}}}const P=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function x(e,t){function r(){if(r.count++>I){let r=e.read=new Function("r","return function(){return "+(y.freezeData?"Object.freeze":"")+"({"+e.map((e=>"__proto__"===e?"__proto_:r()":P.test(e)?e+":r()":"["+JSON.stringify(e)+"]:r()")).join(",")+"})}")(M);return 0===e.highByte&&(e.read=B(t,e.read)),r()}let n={};for(let t=0,r=e.length;t<r;t++){let r=e[t];"__proto__"===r&&(r="__proto_"),n[r]=M()}return y.freezeData?Object.freeze(n):n}return r.count=0,0===e.highByte?B(t,r):r}const B=(e,t)=>function(){let r=i[a++];if(0===r)return t();let n=e<32?-(e+(r<<5)):e+(r<<5),o=u[n]||L()[n];if(!o)throw new Error("Record id is not defined for "+n);return o.read||(o.read=x(o,e)),o.read()};function L(){let e=ie((()=>(i=null,y.getStructures())));return u=y._mergeStructures(e,u)}var U=W,N=W,j=W,D=W;let F=!1;function W(e){let t;if(e<16&&(t=$(e)))return t;if(e>64&&n)return n.decode(i.subarray(a,a+=e));const r=a+e,o=[];for(t="";a<r;){const e=i[a++];if(128&e)if(192==(224&e)){const t=63&i[a++];o.push((31&e)<<6|t)}else if(224==(240&e)){const t=63&i[a++],r=63&i[a++];o.push((31&e)<<12|t<<6|r)}else if(240==(248&e)){let t=(7&e)<<18|(63&i[a++])<<12|(63&i[a++])<<6|63&i[a++];t>65535&&(t-=65536,o.push(t>>>10&1023|55296),t=56320|1023&t),o.push(t)}else o.push(e);else o.push(e);o.length>=4096&&(t+=H.apply(String,o),o.length=0)}return o.length>0&&(t+=H.apply(String,o)),t}function V(e){let t=new Array(e);for(let r=0;r<e;r++)t[r]=M();return y.freezeData?Object.freeze(t):t}function z(e){if(y.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=J();"__proto__"===e&&(e="__proto_"),t[e]=M()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(M(),M());return t}}var H=String.fromCharCode;function q(e){let t=a,r=new Array(e);for(let n=0;n<e;n++){const e=i[a++];if((128&e)>0)return void(a=t);r[n]=e}return H.apply(String,r)}function $(e){if(e<4){if(e<2){if(0===e)return"";{let e=i[a++];return(128&e)>1?void(a-=1):H(e)}}{let t=i[a++],r=i[a++];if((128&t)>0||(128&r)>0)return void(a-=2);if(e<3)return H(t,r);let n=i[a++];return(128&n)>0?void(a-=3):H(t,r,n)}}{let t=i[a++],r=i[a++],n=i[a++],o=i[a++];if((128&t)>0||(128&r)>0||(128&n)>0||(128&o)>0)return void(a-=4);if(e<6){if(4===e)return H(t,r,n,o);{let e=i[a++];return(128&e)>0?void(a-=5):H(t,r,n,o,e)}}if(e<8){let s=i[a++],l=i[a++];if((128&s)>0||(128&l)>0)return void(a-=6);if(e<7)return H(t,r,n,o,s,l);let u=i[a++];return(128&u)>0?void(a-=7):H(t,r,n,o,s,l,u)}{let s=i[a++],l=i[a++],u=i[a++],c=i[a++];if((128&s)>0||(128&l)>0||(128&u)>0||(128&c)>0)return void(a-=8);if(e<10){if(8===e)return H(t,r,n,o,s,l,u,c);{let e=i[a++];return(128&e)>0?void(a-=9):H(t,r,n,o,s,l,u,c,e)}}if(e<12){let h=i[a++],f=i[a++];if((128&h)>0||(128&f)>0)return void(a-=10);if(e<11)return H(t,r,n,o,s,l,u,c,h,f);let d=i[a++];return(128&d)>0?void(a-=11):H(t,r,n,o,s,l,u,c,h,f,d)}{let h=i[a++],f=i[a++],d=i[a++],p=i[a++];if((128&h)>0||(128&f)>0||(128&d)>0||(128&p)>0)return void(a-=12);if(e<14){if(12===e)return H(t,r,n,o,s,l,u,c,h,f,d,p);{let e=i[a++];return(128&e)>0?void(a-=13):H(t,r,n,o,s,l,u,c,h,f,d,p,e)}}{let g=i[a++],y=i[a++];if((128&g)>0||(128&y)>0)return void(a-=14);if(e<15)return H(t,r,n,o,s,l,u,c,h,f,d,p,g,y);let b=i[a++];return(128&b)>0?void(a-=15):H(t,r,n,o,s,l,u,c,h,f,d,p,g,y,b)}}}}}function K(){let e,t=i[a++];if(t<192)e=t-160;else switch(t){case 217:e=i[a++];break;case 218:e=d.getUint16(a),a+=2;break;case 219:e=d.getUint32(a),a+=4;break;default:throw new Error("Expected string")}return W(e)}function G(e){return y.copyBuffers?Uint8Array.prototype.slice.call(i,a,a+=e):i.subarray(a,a+=e)}function Q(e){let t=i[a++];if(m[t]){let r;return m[t](i.subarray(a,r=a+=e),(e=>{a=e;try{return M()}finally{a=r}}))}throw new Error("Unknown extension type "+t)}var Y=new Array(4096);function J(){let e=i[a++];if(!(e>=160&&e<192))return a--,X(M());if(e-=160,v>=a)return c.slice(a-b,(a+=e)-b);if(!(0==v&&o<180))return U(e);let t,r=4095&(e<<5^(e>1?d.getUint16(a):e>0?i[a]:0)),n=Y[r],s=a,l=a+e-3,u=0;if(n&&n.bytes==e){for(;s<l;){if(t=d.getUint32(s),t!=n[u++]){s=1879048192;break}s+=4}for(l+=3;s<l;)if(t=i[s++],t!=n[u++]){s=1879048192;break}if(s===l)return a=s,n.string;l-=3,s=a}for(n=[],Y[r]=n,n.bytes=e;s<l;)t=d.getUint32(s),n.push(t),s+=4;for(l+=3;s<l;)t=i[s++],n.push(t);let h=e<16?$(e):q(e);return n.string=null!=h?h:U(e)}function X(e){if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e||"bigint"==typeof e)return e.toString();if(null==e)return e+"";throw new Error("Invalid property type for record",typeof e)}const Z=(e,t)=>{let r=M().map(X),n=e;void 0!==t&&(e=e<32?-((t<<5)+e):(t<<5)+e,r.highByte=t);let i=u[e];return i&&(i.isShared||T)&&((u.restoreStructures||(u.restoreStructures=[]))[e]=i),u[e]=r,r.read=x(r,n),r.read()};m[0]=()=>{},m[0].noBuffer=!0,m[66]=e=>{let t=e.length,r=BigInt(128&e[0]?e[0]-256:e[0]);for(let n=1;n<t;n++)r<<=8n,r+=BigInt(e[n]);return r};let ee={Error,TypeError,ReferenceError};m[101]=()=>{let e=M();return(ee[e[0]]||Error)(e[1],{cause:e[2]})},m[105]=e=>{if(!1===y.structuredClone)throw new Error("Structured clone extension is disabled");let t=d.getUint32(a-4);f||(f=new Map);let r,n=i[a];r=n>=144&&n<160||220==n||221==n?[]:{};let o={target:r};f.set(t,o);let s=M();return o.used?Object.assign(r,s):(o.target=s,s)},m[112]=e=>{if(!1===y.structuredClone)throw new Error("Structured clone extension is disabled");let t=d.getUint32(a-4),r=f.get(t);return r.used=!0,r.target},m[115]=()=>new Set(M());const te=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map((e=>e+"Array"));let re="object"==typeof globalThis?globalThis:window;m[116]=e=>{let t=e[0],r=te[t];if(!r){if(16===t){let t=new ArrayBuffer(e.length-1);return new Uint8Array(t).set(e.subarray(1)),t}throw new Error("Could not find typed array for code "+t)}return new re[r](Uint8Array.prototype.slice.call(e,1).buffer)},m[120]=()=>{let e=M();return new RegExp(e[0],e[1])};const ne=[];function ie(e){A&&A();let t=o,r=a,n=g,s=b,l=v,m=c,w=p,_=f,E=h,S=new Uint8Array(i.slice(0,o)),k=u,I=u.slice(0,u.length),C=y,R=T,O=e();return o=t,a=r,g=n,b=s,v=l,c=m,p=w,f=_,h=E,i=S,T=R,(u=k).splice(0,u.length,...I),y=C,d=new DataView(i.buffer,i.byteOffset,i.byteLength),O}function oe(){i=null,f=null,u=null}m[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],r=a;return a+=t-e.length,h=ne,(h=[K(),K()]).position0=0,h.position1=0,h.postBundlePosition=a,a=r,M()},m[255]=e=>4==e.length?new Date(1e3*(16777216*e[0]+(e[1]<<16)+(e[2]<<8)+e[3])):8==e.length?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+1e3*(4294967296*(3&e[3])+16777216*e[4]+(e[5]<<16)+(e[6]<<8)+e[7])):12==e.length?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+1e3*((128&e[4]?-281474976710656:0)+1099511627776*e[6]+4294967296*e[7]+16777216*e[8]+(e[9]<<16)+(e[10]<<8)+e[11])):new Date("invalid");const se=new Array(147);for(let e=0;e<256;e++)se[e]=+("1e"+Math.floor(45.15-.30103*e));const ae=C;var le=new C({useRecords:!1});const ue=le.unpack,ce=le.unpackMultiple,he=le.unpack,fe={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let de=new Float32Array(1),pe=new Uint8Array(de.buffer,0,4);function ge(e){de[0]=e;let t=se[(127&pe[3])<<1|pe[2]>>7];return(t*e+(e>0?.5:-.5)|0)/t}var ye=r(8287).hp;let be,ve,me;try{be=new TextEncoder}catch(e){}const we=void 0!==ye,_e=we?function(e){return ye.allocUnsafeSlow(e)}:Uint8Array,Ee=we?ye:Uint8Array,Se=we?4294967296:2144337920;let ke,Ae,Te,Ie,Ce,Re=0,Oe=null;const Me=/[\u0080-\uFFFF]/,Pe=Symbol("record-id");class xe extends C{constructor(e){let t,r,n,i;super(e),this.offset=0;let o=Ee.prototype.utf8Write?function(e,t){return ke.utf8Write(e,t,4294967295)}:!(!be||!be.encodeInto)&&function(e,t){return be.encodeInto(e,ke.subarray(t)).written},s=this;e||(e={});let a=e&&e.sequential,l=e.structures||e.saveStructures,u=e.maxSharedStructures;if(null==u&&(u=l?32:0),u>8160)throw new Error("Maximum maxSharedStructure is 8160");e.structuredClone&&null==e.moreTypes&&(this.moreTypes=!0);let c=e.maxOwnStructures;null==c&&(c=l?32:64),this.structures||0==e.useRecords||(this.structures=[]);let h=u>32||c+u>64,f=u+64,d=u+c+64;if(d>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let p=[],g=0,y=0;this.pack=this.encode=function(e,o){if(ke||(ke=new _e(8192),Te=ke.dataView||(ke.dataView=new DataView(ke.buffer,0,8192)),Re=0),Ie=ke.length-10,Ie-Re<2048?(ke=new _e(ke.length),Te=ke.dataView||(ke.dataView=new DataView(ke.buffer,0,ke.length)),Ie=ke.length-10,Re=0):Re=Re+7&2147483640,t=Re,o&Ye&&(Re+=255&o),i=s.structuredClone?new Map:null,s.bundleStrings&&"string"!=typeof e?(Oe=[],Oe.size=1/0):Oe=null,n=s.structures,n){n.uninitialized&&(n=s._mergeStructures(s.getStructures()));let e=n.sharedLength||0;if(e>u)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+n.sharedLength);if(!n.transitions){n.transitions=Object.create(null);for(let t=0;t<e;t++){let e=n[t];if(!e)continue;let r,i=n.transitions;for(let t=0,n=e.length;t<n;t++){let n=e[t];r=i[n],r||(r=i[n]=Object.create(null)),i=r}i[Pe]=t+64}this.lastNamedStructuresLength=e}a||(n.nextId=e+64)}let l;r&&(r=!1);try{s.randomAccessStructure&&e&&e.constructor&&e.constructor===Object?I(e):m(e);let r=Oe;if(Oe&&Ne(t,m,0),i&&i.idsToInsert){let e=i.idsToInsert.sort(((e,t)=>e.offset>t.offset?1:-1)),n=e.length,o=-1;for(;r&&n>0;){let i=e[--n].offset+t;i<r.stringsPosition+t&&-1===o&&(o=0),i>r.position+t?o>=0&&(o+=6):(o>=0&&(Te.setUint32(r.position+t,Te.getUint32(r.position+t)+o),o=-1),r=r.previous,n++)}o>=0&&r&&Te.setUint32(r.position+t,Te.getUint32(r.position+t)+o),Re+=6*e.length,Re>Ie&&k(Re),s.offset=Re;let a=function(e,t){let r,n=6*t.length,i=e.length-n;for(;r=t.pop();){let t=r.offset,o=r.id;e.copyWithin(t+n,t,i),n-=6;let s=t+n;e[s++]=214,e[s++]=105,e[s++]=o>>24,e[s++]=o>>16&255,e[s++]=o>>8&255,e[s++]=255&o,i=t}return e}(ke.subarray(t,Re),e);return i=null,a}return s.offset=Re,o&Ge?(ke.start=t,ke.end=Re,ke):ke.subarray(t,Re)}catch(e){throw l=e,e}finally{if(n&&(b(),r&&s.saveStructures)){let r=n.sharedLength||0,i=ke.subarray(t,Re),a=De(n,s);if(!l)return!1===s.saveStructures(a,a.isCompatible)?s.pack(e,o):(s.lastNamedStructuresLength=r,ke.length>1073741824&&(ke=null),i)}ke.length>1073741824&&(ke=null),o&Qe&&(Re=t)}};const b=()=>{y<10&&y++;let e=n.sharedLength||0;if(n.length>e&&!a&&(n.length=e),g>1e4)n.transitions=null,y=0,g=0,p.length>0&&(p=[]);else if(p.length>0&&!a){for(let e=0,t=p.length;e<t;e++)p[e][Pe]=0;p=[]}},v=e=>{var t=e.length;t<16?ke[Re++]=144|t:t<65536?(ke[Re++]=220,ke[Re++]=t>>8,ke[Re++]=255&t):(ke[Re++]=221,Te.setUint32(Re,t),Re+=4);for(let r=0;r<t;r++)m(e[r])},m=e=>{Re>Ie&&(ke=k(Re));var r,n=typeof e;if("string"===n){let n,i=e.length;if(Oe&&i>=4&&i<4096){if((Oe.size+=i)>21760){let e,r,n=(Oe[0]?3*Oe[0].length+Oe[1].length:0)+10;Re+n>Ie&&(ke=k(Re+n)),Oe.position?(r=Oe,ke[Re]=200,Re+=3,ke[Re++]=98,e=Re-t,Re+=4,Ne(t,m,0),Te.setUint16(e+t-3,Re-t-e)):(ke[Re++]=214,ke[Re++]=98,e=Re-t,Re+=4),Oe=["",""],Oe.previous=r,Oe.size=0,Oe.position=e}let r=Me.test(e);return Oe[r?0:1]+=e,ke[Re++]=193,void m(r?-i:i)}n=i<32?1:i<256?2:i<65536?3:5;let s=3*i;if(Re+s>Ie&&(ke=k(Re+s)),i<64||!o){let t,o,s,a=Re+n;for(t=0;t<i;t++)o=e.charCodeAt(t),o<128?ke[a++]=o:o<2048?(ke[a++]=o>>6|192,ke[a++]=63&o|128):55296==(64512&o)&&56320==(64512&(s=e.charCodeAt(t+1)))?(o=65536+((1023&o)<<10)+(1023&s),t++,ke[a++]=o>>18|240,ke[a++]=o>>12&63|128,ke[a++]=o>>6&63|128,ke[a++]=63&o|128):(ke[a++]=o>>12|224,ke[a++]=o>>6&63|128,ke[a++]=63&o|128);r=a-Re-n}else r=o(e,Re+n);r<32?ke[Re++]=160|r:r<256?(n<2&&ke.copyWithin(Re+2,Re+1,Re+1+r),ke[Re++]=217,ke[Re++]=r):r<65536?(n<3&&ke.copyWithin(Re+3,Re+2,Re+2+r),ke[Re++]=218,ke[Re++]=r>>8,ke[Re++]=255&r):(n<5&&ke.copyWithin(Re+5,Re+3,Re+3+r),ke[Re++]=219,Te.setUint32(Re,r),Re+=4),Re+=r}else if("number"===n)if(e>>>0===e)e<32||e<128&&!1===this.useRecords||e<64&&!this.randomAccessStructure?ke[Re++]=e:e<256?(ke[Re++]=204,ke[Re++]=e):e<65536?(ke[Re++]=205,ke[Re++]=e>>8,ke[Re++]=255&e):(ke[Re++]=206,Te.setUint32(Re,e),Re+=4);else if((e|0)===e)e>=-32?ke[Re++]=256+e:e>=-128?(ke[Re++]=208,ke[Re++]=e+256):e>=-32768?(ke[Re++]=209,Te.setInt16(Re,e),Re+=2):(ke[Re++]=210,Te.setInt32(Re,e),Re+=4);else{let t;if((t=this.useFloat32)>0&&e<4294967296&&e>=-2147483648){let r;if(ke[Re++]=202,Te.setFloat32(Re,e),t<4||((r=e*se[(127&ke[Re])<<1|ke[Re+1]>>7])|0)===r)return void(Re+=4);Re--}ke[Re++]=203,Te.setFloat64(Re,e),Re+=8}else if("object"===n||"function"===n)if(e){if(i){let r=i.get(e);if(r){if(!r.id){let e=i.idsToInsert||(i.idsToInsert=[]);r.id=e.push(r)}return ke[Re++]=214,ke[Re++]=112,Te.setUint32(Re,r.id),void(Re+=4)}i.set(e,{offset:Re-t})}let o=e.constructor;if(o===Object)S(e);else if(o===Array)v(e);else if(o===Map)if(this.mapAsEmptyObject)ke[Re++]=128;else{(r=e.size)<16?ke[Re++]=128|r:r<65536?(ke[Re++]=222,ke[Re++]=r>>8,ke[Re++]=255&r):(ke[Re++]=223,Te.setUint32(Re,r),Re+=4);for(let[t,r]of e)m(t),m(r)}else{for(let t=0,r=ve.length;t<r;t++){if(e instanceof me[t]){let r=ve[t];if(r.write){r.type&&(ke[Re++]=212,ke[Re++]=r.type,ke[Re++]=0);let t=r.write.call(this,e);return void(t===e?Array.isArray(e)?v(e):S(e):m(t))}let n,i=ke,o=Te,s=Re;ke=null;try{n=r.pack.call(this,e,(e=>(ke=i,i=null,Re+=e,Re>Ie&&k(Re),{target:ke,targetView:Te,position:Re-e})),m)}finally{i&&(ke=i,Te=o,Re=s,Ie=ke.length-10)}return void(n&&(n.length+Re>Ie&&k(n.length+Re),Re=Ue(n,ke,Re,r.type)))}}if(Array.isArray(e))v(e);else{if(e.toJSON){const t=e.toJSON();if(t!==e)return m(t)}if("function"===n)return m(this.writeFunction&&this.writeFunction(e));S(e)}}}else ke[Re++]=192;else if("boolean"===n)ke[Re++]=e?195:194;else if("bigint"===n){if(e<BigInt(1)<<BigInt(63)&&e>=-(BigInt(1)<<BigInt(63)))ke[Re++]=211,Te.setBigInt64(Re,e);else if(e<BigInt(1)<<BigInt(64)&&e>0)ke[Re++]=207,Te.setBigUint64(Re,e);else{if(!this.largeBigIntToFloat){if(this.useBigIntExtension&&e<2n**1023n&&e>-(2n**1023n)){ke[Re++]=199,Re++,ke[Re++]=66;let t,r=[];do{let n=0xffn&e;t=(0x80n&n)===(e<0n?0x80n:0n),r.push(n),e>>=8n}while(0n!==e&&-1n!==e||!t);ke[Re-2]=r.length;for(let e=r.length;e>0;)ke[Re++]=Number(r[--e]);return}throw new RangeError(e+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension or set largeBigIntToFloat to convert to float-64")}ke[Re++]=203,Te.setFloat64(Re,Number(e))}Re+=8}else{if("undefined"!==n)throw new Error("Unknown type: "+n);this.encodeUndefinedAsNil?ke[Re++]=192:(ke[Re++]=212,ke[Re++]=0,ke[Re++]=0)}},w=this.variableMapSize||this.coercibleKeyAsNumber?e=>{let t,r=Object.keys(e),n=r.length;if(n<16?ke[Re++]=128|n:n<65536?(ke[Re++]=222,ke[Re++]=n>>8,ke[Re++]=255&n):(ke[Re++]=223,Te.setUint32(Re,n),Re+=4),this.coercibleKeyAsNumber)for(let i=0;i<n;i++){t=r[i];let n=Number(t);m(isNaN(n)?t:n),m(e[t])}else for(let i=0;i<n;i++)m(t=r[i]),m(e[t])}:e=>{ke[Re++]=222;let r=Re-t;Re+=2;let n=0;for(let t in e)("function"!=typeof e.hasOwnProperty||e.hasOwnProperty(t))&&(m(t),m(e[t]),n++);ke[r+++t]=n>>8,ke[r+t]=255&n},_=!1===this.useRecords?w:e.progressiveRecords&&!h?e=>{let r,i,o=n.transitions||(n.transitions=Object.create(null)),s=Re++-t;for(let a in e)if("function"!=typeof e.hasOwnProperty||e.hasOwnProperty(a)){if(r=o[a],r)o=r;else{let l=Object.keys(e),u=o;o=n.transitions;let c=0;for(let e=0,t=l.length;e<t;e++){let t=l[e];r=o[t],r||(r=o[t]=Object.create(null),c++),o=r}s+t+1==Re?(Re--,A(o,l,c)):T(o,l,s,c),i=!0,o=u[a]}m(e[a])}if(!i){let r=o[Pe];r?ke[s+t]=r:T(o,Object.keys(e),s,0)}}:e=>{let t,r=n.transitions||(n.transitions=Object.create(null)),i=0;for(let n in e)("function"!=typeof e.hasOwnProperty||e.hasOwnProperty(n))&&(t=r[n],t||(t=r[n]=Object.create(null),i++),r=t);let o=r[Pe];o?o>=96&&h?(ke[Re++]=96+(31&(o-=96)),ke[Re++]=o>>5):ke[Re++]=o:A(r,r.__keys__||Object.keys(e),i);for(let t in e)("function"!=typeof e.hasOwnProperty||e.hasOwnProperty(t))&&m(e[t])},E="function"==typeof this.useRecords&&this.useRecords,S=E?e=>{E(e)?_(e):w(e)}:_,k=e=>{let r;if(e>16777216){if(e-t>Se)throw new Error("Packed buffer would be larger than maximum buffer size");r=Math.min(Se,4096*Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096))}else r=1+(Math.max(e-t<<2,ke.length-1)>>12)<<12;let n=new _e(r);return Te=n.dataView||(n.dataView=new DataView(n.buffer,0,r)),e=Math.min(e,ke.length),ke.copy?ke.copy(n,0,t,e):n.set(ke.slice(t,e)),Re-=t,t=0,Ie=n.length-10,ke=n},A=(e,t,i)=>{let o=n.nextId;o||(o=64),o<f&&this.shouldShareStructure&&!this.shouldShareStructure(t)?(o=n.nextOwnId,o<d||(o=f),n.nextOwnId=o+1):(o>=d&&(o=f),n.nextId=o+1);let s=t.highByte=o>=96&&h?o-96>>5:-1;e[Pe]=o,e.__keys__=t,n[o-64]=t,o<f?(t.isShared=!0,n.sharedLength=o-63,r=!0,s>=0?(ke[Re++]=96+(31&o),ke[Re++]=s):ke[Re++]=o):(s>=0?(ke[Re++]=213,ke[Re++]=114,ke[Re++]=96+(31&o),ke[Re++]=s):(ke[Re++]=212,ke[Re++]=114,ke[Re++]=o),i&&(g+=y*i),p.length>=c&&(p.shift()[Pe]=0),p.push(e),m(t))},T=(e,r,n,i)=>{let o=ke,s=Re,a=Ie,l=t;ke=Ae,Re=0,t=0,ke||(Ae=ke=new _e(8192)),Ie=ke.length-10,A(e,r,i),Ae=ke;let u=Re;if(ke=o,Re=s,Ie=a,t=l,u>1){let e=Re+u-1;e>Ie&&k(e);let r=n+t;ke.copyWithin(r+u,r+1,Re),ke.set(Ae.slice(0,u),r),Re=e}else ke[n+t]=Ae[0]},I=e=>{let i=Ce(e,ke,t,Re,n,k,((e,t,n)=>{if(n)return r=!0;Re=t;let i=ke;return m(e),b(),i!==ke?{position:Re,targetView:Te,target:ke}:Re}),this);if(0===i)return S(e);Re=i}}useBuffer(e){ke=e,Te=new DataView(ke.buffer,ke.byteOffset,ke.byteLength),Re=0}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}function Be(e,t,r,n){let i=e.byteLength;if(i+1<256){var{target:o,position:s}=r(4+i);o[s++]=199,o[s++]=i+1}else if(i+1<65536){var{target:o,position:s}=r(5+i);o[s++]=200,o[s++]=i+1>>8,o[s++]=i+1&255}else{var{target:o,position:s,targetView:a}=r(7+i);o[s++]=201,a.setUint32(s,i+1),s+=4}o[s++]=116,o[s++]=t,e.buffer||(e=new Uint8Array(e)),o.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),s)}function Le(e,t){let r=e.byteLength;var n,i;if(r<256){var{target:n,position:i}=t(r+2);n[i++]=196,n[i++]=r}else if(r<65536){var{target:n,position:i}=t(r+3);n[i++]=197,n[i++]=r>>8,n[i++]=255&r}else{var{target:n,position:i,targetView:o}=t(r+5);n[i++]=198,o.setUint32(i,r),i+=4}n.set(e,i)}function Ue(e,t,r,n){let i=e.length;switch(i){case 1:t[r++]=212;break;case 2:t[r++]=213;break;case 4:t[r++]=214;break;case 8:t[r++]=215;break;case 16:t[r++]=216;break;default:i<256?(t[r++]=199,t[r++]=i):i<65536?(t[r++]=200,t[r++]=i>>8,t[r++]=255&i):(t[r++]=201,t[r++]=i>>24,t[r++]=i>>16&255,t[r++]=i>>8&255,t[r++]=255&i)}return t[r++]=n,t.set(e,r),r+=i}function Ne(e,t,r){if(Oe.length>0){Te.setUint32(Oe.position+e,Re+r-Oe.position-e),Oe.stringsPosition=Re-e;let n=Oe;Oe=null,t(n[0]),t(n[1])}}function je(e){if(e.Class){if(!e.pack&&!e.write)throw new Error("Extension has no pack or write function");if(e.pack&&!e.type)throw new Error("Extension has no type (numeric code to identify the extension)");me.unshift(e.Class),ve.unshift(e)}!function(e){e.unpack?m[e.type]=e.unpack:m[e.type]=e}(e)}function De(e,t){return e.isCompatible=e=>{let r=!e||(t.lastNamedStructuresLength||0)===e.length;return r||t._mergeStructures(e),r},e}me=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,_],ve=[{pack(e,t,r){let n=e.getTime()/1e3;if((this.useTimestamp32||0===e.getMilliseconds())&&n>=0&&n<4294967296){let{target:e,targetView:r,position:i}=t(6);e[i++]=214,e[i++]=255,r.setUint32(i,n)}else if(n>0&&n<4294967296){let{target:r,targetView:i,position:o}=t(10);r[o++]=215,r[o++]=255,i.setUint32(o,4e6*e.getMilliseconds()+(n/1e3/4294967296|0)),i.setUint32(o+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return t(0),r(this.onInvalidDate());let{target:e,targetView:n,position:i}=t(3);e[i++]=212,e[i++]=255,e[i++]=255}else{let{target:r,targetView:i,position:o}=t(15);r[o++]=199,r[o++]=12,r[o++]=255,i.setUint32(o,1e6*e.getMilliseconds()),i.setBigInt64(o+4,BigInt(Math.floor(n)))}}},{pack(e,t,r){if(this.setAsEmptyObject)return t(0),r({});let n=Array.from(e),{target:i,position:o}=t(this.moreTypes?3:0);this.moreTypes&&(i[o++]=212,i[o++]=115,i[o++]=0),r(n)}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=101,n[i++]=0),r([e.name,e.message,e.cause])}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=120,n[i++]=0),r([e.source,e.flags])}},{pack(e,t){this.moreTypes?Be(e,16,t):Le(we?ye.from(e):new Uint8Array(e),t)}},{pack(e,t){let r=e.constructor;r!==Ee&&this.moreTypes?Be(e,te.indexOf(r.name),t):Le(e,t)}},{pack(e,t){let{target:r,position:n}=t(1);r[n]=193}}];let Fe=new xe({useRecords:!1});const We=Fe.pack,Ve=Fe.pack,ze=xe,{NEVER:He,ALWAYS:qe,DECIMAL_ROUND:$e,DECIMAL_FIT:Ke}=fe,Ge=512,Qe=1024,Ye=2048;var Je=r(8287).hp;const Xe=function(e,t={}){if(!e||"object"!=typeof e)throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a promise");const r=new C(t);let n;const i=e=>{let t;n&&(e=Je.concat([n,e]),n=void 0);try{t=r.unpackMultiple(e)}catch(r){if(!r.incomplete)throw r;n=e.slice(r.lastPosition),t=r.values}return t};return"function"==typeof e[Symbol.iterator]?function*(){for(const t of e)yield*i(t)}():"function"==typeof e[Symbol.asyncIterator]?async function*(){for await(const t of e)yield*i(t)}():void 0},Ze=function(e,t={}){if(e&&"object"==typeof e){if("function"==typeof e[Symbol.iterator])return function*(e,t){const r=new xe(t);for(const t of e)yield r.pack(t)}(e,t);if("function"==typeof e.then||"function"==typeof e[Symbol.asyncIterator])return async function*(e,t){const r=new xe(t);for await(const t of e)yield r.pack(t)}(e,t);throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a Promise")}throw new Error("first argument must be an Iterable, Async Iterable, or a Promise for an Async Iterable")},et=!1,tt=!0},6351:e=>{"use strict";e.exports={version:"0.0.2"}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}return r.amdO={},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(7820)})()));
|