UNPKG

@hackler/js-client-sdk

Version:

JavaScript Client(Web Browser) SDK

15 lines (13 loc) 78.9 kB
import{Logger as e,toPayload as t,IdentifiersBuilder as r,IdentifierType as n,HackleInternalClient as o,Decision as i,DecisionReason as a,FeatureFlagDecision as s,DEFAULT_ON_READY_TIMEOUT as u,Workspace as c,logLevels as f,EventProcessor as l}from"@hackler/sdk-core";import{EventEmitter as d}from"events";import{v4 as p}from"uuid"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var h=function(){return h=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},h.apply(this,arguments)},v=[0,8,16,32,64,128,256,512],g=e.log;function y(e,t){return{abort:function(){},responsePromise:new Promise((function(r,n){var o=new XMLHttpRequest;o.open("GET",e),o.onreadystatechange=function(){if(o.readyState===o.DONE){if(0===o.status)return void n(new Error("Request error"));r({statusCode:o.status,body:o.responseText})}},o.setRequestHeader("content-type","application/json"),o.withCredentials=!0,w(o,t),o.send()}))}}function w(e,t){for(var r in t)t.hasOwnProperty(r)&&e.setRequestHeader(r,t[r])}var m=function(){function e(e,t){this.sdkKey=e,this.headers=t.headers,this.dispatchUrl=t.dispatchUrl,this.beaconDispatchUrl=t.beaconDispatchUrl||"",this.useBeacon=t.useBeacon}return e.prototype.dispatch=function(e,t){this._post(e,t)},e.prototype.dispatchXhrOrBeacon=function(e,t){this.useBeacon?this._beacon(e,t):this._post(e,t)},e.prototype._post=function(e,t){var r=this._createRequest(e),n=r.payload,o=r.headers;!function(e,t,r,n){var o=JSON.stringify(t),i=new XMLHttpRequest;i.open("POST",e),i.onreadystatechange=function(){i.readyState===i.DONE&&i.status>=200&&i.status<400&&n(i)},i.setRequestHeader("content-type","application/json"),i.withCredentials=!0,w(i,r),i.send(o)}(this.dispatchUrl,n,o,t)},e.prototype._beacon=function(e,t){var r=this._createRequest(e),n=r.payload,o=r.headers;!function(e,t,r,n){var o=!1;if("undefined"!=typeof window&&(o=window&&window.navigator&&window.navigator.sendBeacon&&!0),o){var i=JSON.stringify(t),a=new URLSearchParams;a.append("sdkName",r["X-HACKLE-SDK-NAME"]),a.append("sdkVersion",r["X-HACKLE-SDK-VERSION"]),a.append("sdkTime",r["X-HACKLE-SDK-TIME"]),a.append("data",i),window.navigator.sendBeacon(e,a),n()}else g.error("Does not support sendBeacon"),n()}(this.beaconDispatchUrl,n,o,t)},e.prototype._createRequest=function(e){var r;return{payload:t(e),headers:h(((r={})["X-HACKLE-SDK-KEY"]=this.sdkKey,r["X-HACKLE-SDK-TIME"]=(new Date).getTime().toString(),r),this.headers)}},e}(),b=function(){function e(){}return e.get=function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}return null},e.set=function(e,t,r,n,o,i){var a="",s="",u="";if(n){var c=function(e){var t=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,r=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,n=e.split("."),o=n[n.length-1];(o.length>4||"com"===o||"org"===o)&&(r=t);var i=e.match(r);return i?i[0]:""}(document.location.hostname);a=c?"; domain=."+c:""}if(r){var f=new Date;f.setTime(f.getTime()+24*r*60*60*1e3),s="; expires="+f.toUTCString()}i&&(o=!0,u="; SameSite=None"),o&&(u+="; secure");var l=e+"="+encodeURIComponent(t)+s+"; path=/"+a+u;return document.cookie=l,l},e.remove=function(t,r){e.set(t,"",-1,r,!1,!1)},e}();var S=function(){function e(){}return e.initialize=function(){b.get("_hackle_hid")||k()},e.reInitialize=function(){k()},e}();function x(){var e=b.get("_hackle_id");if(e)return e;var t=b.get("_hackle_hid");return t||k()}function E(e){b.set("_hackle_id",e,3650,!0)}function A(){b.remove("_hackle_id",!0)}function k(){var e=p();return b.set("_hackle_hid",e,3650,!0),e}var O="model",T="name",R="type",j="vendor",C="version",I="mobile",_="tablet",P=function(){function e(){}return e.parse=function(t){return{browser:e.getBrowser(t),cpu:e.getCPU(t),device:e.getDevice(t),engine:e.getEngine(t),os:e.getOS(t)}},e.getBrowser=function(t){var r={name:void 0,version:void 0,major:void 0};return e.mapper.rgx.call(r,t,e.regexes.browser),r.major=e.util.major(r.version),r},e.getCPU=function(t){var r={architecture:void 0};return e.mapper.rgx.call(r,t,e.regexes.cpu),r},e.getDevice=function(t){var r={model:void 0,type:void 0,vendor:void 0};return e.mapper.rgx.call(r,t,e.regexes.device),r},e.getEngine=function(t){var r={name:void 0,version:void 0};return e.mapper.rgx.call(r,t,e.regexes.os),r},e.getOS=function(t){var r={name:void 0,version:void 0};return e.mapper.rgx.call(r,t,e.regexes.os),r},e.util={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},e.mapper={rgx:function(e,t){for(var r,n,o,i,a,s,u=0;u<t.length&&!a;){var c=t[u],f=t[u+1];for(r=n=0;r<c.length&&!a;)if(a=c[r++].exec(e))for(o=0;o<f.length;o++)s=a[++n],"object"==typeof(i=f[o])&&i.length>0?2==i.length?"function"==typeof i[1]?this[i[0]]=i[1].call(this,s):this[i[0]]=i[1]:3==i.length?"function"!=typeof i[1]||i[1].exec&&i[1].test?this[i[0]]=s?s.replace(i[1],i[2]):void 0:this[i[0]]=s?i[1].call(this,s,i[2]):void 0:4==i.length&&(this[i[0]]=s?i[3].call(this,s.replace(i[1],i[2])):void 0):this[i]=s||void 0;u+=2}},str:function(t,r){for(var n in r)if("object"==typeof r[n]&&r[n].length>0){for(var o=0;o<r[n].length;o++)if(e.util.has(r[n][o],t))return"?"===n?void 0:n}else if(e.util.has(r[n],t))return"?"===n?void 0:n;return t}},e.maps={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},e.regexes={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[T,C],[/(opios)[\/\s]+([\w\.]+)/i],[[T,"Opera Mini"],C],[/\s(opr)\/([\w\.]+)/i],[[T,"Opera"],C],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[T,C],[/(konqueror)\/([\w\.]+)/i],[[T,"Konqueror"],C],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[T,"IE"],C],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[T,"Edge"],C],[/(yabrowser)\/([\w\.]+)/i],[[T,"Yandex"],C],[/(Avast)\/([\w\.]+)/i],[[T,"Avast Secure Browser"],C],[/(AVG)\/([\w\.]+)/i],[[T,"AVG Secure Browser"],C],[/(puffin)\/([\w\.]+)/i],[[T,"Puffin"],C],[/(focus)\/([\w\.]+)/i],[[T,"Firefox Focus"],C],[/(opt)\/([\w\.]+)/i],[[T,"Opera Touch"],C],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[T,"UCBrowser"],C],[/(comodo_dragon)\/([\w\.]+)/i],[[T,/_/g," "],C],[/(windowswechat qbcore)\/([\w\.]+)/i],[[T,"WeChat(Win) Desktop"],C],[/(micromessenger)\/([\w\.]+)/i],[[T,"WeChat"],C],[/(brave)\/([\w\.]+)/i],[[T,"Brave"],C],[/(whale)\/([\w\.]+)/i],[[T,"Whale"],C],[/(qqbrowserlite)\/([\w\.]+)/i],[T,C],[/(QQ)\/([\d\.]+)/i],[T,C],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[T,C],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[T,C],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[T,C],[/(MetaSr)[\/\s]?([\w\.]+)/i],[T],[/(LBBROWSER)/i],[T],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[C,[T,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[C,[T,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[T,C],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[C,[T,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[T,/(.+)/,"$1 WebView"],C],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[T,/(.+(?:g|us))(.+)/,"$1 $2"],C],[/((?:android.+)crmo|crios)\/([\w\.]+)/i,/android.+(chrome)\/([\w\.]+)\s+(?:mobile\s?safari)/i],[[T,"Chrome Mobile"],C],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[C,[T,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[T,"Sailfish Browser"],C],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[T,C],[/(dolfin)\/([\w\.]+)/i],[[T,"Dolphin"],C],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[T,"360 Browser"]],[/(coast)\/([\w\.]+)/i],[[T,"Opera Coast"],C],[/fxios\/([\w\.-]+)/i],[C,[T,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[C,[T,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[C,T],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[T,"GSA"],C],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[T,[C,e.mapper.str,e.maps.browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[T,C],[/(navigator|netscape)\/([\w\.-]+)/i],[[T,"Netscape"],C],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[T,C]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",e.util.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/windows\s(ce|mobile);\sppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[["architecture",/ower/,"",e.util.lowerize]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[["architecture",e.util.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[O,j,[R,_]],[/applecoremedia\/[\w\.]+ \((ipad)/],[O,[j,"Apple"],[R,_]],[/(apple\s{0,1}tv)/i],[[O,"Apple TV"],[j,"Apple"],[R,"smarttv"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[j,O,[R,_]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[O,[j,"Amazon"],[R,_]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[O,e.mapper.str,e.maps.device.amazon.model],[j,"Amazon"],[R,I]],[/android.+aft([bms])\sbuild/i],[O,[j,"Amazon"],[R,"smarttv"]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[O,j,[R,I]],[/\((ip[honed|\s\w*]+);/i],[O,[j,"Apple"],[R,I]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[j,O,[R,I]],[/\(bb10;\s(\w+)/i],[O,[j,"BlackBerry"],[R,I]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[O,[j,"Asus"],[R,_]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[j,"Sony"],[O,"Xperia Tablet"],[R,_]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[O,[j,"Sony"],[R,I]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[j,O,[R,"console"]],[/android.+;\s(shield)\sbuild/i],[O,[j,"Nvidia"],[R,"console"]],[/(playstation\s[34portablevi]+)/i],[O,[j,"Sony"],[R,"console"]],[/(sprint\s(\w+))/i],[[j,e.mapper.str,e.maps.device.sprint.vendor],[O,e.mapper.str,e.maps.device.sprint.model],[R,I]],[/(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[j,[O,/_/g," "],[R,I]],[/(nexus\s9)/i],[O,[j,"HTC"],[R,_]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p|vog-l29|ane-lx1|eml-l29)/i],[O,[j,"Huawei"],[R,I]],[/android.+(bah2?-a?[lw]\d{2})/i],[O,[j,"Huawei"],[R,_]],[/(microsoft);\s(lumia[\s\w]+)/i],[j,O,[R,I]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[O,[j,"Microsoft"],[R,"console"]],[/(kin\.[onetw]{3})/i],[[O,/\./g," "],[j,"Microsoft"],[R,I]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[O,[j,"Motorola"],[R,I]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[O,[j,"Motorola"],[R,_]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[j,e.util.trim],[O,e.util.trim],[R,"smarttv"]],[/hbbtv.+maple;(\d+)/i],[[O,/^/,"SmartTV"],[j,"Samsung"],[R,"smarttv"]],[/\(dtv[\);].+(aquos)/i],[O,[j,"Sharp"],[R,"smarttv"]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[j,"Samsung"],O,[R,_]],[/smart-tv.+(samsung)/i],[j,[R,"smarttv"],O],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[j,"Samsung"],O,[R,I]],[/sie-(\w*)/i],[O,[j,"Siemens"],[R,I]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[j,"Nokia"],O,[R,I]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[O,[j,"Acer"],[R,_]],[/android.+([vl]k\-?\d{3})\s+build/i],[O,[j,"LG"],[R,_]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[j,"LG"],O,[R,_]],[/(lg) netcast\.tv/i],[j,O,[R,"smarttv"]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[O,[j,"LG"],[R,I]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[j,O,[R,_]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[O,[j,"Lenovo"],[R,_]],[/(lenovo)[_\s-]?([\w-]+)/i],[j,O,[R,I]],[/linux;.+((jolla));/i],[j,O,[R,I]],[/((pebble))app\/[\d\.]+\s/i],[j,O,[R,"wearable"]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[j,O,[R,I]],[/crkey/i],[[O,"Chromecast"],[j,"Google"],[R,"smarttv"]],[/android.+;\s(glass)\s\d/i],[O,[j,"Google"],[R,"wearable"]],[/android.+;\s(pixel c)[\s)]/i],[O,[j,"Google"],[R,_]],[/android.+;\s(pixel( [23])?( xl)?)[\s)]/i],[O,[j,"Google"],[R,I]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:a\d|one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[O,/_/g," "],[j,"Xiaomi"],[R,I]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[O,/_/g," "],[j,"Xiaomi"],[R,_]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[O,[j,"Meizu"],[R,I]],[/(mz)-([\w-]{2,})/i],[[j,"Meizu"],O,[R,I]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[O,[j,"OnePlus"],[R,I]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[O,[j,"RCA"],[R,_]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[O,[j,"Dell"],[R,_]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[O,[j,"Verizon"],[R,_]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[j,"Barnes & Noble"],O,[R,_]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[O,[j,"NuVision"],[R,_]],[/android.+;\s(k88)\sbuild/i],[O,[j,"ZTE"],[R,_]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[O,[j,"Swiss"],[R,I]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[O,[j,"Swiss"],[R,_]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[O,[j,"Zeki"],[R,_]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[j,"Dragon Touch"],O,[R,_]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[O,[j,"Insignia"],[R,_]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[O,[j,"NextBook"],[R,_]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[j,"Voice"],O,[R,I]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[j,"LvTel"],O,[R,I]],[/android.+;\s(PH-1)\s/i],[O,[j,"Essential"],[R,I]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[O,[j,"Envizen"],[R,_]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[j,O,[R,_]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[O,[j,"MachSpeed"],[R,_]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[j,O,[R,_]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[O,[j,"Rotor"],[R,_]],[/android.+(KS(.+))\s+build/i],[O,[j,"Amazon"],[R,_]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[j,O,[R,_]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[R,e.util.lowerize],j,O],[/[\s\/\(](smart-?tv)[;\)]/i],[[R,"smarttv"]],[/(android[\w\.\s\-]{0,9});.+build/i],[O,[j,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[C,[T,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[C,[T,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[T,C],[/rv\:([\w\.]{1,9}).+(gecko)/i],[C,T]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[T,C],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[[T,e.mapper.str,e.maps.os.windows],[C,e.mapper.str,e.maps.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[T,"Windows"],[C,e.mapper.str,e.maps.os.windows.version]],[/\((bb)(10);/i],[[T,"BlackBerry"],C],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[T,C],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[T,"Symbian"],C],[/\((series40);/i],[T],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[T,"Firefox OS"],C],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[[T,"Linux"],C],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[T,"Chromium OS"],C],[/(sunos)\s?([\w\.\d]*)/i],[[T,"Solaris"],C],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[[T,"Linux"],C],[/(iphone)(?:.*os\s*([\w]*)\slike\smac|;\sopera)/i],[[T,"iPhone"],[C,/_/g,"."]],[/(ipad)(?:.*os\s*([\w]*)\slike\smac|;\sopera)/i],[[T,"iPad"],[C,/_/g,"."]],[/(haiku)\s(\w+)/i],[T,C],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[C,/_/g,"."],[T,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[T,"Mac"],[C,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[T,C]]},e}(),N=function(){function e(){}return e.generate=function(e){var t,r;if(void 0===e){var n={hostname:"",pathname:"",host:"",search:"",protocol:""};r={navigator:{userAgent:"",vendor:"",languages:[]},document:{location:n,title:""},location:n,screen:{width:"",height:""}}}else r=e;var o=P.parse(r.navigator.userAgent),i=o.browser,a=o.os,s=o.device,u=s.type?"mobile"===s.type?"Mobile":"ETC":"Web",c=(r.location.protocol||"").replace(":",""),f=r.screen,l="";try{l=Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){}return{platform:u||"",browserName:i.name||"",browserMajorVersion:i.major||"",browserVersion:i.version||"",osName:a.name||"",osVersion:a.version||"",deviceModel:s.model||"",deviceType:s.type||"",deviceVendor:s.vendor||"",language:(null===(t=r.navigator.languages)||void 0===t?void 0:t[0])||"",userAgent:r.navigator.userAgent||"",pagePath:r.location.pathname||"",pageTitle:r.document.title||"",host:r.location.host||"",protocol:c,referrer:r.document.referrer||"",queryParameter:r.location.search||"",screenWidth:f.width||"",screenHeight:f.height||"",timeZone:l||""}},e}(),L=function(){function e(){}return e.prototype.resolveOrNull=function(e){var t=this._resolveUser(e);return this._resolveHackleUserOrNull(t)},e.prototype._resolveUser=function(e){return e?"string"==typeof e?{id:e}:e:{id:x()}},e.prototype._resolveHackleUserOrNull=function(e){var t=new r;t.addIdentifiers(e.identifiers||{}),e.id&&t.add(n.ID,e.id),e.userId&&t.add(n.USER,e.userId),t.add(n.DEVICE,e.deviceId||x());var o=t.build();if(0!==Object.keys(o).length)return{identifiers:o,properties:e.properties||{},hackleProperties:this._getHackleProperties()}},e.prototype._getHackleProperties=function(){var e;return"undefined"!=typeof window&&(e=N.generate(window)),e||{}},e}(),M=e.log,D=function(){function e(e,t,r){this.hackleInternalClient=new o(e,t,r),this.hackleUserResolver=new L}return e.prototype.variation=function(e,t,r){return this.variationDetail(e,t,r).variation},e.prototype.variationDetail=function(e,t,r){var n=r||"A";try{var o=this.hackleUserResolver.resolveOrNull(t);return o?this.hackleInternalClient._experiment(e,o,n):i.of(n,a.INVALID_INPUT)}catch(t){return M.error("Unexpected exception while deciding variation for experiment[".concat(e,"]. Returning default variation[").concat(n,"] : ").concat(t)),i.of(n,a.EXCEPTION)}},e.prototype.isFeatureOn=function(e,t){return this.featureFlagDetail(e,t).isOn},e.prototype.featureFlagDetail=function(e,t){try{var r=this.hackleUserResolver.resolveOrNull(t);return r?this.hackleInternalClient._featureFlag(e,r):s.off(a.INVALID_INPUT)}catch(t){return M.error('"Unexpected exception while deciding feature flag['.concat(e,"]. Returning default value[false] : ").concat(t)),s.off(a.EXCEPTION)}},e.prototype.track=function(e,t){M.debug("track event : ".concat(JSON.stringify(e)));var r=this._convertEvent(e),n=this.hackleUserResolver.resolveOrNull(t);n&&this.hackleInternalClient._track(r,n)},e.prototype.trackPageView=function(e){M.debug("tracking page view");var t=this.hackleUserResolver.resolveOrNull(null==e?void 0:e.user);t&&this.hackleInternalClient._track({key:"$page_view"},t)},e.prototype.onReady=function(e,t){void 0===t&&(t=u),this.hackleInternalClient._onReady(e,t)},e.prototype.onInitialized=function(e){return this.hackleInternalClient._onInitialized({timeout:null==e?void 0:e.timeout})},e.prototype.close=function(){M.debug("Hackle Client is closing"),this.hackleInternalClient._close()},e.prototype._convertEvent=function(e){return"string"==typeof e?{key:e}:e},e}(),z=function(){function e(e,t,r,n){var o=this;this.workspace=null,this.sdkKey=e,this.httpGetRequest=t,this.eventEmitter=r,this.isStarted=!1,this.updateInterval=n.updateInterval,this.fetchUrl=n.fetchUrl,this.headers=n.headers,this.readyPromiseResolver=function(){},this.readyPromiseRejecter=function(){},this.readyPromise=new Promise((function(e,t){o.readyPromiseResolver=e,o.readyPromiseRejecter=t})),this.currentTimeout=null,this.errorRetryController=new U,this.currentRequest=null,this.syncOnCurrentRequestComplete=!1,this.isReadyPromiseSettled=!1}return e.prototype.onReady=function(){return this.readyPromise},e.prototype.start=function(){this.isStarted||(this.isStarted=!0,this.errorRetryController.reset(),this.fetch())},e.prototype.stop=function(){return this.isStarted=!1,this.currentTimeout&&(clearTimeout(this.currentTimeout),this.currentTimeout=null),this.currentRequest&&(this.currentRequest.abort(),this.currentRequest=null),Promise.resolve()},e.prototype.get=function(){return this.workspace},e.prototype.scheduleNextUpdate=function(){var e=this,t=this.errorRetryController.getDelay(),r=Math.max(t,this.updateInterval);this.currentTimeout=setTimeout((function(){e.currentRequest?e.syncOnCurrentRequestComplete=!0:e.fetch()}),r)},e.prototype.fetch=function(){var e,t=this,r=((e={})["X-HACKLE-SDK-KEY"]=this.sdkKey,e["X-HACKLE-SDK-TIME"]=(new Date).getTime().toString(),e["X-HACKLE-SDK-NAME"]=this.headers["X-HACKLE-SDK-NAME"],e["X-HACKLE-SDK-VERSION"]=this.headers["X-HACKLE-SDK-VERSION"],e);this.currentRequest=this.httpGetRequest(this.fetchUrl,r);var n=function(){t.onRequestComplete()};this.currentRequest.responsePromise.then((function(e){t.onRequestResolved(e)}),(function(e){t.onRequestRejected(e)})).then(n,n),this.updateInterval>0&&this.scheduleNextUpdate()},e.prototype.onRequestComplete=function(){this.isStarted&&(this.currentRequest=null,this.syncOnCurrentRequestComplete&&this.fetch(),this.syncOnCurrentRequestComplete=!1)},e.prototype.onRequestResolved=function(e){var t=this;if(this.isStarted&&(void 0!==e.statusCode&&e.statusCode>=200&&e.statusCode<400?this.errorRetryController.reset():401===e.statusCode||403===e.statusCode?this.readyPromiseRejecter(new Error("Invalid key provided.")):this.errorRetryController.countError(),e.body)){var r=JSON.parse(e.body);this.workspace||setTimeout((function(){t.eventEmitter.emit("ready")}),0),this.workspace=c.from(r),this.readyPromiseResolver()}},e.prototype.onRequestRejected=function(e){this.isStarted&&(this.errorRetryController.countError(),console.error("Error fetching data",e))},e.prototype.close=function(){this.stop()},e}(),U=function(){function e(){this.errorCount=0}return e.prototype.getDelay=function(){return 0===this.errorCount?0:1e3*v[Math.min(v.length-1,this.errorCount)]+Math.round(1e3*Math.random())},e.prototype.countError=function(){this.errorCount<v.length-1&&this.errorCount++},e.prototype.reset=function(){this.errorCount=0},e}(),B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},F=function(e){return e&&e.Math==Math&&e},K=F("object"==typeof globalThis&&globalThis)||F("object"==typeof window&&window)||F("object"==typeof self&&self)||F("object"==typeof B&&B)||function(){return this}()||Function("return this")(),q={},H=function(e){try{return!!e()}catch(e){return!0}},V=!H((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),G=!H((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),X=G,W=Function.prototype.call,$=X?W.bind(W):function(){return W.apply(W,arguments)},J={},Y={}.propertyIsEnumerable,Z=Object.getOwnPropertyDescriptor,Q=Z&&!Y.call({1:2},1);J.f=Q?function(e){var t=Z(this,e);return!!t&&t.enumerable}:Y;var ee,te,re=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},ne=G,oe=Function.prototype,ie=oe.bind,ae=oe.call,se=ne&&ie.bind(ae,ae),ue=ne?function(e){return e&&se(e)}:function(e){return e&&function(){return ae.apply(e,arguments)}},ce=ue,fe=ce({}.toString),le=ce("".slice),de=function(e){return le(fe(e),8,-1)},pe=ue,he=H,ve=de,ge=K.Object,ye=pe("".split),we=he((function(){return!ge("z").propertyIsEnumerable(0)}))?function(e){return"String"==ve(e)?ye(e,""):ge(e)}:ge,me=K.TypeError,be=function(e){if(null==e)throw me("Can't call method on "+e);return e},Se=we,xe=be,Ee=function(e){return Se(xe(e))},Ae=function(e){return"function"==typeof e},ke=Ae,Oe=function(e){return"object"==typeof e?null!==e:ke(e)},Te=K,Re=Ae,je=function(e){return Re(e)?e:void 0},Ce=function(e,t){return arguments.length<2?je(Te[e]):Te[e]&&Te[e][t]},Ie=ue({}.isPrototypeOf),_e=Ce("navigator","userAgent")||"",Pe=K,Ne=_e,Le=Pe.process,Me=Pe.Deno,De=Le&&Le.versions||Me&&Me.version,ze=De&&De.v8;ze&&(te=(ee=ze.split("."))[0]>0&&ee[0]<4?1:+(ee[0]+ee[1])),!te&&Ne&&(!(ee=Ne.match(/Edge\/(\d+)/))||ee[1]>=74)&&(ee=Ne.match(/Chrome\/(\d+)/))&&(te=+ee[1]);var Ue=te,Be=Ue,Fe=H,Ke=!!Object.getOwnPropertySymbols&&!Fe((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Be&&Be<41})),qe=Ke&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,He=Ce,Ve=Ae,Ge=Ie,Xe=qe,We=K.Object,$e=Xe?function(e){return"symbol"==typeof e}:function(e){var t=He("Symbol");return Ve(t)&&Ge(t.prototype,We(e))},Je=K.String,Ye=function(e){try{return Je(e)}catch(e){return"Object"}},Ze=Ae,Qe=Ye,et=K.TypeError,tt=function(e){if(Ze(e))return e;throw et(Qe(e)+" is not a function")},rt=tt,nt=function(e,t){var r=e[t];return null==r?void 0:rt(r)},ot=$,it=Ae,at=Oe,st=K.TypeError,ut={exports:{}},ct=K,ft=Object.defineProperty,lt=function(e,t){try{ft(ct,e,{value:t,configurable:!0,writable:!0})}catch(r){ct[e]=t}return t},dt=lt,pt=K["__core-js_shared__"]||dt("__core-js_shared__",{}),ht=pt;(ut.exports=function(e,t){return ht[e]||(ht[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.22.7",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.7/LICENSE",source:"https://github.com/zloirock/core-js"});var vt=be,gt=K.Object,yt=function(e){return gt(vt(e))},wt=yt,mt=ue({}.hasOwnProperty),bt=Object.hasOwn||function(e,t){return mt(wt(e),t)},St=ue,xt=0,Et=Math.random(),At=St(1..toString),kt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+At(++xt+Et,36)},Ot=K,Tt=ut.exports,Rt=bt,jt=kt,Ct=Ke,It=qe,_t=Tt("wks"),Pt=Ot.Symbol,Nt=Pt&&Pt.for,Lt=It?Pt:Pt&&Pt.withoutSetter||jt,Mt=function(e){if(!Rt(_t,e)||!Ct&&"string"!=typeof _t[e]){var t="Symbol."+e;Ct&&Rt(Pt,e)?_t[e]=Pt[e]:_t[e]=It&&Nt?Nt(t):Lt(t)}return _t[e]},Dt=$,zt=Oe,Ut=$e,Bt=nt,Ft=function(e,t){var r,n;if("string"===t&&it(r=e.toString)&&!at(n=ot(r,e)))return n;if(it(r=e.valueOf)&&!at(n=ot(r,e)))return n;if("string"!==t&&it(r=e.toString)&&!at(n=ot(r,e)))return n;throw st("Can't convert object to primitive value")},Kt=Mt,qt=K.TypeError,Ht=Kt("toPrimitive"),Vt=function(e,t){if(!zt(e)||Ut(e))return e;var r,n=Bt(e,Ht);if(n){if(void 0===t&&(t="default"),r=Dt(n,e,t),!zt(r)||Ut(r))return r;throw qt("Can't convert object to primitive value")}return void 0===t&&(t="number"),Ft(e,t)},Gt=$e,Xt=function(e){var t=Vt(e,"string");return Gt(t)?t:t+""},Wt=Oe,$t=K.document,Jt=Wt($t)&&Wt($t.createElement),Yt=function(e){return Jt?$t.createElement(e):{}},Zt=Yt,Qt=!V&&!H((function(){return 7!=Object.defineProperty(Zt("div"),"a",{get:function(){return 7}}).a})),er=V,tr=$,rr=J,nr=re,or=Ee,ir=Xt,ar=bt,sr=Qt,ur=Object.getOwnPropertyDescriptor;q.f=er?ur:function(e,t){if(e=or(e),t=ir(t),sr)try{return ur(e,t)}catch(e){}if(ar(e,t))return nr(!tr(rr.f,e,t),e[t])};var cr={},fr=V&&H((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),lr=K,dr=Oe,pr=lr.String,hr=lr.TypeError,vr=function(e){if(dr(e))return e;throw hr(pr(e)+" is not an object")},gr=V,yr=Qt,wr=fr,mr=vr,br=Xt,Sr=K.TypeError,xr=Object.defineProperty,Er=Object.getOwnPropertyDescriptor;cr.f=gr?wr?function(e,t,r){if(mr(e),t=br(t),mr(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var n=Er(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return xr(e,t,r)}:xr:function(e,t,r){if(mr(e),t=br(t),mr(r),yr)try{return xr(e,t,r)}catch(e){}if("get"in r||"set"in r)throw Sr("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Ar=cr,kr=re,Or=V?function(e,t,r){return Ar.f(e,t,kr(1,r))}:function(e,t,r){return e[t]=r,e},Tr={exports:{}},Rr=V,jr=bt,Cr=Function.prototype,Ir=Rr&&Object.getOwnPropertyDescriptor,_r=jr(Cr,"name"),Pr={EXISTS:_r,PROPER:_r&&"something"===function(){}.name,CONFIGURABLE:_r&&(!Rr||Rr&&Ir(Cr,"name").configurable)},Nr=Ae,Lr=pt,Mr=ue(Function.toString);Nr(Lr.inspectSource)||(Lr.inspectSource=function(e){return Mr(e)});var Dr,zr,Ur,Br=Lr.inspectSource,Fr=Ae,Kr=Br,qr=K.WeakMap,Hr=Fr(qr)&&/native code/.test(Kr(qr)),Vr=ut.exports,Gr=kt,Xr=Vr("keys"),Wr=function(e){return Xr[e]||(Xr[e]=Gr(e))},$r={},Jr=Hr,Yr=K,Zr=ue,Qr=Oe,en=Or,tn=bt,rn=pt,nn=Wr,on=$r,an=Yr.TypeError,sn=Yr.WeakMap;if(Jr||rn.state){var un=rn.state||(rn.state=new sn),cn=Zr(un.get),fn=Zr(un.has),ln=Zr(un.set);Dr=function(e,t){if(fn(un,e))throw new an("Object already initialized");return t.facade=e,ln(un,e,t),t},zr=function(e){return cn(un,e)||{}},Ur=function(e){return fn(un,e)}}else{var dn=nn("state");on[dn]=!0,Dr=function(e,t){if(tn(e,dn))throw new an("Object already initialized");return t.facade=e,en(e,dn,t),t},zr=function(e){return tn(e,dn)?e[dn]:{}},Ur=function(e){return tn(e,dn)}}var pn={set:Dr,get:zr,has:Ur,enforce:function(e){return Ur(e)?zr(e):Dr(e,{})},getterFor:function(e){return function(t){var r;if(!Qr(t)||(r=zr(t)).type!==e)throw an("Incompatible receiver, "+e+" required");return r}}},hn=H,vn=Ae,gn=bt,yn=V,wn=Pr.CONFIGURABLE,mn=Br,bn=pn.enforce,Sn=pn.get,xn=Object.defineProperty,En=yn&&!hn((function(){return 8!==xn((function(){}),"length",{value:8}).length})),An=String(String).split("String"),kn=Tr.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!gn(e,"name")||wn&&e.name!==t)&&xn(e,"name",{value:t,configurable:!0}),En&&r&&gn(r,"arity")&&e.length!==r.arity&&xn(e,"length",{value:r.arity});try{r&&gn(r,"constructor")&&r.constructor?yn&&xn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=bn(e);return gn(n,"source")||(n.source=An.join("string"==typeof t?t:"")),e};Function.prototype.toString=kn((function(){return vn(this)&&Sn(this).source||mn(this)}),"toString");var On=Ae,Tn=Or,Rn=Tr.exports,jn=lt,Cn=function(e,t,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:t;return On(r)&&Rn(r,i,n),n.global?o?e[t]=r:jn(t,r):(n.unsafe?e[t]&&(o=!0):delete e[t],o?e[t]=r:Tn(e,t,r)),e},In={},_n=Math.ceil,Pn=Math.floor,Nn=Math.trunc||function(e){var t=+e;return(t>0?Pn:_n)(t)},Ln=function(e){var t=+e;return t!=t||0===t?0:Nn(t)},Mn=Ln,Dn=Math.max,zn=Math.min,Un=function(e,t){var r=Mn(e);return r<0?Dn(r+t,0):zn(r,t)},Bn=Ln,Fn=Math.min,Kn=function(e){return e>0?Fn(Bn(e),9007199254740991):0},qn=function(e){return Kn(e.length)},Hn=Ee,Vn=Un,Gn=qn,Xn=function(e){return function(t,r,n){var o,i=Hn(t),a=Gn(i),s=Vn(n,a);if(e&&r!=r){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((e||s in i)&&i[s]===r)return e||s||0;return!e&&-1}},Wn={includes:Xn(!0),indexOf:Xn(!1)},$n=bt,Jn=Ee,Yn=Wn.indexOf,Zn=$r,Qn=ue([].push),eo=function(e,t){var r,n=Jn(e),o=0,i=[];for(r in n)!$n(Zn,r)&&$n(n,r)&&Qn(i,r);for(;t.length>o;)$n(n,r=t[o++])&&(~Yn(i,r)||Qn(i,r));return i},to=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ro=eo,no=to.concat("length","prototype");In.f=Object.getOwnPropertyNames||function(e){return ro(e,no)};var oo={};oo.f=Object.getOwnPropertySymbols;var io=Ce,ao=In,so=oo,uo=vr,co=ue([].concat),fo=io("Reflect","ownKeys")||function(e){var t=ao.f(uo(e)),r=so.f;return r?co(t,r(e)):t},lo=bt,po=fo,ho=q,vo=cr,go=function(e,t,r){for(var n=po(t),o=vo.f,i=ho.f,a=0;a<n.length;a++){var s=n[a];lo(e,s)||r&&lo(r,s)||o(e,s,i(t,s))}},yo=H,wo=Ae,mo=/#|\.prototype\./,bo=function(e,t){var r=xo[So(e)];return r==Ao||r!=Eo&&(wo(t)?yo(t):!!t)},So=bo.normalize=function(e){return String(e).replace(mo,".").toLowerCase()},xo=bo.data={},Eo=bo.NATIVE="N",Ao=bo.POLYFILL="P",ko=bo,Oo=K,To=q.f,Ro=Or,jo=Cn,Co=lt,Io=go,_o=ko,Po=function(e,t){var r,n,o,i,a,s=e.target,u=e.global,c=e.stat;if(r=u?Oo:c?Oo[s]||Co(s,{}):(Oo[s]||{}).prototype)for(n in t){if(i=t[n],o=e.dontCallGetSet?(a=To(r,n))&&a.value:r[n],!_o(u?n:s+(c?".":"#")+n,e.forced)&&void 0!==o){if(typeof i==typeof o)continue;Io(i,o)}(e.sham||o&&o.sham)&&Ro(i,"sham",!0),jo(r,n,i,e)}},No=!H((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Lo=K,Mo=bt,Do=Ae,zo=yt,Uo=No,Bo=Wr("IE_PROTO"),Fo=Lo.Object,Ko=Fo.prototype,qo=Uo?Fo.getPrototypeOf:function(e){var t=zo(e);if(Mo(t,Bo))return t[Bo];var r=t.constructor;return Do(r)&&t instanceof r?r.prototype:t instanceof Fo?Ko:null},Ho=K,Vo=Ae,Go=Ho.String,Xo=Ho.TypeError,Wo=ue,$o=vr,Jo=function(e){if("object"==typeof e||Vo(e))return e;throw Xo("Can't set "+Go(e)+" as a prototype")},Yo=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Wo(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return $o(r),Jo(n),t?e(r,n):r.__proto__=n,r}}():void 0),Zo={},Qo=eo,ei=to,ti=Object.keys||function(e){return Qo(e,ei)},ri=V,ni=fr,oi=cr,ii=vr,ai=Ee,si=ti;Zo.f=ri&&!ni?Object.defineProperties:function(e,t){ii(e);for(var r,n=ai(t),o=si(t),i=o.length,a=0;i>a;)oi.f(e,r=o[a++],n[r]);return e};var ui,ci=Ce("document","documentElement"),fi=vr,li=Zo,di=to,pi=$r,hi=ci,vi=Yt,gi=Wr("IE_PROTO"),yi=function(){},wi=function(e){return"<script>"+e+"<\/script>"},mi=function(e){e.write(wi("")),e.close();var t=e.parentWindow.Object;return e=null,t},bi=function(){try{ui=new ActiveXObject("htmlfile")}catch(e){}var e,t;bi="undefined"!=typeof document?document.domain&&ui?mi(ui):((t=vi("iframe")).style.display="none",hi.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(wi("document.F=Object")),e.close(),e.F):mi(ui);for(var r=di.length;r--;)delete bi.prototype[di[r]];return bi()};pi[gi]=!0;var Si=Object.create||function(e,t){var r;return null!==e?(yi.prototype=fi(e),r=new yi,yi.prototype=null,r[gi]=e):r=bi(),void 0===t?r:li.f(r,t)},xi=Error,Ei=ue("".replace),Ai=String(xi("zxcasd").stack),ki=/\n\s*at [^:]*:[^\n]*/,Oi=ki.test(Ai),Ti=Oe,Ri=Or,ji=tt,Ci=G,Ii=ue(ue.bind),_i=function(e,t){return ji(e),void 0===t?e:Ci?Ii(e,t):function(){return e.apply(t,arguments)}},Pi={},Ni=Pi,Li=Mt("iterator"),Mi=Array.prototype,Di=function(e){return void 0!==e&&(Ni.Array===e||Mi[Li]===e)},zi={};zi[Mt("toStringTag")]="z";var Ui="[object z]"===String(zi),Bi=K,Fi=Ui,Ki=Ae,qi=de,Hi=Mt("toStringTag"),Vi=Bi.Object,Gi="Arguments"==qi(function(){return arguments}()),Xi=Fi?qi:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Vi(e),Hi))?r:Gi?qi(t):"Object"==(n=qi(t))&&Ki(t.callee)?"Arguments":n},Wi=Xi,$i=nt,Ji=Pi,Yi=Mt("iterator"),Zi=function(e){if(null!=e)return $i(e,Yi)||$i(e,"@@iterator")||Ji[Wi(e)]},Qi=$,ea=tt,ta=vr,ra=Ye,na=Zi,oa=K.TypeError,ia=function(e,t){var r=arguments.length<2?na(e):t;if(ea(r))return ta(Qi(r,e));throw oa(ra(e)+" is not iterable")},aa=$,sa=vr,ua=nt,ca=function(e,t,r){var n,o;sa(e);try{if(!(n=ua(e,"return"))){if("throw"===t)throw r;return r}n=aa(n,e)}catch(e){o=!0,n=e}if("throw"===t)throw r;if(o)throw n;return sa(n),r},fa=_i,la=$,da=vr,pa=Ye,ha=Di,va=qn,ga=Ie,ya=ia,wa=Zi,ma=ca,ba=K.TypeError,Sa=function(e,t){this.stopped=e,this.result=t},xa=Sa.prototype,Ea=function(e,t,r){var n,o,i,a,s,u,c,f=r&&r.that,l=!(!r||!r.AS_ENTRIES),d=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),h=fa(t,f),v=function(e){return n&&ma(n,"normal",e),new Sa(!0,e)},g=function(e){return l?(da(e),p?h(e[0],e[1],v):h(e[0],e[1])):p?h(e,v):h(e)};if(d)n=e;else{if(!(o=wa(e)))throw ba(pa(e)+" is not iterable");if(ha(o)){for(i=0,a=va(e);a>i;i++)if((s=g(e[i]))&&ga(xa,s))return s;return new Sa(!1)}n=ya(e,o)}for(u=n.next;!(c=la(u,n)).done;){try{s=g(c.value)}catch(e){ma(n,"throw",e)}if("object"==typeof s&&s&&ga(xa,s))return s}return new Sa(!1)},Aa=Xi,ka=K.String,Oa=function(e){if("Symbol"===Aa(e))throw TypeError("Cannot convert a Symbol value to a string");return ka(e)},Ta=Oa,Ra=re,ja=!H((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",Ra(1,7)),7!==e.stack)})),Ca=Po,Ia=K,_a=Ie,Pa=qo,Na=Yo,La=go,Ma=Si,Da=Or,za=re,Ua=function(e,t){if(Oi&&"string"==typeof e&&!xi.prepareStackTrace)for(;t--;)e=Ei(e,ki,"");return e},Ba=function(e,t){Ti(t)&&"cause"in t&&Ri(e,"cause",t.cause)},Fa=Ea,Ka=function(e,t){return void 0===e?arguments.length<2?"":t:Ta(e)},qa=ja,Ha=Mt("toStringTag"),Va=Ia.Error,Ga=[].push,Xa=function(e,t){var r,n=arguments.length>2?arguments[2]:void 0,o=_a(Wa,this);Na?r=Na(new Va,o?Pa(this):Wa):(r=o?this:Ma(Wa),Da(r,Ha,"Error")),void 0!==t&&Da(r,"message",Ka(t)),qa&&Da(r,"stack",Ua(r.stack,1)),Ba(r,n);var i=[];return Fa(e,Ga,{that:i}),Da(r,"errors",i),r};Na?Na(Xa,Va):La(Xa,Va,{name:!0});var Wa=Xa.prototype=Ma(Va.prototype,{constructor:za(1,Xa),message:za(1,""),name:za(1,"AggregateError")});Ca({global:!0,constructor:!0,arity:2},{AggregateError:Xa});var $a=Mt,Ja=Si,Ya=cr.f,Za=$a("unscopables"),Qa=Array.prototype;null==Qa[Za]&&Ya(Qa,Za,{configurable:!0,value:Ja(null)});var es,ts,rs,ns=function(e){Qa[Za][e]=!0},os=H,is=Ae,as=qo,ss=Cn,us=Mt("iterator"),cs=!1;[].keys&&("next"in(rs=[].keys())?(ts=as(as(rs)))!==Object.prototype&&(es=ts):cs=!0);var fs=null==es||os((function(){var e={};return es[us].call(e)!==e}));fs&&(es={}),is(es[us])||ss(es,us,(function(){return this}));var ls={IteratorPrototype:es,BUGGY_SAFARI_ITERATORS:cs},ds=cr.f,ps=bt,hs=Mt("toStringTag"),vs=function(e,t,r){e&&!r&&(e=e.prototype),e&&!ps(e,hs)&&ds(e,hs,{configurable:!0,value:t})},gs=ls.IteratorPrototype,ys=Si,ws=re,ms=vs,bs=Pi,Ss=function(){return this},xs=Po,Es=$,As=Ae,ks=function(e,t,r,n){var o=t+" Iterator";return e.prototype=ys(gs,{next:ws(+!n,r)}),ms(e,o,!1),bs[o]=Ss,e},Os=qo,Ts=Yo,Rs=vs,js=Or,Cs=Cn,Is=Pi,_s=Pr.PROPER,Ps=Pr.CONFIGURABLE,Ns=ls.IteratorPrototype,Ls=ls.BUGGY_SAFARI_ITERATORS,Ms=Mt("iterator"),Ds=function(){return this},zs=function(e,t,r,n,o,i,a){ks(r,t,n);var s,u,c,f=function(e){if(e===o&&v)return v;if(!Ls&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new r(this,e)}}return function(){return new r(this)}},l=t+" Iterator",d=!1,p=e.prototype,h=p[Ms]||p["@@iterator"]||o&&p[o],v=!Ls&&h||f(o),g="Array"==t&&p.entries||h;if(g&&(s=Os(g.call(new e)))!==Object.prototype&&s.next&&(Os(s)!==Ns&&(Ts?Ts(s,Ns):As(s[Ms])||Cs(s,Ms,Ds)),Rs(s,l,!0)),_s&&"values"==o&&h&&"values"!==h.name&&(Ps?js(p,"name","values"):(d=!0,v=function(){return Es(h,this)})),o)if(u={values:f("values"),keys:i?v:f("keys"),entries:f("entries")},a)for(c in u)(Ls||d||!(c in p))&&Cs(p,c,u[c]);else xs({target:t,proto:!0,forced:Ls||d},u);return p[Ms]!==v&&Cs(p,Ms,v,{name:o}),Is[t]=v,u},Us=Ee,Bs=ns,Fs=Pi,Ks=pn,qs=cr.f,Hs=zs,Vs=V,Gs=Ks.set,Xs=Ks.getterFor("Array Iterator"),Ws=Hs(Array,"Array",(function(e,t){Gs(this,{type:"Array Iterator",target:Us(e),index:0,kind:t})}),(function(){var e=Xs(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),$s=Fs.Arguments=Fs.Array;if(Bs("keys"),Bs("values"),Bs("entries"),Vs&&"values"!==$s.name)try{qs($s,"name",{value:"values"})}catch(e){}var Js=Xi,Ys=Ui?{}.toString:function(){return"[object "+Js(this)+"]"};Ui||Cn(Object.prototype,"toString",Ys,{unsafe:!0});var Zs="process"==de(K.process),Qs=Ce,eu=cr,tu=V,ru=Mt("species"),nu=function(e){var t=Qs(e),r=eu.f;tu&&t&&!t[ru]&&r(t,ru,{configurable:!0,get:function(){return this}})},ou=Ie,iu=K.TypeError,au=function(e,t){if(ou(t,e))return e;throw iu("Incorrect invocation")},su=ue,uu=H,cu=Ae,fu=Xi,lu=Br,du=function(){},pu=[],hu=Ce("Reflect","construct"),vu=/^\s*(?:class|function)\b/,gu=su(vu.exec),yu=!vu.exec(du),wu=function(e){if(!cu(e))return!1;try{return hu(du,pu,e),!0}catch(e){return!1}},mu=function(e){if(!cu(e))return!1;switch(fu(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return yu||!!gu(vu,lu(e))}catch(e){return!0}};mu.sham=!0;var bu,Su,xu,Eu,Au=!hu||uu((function(){var e;return wu(wu.call)||!wu(Object)||!wu((function(){e=!0}))||e}))?mu:wu,ku=Au,Ou=Ye,Tu=K.TypeError,Ru=vr,ju=function(e){if(ku(e))return e;throw Tu(Ou(e)+" is not a constructor")},Cu=Mt("species"),Iu=function(e,t){var r,n=Ru(e).constructor;return void 0===n||null==(r=Ru(n)[Cu])?t:ju(r)},_u=G,Pu=Function.prototype,Nu=Pu.apply,Lu=Pu.call,Mu="object"==typeof Reflect&&Reflect.apply||(_u?Lu.bind(Nu):function(){return Lu.apply(Nu,arguments)}),Du=ue([].slice),zu=K.TypeError,Uu=/(?:ipad|iphone|ipod).*applewebkit/i.test(_e),Bu=K,Fu=Mu,Ku=_i,qu=Ae,Hu=bt,Vu=H,Gu=ci,Xu=Du,Wu=Yt,$u=function(e,t){if(e<t)throw zu("Not enough arguments");return e},Ju=Uu,Yu=Zs,Zu=Bu.setImmediate,Qu=Bu.clearImmediate,ec=Bu.process,tc=Bu.Dispatch,rc=Bu.Function,nc=Bu.MessageChannel,oc=Bu.String,ic=0,ac={};try{bu=Bu.location}catch(e){}var sc=function(e){if(Hu(ac,e)){var t=ac[e];delete ac[e],t()}},uc=function(e){return function(){sc(e)}},cc=function(e){sc(e.data)},fc=function(e){Bu.postMessage(oc(e),bu.protocol+"//"+bu.host)};Zu&&Qu||(Zu=function(e){$u(arguments.length,1);var t=qu(e)?e:rc(e),r=Xu(arguments,1);return ac[++ic]=function(){Fu(t,void 0,r)},Su(ic),ic},Qu=function(e){delete ac[e]},Yu?Su=function(e){ec.nextTick(uc(e))}:tc&&tc.now?Su=function(e){tc.now(uc(e))}:nc&&!Ju?(Eu=(xu=new nc).port2,xu.port1.onmessage=cc,Su=Ku(Eu.postMessage,Eu)):Bu.addEventListener&&qu(Bu.postMessage)&&!Bu.importScripts&&bu&&"file:"!==bu.protocol&&!Vu(fc)?(Su=fc,Bu.addEventListener("message",cc,!1)):Su="onreadystatechange"in Wu("script")?function(e){Gu.appendChild(Wu("script")).onreadystatechange=function(){Gu.removeChild(this),sc(e)}}:function(e){setTimeout(uc(e),0)});var lc,dc,pc,hc,vc,gc,yc,wc,mc={set:Zu,clear:Qu},bc=K,Sc=/ipad|iphone|ipod/i.test(_e)&&void 0!==bc.Pebble,xc=/web0s(?!.*chrome)/i.test(_e),Ec=K,Ac=_i,kc=q.f,Oc=mc.set,Tc=Uu,Rc=Sc,jc=xc,Cc=Zs,Ic=Ec.MutationObserver||Ec.WebKitMutationObserver,_c=Ec.document,Pc=Ec.process,Nc=Ec.Promise,Lc=kc(Ec,"queueMicrotask"),Mc=Lc&&Lc.value;Mc||(lc=function(){var e,t;for(Cc&&(e=Pc.domain)&&e.exit();dc;){t=dc.fn,dc=dc.next;try{t()}catch(e){throw dc?hc():pc=void 0,e}}pc=void 0,e&&e.enter()},Tc||Cc||jc||!Ic||!_c?!Rc&&Nc&&Nc.resolve?((yc=Nc.resolve(void 0)).constructor=Nc,wc=Ac(yc.then,yc),hc=function(){wc(lc)}):Cc?hc=function(){Pc.nextTick(lc)}:(Oc=Ac(Oc,Ec),hc=function(){Oc(lc)}):(vc=!0,gc=_c.createTextNode(""),new Ic(lc).observe(gc,{characterData:!0}),hc=function(){gc.data=vc=!vc}));var Dc=Mc||function(e){var t={fn:e,next:void 0};pc&&(pc.next=t),dc||(dc=t,hc()),pc=t},zc=K,Uc=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Bc=function(){this.head=null,this.tail=null};Bc.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var Fc=Bc,Kc=K.Promise,qc="object"==typeof window&&"object"!=typeof Deno,Hc=K,Vc=Kc,Gc=Ae,Xc=ko,Wc=Br,$c=Mt,Jc=qc,Yc=Ue;Vc&&Vc.prototype;var Zc=$c("species"),Qc=!1,ef=Gc(Hc.PromiseRejectionEvent),tf=Xc("Promise",(function(){var e=Wc(Vc),t=e!==String(Vc);if(!t&&66===Yc)return!0;if(Yc>=51&&/native code/.test(e))return!1;var r=new Vc((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(r.constructor={})[Zc]=n,!(Qc=r.then((function(){}))instanceof n)||!t&&Jc&&!ef})),rf={CONSTRUCTOR:tf,REJECTION_EVENT:ef,SUBCLASSING:Qc},nf={},of=tt,af=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=of(t),this.reject=of(r)};nf.f=function(e){return new af(e)};var sf,uf,cf,ff=Po,lf=Zs,df=K,pf=$,hf=Cn,vf=Yo,gf=vs,yf=nu,wf=tt,mf=Ae,bf=Oe,Sf=au,xf=Iu,Ef=mc.set,Af=Dc,kf=function(e,t){var r=zc.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))},Of=Uc,Tf=Fc,Rf=pn,jf=Kc,Cf=nf,If=rf.CONSTRUCTOR,_f=rf.REJECTION_EVENT,Pf=rf.SUBCLASSING,Nf=Rf.getterFor("Promise"),Lf=Rf.set,Mf=jf&&jf.prototype,Df=jf,zf=Mf,Uf=df.TypeError,Bf=df.document,Ff=df.process,Kf=Cf.f,qf=Kf,Hf=!!(Bf&&Bf.createEvent&&df.dispatchEvent),Vf=function(e){var t;return!(!bf(e)||!mf(t=e.then))&&t},Gf=function(e,t){var r,n,o,i=t.value,a=1==t.state,s=a?e.ok:e.fail,u=e.resolve,c=e.reject,f=e.domain;try{s?(a||(2===t.rejection&&Yf(t),t.rejection=1),!0===s?r=i:(f&&f.enter(),r=s(i),f&&(f.exit(),o=!0)),r===e.promise?c(Uf("Promise-chain cycle")):(n=Vf(r))?pf(n,r,u,c):u(r)):c(i)}catch(e){f&&!o&&f.exit(),c(e)}},Xf=function(e,t){e.notified||(e.notified=!0,Af((function(){for(var r,n=e.reactions;r=n.get();)Gf(r,e);e.notified=!1,t&&!e.rejection&&$f(e)})))},Wf=function(e,t,r){var n,o;Hf?((n=Bf.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),df.dispatchEvent(n)):n={promise:t,reason:r},!_f&&(o=df["on"+e])?o(n):"unhandledrejection"===e&&kf("Unhandled promise rejection",r)},$f=function(e){pf(Ef,df,(function(){var t,r=e.facade,n=e.value;if(Jf(e)&&(t=Of((function(){lf?Ff.emit("unhandledRejection",n,r):Wf("unhandledrejection",r,n)})),e.rejection=lf||Jf(e)?2:1,t.error))throw t.value}))},Jf=function(e){return 1!==e.rejection&&!e.parent},Yf=function(e){pf(Ef,df,(function(){var t=e.facade;lf?Ff.emit("rejectionHandled",t):Wf("rejectionhandled",t,e.value)}))},Zf=function(e,t,r){return function(n){e(t,n,r)}},Qf=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,Xf(e,!0))},el=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw Uf("Promise can't be resolved itself");var n=Vf(t);n?Af((function(){var r={done:!1};try{pf(n,t,Zf(el,r,e),Zf(Qf,r,e))}catch(t){Qf(r,t,e)}})):(e.value=t,e.state=1,Xf(e,!1))}catch(t){Qf({done:!1},t,e)}}};if(If&&(zf=(Df=function(e){Sf(this,zf),wf(e),pf(sf,this);var t=Nf(this);try{e(Zf(el,t),Zf(Qf,t))}catch(e){Qf(t,e)}}).prototype,(sf=function(e){Lf(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:new Tf,rejection:!1,state:0,value:void 0})}).prototype=hf(zf,"then",(function(e,t){var r=Nf(this),n=Kf(xf(this,Df));return r.parent=!0,n.ok=!mf(e)||e,n.fail=mf(t)&&t,n.domain=lf?Ff.domain:void 0,0==r.state?r.reactions.add(n):Af((function(){Gf(n,r)})),n.promise})),uf=function(){var e=new sf,t=Nf(e);this.promise=e,this.resolve=Zf(el,t),this.reject=Zf(Qf,t)},Cf.f=Kf=function(e){return e===Df||undefined===e?new uf(e):qf(e)},mf(jf)&&Mf!==Object.prototype)){cf=Mf.then,Pf||hf(Mf,"then",(function(e,t){var r=this;return new Df((function(e,t){pf(cf,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete Mf.constructor}catch(e){}vf&&vf(Mf,zf)}ff({global:!0,constructor:!0,wrap:!0,forced:If},{Promise:Df}),gf(Df,"Promise",!1),yf("Promise");var tl=Mt("iterator"),rl=!1;try{var nl=0,ol={next:function(){return{done:!!nl++}},return:function(){rl=!0}};ol[tl]=function(){return this},Array.from(ol,(function(){throw 2}))}catch(e){}var il=function(e,t){if(